Skip to content

Commit f3aba87

Browse files
committed
Try fixing errors
1 parent c055e83 commit f3aba87

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

test/io/test_np.f90

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ subroutine add_array_to_empty(error)
958958
if (allocated(error)) return
959959
select type (typed_array => arrays(1)%array)
960960
class is (t_array_rdp_2)
961-
call check(error, size(typed_array%values), size(input_array), "Array sizes to not match.")
961+
call check(error, size(typed_array%values), size(input_array), "Array sizes do not match.")
962962
if (allocated(error)) return
963963
call check(error, any(abs(typed_array%values - input_array) <= epsilon(1.0_dp)), &
964964
"Precision loss when adding array.")
@@ -987,7 +987,7 @@ subroutine add_two_arrays(error)
987987
if (allocated(error)) return
988988
select type (typed_array => arrays(1)%array)
989989
class is (t_array_rdp_2)
990-
call check(error, size(typed_array%values), size(array_1), "Array sizes to not match.")
990+
call check(error, size(typed_array%values), size(array_1), "Array sizes do not match.")
991991
if (allocated(error)) return
992992
call check(error, any(abs(typed_array%values - array_1) <= epsilon(1.0_dp)), &
993993
"Precision loss when adding array.")
@@ -1007,7 +1007,7 @@ subroutine add_two_arrays(error)
10071007
if (allocated(error)) return
10081008
select type (typed_array => arrays(2)%array)
10091009
class is (t_array_rsp_1)
1010-
call check(error, size(typed_array%values), size(array_2), "Array sizes to not match.")
1010+
call check(error, size(typed_array%values), size(array_2), "Array sizes do not match.")
10111011
if (allocated(error)) return
10121012
call check(error, any(abs(typed_array%values - array_2) <= epsilon(1.0_sp)), &
10131013
"Precision loss when adding array.")
@@ -1036,7 +1036,7 @@ subroutine add_array_custom_name(error)
10361036
if (allocated(error)) return
10371037
select type (typed_array => arrays(1)%array)
10381038
class is (t_array_rdp_2)
1039-
call check(error, size(typed_array%values), size(input_array), "Array sizes to not match.")
1039+
call check(error, size(typed_array%values), size(input_array), "Array sizes do not match.")
10401040
if (allocated(error)) return
10411041
call check(error, any(abs(typed_array%values - input_array) <= epsilon(1.0_dp)), &
10421042
"Precision loss when adding array.")
@@ -1099,6 +1099,7 @@ subroutine npz_save_one_array(error)
10991099
integer :: stat
11001100
real(dp), allocatable :: input_array(:,:)
11011101
character(*), parameter :: output_file = "one_array.npz"
1102+
character(*), parameter :: tmp = temp_dir//"one_array"
11021103

11031104
allocate(input_array(10, 4))
11041105
call random_number(input_array)
@@ -1117,7 +1118,7 @@ subroutine npz_save_one_array(error)
11171118
call delete_file(output_file); return
11181119
end if
11191120

1120-
call load_npz(output_file, arrays_reloaded, stat)
1121+
call load_npz(output_file, arrays_reloaded, stat, tmp_dir=tmp)
11211122
call check(error, stat, "Error loading the npz file.")
11221123
if (allocated(error)) then
11231124
call delete_file(output_file); return
@@ -1128,7 +1129,7 @@ subroutine npz_save_one_array(error)
11281129
end if
11291130
select type (typed_array => arrays_reloaded(1)%array)
11301131
class is (t_array_rdp_2)
1131-
call check(error, size(typed_array%values), size(input_array), "Array sizes to not match.")
1132+
call check(error, size(typed_array%values), size(input_array), "Array sizes do not match.")
11321133
if (allocated(error)) then
11331134
call delete_file(output_file); return
11341135
end if
@@ -1150,15 +1151,18 @@ subroutine npz_save_two_arrays(error)
11501151
integer :: stat
11511152
real(dp), allocatable :: input_array_1(:,:)
11521153
complex(dp), allocatable :: input_array_2(:)
1154+
character(*), parameter :: array_name_1 = "array_1"
1155+
character(*), parameter :: array_name_2 = "array_2"
11531156
character(*), parameter :: output_file = "two_arrays.npz"
1157+
character(*), parameter :: tmp = temp_dir//"two_arrays"
11541158

11551159
allocate(input_array_1(5, 6))
11561160
call random_number(input_array_1)
11571161
input_array_2 = [(1.0_dp, 2.0_dp), (3.0_dp, 4.0_dp), (5.0_dp, 6.0_dp)]
1158-
call add_array(arrays, input_array_1, stat)
1162+
call add_array(arrays, input_array_1, stat, name=array_name_1)
11591163
call check(error, stat, "Error adding array 1 to the list of arrays.")
11601164
if (allocated(error)) return
1161-
call add_array(arrays, input_array_2, stat)
1165+
call add_array(arrays, input_array_2, stat, name=array_name_2)
11621166
call check(error, stat, "Error adding array 2 to the list of arrays.")
11631167
if (allocated(error)) return
11641168
call check(error, size(arrays) == 2, "Wrong array size.")
@@ -1173,7 +1177,7 @@ subroutine npz_save_two_arrays(error)
11731177
call delete_file(output_file); return
11741178
end if
11751179

1176-
call load_npz(output_file, arrays_reloaded, stat)
1180+
call load_npz(output_file, arrays_reloaded, stat, tmp_dir=tmp)
11771181
call check(error, stat, "Error loading npz file.")
11781182
if (allocated(error)) then
11791183
call delete_file(output_file); return
@@ -1185,7 +1189,7 @@ subroutine npz_save_two_arrays(error)
11851189

11861190
select type (typed_array => arrays_reloaded(1)%array)
11871191
class is (t_array_rdp_2)
1188-
call check(error, size(typed_array%values), size(input_array_1), "Array sizes to not match.")
1192+
call check(error, size(typed_array%values), size(input_array_1), "First array does not match in size.")
11891193
if (allocated(error)) then
11901194
call delete_file(output_file); return
11911195
end if
@@ -1200,7 +1204,7 @@ subroutine npz_save_two_arrays(error)
12001204

12011205
select type (typed_array => arrays_reloaded(2)%array)
12021206
class is (t_array_cdp_1)
1203-
call check(error, size(typed_array%values), size(input_array_2), "Array sizes to not match.")
1207+
call check(error, size(typed_array%values), size(input_array_2), "Second array does not match in size.")
12041208
if (allocated(error)) then
12051209
call delete_file(output_file); return
12061210
end if

0 commit comments

Comments
 (0)