mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-11-04 05:03:58 +01:00
fix tests broken due to new dimension of basis_nucleus_index
This commit is contained in:
parent
2e04d5e610
commit
db35b102ed
@ -25,7 +25,7 @@ static int test_write_dset (const char* file_name, const back_end_t backend) {
|
|||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
// write numerical attribute in an empty file
|
// write numerical attribute in an empty file
|
||||||
rc = trexio_write_nucleus_num(file, num);
|
rc = trexio_write_basis_num(file, num);
|
||||||
assert (rc == TREXIO_SUCCESS);
|
assert (rc == TREXIO_SUCCESS);
|
||||||
|
|
||||||
// write numerical (integer) dataset in a file
|
// write numerical (integer) dataset in a file
|
||||||
@ -91,7 +91,7 @@ static int test_read_dset (const char* file_name, const back_end_t backend) {
|
|||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
// read numerical attribute from the file
|
// read numerical attribute from the file
|
||||||
rc = trexio_read_nucleus_num(file, &num);
|
rc = trexio_read_basis_num(file, &num);
|
||||||
assert (rc == TREXIO_SUCCESS);
|
assert (rc == TREXIO_SUCCESS);
|
||||||
assert (num == 12);
|
assert (num == 12);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ static int test_write_dset (const char* file_name, const back_end_t backend) {
|
|||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
// write numerical attribute in an empty file
|
// write numerical attribute in an empty file
|
||||||
rc = trexio_write_nucleus_num(file, num);
|
rc = trexio_write_basis_num(file, num);
|
||||||
assert (rc == TREXIO_SUCCESS);
|
assert (rc == TREXIO_SUCCESS);
|
||||||
|
|
||||||
// write numerical (integer) dataset in a file
|
// write numerical (integer) dataset in a file
|
||||||
@ -91,7 +91,7 @@ static int test_read_dset (const char* file_name, const back_end_t backend) {
|
|||||||
assert (file != NULL);
|
assert (file != NULL);
|
||||||
|
|
||||||
// read numerical attribute from the file
|
// read numerical attribute from the file
|
||||||
rc = trexio_read_nucleus_num(file, &num);
|
rc = trexio_read_basis_num(file, &num);
|
||||||
assert (rc == TREXIO_SUCCESS);
|
assert (rc == TREXIO_SUCCESS);
|
||||||
assert (num == 12);
|
assert (num == 12);
|
||||||
|
|
||||||
|
@ -44,9 +44,9 @@ subroutine test_write(file_name, back_end)
|
|||||||
|
|
||||||
integer :: rc = 1
|
integer :: rc = 1
|
||||||
|
|
||||||
integer :: num
|
integer :: num, basis_num
|
||||||
|
|
||||||
integer :: basis_nucleus_index(12)
|
integer :: basis_nucleus_index(24)
|
||||||
double precision :: charge(12)
|
double precision :: charge(12)
|
||||||
double precision :: coord(3,12)
|
double precision :: coord(3,12)
|
||||||
|
|
||||||
@ -70,7 +70,8 @@ subroutine test_write(file_name, back_end)
|
|||||||
0.00000000d0, 2.47304151d0 , 0.00000000d0 /), &
|
0.00000000d0, 2.47304151d0 , 0.00000000d0 /), &
|
||||||
shape(coord) )
|
shape(coord) )
|
||||||
|
|
||||||
basis_nucleus_index = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 /)
|
basis_num = 24
|
||||||
|
basis_nucleus_index = (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 /)
|
||||||
|
|
||||||
label = [character(len=8) :: 'C', 'Na','C', 'C 66', 'C','C', 'H 99', 'Ru', 'H', 'H', 'H', 'H' ]
|
label = [character(len=8) :: 'C', 'Na','C', 'C 66', 'C','C', 'H 99', 'Ru', 'H', 'H', 'H', 'H' ]
|
||||||
|
|
||||||
@ -104,6 +105,8 @@ subroutine test_write(file_name, back_end)
|
|||||||
deallocate(sym_str)
|
deallocate(sym_str)
|
||||||
call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE POINT GROUP')
|
call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE POINT GROUP')
|
||||||
|
|
||||||
|
rc = trexio_write_basis_num(trex_file, basis_num)
|
||||||
|
call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE BASIS NUM')
|
||||||
|
|
||||||
rc = trexio_write_basis_nucleus_index(trex_file, basis_nucleus_index)
|
rc = trexio_write_basis_nucleus_index(trex_file, basis_nucleus_index)
|
||||||
call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE INDEX')
|
call trexio_assert(rc, TREXIO_SUCCESS, 'SUCCESS WRITE INDEX')
|
||||||
@ -137,9 +140,9 @@ subroutine test_read(file_name, back_end)
|
|||||||
|
|
||||||
integer :: i, j, k, ind, offset, flag
|
integer :: i, j, k, ind, offset, flag
|
||||||
integer :: rc = 1
|
integer :: rc = 1
|
||||||
integer :: num, num_read
|
integer :: num, num_read, basis_num
|
||||||
|
|
||||||
integer :: basis_nucleus_index(12)
|
integer :: basis_nucleus_index(24)
|
||||||
double precision :: charge(12)
|
double precision :: charge(12)
|
||||||
double precision :: coord(3,12)
|
double precision :: coord(3,12)
|
||||||
|
|
||||||
@ -152,6 +155,7 @@ subroutine test_read(file_name, back_end)
|
|||||||
character*(128) :: str
|
character*(128) :: str
|
||||||
|
|
||||||
num = 12
|
num = 12
|
||||||
|
basis_num = 24
|
||||||
|
|
||||||
! ================= START OF TEST ===================== !
|
! ================= START OF TEST ===================== !
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user