@@ -958,7 +958,7 @@ subroutine add_array_to_empty(error)
958
958
if (allocated (error)) return
959
959
select type (typed_array = > arrays(1 )% array)
960
960
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." )
962
962
if (allocated (error)) return
963
963
call check(error, any (abs (typed_array% values - input_array) <= epsilon (1.0_dp )), &
964
964
" Precision loss when adding array." )
@@ -987,7 +987,7 @@ subroutine add_two_arrays(error)
987
987
if (allocated (error)) return
988
988
select type (typed_array = > arrays(1 )% array)
989
989
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." )
991
991
if (allocated (error)) return
992
992
call check(error, any (abs (typed_array% values - array_1) <= epsilon (1.0_dp )), &
993
993
" Precision loss when adding array." )
@@ -1007,7 +1007,7 @@ subroutine add_two_arrays(error)
1007
1007
if (allocated (error)) return
1008
1008
select type (typed_array = > arrays(2 )% array)
1009
1009
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." )
1011
1011
if (allocated (error)) return
1012
1012
call check(error, any (abs (typed_array% values - array_2) <= epsilon (1.0_sp )), &
1013
1013
" Precision loss when adding array." )
@@ -1036,7 +1036,7 @@ subroutine add_array_custom_name(error)
1036
1036
if (allocated (error)) return
1037
1037
select type (typed_array = > arrays(1 )% array)
1038
1038
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." )
1040
1040
if (allocated (error)) return
1041
1041
call check(error, any (abs (typed_array% values - input_array) <= epsilon (1.0_dp )), &
1042
1042
" Precision loss when adding array." )
@@ -1099,6 +1099,7 @@ subroutine npz_save_one_array(error)
1099
1099
integer :: stat
1100
1100
real (dp), allocatable :: input_array(:,:)
1101
1101
character (* ), parameter :: output_file = " one_array.npz"
1102
+ character (* ), parameter :: tmp = temp_dir// " one_array"
1102
1103
1103
1104
allocate (input_array(10 , 4 ))
1104
1105
call random_number (input_array)
@@ -1117,7 +1118,7 @@ subroutine npz_save_one_array(error)
1117
1118
call delete_file(output_file); return
1118
1119
end if
1119
1120
1120
- call load_npz(output_file, arrays_reloaded, stat)
1121
+ call load_npz(output_file, arrays_reloaded, stat, tmp_dir = tmp )
1121
1122
call check(error, stat, " Error loading the npz file." )
1122
1123
if (allocated (error)) then
1123
1124
call delete_file(output_file); return
@@ -1128,7 +1129,7 @@ subroutine npz_save_one_array(error)
1128
1129
end if
1129
1130
select type (typed_array = > arrays_reloaded(1 )% array)
1130
1131
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." )
1132
1133
if (allocated (error)) then
1133
1134
call delete_file(output_file); return
1134
1135
end if
@@ -1150,15 +1151,18 @@ subroutine npz_save_two_arrays(error)
1150
1151
integer :: stat
1151
1152
real (dp), allocatable :: input_array_1(:,:)
1152
1153
complex (dp), allocatable :: input_array_2(:)
1154
+ character (* ), parameter :: array_name_1 = " array_1"
1155
+ character (* ), parameter :: array_name_2 = " array_2"
1153
1156
character (* ), parameter :: output_file = " two_arrays.npz"
1157
+ character (* ), parameter :: tmp = temp_dir// " two_arrays"
1154
1158
1155
1159
allocate (input_array_1(5 , 6 ))
1156
1160
call random_number (input_array_1)
1157
1161
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 )
1159
1163
call check(error, stat, " Error adding array 1 to the list of arrays." )
1160
1164
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 )
1162
1166
call check(error, stat, " Error adding array 2 to the list of arrays." )
1163
1167
if (allocated (error)) return
1164
1168
call check(error, size (arrays) == 2 , " Wrong array size." )
@@ -1173,7 +1177,7 @@ subroutine npz_save_two_arrays(error)
1173
1177
call delete_file(output_file); return
1174
1178
end if
1175
1179
1176
- call load_npz(output_file, arrays_reloaded, stat)
1180
+ call load_npz(output_file, arrays_reloaded, stat, tmp_dir = tmp )
1177
1181
call check(error, stat, " Error loading npz file." )
1178
1182
if (allocated (error)) then
1179
1183
call delete_file(output_file); return
@@ -1185,7 +1189,7 @@ subroutine npz_save_two_arrays(error)
1185
1189
1186
1190
select type (typed_array = > arrays_reloaded(1 )% array)
1187
1191
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 ." )
1189
1193
if (allocated (error)) then
1190
1194
call delete_file(output_file); return
1191
1195
end if
@@ -1200,7 +1204,7 @@ subroutine npz_save_two_arrays(error)
1200
1204
1201
1205
select type (typed_array = > arrays_reloaded(2 )% array)
1202
1206
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 ." )
1204
1208
if (allocated (error)) then
1205
1209
call delete_file(output_file); return
1206
1210
end if
0 commit comments