161 module procedure dctestassertequalchar0
163 module procedure dctestassertequalchar1
165 module procedure dctestassertequalchar2
167 module procedure dctestassertequalchar3
169 module procedure dctestassertequalchar4
171 module procedure dctestassertequalchar5
173 module procedure dctestassertequalchar6
175 module procedure dctestassertequalchar7
178 module procedure dctestassertequalint0
180 module procedure dctestassertequalint1
182 module procedure dctestassertequalint2
184 module procedure dctestassertequalint3
186 module procedure dctestassertequalint4
188 module procedure dctestassertequalint5
190 module procedure dctestassertequalint6
192 module procedure dctestassertequalint7
195 module procedure dctestassertequalreal0
197 module procedure dctestassertequalreal1
199 module procedure dctestassertequalreal2
201 module procedure dctestassertequalreal3
203 module procedure dctestassertequalreal4
205 module procedure dctestassertequalreal5
207 module procedure dctestassertequalreal6
209 module procedure dctestassertequalreal7
212 module procedure dctestassertequaldouble0
214 module procedure dctestassertequaldouble1
216 module procedure dctestassertequaldouble2
218 module procedure dctestassertequaldouble3
220 module procedure dctestassertequaldouble4
222 module procedure dctestassertequaldouble5
224 module procedure dctestassertequaldouble6
226 module procedure dctestassertequaldouble7
230 module procedure dctestassertequallogical0
232 module procedure dctestassertequallogical1
234 module procedure dctestassertequallogical2
236 module procedure dctestassertequallogical3
238 module procedure dctestassertequallogical4
240 module procedure dctestassertequallogical5
242 module procedure dctestassertequallogical6
244 module procedure dctestassertequallogical7
247 module procedure dctestassertequalreal0digits
249 module procedure dctestassertequalreal1digits
251 module procedure dctestassertequalreal2digits
253 module procedure dctestassertequalreal3digits
255 module procedure dctestassertequalreal4digits
257 module procedure dctestassertequalreal5digits
259 module procedure dctestassertequalreal6digits
261 module procedure dctestassertequalreal7digits
264 module procedure dctestassertequaldouble0digits
266 module procedure dctestassertequaldouble1digits
268 module procedure dctestassertequaldouble2digits
270 module procedure dctestassertequaldouble3digits
272 module procedure dctestassertequaldouble4digits
274 module procedure dctestassertequaldouble5digits
276 module procedure dctestassertequaldouble6digits
278 module procedure dctestassertequaldouble7digits
285 module procedure dctestassertgreaterthanint0
287 module procedure dctestassertgreaterthanint1
289 module procedure dctestassertgreaterthanint2
291 module procedure dctestassertgreaterthanint3
293 module procedure dctestassertgreaterthanint4
295 module procedure dctestassertgreaterthanint5
297 module procedure dctestassertgreaterthanint6
299 module procedure dctestassertgreaterthanint7
302 module procedure dctestassertgreaterthanreal0
304 module procedure dctestassertgreaterthanreal1
306 module procedure dctestassertgreaterthanreal2
308 module procedure dctestassertgreaterthanreal3
310 module procedure dctestassertgreaterthanreal4
312 module procedure dctestassertgreaterthanreal5
314 module procedure dctestassertgreaterthanreal6
316 module procedure dctestassertgreaterthanreal7
319 module procedure dctestassertgreaterthandouble0
321 module procedure dctestassertgreaterthandouble1
323 module procedure dctestassertgreaterthandouble2
325 module procedure dctestassertgreaterthandouble3
327 module procedure dctestassertgreaterthandouble4
329 module procedure dctestassertgreaterthandouble5
331 module procedure dctestassertgreaterthandouble6
333 module procedure dctestassertgreaterthandouble7
339 module procedure dctestassertlessthanint0
341 module procedure dctestassertlessthanint1
343 module procedure dctestassertlessthanint2
345 module procedure dctestassertlessthanint3
347 module procedure dctestassertlessthanint4
349 module procedure dctestassertlessthanint5
351 module procedure dctestassertlessthanint6
353 module procedure dctestassertlessthanint7
356 module procedure dctestassertlessthanreal0
358 module procedure dctestassertlessthanreal1
360 module procedure dctestassertlessthanreal2
362 module procedure dctestassertlessthanreal3
364 module procedure dctestassertlessthanreal4
366 module procedure dctestassertlessthanreal5
368 module procedure dctestassertlessthanreal6
370 module procedure dctestassertlessthanreal7
373 module procedure dctestassertlessthandouble0
375 module procedure dctestassertlessthandouble1
377 module procedure dctestassertlessthandouble2
379 module procedure dctestassertlessthandouble3
381 module procedure dctestassertlessthandouble4
383 module procedure dctestassertlessthandouble5
385 module procedure dctestassertlessthandouble6
387 module procedure dctestassertlessthandouble7
395 subroutine dctestassertequalchar0(message, answer, check)
399 character(*),
intent(in):: message
400 character(*),
intent(in):: answer
401 character(*),
intent(in):: check
403 character(STRING):: pos_str
404 character(STRING):: wrong, right
415 err_flag = .not. trim(answer) == trim(check)
425 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
427 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
428 write(*,*)
' is NOT EQUAL to'
429 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
433 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
437 end subroutine dctestassertequalchar0
440 subroutine dctestassertequalchar1(message, answer, check)
444 character(*),
intent(in):: message
445 character(*),
intent(in):: answer(:)
446 character(*),
intent(in):: check(:)
448 character(STRING):: pos_str
449 character(STRING):: wrong, right
451 integer:: answer_shape(1), check_shape(1), pos(1)
452 logical:: consist_shape(1)
453 character(TOKEN):: pos_array(1)
454 integer,
allocatable:: mask_array(:)
455 logical,
allocatable:: judge(:)
456 logical,
allocatable:: judge_rev(:)
459 character(STRING),
allocatable:: answer_fixed_length(:)
460 character(STRING),
allocatable:: check_fixed_length(:)
468 answer_shape = shape(answer)
469 check_shape = shape(check)
471 consist_shape = answer_shape == check_shape
473 if (.not. all(consist_shape))
then
474 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
476 write(*,*)
' shape of check is (', check_shape,
')'
477 write(*,*)
' is INCORRECT'
478 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
484 allocate( mask_array( &
486 & answer_shape(1) ) &
491 & answer_shape(1) ) &
494 allocate( judge_rev( &
496 & answer_shape(1) ) &
500 allocate( answer_fixed_length( &
502 & answer_shape(1) ) &
505 allocate( check_fixed_length( &
510 answer_fixed_length = answer
511 check_fixed_length = check
513 judge = answer_fixed_length == check_fixed_length
514 deallocate(answer_fixed_length, check_fixed_length)
518 judge_rev = .not. judge
519 err_flag = any(judge_rev)
521 pos = maxloc(mask_array, judge_rev)
533 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
538 & trim(adjustl(pos_array(1))) //
')'
541 deallocate(mask_array, judge, judge_rev)
547 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
549 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
550 write(*,*)
' is NOT EQUAL to'
551 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
555 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
559 end subroutine dctestassertequalchar1
562 subroutine dctestassertequalchar2(message, answer, check)
566 character(*),
intent(in):: message
567 character(*),
intent(in):: answer(:,:)
568 character(*),
intent(in):: check(:,:)
570 character(STRING):: pos_str
571 character(STRING):: wrong, right
573 integer:: answer_shape(2), check_shape(2), pos(2)
574 logical:: consist_shape(2)
575 character(TOKEN):: pos_array(2)
576 integer,
allocatable:: mask_array(:,:)
577 logical,
allocatable:: judge(:,:)
578 logical,
allocatable:: judge_rev(:,:)
581 character(STRING),
allocatable:: answer_fixed_length(:,:)
582 character(STRING),
allocatable:: check_fixed_length(:,:)
590 answer_shape = shape(answer)
591 check_shape = shape(check)
593 consist_shape = answer_shape == check_shape
595 if (.not. all(consist_shape))
then
596 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
598 write(*,*)
' shape of check is (', check_shape,
')'
599 write(*,*)
' is INCORRECT'
600 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
606 allocate( mask_array( &
609 & answer_shape(2) ) &
615 & answer_shape(2) ) &
618 allocate( judge_rev( &
621 & answer_shape(2) ) &
625 allocate( answer_fixed_length( &
628 & answer_shape(2) ) &
631 allocate( check_fixed_length( &
637 answer_fixed_length = answer
638 check_fixed_length = check
640 judge = answer_fixed_length == check_fixed_length
641 deallocate(answer_fixed_length, check_fixed_length)
645 judge_rev = .not. judge
646 err_flag = any(judge_rev)
648 pos = maxloc(mask_array, judge_rev)
662 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
664 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
668 & trim(adjustl(pos_array(1))) //
',' // &
670 & trim(adjustl(pos_array(2))) //
')'
673 deallocate(mask_array, judge, judge_rev)
679 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
681 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
682 write(*,*)
' is NOT EQUAL to'
683 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
687 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
691 end subroutine dctestassertequalchar2
694 subroutine dctestassertequalchar3(message, answer, check)
698 character(*),
intent(in):: message
699 character(*),
intent(in):: answer(:,:,:)
700 character(*),
intent(in):: check(:,:,:)
702 character(STRING):: pos_str
703 character(STRING):: wrong, right
705 integer:: answer_shape(3), check_shape(3), pos(3)
706 logical:: consist_shape(3)
707 character(TOKEN):: pos_array(3)
708 integer,
allocatable:: mask_array(:,:,:)
709 logical,
allocatable:: judge(:,:,:)
710 logical,
allocatable:: judge_rev(:,:,:)
713 character(STRING),
allocatable:: answer_fixed_length(:,:,:)
714 character(STRING),
allocatable:: check_fixed_length(:,:,:)
722 answer_shape = shape(answer)
723 check_shape = shape(check)
725 consist_shape = answer_shape == check_shape
727 if (.not. all(consist_shape))
then
728 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
730 write(*,*)
' shape of check is (', check_shape,
')'
731 write(*,*)
' is INCORRECT'
732 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
738 allocate( mask_array( &
743 & answer_shape(3) ) &
751 & answer_shape(3) ) &
754 allocate( judge_rev( &
759 & answer_shape(3) ) &
763 allocate( answer_fixed_length( &
768 & answer_shape(3) ) &
771 allocate( check_fixed_length( &
779 answer_fixed_length = answer
780 check_fixed_length = check
782 judge = answer_fixed_length == check_fixed_length
783 deallocate(answer_fixed_length, check_fixed_length)
787 judge_rev = .not. judge
788 err_flag = any(judge_rev)
790 pos = maxloc(mask_array, judge_rev)
808 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
810 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
812 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
816 & trim(adjustl(pos_array(1))) //
',' // &
818 & trim(adjustl(pos_array(2))) //
',' // &
820 & trim(adjustl(pos_array(3))) //
')'
823 deallocate(mask_array, judge, judge_rev)
829 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
831 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
832 write(*,*)
' is NOT EQUAL to'
833 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
837 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
841 end subroutine dctestassertequalchar3
844 subroutine dctestassertequalchar4(message, answer, check)
848 character(*),
intent(in):: message
849 character(*),
intent(in):: answer(:,:,:,:)
850 character(*),
intent(in):: check(:,:,:,:)
852 character(STRING):: pos_str
853 character(STRING):: wrong, right
855 integer:: answer_shape(4), check_shape(4), pos(4)
856 logical:: consist_shape(4)
857 character(TOKEN):: pos_array(4)
858 integer,
allocatable:: mask_array(:,:,:,:)
859 logical,
allocatable:: judge(:,:,:,:)
860 logical,
allocatable:: judge_rev(:,:,:,:)
863 character(STRING),
allocatable:: answer_fixed_length(:,:,:,:)
864 character(STRING),
allocatable:: check_fixed_length(:,:,:,:)
872 answer_shape = shape(answer)
873 check_shape = shape(check)
875 consist_shape = answer_shape == check_shape
877 if (.not. all(consist_shape))
then
878 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
880 write(*,*)
' shape of check is (', check_shape,
')'
881 write(*,*)
' is INCORRECT'
882 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
888 allocate( mask_array( &
895 & answer_shape(4) ) &
905 & answer_shape(4) ) &
908 allocate( judge_rev( &
915 & answer_shape(4) ) &
919 allocate( answer_fixed_length( &
926 & answer_shape(4) ) &
929 allocate( check_fixed_length( &
939 answer_fixed_length = answer
940 check_fixed_length = check
942 judge = answer_fixed_length == check_fixed_length
943 deallocate(answer_fixed_length, check_fixed_length)
947 judge_rev = .not. judge
948 err_flag = any(judge_rev)
950 pos = maxloc(mask_array, judge_rev)
972 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
974 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
976 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
978 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
982 & trim(adjustl(pos_array(1))) //
',' // &
984 & trim(adjustl(pos_array(2))) //
',' // &
986 & trim(adjustl(pos_array(3))) //
',' // &
988 & trim(adjustl(pos_array(4))) //
')'
991 deallocate(mask_array, judge, judge_rev)
997 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
999 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
1000 write(*,*)
' is NOT EQUAL to'
1001 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
1005 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
1009 end subroutine dctestassertequalchar4
1012 subroutine dctestassertequalchar5(message, answer, check)
1016 character(*),
intent(in):: message
1017 character(*),
intent(in):: answer(:,:,:,:,:)
1018 character(*),
intent(in):: check(:,:,:,:,:)
1020 character(STRING):: pos_str
1021 character(STRING):: wrong, right
1023 integer:: answer_shape(5), check_shape(5), pos(5)
1024 logical:: consist_shape(5)
1025 character(TOKEN):: pos_array(5)
1026 integer,
allocatable:: mask_array(:,:,:,:,:)
1027 logical,
allocatable:: judge(:,:,:,:,:)
1028 logical,
allocatable:: judge_rev(:,:,:,:,:)
1031 character(STRING),
allocatable:: answer_fixed_length(:,:,:,:,:)
1032 character(STRING),
allocatable:: check_fixed_length(:,:,:,:,:)
1040 answer_shape = shape(answer)
1041 check_shape = shape(check)
1043 consist_shape = answer_shape == check_shape
1045 if (.not. all(consist_shape))
then
1046 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1048 write(*,*)
' shape of check is (', check_shape,
')'
1049 write(*,*)
' is INCORRECT'
1050 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
1056 allocate( mask_array( &
1057 & answer_shape(1), &
1059 & answer_shape(2), &
1061 & answer_shape(3), &
1063 & answer_shape(4), &
1065 & answer_shape(5) ) &
1069 & answer_shape(1), &
1071 & answer_shape(2), &
1073 & answer_shape(3), &
1075 & answer_shape(4), &
1077 & answer_shape(5) ) &
1080 allocate( judge_rev( &
1081 & answer_shape(1), &
1083 & answer_shape(2), &
1085 & answer_shape(3), &
1087 & answer_shape(4), &
1089 & answer_shape(5) ) &
1093 allocate( answer_fixed_length( &
1094 & answer_shape(1), &
1096 & answer_shape(2), &
1098 & answer_shape(3), &
1100 & answer_shape(4), &
1102 & answer_shape(5) ) &
1105 allocate( check_fixed_length( &
1114 & check_shape(5) ) &
1117 answer_fixed_length = answer
1118 check_fixed_length = check
1120 judge = answer_fixed_length == check_fixed_length
1121 deallocate(answer_fixed_length, check_fixed_length)
1125 judge_rev = .not. judge
1126 err_flag = any(judge_rev)
1128 pos = maxloc(mask_array, judge_rev)
1154 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
1156 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
1158 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
1160 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
1162 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
1166 & trim(adjustl(pos_array(1))) //
',' // &
1168 & trim(adjustl(pos_array(2))) //
',' // &
1170 & trim(adjustl(pos_array(3))) //
',' // &
1172 & trim(adjustl(pos_array(4))) //
',' // &
1174 & trim(adjustl(pos_array(5))) //
')'
1177 deallocate(mask_array, judge, judge_rev)
1183 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1185 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
1186 write(*,*)
' is NOT EQUAL to'
1187 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
1191 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
1195 end subroutine dctestassertequalchar5
1198 subroutine dctestassertequalchar6(message, answer, check)
1202 character(*),
intent(in):: message
1203 character(*),
intent(in):: answer(:,:,:,:,:,:)
1204 character(*),
intent(in):: check(:,:,:,:,:,:)
1206 character(STRING):: pos_str
1207 character(STRING):: wrong, right
1209 integer:: answer_shape(6), check_shape(6), pos(6)
1210 logical:: consist_shape(6)
1211 character(TOKEN):: pos_array(6)
1212 integer,
allocatable:: mask_array(:,:,:,:,:,:)
1213 logical,
allocatable:: judge(:,:,:,:,:,:)
1214 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
1217 character(STRING),
allocatable:: answer_fixed_length(:,:,:,:,:,:)
1218 character(STRING),
allocatable:: check_fixed_length(:,:,:,:,:,:)
1226 answer_shape = shape(answer)
1227 check_shape = shape(check)
1229 consist_shape = answer_shape == check_shape
1231 if (.not. all(consist_shape))
then
1232 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1234 write(*,*)
' shape of check is (', check_shape,
')'
1235 write(*,*)
' is INCORRECT'
1236 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
1242 allocate( mask_array( &
1243 & answer_shape(1), &
1245 & answer_shape(2), &
1247 & answer_shape(3), &
1249 & answer_shape(4), &
1251 & answer_shape(5), &
1253 & answer_shape(6) ) &
1257 & answer_shape(1), &
1259 & answer_shape(2), &
1261 & answer_shape(3), &
1263 & answer_shape(4), &
1265 & answer_shape(5), &
1267 & answer_shape(6) ) &
1270 allocate( judge_rev( &
1271 & answer_shape(1), &
1273 & answer_shape(2), &
1275 & answer_shape(3), &
1277 & answer_shape(4), &
1279 & answer_shape(5), &
1281 & answer_shape(6) ) &
1285 allocate( answer_fixed_length( &
1286 & answer_shape(1), &
1288 & answer_shape(2), &
1290 & answer_shape(3), &
1292 & answer_shape(4), &
1294 & answer_shape(5), &
1296 & answer_shape(6) ) &
1299 allocate( check_fixed_length( &
1310 & check_shape(6) ) &
1313 answer_fixed_length = answer
1314 check_fixed_length = check
1316 judge = answer_fixed_length == check_fixed_length
1317 deallocate(answer_fixed_length, check_fixed_length)
1321 judge_rev = .not. judge
1322 err_flag = any(judge_rev)
1324 pos = maxloc(mask_array, judge_rev)
1354 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
1356 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
1358 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
1360 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
1362 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
1364 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
1368 & trim(adjustl(pos_array(1))) //
',' // &
1370 & trim(adjustl(pos_array(2))) //
',' // &
1372 & trim(adjustl(pos_array(3))) //
',' // &
1374 & trim(adjustl(pos_array(4))) //
',' // &
1376 & trim(adjustl(pos_array(5))) //
',' // &
1378 & trim(adjustl(pos_array(6))) //
')'
1381 deallocate(mask_array, judge, judge_rev)
1387 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1389 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
1390 write(*,*)
' is NOT EQUAL to'
1391 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
1395 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
1399 end subroutine dctestassertequalchar6
1402 subroutine dctestassertequalchar7(message, answer, check)
1406 character(*),
intent(in):: message
1407 character(*),
intent(in):: answer(:,:,:,:,:,:,:)
1408 character(*),
intent(in):: check(:,:,:,:,:,:,:)
1410 character(STRING):: pos_str
1411 character(STRING):: wrong, right
1413 integer:: answer_shape(7), check_shape(7), pos(7)
1414 logical:: consist_shape(7)
1415 character(TOKEN):: pos_array(7)
1416 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
1417 logical,
allocatable:: judge(:,:,:,:,:,:,:)
1418 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
1421 character(STRING),
allocatable:: answer_fixed_length(:,:,:,:,:,:,:)
1422 character(STRING),
allocatable:: check_fixed_length(:,:,:,:,:,:,:)
1430 answer_shape = shape(answer)
1431 check_shape = shape(check)
1433 consist_shape = answer_shape == check_shape
1435 if (.not. all(consist_shape))
then
1436 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1438 write(*,*)
' shape of check is (', check_shape,
')'
1439 write(*,*)
' is INCORRECT'
1440 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
1446 allocate( mask_array( &
1447 & answer_shape(1), &
1449 & answer_shape(2), &
1451 & answer_shape(3), &
1453 & answer_shape(4), &
1455 & answer_shape(5), &
1457 & answer_shape(6), &
1459 & answer_shape(7) ) &
1463 & answer_shape(1), &
1465 & answer_shape(2), &
1467 & answer_shape(3), &
1469 & answer_shape(4), &
1471 & answer_shape(5), &
1473 & answer_shape(6), &
1475 & answer_shape(7) ) &
1478 allocate( judge_rev( &
1479 & answer_shape(1), &
1481 & answer_shape(2), &
1483 & answer_shape(3), &
1485 & answer_shape(4), &
1487 & answer_shape(5), &
1489 & answer_shape(6), &
1491 & answer_shape(7) ) &
1495 allocate( answer_fixed_length( &
1496 & answer_shape(1), &
1498 & answer_shape(2), &
1500 & answer_shape(3), &
1502 & answer_shape(4), &
1504 & answer_shape(5), &
1506 & answer_shape(6), &
1508 & answer_shape(7) ) &
1511 allocate( check_fixed_length( &
1524 & check_shape(7) ) &
1527 answer_fixed_length = answer
1528 check_fixed_length = check
1530 judge = answer_fixed_length == check_fixed_length
1531 deallocate(answer_fixed_length, check_fixed_length)
1535 judge_rev = .not. judge
1536 err_flag = any(judge_rev)
1538 pos = maxloc(mask_array, judge_rev)
1572 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
1574 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
1576 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
1578 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
1580 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
1582 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
1584 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
1588 & trim(adjustl(pos_array(1))) //
',' // &
1590 & trim(adjustl(pos_array(2))) //
',' // &
1592 & trim(adjustl(pos_array(3))) //
',' // &
1594 & trim(adjustl(pos_array(4))) //
',' // &
1596 & trim(adjustl(pos_array(5))) //
',' // &
1598 & trim(adjustl(pos_array(6))) //
',' // &
1600 & trim(adjustl(pos_array(7))) //
')'
1603 deallocate(mask_array, judge, judge_rev)
1609 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1611 write(*,*)
' check' // trim(pos_str) //
' = ', trim(wrong)
1612 write(*,*)
' is NOT EQUAL to'
1613 write(*,*)
' answer' // trim(pos_str) //
' = ', trim(right)
1617 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
1621 end subroutine dctestassertequalchar7
1624 subroutine dctestassertequalint0(message, answer, check)
1628 character(*),
intent(in):: message
1629 integer,
intent(in):: answer
1630 integer,
intent(in):: check
1632 character(STRING):: pos_str
1633 integer:: wrong, right
1643 err_flag = .not. answer == check
1653 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1655 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
1656 write(*,*)
' is NOT EQUAL to'
1657 write(*,*)
' answer' // trim(pos_str) //
' = ', right
1661 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
1665 end subroutine dctestassertequalint0
1668 subroutine dctestassertequalint1(message, answer, check)
1672 character(*),
intent(in):: message
1673 integer,
intent(in):: answer(:)
1674 integer,
intent(in):: check(:)
1676 character(STRING):: pos_str
1677 integer:: wrong, right
1679 integer:: answer_shape(1), check_shape(1), pos(1)
1680 logical:: consist_shape(1)
1681 character(TOKEN):: pos_array(1)
1682 integer,
allocatable:: mask_array(:)
1683 logical,
allocatable:: judge(:)
1684 logical,
allocatable:: judge_rev(:)
1693 answer_shape = shape(answer)
1694 check_shape = shape(check)
1696 consist_shape = answer_shape == check_shape
1698 if (.not. all(consist_shape))
then
1699 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1701 write(*,*)
' shape of check is (', check_shape,
')'
1702 write(*,*)
' is INCORRECT'
1703 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
1709 allocate( mask_array( &
1711 & answer_shape(1) ) &
1716 & answer_shape(1) ) &
1719 allocate( judge_rev( &
1721 & answer_shape(1) ) &
1725 judge = answer == check
1730 judge_rev = .not. judge
1731 err_flag = any(judge_rev)
1733 pos = maxloc(mask_array, judge_rev)
1745 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
1750 & trim(adjustl(pos_array(1))) //
')'
1753 deallocate(mask_array, judge, judge_rev)
1759 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1761 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
1762 write(*,*)
' is NOT EQUAL to'
1763 write(*,*)
' answer' // trim(pos_str) //
' = ', right
1767 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
1771 end subroutine dctestassertequalint1
1774 subroutine dctestassertequalint2(message, answer, check)
1778 character(*),
intent(in):: message
1779 integer,
intent(in):: answer(:,:)
1780 integer,
intent(in):: check(:,:)
1782 character(STRING):: pos_str
1783 integer:: wrong, right
1785 integer:: answer_shape(2), check_shape(2), pos(2)
1786 logical:: consist_shape(2)
1787 character(TOKEN):: pos_array(2)
1788 integer,
allocatable:: mask_array(:,:)
1789 logical,
allocatable:: judge(:,:)
1790 logical,
allocatable:: judge_rev(:,:)
1799 answer_shape = shape(answer)
1800 check_shape = shape(check)
1802 consist_shape = answer_shape == check_shape
1804 if (.not. all(consist_shape))
then
1805 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1807 write(*,*)
' shape of check is (', check_shape,
')'
1808 write(*,*)
' is INCORRECT'
1809 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
1815 allocate( mask_array( &
1816 & answer_shape(1), &
1818 & answer_shape(2) ) &
1822 & answer_shape(1), &
1824 & answer_shape(2) ) &
1827 allocate( judge_rev( &
1828 & answer_shape(1), &
1830 & answer_shape(2) ) &
1834 judge = answer == check
1839 judge_rev = .not. judge
1840 err_flag = any(judge_rev)
1842 pos = maxloc(mask_array, judge_rev)
1856 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
1858 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
1862 & trim(adjustl(pos_array(1))) //
',' // &
1864 & trim(adjustl(pos_array(2))) //
')'
1867 deallocate(mask_array, judge, judge_rev)
1873 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1875 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
1876 write(*,*)
' is NOT EQUAL to'
1877 write(*,*)
' answer' // trim(pos_str) //
' = ', right
1881 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
1885 end subroutine dctestassertequalint2
1888 subroutine dctestassertequalint3(message, answer, check)
1892 character(*),
intent(in):: message
1893 integer,
intent(in):: answer(:,:,:)
1894 integer,
intent(in):: check(:,:,:)
1896 character(STRING):: pos_str
1897 integer:: wrong, right
1899 integer:: answer_shape(3), check_shape(3), pos(3)
1900 logical:: consist_shape(3)
1901 character(TOKEN):: pos_array(3)
1902 integer,
allocatable:: mask_array(:,:,:)
1903 logical,
allocatable:: judge(:,:,:)
1904 logical,
allocatable:: judge_rev(:,:,:)
1913 answer_shape = shape(answer)
1914 check_shape = shape(check)
1916 consist_shape = answer_shape == check_shape
1918 if (.not. all(consist_shape))
then
1919 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
1921 write(*,*)
' shape of check is (', check_shape,
')'
1922 write(*,*)
' is INCORRECT'
1923 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
1929 allocate( mask_array( &
1930 & answer_shape(1), &
1932 & answer_shape(2), &
1934 & answer_shape(3) ) &
1938 & answer_shape(1), &
1940 & answer_shape(2), &
1942 & answer_shape(3) ) &
1945 allocate( judge_rev( &
1946 & answer_shape(1), &
1948 & answer_shape(2), &
1950 & answer_shape(3) ) &
1954 judge = answer == check
1959 judge_rev = .not. judge
1960 err_flag = any(judge_rev)
1962 pos = maxloc(mask_array, judge_rev)
1980 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
1982 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
1984 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
1988 & trim(adjustl(pos_array(1))) //
',' // &
1990 & trim(adjustl(pos_array(2))) //
',' // &
1992 & trim(adjustl(pos_array(3))) //
')'
1995 deallocate(mask_array, judge, judge_rev)
2001 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2003 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2004 write(*,*)
' is NOT EQUAL to'
2005 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2009 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2013 end subroutine dctestassertequalint3
2016 subroutine dctestassertequalint4(message, answer, check)
2020 character(*),
intent(in):: message
2021 integer,
intent(in):: answer(:,:,:,:)
2022 integer,
intent(in):: check(:,:,:,:)
2024 character(STRING):: pos_str
2025 integer:: wrong, right
2027 integer:: answer_shape(4), check_shape(4), pos(4)
2028 logical:: consist_shape(4)
2029 character(TOKEN):: pos_array(4)
2030 integer,
allocatable:: mask_array(:,:,:,:)
2031 logical,
allocatable:: judge(:,:,:,:)
2032 logical,
allocatable:: judge_rev(:,:,:,:)
2041 answer_shape = shape(answer)
2042 check_shape = shape(check)
2044 consist_shape = answer_shape == check_shape
2046 if (.not. all(consist_shape))
then
2047 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2049 write(*,*)
' shape of check is (', check_shape,
')'
2050 write(*,*)
' is INCORRECT'
2051 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
2057 allocate( mask_array( &
2058 & answer_shape(1), &
2060 & answer_shape(2), &
2062 & answer_shape(3), &
2064 & answer_shape(4) ) &
2068 & answer_shape(1), &
2070 & answer_shape(2), &
2072 & answer_shape(3), &
2074 & answer_shape(4) ) &
2077 allocate( judge_rev( &
2078 & answer_shape(1), &
2080 & answer_shape(2), &
2082 & answer_shape(3), &
2084 & answer_shape(4) ) &
2088 judge = answer == check
2093 judge_rev = .not. judge
2094 err_flag = any(judge_rev)
2096 pos = maxloc(mask_array, judge_rev)
2118 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
2120 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
2122 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
2124 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
2128 & trim(adjustl(pos_array(1))) //
',' // &
2130 & trim(adjustl(pos_array(2))) //
',' // &
2132 & trim(adjustl(pos_array(3))) //
',' // &
2134 & trim(adjustl(pos_array(4))) //
')'
2137 deallocate(mask_array, judge, judge_rev)
2143 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2145 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2146 write(*,*)
' is NOT EQUAL to'
2147 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2151 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2155 end subroutine dctestassertequalint4
2158 subroutine dctestassertequalint5(message, answer, check)
2162 character(*),
intent(in):: message
2163 integer,
intent(in):: answer(:,:,:,:,:)
2164 integer,
intent(in):: check(:,:,:,:,:)
2166 character(STRING):: pos_str
2167 integer:: wrong, right
2169 integer:: answer_shape(5), check_shape(5), pos(5)
2170 logical:: consist_shape(5)
2171 character(TOKEN):: pos_array(5)
2172 integer,
allocatable:: mask_array(:,:,:,:,:)
2173 logical,
allocatable:: judge(:,:,:,:,:)
2174 logical,
allocatable:: judge_rev(:,:,:,:,:)
2183 answer_shape = shape(answer)
2184 check_shape = shape(check)
2186 consist_shape = answer_shape == check_shape
2188 if (.not. all(consist_shape))
then
2189 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2191 write(*,*)
' shape of check is (', check_shape,
')'
2192 write(*,*)
' is INCORRECT'
2193 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
2199 allocate( mask_array( &
2200 & answer_shape(1), &
2202 & answer_shape(2), &
2204 & answer_shape(3), &
2206 & answer_shape(4), &
2208 & answer_shape(5) ) &
2212 & answer_shape(1), &
2214 & answer_shape(2), &
2216 & answer_shape(3), &
2218 & answer_shape(4), &
2220 & answer_shape(5) ) &
2223 allocate( judge_rev( &
2224 & answer_shape(1), &
2226 & answer_shape(2), &
2228 & answer_shape(3), &
2230 & answer_shape(4), &
2232 & answer_shape(5) ) &
2236 judge = answer == check
2241 judge_rev = .not. judge
2242 err_flag = any(judge_rev)
2244 pos = maxloc(mask_array, judge_rev)
2270 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
2272 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
2274 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
2276 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
2278 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
2282 & trim(adjustl(pos_array(1))) //
',' // &
2284 & trim(adjustl(pos_array(2))) //
',' // &
2286 & trim(adjustl(pos_array(3))) //
',' // &
2288 & trim(adjustl(pos_array(4))) //
',' // &
2290 & trim(adjustl(pos_array(5))) //
')'
2293 deallocate(mask_array, judge, judge_rev)
2299 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2301 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2302 write(*,*)
' is NOT EQUAL to'
2303 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2307 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2311 end subroutine dctestassertequalint5
2314 subroutine dctestassertequalint6(message, answer, check)
2318 character(*),
intent(in):: message
2319 integer,
intent(in):: answer(:,:,:,:,:,:)
2320 integer,
intent(in):: check(:,:,:,:,:,:)
2322 character(STRING):: pos_str
2323 integer:: wrong, right
2325 integer:: answer_shape(6), check_shape(6), pos(6)
2326 logical:: consist_shape(6)
2327 character(TOKEN):: pos_array(6)
2328 integer,
allocatable:: mask_array(:,:,:,:,:,:)
2329 logical,
allocatable:: judge(:,:,:,:,:,:)
2330 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
2339 answer_shape = shape(answer)
2340 check_shape = shape(check)
2342 consist_shape = answer_shape == check_shape
2344 if (.not. all(consist_shape))
then
2345 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2347 write(*,*)
' shape of check is (', check_shape,
')'
2348 write(*,*)
' is INCORRECT'
2349 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
2355 allocate( mask_array( &
2356 & answer_shape(1), &
2358 & answer_shape(2), &
2360 & answer_shape(3), &
2362 & answer_shape(4), &
2364 & answer_shape(5), &
2366 & answer_shape(6) ) &
2370 & answer_shape(1), &
2372 & answer_shape(2), &
2374 & answer_shape(3), &
2376 & answer_shape(4), &
2378 & answer_shape(5), &
2380 & answer_shape(6) ) &
2383 allocate( judge_rev( &
2384 & answer_shape(1), &
2386 & answer_shape(2), &
2388 & answer_shape(3), &
2390 & answer_shape(4), &
2392 & answer_shape(5), &
2394 & answer_shape(6) ) &
2398 judge = answer == check
2403 judge_rev = .not. judge
2404 err_flag = any(judge_rev)
2406 pos = maxloc(mask_array, judge_rev)
2436 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
2438 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
2440 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
2442 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
2444 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
2446 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
2450 & trim(adjustl(pos_array(1))) //
',' // &
2452 & trim(adjustl(pos_array(2))) //
',' // &
2454 & trim(adjustl(pos_array(3))) //
',' // &
2456 & trim(adjustl(pos_array(4))) //
',' // &
2458 & trim(adjustl(pos_array(5))) //
',' // &
2460 & trim(adjustl(pos_array(6))) //
')'
2463 deallocate(mask_array, judge, judge_rev)
2469 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2471 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2472 write(*,*)
' is NOT EQUAL to'
2473 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2477 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2481 end subroutine dctestassertequalint6
2484 subroutine dctestassertequalint7(message, answer, check)
2488 character(*),
intent(in):: message
2489 integer,
intent(in):: answer(:,:,:,:,:,:,:)
2490 integer,
intent(in):: check(:,:,:,:,:,:,:)
2492 character(STRING):: pos_str
2493 integer:: wrong, right
2495 integer:: answer_shape(7), check_shape(7), pos(7)
2496 logical:: consist_shape(7)
2497 character(TOKEN):: pos_array(7)
2498 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
2499 logical,
allocatable:: judge(:,:,:,:,:,:,:)
2500 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
2509 answer_shape = shape(answer)
2510 check_shape = shape(check)
2512 consist_shape = answer_shape == check_shape
2514 if (.not. all(consist_shape))
then
2515 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2517 write(*,*)
' shape of check is (', check_shape,
')'
2518 write(*,*)
' is INCORRECT'
2519 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
2525 allocate( mask_array( &
2526 & answer_shape(1), &
2528 & answer_shape(2), &
2530 & answer_shape(3), &
2532 & answer_shape(4), &
2534 & answer_shape(5), &
2536 & answer_shape(6), &
2538 & answer_shape(7) ) &
2542 & answer_shape(1), &
2544 & answer_shape(2), &
2546 & answer_shape(3), &
2548 & answer_shape(4), &
2550 & answer_shape(5), &
2552 & answer_shape(6), &
2554 & answer_shape(7) ) &
2557 allocate( judge_rev( &
2558 & answer_shape(1), &
2560 & answer_shape(2), &
2562 & answer_shape(3), &
2564 & answer_shape(4), &
2566 & answer_shape(5), &
2568 & answer_shape(6), &
2570 & answer_shape(7) ) &
2574 judge = answer == check
2579 judge_rev = .not. judge
2580 err_flag = any(judge_rev)
2582 pos = maxloc(mask_array, judge_rev)
2616 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
2618 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
2620 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
2622 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
2624 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
2626 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
2628 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
2632 & trim(adjustl(pos_array(1))) //
',' // &
2634 & trim(adjustl(pos_array(2))) //
',' // &
2636 & trim(adjustl(pos_array(3))) //
',' // &
2638 & trim(adjustl(pos_array(4))) //
',' // &
2640 & trim(adjustl(pos_array(5))) //
',' // &
2642 & trim(adjustl(pos_array(6))) //
',' // &
2644 & trim(adjustl(pos_array(7))) //
')'
2647 deallocate(mask_array, judge, judge_rev)
2653 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2655 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2656 write(*,*)
' is NOT EQUAL to'
2657 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2661 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2665 end subroutine dctestassertequalint7
2668 subroutine dctestassertequalreal0(message, answer, check)
2672 character(*),
intent(in):: message
2673 real,
intent(in):: answer
2674 real,
intent(in):: check
2676 character(STRING):: pos_str
2687 err_flag = abs(answer - check) > 0.0
2697 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2699 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2700 write(*,*)
' is NOT EQUAL to'
2701 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2705 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2709 end subroutine dctestassertequalreal0
2712 subroutine dctestassertequalreal1(message, answer, check)
2716 character(*),
intent(in):: message
2717 real,
intent(in):: answer(:)
2718 real,
intent(in):: check(:)
2720 character(STRING):: pos_str
2723 integer:: answer_shape(1), check_shape(1), pos(1)
2724 logical:: consist_shape(1)
2725 character(TOKEN):: pos_array(1)
2726 integer,
allocatable:: mask_array(:)
2727 logical,
allocatable:: judge(:)
2728 logical,
allocatable:: judge_rev(:)
2737 answer_shape = shape(answer)
2738 check_shape = shape(check)
2740 consist_shape = answer_shape == check_shape
2742 if (.not. all(consist_shape))
then
2743 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2745 write(*,*)
' shape of check is (', check_shape,
')'
2746 write(*,*)
' is INCORRECT'
2747 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
2753 allocate( mask_array( &
2755 & answer_shape(1) ) &
2760 & answer_shape(1) ) &
2763 allocate( judge_rev( &
2765 & answer_shape(1) ) &
2769 judge = abs(answer - check) <= 0.0
2774 judge_rev = .not. judge
2775 err_flag = any(judge_rev)
2777 pos = maxloc(mask_array, judge_rev)
2789 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
2794 & trim(adjustl(pos_array(1))) //
')'
2797 deallocate(mask_array, judge, judge_rev)
2803 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2805 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2806 write(*,*)
' is NOT EQUAL to'
2807 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2811 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2815 end subroutine dctestassertequalreal1
2818 subroutine dctestassertequalreal2(message, answer, check)
2822 character(*),
intent(in):: message
2823 real,
intent(in):: answer(:,:)
2824 real,
intent(in):: check(:,:)
2826 character(STRING):: pos_str
2829 integer:: answer_shape(2), check_shape(2), pos(2)
2830 logical:: consist_shape(2)
2831 character(TOKEN):: pos_array(2)
2832 integer,
allocatable:: mask_array(:,:)
2833 logical,
allocatable:: judge(:,:)
2834 logical,
allocatable:: judge_rev(:,:)
2843 answer_shape = shape(answer)
2844 check_shape = shape(check)
2846 consist_shape = answer_shape == check_shape
2848 if (.not. all(consist_shape))
then
2849 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2851 write(*,*)
' shape of check is (', check_shape,
')'
2852 write(*,*)
' is INCORRECT'
2853 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
2859 allocate( mask_array( &
2860 & answer_shape(1), &
2862 & answer_shape(2) ) &
2866 & answer_shape(1), &
2868 & answer_shape(2) ) &
2871 allocate( judge_rev( &
2872 & answer_shape(1), &
2874 & answer_shape(2) ) &
2878 judge = abs(answer - check) <= 0.0
2883 judge_rev = .not. judge
2884 err_flag = any(judge_rev)
2886 pos = maxloc(mask_array, judge_rev)
2900 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
2902 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
2906 & trim(adjustl(pos_array(1))) //
',' // &
2908 & trim(adjustl(pos_array(2))) //
')'
2911 deallocate(mask_array, judge, judge_rev)
2917 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2919 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
2920 write(*,*)
' is NOT EQUAL to'
2921 write(*,*)
' answer' // trim(pos_str) //
' = ', right
2925 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
2929 end subroutine dctestassertequalreal2
2932 subroutine dctestassertequalreal3(message, answer, check)
2936 character(*),
intent(in):: message
2937 real,
intent(in):: answer(:,:,:)
2938 real,
intent(in):: check(:,:,:)
2940 character(STRING):: pos_str
2943 integer:: answer_shape(3), check_shape(3), pos(3)
2944 logical:: consist_shape(3)
2945 character(TOKEN):: pos_array(3)
2946 integer,
allocatable:: mask_array(:,:,:)
2947 logical,
allocatable:: judge(:,:,:)
2948 logical,
allocatable:: judge_rev(:,:,:)
2957 answer_shape = shape(answer)
2958 check_shape = shape(check)
2960 consist_shape = answer_shape == check_shape
2962 if (.not. all(consist_shape))
then
2963 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
2965 write(*,*)
' shape of check is (', check_shape,
')'
2966 write(*,*)
' is INCORRECT'
2967 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
2973 allocate( mask_array( &
2974 & answer_shape(1), &
2976 & answer_shape(2), &
2978 & answer_shape(3) ) &
2982 & answer_shape(1), &
2984 & answer_shape(2), &
2986 & answer_shape(3) ) &
2989 allocate( judge_rev( &
2990 & answer_shape(1), &
2992 & answer_shape(2), &
2994 & answer_shape(3) ) &
2998 judge = abs(answer - check) <= 0.0
3003 judge_rev = .not. judge
3004 err_flag = any(judge_rev)
3006 pos = maxloc(mask_array, judge_rev)
3024 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
3026 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
3028 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
3032 & trim(adjustl(pos_array(1))) //
',' // &
3034 & trim(adjustl(pos_array(2))) //
',' // &
3036 & trim(adjustl(pos_array(3))) //
')'
3039 deallocate(mask_array, judge, judge_rev)
3045 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3047 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3048 write(*,*)
' is NOT EQUAL to'
3049 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3053 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3057 end subroutine dctestassertequalreal3
3060 subroutine dctestassertequalreal4(message, answer, check)
3064 character(*),
intent(in):: message
3065 real,
intent(in):: answer(:,:,:,:)
3066 real,
intent(in):: check(:,:,:,:)
3068 character(STRING):: pos_str
3071 integer:: answer_shape(4), check_shape(4), pos(4)
3072 logical:: consist_shape(4)
3073 character(TOKEN):: pos_array(4)
3074 integer,
allocatable:: mask_array(:,:,:,:)
3075 logical,
allocatable:: judge(:,:,:,:)
3076 logical,
allocatable:: judge_rev(:,:,:,:)
3085 answer_shape = shape(answer)
3086 check_shape = shape(check)
3088 consist_shape = answer_shape == check_shape
3090 if (.not. all(consist_shape))
then
3091 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3093 write(*,*)
' shape of check is (', check_shape,
')'
3094 write(*,*)
' is INCORRECT'
3095 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
3101 allocate( mask_array( &
3102 & answer_shape(1), &
3104 & answer_shape(2), &
3106 & answer_shape(3), &
3108 & answer_shape(4) ) &
3112 & answer_shape(1), &
3114 & answer_shape(2), &
3116 & answer_shape(3), &
3118 & answer_shape(4) ) &
3121 allocate( judge_rev( &
3122 & answer_shape(1), &
3124 & answer_shape(2), &
3126 & answer_shape(3), &
3128 & answer_shape(4) ) &
3132 judge = abs(answer - check) <= 0.0
3137 judge_rev = .not. judge
3138 err_flag = any(judge_rev)
3140 pos = maxloc(mask_array, judge_rev)
3162 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
3164 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
3166 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
3168 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
3172 & trim(adjustl(pos_array(1))) //
',' // &
3174 & trim(adjustl(pos_array(2))) //
',' // &
3176 & trim(adjustl(pos_array(3))) //
',' // &
3178 & trim(adjustl(pos_array(4))) //
')'
3181 deallocate(mask_array, judge, judge_rev)
3187 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3189 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3190 write(*,*)
' is NOT EQUAL to'
3191 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3195 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3199 end subroutine dctestassertequalreal4
3202 subroutine dctestassertequalreal5(message, answer, check)
3206 character(*),
intent(in):: message
3207 real,
intent(in):: answer(:,:,:,:,:)
3208 real,
intent(in):: check(:,:,:,:,:)
3210 character(STRING):: pos_str
3213 integer:: answer_shape(5), check_shape(5), pos(5)
3214 logical:: consist_shape(5)
3215 character(TOKEN):: pos_array(5)
3216 integer,
allocatable:: mask_array(:,:,:,:,:)
3217 logical,
allocatable:: judge(:,:,:,:,:)
3218 logical,
allocatable:: judge_rev(:,:,:,:,:)
3227 answer_shape = shape(answer)
3228 check_shape = shape(check)
3230 consist_shape = answer_shape == check_shape
3232 if (.not. all(consist_shape))
then
3233 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3235 write(*,*)
' shape of check is (', check_shape,
')'
3236 write(*,*)
' is INCORRECT'
3237 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
3243 allocate( mask_array( &
3244 & answer_shape(1), &
3246 & answer_shape(2), &
3248 & answer_shape(3), &
3250 & answer_shape(4), &
3252 & answer_shape(5) ) &
3256 & answer_shape(1), &
3258 & answer_shape(2), &
3260 & answer_shape(3), &
3262 & answer_shape(4), &
3264 & answer_shape(5) ) &
3267 allocate( judge_rev( &
3268 & answer_shape(1), &
3270 & answer_shape(2), &
3272 & answer_shape(3), &
3274 & answer_shape(4), &
3276 & answer_shape(5) ) &
3280 judge = abs(answer - check) <= 0.0
3285 judge_rev = .not. judge
3286 err_flag = any(judge_rev)
3288 pos = maxloc(mask_array, judge_rev)
3314 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
3316 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
3318 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
3320 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
3322 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
3326 & trim(adjustl(pos_array(1))) //
',' // &
3328 & trim(adjustl(pos_array(2))) //
',' // &
3330 & trim(adjustl(pos_array(3))) //
',' // &
3332 & trim(adjustl(pos_array(4))) //
',' // &
3334 & trim(adjustl(pos_array(5))) //
')'
3337 deallocate(mask_array, judge, judge_rev)
3343 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3345 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3346 write(*,*)
' is NOT EQUAL to'
3347 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3351 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3355 end subroutine dctestassertequalreal5
3358 subroutine dctestassertequalreal6(message, answer, check)
3362 character(*),
intent(in):: message
3363 real,
intent(in):: answer(:,:,:,:,:,:)
3364 real,
intent(in):: check(:,:,:,:,:,:)
3366 character(STRING):: pos_str
3369 integer:: answer_shape(6), check_shape(6), pos(6)
3370 logical:: consist_shape(6)
3371 character(TOKEN):: pos_array(6)
3372 integer,
allocatable:: mask_array(:,:,:,:,:,:)
3373 logical,
allocatable:: judge(:,:,:,:,:,:)
3374 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
3383 answer_shape = shape(answer)
3384 check_shape = shape(check)
3386 consist_shape = answer_shape == check_shape
3388 if (.not. all(consist_shape))
then
3389 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3391 write(*,*)
' shape of check is (', check_shape,
')'
3392 write(*,*)
' is INCORRECT'
3393 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
3399 allocate( mask_array( &
3400 & answer_shape(1), &
3402 & answer_shape(2), &
3404 & answer_shape(3), &
3406 & answer_shape(4), &
3408 & answer_shape(5), &
3410 & answer_shape(6) ) &
3414 & answer_shape(1), &
3416 & answer_shape(2), &
3418 & answer_shape(3), &
3420 & answer_shape(4), &
3422 & answer_shape(5), &
3424 & answer_shape(6) ) &
3427 allocate( judge_rev( &
3428 & answer_shape(1), &
3430 & answer_shape(2), &
3432 & answer_shape(3), &
3434 & answer_shape(4), &
3436 & answer_shape(5), &
3438 & answer_shape(6) ) &
3442 judge = abs(answer - check) <= 0.0
3447 judge_rev = .not. judge
3448 err_flag = any(judge_rev)
3450 pos = maxloc(mask_array, judge_rev)
3480 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
3482 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
3484 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
3486 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
3488 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
3490 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
3494 & trim(adjustl(pos_array(1))) //
',' // &
3496 & trim(adjustl(pos_array(2))) //
',' // &
3498 & trim(adjustl(pos_array(3))) //
',' // &
3500 & trim(adjustl(pos_array(4))) //
',' // &
3502 & trim(adjustl(pos_array(5))) //
',' // &
3504 & trim(adjustl(pos_array(6))) //
')'
3507 deallocate(mask_array, judge, judge_rev)
3513 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3515 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3516 write(*,*)
' is NOT EQUAL to'
3517 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3521 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3525 end subroutine dctestassertequalreal6
3528 subroutine dctestassertequalreal7(message, answer, check)
3532 character(*),
intent(in):: message
3533 real,
intent(in):: answer(:,:,:,:,:,:,:)
3534 real,
intent(in):: check(:,:,:,:,:,:,:)
3536 character(STRING):: pos_str
3539 integer:: answer_shape(7), check_shape(7), pos(7)
3540 logical:: consist_shape(7)
3541 character(TOKEN):: pos_array(7)
3542 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
3543 logical,
allocatable:: judge(:,:,:,:,:,:,:)
3544 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
3553 answer_shape = shape(answer)
3554 check_shape = shape(check)
3556 consist_shape = answer_shape == check_shape
3558 if (.not. all(consist_shape))
then
3559 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3561 write(*,*)
' shape of check is (', check_shape,
')'
3562 write(*,*)
' is INCORRECT'
3563 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
3569 allocate( mask_array( &
3570 & answer_shape(1), &
3572 & answer_shape(2), &
3574 & answer_shape(3), &
3576 & answer_shape(4), &
3578 & answer_shape(5), &
3580 & answer_shape(6), &
3582 & answer_shape(7) ) &
3586 & answer_shape(1), &
3588 & answer_shape(2), &
3590 & answer_shape(3), &
3592 & answer_shape(4), &
3594 & answer_shape(5), &
3596 & answer_shape(6), &
3598 & answer_shape(7) ) &
3601 allocate( judge_rev( &
3602 & answer_shape(1), &
3604 & answer_shape(2), &
3606 & answer_shape(3), &
3608 & answer_shape(4), &
3610 & answer_shape(5), &
3612 & answer_shape(6), &
3614 & answer_shape(7) ) &
3618 judge = abs(answer - check) <= 0.0
3623 judge_rev = .not. judge
3624 err_flag = any(judge_rev)
3626 pos = maxloc(mask_array, judge_rev)
3660 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
3662 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
3664 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
3666 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
3668 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
3670 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
3672 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
3676 & trim(adjustl(pos_array(1))) //
',' // &
3678 & trim(adjustl(pos_array(2))) //
',' // &
3680 & trim(adjustl(pos_array(3))) //
',' // &
3682 & trim(adjustl(pos_array(4))) //
',' // &
3684 & trim(adjustl(pos_array(5))) //
',' // &
3686 & trim(adjustl(pos_array(6))) //
',' // &
3688 & trim(adjustl(pos_array(7))) //
')'
3691 deallocate(mask_array, judge, judge_rev)
3697 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3699 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3700 write(*,*)
' is NOT EQUAL to'
3701 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3705 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3709 end subroutine dctestassertequalreal7
3712 subroutine dctestassertequaldouble0(message, answer, check)
3716 character(*),
intent(in):: message
3717 real(DP),
intent(in):: answer
3718 real(DP),
intent(in):: check
3720 character(STRING):: pos_str
3721 real(DP):: wrong, right
3731 err_flag = abs(answer - check) > 0.0_dp
3741 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3743 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3744 write(*,*)
' is NOT EQUAL to'
3745 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3749 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3753 end subroutine dctestassertequaldouble0
3756 subroutine dctestassertequaldouble1(message, answer, check)
3760 character(*),
intent(in):: message
3761 real(DP),
intent(in):: answer(:)
3762 real(DP),
intent(in):: check(:)
3764 character(STRING):: pos_str
3765 real(DP):: wrong, right
3767 integer:: answer_shape(1), check_shape(1), pos(1)
3768 logical:: consist_shape(1)
3769 character(TOKEN):: pos_array(1)
3770 integer,
allocatable:: mask_array(:)
3771 logical,
allocatable:: judge(:)
3772 logical,
allocatable:: judge_rev(:)
3781 answer_shape = shape(answer)
3782 check_shape = shape(check)
3784 consist_shape = answer_shape == check_shape
3786 if (.not. all(consist_shape))
then
3787 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3789 write(*,*)
' shape of check is (', check_shape,
')'
3790 write(*,*)
' is INCORRECT'
3791 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
3797 allocate( mask_array( &
3799 & answer_shape(1) ) &
3804 & answer_shape(1) ) &
3807 allocate( judge_rev( &
3809 & answer_shape(1) ) &
3813 judge = abs(answer - check) <= 0.0_dp
3818 judge_rev = .not. judge
3819 err_flag = any(judge_rev)
3821 pos = maxloc(mask_array, judge_rev)
3833 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
3838 & trim(adjustl(pos_array(1))) //
')'
3841 deallocate(mask_array, judge, judge_rev)
3847 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3849 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3850 write(*,*)
' is NOT EQUAL to'
3851 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3855 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3859 end subroutine dctestassertequaldouble1
3862 subroutine dctestassertequaldouble2(message, answer, check)
3866 character(*),
intent(in):: message
3867 real(DP),
intent(in):: answer(:,:)
3868 real(DP),
intent(in):: check(:,:)
3870 character(STRING):: pos_str
3871 real(DP):: wrong, right
3873 integer:: answer_shape(2), check_shape(2), pos(2)
3874 logical:: consist_shape(2)
3875 character(TOKEN):: pos_array(2)
3876 integer,
allocatable:: mask_array(:,:)
3877 logical,
allocatable:: judge(:,:)
3878 logical,
allocatable:: judge_rev(:,:)
3887 answer_shape = shape(answer)
3888 check_shape = shape(check)
3890 consist_shape = answer_shape == check_shape
3892 if (.not. all(consist_shape))
then
3893 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3895 write(*,*)
' shape of check is (', check_shape,
')'
3896 write(*,*)
' is INCORRECT'
3897 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
3903 allocate( mask_array( &
3904 & answer_shape(1), &
3906 & answer_shape(2) ) &
3910 & answer_shape(1), &
3912 & answer_shape(2) ) &
3915 allocate( judge_rev( &
3916 & answer_shape(1), &
3918 & answer_shape(2) ) &
3922 judge = abs(answer - check) <= 0.0_dp
3927 judge_rev = .not. judge
3928 err_flag = any(judge_rev)
3930 pos = maxloc(mask_array, judge_rev)
3944 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
3946 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
3950 & trim(adjustl(pos_array(1))) //
',' // &
3952 & trim(adjustl(pos_array(2))) //
')'
3955 deallocate(mask_array, judge, judge_rev)
3961 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
3963 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
3964 write(*,*)
' is NOT EQUAL to'
3965 write(*,*)
' answer' // trim(pos_str) //
' = ', right
3969 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
3973 end subroutine dctestassertequaldouble2
3976 subroutine dctestassertequaldouble3(message, answer, check)
3980 character(*),
intent(in):: message
3981 real(DP),
intent(in):: answer(:,:,:)
3982 real(DP),
intent(in):: check(:,:,:)
3984 character(STRING):: pos_str
3985 real(DP):: wrong, right
3987 integer:: answer_shape(3), check_shape(3), pos(3)
3988 logical:: consist_shape(3)
3989 character(TOKEN):: pos_array(3)
3990 integer,
allocatable:: mask_array(:,:,:)
3991 logical,
allocatable:: judge(:,:,:)
3992 logical,
allocatable:: judge_rev(:,:,:)
4001 answer_shape = shape(answer)
4002 check_shape = shape(check)
4004 consist_shape = answer_shape == check_shape
4006 if (.not. all(consist_shape))
then
4007 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4009 write(*,*)
' shape of check is (', check_shape,
')'
4010 write(*,*)
' is INCORRECT'
4011 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
4017 allocate( mask_array( &
4018 & answer_shape(1), &
4020 & answer_shape(2), &
4022 & answer_shape(3) ) &
4026 & answer_shape(1), &
4028 & answer_shape(2), &
4030 & answer_shape(3) ) &
4033 allocate( judge_rev( &
4034 & answer_shape(1), &
4036 & answer_shape(2), &
4038 & answer_shape(3) ) &
4042 judge = abs(answer - check) <= 0.0_dp
4047 judge_rev = .not. judge
4048 err_flag = any(judge_rev)
4050 pos = maxloc(mask_array, judge_rev)
4068 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
4070 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
4072 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
4076 & trim(adjustl(pos_array(1))) //
',' // &
4078 & trim(adjustl(pos_array(2))) //
',' // &
4080 & trim(adjustl(pos_array(3))) //
')'
4083 deallocate(mask_array, judge, judge_rev)
4089 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4091 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
4092 write(*,*)
' is NOT EQUAL to'
4093 write(*,*)
' answer' // trim(pos_str) //
' = ', right
4097 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
4101 end subroutine dctestassertequaldouble3
4104 subroutine dctestassertequaldouble4(message, answer, check)
4108 character(*),
intent(in):: message
4109 real(DP),
intent(in):: answer(:,:,:,:)
4110 real(DP),
intent(in):: check(:,:,:,:)
4112 character(STRING):: pos_str
4113 real(DP):: wrong, right
4115 integer:: answer_shape(4), check_shape(4), pos(4)
4116 logical:: consist_shape(4)
4117 character(TOKEN):: pos_array(4)
4118 integer,
allocatable:: mask_array(:,:,:,:)
4119 logical,
allocatable:: judge(:,:,:,:)
4120 logical,
allocatable:: judge_rev(:,:,:,:)
4129 answer_shape = shape(answer)
4130 check_shape = shape(check)
4132 consist_shape = answer_shape == check_shape
4134 if (.not. all(consist_shape))
then
4135 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4137 write(*,*)
' shape of check is (', check_shape,
')'
4138 write(*,*)
' is INCORRECT'
4139 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
4145 allocate( mask_array( &
4146 & answer_shape(1), &
4148 & answer_shape(2), &
4150 & answer_shape(3), &
4152 & answer_shape(4) ) &
4156 & answer_shape(1), &
4158 & answer_shape(2), &
4160 & answer_shape(3), &
4162 & answer_shape(4) ) &
4165 allocate( judge_rev( &
4166 & answer_shape(1), &
4168 & answer_shape(2), &
4170 & answer_shape(3), &
4172 & answer_shape(4) ) &
4176 judge = abs(answer - check) <= 0.0_dp
4181 judge_rev = .not. judge
4182 err_flag = any(judge_rev)
4184 pos = maxloc(mask_array, judge_rev)
4206 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
4208 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
4210 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
4212 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
4216 & trim(adjustl(pos_array(1))) //
',' // &
4218 & trim(adjustl(pos_array(2))) //
',' // &
4220 & trim(adjustl(pos_array(3))) //
',' // &
4222 & trim(adjustl(pos_array(4))) //
')'
4225 deallocate(mask_array, judge, judge_rev)
4231 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4233 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
4234 write(*,*)
' is NOT EQUAL to'
4235 write(*,*)
' answer' // trim(pos_str) //
' = ', right
4239 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
4243 end subroutine dctestassertequaldouble4
4246 subroutine dctestassertequaldouble5(message, answer, check)
4250 character(*),
intent(in):: message
4251 real(DP),
intent(in):: answer(:,:,:,:,:)
4252 real(DP),
intent(in):: check(:,:,:,:,:)
4254 character(STRING):: pos_str
4255 real(DP):: wrong, right
4257 integer:: answer_shape(5), check_shape(5), pos(5)
4258 logical:: consist_shape(5)
4259 character(TOKEN):: pos_array(5)
4260 integer,
allocatable:: mask_array(:,:,:,:,:)
4261 logical,
allocatable:: judge(:,:,:,:,:)
4262 logical,
allocatable:: judge_rev(:,:,:,:,:)
4271 answer_shape = shape(answer)
4272 check_shape = shape(check)
4274 consist_shape = answer_shape == check_shape
4276 if (.not. all(consist_shape))
then
4277 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4279 write(*,*)
' shape of check is (', check_shape,
')'
4280 write(*,*)
' is INCORRECT'
4281 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
4287 allocate( mask_array( &
4288 & answer_shape(1), &
4290 & answer_shape(2), &
4292 & answer_shape(3), &
4294 & answer_shape(4), &
4296 & answer_shape(5) ) &
4300 & answer_shape(1), &
4302 & answer_shape(2), &
4304 & answer_shape(3), &
4306 & answer_shape(4), &
4308 & answer_shape(5) ) &
4311 allocate( judge_rev( &
4312 & answer_shape(1), &
4314 & answer_shape(2), &
4316 & answer_shape(3), &
4318 & answer_shape(4), &
4320 & answer_shape(5) ) &
4324 judge = abs(answer - check) <= 0.0_dp
4329 judge_rev = .not. judge
4330 err_flag = any(judge_rev)
4332 pos = maxloc(mask_array, judge_rev)
4358 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
4360 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
4362 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
4364 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
4366 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
4370 & trim(adjustl(pos_array(1))) //
',' // &
4372 & trim(adjustl(pos_array(2))) //
',' // &
4374 & trim(adjustl(pos_array(3))) //
',' // &
4376 & trim(adjustl(pos_array(4))) //
',' // &
4378 & trim(adjustl(pos_array(5))) //
')'
4381 deallocate(mask_array, judge, judge_rev)
4387 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4389 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
4390 write(*,*)
' is NOT EQUAL to'
4391 write(*,*)
' answer' // trim(pos_str) //
' = ', right
4395 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
4399 end subroutine dctestassertequaldouble5
4402 subroutine dctestassertequaldouble6(message, answer, check)
4406 character(*),
intent(in):: message
4407 real(DP),
intent(in):: answer(:,:,:,:,:,:)
4408 real(DP),
intent(in):: check(:,:,:,:,:,:)
4410 character(STRING):: pos_str
4411 real(DP):: wrong, right
4413 integer:: answer_shape(6), check_shape(6), pos(6)
4414 logical:: consist_shape(6)
4415 character(TOKEN):: pos_array(6)
4416 integer,
allocatable:: mask_array(:,:,:,:,:,:)
4417 logical,
allocatable:: judge(:,:,:,:,:,:)
4418 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
4427 answer_shape = shape(answer)
4428 check_shape = shape(check)
4430 consist_shape = answer_shape == check_shape
4432 if (.not. all(consist_shape))
then
4433 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4435 write(*,*)
' shape of check is (', check_shape,
')'
4436 write(*,*)
' is INCORRECT'
4437 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
4443 allocate( mask_array( &
4444 & answer_shape(1), &
4446 & answer_shape(2), &
4448 & answer_shape(3), &
4450 & answer_shape(4), &
4452 & answer_shape(5), &
4454 & answer_shape(6) ) &
4458 & answer_shape(1), &
4460 & answer_shape(2), &
4462 & answer_shape(3), &
4464 & answer_shape(4), &
4466 & answer_shape(5), &
4468 & answer_shape(6) ) &
4471 allocate( judge_rev( &
4472 & answer_shape(1), &
4474 & answer_shape(2), &
4476 & answer_shape(3), &
4478 & answer_shape(4), &
4480 & answer_shape(5), &
4482 & answer_shape(6) ) &
4486 judge = abs(answer - check) <= 0.0_dp
4491 judge_rev = .not. judge
4492 err_flag = any(judge_rev)
4494 pos = maxloc(mask_array, judge_rev)
4524 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
4526 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
4528 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
4530 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
4532 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
4534 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
4538 & trim(adjustl(pos_array(1))) //
',' // &
4540 & trim(adjustl(pos_array(2))) //
',' // &
4542 & trim(adjustl(pos_array(3))) //
',' // &
4544 & trim(adjustl(pos_array(4))) //
',' // &
4546 & trim(adjustl(pos_array(5))) //
',' // &
4548 & trim(adjustl(pos_array(6))) //
')'
4551 deallocate(mask_array, judge, judge_rev)
4557 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4559 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
4560 write(*,*)
' is NOT EQUAL to'
4561 write(*,*)
' answer' // trim(pos_str) //
' = ', right
4565 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
4569 end subroutine dctestassertequaldouble6
4572 subroutine dctestassertequaldouble7(message, answer, check)
4576 character(*),
intent(in):: message
4577 real(DP),
intent(in):: answer(:,:,:,:,:,:,:)
4578 real(DP),
intent(in):: check(:,:,:,:,:,:,:)
4580 character(STRING):: pos_str
4581 real(DP):: wrong, right
4583 integer:: answer_shape(7), check_shape(7), pos(7)
4584 logical:: consist_shape(7)
4585 character(TOKEN):: pos_array(7)
4586 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
4587 logical,
allocatable:: judge(:,:,:,:,:,:,:)
4588 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
4597 answer_shape = shape(answer)
4598 check_shape = shape(check)
4600 consist_shape = answer_shape == check_shape
4602 if (.not. all(consist_shape))
then
4603 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4605 write(*,*)
' shape of check is (', check_shape,
')'
4606 write(*,*)
' is INCORRECT'
4607 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
4613 allocate( mask_array( &
4614 & answer_shape(1), &
4616 & answer_shape(2), &
4618 & answer_shape(3), &
4620 & answer_shape(4), &
4622 & answer_shape(5), &
4624 & answer_shape(6), &
4626 & answer_shape(7) ) &
4630 & answer_shape(1), &
4632 & answer_shape(2), &
4634 & answer_shape(3), &
4636 & answer_shape(4), &
4638 & answer_shape(5), &
4640 & answer_shape(6), &
4642 & answer_shape(7) ) &
4645 allocate( judge_rev( &
4646 & answer_shape(1), &
4648 & answer_shape(2), &
4650 & answer_shape(3), &
4652 & answer_shape(4), &
4654 & answer_shape(5), &
4656 & answer_shape(6), &
4658 & answer_shape(7) ) &
4662 judge = abs(answer - check) <= 0.0_dp
4667 judge_rev = .not. judge
4668 err_flag = any(judge_rev)
4670 pos = maxloc(mask_array, judge_rev)
4704 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
4706 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
4708 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
4710 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
4712 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
4714 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
4716 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
4720 & trim(adjustl(pos_array(1))) //
',' // &
4722 & trim(adjustl(pos_array(2))) //
',' // &
4724 & trim(adjustl(pos_array(3))) //
',' // &
4726 & trim(adjustl(pos_array(4))) //
',' // &
4728 & trim(adjustl(pos_array(5))) //
',' // &
4730 & trim(adjustl(pos_array(6))) //
',' // &
4732 & trim(adjustl(pos_array(7))) //
')'
4735 deallocate(mask_array, judge, judge_rev)
4741 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
4743 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
4744 write(*,*)
' is NOT EQUAL to'
4745 write(*,*)
' answer' // trim(pos_str) //
' = ', right
4749 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
4753 end subroutine dctestassertequaldouble7
4755 subroutine dctestassertequallogical0(message, answer, check)
4758 character(*),
intent(in):: message
4759 logical,
intent(in):: answer
4760 logical,
intent(in):: check
4762 character(STRING):: answer_str
4763 character(STRING):: check_str
4771 answer_str =
".true."
4773 answer_str =
".false."
4777 check_str =
".true."
4779 check_str =
".false."
4784 call dctestassertequalchar0(message, answer_str, check_str)
4788 end subroutine dctestassertequallogical0
4789 subroutine dctestassertequallogical1(message, answer, check)
4792 character(*),
intent(in):: message
4793 logical,
intent(in):: answer(:)
4794 logical,
intent(in):: check(:)
4796 integer:: answer_shape(1), check_shape(1), i
4797 logical,
allocatable:: answer_tmp(:), check_tmp(:)
4798 character(STRING),
allocatable:: answer_str_tmp(:), check_str_tmp(:)
4799 character(STRING),
allocatable:: answer_str(:)
4800 character(STRING),
allocatable:: check_str(:)
4807 allocate(answer_tmp(
size(answer)))
4808 allocate(check_tmp(
size(check)))
4809 allocate(answer_str_tmp(
size(answer)))
4810 allocate(check_str_tmp(
size(check)))
4811 answer_tmp = pack(answer, .true.)
4812 check_tmp = pack(check, .true.)
4814 do i = 1,
size(answer_tmp)
4815 if (answer_tmp(i))
then
4816 answer_str_tmp(i) =
'.true.'
4818 answer_str_tmp(i) =
'.false.'
4822 do i = 1,
size(check_tmp)
4823 if (check_tmp(i))
then
4824 check_str_tmp(i) =
'.true.'
4826 check_str_tmp(i) =
'.false.'
4830 answer_shape = shape(answer)
4831 check_shape = shape(check)
4833 allocate( answer_str( &
4835 & answer_shape(1) ) &
4838 allocate( check_str( &
4840 & check_shape(1) ) &
4843 answer_str = reshape(answer_str_tmp, answer_shape)
4844 check_str = reshape(check_str_tmp, check_shape)
4848 call dctestassertequalchar1(message, answer_str, check_str)
4850 deallocate(answer_str, answer_tmp, answer_str_tmp)
4851 deallocate(check_str, check_tmp, check_str_tmp)
4854 end subroutine dctestassertequallogical1
4855 subroutine dctestassertequallogical2(message, answer, check)
4858 character(*),
intent(in):: message
4859 logical,
intent(in):: answer(:,:)
4860 logical,
intent(in):: check(:,:)
4862 integer:: answer_shape(2), check_shape(2), i
4863 logical,
allocatable:: answer_tmp(:), check_tmp(:)
4864 character(STRING),
allocatable:: answer_str_tmp(:), check_str_tmp(:)
4865 character(STRING),
allocatable:: answer_str(:,:)
4866 character(STRING),
allocatable:: check_str(:,:)
4873 allocate(answer_tmp(
size(answer)))
4874 allocate(check_tmp(
size(check)))
4875 allocate(answer_str_tmp(
size(answer)))
4876 allocate(check_str_tmp(
size(check)))
4877 answer_tmp = pack(answer, .true.)
4878 check_tmp = pack(check, .true.)
4880 do i = 1,
size(answer_tmp)
4881 if (answer_tmp(i))
then
4882 answer_str_tmp(i) =
'.true.'
4884 answer_str_tmp(i) =
'.false.'
4888 do i = 1,
size(check_tmp)
4889 if (check_tmp(i))
then
4890 check_str_tmp(i) =
'.true.'
4892 check_str_tmp(i) =
'.false.'
4896 answer_shape = shape(answer)
4897 check_shape = shape(check)
4899 allocate( answer_str( &
4900 & answer_shape(1), &
4902 & answer_shape(2) ) &
4905 allocate( check_str( &
4908 & check_shape(2) ) &
4911 answer_str = reshape(answer_str_tmp, answer_shape)
4912 check_str = reshape(check_str_tmp, check_shape)
4916 call dctestassertequalchar2(message, answer_str, check_str)
4918 deallocate(answer_str, answer_tmp, answer_str_tmp)
4919 deallocate(check_str, check_tmp, check_str_tmp)
4922 end subroutine dctestassertequallogical2
4923 subroutine dctestassertequallogical3(message, answer, check)
4926 character(*),
intent(in):: message
4927 logical,
intent(in):: answer(:,:,:)
4928 logical,
intent(in):: check(:,:,:)
4930 integer:: answer_shape(3), check_shape(3), i
4931 logical,
allocatable:: answer_tmp(:), check_tmp(:)
4932 character(STRING),
allocatable:: answer_str_tmp(:), check_str_tmp(:)
4933 character(STRING),
allocatable:: answer_str(:,:,:)
4934 character(STRING),
allocatable:: check_str(:,:,:)
4941 allocate(answer_tmp(
size(answer)))
4942 allocate(check_tmp(
size(check)))
4943 allocate(answer_str_tmp(
size(answer)))
4944 allocate(check_str_tmp(
size(check)))
4945 answer_tmp = pack(answer, .true.)
4946 check_tmp = pack(check, .true.)
4948 do i = 1,
size(answer_tmp)
4949 if (answer_tmp(i))
then
4950 answer_str_tmp(i) =
'.true.'
4952 answer_str_tmp(i) =
'.false.'
4956 do i = 1,
size(check_tmp)
4957 if (check_tmp(i))
then
4958 check_str_tmp(i) =
'.true.'
4960 check_str_tmp(i) =
'.false.'
4964 answer_shape = shape(answer)
4965 check_shape = shape(check)
4967 allocate( answer_str( &
4968 & answer_shape(1), &
4970 & answer_shape(2), &
4972 & answer_shape(3) ) &
4975 allocate( check_str( &
4980 & check_shape(3) ) &
4983 answer_str = reshape(answer_str_tmp, answer_shape)
4984 check_str = reshape(check_str_tmp, check_shape)
4988 call dctestassertequalchar3(message, answer_str, check_str)
4990 deallocate(answer_str, answer_tmp, answer_str_tmp)
4991 deallocate(check_str, check_tmp, check_str_tmp)
4994 end subroutine dctestassertequallogical3
4995 subroutine dctestassertequallogical4(message, answer, check)
4998 character(*),
intent(in):: message
4999 logical,
intent(in):: answer(:,:,:,:)
5000 logical,
intent(in):: check(:,:,:,:)
5002 integer:: answer_shape(4), check_shape(4), i
5003 logical,
allocatable:: answer_tmp(:), check_tmp(:)
5004 character(STRING),
allocatable:: answer_str_tmp(:), check_str_tmp(:)
5005 character(STRING),
allocatable:: answer_str(:,:,:,:)
5006 character(STRING),
allocatable:: check_str(:,:,:,:)
5013 allocate(answer_tmp(
size(answer)))
5014 allocate(check_tmp(
size(check)))
5015 allocate(answer_str_tmp(
size(answer)))
5016 allocate(check_str_tmp(
size(check)))
5017 answer_tmp = pack(answer, .true.)
5018 check_tmp = pack(check, .true.)
5020 do i = 1,
size(answer_tmp)
5021 if (answer_tmp(i))
then
5022 answer_str_tmp(i) =
'.true.'
5024 answer_str_tmp(i) =
'.false.'
5028 do i = 1,
size(check_tmp)
5029 if (check_tmp(i))
then
5030 check_str_tmp(i) =
'.true.'
5032 check_str_tmp(i) =
'.false.'
5036 answer_shape = shape(answer)
5037 check_shape = shape(check)
5039 allocate( answer_str( &
5040 & answer_shape(1), &
5042 & answer_shape(2), &
5044 & answer_shape(3), &
5046 & answer_shape(4) ) &
5049 allocate( check_str( &
5056 & check_shape(4) ) &
5059 answer_str = reshape(answer_str_tmp, answer_shape)
5060 check_str = reshape(check_str_tmp, check_shape)
5064 call dctestassertequalchar4(message, answer_str, check_str)
5066 deallocate(answer_str, answer_tmp, answer_str_tmp)
5067 deallocate(check_str, check_tmp, check_str_tmp)
5070 end subroutine dctestassertequallogical4
5071 subroutine dctestassertequallogical5(message, answer, check)
5074 character(*),
intent(in):: message
5075 logical,
intent(in):: answer(:,:,:,:,:)
5076 logical,
intent(in):: check(:,:,:,:,:)
5078 integer:: answer_shape(5), check_shape(5), i
5079 logical,
allocatable:: answer_tmp(:), check_tmp(:)
5080 character(STRING),
allocatable:: answer_str_tmp(:), check_str_tmp(:)
5081 character(STRING),
allocatable:: answer_str(:,:,:,:,:)
5082 character(STRING),
allocatable:: check_str(:,:,:,:,:)
5089 allocate(answer_tmp(
size(answer)))
5090 allocate(check_tmp(
size(check)))
5091 allocate(answer_str_tmp(
size(answer)))
5092 allocate(check_str_tmp(
size(check)))
5093 answer_tmp = pack(answer, .true.)
5094 check_tmp = pack(check, .true.)
5096 do i = 1,
size(answer_tmp)
5097 if (answer_tmp(i))
then
5098 answer_str_tmp(i) =
'.true.'
5100 answer_str_tmp(i) =
'.false.'
5104 do i = 1,
size(check_tmp)
5105 if (check_tmp(i))
then
5106 check_str_tmp(i) =
'.true.'
5108 check_str_tmp(i) =
'.false.'
5112 answer_shape = shape(answer)
5113 check_shape = shape(check)
5115 allocate( answer_str( &
5116 & answer_shape(1), &
5118 & answer_shape(2), &
5120 & answer_shape(3), &
5122 & answer_shape(4), &
5124 & answer_shape(5) ) &
5127 allocate( check_str( &
5136 & check_shape(5) ) &
5139 answer_str = reshape(answer_str_tmp, answer_shape)
5140 check_str = reshape(check_str_tmp, check_shape)
5144 call dctestassertequalchar5(message, answer_str, check_str)
5146 deallocate(answer_str, answer_tmp, answer_str_tmp)
5147 deallocate(check_str, check_tmp, check_str_tmp)
5150 end subroutine dctestassertequallogical5
5151 subroutine dctestassertequallogical6(message, answer, check)
5154 character(*),
intent(in):: message
5155 logical,
intent(in):: answer(:,:,:,:,:,:)
5156 logical,
intent(in):: check(:,:,:,:,:,:)
5158 integer:: answer_shape(6), check_shape(6), i
5159 logical,
allocatable:: answer_tmp(:), check_tmp(:)
5160 character(STRING),
allocatable:: answer_str_tmp(:), check_str_tmp(:)
5161 character(STRING),
allocatable:: answer_str(:,:,:,:,:,:)
5162 character(STRING),
allocatable:: check_str(:,:,:,:,:,:)
5169 allocate(answer_tmp(
size(answer)))
5170 allocate(check_tmp(
size(check)))
5171 allocate(answer_str_tmp(
size(answer)))
5172 allocate(check_str_tmp(
size(check)))
5173 answer_tmp = pack(answer, .true.)
5174 check_tmp = pack(check, .true.)
5176 do i = 1,
size(answer_tmp)
5177 if (answer_tmp(i))
then
5178 answer_str_tmp(i) =
'.true.'
5180 answer_str_tmp(i) =
'.false.'
5184 do i = 1,
size(check_tmp)
5185 if (check_tmp(i))
then
5186 check_str_tmp(i) =
'.true.'
5188 check_str_tmp(i) =
'.false.'
5192 answer_shape = shape(answer)
5193 check_shape = shape(check)
5195 allocate( answer_str( &
5196 & answer_shape(1), &
5198 & answer_shape(2), &
5200 & answer_shape(3), &
5202 & answer_shape(4), &
5204 & answer_shape(5), &
5206 & answer_shape(6) ) &
5209 allocate( check_str( &
5220 & check_shape(6) ) &
5223 answer_str = reshape(answer_str_tmp, answer_shape)
5224 check_str = reshape(check_str_tmp, check_shape)
5228 call dctestassertequalchar6(message, answer_str, check_str)
5230 deallocate(answer_str, answer_tmp, answer_str_tmp)
5231 deallocate(check_str, check_tmp, check_str_tmp)
5234 end subroutine dctestassertequallogical6
5235 subroutine dctestassertequallogical7(message, answer, check)
5238 character(*),
intent(in):: message
5239 logical,
intent(in):: answer(:,:,:,:,:,:,:)
5240 logical,
intent(in):: check(:,:,:,:,:,:,:)
5242 integer:: answer_shape(7), check_shape(7), i
5243 logical,
allocatable:: answer_tmp(:), check_tmp(:)
5244 character(STRING),
allocatable:: answer_str_tmp(:), check_str_tmp(:)
5245 character(STRING),
allocatable:: answer_str(:,:,:,:,:,:,:)
5246 character(STRING),
allocatable:: check_str(:,:,:,:,:,:,:)
5253 allocate(answer_tmp(
size(answer)))
5254 allocate(check_tmp(
size(check)))
5255 allocate(answer_str_tmp(
size(answer)))
5256 allocate(check_str_tmp(
size(check)))
5257 answer_tmp = pack(answer, .true.)
5258 check_tmp = pack(check, .true.)
5260 do i = 1,
size(answer_tmp)
5261 if (answer_tmp(i))
then
5262 answer_str_tmp(i) =
'.true.'
5264 answer_str_tmp(i) =
'.false.'
5268 do i = 1,
size(check_tmp)
5269 if (check_tmp(i))
then
5270 check_str_tmp(i) =
'.true.'
5272 check_str_tmp(i) =
'.false.'
5276 answer_shape = shape(answer)
5277 check_shape = shape(check)
5279 allocate( answer_str( &
5280 & answer_shape(1), &
5282 & answer_shape(2), &
5284 & answer_shape(3), &
5286 & answer_shape(4), &
5288 & answer_shape(5), &
5290 & answer_shape(6), &
5292 & answer_shape(7) ) &
5295 allocate( check_str( &
5308 & check_shape(7) ) &
5311 answer_str = reshape(answer_str_tmp, answer_shape)
5312 check_str = reshape(check_str_tmp, check_shape)
5316 call dctestassertequalchar7(message, answer_str, check_str)
5318 deallocate(answer_str, answer_tmp, answer_str_tmp)
5319 deallocate(check_str, check_tmp, check_str_tmp)
5322 end subroutine dctestassertequallogical7
5324 subroutine dctestassertequalreal0digits( &
5325 & message, answer, check, significant_digits, ignore_digits )
5329 character(*),
intent(in):: message
5330 real,
intent(in):: answer
5331 real,
intent(in):: check
5332 integer,
intent(in):: significant_digits
5333 integer,
intent(in):: ignore_digits
5335 character(STRING):: pos_str
5336 real:: wrong, right_max, right_min
5337 character(STRING):: pos_str_space
5338 integer:: pos_str_len
5347 if ( significant_digits < 1 )
then
5348 write(*,*)
' *** Error [AssertEQ] *** '
5349 write(*,*)
' Specify a number more than 1 to "significant_digits"'
5353 if ( answer < 0.0 .and. check < 0.0 )
then
5357 & - 0.1 ** significant_digits ) &
5358 & + 0.1 ** (- ignore_digits)
5363 & + 0.1 ** significant_digits ) &
5364 & - 0.1 ** (- ignore_digits)
5370 & + 0.1 ** significant_digits ) &
5371 & + 0.1 ** (- ignore_digits)
5376 & - 0.1 ** significant_digits ) &
5377 & - 0.1 ** (- ignore_digits)
5381 right_max = answer_max
5382 right_min = answer_min
5383 if ( right_max < right_min )
then
5384 right_tmp = right_max
5385 right_max = right_min
5386 right_min = right_tmp
5389 err_flag = .not. (answer_max > check .and. check > answer_min)
5397 pos_str_len = len_trim(pos_str)
5399 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
5401 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
5402 write(*,*)
' is NOT EQUAL to'
5403 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
5404 & //
' ', right_min,
' < '
5405 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
5409 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
5413 end subroutine dctestassertequalreal0digits
5416 subroutine dctestassertequalreal1digits( &
5417 & message, answer, check, significant_digits, ignore_digits )
5421 character(*),
intent(in):: message
5422 real,
intent(in):: answer(:)
5423 real,
intent(in):: check(:)
5424 integer,
intent(in):: significant_digits
5425 integer,
intent(in):: ignore_digits
5427 character(STRING):: pos_str
5428 real:: wrong, right_max, right_min
5429 character(STRING):: pos_str_space
5430 integer:: pos_str_len
5433 integer:: answer_shape(1), check_shape(1), pos(1)
5434 logical:: consist_shape(1)
5435 character(TOKEN):: pos_array(1)
5436 integer,
allocatable:: mask_array(:)
5437 logical,
allocatable:: judge(:)
5438 logical,
allocatable:: judge_rev(:)
5439 logical,
allocatable:: answer_negative(:)
5440 logical,
allocatable:: check_negative(:)
5441 logical,
allocatable:: both_negative(:)
5442 real,
allocatable:: answer_max(:)
5443 real,
allocatable:: answer_min(:)
5448 if ( significant_digits < 1 )
then
5449 write(*,*)
' *** Error [AssertEQ] *** '
5450 write(*,*)
' Specify a number more than 1 to "significant_digits"'
5454 answer_shape = shape(answer)
5455 check_shape = shape(check)
5457 consist_shape = answer_shape == check_shape
5459 if (.not. all(consist_shape))
then
5460 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
5462 write(*,*)
' shape of check is (', check_shape,
')'
5463 write(*,*)
' is INCORRECT'
5464 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
5470 allocate( mask_array( &
5472 & answer_shape(1) ) &
5477 & answer_shape(1) ) &
5480 allocate( judge_rev( &
5482 & answer_shape(1) ) &
5485 allocate( answer_negative( &
5487 & answer_shape(1) ) &
5490 allocate( check_negative( &
5492 & answer_shape(1) ) &
5495 allocate( both_negative( &
5497 & answer_shape(1) ) &
5500 allocate( answer_max( &
5502 & answer_shape(1) ) &
5505 allocate( answer_min( &
5507 & answer_shape(1) ) &
5510 answer_negative = answer < 0.0
5511 check_negative = check < 0.0
5512 both_negative = answer_negative .and. check_negative
5514 where (both_negative)
5518 & - 0.1 ** significant_digits ) &
5519 & + 0.1 ** (- ignore_digits)
5524 & + 0.1 ** significant_digits ) &
5525 & - 0.1 ** (- ignore_digits)
5530 & + 0.1 ** significant_digits ) &
5531 & + 0.1 ** (- ignore_digits)
5536 & - 0.1 ** significant_digits ) &
5537 & - 0.1 ** (- ignore_digits)
5540 judge = answer_max > check .and. check > answer_min
5541 judge_rev = .not. judge
5542 err_flag = any(judge_rev)
5544 pos = maxloc(mask_array, judge_rev)
5552 right_max = answer_max( &
5556 right_min = answer_min( &
5560 if ( right_max < right_min )
then
5561 right_tmp = right_max
5562 right_max = right_min
5563 right_min = right_tmp
5566 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
5571 & trim(adjustl(pos_array(1))) //
')'
5574 deallocate(mask_array, judge, judge_rev)
5575 deallocate(answer_negative, check_negative, both_negative)
5576 deallocate(answer_max, answer_min)
5582 pos_str_len = len_trim(pos_str)
5584 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
5586 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
5587 write(*,*)
' is NOT EQUAL to'
5588 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
5589 & //
' ', right_min,
' < '
5590 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
5594 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
5598 end subroutine dctestassertequalreal1digits
5601 subroutine dctestassertequalreal2digits( &
5602 & message, answer, check, significant_digits, ignore_digits )
5606 character(*),
intent(in):: message
5607 real,
intent(in):: answer(:,:)
5608 real,
intent(in):: check(:,:)
5609 integer,
intent(in):: significant_digits
5610 integer,
intent(in):: ignore_digits
5612 character(STRING):: pos_str
5613 real:: wrong, right_max, right_min
5614 character(STRING):: pos_str_space
5615 integer:: pos_str_len
5618 integer:: answer_shape(2), check_shape(2), pos(2)
5619 logical:: consist_shape(2)
5620 character(TOKEN):: pos_array(2)
5621 integer,
allocatable:: mask_array(:,:)
5622 logical,
allocatable:: judge(:,:)
5623 logical,
allocatable:: judge_rev(:,:)
5624 logical,
allocatable:: answer_negative(:,:)
5625 logical,
allocatable:: check_negative(:,:)
5626 logical,
allocatable:: both_negative(:,:)
5627 real,
allocatable:: answer_max(:,:)
5628 real,
allocatable:: answer_min(:,:)
5633 if ( significant_digits < 1 )
then
5634 write(*,*)
' *** Error [AssertEQ] *** '
5635 write(*,*)
' Specify a number more than 1 to "significant_digits"'
5639 answer_shape = shape(answer)
5640 check_shape = shape(check)
5642 consist_shape = answer_shape == check_shape
5644 if (.not. all(consist_shape))
then
5645 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
5647 write(*,*)
' shape of check is (', check_shape,
')'
5648 write(*,*)
' is INCORRECT'
5649 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
5655 allocate( mask_array( &
5656 & answer_shape(1), &
5658 & answer_shape(2) ) &
5662 & answer_shape(1), &
5664 & answer_shape(2) ) &
5667 allocate( judge_rev( &
5668 & answer_shape(1), &
5670 & answer_shape(2) ) &
5673 allocate( answer_negative( &
5674 & answer_shape(1), &
5676 & answer_shape(2) ) &
5679 allocate( check_negative( &
5680 & answer_shape(1), &
5682 & answer_shape(2) ) &
5685 allocate( both_negative( &
5686 & answer_shape(1), &
5688 & answer_shape(2) ) &
5691 allocate( answer_max( &
5692 & answer_shape(1), &
5694 & answer_shape(2) ) &
5697 allocate( answer_min( &
5698 & answer_shape(1), &
5700 & answer_shape(2) ) &
5703 answer_negative = answer < 0.0
5704 check_negative = check < 0.0
5705 both_negative = answer_negative .and. check_negative
5707 where (both_negative)
5711 & - 0.1 ** significant_digits ) &
5712 & + 0.1 ** (- ignore_digits)
5717 & + 0.1 ** significant_digits ) &
5718 & - 0.1 ** (- ignore_digits)
5723 & + 0.1 ** significant_digits ) &
5724 & + 0.1 ** (- ignore_digits)
5729 & - 0.1 ** significant_digits ) &
5730 & - 0.1 ** (- ignore_digits)
5733 judge = answer_max > check .and. check > answer_min
5734 judge_rev = .not. judge
5735 err_flag = any(judge_rev)
5737 pos = maxloc(mask_array, judge_rev)
5746 right_max = answer_max( &
5751 right_min = answer_min( &
5756 if ( right_max < right_min )
then
5757 right_tmp = right_max
5758 right_max = right_min
5759 right_min = right_tmp
5762 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
5764 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
5768 & trim(adjustl(pos_array(1))) //
',' // &
5770 & trim(adjustl(pos_array(2))) //
')'
5773 deallocate(mask_array, judge, judge_rev)
5774 deallocate(answer_negative, check_negative, both_negative)
5775 deallocate(answer_max, answer_min)
5781 pos_str_len = len_trim(pos_str)
5783 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
5785 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
5786 write(*,*)
' is NOT EQUAL to'
5787 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
5788 & //
' ', right_min,
' < '
5789 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
5793 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
5797 end subroutine dctestassertequalreal2digits
5800 subroutine dctestassertequalreal3digits( &
5801 & message, answer, check, significant_digits, ignore_digits )
5805 character(*),
intent(in):: message
5806 real,
intent(in):: answer(:,:,:)
5807 real,
intent(in):: check(:,:,:)
5808 integer,
intent(in):: significant_digits
5809 integer,
intent(in):: ignore_digits
5811 character(STRING):: pos_str
5812 real:: wrong, right_max, right_min
5813 character(STRING):: pos_str_space
5814 integer:: pos_str_len
5817 integer:: answer_shape(3), check_shape(3), pos(3)
5818 logical:: consist_shape(3)
5819 character(TOKEN):: pos_array(3)
5820 integer,
allocatable:: mask_array(:,:,:)
5821 logical,
allocatable:: judge(:,:,:)
5822 logical,
allocatable:: judge_rev(:,:,:)
5823 logical,
allocatable:: answer_negative(:,:,:)
5824 logical,
allocatable:: check_negative(:,:,:)
5825 logical,
allocatable:: both_negative(:,:,:)
5826 real,
allocatable:: answer_max(:,:,:)
5827 real,
allocatable:: answer_min(:,:,:)
5832 if ( significant_digits < 1 )
then
5833 write(*,*)
' *** Error [AssertEQ] *** '
5834 write(*,*)
' Specify a number more than 1 to "significant_digits"'
5838 answer_shape = shape(answer)
5839 check_shape = shape(check)
5841 consist_shape = answer_shape == check_shape
5843 if (.not. all(consist_shape))
then
5844 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
5846 write(*,*)
' shape of check is (', check_shape,
')'
5847 write(*,*)
' is INCORRECT'
5848 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
5854 allocate( mask_array( &
5855 & answer_shape(1), &
5857 & answer_shape(2), &
5859 & answer_shape(3) ) &
5863 & answer_shape(1), &
5865 & answer_shape(2), &
5867 & answer_shape(3) ) &
5870 allocate( judge_rev( &
5871 & answer_shape(1), &
5873 & answer_shape(2), &
5875 & answer_shape(3) ) &
5878 allocate( answer_negative( &
5879 & answer_shape(1), &
5881 & answer_shape(2), &
5883 & answer_shape(3) ) &
5886 allocate( check_negative( &
5887 & answer_shape(1), &
5889 & answer_shape(2), &
5891 & answer_shape(3) ) &
5894 allocate( both_negative( &
5895 & answer_shape(1), &
5897 & answer_shape(2), &
5899 & answer_shape(3) ) &
5902 allocate( answer_max( &
5903 & answer_shape(1), &
5905 & answer_shape(2), &
5907 & answer_shape(3) ) &
5910 allocate( answer_min( &
5911 & answer_shape(1), &
5913 & answer_shape(2), &
5915 & answer_shape(3) ) &
5918 answer_negative = answer < 0.0
5919 check_negative = check < 0.0
5920 both_negative = answer_negative .and. check_negative
5922 where (both_negative)
5926 & - 0.1 ** significant_digits ) &
5927 & + 0.1 ** (- ignore_digits)
5932 & + 0.1 ** significant_digits ) &
5933 & - 0.1 ** (- ignore_digits)
5938 & + 0.1 ** significant_digits ) &
5939 & + 0.1 ** (- ignore_digits)
5944 & - 0.1 ** significant_digits ) &
5945 & - 0.1 ** (- ignore_digits)
5948 judge = answer_max > check .and. check > answer_min
5949 judge_rev = .not. judge
5950 err_flag = any(judge_rev)
5952 pos = maxloc(mask_array, judge_rev)
5963 right_max = answer_max( &
5970 right_min = answer_min( &
5977 if ( right_max < right_min )
then
5978 right_tmp = right_max
5979 right_max = right_min
5980 right_min = right_tmp
5983 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
5985 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
5987 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
5991 & trim(adjustl(pos_array(1))) //
',' // &
5993 & trim(adjustl(pos_array(2))) //
',' // &
5995 & trim(adjustl(pos_array(3))) //
')'
5998 deallocate(mask_array, judge, judge_rev)
5999 deallocate(answer_negative, check_negative, both_negative)
6000 deallocate(answer_max, answer_min)
6006 pos_str_len = len_trim(pos_str)
6008 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6010 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
6011 write(*,*)
' is NOT EQUAL to'
6012 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
6013 & //
' ', right_min,
' < '
6014 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
6018 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
6022 end subroutine dctestassertequalreal3digits
6025 subroutine dctestassertequalreal4digits( &
6026 & message, answer, check, significant_digits, ignore_digits )
6030 character(*),
intent(in):: message
6031 real,
intent(in):: answer(:,:,:,:)
6032 real,
intent(in):: check(:,:,:,:)
6033 integer,
intent(in):: significant_digits
6034 integer,
intent(in):: ignore_digits
6036 character(STRING):: pos_str
6037 real:: wrong, right_max, right_min
6038 character(STRING):: pos_str_space
6039 integer:: pos_str_len
6042 integer:: answer_shape(4), check_shape(4), pos(4)
6043 logical:: consist_shape(4)
6044 character(TOKEN):: pos_array(4)
6045 integer,
allocatable:: mask_array(:,:,:,:)
6046 logical,
allocatable:: judge(:,:,:,:)
6047 logical,
allocatable:: judge_rev(:,:,:,:)
6048 logical,
allocatable:: answer_negative(:,:,:,:)
6049 logical,
allocatable:: check_negative(:,:,:,:)
6050 logical,
allocatable:: both_negative(:,:,:,:)
6051 real,
allocatable:: answer_max(:,:,:,:)
6052 real,
allocatable:: answer_min(:,:,:,:)
6057 if ( significant_digits < 1 )
then
6058 write(*,*)
' *** Error [AssertEQ] *** '
6059 write(*,*)
' Specify a number more than 1 to "significant_digits"'
6063 answer_shape = shape(answer)
6064 check_shape = shape(check)
6066 consist_shape = answer_shape == check_shape
6068 if (.not. all(consist_shape))
then
6069 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6071 write(*,*)
' shape of check is (', check_shape,
')'
6072 write(*,*)
' is INCORRECT'
6073 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
6079 allocate( mask_array( &
6080 & answer_shape(1), &
6082 & answer_shape(2), &
6084 & answer_shape(3), &
6086 & answer_shape(4) ) &
6090 & answer_shape(1), &
6092 & answer_shape(2), &
6094 & answer_shape(3), &
6096 & answer_shape(4) ) &
6099 allocate( judge_rev( &
6100 & answer_shape(1), &
6102 & answer_shape(2), &
6104 & answer_shape(3), &
6106 & answer_shape(4) ) &
6109 allocate( answer_negative( &
6110 & answer_shape(1), &
6112 & answer_shape(2), &
6114 & answer_shape(3), &
6116 & answer_shape(4) ) &
6119 allocate( check_negative( &
6120 & answer_shape(1), &
6122 & answer_shape(2), &
6124 & answer_shape(3), &
6126 & answer_shape(4) ) &
6129 allocate( both_negative( &
6130 & answer_shape(1), &
6132 & answer_shape(2), &
6134 & answer_shape(3), &
6136 & answer_shape(4) ) &
6139 allocate( answer_max( &
6140 & answer_shape(1), &
6142 & answer_shape(2), &
6144 & answer_shape(3), &
6146 & answer_shape(4) ) &
6149 allocate( answer_min( &
6150 & answer_shape(1), &
6152 & answer_shape(2), &
6154 & answer_shape(3), &
6156 & answer_shape(4) ) &
6159 answer_negative = answer < 0.0
6160 check_negative = check < 0.0
6161 both_negative = answer_negative .and. check_negative
6163 where (both_negative)
6167 & - 0.1 ** significant_digits ) &
6168 & + 0.1 ** (- ignore_digits)
6173 & + 0.1 ** significant_digits ) &
6174 & - 0.1 ** (- ignore_digits)
6179 & + 0.1 ** significant_digits ) &
6180 & + 0.1 ** (- ignore_digits)
6185 & - 0.1 ** significant_digits ) &
6186 & - 0.1 ** (- ignore_digits)
6189 judge = answer_max > check .and. check > answer_min
6190 judge_rev = .not. judge
6191 err_flag = any(judge_rev)
6193 pos = maxloc(mask_array, judge_rev)
6206 right_max = answer_max( &
6215 right_min = answer_min( &
6224 if ( right_max < right_min )
then
6225 right_tmp = right_max
6226 right_max = right_min
6227 right_min = right_tmp
6230 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
6232 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
6234 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
6236 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
6240 & trim(adjustl(pos_array(1))) //
',' // &
6242 & trim(adjustl(pos_array(2))) //
',' // &
6244 & trim(adjustl(pos_array(3))) //
',' // &
6246 & trim(adjustl(pos_array(4))) //
')'
6249 deallocate(mask_array, judge, judge_rev)
6250 deallocate(answer_negative, check_negative, both_negative)
6251 deallocate(answer_max, answer_min)
6257 pos_str_len = len_trim(pos_str)
6259 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6261 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
6262 write(*,*)
' is NOT EQUAL to'
6263 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
6264 & //
' ', right_min,
' < '
6265 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
6269 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
6273 end subroutine dctestassertequalreal4digits
6276 subroutine dctestassertequalreal5digits( &
6277 & message, answer, check, significant_digits, ignore_digits )
6281 character(*),
intent(in):: message
6282 real,
intent(in):: answer(:,:,:,:,:)
6283 real,
intent(in):: check(:,:,:,:,:)
6284 integer,
intent(in):: significant_digits
6285 integer,
intent(in):: ignore_digits
6287 character(STRING):: pos_str
6288 real:: wrong, right_max, right_min
6289 character(STRING):: pos_str_space
6290 integer:: pos_str_len
6293 integer:: answer_shape(5), check_shape(5), pos(5)
6294 logical:: consist_shape(5)
6295 character(TOKEN):: pos_array(5)
6296 integer,
allocatable:: mask_array(:,:,:,:,:)
6297 logical,
allocatable:: judge(:,:,:,:,:)
6298 logical,
allocatable:: judge_rev(:,:,:,:,:)
6299 logical,
allocatable:: answer_negative(:,:,:,:,:)
6300 logical,
allocatable:: check_negative(:,:,:,:,:)
6301 logical,
allocatable:: both_negative(:,:,:,:,:)
6302 real,
allocatable:: answer_max(:,:,:,:,:)
6303 real,
allocatable:: answer_min(:,:,:,:,:)
6308 if ( significant_digits < 1 )
then
6309 write(*,*)
' *** Error [AssertEQ] *** '
6310 write(*,*)
' Specify a number more than 1 to "significant_digits"'
6314 answer_shape = shape(answer)
6315 check_shape = shape(check)
6317 consist_shape = answer_shape == check_shape
6319 if (.not. all(consist_shape))
then
6320 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6322 write(*,*)
' shape of check is (', check_shape,
')'
6323 write(*,*)
' is INCORRECT'
6324 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
6330 allocate( mask_array( &
6331 & answer_shape(1), &
6333 & answer_shape(2), &
6335 & answer_shape(3), &
6337 & answer_shape(4), &
6339 & answer_shape(5) ) &
6343 & answer_shape(1), &
6345 & answer_shape(2), &
6347 & answer_shape(3), &
6349 & answer_shape(4), &
6351 & answer_shape(5) ) &
6354 allocate( judge_rev( &
6355 & answer_shape(1), &
6357 & answer_shape(2), &
6359 & answer_shape(3), &
6361 & answer_shape(4), &
6363 & answer_shape(5) ) &
6366 allocate( answer_negative( &
6367 & answer_shape(1), &
6369 & answer_shape(2), &
6371 & answer_shape(3), &
6373 & answer_shape(4), &
6375 & answer_shape(5) ) &
6378 allocate( check_negative( &
6379 & answer_shape(1), &
6381 & answer_shape(2), &
6383 & answer_shape(3), &
6385 & answer_shape(4), &
6387 & answer_shape(5) ) &
6390 allocate( both_negative( &
6391 & answer_shape(1), &
6393 & answer_shape(2), &
6395 & answer_shape(3), &
6397 & answer_shape(4), &
6399 & answer_shape(5) ) &
6402 allocate( answer_max( &
6403 & answer_shape(1), &
6405 & answer_shape(2), &
6407 & answer_shape(3), &
6409 & answer_shape(4), &
6411 & answer_shape(5) ) &
6414 allocate( answer_min( &
6415 & answer_shape(1), &
6417 & answer_shape(2), &
6419 & answer_shape(3), &
6421 & answer_shape(4), &
6423 & answer_shape(5) ) &
6426 answer_negative = answer < 0.0
6427 check_negative = check < 0.0
6428 both_negative = answer_negative .and. check_negative
6430 where (both_negative)
6434 & - 0.1 ** significant_digits ) &
6435 & + 0.1 ** (- ignore_digits)
6440 & + 0.1 ** significant_digits ) &
6441 & - 0.1 ** (- ignore_digits)
6446 & + 0.1 ** significant_digits ) &
6447 & + 0.1 ** (- ignore_digits)
6452 & - 0.1 ** significant_digits ) &
6453 & - 0.1 ** (- ignore_digits)
6456 judge = answer_max > check .and. check > answer_min
6457 judge_rev = .not. judge
6458 err_flag = any(judge_rev)
6460 pos = maxloc(mask_array, judge_rev)
6475 right_max = answer_max( &
6486 right_min = answer_min( &
6497 if ( right_max < right_min )
then
6498 right_tmp = right_max
6499 right_max = right_min
6500 right_min = right_tmp
6503 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
6505 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
6507 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
6509 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
6511 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
6515 & trim(adjustl(pos_array(1))) //
',' // &
6517 & trim(adjustl(pos_array(2))) //
',' // &
6519 & trim(adjustl(pos_array(3))) //
',' // &
6521 & trim(adjustl(pos_array(4))) //
',' // &
6523 & trim(adjustl(pos_array(5))) //
')'
6526 deallocate(mask_array, judge, judge_rev)
6527 deallocate(answer_negative, check_negative, both_negative)
6528 deallocate(answer_max, answer_min)
6534 pos_str_len = len_trim(pos_str)
6536 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6538 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
6539 write(*,*)
' is NOT EQUAL to'
6540 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
6541 & //
' ', right_min,
' < '
6542 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
6546 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
6550 end subroutine dctestassertequalreal5digits
6553 subroutine dctestassertequalreal6digits( &
6554 & message, answer, check, significant_digits, ignore_digits )
6558 character(*),
intent(in):: message
6559 real,
intent(in):: answer(:,:,:,:,:,:)
6560 real,
intent(in):: check(:,:,:,:,:,:)
6561 integer,
intent(in):: significant_digits
6562 integer,
intent(in):: ignore_digits
6564 character(STRING):: pos_str
6565 real:: wrong, right_max, right_min
6566 character(STRING):: pos_str_space
6567 integer:: pos_str_len
6570 integer:: answer_shape(6), check_shape(6), pos(6)
6571 logical:: consist_shape(6)
6572 character(TOKEN):: pos_array(6)
6573 integer,
allocatable:: mask_array(:,:,:,:,:,:)
6574 logical,
allocatable:: judge(:,:,:,:,:,:)
6575 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
6576 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
6577 logical,
allocatable:: check_negative(:,:,:,:,:,:)
6578 logical,
allocatable:: both_negative(:,:,:,:,:,:)
6579 real,
allocatable:: answer_max(:,:,:,:,:,:)
6580 real,
allocatable:: answer_min(:,:,:,:,:,:)
6585 if ( significant_digits < 1 )
then
6586 write(*,*)
' *** Error [AssertEQ] *** '
6587 write(*,*)
' Specify a number more than 1 to "significant_digits"'
6591 answer_shape = shape(answer)
6592 check_shape = shape(check)
6594 consist_shape = answer_shape == check_shape
6596 if (.not. all(consist_shape))
then
6597 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6599 write(*,*)
' shape of check is (', check_shape,
')'
6600 write(*,*)
' is INCORRECT'
6601 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
6607 allocate( mask_array( &
6608 & answer_shape(1), &
6610 & answer_shape(2), &
6612 & answer_shape(3), &
6614 & answer_shape(4), &
6616 & answer_shape(5), &
6618 & answer_shape(6) ) &
6622 & answer_shape(1), &
6624 & answer_shape(2), &
6626 & answer_shape(3), &
6628 & answer_shape(4), &
6630 & answer_shape(5), &
6632 & answer_shape(6) ) &
6635 allocate( judge_rev( &
6636 & answer_shape(1), &
6638 & answer_shape(2), &
6640 & answer_shape(3), &
6642 & answer_shape(4), &
6644 & answer_shape(5), &
6646 & answer_shape(6) ) &
6649 allocate( answer_negative( &
6650 & answer_shape(1), &
6652 & answer_shape(2), &
6654 & answer_shape(3), &
6656 & answer_shape(4), &
6658 & answer_shape(5), &
6660 & answer_shape(6) ) &
6663 allocate( check_negative( &
6664 & answer_shape(1), &
6666 & answer_shape(2), &
6668 & answer_shape(3), &
6670 & answer_shape(4), &
6672 & answer_shape(5), &
6674 & answer_shape(6) ) &
6677 allocate( both_negative( &
6678 & answer_shape(1), &
6680 & answer_shape(2), &
6682 & answer_shape(3), &
6684 & answer_shape(4), &
6686 & answer_shape(5), &
6688 & answer_shape(6) ) &
6691 allocate( answer_max( &
6692 & answer_shape(1), &
6694 & answer_shape(2), &
6696 & answer_shape(3), &
6698 & answer_shape(4), &
6700 & answer_shape(5), &
6702 & answer_shape(6) ) &
6705 allocate( answer_min( &
6706 & answer_shape(1), &
6708 & answer_shape(2), &
6710 & answer_shape(3), &
6712 & answer_shape(4), &
6714 & answer_shape(5), &
6716 & answer_shape(6) ) &
6719 answer_negative = answer < 0.0
6720 check_negative = check < 0.0
6721 both_negative = answer_negative .and. check_negative
6723 where (both_negative)
6727 & - 0.1 ** significant_digits ) &
6728 & + 0.1 ** (- ignore_digits)
6733 & + 0.1 ** significant_digits ) &
6734 & - 0.1 ** (- ignore_digits)
6739 & + 0.1 ** significant_digits ) &
6740 & + 0.1 ** (- ignore_digits)
6745 & - 0.1 ** significant_digits ) &
6746 & - 0.1 ** (- ignore_digits)
6749 judge = answer_max > check .and. check > answer_min
6750 judge_rev = .not. judge
6751 err_flag = any(judge_rev)
6753 pos = maxloc(mask_array, judge_rev)
6770 right_max = answer_max( &
6783 right_min = answer_min( &
6796 if ( right_max < right_min )
then
6797 right_tmp = right_max
6798 right_max = right_min
6799 right_min = right_tmp
6802 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
6804 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
6806 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
6808 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
6810 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
6812 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
6816 & trim(adjustl(pos_array(1))) //
',' // &
6818 & trim(adjustl(pos_array(2))) //
',' // &
6820 & trim(adjustl(pos_array(3))) //
',' // &
6822 & trim(adjustl(pos_array(4))) //
',' // &
6824 & trim(adjustl(pos_array(5))) //
',' // &
6826 & trim(adjustl(pos_array(6))) //
')'
6829 deallocate(mask_array, judge, judge_rev)
6830 deallocate(answer_negative, check_negative, both_negative)
6831 deallocate(answer_max, answer_min)
6837 pos_str_len = len_trim(pos_str)
6839 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6841 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
6842 write(*,*)
' is NOT EQUAL to'
6843 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
6844 & //
' ', right_min,
' < '
6845 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
6849 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
6853 end subroutine dctestassertequalreal6digits
6856 subroutine dctestassertequalreal7digits( &
6857 & message, answer, check, significant_digits, ignore_digits )
6861 character(*),
intent(in):: message
6862 real,
intent(in):: answer(:,:,:,:,:,:,:)
6863 real,
intent(in):: check(:,:,:,:,:,:,:)
6864 integer,
intent(in):: significant_digits
6865 integer,
intent(in):: ignore_digits
6867 character(STRING):: pos_str
6868 real:: wrong, right_max, right_min
6869 character(STRING):: pos_str_space
6870 integer:: pos_str_len
6873 integer:: answer_shape(7), check_shape(7), pos(7)
6874 logical:: consist_shape(7)
6875 character(TOKEN):: pos_array(7)
6876 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
6877 logical,
allocatable:: judge(:,:,:,:,:,:,:)
6878 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
6879 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
6880 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
6881 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
6882 real,
allocatable:: answer_max(:,:,:,:,:,:,:)
6883 real,
allocatable:: answer_min(:,:,:,:,:,:,:)
6888 if ( significant_digits < 1 )
then
6889 write(*,*)
' *** Error [AssertEQ] *** '
6890 write(*,*)
' Specify a number more than 1 to "significant_digits"'
6894 answer_shape = shape(answer)
6895 check_shape = shape(check)
6897 consist_shape = answer_shape == check_shape
6899 if (.not. all(consist_shape))
then
6900 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
6902 write(*,*)
' shape of check is (', check_shape,
')'
6903 write(*,*)
' is INCORRECT'
6904 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
6910 allocate( mask_array( &
6911 & answer_shape(1), &
6913 & answer_shape(2), &
6915 & answer_shape(3), &
6917 & answer_shape(4), &
6919 & answer_shape(5), &
6921 & answer_shape(6), &
6923 & answer_shape(7) ) &
6927 & answer_shape(1), &
6929 & answer_shape(2), &
6931 & answer_shape(3), &
6933 & answer_shape(4), &
6935 & answer_shape(5), &
6937 & answer_shape(6), &
6939 & answer_shape(7) ) &
6942 allocate( judge_rev( &
6943 & answer_shape(1), &
6945 & answer_shape(2), &
6947 & answer_shape(3), &
6949 & answer_shape(4), &
6951 & answer_shape(5), &
6953 & answer_shape(6), &
6955 & answer_shape(7) ) &
6958 allocate( answer_negative( &
6959 & answer_shape(1), &
6961 & answer_shape(2), &
6963 & answer_shape(3), &
6965 & answer_shape(4), &
6967 & answer_shape(5), &
6969 & answer_shape(6), &
6971 & answer_shape(7) ) &
6974 allocate( check_negative( &
6975 & answer_shape(1), &
6977 & answer_shape(2), &
6979 & answer_shape(3), &
6981 & answer_shape(4), &
6983 & answer_shape(5), &
6985 & answer_shape(6), &
6987 & answer_shape(7) ) &
6990 allocate( both_negative( &
6991 & answer_shape(1), &
6993 & answer_shape(2), &
6995 & answer_shape(3), &
6997 & answer_shape(4), &
6999 & answer_shape(5), &
7001 & answer_shape(6), &
7003 & answer_shape(7) ) &
7006 allocate( answer_max( &
7007 & answer_shape(1), &
7009 & answer_shape(2), &
7011 & answer_shape(3), &
7013 & answer_shape(4), &
7015 & answer_shape(5), &
7017 & answer_shape(6), &
7019 & answer_shape(7) ) &
7022 allocate( answer_min( &
7023 & answer_shape(1), &
7025 & answer_shape(2), &
7027 & answer_shape(3), &
7029 & answer_shape(4), &
7031 & answer_shape(5), &
7033 & answer_shape(6), &
7035 & answer_shape(7) ) &
7038 answer_negative = answer < 0.0
7039 check_negative = check < 0.0
7040 both_negative = answer_negative .and. check_negative
7042 where (both_negative)
7046 & - 0.1 ** significant_digits ) &
7047 & + 0.1 ** (- ignore_digits)
7052 & + 0.1 ** significant_digits ) &
7053 & - 0.1 ** (- ignore_digits)
7058 & + 0.1 ** significant_digits ) &
7059 & + 0.1 ** (- ignore_digits)
7064 & - 0.1 ** significant_digits ) &
7065 & - 0.1 ** (- ignore_digits)
7068 judge = answer_max > check .and. check > answer_min
7069 judge_rev = .not. judge
7070 err_flag = any(judge_rev)
7072 pos = maxloc(mask_array, judge_rev)
7091 right_max = answer_max( &
7106 right_min = answer_min( &
7121 if ( right_max < right_min )
then
7122 right_tmp = right_max
7123 right_max = right_min
7124 right_min = right_tmp
7127 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
7129 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
7131 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
7133 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
7135 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
7137 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
7139 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
7143 & trim(adjustl(pos_array(1))) //
',' // &
7145 & trim(adjustl(pos_array(2))) //
',' // &
7147 & trim(adjustl(pos_array(3))) //
',' // &
7149 & trim(adjustl(pos_array(4))) //
',' // &
7151 & trim(adjustl(pos_array(5))) //
',' // &
7153 & trim(adjustl(pos_array(6))) //
',' // &
7155 & trim(adjustl(pos_array(7))) //
')'
7158 deallocate(mask_array, judge, judge_rev)
7159 deallocate(answer_negative, check_negative, both_negative)
7160 deallocate(answer_max, answer_min)
7166 pos_str_len = len_trim(pos_str)
7168 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7170 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
7171 write(*,*)
' is NOT EQUAL to'
7172 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
7173 & //
' ', right_min,
' < '
7174 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
7178 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
7182 end subroutine dctestassertequalreal7digits
7185 subroutine dctestassertequaldouble0digits( &
7186 & message, answer, check, significant_digits, ignore_digits )
7190 character(*),
intent(in):: message
7191 real(DP),
intent(in):: answer
7192 real(DP),
intent(in):: check
7193 integer,
intent(in):: significant_digits
7194 integer,
intent(in):: ignore_digits
7196 character(STRING):: pos_str
7197 real(DP):: wrong, right_max, right_min
7198 character(STRING):: pos_str_space
7199 integer:: pos_str_len
7200 real(DP):: right_tmp
7202 real(DP):: answer_max
7203 real(DP):: answer_min
7208 if ( significant_digits < 1 )
then
7209 write(*,*)
' *** Error [AssertEQ] *** '
7210 write(*,*)
' Specify a number more than 1 to "significant_digits"'
7214 if ( answer < 0.0_dp .and. check < 0.0_dp )
then
7218 & - 0.1_dp ** significant_digits ) &
7219 & + 0.1_dp ** (- ignore_digits)
7224 & + 0.1_dp ** significant_digits ) &
7225 & - 0.1_dp ** (- ignore_digits)
7231 & + 0.1_dp ** significant_digits ) &
7232 & + 0.1_dp ** (- ignore_digits)
7237 & - 0.1_dp ** significant_digits ) &
7238 & - 0.1_dp ** (- ignore_digits)
7242 right_max = answer_max
7243 right_min = answer_min
7244 if ( right_max < right_min )
then
7245 right_tmp = right_max
7246 right_max = right_min
7247 right_min = right_tmp
7250 err_flag = .not. (answer_max > check .and. check > answer_min)
7258 pos_str_len = len_trim(pos_str)
7260 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7262 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
7263 write(*,*)
' is NOT EQUAL to'
7264 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
7265 & //
' ', right_min,
' < '
7266 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
7270 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
7274 end subroutine dctestassertequaldouble0digits
7277 subroutine dctestassertequaldouble1digits( &
7278 & message, answer, check, significant_digits, ignore_digits )
7282 character(*),
intent(in):: message
7283 real(DP),
intent(in):: answer(:)
7284 real(DP),
intent(in):: check(:)
7285 integer,
intent(in):: significant_digits
7286 integer,
intent(in):: ignore_digits
7288 character(STRING):: pos_str
7289 real(DP):: wrong, right_max, right_min
7290 character(STRING):: pos_str_space
7291 integer:: pos_str_len
7292 real(DP):: right_tmp
7294 integer:: answer_shape(1), check_shape(1), pos(1)
7295 logical:: consist_shape(1)
7296 character(TOKEN):: pos_array(1)
7297 integer,
allocatable:: mask_array(:)
7298 logical,
allocatable:: judge(:)
7299 logical,
allocatable:: judge_rev(:)
7300 logical,
allocatable:: answer_negative(:)
7301 logical,
allocatable:: check_negative(:)
7302 logical,
allocatable:: both_negative(:)
7303 real(DP),
allocatable:: answer_max(:)
7304 real(DP),
allocatable:: answer_min(:)
7309 if ( significant_digits < 1 )
then
7310 write(*,*)
' *** Error [AssertEQ] *** '
7311 write(*,*)
' Specify a number more than 1 to "significant_digits"'
7315 answer_shape = shape(answer)
7316 check_shape = shape(check)
7318 consist_shape = answer_shape == check_shape
7320 if (.not. all(consist_shape))
then
7321 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7323 write(*,*)
' shape of check is (', check_shape,
')'
7324 write(*,*)
' is INCORRECT'
7325 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
7331 allocate( mask_array( &
7333 & answer_shape(1) ) &
7338 & answer_shape(1) ) &
7341 allocate( judge_rev( &
7343 & answer_shape(1) ) &
7346 allocate( answer_negative( &
7348 & answer_shape(1) ) &
7351 allocate( check_negative( &
7353 & answer_shape(1) ) &
7356 allocate( both_negative( &
7358 & answer_shape(1) ) &
7361 allocate( answer_max( &
7363 & answer_shape(1) ) &
7366 allocate( answer_min( &
7368 & answer_shape(1) ) &
7371 answer_negative = answer < 0.0_dp
7372 check_negative = check < 0.0_dp
7373 both_negative = answer_negative .and. check_negative
7375 where (both_negative)
7379 & - 0.1_dp ** significant_digits ) &
7380 & + 0.1_dp ** (- ignore_digits)
7385 & + 0.1_dp ** significant_digits ) &
7386 & - 0.1_dp ** (- ignore_digits)
7391 & + 0.1_dp ** significant_digits ) &
7392 & + 0.1_dp ** (- ignore_digits)
7397 & - 0.1_dp ** significant_digits ) &
7398 & - 0.1_dp ** (- ignore_digits)
7401 judge = answer_max > check .and. check > answer_min
7402 judge_rev = .not. judge
7403 err_flag = any(judge_rev)
7405 pos = maxloc(mask_array, judge_rev)
7413 right_max = answer_max( &
7417 right_min = answer_min( &
7421 if ( right_max < right_min )
then
7422 right_tmp = right_max
7423 right_max = right_min
7424 right_min = right_tmp
7427 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
7432 & trim(adjustl(pos_array(1))) //
')'
7435 deallocate(mask_array, judge, judge_rev)
7436 deallocate(answer_negative, check_negative, both_negative)
7437 deallocate(answer_max, answer_min)
7443 pos_str_len = len_trim(pos_str)
7445 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7447 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
7448 write(*,*)
' is NOT EQUAL to'
7449 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
7450 & //
' ', right_min,
' < '
7451 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
7455 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
7459 end subroutine dctestassertequaldouble1digits
7462 subroutine dctestassertequaldouble2digits( &
7463 & message, answer, check, significant_digits, ignore_digits )
7467 character(*),
intent(in):: message
7468 real(DP),
intent(in):: answer(:,:)
7469 real(DP),
intent(in):: check(:,:)
7470 integer,
intent(in):: significant_digits
7471 integer,
intent(in):: ignore_digits
7473 character(STRING):: pos_str
7474 real(DP):: wrong, right_max, right_min
7475 character(STRING):: pos_str_space
7476 integer:: pos_str_len
7477 real(DP):: right_tmp
7479 integer:: answer_shape(2), check_shape(2), pos(2)
7480 logical:: consist_shape(2)
7481 character(TOKEN):: pos_array(2)
7482 integer,
allocatable:: mask_array(:,:)
7483 logical,
allocatable:: judge(:,:)
7484 logical,
allocatable:: judge_rev(:,:)
7485 logical,
allocatable:: answer_negative(:,:)
7486 logical,
allocatable:: check_negative(:,:)
7487 logical,
allocatable:: both_negative(:,:)
7488 real(DP),
allocatable:: answer_max(:,:)
7489 real(DP),
allocatable:: answer_min(:,:)
7494 if ( significant_digits < 1 )
then
7495 write(*,*)
' *** Error [AssertEQ] *** '
7496 write(*,*)
' Specify a number more than 1 to "significant_digits"'
7500 answer_shape = shape(answer)
7501 check_shape = shape(check)
7503 consist_shape = answer_shape == check_shape
7505 if (.not. all(consist_shape))
then
7506 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7508 write(*,*)
' shape of check is (', check_shape,
')'
7509 write(*,*)
' is INCORRECT'
7510 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
7516 allocate( mask_array( &
7517 & answer_shape(1), &
7519 & answer_shape(2) ) &
7523 & answer_shape(1), &
7525 & answer_shape(2) ) &
7528 allocate( judge_rev( &
7529 & answer_shape(1), &
7531 & answer_shape(2) ) &
7534 allocate( answer_negative( &
7535 & answer_shape(1), &
7537 & answer_shape(2) ) &
7540 allocate( check_negative( &
7541 & answer_shape(1), &
7543 & answer_shape(2) ) &
7546 allocate( both_negative( &
7547 & answer_shape(1), &
7549 & answer_shape(2) ) &
7552 allocate( answer_max( &
7553 & answer_shape(1), &
7555 & answer_shape(2) ) &
7558 allocate( answer_min( &
7559 & answer_shape(1), &
7561 & answer_shape(2) ) &
7564 answer_negative = answer < 0.0_dp
7565 check_negative = check < 0.0_dp
7566 both_negative = answer_negative .and. check_negative
7568 where (both_negative)
7572 & - 0.1_dp ** significant_digits ) &
7573 & + 0.1_dp ** (- ignore_digits)
7578 & + 0.1_dp ** significant_digits ) &
7579 & - 0.1_dp ** (- ignore_digits)
7584 & + 0.1_dp ** significant_digits ) &
7585 & + 0.1_dp ** (- ignore_digits)
7590 & - 0.1_dp ** significant_digits ) &
7591 & - 0.1_dp ** (- ignore_digits)
7594 judge = answer_max > check .and. check > answer_min
7595 judge_rev = .not. judge
7596 err_flag = any(judge_rev)
7598 pos = maxloc(mask_array, judge_rev)
7607 right_max = answer_max( &
7612 right_min = answer_min( &
7617 if ( right_max < right_min )
then
7618 right_tmp = right_max
7619 right_max = right_min
7620 right_min = right_tmp
7623 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
7625 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
7629 & trim(adjustl(pos_array(1))) //
',' // &
7631 & trim(adjustl(pos_array(2))) //
')'
7634 deallocate(mask_array, judge, judge_rev)
7635 deallocate(answer_negative, check_negative, both_negative)
7636 deallocate(answer_max, answer_min)
7642 pos_str_len = len_trim(pos_str)
7644 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7646 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
7647 write(*,*)
' is NOT EQUAL to'
7648 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
7649 & //
' ', right_min,
' < '
7650 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
7654 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
7658 end subroutine dctestassertequaldouble2digits
7661 subroutine dctestassertequaldouble3digits( &
7662 & message, answer, check, significant_digits, ignore_digits )
7666 character(*),
intent(in):: message
7667 real(DP),
intent(in):: answer(:,:,:)
7668 real(DP),
intent(in):: check(:,:,:)
7669 integer,
intent(in):: significant_digits
7670 integer,
intent(in):: ignore_digits
7672 character(STRING):: pos_str
7673 real(DP):: wrong, right_max, right_min
7674 character(STRING):: pos_str_space
7675 integer:: pos_str_len
7676 real(DP):: right_tmp
7678 integer:: answer_shape(3), check_shape(3), pos(3)
7679 logical:: consist_shape(3)
7680 character(TOKEN):: pos_array(3)
7681 integer,
allocatable:: mask_array(:,:,:)
7682 logical,
allocatable:: judge(:,:,:)
7683 logical,
allocatable:: judge_rev(:,:,:)
7684 logical,
allocatable:: answer_negative(:,:,:)
7685 logical,
allocatable:: check_negative(:,:,:)
7686 logical,
allocatable:: both_negative(:,:,:)
7687 real(DP),
allocatable:: answer_max(:,:,:)
7688 real(DP),
allocatable:: answer_min(:,:,:)
7693 if ( significant_digits < 1 )
then
7694 write(*,*)
' *** Error [AssertEQ] *** '
7695 write(*,*)
' Specify a number more than 1 to "significant_digits"'
7699 answer_shape = shape(answer)
7700 check_shape = shape(check)
7702 consist_shape = answer_shape == check_shape
7704 if (.not. all(consist_shape))
then
7705 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7707 write(*,*)
' shape of check is (', check_shape,
')'
7708 write(*,*)
' is INCORRECT'
7709 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
7715 allocate( mask_array( &
7716 & answer_shape(1), &
7718 & answer_shape(2), &
7720 & answer_shape(3) ) &
7724 & answer_shape(1), &
7726 & answer_shape(2), &
7728 & answer_shape(3) ) &
7731 allocate( judge_rev( &
7732 & answer_shape(1), &
7734 & answer_shape(2), &
7736 & answer_shape(3) ) &
7739 allocate( answer_negative( &
7740 & answer_shape(1), &
7742 & answer_shape(2), &
7744 & answer_shape(3) ) &
7747 allocate( check_negative( &
7748 & answer_shape(1), &
7750 & answer_shape(2), &
7752 & answer_shape(3) ) &
7755 allocate( both_negative( &
7756 & answer_shape(1), &
7758 & answer_shape(2), &
7760 & answer_shape(3) ) &
7763 allocate( answer_max( &
7764 & answer_shape(1), &
7766 & answer_shape(2), &
7768 & answer_shape(3) ) &
7771 allocate( answer_min( &
7772 & answer_shape(1), &
7774 & answer_shape(2), &
7776 & answer_shape(3) ) &
7779 answer_negative = answer < 0.0_dp
7780 check_negative = check < 0.0_dp
7781 both_negative = answer_negative .and. check_negative
7783 where (both_negative)
7787 & - 0.1_dp ** significant_digits ) &
7788 & + 0.1_dp ** (- ignore_digits)
7793 & + 0.1_dp ** significant_digits ) &
7794 & - 0.1_dp ** (- ignore_digits)
7799 & + 0.1_dp ** significant_digits ) &
7800 & + 0.1_dp ** (- ignore_digits)
7805 & - 0.1_dp ** significant_digits ) &
7806 & - 0.1_dp ** (- ignore_digits)
7809 judge = answer_max > check .and. check > answer_min
7810 judge_rev = .not. judge
7811 err_flag = any(judge_rev)
7813 pos = maxloc(mask_array, judge_rev)
7824 right_max = answer_max( &
7831 right_min = answer_min( &
7838 if ( right_max < right_min )
then
7839 right_tmp = right_max
7840 right_max = right_min
7841 right_min = right_tmp
7844 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
7846 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
7848 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
7852 & trim(adjustl(pos_array(1))) //
',' // &
7854 & trim(adjustl(pos_array(2))) //
',' // &
7856 & trim(adjustl(pos_array(3))) //
')'
7859 deallocate(mask_array, judge, judge_rev)
7860 deallocate(answer_negative, check_negative, both_negative)
7861 deallocate(answer_max, answer_min)
7867 pos_str_len = len_trim(pos_str)
7869 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7871 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
7872 write(*,*)
' is NOT EQUAL to'
7873 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
7874 & //
' ', right_min,
' < '
7875 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
7879 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
7883 end subroutine dctestassertequaldouble3digits
7886 subroutine dctestassertequaldouble4digits( &
7887 & message, answer, check, significant_digits, ignore_digits )
7891 character(*),
intent(in):: message
7892 real(DP),
intent(in):: answer(:,:,:,:)
7893 real(DP),
intent(in):: check(:,:,:,:)
7894 integer,
intent(in):: significant_digits
7895 integer,
intent(in):: ignore_digits
7897 character(STRING):: pos_str
7898 real(DP):: wrong, right_max, right_min
7899 character(STRING):: pos_str_space
7900 integer:: pos_str_len
7901 real(DP):: right_tmp
7903 integer:: answer_shape(4), check_shape(4), pos(4)
7904 logical:: consist_shape(4)
7905 character(TOKEN):: pos_array(4)
7906 integer,
allocatable:: mask_array(:,:,:,:)
7907 logical,
allocatable:: judge(:,:,:,:)
7908 logical,
allocatable:: judge_rev(:,:,:,:)
7909 logical,
allocatable:: answer_negative(:,:,:,:)
7910 logical,
allocatable:: check_negative(:,:,:,:)
7911 logical,
allocatable:: both_negative(:,:,:,:)
7912 real(DP),
allocatable:: answer_max(:,:,:,:)
7913 real(DP),
allocatable:: answer_min(:,:,:,:)
7918 if ( significant_digits < 1 )
then
7919 write(*,*)
' *** Error [AssertEQ] *** '
7920 write(*,*)
' Specify a number more than 1 to "significant_digits"'
7924 answer_shape = shape(answer)
7925 check_shape = shape(check)
7927 consist_shape = answer_shape == check_shape
7929 if (.not. all(consist_shape))
then
7930 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
7932 write(*,*)
' shape of check is (', check_shape,
')'
7933 write(*,*)
' is INCORRECT'
7934 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
7940 allocate( mask_array( &
7941 & answer_shape(1), &
7943 & answer_shape(2), &
7945 & answer_shape(3), &
7947 & answer_shape(4) ) &
7951 & answer_shape(1), &
7953 & answer_shape(2), &
7955 & answer_shape(3), &
7957 & answer_shape(4) ) &
7960 allocate( judge_rev( &
7961 & answer_shape(1), &
7963 & answer_shape(2), &
7965 & answer_shape(3), &
7967 & answer_shape(4) ) &
7970 allocate( answer_negative( &
7971 & answer_shape(1), &
7973 & answer_shape(2), &
7975 & answer_shape(3), &
7977 & answer_shape(4) ) &
7980 allocate( check_negative( &
7981 & answer_shape(1), &
7983 & answer_shape(2), &
7985 & answer_shape(3), &
7987 & answer_shape(4) ) &
7990 allocate( both_negative( &
7991 & answer_shape(1), &
7993 & answer_shape(2), &
7995 & answer_shape(3), &
7997 & answer_shape(4) ) &
8000 allocate( answer_max( &
8001 & answer_shape(1), &
8003 & answer_shape(2), &
8005 & answer_shape(3), &
8007 & answer_shape(4) ) &
8010 allocate( answer_min( &
8011 & answer_shape(1), &
8013 & answer_shape(2), &
8015 & answer_shape(3), &
8017 & answer_shape(4) ) &
8020 answer_negative = answer < 0.0_dp
8021 check_negative = check < 0.0_dp
8022 both_negative = answer_negative .and. check_negative
8024 where (both_negative)
8028 & - 0.1_dp ** significant_digits ) &
8029 & + 0.1_dp ** (- ignore_digits)
8034 & + 0.1_dp ** significant_digits ) &
8035 & - 0.1_dp ** (- ignore_digits)
8040 & + 0.1_dp ** significant_digits ) &
8041 & + 0.1_dp ** (- ignore_digits)
8046 & - 0.1_dp ** significant_digits ) &
8047 & - 0.1_dp ** (- ignore_digits)
8050 judge = answer_max > check .and. check > answer_min
8051 judge_rev = .not. judge
8052 err_flag = any(judge_rev)
8054 pos = maxloc(mask_array, judge_rev)
8067 right_max = answer_max( &
8076 right_min = answer_min( &
8085 if ( right_max < right_min )
then
8086 right_tmp = right_max
8087 right_max = right_min
8088 right_min = right_tmp
8091 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
8093 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
8095 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
8097 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
8101 & trim(adjustl(pos_array(1))) //
',' // &
8103 & trim(adjustl(pos_array(2))) //
',' // &
8105 & trim(adjustl(pos_array(3))) //
',' // &
8107 & trim(adjustl(pos_array(4))) //
')'
8110 deallocate(mask_array, judge, judge_rev)
8111 deallocate(answer_negative, check_negative, both_negative)
8112 deallocate(answer_max, answer_min)
8118 pos_str_len = len_trim(pos_str)
8120 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
8122 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
8123 write(*,*)
' is NOT EQUAL to'
8124 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
8125 & //
' ', right_min,
' < '
8126 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
8130 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
8134 end subroutine dctestassertequaldouble4digits
8137 subroutine dctestassertequaldouble5digits( &
8138 & message, answer, check, significant_digits, ignore_digits )
8142 character(*),
intent(in):: message
8143 real(DP),
intent(in):: answer(:,:,:,:,:)
8144 real(DP),
intent(in):: check(:,:,:,:,:)
8145 integer,
intent(in):: significant_digits
8146 integer,
intent(in):: ignore_digits
8148 character(STRING):: pos_str
8149 real(DP):: wrong, right_max, right_min
8150 character(STRING):: pos_str_space
8151 integer:: pos_str_len
8152 real(DP):: right_tmp
8154 integer:: answer_shape(5), check_shape(5), pos(5)
8155 logical:: consist_shape(5)
8156 character(TOKEN):: pos_array(5)
8157 integer,
allocatable:: mask_array(:,:,:,:,:)
8158 logical,
allocatable:: judge(:,:,:,:,:)
8159 logical,
allocatable:: judge_rev(:,:,:,:,:)
8160 logical,
allocatable:: answer_negative(:,:,:,:,:)
8161 logical,
allocatable:: check_negative(:,:,:,:,:)
8162 logical,
allocatable:: both_negative(:,:,:,:,:)
8163 real(DP),
allocatable:: answer_max(:,:,:,:,:)
8164 real(DP),
allocatable:: answer_min(:,:,:,:,:)
8169 if ( significant_digits < 1 )
then
8170 write(*,*)
' *** Error [AssertEQ] *** '
8171 write(*,*)
' Specify a number more than 1 to "significant_digits"'
8175 answer_shape = shape(answer)
8176 check_shape = shape(check)
8178 consist_shape = answer_shape == check_shape
8180 if (.not. all(consist_shape))
then
8181 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
8183 write(*,*)
' shape of check is (', check_shape,
')'
8184 write(*,*)
' is INCORRECT'
8185 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
8191 allocate( mask_array( &
8192 & answer_shape(1), &
8194 & answer_shape(2), &
8196 & answer_shape(3), &
8198 & answer_shape(4), &
8200 & answer_shape(5) ) &
8204 & answer_shape(1), &
8206 & answer_shape(2), &
8208 & answer_shape(3), &
8210 & answer_shape(4), &
8212 & answer_shape(5) ) &
8215 allocate( judge_rev( &
8216 & answer_shape(1), &
8218 & answer_shape(2), &
8220 & answer_shape(3), &
8222 & answer_shape(4), &
8224 & answer_shape(5) ) &
8227 allocate( answer_negative( &
8228 & answer_shape(1), &
8230 & answer_shape(2), &
8232 & answer_shape(3), &
8234 & answer_shape(4), &
8236 & answer_shape(5) ) &
8239 allocate( check_negative( &
8240 & answer_shape(1), &
8242 & answer_shape(2), &
8244 & answer_shape(3), &
8246 & answer_shape(4), &
8248 & answer_shape(5) ) &
8251 allocate( both_negative( &
8252 & answer_shape(1), &
8254 & answer_shape(2), &
8256 & answer_shape(3), &
8258 & answer_shape(4), &
8260 & answer_shape(5) ) &
8263 allocate( answer_max( &
8264 & answer_shape(1), &
8266 & answer_shape(2), &
8268 & answer_shape(3), &
8270 & answer_shape(4), &
8272 & answer_shape(5) ) &
8275 allocate( answer_min( &
8276 & answer_shape(1), &
8278 & answer_shape(2), &
8280 & answer_shape(3), &
8282 & answer_shape(4), &
8284 & answer_shape(5) ) &
8287 answer_negative = answer < 0.0_dp
8288 check_negative = check < 0.0_dp
8289 both_negative = answer_negative .and. check_negative
8291 where (both_negative)
8295 & - 0.1_dp ** significant_digits ) &
8296 & + 0.1_dp ** (- ignore_digits)
8301 & + 0.1_dp ** significant_digits ) &
8302 & - 0.1_dp ** (- ignore_digits)
8307 & + 0.1_dp ** significant_digits ) &
8308 & + 0.1_dp ** (- ignore_digits)
8313 & - 0.1_dp ** significant_digits ) &
8314 & - 0.1_dp ** (- ignore_digits)
8317 judge = answer_max > check .and. check > answer_min
8318 judge_rev = .not. judge
8319 err_flag = any(judge_rev)
8321 pos = maxloc(mask_array, judge_rev)
8336 right_max = answer_max( &
8347 right_min = answer_min( &
8358 if ( right_max < right_min )
then
8359 right_tmp = right_max
8360 right_max = right_min
8361 right_min = right_tmp
8364 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
8366 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
8368 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
8370 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
8372 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
8376 & trim(adjustl(pos_array(1))) //
',' // &
8378 & trim(adjustl(pos_array(2))) //
',' // &
8380 & trim(adjustl(pos_array(3))) //
',' // &
8382 & trim(adjustl(pos_array(4))) //
',' // &
8384 & trim(adjustl(pos_array(5))) //
')'
8387 deallocate(mask_array, judge, judge_rev)
8388 deallocate(answer_negative, check_negative, both_negative)
8389 deallocate(answer_max, answer_min)
8395 pos_str_len = len_trim(pos_str)
8397 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
8399 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
8400 write(*,*)
' is NOT EQUAL to'
8401 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
8402 & //
' ', right_min,
' < '
8403 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
8407 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
8411 end subroutine dctestassertequaldouble5digits
8414 subroutine dctestassertequaldouble6digits( &
8415 & message, answer, check, significant_digits, ignore_digits )
8419 character(*),
intent(in):: message
8420 real(DP),
intent(in):: answer(:,:,:,:,:,:)
8421 real(DP),
intent(in):: check(:,:,:,:,:,:)
8422 integer,
intent(in):: significant_digits
8423 integer,
intent(in):: ignore_digits
8425 character(STRING):: pos_str
8426 real(DP):: wrong, right_max, right_min
8427 character(STRING):: pos_str_space
8428 integer:: pos_str_len
8429 real(DP):: right_tmp
8431 integer:: answer_shape(6), check_shape(6), pos(6)
8432 logical:: consist_shape(6)
8433 character(TOKEN):: pos_array(6)
8434 integer,
allocatable:: mask_array(:,:,:,:,:,:)
8435 logical,
allocatable:: judge(:,:,:,:,:,:)
8436 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
8437 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
8438 logical,
allocatable:: check_negative(:,:,:,:,:,:)
8439 logical,
allocatable:: both_negative(:,:,:,:,:,:)
8440 real(DP),
allocatable:: answer_max(:,:,:,:,:,:)
8441 real(DP),
allocatable:: answer_min(:,:,:,:,:,:)
8446 if ( significant_digits < 1 )
then
8447 write(*,*)
' *** Error [AssertEQ] *** '
8448 write(*,*)
' Specify a number more than 1 to "significant_digits"'
8452 answer_shape = shape(answer)
8453 check_shape = shape(check)
8455 consist_shape = answer_shape == check_shape
8457 if (.not. all(consist_shape))
then
8458 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
8460 write(*,*)
' shape of check is (', check_shape,
')'
8461 write(*,*)
' is INCORRECT'
8462 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
8468 allocate( mask_array( &
8469 & answer_shape(1), &
8471 & answer_shape(2), &
8473 & answer_shape(3), &
8475 & answer_shape(4), &
8477 & answer_shape(5), &
8479 & answer_shape(6) ) &
8483 & answer_shape(1), &
8485 & answer_shape(2), &
8487 & answer_shape(3), &
8489 & answer_shape(4), &
8491 & answer_shape(5), &
8493 & answer_shape(6) ) &
8496 allocate( judge_rev( &
8497 & answer_shape(1), &
8499 & answer_shape(2), &
8501 & answer_shape(3), &
8503 & answer_shape(4), &
8505 & answer_shape(5), &
8507 & answer_shape(6) ) &
8510 allocate( answer_negative( &
8511 & answer_shape(1), &
8513 & answer_shape(2), &
8515 & answer_shape(3), &
8517 & answer_shape(4), &
8519 & answer_shape(5), &
8521 & answer_shape(6) ) &
8524 allocate( check_negative( &
8525 & answer_shape(1), &
8527 & answer_shape(2), &
8529 & answer_shape(3), &
8531 & answer_shape(4), &
8533 & answer_shape(5), &
8535 & answer_shape(6) ) &
8538 allocate( both_negative( &
8539 & answer_shape(1), &
8541 & answer_shape(2), &
8543 & answer_shape(3), &
8545 & answer_shape(4), &
8547 & answer_shape(5), &
8549 & answer_shape(6) ) &
8552 allocate( answer_max( &
8553 & answer_shape(1), &
8555 & answer_shape(2), &
8557 & answer_shape(3), &
8559 & answer_shape(4), &
8561 & answer_shape(5), &
8563 & answer_shape(6) ) &
8566 allocate( answer_min( &
8567 & answer_shape(1), &
8569 & answer_shape(2), &
8571 & answer_shape(3), &
8573 & answer_shape(4), &
8575 & answer_shape(5), &
8577 & answer_shape(6) ) &
8580 answer_negative = answer < 0.0_dp
8581 check_negative = check < 0.0_dp
8582 both_negative = answer_negative .and. check_negative
8584 where (both_negative)
8588 & - 0.1_dp ** significant_digits ) &
8589 & + 0.1_dp ** (- ignore_digits)
8594 & + 0.1_dp ** significant_digits ) &
8595 & - 0.1_dp ** (- ignore_digits)
8600 & + 0.1_dp ** significant_digits ) &
8601 & + 0.1_dp ** (- ignore_digits)
8606 & - 0.1_dp ** significant_digits ) &
8607 & - 0.1_dp ** (- ignore_digits)
8610 judge = answer_max > check .and. check > answer_min
8611 judge_rev = .not. judge
8612 err_flag = any(judge_rev)
8614 pos = maxloc(mask_array, judge_rev)
8631 right_max = answer_max( &
8644 right_min = answer_min( &
8657 if ( right_max < right_min )
then
8658 right_tmp = right_max
8659 right_max = right_min
8660 right_min = right_tmp
8663 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
8665 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
8667 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
8669 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
8671 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
8673 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
8677 & trim(adjustl(pos_array(1))) //
',' // &
8679 & trim(adjustl(pos_array(2))) //
',' // &
8681 & trim(adjustl(pos_array(3))) //
',' // &
8683 & trim(adjustl(pos_array(4))) //
',' // &
8685 & trim(adjustl(pos_array(5))) //
',' // &
8687 & trim(adjustl(pos_array(6))) //
')'
8690 deallocate(mask_array, judge, judge_rev)
8691 deallocate(answer_negative, check_negative, both_negative)
8692 deallocate(answer_max, answer_min)
8698 pos_str_len = len_trim(pos_str)
8700 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
8702 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
8703 write(*,*)
' is NOT EQUAL to'
8704 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
8705 & //
' ', right_min,
' < '
8706 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
8710 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
8714 end subroutine dctestassertequaldouble6digits
8717 subroutine dctestassertequaldouble7digits( &
8718 & message, answer, check, significant_digits, ignore_digits )
8722 character(*),
intent(in):: message
8723 real(DP),
intent(in):: answer(:,:,:,:,:,:,:)
8724 real(DP),
intent(in):: check(:,:,:,:,:,:,:)
8725 integer,
intent(in):: significant_digits
8726 integer,
intent(in):: ignore_digits
8728 character(STRING):: pos_str
8729 real(DP):: wrong, right_max, right_min
8730 character(STRING):: pos_str_space
8731 integer:: pos_str_len
8732 real(DP):: right_tmp
8734 integer:: answer_shape(7), check_shape(7), pos(7)
8735 logical:: consist_shape(7)
8736 character(TOKEN):: pos_array(7)
8737 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
8738 logical,
allocatable:: judge(:,:,:,:,:,:,:)
8739 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
8740 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
8741 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
8742 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
8743 real(DP),
allocatable:: answer_max(:,:,:,:,:,:,:)
8744 real(DP),
allocatable:: answer_min(:,:,:,:,:,:,:)
8749 if ( significant_digits < 1 )
then
8750 write(*,*)
' *** Error [AssertEQ] *** '
8751 write(*,*)
' Specify a number more than 1 to "significant_digits"'
8755 answer_shape = shape(answer)
8756 check_shape = shape(check)
8758 consist_shape = answer_shape == check_shape
8760 if (.not. all(consist_shape))
then
8761 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
8763 write(*,*)
' shape of check is (', check_shape,
')'
8764 write(*,*)
' is INCORRECT'
8765 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
8771 allocate( mask_array( &
8772 & answer_shape(1), &
8774 & answer_shape(2), &
8776 & answer_shape(3), &
8778 & answer_shape(4), &
8780 & answer_shape(5), &
8782 & answer_shape(6), &
8784 & answer_shape(7) ) &
8788 & answer_shape(1), &
8790 & answer_shape(2), &
8792 & answer_shape(3), &
8794 & answer_shape(4), &
8796 & answer_shape(5), &
8798 & answer_shape(6), &
8800 & answer_shape(7) ) &
8803 allocate( judge_rev( &
8804 & answer_shape(1), &
8806 & answer_shape(2), &
8808 & answer_shape(3), &
8810 & answer_shape(4), &
8812 & answer_shape(5), &
8814 & answer_shape(6), &
8816 & answer_shape(7) ) &
8819 allocate( answer_negative( &
8820 & answer_shape(1), &
8822 & answer_shape(2), &
8824 & answer_shape(3), &
8826 & answer_shape(4), &
8828 & answer_shape(5), &
8830 & answer_shape(6), &
8832 & answer_shape(7) ) &
8835 allocate( check_negative( &
8836 & answer_shape(1), &
8838 & answer_shape(2), &
8840 & answer_shape(3), &
8842 & answer_shape(4), &
8844 & answer_shape(5), &
8846 & answer_shape(6), &
8848 & answer_shape(7) ) &
8851 allocate( both_negative( &
8852 & answer_shape(1), &
8854 & answer_shape(2), &
8856 & answer_shape(3), &
8858 & answer_shape(4), &
8860 & answer_shape(5), &
8862 & answer_shape(6), &
8864 & answer_shape(7) ) &
8867 allocate( answer_max( &
8868 & answer_shape(1), &
8870 & answer_shape(2), &
8872 & answer_shape(3), &
8874 & answer_shape(4), &
8876 & answer_shape(5), &
8878 & answer_shape(6), &
8880 & answer_shape(7) ) &
8883 allocate( answer_min( &
8884 & answer_shape(1), &
8886 & answer_shape(2), &
8888 & answer_shape(3), &
8890 & answer_shape(4), &
8892 & answer_shape(5), &
8894 & answer_shape(6), &
8896 & answer_shape(7) ) &
8899 answer_negative = answer < 0.0_dp
8900 check_negative = check < 0.0_dp
8901 both_negative = answer_negative .and. check_negative
8903 where (both_negative)
8907 & - 0.1_dp ** significant_digits ) &
8908 & + 0.1_dp ** (- ignore_digits)
8913 & + 0.1_dp ** significant_digits ) &
8914 & - 0.1_dp ** (- ignore_digits)
8919 & + 0.1_dp ** significant_digits ) &
8920 & + 0.1_dp ** (- ignore_digits)
8925 & - 0.1_dp ** significant_digits ) &
8926 & - 0.1_dp ** (- ignore_digits)
8929 judge = answer_max > check .and. check > answer_min
8930 judge_rev = .not. judge
8931 err_flag = any(judge_rev)
8933 pos = maxloc(mask_array, judge_rev)
8952 right_max = answer_max( &
8967 right_min = answer_min( &
8982 if ( right_max < right_min )
then
8983 right_tmp = right_max
8984 right_max = right_min
8985 right_min = right_tmp
8988 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
8990 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
8992 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
8994 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
8996 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
8998 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
9000 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
9004 & trim(adjustl(pos_array(1))) //
',' // &
9006 & trim(adjustl(pos_array(2))) //
',' // &
9008 & trim(adjustl(pos_array(3))) //
',' // &
9010 & trim(adjustl(pos_array(4))) //
',' // &
9012 & trim(adjustl(pos_array(5))) //
',' // &
9014 & trim(adjustl(pos_array(6))) //
',' // &
9016 & trim(adjustl(pos_array(7))) //
')'
9019 deallocate(mask_array, judge, judge_rev)
9020 deallocate(answer_negative, check_negative, both_negative)
9021 deallocate(answer_max, answer_min)
9027 pos_str_len = len_trim(pos_str)
9029 write(*,*)
' *** Error [AssertEQ] *** Checking ' // trim(message) //
' FAILURE'
9031 write(*,*)
' check' // trim(pos_str) //
' = ', wrong
9032 write(*,*)
' is NOT EQUAL to'
9033 write(*,*)
' ' // pos_str_space(1:pos_str_len) &
9034 & //
' ', right_min,
' < '
9035 write(*,*)
' answer' // trim(pos_str) //
' < ', right_max
9039 write(*,*)
' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) //
' OK'
9043 end subroutine dctestassertequaldouble7digits
9046 subroutine dctestassertgreaterthanint0( &
9047 & message, answer, check, negative_support)
9051 character(*),
intent(in):: message
9052 integer,
intent(in):: answer
9053 integer,
intent(in):: check
9054 logical,
intent(in),
optional:: negative_support
9056 logical:: negative_support_on
9057 character(STRING):: pos_str
9058 character(TOKEN):: abs_mes
9059 integer:: wrong, right
9064 if (
present(negative_support))
then
9065 negative_support_on = negative_support
9067 negative_support_on = .true.
9073 err_flag = .not. answer < check
9078 & .and. negative_support_on )
then
9080 err_flag = .not. err_flag
9081 abs_mes =
'ABSOLUTE value of'
9092 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9094 write(*,*)
' ' // trim(abs_mes) // &
9095 &
' check' // trim(pos_str) //
' = ', wrong
9096 write(*,*)
' is NOT GREATER THAN'
9097 write(*,*)
' ' // trim(abs_mes) // &
9098 &
' answer' // trim(pos_str) //
' = ', right
9102 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
9106 end subroutine dctestassertgreaterthanint0
9109 subroutine dctestassertgreaterthanint1( &
9110 & message, answer, check, negative_support)
9114 character(*),
intent(in):: message
9115 integer,
intent(in):: answer(:)
9116 integer,
intent(in):: check(:)
9117 logical,
intent(in),
optional:: negative_support
9119 logical:: negative_support_on
9120 character(STRING):: pos_str
9121 character(TOKEN):: abs_mes
9122 integer:: wrong, right
9124 integer:: answer_shape(1), check_shape(1), pos(1)
9125 logical:: consist_shape(1)
9126 character(TOKEN):: pos_array(1)
9127 integer,
allocatable:: mask_array(:)
9128 logical,
allocatable:: judge(:)
9129 logical,
allocatable:: judge_rev(:)
9130 logical,
allocatable:: answer_negative(:)
9131 logical,
allocatable:: check_negative(:)
9132 logical,
allocatable:: both_negative(:)
9136 if (
present(negative_support))
then
9137 negative_support_on = negative_support
9139 negative_support_on = .true.
9145 answer_shape = shape(answer)
9146 check_shape = shape(check)
9148 consist_shape = answer_shape == check_shape
9150 if (.not. all(consist_shape))
then
9151 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9153 write(*,*)
' shape of check is (', check_shape,
')'
9154 write(*,*)
' is INCORRECT'
9155 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
9161 allocate( mask_array( &
9163 & answer_shape(1) ) &
9168 & answer_shape(1) ) &
9171 allocate( judge_rev( &
9173 & answer_shape(1) ) &
9176 allocate( answer_negative( &
9178 & answer_shape(1) ) &
9181 allocate( check_negative( &
9183 & answer_shape(1) ) &
9186 allocate( both_negative( &
9188 & answer_shape(1) ) &
9191 answer_negative = answer < 0
9192 check_negative = check < 0
9193 both_negative = answer_negative .and. check_negative
9194 if (.not. negative_support_on) both_negative = .false.
9196 judge = answer < check
9197 where (both_negative) judge = .not. judge
9199 judge_rev = .not. judge
9200 err_flag = any(judge_rev)
9202 pos = maxloc(mask_array, judge_rev)
9214 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
9219 & trim(adjustl(pos_array(1))) //
')'
9221 if ( both_negative( &
9225 abs_mes =
'ABSOLUTE value of'
9232 deallocate(mask_array, judge, judge_rev)
9233 deallocate(answer_negative, check_negative, both_negative)
9239 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9241 write(*,*)
' ' // trim(abs_mes) // &
9242 &
' check' // trim(pos_str) //
' = ', wrong
9243 write(*,*)
' is NOT GREATER THAN'
9244 write(*,*)
' ' // trim(abs_mes) // &
9245 &
' answer' // trim(pos_str) //
' = ', right
9249 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
9253 end subroutine dctestassertgreaterthanint1
9256 subroutine dctestassertgreaterthanint2( &
9257 & message, answer, check, negative_support)
9261 character(*),
intent(in):: message
9262 integer,
intent(in):: answer(:,:)
9263 integer,
intent(in):: check(:,:)
9264 logical,
intent(in),
optional:: negative_support
9266 logical:: negative_support_on
9267 character(STRING):: pos_str
9268 character(TOKEN):: abs_mes
9269 integer:: wrong, right
9271 integer:: answer_shape(2), check_shape(2), pos(2)
9272 logical:: consist_shape(2)
9273 character(TOKEN):: pos_array(2)
9274 integer,
allocatable:: mask_array(:,:)
9275 logical,
allocatable:: judge(:,:)
9276 logical,
allocatable:: judge_rev(:,:)
9277 logical,
allocatable:: answer_negative(:,:)
9278 logical,
allocatable:: check_negative(:,:)
9279 logical,
allocatable:: both_negative(:,:)
9283 if (
present(negative_support))
then
9284 negative_support_on = negative_support
9286 negative_support_on = .true.
9292 answer_shape = shape(answer)
9293 check_shape = shape(check)
9295 consist_shape = answer_shape == check_shape
9297 if (.not. all(consist_shape))
then
9298 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9300 write(*,*)
' shape of check is (', check_shape,
')'
9301 write(*,*)
' is INCORRECT'
9302 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
9308 allocate( mask_array( &
9309 & answer_shape(1), &
9311 & answer_shape(2) ) &
9315 & answer_shape(1), &
9317 & answer_shape(2) ) &
9320 allocate( judge_rev( &
9321 & answer_shape(1), &
9323 & answer_shape(2) ) &
9326 allocate( answer_negative( &
9327 & answer_shape(1), &
9329 & answer_shape(2) ) &
9332 allocate( check_negative( &
9333 & answer_shape(1), &
9335 & answer_shape(2) ) &
9338 allocate( both_negative( &
9339 & answer_shape(1), &
9341 & answer_shape(2) ) &
9344 answer_negative = answer < 0
9345 check_negative = check < 0
9346 both_negative = answer_negative .and. check_negative
9347 if (.not. negative_support_on) both_negative = .false.
9349 judge = answer < check
9350 where (both_negative) judge = .not. judge
9352 judge_rev = .not. judge
9353 err_flag = any(judge_rev)
9355 pos = maxloc(mask_array, judge_rev)
9369 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
9371 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
9375 & trim(adjustl(pos_array(1))) //
',' // &
9377 & trim(adjustl(pos_array(2))) //
')'
9379 if ( both_negative( &
9384 abs_mes =
'ABSOLUTE value of'
9391 deallocate(mask_array, judge, judge_rev)
9392 deallocate(answer_negative, check_negative, both_negative)
9398 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9400 write(*,*)
' ' // trim(abs_mes) // &
9401 &
' check' // trim(pos_str) //
' = ', wrong
9402 write(*,*)
' is NOT GREATER THAN'
9403 write(*,*)
' ' // trim(abs_mes) // &
9404 &
' answer' // trim(pos_str) //
' = ', right
9408 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
9412 end subroutine dctestassertgreaterthanint2
9415 subroutine dctestassertgreaterthanint3( &
9416 & message, answer, check, negative_support)
9420 character(*),
intent(in):: message
9421 integer,
intent(in):: answer(:,:,:)
9422 integer,
intent(in):: check(:,:,:)
9423 logical,
intent(in),
optional:: negative_support
9425 logical:: negative_support_on
9426 character(STRING):: pos_str
9427 character(TOKEN):: abs_mes
9428 integer:: wrong, right
9430 integer:: answer_shape(3), check_shape(3), pos(3)
9431 logical:: consist_shape(3)
9432 character(TOKEN):: pos_array(3)
9433 integer,
allocatable:: mask_array(:,:,:)
9434 logical,
allocatable:: judge(:,:,:)
9435 logical,
allocatable:: judge_rev(:,:,:)
9436 logical,
allocatable:: answer_negative(:,:,:)
9437 logical,
allocatable:: check_negative(:,:,:)
9438 logical,
allocatable:: both_negative(:,:,:)
9442 if (
present(negative_support))
then
9443 negative_support_on = negative_support
9445 negative_support_on = .true.
9451 answer_shape = shape(answer)
9452 check_shape = shape(check)
9454 consist_shape = answer_shape == check_shape
9456 if (.not. all(consist_shape))
then
9457 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9459 write(*,*)
' shape of check is (', check_shape,
')'
9460 write(*,*)
' is INCORRECT'
9461 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
9467 allocate( mask_array( &
9468 & answer_shape(1), &
9470 & answer_shape(2), &
9472 & answer_shape(3) ) &
9476 & answer_shape(1), &
9478 & answer_shape(2), &
9480 & answer_shape(3) ) &
9483 allocate( judge_rev( &
9484 & answer_shape(1), &
9486 & answer_shape(2), &
9488 & answer_shape(3) ) &
9491 allocate( answer_negative( &
9492 & answer_shape(1), &
9494 & answer_shape(2), &
9496 & answer_shape(3) ) &
9499 allocate( check_negative( &
9500 & answer_shape(1), &
9502 & answer_shape(2), &
9504 & answer_shape(3) ) &
9507 allocate( both_negative( &
9508 & answer_shape(1), &
9510 & answer_shape(2), &
9512 & answer_shape(3) ) &
9515 answer_negative = answer < 0
9516 check_negative = check < 0
9517 both_negative = answer_negative .and. check_negative
9518 if (.not. negative_support_on) both_negative = .false.
9520 judge = answer < check
9521 where (both_negative) judge = .not. judge
9523 judge_rev = .not. judge
9524 err_flag = any(judge_rev)
9526 pos = maxloc(mask_array, judge_rev)
9544 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
9546 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
9548 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
9552 & trim(adjustl(pos_array(1))) //
',' // &
9554 & trim(adjustl(pos_array(2))) //
',' // &
9556 & trim(adjustl(pos_array(3))) //
')'
9558 if ( both_negative( &
9565 abs_mes =
'ABSOLUTE value of'
9572 deallocate(mask_array, judge, judge_rev)
9573 deallocate(answer_negative, check_negative, both_negative)
9579 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9581 write(*,*)
' ' // trim(abs_mes) // &
9582 &
' check' // trim(pos_str) //
' = ', wrong
9583 write(*,*)
' is NOT GREATER THAN'
9584 write(*,*)
' ' // trim(abs_mes) // &
9585 &
' answer' // trim(pos_str) //
' = ', right
9589 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
9593 end subroutine dctestassertgreaterthanint3
9596 subroutine dctestassertgreaterthanint4( &
9597 & message, answer, check, negative_support)
9601 character(*),
intent(in):: message
9602 integer,
intent(in):: answer(:,:,:,:)
9603 integer,
intent(in):: check(:,:,:,:)
9604 logical,
intent(in),
optional:: negative_support
9606 logical:: negative_support_on
9607 character(STRING):: pos_str
9608 character(TOKEN):: abs_mes
9609 integer:: wrong, right
9611 integer:: answer_shape(4), check_shape(4), pos(4)
9612 logical:: consist_shape(4)
9613 character(TOKEN):: pos_array(4)
9614 integer,
allocatable:: mask_array(:,:,:,:)
9615 logical,
allocatable:: judge(:,:,:,:)
9616 logical,
allocatable:: judge_rev(:,:,:,:)
9617 logical,
allocatable:: answer_negative(:,:,:,:)
9618 logical,
allocatable:: check_negative(:,:,:,:)
9619 logical,
allocatable:: both_negative(:,:,:,:)
9623 if (
present(negative_support))
then
9624 negative_support_on = negative_support
9626 negative_support_on = .true.
9632 answer_shape = shape(answer)
9633 check_shape = shape(check)
9635 consist_shape = answer_shape == check_shape
9637 if (.not. all(consist_shape))
then
9638 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9640 write(*,*)
' shape of check is (', check_shape,
')'
9641 write(*,*)
' is INCORRECT'
9642 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
9648 allocate( mask_array( &
9649 & answer_shape(1), &
9651 & answer_shape(2), &
9653 & answer_shape(3), &
9655 & answer_shape(4) ) &
9659 & answer_shape(1), &
9661 & answer_shape(2), &
9663 & answer_shape(3), &
9665 & answer_shape(4) ) &
9668 allocate( judge_rev( &
9669 & answer_shape(1), &
9671 & answer_shape(2), &
9673 & answer_shape(3), &
9675 & answer_shape(4) ) &
9678 allocate( answer_negative( &
9679 & answer_shape(1), &
9681 & answer_shape(2), &
9683 & answer_shape(3), &
9685 & answer_shape(4) ) &
9688 allocate( check_negative( &
9689 & answer_shape(1), &
9691 & answer_shape(2), &
9693 & answer_shape(3), &
9695 & answer_shape(4) ) &
9698 allocate( both_negative( &
9699 & answer_shape(1), &
9701 & answer_shape(2), &
9703 & answer_shape(3), &
9705 & answer_shape(4) ) &
9708 answer_negative = answer < 0
9709 check_negative = check < 0
9710 both_negative = answer_negative .and. check_negative
9711 if (.not. negative_support_on) both_negative = .false.
9713 judge = answer < check
9714 where (both_negative) judge = .not. judge
9716 judge_rev = .not. judge
9717 err_flag = any(judge_rev)
9719 pos = maxloc(mask_array, judge_rev)
9741 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
9743 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
9745 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
9747 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
9751 & trim(adjustl(pos_array(1))) //
',' // &
9753 & trim(adjustl(pos_array(2))) //
',' // &
9755 & trim(adjustl(pos_array(3))) //
',' // &
9757 & trim(adjustl(pos_array(4))) //
')'
9759 if ( both_negative( &
9768 abs_mes =
'ABSOLUTE value of'
9775 deallocate(mask_array, judge, judge_rev)
9776 deallocate(answer_negative, check_negative, both_negative)
9782 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9784 write(*,*)
' ' // trim(abs_mes) // &
9785 &
' check' // trim(pos_str) //
' = ', wrong
9786 write(*,*)
' is NOT GREATER THAN'
9787 write(*,*)
' ' // trim(abs_mes) // &
9788 &
' answer' // trim(pos_str) //
' = ', right
9792 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
9796 end subroutine dctestassertgreaterthanint4
9799 subroutine dctestassertgreaterthanint5( &
9800 & message, answer, check, negative_support)
9804 character(*),
intent(in):: message
9805 integer,
intent(in):: answer(:,:,:,:,:)
9806 integer,
intent(in):: check(:,:,:,:,:)
9807 logical,
intent(in),
optional:: negative_support
9809 logical:: negative_support_on
9810 character(STRING):: pos_str
9811 character(TOKEN):: abs_mes
9812 integer:: wrong, right
9814 integer:: answer_shape(5), check_shape(5), pos(5)
9815 logical:: consist_shape(5)
9816 character(TOKEN):: pos_array(5)
9817 integer,
allocatable:: mask_array(:,:,:,:,:)
9818 logical,
allocatable:: judge(:,:,:,:,:)
9819 logical,
allocatable:: judge_rev(:,:,:,:,:)
9820 logical,
allocatable:: answer_negative(:,:,:,:,:)
9821 logical,
allocatable:: check_negative(:,:,:,:,:)
9822 logical,
allocatable:: both_negative(:,:,:,:,:)
9826 if (
present(negative_support))
then
9827 negative_support_on = negative_support
9829 negative_support_on = .true.
9835 answer_shape = shape(answer)
9836 check_shape = shape(check)
9838 consist_shape = answer_shape == check_shape
9840 if (.not. all(consist_shape))
then
9841 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
9843 write(*,*)
' shape of check is (', check_shape,
')'
9844 write(*,*)
' is INCORRECT'
9845 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
9851 allocate( mask_array( &
9852 & answer_shape(1), &
9854 & answer_shape(2), &
9856 & answer_shape(3), &
9858 & answer_shape(4), &
9860 & answer_shape(5) ) &
9864 & answer_shape(1), &
9866 & answer_shape(2), &
9868 & answer_shape(3), &
9870 & answer_shape(4), &
9872 & answer_shape(5) ) &
9875 allocate( judge_rev( &
9876 & answer_shape(1), &
9878 & answer_shape(2), &
9880 & answer_shape(3), &
9882 & answer_shape(4), &
9884 & answer_shape(5) ) &
9887 allocate( answer_negative( &
9888 & answer_shape(1), &
9890 & answer_shape(2), &
9892 & answer_shape(3), &
9894 & answer_shape(4), &
9896 & answer_shape(5) ) &
9899 allocate( check_negative( &
9900 & answer_shape(1), &
9902 & answer_shape(2), &
9904 & answer_shape(3), &
9906 & answer_shape(4), &
9908 & answer_shape(5) ) &
9911 allocate( both_negative( &
9912 & answer_shape(1), &
9914 & answer_shape(2), &
9916 & answer_shape(3), &
9918 & answer_shape(4), &
9920 & answer_shape(5) ) &
9923 answer_negative = answer < 0
9924 check_negative = check < 0
9925 both_negative = answer_negative .and. check_negative
9926 if (.not. negative_support_on) both_negative = .false.
9928 judge = answer < check
9929 where (both_negative) judge = .not. judge
9931 judge_rev = .not. judge
9932 err_flag = any(judge_rev)
9934 pos = maxloc(mask_array, judge_rev)
9960 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
9962 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
9964 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
9966 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
9968 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
9972 & trim(adjustl(pos_array(1))) //
',' // &
9974 & trim(adjustl(pos_array(2))) //
',' // &
9976 & trim(adjustl(pos_array(3))) //
',' // &
9978 & trim(adjustl(pos_array(4))) //
',' // &
9980 & trim(adjustl(pos_array(5))) //
')'
9982 if ( both_negative( &
9993 abs_mes =
'ABSOLUTE value of'
10000 deallocate(mask_array, judge, judge_rev)
10001 deallocate(answer_negative, check_negative, both_negative)
10007 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10009 write(*,*)
' ' // trim(abs_mes) // &
10010 &
' check' // trim(pos_str) //
' = ', wrong
10011 write(*,*)
' is NOT GREATER THAN'
10012 write(*,*)
' ' // trim(abs_mes) // &
10013 &
' answer' // trim(pos_str) //
' = ', right
10017 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
10021 end subroutine dctestassertgreaterthanint5
10024 subroutine dctestassertgreaterthanint6( &
10025 & message, answer, check, negative_support)
10029 character(*),
intent(in):: message
10030 integer,
intent(in):: answer(:,:,:,:,:,:)
10031 integer,
intent(in):: check(:,:,:,:,:,:)
10032 logical,
intent(in),
optional:: negative_support
10034 logical:: negative_support_on
10035 character(STRING):: pos_str
10036 character(TOKEN):: abs_mes
10037 integer:: wrong, right
10039 integer:: answer_shape(6), check_shape(6), pos(6)
10040 logical:: consist_shape(6)
10041 character(TOKEN):: pos_array(6)
10042 integer,
allocatable:: mask_array(:,:,:,:,:,:)
10043 logical,
allocatable:: judge(:,:,:,:,:,:)
10044 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
10045 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
10046 logical,
allocatable:: check_negative(:,:,:,:,:,:)
10047 logical,
allocatable:: both_negative(:,:,:,:,:,:)
10051 if (
present(negative_support))
then
10052 negative_support_on = negative_support
10054 negative_support_on = .true.
10060 answer_shape = shape(answer)
10061 check_shape = shape(check)
10063 consist_shape = answer_shape == check_shape
10065 if (.not. all(consist_shape))
then
10066 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10068 write(*,*)
' shape of check is (', check_shape,
')'
10069 write(*,*)
' is INCORRECT'
10070 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
10076 allocate( mask_array( &
10077 & answer_shape(1), &
10079 & answer_shape(2), &
10081 & answer_shape(3), &
10083 & answer_shape(4), &
10085 & answer_shape(5), &
10087 & answer_shape(6) ) &
10091 & answer_shape(1), &
10093 & answer_shape(2), &
10095 & answer_shape(3), &
10097 & answer_shape(4), &
10099 & answer_shape(5), &
10101 & answer_shape(6) ) &
10104 allocate( judge_rev( &
10105 & answer_shape(1), &
10107 & answer_shape(2), &
10109 & answer_shape(3), &
10111 & answer_shape(4), &
10113 & answer_shape(5), &
10115 & answer_shape(6) ) &
10118 allocate( answer_negative( &
10119 & answer_shape(1), &
10121 & answer_shape(2), &
10123 & answer_shape(3), &
10125 & answer_shape(4), &
10127 & answer_shape(5), &
10129 & answer_shape(6) ) &
10132 allocate( check_negative( &
10133 & answer_shape(1), &
10135 & answer_shape(2), &
10137 & answer_shape(3), &
10139 & answer_shape(4), &
10141 & answer_shape(5), &
10143 & answer_shape(6) ) &
10146 allocate( both_negative( &
10147 & answer_shape(1), &
10149 & answer_shape(2), &
10151 & answer_shape(3), &
10153 & answer_shape(4), &
10155 & answer_shape(5), &
10157 & answer_shape(6) ) &
10160 answer_negative = answer < 0
10161 check_negative = check < 0
10162 both_negative = answer_negative .and. check_negative
10163 if (.not. negative_support_on) both_negative = .false.
10165 judge = answer < check
10166 where (both_negative) judge = .not. judge
10168 judge_rev = .not. judge
10169 err_flag = any(judge_rev)
10171 pos = maxloc(mask_array, judge_rev)
10201 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
10203 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
10205 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
10207 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
10209 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
10211 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
10215 & trim(adjustl(pos_array(1))) //
',' // &
10217 & trim(adjustl(pos_array(2))) //
',' // &
10219 & trim(adjustl(pos_array(3))) //
',' // &
10221 & trim(adjustl(pos_array(4))) //
',' // &
10223 & trim(adjustl(pos_array(5))) //
',' // &
10225 & trim(adjustl(pos_array(6))) //
')'
10227 if ( both_negative( &
10240 abs_mes =
'ABSOLUTE value of'
10247 deallocate(mask_array, judge, judge_rev)
10248 deallocate(answer_negative, check_negative, both_negative)
10254 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10256 write(*,*)
' ' // trim(abs_mes) // &
10257 &
' check' // trim(pos_str) //
' = ', wrong
10258 write(*,*)
' is NOT GREATER THAN'
10259 write(*,*)
' ' // trim(abs_mes) // &
10260 &
' answer' // trim(pos_str) //
' = ', right
10264 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
10268 end subroutine dctestassertgreaterthanint6
10271 subroutine dctestassertgreaterthanint7( &
10272 & message, answer, check, negative_support)
10276 character(*),
intent(in):: message
10277 integer,
intent(in):: answer(:,:,:,:,:,:,:)
10278 integer,
intent(in):: check(:,:,:,:,:,:,:)
10279 logical,
intent(in),
optional:: negative_support
10281 logical:: negative_support_on
10282 character(STRING):: pos_str
10283 character(TOKEN):: abs_mes
10284 integer:: wrong, right
10286 integer:: answer_shape(7), check_shape(7), pos(7)
10287 logical:: consist_shape(7)
10288 character(TOKEN):: pos_array(7)
10289 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
10290 logical,
allocatable:: judge(:,:,:,:,:,:,:)
10291 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
10292 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
10293 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
10294 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
10298 if (
present(negative_support))
then
10299 negative_support_on = negative_support
10301 negative_support_on = .true.
10307 answer_shape = shape(answer)
10308 check_shape = shape(check)
10310 consist_shape = answer_shape == check_shape
10312 if (.not. all(consist_shape))
then
10313 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10315 write(*,*)
' shape of check is (', check_shape,
')'
10316 write(*,*)
' is INCORRECT'
10317 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
10323 allocate( mask_array( &
10324 & answer_shape(1), &
10326 & answer_shape(2), &
10328 & answer_shape(3), &
10330 & answer_shape(4), &
10332 & answer_shape(5), &
10334 & answer_shape(6), &
10336 & answer_shape(7) ) &
10340 & answer_shape(1), &
10342 & answer_shape(2), &
10344 & answer_shape(3), &
10346 & answer_shape(4), &
10348 & answer_shape(5), &
10350 & answer_shape(6), &
10352 & answer_shape(7) ) &
10355 allocate( judge_rev( &
10356 & answer_shape(1), &
10358 & answer_shape(2), &
10360 & answer_shape(3), &
10362 & answer_shape(4), &
10364 & answer_shape(5), &
10366 & answer_shape(6), &
10368 & answer_shape(7) ) &
10371 allocate( answer_negative( &
10372 & answer_shape(1), &
10374 & answer_shape(2), &
10376 & answer_shape(3), &
10378 & answer_shape(4), &
10380 & answer_shape(5), &
10382 & answer_shape(6), &
10384 & answer_shape(7) ) &
10387 allocate( check_negative( &
10388 & answer_shape(1), &
10390 & answer_shape(2), &
10392 & answer_shape(3), &
10394 & answer_shape(4), &
10396 & answer_shape(5), &
10398 & answer_shape(6), &
10400 & answer_shape(7) ) &
10403 allocate( both_negative( &
10404 & answer_shape(1), &
10406 & answer_shape(2), &
10408 & answer_shape(3), &
10410 & answer_shape(4), &
10412 & answer_shape(5), &
10414 & answer_shape(6), &
10416 & answer_shape(7) ) &
10419 answer_negative = answer < 0
10420 check_negative = check < 0
10421 both_negative = answer_negative .and. check_negative
10422 if (.not. negative_support_on) both_negative = .false.
10424 judge = answer < check
10425 where (both_negative) judge = .not. judge
10427 judge_rev = .not. judge
10428 err_flag = any(judge_rev)
10430 pos = maxloc(mask_array, judge_rev)
10464 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
10466 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
10468 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
10470 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
10472 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
10474 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
10476 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
10480 & trim(adjustl(pos_array(1))) //
',' // &
10482 & trim(adjustl(pos_array(2))) //
',' // &
10484 & trim(adjustl(pos_array(3))) //
',' // &
10486 & trim(adjustl(pos_array(4))) //
',' // &
10488 & trim(adjustl(pos_array(5))) //
',' // &
10490 & trim(adjustl(pos_array(6))) //
',' // &
10492 & trim(adjustl(pos_array(7))) //
')'
10494 if ( both_negative( &
10509 abs_mes =
'ABSOLUTE value of'
10516 deallocate(mask_array, judge, judge_rev)
10517 deallocate(answer_negative, check_negative, both_negative)
10523 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10525 write(*,*)
' ' // trim(abs_mes) // &
10526 &
' check' // trim(pos_str) //
' = ', wrong
10527 write(*,*)
' is NOT GREATER THAN'
10528 write(*,*)
' ' // trim(abs_mes) // &
10529 &
' answer' // trim(pos_str) //
' = ', right
10533 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
10537 end subroutine dctestassertgreaterthanint7
10540 subroutine dctestassertgreaterthanreal0( &
10541 & message, answer, check, negative_support)
10545 character(*),
intent(in):: message
10546 real,
intent(in):: answer
10547 real,
intent(in):: check
10548 logical,
intent(in),
optional:: negative_support
10550 logical:: negative_support_on
10551 character(STRING):: pos_str
10552 character(TOKEN):: abs_mes
10553 real:: wrong, right
10558 if (
present(negative_support))
then
10559 negative_support_on = negative_support
10561 negative_support_on = .true.
10567 err_flag = .not. answer < check
10570 if ( answer < 0.0 &
10571 & .and. check < 0.0 &
10572 & .and. negative_support_on )
then
10574 err_flag = .not. err_flag
10575 abs_mes =
'ABSOLUTE value of'
10586 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10588 write(*,*)
' ' // trim(abs_mes) // &
10589 &
' check' // trim(pos_str) //
' = ', wrong
10590 write(*,*)
' is NOT GREATER THAN'
10591 write(*,*)
' ' // trim(abs_mes) // &
10592 &
' answer' // trim(pos_str) //
' = ', right
10596 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
10600 end subroutine dctestassertgreaterthanreal0
10603 subroutine dctestassertgreaterthanreal1( &
10604 & message, answer, check, negative_support)
10608 character(*),
intent(in):: message
10609 real,
intent(in):: answer(:)
10610 real,
intent(in):: check(:)
10611 logical,
intent(in),
optional:: negative_support
10613 logical:: negative_support_on
10614 character(STRING):: pos_str
10615 character(TOKEN):: abs_mes
10616 real:: wrong, right
10618 integer:: answer_shape(1), check_shape(1), pos(1)
10619 logical:: consist_shape(1)
10620 character(TOKEN):: pos_array(1)
10621 integer,
allocatable:: mask_array(:)
10622 logical,
allocatable:: judge(:)
10623 logical,
allocatable:: judge_rev(:)
10624 logical,
allocatable:: answer_negative(:)
10625 logical,
allocatable:: check_negative(:)
10626 logical,
allocatable:: both_negative(:)
10630 if (
present(negative_support))
then
10631 negative_support_on = negative_support
10633 negative_support_on = .true.
10639 answer_shape = shape(answer)
10640 check_shape = shape(check)
10642 consist_shape = answer_shape == check_shape
10644 if (.not. all(consist_shape))
then
10645 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10647 write(*,*)
' shape of check is (', check_shape,
')'
10648 write(*,*)
' is INCORRECT'
10649 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
10655 allocate( mask_array( &
10657 & answer_shape(1) ) &
10662 & answer_shape(1) ) &
10665 allocate( judge_rev( &
10667 & answer_shape(1) ) &
10670 allocate( answer_negative( &
10672 & answer_shape(1) ) &
10675 allocate( check_negative( &
10677 & answer_shape(1) ) &
10680 allocate( both_negative( &
10682 & answer_shape(1) ) &
10685 answer_negative = answer < 0.0
10686 check_negative = check < 0.0
10687 both_negative = answer_negative .and. check_negative
10688 if (.not. negative_support_on) both_negative = .false.
10690 judge = answer < check
10691 where (both_negative) judge = .not. judge
10693 judge_rev = .not. judge
10694 err_flag = any(judge_rev)
10696 pos = maxloc(mask_array, judge_rev)
10708 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
10713 & trim(adjustl(pos_array(1))) //
')'
10715 if ( both_negative( &
10719 abs_mes =
'ABSOLUTE value of'
10726 deallocate(mask_array, judge, judge_rev)
10727 deallocate(answer_negative, check_negative, both_negative)
10733 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10735 write(*,*)
' ' // trim(abs_mes) // &
10736 &
' check' // trim(pos_str) //
' = ', wrong
10737 write(*,*)
' is NOT GREATER THAN'
10738 write(*,*)
' ' // trim(abs_mes) // &
10739 &
' answer' // trim(pos_str) //
' = ', right
10743 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
10747 end subroutine dctestassertgreaterthanreal1
10750 subroutine dctestassertgreaterthanreal2( &
10751 & message, answer, check, negative_support)
10755 character(*),
intent(in):: message
10756 real,
intent(in):: answer(:,:)
10757 real,
intent(in):: check(:,:)
10758 logical,
intent(in),
optional:: negative_support
10760 logical:: negative_support_on
10761 character(STRING):: pos_str
10762 character(TOKEN):: abs_mes
10763 real:: wrong, right
10765 integer:: answer_shape(2), check_shape(2), pos(2)
10766 logical:: consist_shape(2)
10767 character(TOKEN):: pos_array(2)
10768 integer,
allocatable:: mask_array(:,:)
10769 logical,
allocatable:: judge(:,:)
10770 logical,
allocatable:: judge_rev(:,:)
10771 logical,
allocatable:: answer_negative(:,:)
10772 logical,
allocatable:: check_negative(:,:)
10773 logical,
allocatable:: both_negative(:,:)
10777 if (
present(negative_support))
then
10778 negative_support_on = negative_support
10780 negative_support_on = .true.
10786 answer_shape = shape(answer)
10787 check_shape = shape(check)
10789 consist_shape = answer_shape == check_shape
10791 if (.not. all(consist_shape))
then
10792 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10794 write(*,*)
' shape of check is (', check_shape,
')'
10795 write(*,*)
' is INCORRECT'
10796 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
10802 allocate( mask_array( &
10803 & answer_shape(1), &
10805 & answer_shape(2) ) &
10809 & answer_shape(1), &
10811 & answer_shape(2) ) &
10814 allocate( judge_rev( &
10815 & answer_shape(1), &
10817 & answer_shape(2) ) &
10820 allocate( answer_negative( &
10821 & answer_shape(1), &
10823 & answer_shape(2) ) &
10826 allocate( check_negative( &
10827 & answer_shape(1), &
10829 & answer_shape(2) ) &
10832 allocate( both_negative( &
10833 & answer_shape(1), &
10835 & answer_shape(2) ) &
10838 answer_negative = answer < 0.0
10839 check_negative = check < 0.0
10840 both_negative = answer_negative .and. check_negative
10841 if (.not. negative_support_on) both_negative = .false.
10843 judge = answer < check
10844 where (both_negative) judge = .not. judge
10846 judge_rev = .not. judge
10847 err_flag = any(judge_rev)
10849 pos = maxloc(mask_array, judge_rev)
10863 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
10865 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
10869 & trim(adjustl(pos_array(1))) //
',' // &
10871 & trim(adjustl(pos_array(2))) //
')'
10873 if ( both_negative( &
10878 abs_mes =
'ABSOLUTE value of'
10885 deallocate(mask_array, judge, judge_rev)
10886 deallocate(answer_negative, check_negative, both_negative)
10892 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10894 write(*,*)
' ' // trim(abs_mes) // &
10895 &
' check' // trim(pos_str) //
' = ', wrong
10896 write(*,*)
' is NOT GREATER THAN'
10897 write(*,*)
' ' // trim(abs_mes) // &
10898 &
' answer' // trim(pos_str) //
' = ', right
10902 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
10906 end subroutine dctestassertgreaterthanreal2
10909 subroutine dctestassertgreaterthanreal3( &
10910 & message, answer, check, negative_support)
10914 character(*),
intent(in):: message
10915 real,
intent(in):: answer(:,:,:)
10916 real,
intent(in):: check(:,:,:)
10917 logical,
intent(in),
optional:: negative_support
10919 logical:: negative_support_on
10920 character(STRING):: pos_str
10921 character(TOKEN):: abs_mes
10922 real:: wrong, right
10924 integer:: answer_shape(3), check_shape(3), pos(3)
10925 logical:: consist_shape(3)
10926 character(TOKEN):: pos_array(3)
10927 integer,
allocatable:: mask_array(:,:,:)
10928 logical,
allocatable:: judge(:,:,:)
10929 logical,
allocatable:: judge_rev(:,:,:)
10930 logical,
allocatable:: answer_negative(:,:,:)
10931 logical,
allocatable:: check_negative(:,:,:)
10932 logical,
allocatable:: both_negative(:,:,:)
10936 if (
present(negative_support))
then
10937 negative_support_on = negative_support
10939 negative_support_on = .true.
10945 answer_shape = shape(answer)
10946 check_shape = shape(check)
10948 consist_shape = answer_shape == check_shape
10950 if (.not. all(consist_shape))
then
10951 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
10953 write(*,*)
' shape of check is (', check_shape,
')'
10954 write(*,*)
' is INCORRECT'
10955 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
10961 allocate( mask_array( &
10962 & answer_shape(1), &
10964 & answer_shape(2), &
10966 & answer_shape(3) ) &
10970 & answer_shape(1), &
10972 & answer_shape(2), &
10974 & answer_shape(3) ) &
10977 allocate( judge_rev( &
10978 & answer_shape(1), &
10980 & answer_shape(2), &
10982 & answer_shape(3) ) &
10985 allocate( answer_negative( &
10986 & answer_shape(1), &
10988 & answer_shape(2), &
10990 & answer_shape(3) ) &
10993 allocate( check_negative( &
10994 & answer_shape(1), &
10996 & answer_shape(2), &
10998 & answer_shape(3) ) &
11001 allocate( both_negative( &
11002 & answer_shape(1), &
11004 & answer_shape(2), &
11006 & answer_shape(3) ) &
11009 answer_negative = answer < 0.0
11010 check_negative = check < 0.0
11011 both_negative = answer_negative .and. check_negative
11012 if (.not. negative_support_on) both_negative = .false.
11014 judge = answer < check
11015 where (both_negative) judge = .not. judge
11017 judge_rev = .not. judge
11018 err_flag = any(judge_rev)
11020 pos = maxloc(mask_array, judge_rev)
11038 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
11040 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
11042 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
11046 & trim(adjustl(pos_array(1))) //
',' // &
11048 & trim(adjustl(pos_array(2))) //
',' // &
11050 & trim(adjustl(pos_array(3))) //
')'
11052 if ( both_negative( &
11059 abs_mes =
'ABSOLUTE value of'
11066 deallocate(mask_array, judge, judge_rev)
11067 deallocate(answer_negative, check_negative, both_negative)
11073 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11075 write(*,*)
' ' // trim(abs_mes) // &
11076 &
' check' // trim(pos_str) //
' = ', wrong
11077 write(*,*)
' is NOT GREATER THAN'
11078 write(*,*)
' ' // trim(abs_mes) // &
11079 &
' answer' // trim(pos_str) //
' = ', right
11083 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
11087 end subroutine dctestassertgreaterthanreal3
11090 subroutine dctestassertgreaterthanreal4( &
11091 & message, answer, check, negative_support)
11095 character(*),
intent(in):: message
11096 real,
intent(in):: answer(:,:,:,:)
11097 real,
intent(in):: check(:,:,:,:)
11098 logical,
intent(in),
optional:: negative_support
11100 logical:: negative_support_on
11101 character(STRING):: pos_str
11102 character(TOKEN):: abs_mes
11103 real:: wrong, right
11105 integer:: answer_shape(4), check_shape(4), pos(4)
11106 logical:: consist_shape(4)
11107 character(TOKEN):: pos_array(4)
11108 integer,
allocatable:: mask_array(:,:,:,:)
11109 logical,
allocatable:: judge(:,:,:,:)
11110 logical,
allocatable:: judge_rev(:,:,:,:)
11111 logical,
allocatable:: answer_negative(:,:,:,:)
11112 logical,
allocatable:: check_negative(:,:,:,:)
11113 logical,
allocatable:: both_negative(:,:,:,:)
11117 if (
present(negative_support))
then
11118 negative_support_on = negative_support
11120 negative_support_on = .true.
11126 answer_shape = shape(answer)
11127 check_shape = shape(check)
11129 consist_shape = answer_shape == check_shape
11131 if (.not. all(consist_shape))
then
11132 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11134 write(*,*)
' shape of check is (', check_shape,
')'
11135 write(*,*)
' is INCORRECT'
11136 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
11142 allocate( mask_array( &
11143 & answer_shape(1), &
11145 & answer_shape(2), &
11147 & answer_shape(3), &
11149 & answer_shape(4) ) &
11153 & answer_shape(1), &
11155 & answer_shape(2), &
11157 & answer_shape(3), &
11159 & answer_shape(4) ) &
11162 allocate( judge_rev( &
11163 & answer_shape(1), &
11165 & answer_shape(2), &
11167 & answer_shape(3), &
11169 & answer_shape(4) ) &
11172 allocate( answer_negative( &
11173 & answer_shape(1), &
11175 & answer_shape(2), &
11177 & answer_shape(3), &
11179 & answer_shape(4) ) &
11182 allocate( check_negative( &
11183 & answer_shape(1), &
11185 & answer_shape(2), &
11187 & answer_shape(3), &
11189 & answer_shape(4) ) &
11192 allocate( both_negative( &
11193 & answer_shape(1), &
11195 & answer_shape(2), &
11197 & answer_shape(3), &
11199 & answer_shape(4) ) &
11202 answer_negative = answer < 0.0
11203 check_negative = check < 0.0
11204 both_negative = answer_negative .and. check_negative
11205 if (.not. negative_support_on) both_negative = .false.
11207 judge = answer < check
11208 where (both_negative) judge = .not. judge
11210 judge_rev = .not. judge
11211 err_flag = any(judge_rev)
11213 pos = maxloc(mask_array, judge_rev)
11235 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
11237 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
11239 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
11241 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
11245 & trim(adjustl(pos_array(1))) //
',' // &
11247 & trim(adjustl(pos_array(2))) //
',' // &
11249 & trim(adjustl(pos_array(3))) //
',' // &
11251 & trim(adjustl(pos_array(4))) //
')'
11253 if ( both_negative( &
11262 abs_mes =
'ABSOLUTE value of'
11269 deallocate(mask_array, judge, judge_rev)
11270 deallocate(answer_negative, check_negative, both_negative)
11276 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11278 write(*,*)
' ' // trim(abs_mes) // &
11279 &
' check' // trim(pos_str) //
' = ', wrong
11280 write(*,*)
' is NOT GREATER THAN'
11281 write(*,*)
' ' // trim(abs_mes) // &
11282 &
' answer' // trim(pos_str) //
' = ', right
11286 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
11290 end subroutine dctestassertgreaterthanreal4
11293 subroutine dctestassertgreaterthanreal5( &
11294 & message, answer, check, negative_support)
11298 character(*),
intent(in):: message
11299 real,
intent(in):: answer(:,:,:,:,:)
11300 real,
intent(in):: check(:,:,:,:,:)
11301 logical,
intent(in),
optional:: negative_support
11303 logical:: negative_support_on
11304 character(STRING):: pos_str
11305 character(TOKEN):: abs_mes
11306 real:: wrong, right
11308 integer:: answer_shape(5), check_shape(5), pos(5)
11309 logical:: consist_shape(5)
11310 character(TOKEN):: pos_array(5)
11311 integer,
allocatable:: mask_array(:,:,:,:,:)
11312 logical,
allocatable:: judge(:,:,:,:,:)
11313 logical,
allocatable:: judge_rev(:,:,:,:,:)
11314 logical,
allocatable:: answer_negative(:,:,:,:,:)
11315 logical,
allocatable:: check_negative(:,:,:,:,:)
11316 logical,
allocatable:: both_negative(:,:,:,:,:)
11320 if (
present(negative_support))
then
11321 negative_support_on = negative_support
11323 negative_support_on = .true.
11329 answer_shape = shape(answer)
11330 check_shape = shape(check)
11332 consist_shape = answer_shape == check_shape
11334 if (.not. all(consist_shape))
then
11335 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11337 write(*,*)
' shape of check is (', check_shape,
')'
11338 write(*,*)
' is INCORRECT'
11339 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
11345 allocate( mask_array( &
11346 & answer_shape(1), &
11348 & answer_shape(2), &
11350 & answer_shape(3), &
11352 & answer_shape(4), &
11354 & answer_shape(5) ) &
11358 & answer_shape(1), &
11360 & answer_shape(2), &
11362 & answer_shape(3), &
11364 & answer_shape(4), &
11366 & answer_shape(5) ) &
11369 allocate( judge_rev( &
11370 & answer_shape(1), &
11372 & answer_shape(2), &
11374 & answer_shape(3), &
11376 & answer_shape(4), &
11378 & answer_shape(5) ) &
11381 allocate( answer_negative( &
11382 & answer_shape(1), &
11384 & answer_shape(2), &
11386 & answer_shape(3), &
11388 & answer_shape(4), &
11390 & answer_shape(5) ) &
11393 allocate( check_negative( &
11394 & answer_shape(1), &
11396 & answer_shape(2), &
11398 & answer_shape(3), &
11400 & answer_shape(4), &
11402 & answer_shape(5) ) &
11405 allocate( both_negative( &
11406 & answer_shape(1), &
11408 & answer_shape(2), &
11410 & answer_shape(3), &
11412 & answer_shape(4), &
11414 & answer_shape(5) ) &
11417 answer_negative = answer < 0.0
11418 check_negative = check < 0.0
11419 both_negative = answer_negative .and. check_negative
11420 if (.not. negative_support_on) both_negative = .false.
11422 judge = answer < check
11423 where (both_negative) judge = .not. judge
11425 judge_rev = .not. judge
11426 err_flag = any(judge_rev)
11428 pos = maxloc(mask_array, judge_rev)
11454 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
11456 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
11458 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
11460 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
11462 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
11466 & trim(adjustl(pos_array(1))) //
',' // &
11468 & trim(adjustl(pos_array(2))) //
',' // &
11470 & trim(adjustl(pos_array(3))) //
',' // &
11472 & trim(adjustl(pos_array(4))) //
',' // &
11474 & trim(adjustl(pos_array(5))) //
')'
11476 if ( both_negative( &
11487 abs_mes =
'ABSOLUTE value of'
11494 deallocate(mask_array, judge, judge_rev)
11495 deallocate(answer_negative, check_negative, both_negative)
11501 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11503 write(*,*)
' ' // trim(abs_mes) // &
11504 &
' check' // trim(pos_str) //
' = ', wrong
11505 write(*,*)
' is NOT GREATER THAN'
11506 write(*,*)
' ' // trim(abs_mes) // &
11507 &
' answer' // trim(pos_str) //
' = ', right
11511 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
11515 end subroutine dctestassertgreaterthanreal5
11518 subroutine dctestassertgreaterthanreal6( &
11519 & message, answer, check, negative_support)
11523 character(*),
intent(in):: message
11524 real,
intent(in):: answer(:,:,:,:,:,:)
11525 real,
intent(in):: check(:,:,:,:,:,:)
11526 logical,
intent(in),
optional:: negative_support
11528 logical:: negative_support_on
11529 character(STRING):: pos_str
11530 character(TOKEN):: abs_mes
11531 real:: wrong, right
11533 integer:: answer_shape(6), check_shape(6), pos(6)
11534 logical:: consist_shape(6)
11535 character(TOKEN):: pos_array(6)
11536 integer,
allocatable:: mask_array(:,:,:,:,:,:)
11537 logical,
allocatable:: judge(:,:,:,:,:,:)
11538 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
11539 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
11540 logical,
allocatable:: check_negative(:,:,:,:,:,:)
11541 logical,
allocatable:: both_negative(:,:,:,:,:,:)
11545 if (
present(negative_support))
then
11546 negative_support_on = negative_support
11548 negative_support_on = .true.
11554 answer_shape = shape(answer)
11555 check_shape = shape(check)
11557 consist_shape = answer_shape == check_shape
11559 if (.not. all(consist_shape))
then
11560 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11562 write(*,*)
' shape of check is (', check_shape,
')'
11563 write(*,*)
' is INCORRECT'
11564 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
11570 allocate( mask_array( &
11571 & answer_shape(1), &
11573 & answer_shape(2), &
11575 & answer_shape(3), &
11577 & answer_shape(4), &
11579 & answer_shape(5), &
11581 & answer_shape(6) ) &
11585 & answer_shape(1), &
11587 & answer_shape(2), &
11589 & answer_shape(3), &
11591 & answer_shape(4), &
11593 & answer_shape(5), &
11595 & answer_shape(6) ) &
11598 allocate( judge_rev( &
11599 & answer_shape(1), &
11601 & answer_shape(2), &
11603 & answer_shape(3), &
11605 & answer_shape(4), &
11607 & answer_shape(5), &
11609 & answer_shape(6) ) &
11612 allocate( answer_negative( &
11613 & answer_shape(1), &
11615 & answer_shape(2), &
11617 & answer_shape(3), &
11619 & answer_shape(4), &
11621 & answer_shape(5), &
11623 & answer_shape(6) ) &
11626 allocate( check_negative( &
11627 & answer_shape(1), &
11629 & answer_shape(2), &
11631 & answer_shape(3), &
11633 & answer_shape(4), &
11635 & answer_shape(5), &
11637 & answer_shape(6) ) &
11640 allocate( both_negative( &
11641 & answer_shape(1), &
11643 & answer_shape(2), &
11645 & answer_shape(3), &
11647 & answer_shape(4), &
11649 & answer_shape(5), &
11651 & answer_shape(6) ) &
11654 answer_negative = answer < 0.0
11655 check_negative = check < 0.0
11656 both_negative = answer_negative .and. check_negative
11657 if (.not. negative_support_on) both_negative = .false.
11659 judge = answer < check
11660 where (both_negative) judge = .not. judge
11662 judge_rev = .not. judge
11663 err_flag = any(judge_rev)
11665 pos = maxloc(mask_array, judge_rev)
11695 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
11697 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
11699 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
11701 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
11703 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
11705 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
11709 & trim(adjustl(pos_array(1))) //
',' // &
11711 & trim(adjustl(pos_array(2))) //
',' // &
11713 & trim(adjustl(pos_array(3))) //
',' // &
11715 & trim(adjustl(pos_array(4))) //
',' // &
11717 & trim(adjustl(pos_array(5))) //
',' // &
11719 & trim(adjustl(pos_array(6))) //
')'
11721 if ( both_negative( &
11734 abs_mes =
'ABSOLUTE value of'
11741 deallocate(mask_array, judge, judge_rev)
11742 deallocate(answer_negative, check_negative, both_negative)
11748 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11750 write(*,*)
' ' // trim(abs_mes) // &
11751 &
' check' // trim(pos_str) //
' = ', wrong
11752 write(*,*)
' is NOT GREATER THAN'
11753 write(*,*)
' ' // trim(abs_mes) // &
11754 &
' answer' // trim(pos_str) //
' = ', right
11758 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
11762 end subroutine dctestassertgreaterthanreal6
11765 subroutine dctestassertgreaterthanreal7( &
11766 & message, answer, check, negative_support)
11770 character(*),
intent(in):: message
11771 real,
intent(in):: answer(:,:,:,:,:,:,:)
11772 real,
intent(in):: check(:,:,:,:,:,:,:)
11773 logical,
intent(in),
optional:: negative_support
11775 logical:: negative_support_on
11776 character(STRING):: pos_str
11777 character(TOKEN):: abs_mes
11778 real:: wrong, right
11780 integer:: answer_shape(7), check_shape(7), pos(7)
11781 logical:: consist_shape(7)
11782 character(TOKEN):: pos_array(7)
11783 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
11784 logical,
allocatable:: judge(:,:,:,:,:,:,:)
11785 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
11786 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
11787 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
11788 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
11792 if (
present(negative_support))
then
11793 negative_support_on = negative_support
11795 negative_support_on = .true.
11801 answer_shape = shape(answer)
11802 check_shape = shape(check)
11804 consist_shape = answer_shape == check_shape
11806 if (.not. all(consist_shape))
then
11807 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
11809 write(*,*)
' shape of check is (', check_shape,
')'
11810 write(*,*)
' is INCORRECT'
11811 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
11817 allocate( mask_array( &
11818 & answer_shape(1), &
11820 & answer_shape(2), &
11822 & answer_shape(3), &
11824 & answer_shape(4), &
11826 & answer_shape(5), &
11828 & answer_shape(6), &
11830 & answer_shape(7) ) &
11834 & answer_shape(1), &
11836 & answer_shape(2), &
11838 & answer_shape(3), &
11840 & answer_shape(4), &
11842 & answer_shape(5), &
11844 & answer_shape(6), &
11846 & answer_shape(7) ) &
11849 allocate( judge_rev( &
11850 & answer_shape(1), &
11852 & answer_shape(2), &
11854 & answer_shape(3), &
11856 & answer_shape(4), &
11858 & answer_shape(5), &
11860 & answer_shape(6), &
11862 & answer_shape(7) ) &
11865 allocate( answer_negative( &
11866 & answer_shape(1), &
11868 & answer_shape(2), &
11870 & answer_shape(3), &
11872 & answer_shape(4), &
11874 & answer_shape(5), &
11876 & answer_shape(6), &
11878 & answer_shape(7) ) &
11881 allocate( check_negative( &
11882 & answer_shape(1), &
11884 & answer_shape(2), &
11886 & answer_shape(3), &
11888 & answer_shape(4), &
11890 & answer_shape(5), &
11892 & answer_shape(6), &
11894 & answer_shape(7) ) &
11897 allocate( both_negative( &
11898 & answer_shape(1), &
11900 & answer_shape(2), &
11902 & answer_shape(3), &
11904 & answer_shape(4), &
11906 & answer_shape(5), &
11908 & answer_shape(6), &
11910 & answer_shape(7) ) &
11913 answer_negative = answer < 0.0
11914 check_negative = check < 0.0
11915 both_negative = answer_negative .and. check_negative
11916 if (.not. negative_support_on) both_negative = .false.
11918 judge = answer < check
11919 where (both_negative) judge = .not. judge
11921 judge_rev = .not. judge
11922 err_flag = any(judge_rev)
11924 pos = maxloc(mask_array, judge_rev)
11958 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
11960 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
11962 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
11964 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
11966 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
11968 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
11970 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
11974 & trim(adjustl(pos_array(1))) //
',' // &
11976 & trim(adjustl(pos_array(2))) //
',' // &
11978 & trim(adjustl(pos_array(3))) //
',' // &
11980 & trim(adjustl(pos_array(4))) //
',' // &
11982 & trim(adjustl(pos_array(5))) //
',' // &
11984 & trim(adjustl(pos_array(6))) //
',' // &
11986 & trim(adjustl(pos_array(7))) //
')'
11988 if ( both_negative( &
12003 abs_mes =
'ABSOLUTE value of'
12010 deallocate(mask_array, judge, judge_rev)
12011 deallocate(answer_negative, check_negative, both_negative)
12017 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12019 write(*,*)
' ' // trim(abs_mes) // &
12020 &
' check' // trim(pos_str) //
' = ', wrong
12021 write(*,*)
' is NOT GREATER THAN'
12022 write(*,*)
' ' // trim(abs_mes) // &
12023 &
' answer' // trim(pos_str) //
' = ', right
12027 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
12031 end subroutine dctestassertgreaterthanreal7
12034 subroutine dctestassertgreaterthandouble0( &
12035 & message, answer, check, negative_support)
12039 character(*),
intent(in):: message
12040 real(DP),
intent(in):: answer
12041 real(DP),
intent(in):: check
12042 logical,
intent(in),
optional:: negative_support
12044 logical:: negative_support_on
12045 character(STRING):: pos_str
12046 character(TOKEN):: abs_mes
12047 real(DP):: wrong, right
12052 if (
present(negative_support))
then
12053 negative_support_on = negative_support
12055 negative_support_on = .true.
12061 err_flag = .not. answer < check
12064 if ( answer < 0.0_dp &
12065 & .and. check < 0.0_dp &
12066 & .and. negative_support_on )
then
12068 err_flag = .not. err_flag
12069 abs_mes =
'ABSOLUTE value of'
12080 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12082 write(*,*)
' ' // trim(abs_mes) // &
12083 &
' check' // trim(pos_str) //
' = ', wrong
12084 write(*,*)
' is NOT GREATER THAN'
12085 write(*,*)
' ' // trim(abs_mes) // &
12086 &
' answer' // trim(pos_str) //
' = ', right
12090 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
12094 end subroutine dctestassertgreaterthandouble0
12097 subroutine dctestassertgreaterthandouble1( &
12098 & message, answer, check, negative_support)
12102 character(*),
intent(in):: message
12103 real(DP),
intent(in):: answer(:)
12104 real(DP),
intent(in):: check(:)
12105 logical,
intent(in),
optional:: negative_support
12107 logical:: negative_support_on
12108 character(STRING):: pos_str
12109 character(TOKEN):: abs_mes
12110 real(DP):: wrong, right
12112 integer:: answer_shape(1), check_shape(1), pos(1)
12113 logical:: consist_shape(1)
12114 character(TOKEN):: pos_array(1)
12115 integer,
allocatable:: mask_array(:)
12116 logical,
allocatable:: judge(:)
12117 logical,
allocatable:: judge_rev(:)
12118 logical,
allocatable:: answer_negative(:)
12119 logical,
allocatable:: check_negative(:)
12120 logical,
allocatable:: both_negative(:)
12124 if (
present(negative_support))
then
12125 negative_support_on = negative_support
12127 negative_support_on = .true.
12133 answer_shape = shape(answer)
12134 check_shape = shape(check)
12136 consist_shape = answer_shape == check_shape
12138 if (.not. all(consist_shape))
then
12139 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12141 write(*,*)
' shape of check is (', check_shape,
')'
12142 write(*,*)
' is INCORRECT'
12143 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
12149 allocate( mask_array( &
12151 & answer_shape(1) ) &
12156 & answer_shape(1) ) &
12159 allocate( judge_rev( &
12161 & answer_shape(1) ) &
12164 allocate( answer_negative( &
12166 & answer_shape(1) ) &
12169 allocate( check_negative( &
12171 & answer_shape(1) ) &
12174 allocate( both_negative( &
12176 & answer_shape(1) ) &
12179 answer_negative = answer < 0.0_dp
12180 check_negative = check < 0.0_dp
12181 both_negative = answer_negative .and. check_negative
12182 if (.not. negative_support_on) both_negative = .false.
12184 judge = answer < check
12185 where (both_negative) judge = .not. judge
12187 judge_rev = .not. judge
12188 err_flag = any(judge_rev)
12190 pos = maxloc(mask_array, judge_rev)
12202 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
12207 & trim(adjustl(pos_array(1))) //
')'
12209 if ( both_negative( &
12213 abs_mes =
'ABSOLUTE value of'
12220 deallocate(mask_array, judge, judge_rev)
12221 deallocate(answer_negative, check_negative, both_negative)
12227 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12229 write(*,*)
' ' // trim(abs_mes) // &
12230 &
' check' // trim(pos_str) //
' = ', wrong
12231 write(*,*)
' is NOT GREATER THAN'
12232 write(*,*)
' ' // trim(abs_mes) // &
12233 &
' answer' // trim(pos_str) //
' = ', right
12237 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
12241 end subroutine dctestassertgreaterthandouble1
12244 subroutine dctestassertgreaterthandouble2( &
12245 & message, answer, check, negative_support)
12249 character(*),
intent(in):: message
12250 real(DP),
intent(in):: answer(:,:)
12251 real(DP),
intent(in):: check(:,:)
12252 logical,
intent(in),
optional:: negative_support
12254 logical:: negative_support_on
12255 character(STRING):: pos_str
12256 character(TOKEN):: abs_mes
12257 real(DP):: wrong, right
12259 integer:: answer_shape(2), check_shape(2), pos(2)
12260 logical:: consist_shape(2)
12261 character(TOKEN):: pos_array(2)
12262 integer,
allocatable:: mask_array(:,:)
12263 logical,
allocatable:: judge(:,:)
12264 logical,
allocatable:: judge_rev(:,:)
12265 logical,
allocatable:: answer_negative(:,:)
12266 logical,
allocatable:: check_negative(:,:)
12267 logical,
allocatable:: both_negative(:,:)
12271 if (
present(negative_support))
then
12272 negative_support_on = negative_support
12274 negative_support_on = .true.
12280 answer_shape = shape(answer)
12281 check_shape = shape(check)
12283 consist_shape = answer_shape == check_shape
12285 if (.not. all(consist_shape))
then
12286 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12288 write(*,*)
' shape of check is (', check_shape,
')'
12289 write(*,*)
' is INCORRECT'
12290 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
12296 allocate( mask_array( &
12297 & answer_shape(1), &
12299 & answer_shape(2) ) &
12303 & answer_shape(1), &
12305 & answer_shape(2) ) &
12308 allocate( judge_rev( &
12309 & answer_shape(1), &
12311 & answer_shape(2) ) &
12314 allocate( answer_negative( &
12315 & answer_shape(1), &
12317 & answer_shape(2) ) &
12320 allocate( check_negative( &
12321 & answer_shape(1), &
12323 & answer_shape(2) ) &
12326 allocate( both_negative( &
12327 & answer_shape(1), &
12329 & answer_shape(2) ) &
12332 answer_negative = answer < 0.0_dp
12333 check_negative = check < 0.0_dp
12334 both_negative = answer_negative .and. check_negative
12335 if (.not. negative_support_on) both_negative = .false.
12337 judge = answer < check
12338 where (both_negative) judge = .not. judge
12340 judge_rev = .not. judge
12341 err_flag = any(judge_rev)
12343 pos = maxloc(mask_array, judge_rev)
12357 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
12359 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
12363 & trim(adjustl(pos_array(1))) //
',' // &
12365 & trim(adjustl(pos_array(2))) //
')'
12367 if ( both_negative( &
12372 abs_mes =
'ABSOLUTE value of'
12379 deallocate(mask_array, judge, judge_rev)
12380 deallocate(answer_negative, check_negative, both_negative)
12386 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12388 write(*,*)
' ' // trim(abs_mes) // &
12389 &
' check' // trim(pos_str) //
' = ', wrong
12390 write(*,*)
' is NOT GREATER THAN'
12391 write(*,*)
' ' // trim(abs_mes) // &
12392 &
' answer' // trim(pos_str) //
' = ', right
12396 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
12400 end subroutine dctestassertgreaterthandouble2
12403 subroutine dctestassertgreaterthandouble3( &
12404 & message, answer, check, negative_support)
12408 character(*),
intent(in):: message
12409 real(DP),
intent(in):: answer(:,:,:)
12410 real(DP),
intent(in):: check(:,:,:)
12411 logical,
intent(in),
optional:: negative_support
12413 logical:: negative_support_on
12414 character(STRING):: pos_str
12415 character(TOKEN):: abs_mes
12416 real(DP):: wrong, right
12418 integer:: answer_shape(3), check_shape(3), pos(3)
12419 logical:: consist_shape(3)
12420 character(TOKEN):: pos_array(3)
12421 integer,
allocatable:: mask_array(:,:,:)
12422 logical,
allocatable:: judge(:,:,:)
12423 logical,
allocatable:: judge_rev(:,:,:)
12424 logical,
allocatable:: answer_negative(:,:,:)
12425 logical,
allocatable:: check_negative(:,:,:)
12426 logical,
allocatable:: both_negative(:,:,:)
12430 if (
present(negative_support))
then
12431 negative_support_on = negative_support
12433 negative_support_on = .true.
12439 answer_shape = shape(answer)
12440 check_shape = shape(check)
12442 consist_shape = answer_shape == check_shape
12444 if (.not. all(consist_shape))
then
12445 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12447 write(*,*)
' shape of check is (', check_shape,
')'
12448 write(*,*)
' is INCORRECT'
12449 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
12455 allocate( mask_array( &
12456 & answer_shape(1), &
12458 & answer_shape(2), &
12460 & answer_shape(3) ) &
12464 & answer_shape(1), &
12466 & answer_shape(2), &
12468 & answer_shape(3) ) &
12471 allocate( judge_rev( &
12472 & answer_shape(1), &
12474 & answer_shape(2), &
12476 & answer_shape(3) ) &
12479 allocate( answer_negative( &
12480 & answer_shape(1), &
12482 & answer_shape(2), &
12484 & answer_shape(3) ) &
12487 allocate( check_negative( &
12488 & answer_shape(1), &
12490 & answer_shape(2), &
12492 & answer_shape(3) ) &
12495 allocate( both_negative( &
12496 & answer_shape(1), &
12498 & answer_shape(2), &
12500 & answer_shape(3) ) &
12503 answer_negative = answer < 0.0_dp
12504 check_negative = check < 0.0_dp
12505 both_negative = answer_negative .and. check_negative
12506 if (.not. negative_support_on) both_negative = .false.
12508 judge = answer < check
12509 where (both_negative) judge = .not. judge
12511 judge_rev = .not. judge
12512 err_flag = any(judge_rev)
12514 pos = maxloc(mask_array, judge_rev)
12532 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
12534 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
12536 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
12540 & trim(adjustl(pos_array(1))) //
',' // &
12542 & trim(adjustl(pos_array(2))) //
',' // &
12544 & trim(adjustl(pos_array(3))) //
')'
12546 if ( both_negative( &
12553 abs_mes =
'ABSOLUTE value of'
12560 deallocate(mask_array, judge, judge_rev)
12561 deallocate(answer_negative, check_negative, both_negative)
12567 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12569 write(*,*)
' ' // trim(abs_mes) // &
12570 &
' check' // trim(pos_str) //
' = ', wrong
12571 write(*,*)
' is NOT GREATER THAN'
12572 write(*,*)
' ' // trim(abs_mes) // &
12573 &
' answer' // trim(pos_str) //
' = ', right
12577 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
12581 end subroutine dctestassertgreaterthandouble3
12584 subroutine dctestassertgreaterthandouble4( &
12585 & message, answer, check, negative_support)
12589 character(*),
intent(in):: message
12590 real(DP),
intent(in):: answer(:,:,:,:)
12591 real(DP),
intent(in):: check(:,:,:,:)
12592 logical,
intent(in),
optional:: negative_support
12594 logical:: negative_support_on
12595 character(STRING):: pos_str
12596 character(TOKEN):: abs_mes
12597 real(DP):: wrong, right
12599 integer:: answer_shape(4), check_shape(4), pos(4)
12600 logical:: consist_shape(4)
12601 character(TOKEN):: pos_array(4)
12602 integer,
allocatable:: mask_array(:,:,:,:)
12603 logical,
allocatable:: judge(:,:,:,:)
12604 logical,
allocatable:: judge_rev(:,:,:,:)
12605 logical,
allocatable:: answer_negative(:,:,:,:)
12606 logical,
allocatable:: check_negative(:,:,:,:)
12607 logical,
allocatable:: both_negative(:,:,:,:)
12611 if (
present(negative_support))
then
12612 negative_support_on = negative_support
12614 negative_support_on = .true.
12620 answer_shape = shape(answer)
12621 check_shape = shape(check)
12623 consist_shape = answer_shape == check_shape
12625 if (.not. all(consist_shape))
then
12626 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12628 write(*,*)
' shape of check is (', check_shape,
')'
12629 write(*,*)
' is INCORRECT'
12630 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
12636 allocate( mask_array( &
12637 & answer_shape(1), &
12639 & answer_shape(2), &
12641 & answer_shape(3), &
12643 & answer_shape(4) ) &
12647 & answer_shape(1), &
12649 & answer_shape(2), &
12651 & answer_shape(3), &
12653 & answer_shape(4) ) &
12656 allocate( judge_rev( &
12657 & answer_shape(1), &
12659 & answer_shape(2), &
12661 & answer_shape(3), &
12663 & answer_shape(4) ) &
12666 allocate( answer_negative( &
12667 & answer_shape(1), &
12669 & answer_shape(2), &
12671 & answer_shape(3), &
12673 & answer_shape(4) ) &
12676 allocate( check_negative( &
12677 & answer_shape(1), &
12679 & answer_shape(2), &
12681 & answer_shape(3), &
12683 & answer_shape(4) ) &
12686 allocate( both_negative( &
12687 & answer_shape(1), &
12689 & answer_shape(2), &
12691 & answer_shape(3), &
12693 & answer_shape(4) ) &
12696 answer_negative = answer < 0.0_dp
12697 check_negative = check < 0.0_dp
12698 both_negative = answer_negative .and. check_negative
12699 if (.not. negative_support_on) both_negative = .false.
12701 judge = answer < check
12702 where (both_negative) judge = .not. judge
12704 judge_rev = .not. judge
12705 err_flag = any(judge_rev)
12707 pos = maxloc(mask_array, judge_rev)
12729 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
12731 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
12733 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
12735 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
12739 & trim(adjustl(pos_array(1))) //
',' // &
12741 & trim(adjustl(pos_array(2))) //
',' // &
12743 & trim(adjustl(pos_array(3))) //
',' // &
12745 & trim(adjustl(pos_array(4))) //
')'
12747 if ( both_negative( &
12756 abs_mes =
'ABSOLUTE value of'
12763 deallocate(mask_array, judge, judge_rev)
12764 deallocate(answer_negative, check_negative, both_negative)
12770 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12772 write(*,*)
' ' // trim(abs_mes) // &
12773 &
' check' // trim(pos_str) //
' = ', wrong
12774 write(*,*)
' is NOT GREATER THAN'
12775 write(*,*)
' ' // trim(abs_mes) // &
12776 &
' answer' // trim(pos_str) //
' = ', right
12780 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
12784 end subroutine dctestassertgreaterthandouble4
12787 subroutine dctestassertgreaterthandouble5( &
12788 & message, answer, check, negative_support)
12792 character(*),
intent(in):: message
12793 real(DP),
intent(in):: answer(:,:,:,:,:)
12794 real(DP),
intent(in):: check(:,:,:,:,:)
12795 logical,
intent(in),
optional:: negative_support
12797 logical:: negative_support_on
12798 character(STRING):: pos_str
12799 character(TOKEN):: abs_mes
12800 real(DP):: wrong, right
12802 integer:: answer_shape(5), check_shape(5), pos(5)
12803 logical:: consist_shape(5)
12804 character(TOKEN):: pos_array(5)
12805 integer,
allocatable:: mask_array(:,:,:,:,:)
12806 logical,
allocatable:: judge(:,:,:,:,:)
12807 logical,
allocatable:: judge_rev(:,:,:,:,:)
12808 logical,
allocatable:: answer_negative(:,:,:,:,:)
12809 logical,
allocatable:: check_negative(:,:,:,:,:)
12810 logical,
allocatable:: both_negative(:,:,:,:,:)
12814 if (
present(negative_support))
then
12815 negative_support_on = negative_support
12817 negative_support_on = .true.
12823 answer_shape = shape(answer)
12824 check_shape = shape(check)
12826 consist_shape = answer_shape == check_shape
12828 if (.not. all(consist_shape))
then
12829 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12831 write(*,*)
' shape of check is (', check_shape,
')'
12832 write(*,*)
' is INCORRECT'
12833 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
12839 allocate( mask_array( &
12840 & answer_shape(1), &
12842 & answer_shape(2), &
12844 & answer_shape(3), &
12846 & answer_shape(4), &
12848 & answer_shape(5) ) &
12852 & answer_shape(1), &
12854 & answer_shape(2), &
12856 & answer_shape(3), &
12858 & answer_shape(4), &
12860 & answer_shape(5) ) &
12863 allocate( judge_rev( &
12864 & answer_shape(1), &
12866 & answer_shape(2), &
12868 & answer_shape(3), &
12870 & answer_shape(4), &
12872 & answer_shape(5) ) &
12875 allocate( answer_negative( &
12876 & answer_shape(1), &
12878 & answer_shape(2), &
12880 & answer_shape(3), &
12882 & answer_shape(4), &
12884 & answer_shape(5) ) &
12887 allocate( check_negative( &
12888 & answer_shape(1), &
12890 & answer_shape(2), &
12892 & answer_shape(3), &
12894 & answer_shape(4), &
12896 & answer_shape(5) ) &
12899 allocate( both_negative( &
12900 & answer_shape(1), &
12902 & answer_shape(2), &
12904 & answer_shape(3), &
12906 & answer_shape(4), &
12908 & answer_shape(5) ) &
12911 answer_negative = answer < 0.0_dp
12912 check_negative = check < 0.0_dp
12913 both_negative = answer_negative .and. check_negative
12914 if (.not. negative_support_on) both_negative = .false.
12916 judge = answer < check
12917 where (both_negative) judge = .not. judge
12919 judge_rev = .not. judge
12920 err_flag = any(judge_rev)
12922 pos = maxloc(mask_array, judge_rev)
12948 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
12950 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
12952 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
12954 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
12956 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
12960 & trim(adjustl(pos_array(1))) //
',' // &
12962 & trim(adjustl(pos_array(2))) //
',' // &
12964 & trim(adjustl(pos_array(3))) //
',' // &
12966 & trim(adjustl(pos_array(4))) //
',' // &
12968 & trim(adjustl(pos_array(5))) //
')'
12970 if ( both_negative( &
12981 abs_mes =
'ABSOLUTE value of'
12988 deallocate(mask_array, judge, judge_rev)
12989 deallocate(answer_negative, check_negative, both_negative)
12995 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
12997 write(*,*)
' ' // trim(abs_mes) // &
12998 &
' check' // trim(pos_str) //
' = ', wrong
12999 write(*,*)
' is NOT GREATER THAN'
13000 write(*,*)
' ' // trim(abs_mes) // &
13001 &
' answer' // trim(pos_str) //
' = ', right
13005 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
13009 end subroutine dctestassertgreaterthandouble5
13012 subroutine dctestassertgreaterthandouble6( &
13013 & message, answer, check, negative_support)
13017 character(*),
intent(in):: message
13018 real(DP),
intent(in):: answer(:,:,:,:,:,:)
13019 real(DP),
intent(in):: check(:,:,:,:,:,:)
13020 logical,
intent(in),
optional:: negative_support
13022 logical:: negative_support_on
13023 character(STRING):: pos_str
13024 character(TOKEN):: abs_mes
13025 real(DP):: wrong, right
13027 integer:: answer_shape(6), check_shape(6), pos(6)
13028 logical:: consist_shape(6)
13029 character(TOKEN):: pos_array(6)
13030 integer,
allocatable:: mask_array(:,:,:,:,:,:)
13031 logical,
allocatable:: judge(:,:,:,:,:,:)
13032 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
13033 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
13034 logical,
allocatable:: check_negative(:,:,:,:,:,:)
13035 logical,
allocatable:: both_negative(:,:,:,:,:,:)
13039 if (
present(negative_support))
then
13040 negative_support_on = negative_support
13042 negative_support_on = .true.
13048 answer_shape = shape(answer)
13049 check_shape = shape(check)
13051 consist_shape = answer_shape == check_shape
13053 if (.not. all(consist_shape))
then
13054 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
13056 write(*,*)
' shape of check is (', check_shape,
')'
13057 write(*,*)
' is INCORRECT'
13058 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
13064 allocate( mask_array( &
13065 & answer_shape(1), &
13067 & answer_shape(2), &
13069 & answer_shape(3), &
13071 & answer_shape(4), &
13073 & answer_shape(5), &
13075 & answer_shape(6) ) &
13079 & answer_shape(1), &
13081 & answer_shape(2), &
13083 & answer_shape(3), &
13085 & answer_shape(4), &
13087 & answer_shape(5), &
13089 & answer_shape(6) ) &
13092 allocate( judge_rev( &
13093 & answer_shape(1), &
13095 & answer_shape(2), &
13097 & answer_shape(3), &
13099 & answer_shape(4), &
13101 & answer_shape(5), &
13103 & answer_shape(6) ) &
13106 allocate( answer_negative( &
13107 & answer_shape(1), &
13109 & answer_shape(2), &
13111 & answer_shape(3), &
13113 & answer_shape(4), &
13115 & answer_shape(5), &
13117 & answer_shape(6) ) &
13120 allocate( check_negative( &
13121 & answer_shape(1), &
13123 & answer_shape(2), &
13125 & answer_shape(3), &
13127 & answer_shape(4), &
13129 & answer_shape(5), &
13131 & answer_shape(6) ) &
13134 allocate( both_negative( &
13135 & answer_shape(1), &
13137 & answer_shape(2), &
13139 & answer_shape(3), &
13141 & answer_shape(4), &
13143 & answer_shape(5), &
13145 & answer_shape(6) ) &
13148 answer_negative = answer < 0.0_dp
13149 check_negative = check < 0.0_dp
13150 both_negative = answer_negative .and. check_negative
13151 if (.not. negative_support_on) both_negative = .false.
13153 judge = answer < check
13154 where (both_negative) judge = .not. judge
13156 judge_rev = .not. judge
13157 err_flag = any(judge_rev)
13159 pos = maxloc(mask_array, judge_rev)
13189 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
13191 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
13193 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
13195 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
13197 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
13199 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
13203 & trim(adjustl(pos_array(1))) //
',' // &
13205 & trim(adjustl(pos_array(2))) //
',' // &
13207 & trim(adjustl(pos_array(3))) //
',' // &
13209 & trim(adjustl(pos_array(4))) //
',' // &
13211 & trim(adjustl(pos_array(5))) //
',' // &
13213 & trim(adjustl(pos_array(6))) //
')'
13215 if ( both_negative( &
13228 abs_mes =
'ABSOLUTE value of'
13235 deallocate(mask_array, judge, judge_rev)
13236 deallocate(answer_negative, check_negative, both_negative)
13242 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
13244 write(*,*)
' ' // trim(abs_mes) // &
13245 &
' check' // trim(pos_str) //
' = ', wrong
13246 write(*,*)
' is NOT GREATER THAN'
13247 write(*,*)
' ' // trim(abs_mes) // &
13248 &
' answer' // trim(pos_str) //
' = ', right
13252 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
13256 end subroutine dctestassertgreaterthandouble6
13259 subroutine dctestassertgreaterthandouble7( &
13260 & message, answer, check, negative_support)
13264 character(*),
intent(in):: message
13265 real(DP),
intent(in):: answer(:,:,:,:,:,:,:)
13266 real(DP),
intent(in):: check(:,:,:,:,:,:,:)
13267 logical,
intent(in),
optional:: negative_support
13269 logical:: negative_support_on
13270 character(STRING):: pos_str
13271 character(TOKEN):: abs_mes
13272 real(DP):: wrong, right
13274 integer:: answer_shape(7), check_shape(7), pos(7)
13275 logical:: consist_shape(7)
13276 character(TOKEN):: pos_array(7)
13277 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
13278 logical,
allocatable:: judge(:,:,:,:,:,:,:)
13279 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
13280 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
13281 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
13282 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
13286 if (
present(negative_support))
then
13287 negative_support_on = negative_support
13289 negative_support_on = .true.
13295 answer_shape = shape(answer)
13296 check_shape = shape(check)
13298 consist_shape = answer_shape == check_shape
13300 if (.not. all(consist_shape))
then
13301 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
13303 write(*,*)
' shape of check is (', check_shape,
')'
13304 write(*,*)
' is INCORRECT'
13305 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
13311 allocate( mask_array( &
13312 & answer_shape(1), &
13314 & answer_shape(2), &
13316 & answer_shape(3), &
13318 & answer_shape(4), &
13320 & answer_shape(5), &
13322 & answer_shape(6), &
13324 & answer_shape(7) ) &
13328 & answer_shape(1), &
13330 & answer_shape(2), &
13332 & answer_shape(3), &
13334 & answer_shape(4), &
13336 & answer_shape(5), &
13338 & answer_shape(6), &
13340 & answer_shape(7) ) &
13343 allocate( judge_rev( &
13344 & answer_shape(1), &
13346 & answer_shape(2), &
13348 & answer_shape(3), &
13350 & answer_shape(4), &
13352 & answer_shape(5), &
13354 & answer_shape(6), &
13356 & answer_shape(7) ) &
13359 allocate( answer_negative( &
13360 & answer_shape(1), &
13362 & answer_shape(2), &
13364 & answer_shape(3), &
13366 & answer_shape(4), &
13368 & answer_shape(5), &
13370 & answer_shape(6), &
13372 & answer_shape(7) ) &
13375 allocate( check_negative( &
13376 & answer_shape(1), &
13378 & answer_shape(2), &
13380 & answer_shape(3), &
13382 & answer_shape(4), &
13384 & answer_shape(5), &
13386 & answer_shape(6), &
13388 & answer_shape(7) ) &
13391 allocate( both_negative( &
13392 & answer_shape(1), &
13394 & answer_shape(2), &
13396 & answer_shape(3), &
13398 & answer_shape(4), &
13400 & answer_shape(5), &
13402 & answer_shape(6), &
13404 & answer_shape(7) ) &
13407 answer_negative = answer < 0.0_dp
13408 check_negative = check < 0.0_dp
13409 both_negative = answer_negative .and. check_negative
13410 if (.not. negative_support_on) both_negative = .false.
13412 judge = answer < check
13413 where (both_negative) judge = .not. judge
13415 judge_rev = .not. judge
13416 err_flag = any(judge_rev)
13418 pos = maxloc(mask_array, judge_rev)
13452 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
13454 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
13456 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
13458 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
13460 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
13462 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
13464 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
13468 & trim(adjustl(pos_array(1))) //
',' // &
13470 & trim(adjustl(pos_array(2))) //
',' // &
13472 & trim(adjustl(pos_array(3))) //
',' // &
13474 & trim(adjustl(pos_array(4))) //
',' // &
13476 & trim(adjustl(pos_array(5))) //
',' // &
13478 & trim(adjustl(pos_array(6))) //
',' // &
13480 & trim(adjustl(pos_array(7))) //
')'
13482 if ( both_negative( &
13497 abs_mes =
'ABSOLUTE value of'
13504 deallocate(mask_array, judge, judge_rev)
13505 deallocate(answer_negative, check_negative, both_negative)
13511 write(*,*)
' *** Error [AssertGT] *** Checking ' // trim(message) //
' FAILURE'
13513 write(*,*)
' ' // trim(abs_mes) // &
13514 &
' check' // trim(pos_str) //
' = ', wrong
13515 write(*,*)
' is NOT GREATER THAN'
13516 write(*,*)
' ' // trim(abs_mes) // &
13517 &
' answer' // trim(pos_str) //
' = ', right
13521 write(*,*)
' *** MESSAGE [AssertGT] *** Checking ' // trim(message) //
' OK'
13525 end subroutine dctestassertgreaterthandouble7
13528 subroutine dctestassertlessthanint0( &
13529 & message, answer, check, negative_support)
13533 character(*),
intent(in):: message
13534 integer,
intent(in):: answer
13535 integer,
intent(in):: check
13536 logical,
intent(in),
optional:: negative_support
13538 logical:: negative_support_on
13539 character(STRING):: pos_str
13540 character(TOKEN):: abs_mes
13541 integer:: wrong, right
13546 if (
present(negative_support))
then
13547 negative_support_on = negative_support
13549 negative_support_on = .true.
13557 err_flag = .not. answer > check
13561 & .and. check < 0 &
13562 & .and. negative_support_on )
then
13564 err_flag = .not. err_flag
13565 abs_mes =
'ABSOLUTE value of'
13576 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
13578 write(*,*)
' ' // trim(abs_mes) // &
13579 &
' check' // trim(pos_str) //
' = ', wrong
13580 write(*,*)
' is NOT LESS THAN'
13581 write(*,*)
' ' // trim(abs_mes) // &
13582 &
' answer' // trim(pos_str) //
' = ', right
13586 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
13590 end subroutine dctestassertlessthanint0
13593 subroutine dctestassertlessthanint1( &
13594 & message, answer, check, negative_support)
13598 character(*),
intent(in):: message
13599 integer,
intent(in):: answer(:)
13600 integer,
intent(in):: check(:)
13601 logical,
intent(in),
optional:: negative_support
13603 logical:: negative_support_on
13604 character(STRING):: pos_str
13605 character(TOKEN):: abs_mes
13606 integer:: wrong, right
13608 integer:: answer_shape(1), check_shape(1), pos(1)
13609 logical:: consist_shape(1)
13610 character(TOKEN):: pos_array(1)
13611 integer,
allocatable:: mask_array(:)
13612 logical,
allocatable:: judge(:)
13613 logical,
allocatable:: judge_rev(:)
13614 logical,
allocatable:: answer_negative(:)
13615 logical,
allocatable:: check_negative(:)
13616 logical,
allocatable:: both_negative(:)
13620 if (
present(negative_support))
then
13621 negative_support_on = negative_support
13623 negative_support_on = .true.
13629 answer_shape = shape(answer)
13630 check_shape = shape(check)
13632 consist_shape = answer_shape == check_shape
13634 if (.not. all(consist_shape))
then
13635 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
13637 write(*,*)
' shape of check is (', check_shape,
')'
13638 write(*,*)
' is INCORRECT'
13639 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
13645 allocate( mask_array( &
13647 & answer_shape(1) ) &
13652 & answer_shape(1) ) &
13655 allocate( judge_rev( &
13657 & answer_shape(1) ) &
13660 allocate( answer_negative( &
13662 & answer_shape(1) ) &
13665 allocate( check_negative( &
13667 & answer_shape(1) ) &
13670 allocate( both_negative( &
13672 & answer_shape(1) ) &
13675 answer_negative = answer < 0
13676 check_negative = check < 0
13677 both_negative = answer_negative .and. check_negative
13678 if (.not. negative_support_on) both_negative = .false.
13680 judge = answer > check
13681 where (both_negative) judge = .not. judge
13683 judge_rev = .not. judge
13684 err_flag = any(judge_rev)
13686 pos = maxloc(mask_array, judge_rev)
13698 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
13703 & trim(adjustl(pos_array(1))) //
')'
13705 if ( both_negative( &
13709 abs_mes =
'ABSOLUTE value of'
13716 deallocate(mask_array, judge, judge_rev)
13717 deallocate(answer_negative, check_negative, both_negative)
13723 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
13725 write(*,*)
' ' // trim(abs_mes) // &
13726 &
' check' // trim(pos_str) //
' = ', wrong
13727 write(*,*)
' is NOT LESS THAN'
13728 write(*,*)
' ' // trim(abs_mes) // &
13729 &
' answer' // trim(pos_str) //
' = ', right
13733 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
13737 end subroutine dctestassertlessthanint1
13740 subroutine dctestassertlessthanint2( &
13741 & message, answer, check, negative_support)
13745 character(*),
intent(in):: message
13746 integer,
intent(in):: answer(:,:)
13747 integer,
intent(in):: check(:,:)
13748 logical,
intent(in),
optional:: negative_support
13750 logical:: negative_support_on
13751 character(STRING):: pos_str
13752 character(TOKEN):: abs_mes
13753 integer:: wrong, right
13755 integer:: answer_shape(2), check_shape(2), pos(2)
13756 logical:: consist_shape(2)
13757 character(TOKEN):: pos_array(2)
13758 integer,
allocatable:: mask_array(:,:)
13759 logical,
allocatable:: judge(:,:)
13760 logical,
allocatable:: judge_rev(:,:)
13761 logical,
allocatable:: answer_negative(:,:)
13762 logical,
allocatable:: check_negative(:,:)
13763 logical,
allocatable:: both_negative(:,:)
13767 if (
present(negative_support))
then
13768 negative_support_on = negative_support
13770 negative_support_on = .true.
13776 answer_shape = shape(answer)
13777 check_shape = shape(check)
13779 consist_shape = answer_shape == check_shape
13781 if (.not. all(consist_shape))
then
13782 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
13784 write(*,*)
' shape of check is (', check_shape,
')'
13785 write(*,*)
' is INCORRECT'
13786 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
13792 allocate( mask_array( &
13793 & answer_shape(1), &
13795 & answer_shape(2) ) &
13799 & answer_shape(1), &
13801 & answer_shape(2) ) &
13804 allocate( judge_rev( &
13805 & answer_shape(1), &
13807 & answer_shape(2) ) &
13810 allocate( answer_negative( &
13811 & answer_shape(1), &
13813 & answer_shape(2) ) &
13816 allocate( check_negative( &
13817 & answer_shape(1), &
13819 & answer_shape(2) ) &
13822 allocate( both_negative( &
13823 & answer_shape(1), &
13825 & answer_shape(2) ) &
13828 answer_negative = answer < 0
13829 check_negative = check < 0
13830 both_negative = answer_negative .and. check_negative
13831 if (.not. negative_support_on) both_negative = .false.
13833 judge = answer > check
13834 where (both_negative) judge = .not. judge
13836 judge_rev = .not. judge
13837 err_flag = any(judge_rev)
13839 pos = maxloc(mask_array, judge_rev)
13853 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
13855 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
13859 & trim(adjustl(pos_array(1))) //
',' // &
13861 & trim(adjustl(pos_array(2))) //
')'
13863 if ( both_negative( &
13868 abs_mes =
'ABSOLUTE value of'
13875 deallocate(mask_array, judge, judge_rev)
13876 deallocate(answer_negative, check_negative, both_negative)
13882 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
13884 write(*,*)
' ' // trim(abs_mes) // &
13885 &
' check' // trim(pos_str) //
' = ', wrong
13886 write(*,*)
' is NOT LESS THAN'
13887 write(*,*)
' ' // trim(abs_mes) // &
13888 &
' answer' // trim(pos_str) //
' = ', right
13892 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
13896 end subroutine dctestassertlessthanint2
13899 subroutine dctestassertlessthanint3( &
13900 & message, answer, check, negative_support)
13904 character(*),
intent(in):: message
13905 integer,
intent(in):: answer(:,:,:)
13906 integer,
intent(in):: check(:,:,:)
13907 logical,
intent(in),
optional:: negative_support
13909 logical:: negative_support_on
13910 character(STRING):: pos_str
13911 character(TOKEN):: abs_mes
13912 integer:: wrong, right
13914 integer:: answer_shape(3), check_shape(3), pos(3)
13915 logical:: consist_shape(3)
13916 character(TOKEN):: pos_array(3)
13917 integer,
allocatable:: mask_array(:,:,:)
13918 logical,
allocatable:: judge(:,:,:)
13919 logical,
allocatable:: judge_rev(:,:,:)
13920 logical,
allocatable:: answer_negative(:,:,:)
13921 logical,
allocatable:: check_negative(:,:,:)
13922 logical,
allocatable:: both_negative(:,:,:)
13926 if (
present(negative_support))
then
13927 negative_support_on = negative_support
13929 negative_support_on = .true.
13935 answer_shape = shape(answer)
13936 check_shape = shape(check)
13938 consist_shape = answer_shape == check_shape
13940 if (.not. all(consist_shape))
then
13941 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
13943 write(*,*)
' shape of check is (', check_shape,
')'
13944 write(*,*)
' is INCORRECT'
13945 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
13951 allocate( mask_array( &
13952 & answer_shape(1), &
13954 & answer_shape(2), &
13956 & answer_shape(3) ) &
13960 & answer_shape(1), &
13962 & answer_shape(2), &
13964 & answer_shape(3) ) &
13967 allocate( judge_rev( &
13968 & answer_shape(1), &
13970 & answer_shape(2), &
13972 & answer_shape(3) ) &
13975 allocate( answer_negative( &
13976 & answer_shape(1), &
13978 & answer_shape(2), &
13980 & answer_shape(3) ) &
13983 allocate( check_negative( &
13984 & answer_shape(1), &
13986 & answer_shape(2), &
13988 & answer_shape(3) ) &
13991 allocate( both_negative( &
13992 & answer_shape(1), &
13994 & answer_shape(2), &
13996 & answer_shape(3) ) &
13999 answer_negative = answer < 0
14000 check_negative = check < 0
14001 both_negative = answer_negative .and. check_negative
14002 if (.not. negative_support_on) both_negative = .false.
14004 judge = answer > check
14005 where (both_negative) judge = .not. judge
14007 judge_rev = .not. judge
14008 err_flag = any(judge_rev)
14010 pos = maxloc(mask_array, judge_rev)
14028 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
14030 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
14032 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
14036 & trim(adjustl(pos_array(1))) //
',' // &
14038 & trim(adjustl(pos_array(2))) //
',' // &
14040 & trim(adjustl(pos_array(3))) //
')'
14042 if ( both_negative( &
14049 abs_mes =
'ABSOLUTE value of'
14056 deallocate(mask_array, judge, judge_rev)
14057 deallocate(answer_negative, check_negative, both_negative)
14063 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14065 write(*,*)
' ' // trim(abs_mes) // &
14066 &
' check' // trim(pos_str) //
' = ', wrong
14067 write(*,*)
' is NOT LESS THAN'
14068 write(*,*)
' ' // trim(abs_mes) // &
14069 &
' answer' // trim(pos_str) //
' = ', right
14073 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
14077 end subroutine dctestassertlessthanint3
14080 subroutine dctestassertlessthanint4( &
14081 & message, answer, check, negative_support)
14085 character(*),
intent(in):: message
14086 integer,
intent(in):: answer(:,:,:,:)
14087 integer,
intent(in):: check(:,:,:,:)
14088 logical,
intent(in),
optional:: negative_support
14090 logical:: negative_support_on
14091 character(STRING):: pos_str
14092 character(TOKEN):: abs_mes
14093 integer:: wrong, right
14095 integer:: answer_shape(4), check_shape(4), pos(4)
14096 logical:: consist_shape(4)
14097 character(TOKEN):: pos_array(4)
14098 integer,
allocatable:: mask_array(:,:,:,:)
14099 logical,
allocatable:: judge(:,:,:,:)
14100 logical,
allocatable:: judge_rev(:,:,:,:)
14101 logical,
allocatable:: answer_negative(:,:,:,:)
14102 logical,
allocatable:: check_negative(:,:,:,:)
14103 logical,
allocatable:: both_negative(:,:,:,:)
14107 if (
present(negative_support))
then
14108 negative_support_on = negative_support
14110 negative_support_on = .true.
14116 answer_shape = shape(answer)
14117 check_shape = shape(check)
14119 consist_shape = answer_shape == check_shape
14121 if (.not. all(consist_shape))
then
14122 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14124 write(*,*)
' shape of check is (', check_shape,
')'
14125 write(*,*)
' is INCORRECT'
14126 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
14132 allocate( mask_array( &
14133 & answer_shape(1), &
14135 & answer_shape(2), &
14137 & answer_shape(3), &
14139 & answer_shape(4) ) &
14143 & answer_shape(1), &
14145 & answer_shape(2), &
14147 & answer_shape(3), &
14149 & answer_shape(4) ) &
14152 allocate( judge_rev( &
14153 & answer_shape(1), &
14155 & answer_shape(2), &
14157 & answer_shape(3), &
14159 & answer_shape(4) ) &
14162 allocate( answer_negative( &
14163 & answer_shape(1), &
14165 & answer_shape(2), &
14167 & answer_shape(3), &
14169 & answer_shape(4) ) &
14172 allocate( check_negative( &
14173 & answer_shape(1), &
14175 & answer_shape(2), &
14177 & answer_shape(3), &
14179 & answer_shape(4) ) &
14182 allocate( both_negative( &
14183 & answer_shape(1), &
14185 & answer_shape(2), &
14187 & answer_shape(3), &
14189 & answer_shape(4) ) &
14192 answer_negative = answer < 0
14193 check_negative = check < 0
14194 both_negative = answer_negative .and. check_negative
14195 if (.not. negative_support_on) both_negative = .false.
14197 judge = answer > check
14198 where (both_negative) judge = .not. judge
14200 judge_rev = .not. judge
14201 err_flag = any(judge_rev)
14203 pos = maxloc(mask_array, judge_rev)
14225 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
14227 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
14229 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
14231 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
14235 & trim(adjustl(pos_array(1))) //
',' // &
14237 & trim(adjustl(pos_array(2))) //
',' // &
14239 & trim(adjustl(pos_array(3))) //
',' // &
14241 & trim(adjustl(pos_array(4))) //
')'
14243 if ( both_negative( &
14252 abs_mes =
'ABSOLUTE value of'
14259 deallocate(mask_array, judge, judge_rev)
14260 deallocate(answer_negative, check_negative, both_negative)
14266 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14268 write(*,*)
' ' // trim(abs_mes) // &
14269 &
' check' // trim(pos_str) //
' = ', wrong
14270 write(*,*)
' is NOT LESS THAN'
14271 write(*,*)
' ' // trim(abs_mes) // &
14272 &
' answer' // trim(pos_str) //
' = ', right
14276 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
14280 end subroutine dctestassertlessthanint4
14283 subroutine dctestassertlessthanint5( &
14284 & message, answer, check, negative_support)
14288 character(*),
intent(in):: message
14289 integer,
intent(in):: answer(:,:,:,:,:)
14290 integer,
intent(in):: check(:,:,:,:,:)
14291 logical,
intent(in),
optional:: negative_support
14293 logical:: negative_support_on
14294 character(STRING):: pos_str
14295 character(TOKEN):: abs_mes
14296 integer:: wrong, right
14298 integer:: answer_shape(5), check_shape(5), pos(5)
14299 logical:: consist_shape(5)
14300 character(TOKEN):: pos_array(5)
14301 integer,
allocatable:: mask_array(:,:,:,:,:)
14302 logical,
allocatable:: judge(:,:,:,:,:)
14303 logical,
allocatable:: judge_rev(:,:,:,:,:)
14304 logical,
allocatable:: answer_negative(:,:,:,:,:)
14305 logical,
allocatable:: check_negative(:,:,:,:,:)
14306 logical,
allocatable:: both_negative(:,:,:,:,:)
14310 if (
present(negative_support))
then
14311 negative_support_on = negative_support
14313 negative_support_on = .true.
14319 answer_shape = shape(answer)
14320 check_shape = shape(check)
14322 consist_shape = answer_shape == check_shape
14324 if (.not. all(consist_shape))
then
14325 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14327 write(*,*)
' shape of check is (', check_shape,
')'
14328 write(*,*)
' is INCORRECT'
14329 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
14335 allocate( mask_array( &
14336 & answer_shape(1), &
14338 & answer_shape(2), &
14340 & answer_shape(3), &
14342 & answer_shape(4), &
14344 & answer_shape(5) ) &
14348 & answer_shape(1), &
14350 & answer_shape(2), &
14352 & answer_shape(3), &
14354 & answer_shape(4), &
14356 & answer_shape(5) ) &
14359 allocate( judge_rev( &
14360 & answer_shape(1), &
14362 & answer_shape(2), &
14364 & answer_shape(3), &
14366 & answer_shape(4), &
14368 & answer_shape(5) ) &
14371 allocate( answer_negative( &
14372 & answer_shape(1), &
14374 & answer_shape(2), &
14376 & answer_shape(3), &
14378 & answer_shape(4), &
14380 & answer_shape(5) ) &
14383 allocate( check_negative( &
14384 & answer_shape(1), &
14386 & answer_shape(2), &
14388 & answer_shape(3), &
14390 & answer_shape(4), &
14392 & answer_shape(5) ) &
14395 allocate( both_negative( &
14396 & answer_shape(1), &
14398 & answer_shape(2), &
14400 & answer_shape(3), &
14402 & answer_shape(4), &
14404 & answer_shape(5) ) &
14407 answer_negative = answer < 0
14408 check_negative = check < 0
14409 both_negative = answer_negative .and. check_negative
14410 if (.not. negative_support_on) both_negative = .false.
14412 judge = answer > check
14413 where (both_negative) judge = .not. judge
14415 judge_rev = .not. judge
14416 err_flag = any(judge_rev)
14418 pos = maxloc(mask_array, judge_rev)
14444 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
14446 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
14448 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
14450 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
14452 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
14456 & trim(adjustl(pos_array(1))) //
',' // &
14458 & trim(adjustl(pos_array(2))) //
',' // &
14460 & trim(adjustl(pos_array(3))) //
',' // &
14462 & trim(adjustl(pos_array(4))) //
',' // &
14464 & trim(adjustl(pos_array(5))) //
')'
14466 if ( both_negative( &
14477 abs_mes =
'ABSOLUTE value of'
14484 deallocate(mask_array, judge, judge_rev)
14485 deallocate(answer_negative, check_negative, both_negative)
14491 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14493 write(*,*)
' ' // trim(abs_mes) // &
14494 &
' check' // trim(pos_str) //
' = ', wrong
14495 write(*,*)
' is NOT LESS THAN'
14496 write(*,*)
' ' // trim(abs_mes) // &
14497 &
' answer' // trim(pos_str) //
' = ', right
14501 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
14505 end subroutine dctestassertlessthanint5
14508 subroutine dctestassertlessthanint6( &
14509 & message, answer, check, negative_support)
14513 character(*),
intent(in):: message
14514 integer,
intent(in):: answer(:,:,:,:,:,:)
14515 integer,
intent(in):: check(:,:,:,:,:,:)
14516 logical,
intent(in),
optional:: negative_support
14518 logical:: negative_support_on
14519 character(STRING):: pos_str
14520 character(TOKEN):: abs_mes
14521 integer:: wrong, right
14523 integer:: answer_shape(6), check_shape(6), pos(6)
14524 logical:: consist_shape(6)
14525 character(TOKEN):: pos_array(6)
14526 integer,
allocatable:: mask_array(:,:,:,:,:,:)
14527 logical,
allocatable:: judge(:,:,:,:,:,:)
14528 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
14529 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
14530 logical,
allocatable:: check_negative(:,:,:,:,:,:)
14531 logical,
allocatable:: both_negative(:,:,:,:,:,:)
14535 if (
present(negative_support))
then
14536 negative_support_on = negative_support
14538 negative_support_on = .true.
14544 answer_shape = shape(answer)
14545 check_shape = shape(check)
14547 consist_shape = answer_shape == check_shape
14549 if (.not. all(consist_shape))
then
14550 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14552 write(*,*)
' shape of check is (', check_shape,
')'
14553 write(*,*)
' is INCORRECT'
14554 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
14560 allocate( mask_array( &
14561 & answer_shape(1), &
14563 & answer_shape(2), &
14565 & answer_shape(3), &
14567 & answer_shape(4), &
14569 & answer_shape(5), &
14571 & answer_shape(6) ) &
14575 & answer_shape(1), &
14577 & answer_shape(2), &
14579 & answer_shape(3), &
14581 & answer_shape(4), &
14583 & answer_shape(5), &
14585 & answer_shape(6) ) &
14588 allocate( judge_rev( &
14589 & answer_shape(1), &
14591 & answer_shape(2), &
14593 & answer_shape(3), &
14595 & answer_shape(4), &
14597 & answer_shape(5), &
14599 & answer_shape(6) ) &
14602 allocate( answer_negative( &
14603 & answer_shape(1), &
14605 & answer_shape(2), &
14607 & answer_shape(3), &
14609 & answer_shape(4), &
14611 & answer_shape(5), &
14613 & answer_shape(6) ) &
14616 allocate( check_negative( &
14617 & answer_shape(1), &
14619 & answer_shape(2), &
14621 & answer_shape(3), &
14623 & answer_shape(4), &
14625 & answer_shape(5), &
14627 & answer_shape(6) ) &
14630 allocate( both_negative( &
14631 & answer_shape(1), &
14633 & answer_shape(2), &
14635 & answer_shape(3), &
14637 & answer_shape(4), &
14639 & answer_shape(5), &
14641 & answer_shape(6) ) &
14644 answer_negative = answer < 0
14645 check_negative = check < 0
14646 both_negative = answer_negative .and. check_negative
14647 if (.not. negative_support_on) both_negative = .false.
14649 judge = answer > check
14650 where (both_negative) judge = .not. judge
14652 judge_rev = .not. judge
14653 err_flag = any(judge_rev)
14655 pos = maxloc(mask_array, judge_rev)
14685 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
14687 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
14689 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
14691 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
14693 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
14695 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
14699 & trim(adjustl(pos_array(1))) //
',' // &
14701 & trim(adjustl(pos_array(2))) //
',' // &
14703 & trim(adjustl(pos_array(3))) //
',' // &
14705 & trim(adjustl(pos_array(4))) //
',' // &
14707 & trim(adjustl(pos_array(5))) //
',' // &
14709 & trim(adjustl(pos_array(6))) //
')'
14711 if ( both_negative( &
14724 abs_mes =
'ABSOLUTE value of'
14731 deallocate(mask_array, judge, judge_rev)
14732 deallocate(answer_negative, check_negative, both_negative)
14738 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14740 write(*,*)
' ' // trim(abs_mes) // &
14741 &
' check' // trim(pos_str) //
' = ', wrong
14742 write(*,*)
' is NOT LESS THAN'
14743 write(*,*)
' ' // trim(abs_mes) // &
14744 &
' answer' // trim(pos_str) //
' = ', right
14748 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
14752 end subroutine dctestassertlessthanint6
14755 subroutine dctestassertlessthanint7( &
14756 & message, answer, check, negative_support)
14760 character(*),
intent(in):: message
14761 integer,
intent(in):: answer(:,:,:,:,:,:,:)
14762 integer,
intent(in):: check(:,:,:,:,:,:,:)
14763 logical,
intent(in),
optional:: negative_support
14765 logical:: negative_support_on
14766 character(STRING):: pos_str
14767 character(TOKEN):: abs_mes
14768 integer:: wrong, right
14770 integer:: answer_shape(7), check_shape(7), pos(7)
14771 logical:: consist_shape(7)
14772 character(TOKEN):: pos_array(7)
14773 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
14774 logical,
allocatable:: judge(:,:,:,:,:,:,:)
14775 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
14776 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
14777 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
14778 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
14782 if (
present(negative_support))
then
14783 negative_support_on = negative_support
14785 negative_support_on = .true.
14791 answer_shape = shape(answer)
14792 check_shape = shape(check)
14794 consist_shape = answer_shape == check_shape
14796 if (.not. all(consist_shape))
then
14797 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
14799 write(*,*)
' shape of check is (', check_shape,
')'
14800 write(*,*)
' is INCORRECT'
14801 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
14807 allocate( mask_array( &
14808 & answer_shape(1), &
14810 & answer_shape(2), &
14812 & answer_shape(3), &
14814 & answer_shape(4), &
14816 & answer_shape(5), &
14818 & answer_shape(6), &
14820 & answer_shape(7) ) &
14824 & answer_shape(1), &
14826 & answer_shape(2), &
14828 & answer_shape(3), &
14830 & answer_shape(4), &
14832 & answer_shape(5), &
14834 & answer_shape(6), &
14836 & answer_shape(7) ) &
14839 allocate( judge_rev( &
14840 & answer_shape(1), &
14842 & answer_shape(2), &
14844 & answer_shape(3), &
14846 & answer_shape(4), &
14848 & answer_shape(5), &
14850 & answer_shape(6), &
14852 & answer_shape(7) ) &
14855 allocate( answer_negative( &
14856 & answer_shape(1), &
14858 & answer_shape(2), &
14860 & answer_shape(3), &
14862 & answer_shape(4), &
14864 & answer_shape(5), &
14866 & answer_shape(6), &
14868 & answer_shape(7) ) &
14871 allocate( check_negative( &
14872 & answer_shape(1), &
14874 & answer_shape(2), &
14876 & answer_shape(3), &
14878 & answer_shape(4), &
14880 & answer_shape(5), &
14882 & answer_shape(6), &
14884 & answer_shape(7) ) &
14887 allocate( both_negative( &
14888 & answer_shape(1), &
14890 & answer_shape(2), &
14892 & answer_shape(3), &
14894 & answer_shape(4), &
14896 & answer_shape(5), &
14898 & answer_shape(6), &
14900 & answer_shape(7) ) &
14903 answer_negative = answer < 0
14904 check_negative = check < 0
14905 both_negative = answer_negative .and. check_negative
14906 if (.not. negative_support_on) both_negative = .false.
14908 judge = answer > check
14909 where (both_negative) judge = .not. judge
14911 judge_rev = .not. judge
14912 err_flag = any(judge_rev)
14914 pos = maxloc(mask_array, judge_rev)
14948 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
14950 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
14952 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
14954 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
14956 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
14958 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
14960 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
14964 & trim(adjustl(pos_array(1))) //
',' // &
14966 & trim(adjustl(pos_array(2))) //
',' // &
14968 & trim(adjustl(pos_array(3))) //
',' // &
14970 & trim(adjustl(pos_array(4))) //
',' // &
14972 & trim(adjustl(pos_array(5))) //
',' // &
14974 & trim(adjustl(pos_array(6))) //
',' // &
14976 & trim(adjustl(pos_array(7))) //
')'
14978 if ( both_negative( &
14993 abs_mes =
'ABSOLUTE value of'
15000 deallocate(mask_array, judge, judge_rev)
15001 deallocate(answer_negative, check_negative, both_negative)
15007 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15009 write(*,*)
' ' // trim(abs_mes) // &
15010 &
' check' // trim(pos_str) //
' = ', wrong
15011 write(*,*)
' is NOT LESS THAN'
15012 write(*,*)
' ' // trim(abs_mes) // &
15013 &
' answer' // trim(pos_str) //
' = ', right
15017 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
15021 end subroutine dctestassertlessthanint7
15024 subroutine dctestassertlessthanreal0( &
15025 & message, answer, check, negative_support)
15029 character(*),
intent(in):: message
15030 real,
intent(in):: answer
15031 real,
intent(in):: check
15032 logical,
intent(in),
optional:: negative_support
15034 logical:: negative_support_on
15035 character(STRING):: pos_str
15036 character(TOKEN):: abs_mes
15037 real:: wrong, right
15042 if (
present(negative_support))
then
15043 negative_support_on = negative_support
15045 negative_support_on = .true.
15053 err_flag = .not. answer > check
15056 if ( answer < 0.0 &
15057 & .and. check < 0.0 &
15058 & .and. negative_support_on )
then
15060 err_flag = .not. err_flag
15061 abs_mes =
'ABSOLUTE value of'
15072 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15074 write(*,*)
' ' // trim(abs_mes) // &
15075 &
' check' // trim(pos_str) //
' = ', wrong
15076 write(*,*)
' is NOT LESS THAN'
15077 write(*,*)
' ' // trim(abs_mes) // &
15078 &
' answer' // trim(pos_str) //
' = ', right
15082 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
15086 end subroutine dctestassertlessthanreal0
15089 subroutine dctestassertlessthanreal1( &
15090 & message, answer, check, negative_support)
15094 character(*),
intent(in):: message
15095 real,
intent(in):: answer(:)
15096 real,
intent(in):: check(:)
15097 logical,
intent(in),
optional:: negative_support
15099 logical:: negative_support_on
15100 character(STRING):: pos_str
15101 character(TOKEN):: abs_mes
15102 real:: wrong, right
15104 integer:: answer_shape(1), check_shape(1), pos(1)
15105 logical:: consist_shape(1)
15106 character(TOKEN):: pos_array(1)
15107 integer,
allocatable:: mask_array(:)
15108 logical,
allocatable:: judge(:)
15109 logical,
allocatable:: judge_rev(:)
15110 logical,
allocatable:: answer_negative(:)
15111 logical,
allocatable:: check_negative(:)
15112 logical,
allocatable:: both_negative(:)
15116 if (
present(negative_support))
then
15117 negative_support_on = negative_support
15119 negative_support_on = .true.
15125 answer_shape = shape(answer)
15126 check_shape = shape(check)
15128 consist_shape = answer_shape == check_shape
15130 if (.not. all(consist_shape))
then
15131 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15133 write(*,*)
' shape of check is (', check_shape,
')'
15134 write(*,*)
' is INCORRECT'
15135 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
15141 allocate( mask_array( &
15143 & answer_shape(1) ) &
15148 & answer_shape(1) ) &
15151 allocate( judge_rev( &
15153 & answer_shape(1) ) &
15156 allocate( answer_negative( &
15158 & answer_shape(1) ) &
15161 allocate( check_negative( &
15163 & answer_shape(1) ) &
15166 allocate( both_negative( &
15168 & answer_shape(1) ) &
15171 answer_negative = answer < 0.0
15172 check_negative = check < 0.0
15173 both_negative = answer_negative .and. check_negative
15174 if (.not. negative_support_on) both_negative = .false.
15176 judge = answer > check
15177 where (both_negative) judge = .not. judge
15179 judge_rev = .not. judge
15180 err_flag = any(judge_rev)
15182 pos = maxloc(mask_array, judge_rev)
15194 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
15199 & trim(adjustl(pos_array(1))) //
')'
15201 if ( both_negative( &
15205 abs_mes =
'ABSOLUTE value of'
15212 deallocate(mask_array, judge, judge_rev)
15213 deallocate(answer_negative, check_negative, both_negative)
15219 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15221 write(*,*)
' ' // trim(abs_mes) // &
15222 &
' check' // trim(pos_str) //
' = ', wrong
15223 write(*,*)
' is NOT LESS THAN'
15224 write(*,*)
' ' // trim(abs_mes) // &
15225 &
' answer' // trim(pos_str) //
' = ', right
15229 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
15233 end subroutine dctestassertlessthanreal1
15236 subroutine dctestassertlessthanreal2( &
15237 & message, answer, check, negative_support)
15241 character(*),
intent(in):: message
15242 real,
intent(in):: answer(:,:)
15243 real,
intent(in):: check(:,:)
15244 logical,
intent(in),
optional:: negative_support
15246 logical:: negative_support_on
15247 character(STRING):: pos_str
15248 character(TOKEN):: abs_mes
15249 real:: wrong, right
15251 integer:: answer_shape(2), check_shape(2), pos(2)
15252 logical:: consist_shape(2)
15253 character(TOKEN):: pos_array(2)
15254 integer,
allocatable:: mask_array(:,:)
15255 logical,
allocatable:: judge(:,:)
15256 logical,
allocatable:: judge_rev(:,:)
15257 logical,
allocatable:: answer_negative(:,:)
15258 logical,
allocatable:: check_negative(:,:)
15259 logical,
allocatable:: both_negative(:,:)
15263 if (
present(negative_support))
then
15264 negative_support_on = negative_support
15266 negative_support_on = .true.
15272 answer_shape = shape(answer)
15273 check_shape = shape(check)
15275 consist_shape = answer_shape == check_shape
15277 if (.not. all(consist_shape))
then
15278 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15280 write(*,*)
' shape of check is (', check_shape,
')'
15281 write(*,*)
' is INCORRECT'
15282 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
15288 allocate( mask_array( &
15289 & answer_shape(1), &
15291 & answer_shape(2) ) &
15295 & answer_shape(1), &
15297 & answer_shape(2) ) &
15300 allocate( judge_rev( &
15301 & answer_shape(1), &
15303 & answer_shape(2) ) &
15306 allocate( answer_negative( &
15307 & answer_shape(1), &
15309 & answer_shape(2) ) &
15312 allocate( check_negative( &
15313 & answer_shape(1), &
15315 & answer_shape(2) ) &
15318 allocate( both_negative( &
15319 & answer_shape(1), &
15321 & answer_shape(2) ) &
15324 answer_negative = answer < 0.0
15325 check_negative = check < 0.0
15326 both_negative = answer_negative .and. check_negative
15327 if (.not. negative_support_on) both_negative = .false.
15329 judge = answer > check
15330 where (both_negative) judge = .not. judge
15332 judge_rev = .not. judge
15333 err_flag = any(judge_rev)
15335 pos = maxloc(mask_array, judge_rev)
15349 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
15351 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
15355 & trim(adjustl(pos_array(1))) //
',' // &
15357 & trim(adjustl(pos_array(2))) //
')'
15359 if ( both_negative( &
15364 abs_mes =
'ABSOLUTE value of'
15371 deallocate(mask_array, judge, judge_rev)
15372 deallocate(answer_negative, check_negative, both_negative)
15378 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15380 write(*,*)
' ' // trim(abs_mes) // &
15381 &
' check' // trim(pos_str) //
' = ', wrong
15382 write(*,*)
' is NOT LESS THAN'
15383 write(*,*)
' ' // trim(abs_mes) // &
15384 &
' answer' // trim(pos_str) //
' = ', right
15388 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
15392 end subroutine dctestassertlessthanreal2
15395 subroutine dctestassertlessthanreal3( &
15396 & message, answer, check, negative_support)
15400 character(*),
intent(in):: message
15401 real,
intent(in):: answer(:,:,:)
15402 real,
intent(in):: check(:,:,:)
15403 logical,
intent(in),
optional:: negative_support
15405 logical:: negative_support_on
15406 character(STRING):: pos_str
15407 character(TOKEN):: abs_mes
15408 real:: wrong, right
15410 integer:: answer_shape(3), check_shape(3), pos(3)
15411 logical:: consist_shape(3)
15412 character(TOKEN):: pos_array(3)
15413 integer,
allocatable:: mask_array(:,:,:)
15414 logical,
allocatable:: judge(:,:,:)
15415 logical,
allocatable:: judge_rev(:,:,:)
15416 logical,
allocatable:: answer_negative(:,:,:)
15417 logical,
allocatable:: check_negative(:,:,:)
15418 logical,
allocatable:: both_negative(:,:,:)
15422 if (
present(negative_support))
then
15423 negative_support_on = negative_support
15425 negative_support_on = .true.
15431 answer_shape = shape(answer)
15432 check_shape = shape(check)
15434 consist_shape = answer_shape == check_shape
15436 if (.not. all(consist_shape))
then
15437 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15439 write(*,*)
' shape of check is (', check_shape,
')'
15440 write(*,*)
' is INCORRECT'
15441 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
15447 allocate( mask_array( &
15448 & answer_shape(1), &
15450 & answer_shape(2), &
15452 & answer_shape(3) ) &
15456 & answer_shape(1), &
15458 & answer_shape(2), &
15460 & answer_shape(3) ) &
15463 allocate( judge_rev( &
15464 & answer_shape(1), &
15466 & answer_shape(2), &
15468 & answer_shape(3) ) &
15471 allocate( answer_negative( &
15472 & answer_shape(1), &
15474 & answer_shape(2), &
15476 & answer_shape(3) ) &
15479 allocate( check_negative( &
15480 & answer_shape(1), &
15482 & answer_shape(2), &
15484 & answer_shape(3) ) &
15487 allocate( both_negative( &
15488 & answer_shape(1), &
15490 & answer_shape(2), &
15492 & answer_shape(3) ) &
15495 answer_negative = answer < 0.0
15496 check_negative = check < 0.0
15497 both_negative = answer_negative .and. check_negative
15498 if (.not. negative_support_on) both_negative = .false.
15500 judge = answer > check
15501 where (both_negative) judge = .not. judge
15503 judge_rev = .not. judge
15504 err_flag = any(judge_rev)
15506 pos = maxloc(mask_array, judge_rev)
15524 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
15526 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
15528 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
15532 & trim(adjustl(pos_array(1))) //
',' // &
15534 & trim(adjustl(pos_array(2))) //
',' // &
15536 & trim(adjustl(pos_array(3))) //
')'
15538 if ( both_negative( &
15545 abs_mes =
'ABSOLUTE value of'
15552 deallocate(mask_array, judge, judge_rev)
15553 deallocate(answer_negative, check_negative, both_negative)
15559 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15561 write(*,*)
' ' // trim(abs_mes) // &
15562 &
' check' // trim(pos_str) //
' = ', wrong
15563 write(*,*)
' is NOT LESS THAN'
15564 write(*,*)
' ' // trim(abs_mes) // &
15565 &
' answer' // trim(pos_str) //
' = ', right
15569 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
15573 end subroutine dctestassertlessthanreal3
15576 subroutine dctestassertlessthanreal4( &
15577 & message, answer, check, negative_support)
15581 character(*),
intent(in):: message
15582 real,
intent(in):: answer(:,:,:,:)
15583 real,
intent(in):: check(:,:,:,:)
15584 logical,
intent(in),
optional:: negative_support
15586 logical:: negative_support_on
15587 character(STRING):: pos_str
15588 character(TOKEN):: abs_mes
15589 real:: wrong, right
15591 integer:: answer_shape(4), check_shape(4), pos(4)
15592 logical:: consist_shape(4)
15593 character(TOKEN):: pos_array(4)
15594 integer,
allocatable:: mask_array(:,:,:,:)
15595 logical,
allocatable:: judge(:,:,:,:)
15596 logical,
allocatable:: judge_rev(:,:,:,:)
15597 logical,
allocatable:: answer_negative(:,:,:,:)
15598 logical,
allocatable:: check_negative(:,:,:,:)
15599 logical,
allocatable:: both_negative(:,:,:,:)
15603 if (
present(negative_support))
then
15604 negative_support_on = negative_support
15606 negative_support_on = .true.
15612 answer_shape = shape(answer)
15613 check_shape = shape(check)
15615 consist_shape = answer_shape == check_shape
15617 if (.not. all(consist_shape))
then
15618 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15620 write(*,*)
' shape of check is (', check_shape,
')'
15621 write(*,*)
' is INCORRECT'
15622 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
15628 allocate( mask_array( &
15629 & answer_shape(1), &
15631 & answer_shape(2), &
15633 & answer_shape(3), &
15635 & answer_shape(4) ) &
15639 & answer_shape(1), &
15641 & answer_shape(2), &
15643 & answer_shape(3), &
15645 & answer_shape(4) ) &
15648 allocate( judge_rev( &
15649 & answer_shape(1), &
15651 & answer_shape(2), &
15653 & answer_shape(3), &
15655 & answer_shape(4) ) &
15658 allocate( answer_negative( &
15659 & answer_shape(1), &
15661 & answer_shape(2), &
15663 & answer_shape(3), &
15665 & answer_shape(4) ) &
15668 allocate( check_negative( &
15669 & answer_shape(1), &
15671 & answer_shape(2), &
15673 & answer_shape(3), &
15675 & answer_shape(4) ) &
15678 allocate( both_negative( &
15679 & answer_shape(1), &
15681 & answer_shape(2), &
15683 & answer_shape(3), &
15685 & answer_shape(4) ) &
15688 answer_negative = answer < 0.0
15689 check_negative = check < 0.0
15690 both_negative = answer_negative .and. check_negative
15691 if (.not. negative_support_on) both_negative = .false.
15693 judge = answer > check
15694 where (both_negative) judge = .not. judge
15696 judge_rev = .not. judge
15697 err_flag = any(judge_rev)
15699 pos = maxloc(mask_array, judge_rev)
15721 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
15723 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
15725 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
15727 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
15731 & trim(adjustl(pos_array(1))) //
',' // &
15733 & trim(adjustl(pos_array(2))) //
',' // &
15735 & trim(adjustl(pos_array(3))) //
',' // &
15737 & trim(adjustl(pos_array(4))) //
')'
15739 if ( both_negative( &
15748 abs_mes =
'ABSOLUTE value of'
15755 deallocate(mask_array, judge, judge_rev)
15756 deallocate(answer_negative, check_negative, both_negative)
15762 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15764 write(*,*)
' ' // trim(abs_mes) // &
15765 &
' check' // trim(pos_str) //
' = ', wrong
15766 write(*,*)
' is NOT LESS THAN'
15767 write(*,*)
' ' // trim(abs_mes) // &
15768 &
' answer' // trim(pos_str) //
' = ', right
15772 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
15776 end subroutine dctestassertlessthanreal4
15779 subroutine dctestassertlessthanreal5( &
15780 & message, answer, check, negative_support)
15784 character(*),
intent(in):: message
15785 real,
intent(in):: answer(:,:,:,:,:)
15786 real,
intent(in):: check(:,:,:,:,:)
15787 logical,
intent(in),
optional:: negative_support
15789 logical:: negative_support_on
15790 character(STRING):: pos_str
15791 character(TOKEN):: abs_mes
15792 real:: wrong, right
15794 integer:: answer_shape(5), check_shape(5), pos(5)
15795 logical:: consist_shape(5)
15796 character(TOKEN):: pos_array(5)
15797 integer,
allocatable:: mask_array(:,:,:,:,:)
15798 logical,
allocatable:: judge(:,:,:,:,:)
15799 logical,
allocatable:: judge_rev(:,:,:,:,:)
15800 logical,
allocatable:: answer_negative(:,:,:,:,:)
15801 logical,
allocatable:: check_negative(:,:,:,:,:)
15802 logical,
allocatable:: both_negative(:,:,:,:,:)
15806 if (
present(negative_support))
then
15807 negative_support_on = negative_support
15809 negative_support_on = .true.
15815 answer_shape = shape(answer)
15816 check_shape = shape(check)
15818 consist_shape = answer_shape == check_shape
15820 if (.not. all(consist_shape))
then
15821 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15823 write(*,*)
' shape of check is (', check_shape,
')'
15824 write(*,*)
' is INCORRECT'
15825 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
15831 allocate( mask_array( &
15832 & answer_shape(1), &
15834 & answer_shape(2), &
15836 & answer_shape(3), &
15838 & answer_shape(4), &
15840 & answer_shape(5) ) &
15844 & answer_shape(1), &
15846 & answer_shape(2), &
15848 & answer_shape(3), &
15850 & answer_shape(4), &
15852 & answer_shape(5) ) &
15855 allocate( judge_rev( &
15856 & answer_shape(1), &
15858 & answer_shape(2), &
15860 & answer_shape(3), &
15862 & answer_shape(4), &
15864 & answer_shape(5) ) &
15867 allocate( answer_negative( &
15868 & answer_shape(1), &
15870 & answer_shape(2), &
15872 & answer_shape(3), &
15874 & answer_shape(4), &
15876 & answer_shape(5) ) &
15879 allocate( check_negative( &
15880 & answer_shape(1), &
15882 & answer_shape(2), &
15884 & answer_shape(3), &
15886 & answer_shape(4), &
15888 & answer_shape(5) ) &
15891 allocate( both_negative( &
15892 & answer_shape(1), &
15894 & answer_shape(2), &
15896 & answer_shape(3), &
15898 & answer_shape(4), &
15900 & answer_shape(5) ) &
15903 answer_negative = answer < 0.0
15904 check_negative = check < 0.0
15905 both_negative = answer_negative .and. check_negative
15906 if (.not. negative_support_on) both_negative = .false.
15908 judge = answer > check
15909 where (both_negative) judge = .not. judge
15911 judge_rev = .not. judge
15912 err_flag = any(judge_rev)
15914 pos = maxloc(mask_array, judge_rev)
15940 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
15942 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
15944 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
15946 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
15948 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
15952 & trim(adjustl(pos_array(1))) //
',' // &
15954 & trim(adjustl(pos_array(2))) //
',' // &
15956 & trim(adjustl(pos_array(3))) //
',' // &
15958 & trim(adjustl(pos_array(4))) //
',' // &
15960 & trim(adjustl(pos_array(5))) //
')'
15962 if ( both_negative( &
15973 abs_mes =
'ABSOLUTE value of'
15980 deallocate(mask_array, judge, judge_rev)
15981 deallocate(answer_negative, check_negative, both_negative)
15987 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
15989 write(*,*)
' ' // trim(abs_mes) // &
15990 &
' check' // trim(pos_str) //
' = ', wrong
15991 write(*,*)
' is NOT LESS THAN'
15992 write(*,*)
' ' // trim(abs_mes) // &
15993 &
' answer' // trim(pos_str) //
' = ', right
15997 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
16001 end subroutine dctestassertlessthanreal5
16004 subroutine dctestassertlessthanreal6( &
16005 & message, answer, check, negative_support)
16009 character(*),
intent(in):: message
16010 real,
intent(in):: answer(:,:,:,:,:,:)
16011 real,
intent(in):: check(:,:,:,:,:,:)
16012 logical,
intent(in),
optional:: negative_support
16014 logical:: negative_support_on
16015 character(STRING):: pos_str
16016 character(TOKEN):: abs_mes
16017 real:: wrong, right
16019 integer:: answer_shape(6), check_shape(6), pos(6)
16020 logical:: consist_shape(6)
16021 character(TOKEN):: pos_array(6)
16022 integer,
allocatable:: mask_array(:,:,:,:,:,:)
16023 logical,
allocatable:: judge(:,:,:,:,:,:)
16024 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
16025 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
16026 logical,
allocatable:: check_negative(:,:,:,:,:,:)
16027 logical,
allocatable:: both_negative(:,:,:,:,:,:)
16031 if (
present(negative_support))
then
16032 negative_support_on = negative_support
16034 negative_support_on = .true.
16040 answer_shape = shape(answer)
16041 check_shape = shape(check)
16043 consist_shape = answer_shape == check_shape
16045 if (.not. all(consist_shape))
then
16046 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16048 write(*,*)
' shape of check is (', check_shape,
')'
16049 write(*,*)
' is INCORRECT'
16050 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
16056 allocate( mask_array( &
16057 & answer_shape(1), &
16059 & answer_shape(2), &
16061 & answer_shape(3), &
16063 & answer_shape(4), &
16065 & answer_shape(5), &
16067 & answer_shape(6) ) &
16071 & answer_shape(1), &
16073 & answer_shape(2), &
16075 & answer_shape(3), &
16077 & answer_shape(4), &
16079 & answer_shape(5), &
16081 & answer_shape(6) ) &
16084 allocate( judge_rev( &
16085 & answer_shape(1), &
16087 & answer_shape(2), &
16089 & answer_shape(3), &
16091 & answer_shape(4), &
16093 & answer_shape(5), &
16095 & answer_shape(6) ) &
16098 allocate( answer_negative( &
16099 & answer_shape(1), &
16101 & answer_shape(2), &
16103 & answer_shape(3), &
16105 & answer_shape(4), &
16107 & answer_shape(5), &
16109 & answer_shape(6) ) &
16112 allocate( check_negative( &
16113 & answer_shape(1), &
16115 & answer_shape(2), &
16117 & answer_shape(3), &
16119 & answer_shape(4), &
16121 & answer_shape(5), &
16123 & answer_shape(6) ) &
16126 allocate( both_negative( &
16127 & answer_shape(1), &
16129 & answer_shape(2), &
16131 & answer_shape(3), &
16133 & answer_shape(4), &
16135 & answer_shape(5), &
16137 & answer_shape(6) ) &
16140 answer_negative = answer < 0.0
16141 check_negative = check < 0.0
16142 both_negative = answer_negative .and. check_negative
16143 if (.not. negative_support_on) both_negative = .false.
16145 judge = answer > check
16146 where (both_negative) judge = .not. judge
16148 judge_rev = .not. judge
16149 err_flag = any(judge_rev)
16151 pos = maxloc(mask_array, judge_rev)
16181 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
16183 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
16185 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
16187 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
16189 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
16191 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
16195 & trim(adjustl(pos_array(1))) //
',' // &
16197 & trim(adjustl(pos_array(2))) //
',' // &
16199 & trim(adjustl(pos_array(3))) //
',' // &
16201 & trim(adjustl(pos_array(4))) //
',' // &
16203 & trim(adjustl(pos_array(5))) //
',' // &
16205 & trim(adjustl(pos_array(6))) //
')'
16207 if ( both_negative( &
16220 abs_mes =
'ABSOLUTE value of'
16227 deallocate(mask_array, judge, judge_rev)
16228 deallocate(answer_negative, check_negative, both_negative)
16234 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16236 write(*,*)
' ' // trim(abs_mes) // &
16237 &
' check' // trim(pos_str) //
' = ', wrong
16238 write(*,*)
' is NOT LESS THAN'
16239 write(*,*)
' ' // trim(abs_mes) // &
16240 &
' answer' // trim(pos_str) //
' = ', right
16244 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
16248 end subroutine dctestassertlessthanreal6
16251 subroutine dctestassertlessthanreal7( &
16252 & message, answer, check, negative_support)
16256 character(*),
intent(in):: message
16257 real,
intent(in):: answer(:,:,:,:,:,:,:)
16258 real,
intent(in):: check(:,:,:,:,:,:,:)
16259 logical,
intent(in),
optional:: negative_support
16261 logical:: negative_support_on
16262 character(STRING):: pos_str
16263 character(TOKEN):: abs_mes
16264 real:: wrong, right
16266 integer:: answer_shape(7), check_shape(7), pos(7)
16267 logical:: consist_shape(7)
16268 character(TOKEN):: pos_array(7)
16269 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
16270 logical,
allocatable:: judge(:,:,:,:,:,:,:)
16271 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
16272 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
16273 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
16274 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
16278 if (
present(negative_support))
then
16279 negative_support_on = negative_support
16281 negative_support_on = .true.
16287 answer_shape = shape(answer)
16288 check_shape = shape(check)
16290 consist_shape = answer_shape == check_shape
16292 if (.not. all(consist_shape))
then
16293 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16295 write(*,*)
' shape of check is (', check_shape,
')'
16296 write(*,*)
' is INCORRECT'
16297 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
16303 allocate( mask_array( &
16304 & answer_shape(1), &
16306 & answer_shape(2), &
16308 & answer_shape(3), &
16310 & answer_shape(4), &
16312 & answer_shape(5), &
16314 & answer_shape(6), &
16316 & answer_shape(7) ) &
16320 & answer_shape(1), &
16322 & answer_shape(2), &
16324 & answer_shape(3), &
16326 & answer_shape(4), &
16328 & answer_shape(5), &
16330 & answer_shape(6), &
16332 & answer_shape(7) ) &
16335 allocate( judge_rev( &
16336 & answer_shape(1), &
16338 & answer_shape(2), &
16340 & answer_shape(3), &
16342 & answer_shape(4), &
16344 & answer_shape(5), &
16346 & answer_shape(6), &
16348 & answer_shape(7) ) &
16351 allocate( answer_negative( &
16352 & answer_shape(1), &
16354 & answer_shape(2), &
16356 & answer_shape(3), &
16358 & answer_shape(4), &
16360 & answer_shape(5), &
16362 & answer_shape(6), &
16364 & answer_shape(7) ) &
16367 allocate( check_negative( &
16368 & answer_shape(1), &
16370 & answer_shape(2), &
16372 & answer_shape(3), &
16374 & answer_shape(4), &
16376 & answer_shape(5), &
16378 & answer_shape(6), &
16380 & answer_shape(7) ) &
16383 allocate( both_negative( &
16384 & answer_shape(1), &
16386 & answer_shape(2), &
16388 & answer_shape(3), &
16390 & answer_shape(4), &
16392 & answer_shape(5), &
16394 & answer_shape(6), &
16396 & answer_shape(7) ) &
16399 answer_negative = answer < 0.0
16400 check_negative = check < 0.0
16401 both_negative = answer_negative .and. check_negative
16402 if (.not. negative_support_on) both_negative = .false.
16404 judge = answer > check
16405 where (both_negative) judge = .not. judge
16407 judge_rev = .not. judge
16408 err_flag = any(judge_rev)
16410 pos = maxloc(mask_array, judge_rev)
16444 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
16446 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
16448 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
16450 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
16452 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
16454 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
16456 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
16460 & trim(adjustl(pos_array(1))) //
',' // &
16462 & trim(adjustl(pos_array(2))) //
',' // &
16464 & trim(adjustl(pos_array(3))) //
',' // &
16466 & trim(adjustl(pos_array(4))) //
',' // &
16468 & trim(adjustl(pos_array(5))) //
',' // &
16470 & trim(adjustl(pos_array(6))) //
',' // &
16472 & trim(adjustl(pos_array(7))) //
')'
16474 if ( both_negative( &
16489 abs_mes =
'ABSOLUTE value of'
16496 deallocate(mask_array, judge, judge_rev)
16497 deallocate(answer_negative, check_negative, both_negative)
16503 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16505 write(*,*)
' ' // trim(abs_mes) // &
16506 &
' check' // trim(pos_str) //
' = ', wrong
16507 write(*,*)
' is NOT LESS THAN'
16508 write(*,*)
' ' // trim(abs_mes) // &
16509 &
' answer' // trim(pos_str) //
' = ', right
16513 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
16517 end subroutine dctestassertlessthanreal7
16520 subroutine dctestassertlessthandouble0( &
16521 & message, answer, check, negative_support)
16525 character(*),
intent(in):: message
16526 real(DP),
intent(in):: answer
16527 real(DP),
intent(in):: check
16528 logical,
intent(in),
optional:: negative_support
16530 logical:: negative_support_on
16531 character(STRING):: pos_str
16532 character(TOKEN):: abs_mes
16533 real(DP):: wrong, right
16538 if (
present(negative_support))
then
16539 negative_support_on = negative_support
16541 negative_support_on = .true.
16549 err_flag = .not. answer > check
16552 if ( answer < 0.0_dp &
16553 & .and. check < 0.0_dp &
16554 & .and. negative_support_on )
then
16556 err_flag = .not. err_flag
16557 abs_mes =
'ABSOLUTE value of'
16568 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16570 write(*,*)
' ' // trim(abs_mes) // &
16571 &
' check' // trim(pos_str) //
' = ', wrong
16572 write(*,*)
' is NOT LESS THAN'
16573 write(*,*)
' ' // trim(abs_mes) // &
16574 &
' answer' // trim(pos_str) //
' = ', right
16578 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
16582 end subroutine dctestassertlessthandouble0
16585 subroutine dctestassertlessthandouble1( &
16586 & message, answer, check, negative_support)
16590 character(*),
intent(in):: message
16591 real(DP),
intent(in):: answer(:)
16592 real(DP),
intent(in):: check(:)
16593 logical,
intent(in),
optional:: negative_support
16595 logical:: negative_support_on
16596 character(STRING):: pos_str
16597 character(TOKEN):: abs_mes
16598 real(DP):: wrong, right
16600 integer:: answer_shape(1), check_shape(1), pos(1)
16601 logical:: consist_shape(1)
16602 character(TOKEN):: pos_array(1)
16603 integer,
allocatable:: mask_array(:)
16604 logical,
allocatable:: judge(:)
16605 logical,
allocatable:: judge_rev(:)
16606 logical,
allocatable:: answer_negative(:)
16607 logical,
allocatable:: check_negative(:)
16608 logical,
allocatable:: both_negative(:)
16612 if (
present(negative_support))
then
16613 negative_support_on = negative_support
16615 negative_support_on = .true.
16621 answer_shape = shape(answer)
16622 check_shape = shape(check)
16624 consist_shape = answer_shape == check_shape
16626 if (.not. all(consist_shape))
then
16627 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16629 write(*,*)
' shape of check is (', check_shape,
')'
16630 write(*,*)
' is INCORRECT'
16631 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
16637 allocate( mask_array( &
16639 & answer_shape(1) ) &
16644 & answer_shape(1) ) &
16647 allocate( judge_rev( &
16649 & answer_shape(1) ) &
16652 allocate( answer_negative( &
16654 & answer_shape(1) ) &
16657 allocate( check_negative( &
16659 & answer_shape(1) ) &
16662 allocate( both_negative( &
16664 & answer_shape(1) ) &
16667 answer_negative = answer < 0.0_dp
16668 check_negative = check < 0.0_dp
16669 both_negative = answer_negative .and. check_negative
16670 if (.not. negative_support_on) both_negative = .false.
16672 judge = answer > check
16673 where (both_negative) judge = .not. judge
16675 judge_rev = .not. judge
16676 err_flag = any(judge_rev)
16678 pos = maxloc(mask_array, judge_rev)
16690 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
16695 & trim(adjustl(pos_array(1))) //
')'
16697 if ( both_negative( &
16701 abs_mes =
'ABSOLUTE value of'
16708 deallocate(mask_array, judge, judge_rev)
16709 deallocate(answer_negative, check_negative, both_negative)
16715 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16717 write(*,*)
' ' // trim(abs_mes) // &
16718 &
' check' // trim(pos_str) //
' = ', wrong
16719 write(*,*)
' is NOT LESS THAN'
16720 write(*,*)
' ' // trim(abs_mes) // &
16721 &
' answer' // trim(pos_str) //
' = ', right
16725 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
16729 end subroutine dctestassertlessthandouble1
16732 subroutine dctestassertlessthandouble2( &
16733 & message, answer, check, negative_support)
16737 character(*),
intent(in):: message
16738 real(DP),
intent(in):: answer(:,:)
16739 real(DP),
intent(in):: check(:,:)
16740 logical,
intent(in),
optional:: negative_support
16742 logical:: negative_support_on
16743 character(STRING):: pos_str
16744 character(TOKEN):: abs_mes
16745 real(DP):: wrong, right
16747 integer:: answer_shape(2), check_shape(2), pos(2)
16748 logical:: consist_shape(2)
16749 character(TOKEN):: pos_array(2)
16750 integer,
allocatable:: mask_array(:,:)
16751 logical,
allocatable:: judge(:,:)
16752 logical,
allocatable:: judge_rev(:,:)
16753 logical,
allocatable:: answer_negative(:,:)
16754 logical,
allocatable:: check_negative(:,:)
16755 logical,
allocatable:: both_negative(:,:)
16759 if (
present(negative_support))
then
16760 negative_support_on = negative_support
16762 negative_support_on = .true.
16768 answer_shape = shape(answer)
16769 check_shape = shape(check)
16771 consist_shape = answer_shape == check_shape
16773 if (.not. all(consist_shape))
then
16774 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16776 write(*,*)
' shape of check is (', check_shape,
')'
16777 write(*,*)
' is INCORRECT'
16778 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
16784 allocate( mask_array( &
16785 & answer_shape(1), &
16787 & answer_shape(2) ) &
16791 & answer_shape(1), &
16793 & answer_shape(2) ) &
16796 allocate( judge_rev( &
16797 & answer_shape(1), &
16799 & answer_shape(2) ) &
16802 allocate( answer_negative( &
16803 & answer_shape(1), &
16805 & answer_shape(2) ) &
16808 allocate( check_negative( &
16809 & answer_shape(1), &
16811 & answer_shape(2) ) &
16814 allocate( both_negative( &
16815 & answer_shape(1), &
16817 & answer_shape(2) ) &
16820 answer_negative = answer < 0.0_dp
16821 check_negative = check < 0.0_dp
16822 both_negative = answer_negative .and. check_negative
16823 if (.not. negative_support_on) both_negative = .false.
16825 judge = answer > check
16826 where (both_negative) judge = .not. judge
16828 judge_rev = .not. judge
16829 err_flag = any(judge_rev)
16831 pos = maxloc(mask_array, judge_rev)
16845 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
16847 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
16851 & trim(adjustl(pos_array(1))) //
',' // &
16853 & trim(adjustl(pos_array(2))) //
')'
16855 if ( both_negative( &
16860 abs_mes =
'ABSOLUTE value of'
16867 deallocate(mask_array, judge, judge_rev)
16868 deallocate(answer_negative, check_negative, both_negative)
16874 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16876 write(*,*)
' ' // trim(abs_mes) // &
16877 &
' check' // trim(pos_str) //
' = ', wrong
16878 write(*,*)
' is NOT LESS THAN'
16879 write(*,*)
' ' // trim(abs_mes) // &
16880 &
' answer' // trim(pos_str) //
' = ', right
16884 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
16888 end subroutine dctestassertlessthandouble2
16891 subroutine dctestassertlessthandouble3( &
16892 & message, answer, check, negative_support)
16896 character(*),
intent(in):: message
16897 real(DP),
intent(in):: answer(:,:,:)
16898 real(DP),
intent(in):: check(:,:,:)
16899 logical,
intent(in),
optional:: negative_support
16901 logical:: negative_support_on
16902 character(STRING):: pos_str
16903 character(TOKEN):: abs_mes
16904 real(DP):: wrong, right
16906 integer:: answer_shape(3), check_shape(3), pos(3)
16907 logical:: consist_shape(3)
16908 character(TOKEN):: pos_array(3)
16909 integer,
allocatable:: mask_array(:,:,:)
16910 logical,
allocatable:: judge(:,:,:)
16911 logical,
allocatable:: judge_rev(:,:,:)
16912 logical,
allocatable:: answer_negative(:,:,:)
16913 logical,
allocatable:: check_negative(:,:,:)
16914 logical,
allocatable:: both_negative(:,:,:)
16918 if (
present(negative_support))
then
16919 negative_support_on = negative_support
16921 negative_support_on = .true.
16927 answer_shape = shape(answer)
16928 check_shape = shape(check)
16930 consist_shape = answer_shape == check_shape
16932 if (.not. all(consist_shape))
then
16933 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
16935 write(*,*)
' shape of check is (', check_shape,
')'
16936 write(*,*)
' is INCORRECT'
16937 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
16943 allocate( mask_array( &
16944 & answer_shape(1), &
16946 & answer_shape(2), &
16948 & answer_shape(3) ) &
16952 & answer_shape(1), &
16954 & answer_shape(2), &
16956 & answer_shape(3) ) &
16959 allocate( judge_rev( &
16960 & answer_shape(1), &
16962 & answer_shape(2), &
16964 & answer_shape(3) ) &
16967 allocate( answer_negative( &
16968 & answer_shape(1), &
16970 & answer_shape(2), &
16972 & answer_shape(3) ) &
16975 allocate( check_negative( &
16976 & answer_shape(1), &
16978 & answer_shape(2), &
16980 & answer_shape(3) ) &
16983 allocate( both_negative( &
16984 & answer_shape(1), &
16986 & answer_shape(2), &
16988 & answer_shape(3) ) &
16991 answer_negative = answer < 0.0_dp
16992 check_negative = check < 0.0_dp
16993 both_negative = answer_negative .and. check_negative
16994 if (.not. negative_support_on) both_negative = .false.
16996 judge = answer > check
16997 where (both_negative) judge = .not. judge
16999 judge_rev = .not. judge
17000 err_flag = any(judge_rev)
17002 pos = maxloc(mask_array, judge_rev)
17020 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
17022 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
17024 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
17028 & trim(adjustl(pos_array(1))) //
',' // &
17030 & trim(adjustl(pos_array(2))) //
',' // &
17032 & trim(adjustl(pos_array(3))) //
')'
17034 if ( both_negative( &
17041 abs_mes =
'ABSOLUTE value of'
17048 deallocate(mask_array, judge, judge_rev)
17049 deallocate(answer_negative, check_negative, both_negative)
17055 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17057 write(*,*)
' ' // trim(abs_mes) // &
17058 &
' check' // trim(pos_str) //
' = ', wrong
17059 write(*,*)
' is NOT LESS THAN'
17060 write(*,*)
' ' // trim(abs_mes) // &
17061 &
' answer' // trim(pos_str) //
' = ', right
17065 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
17069 end subroutine dctestassertlessthandouble3
17072 subroutine dctestassertlessthandouble4( &
17073 & message, answer, check, negative_support)
17077 character(*),
intent(in):: message
17078 real(DP),
intent(in):: answer(:,:,:,:)
17079 real(DP),
intent(in):: check(:,:,:,:)
17080 logical,
intent(in),
optional:: negative_support
17082 logical:: negative_support_on
17083 character(STRING):: pos_str
17084 character(TOKEN):: abs_mes
17085 real(DP):: wrong, right
17087 integer:: answer_shape(4), check_shape(4), pos(4)
17088 logical:: consist_shape(4)
17089 character(TOKEN):: pos_array(4)
17090 integer,
allocatable:: mask_array(:,:,:,:)
17091 logical,
allocatable:: judge(:,:,:,:)
17092 logical,
allocatable:: judge_rev(:,:,:,:)
17093 logical,
allocatable:: answer_negative(:,:,:,:)
17094 logical,
allocatable:: check_negative(:,:,:,:)
17095 logical,
allocatable:: both_negative(:,:,:,:)
17099 if (
present(negative_support))
then
17100 negative_support_on = negative_support
17102 negative_support_on = .true.
17108 answer_shape = shape(answer)
17109 check_shape = shape(check)
17111 consist_shape = answer_shape == check_shape
17113 if (.not. all(consist_shape))
then
17114 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17116 write(*,*)
' shape of check is (', check_shape,
')'
17117 write(*,*)
' is INCORRECT'
17118 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
17124 allocate( mask_array( &
17125 & answer_shape(1), &
17127 & answer_shape(2), &
17129 & answer_shape(3), &
17131 & answer_shape(4) ) &
17135 & answer_shape(1), &
17137 & answer_shape(2), &
17139 & answer_shape(3), &
17141 & answer_shape(4) ) &
17144 allocate( judge_rev( &
17145 & answer_shape(1), &
17147 & answer_shape(2), &
17149 & answer_shape(3), &
17151 & answer_shape(4) ) &
17154 allocate( answer_negative( &
17155 & answer_shape(1), &
17157 & answer_shape(2), &
17159 & answer_shape(3), &
17161 & answer_shape(4) ) &
17164 allocate( check_negative( &
17165 & answer_shape(1), &
17167 & answer_shape(2), &
17169 & answer_shape(3), &
17171 & answer_shape(4) ) &
17174 allocate( both_negative( &
17175 & answer_shape(1), &
17177 & answer_shape(2), &
17179 & answer_shape(3), &
17181 & answer_shape(4) ) &
17184 answer_negative = answer < 0.0_dp
17185 check_negative = check < 0.0_dp
17186 both_negative = answer_negative .and. check_negative
17187 if (.not. negative_support_on) both_negative = .false.
17189 judge = answer > check
17190 where (both_negative) judge = .not. judge
17192 judge_rev = .not. judge
17193 err_flag = any(judge_rev)
17195 pos = maxloc(mask_array, judge_rev)
17217 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
17219 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
17221 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
17223 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
17227 & trim(adjustl(pos_array(1))) //
',' // &
17229 & trim(adjustl(pos_array(2))) //
',' // &
17231 & trim(adjustl(pos_array(3))) //
',' // &
17233 & trim(adjustl(pos_array(4))) //
')'
17235 if ( both_negative( &
17244 abs_mes =
'ABSOLUTE value of'
17251 deallocate(mask_array, judge, judge_rev)
17252 deallocate(answer_negative, check_negative, both_negative)
17258 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17260 write(*,*)
' ' // trim(abs_mes) // &
17261 &
' check' // trim(pos_str) //
' = ', wrong
17262 write(*,*)
' is NOT LESS THAN'
17263 write(*,*)
' ' // trim(abs_mes) // &
17264 &
' answer' // trim(pos_str) //
' = ', right
17268 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
17272 end subroutine dctestassertlessthandouble4
17275 subroutine dctestassertlessthandouble5( &
17276 & message, answer, check, negative_support)
17280 character(*),
intent(in):: message
17281 real(DP),
intent(in):: answer(:,:,:,:,:)
17282 real(DP),
intent(in):: check(:,:,:,:,:)
17283 logical,
intent(in),
optional:: negative_support
17285 logical:: negative_support_on
17286 character(STRING):: pos_str
17287 character(TOKEN):: abs_mes
17288 real(DP):: wrong, right
17290 integer:: answer_shape(5), check_shape(5), pos(5)
17291 logical:: consist_shape(5)
17292 character(TOKEN):: pos_array(5)
17293 integer,
allocatable:: mask_array(:,:,:,:,:)
17294 logical,
allocatable:: judge(:,:,:,:,:)
17295 logical,
allocatable:: judge_rev(:,:,:,:,:)
17296 logical,
allocatable:: answer_negative(:,:,:,:,:)
17297 logical,
allocatable:: check_negative(:,:,:,:,:)
17298 logical,
allocatable:: both_negative(:,:,:,:,:)
17302 if (
present(negative_support))
then
17303 negative_support_on = negative_support
17305 negative_support_on = .true.
17311 answer_shape = shape(answer)
17312 check_shape = shape(check)
17314 consist_shape = answer_shape == check_shape
17316 if (.not. all(consist_shape))
then
17317 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17319 write(*,*)
' shape of check is (', check_shape,
')'
17320 write(*,*)
' is INCORRECT'
17321 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
17327 allocate( mask_array( &
17328 & answer_shape(1), &
17330 & answer_shape(2), &
17332 & answer_shape(3), &
17334 & answer_shape(4), &
17336 & answer_shape(5) ) &
17340 & answer_shape(1), &
17342 & answer_shape(2), &
17344 & answer_shape(3), &
17346 & answer_shape(4), &
17348 & answer_shape(5) ) &
17351 allocate( judge_rev( &
17352 & answer_shape(1), &
17354 & answer_shape(2), &
17356 & answer_shape(3), &
17358 & answer_shape(4), &
17360 & answer_shape(5) ) &
17363 allocate( answer_negative( &
17364 & answer_shape(1), &
17366 & answer_shape(2), &
17368 & answer_shape(3), &
17370 & answer_shape(4), &
17372 & answer_shape(5) ) &
17375 allocate( check_negative( &
17376 & answer_shape(1), &
17378 & answer_shape(2), &
17380 & answer_shape(3), &
17382 & answer_shape(4), &
17384 & answer_shape(5) ) &
17387 allocate( both_negative( &
17388 & answer_shape(1), &
17390 & answer_shape(2), &
17392 & answer_shape(3), &
17394 & answer_shape(4), &
17396 & answer_shape(5) ) &
17399 answer_negative = answer < 0.0_dp
17400 check_negative = check < 0.0_dp
17401 both_negative = answer_negative .and. check_negative
17402 if (.not. negative_support_on) both_negative = .false.
17404 judge = answer > check
17405 where (both_negative) judge = .not. judge
17407 judge_rev = .not. judge
17408 err_flag = any(judge_rev)
17410 pos = maxloc(mask_array, judge_rev)
17436 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
17438 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
17440 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
17442 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
17444 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
17448 & trim(adjustl(pos_array(1))) //
',' // &
17450 & trim(adjustl(pos_array(2))) //
',' // &
17452 & trim(adjustl(pos_array(3))) //
',' // &
17454 & trim(adjustl(pos_array(4))) //
',' // &
17456 & trim(adjustl(pos_array(5))) //
')'
17458 if ( both_negative( &
17469 abs_mes =
'ABSOLUTE value of'
17476 deallocate(mask_array, judge, judge_rev)
17477 deallocate(answer_negative, check_negative, both_negative)
17483 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17485 write(*,*)
' ' // trim(abs_mes) // &
17486 &
' check' // trim(pos_str) //
' = ', wrong
17487 write(*,*)
' is NOT LESS THAN'
17488 write(*,*)
' ' // trim(abs_mes) // &
17489 &
' answer' // trim(pos_str) //
' = ', right
17493 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
17497 end subroutine dctestassertlessthandouble5
17500 subroutine dctestassertlessthandouble6( &
17501 & message, answer, check, negative_support)
17505 character(*),
intent(in):: message
17506 real(DP),
intent(in):: answer(:,:,:,:,:,:)
17507 real(DP),
intent(in):: check(:,:,:,:,:,:)
17508 logical,
intent(in),
optional:: negative_support
17510 logical:: negative_support_on
17511 character(STRING):: pos_str
17512 character(TOKEN):: abs_mes
17513 real(DP):: wrong, right
17515 integer:: answer_shape(6), check_shape(6), pos(6)
17516 logical:: consist_shape(6)
17517 character(TOKEN):: pos_array(6)
17518 integer,
allocatable:: mask_array(:,:,:,:,:,:)
17519 logical,
allocatable:: judge(:,:,:,:,:,:)
17520 logical,
allocatable:: judge_rev(:,:,:,:,:,:)
17521 logical,
allocatable:: answer_negative(:,:,:,:,:,:)
17522 logical,
allocatable:: check_negative(:,:,:,:,:,:)
17523 logical,
allocatable:: both_negative(:,:,:,:,:,:)
17527 if (
present(negative_support))
then
17528 negative_support_on = negative_support
17530 negative_support_on = .true.
17536 answer_shape = shape(answer)
17537 check_shape = shape(check)
17539 consist_shape = answer_shape == check_shape
17541 if (.not. all(consist_shape))
then
17542 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17544 write(*,*)
' shape of check is (', check_shape,
')'
17545 write(*,*)
' is INCORRECT'
17546 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
17552 allocate( mask_array( &
17553 & answer_shape(1), &
17555 & answer_shape(2), &
17557 & answer_shape(3), &
17559 & answer_shape(4), &
17561 & answer_shape(5), &
17563 & answer_shape(6) ) &
17567 & answer_shape(1), &
17569 & answer_shape(2), &
17571 & answer_shape(3), &
17573 & answer_shape(4), &
17575 & answer_shape(5), &
17577 & answer_shape(6) ) &
17580 allocate( judge_rev( &
17581 & answer_shape(1), &
17583 & answer_shape(2), &
17585 & answer_shape(3), &
17587 & answer_shape(4), &
17589 & answer_shape(5), &
17591 & answer_shape(6) ) &
17594 allocate( answer_negative( &
17595 & answer_shape(1), &
17597 & answer_shape(2), &
17599 & answer_shape(3), &
17601 & answer_shape(4), &
17603 & answer_shape(5), &
17605 & answer_shape(6) ) &
17608 allocate( check_negative( &
17609 & answer_shape(1), &
17611 & answer_shape(2), &
17613 & answer_shape(3), &
17615 & answer_shape(4), &
17617 & answer_shape(5), &
17619 & answer_shape(6) ) &
17622 allocate( both_negative( &
17623 & answer_shape(1), &
17625 & answer_shape(2), &
17627 & answer_shape(3), &
17629 & answer_shape(4), &
17631 & answer_shape(5), &
17633 & answer_shape(6) ) &
17636 answer_negative = answer < 0.0_dp
17637 check_negative = check < 0.0_dp
17638 both_negative = answer_negative .and. check_negative
17639 if (.not. negative_support_on) both_negative = .false.
17641 judge = answer > check
17642 where (both_negative) judge = .not. judge
17644 judge_rev = .not. judge
17645 err_flag = any(judge_rev)
17647 pos = maxloc(mask_array, judge_rev)
17677 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
17679 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
17681 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
17683 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
17685 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
17687 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
17691 & trim(adjustl(pos_array(1))) //
',' // &
17693 & trim(adjustl(pos_array(2))) //
',' // &
17695 & trim(adjustl(pos_array(3))) //
',' // &
17697 & trim(adjustl(pos_array(4))) //
',' // &
17699 & trim(adjustl(pos_array(5))) //
',' // &
17701 & trim(adjustl(pos_array(6))) //
')'
17703 if ( both_negative( &
17716 abs_mes =
'ABSOLUTE value of'
17723 deallocate(mask_array, judge, judge_rev)
17724 deallocate(answer_negative, check_negative, both_negative)
17730 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17732 write(*,*)
' ' // trim(abs_mes) // &
17733 &
' check' // trim(pos_str) //
' = ', wrong
17734 write(*,*)
' is NOT LESS THAN'
17735 write(*,*)
' ' // trim(abs_mes) // &
17736 &
' answer' // trim(pos_str) //
' = ', right
17740 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
17744 end subroutine dctestassertlessthandouble6
17747 subroutine dctestassertlessthandouble7( &
17748 & message, answer, check, negative_support)
17752 character(*),
intent(in):: message
17753 real(DP),
intent(in):: answer(:,:,:,:,:,:,:)
17754 real(DP),
intent(in):: check(:,:,:,:,:,:,:)
17755 logical,
intent(in),
optional:: negative_support
17757 logical:: negative_support_on
17758 character(STRING):: pos_str
17759 character(TOKEN):: abs_mes
17760 real(DP):: wrong, right
17762 integer:: answer_shape(7), check_shape(7), pos(7)
17763 logical:: consist_shape(7)
17764 character(TOKEN):: pos_array(7)
17765 integer,
allocatable:: mask_array(:,:,:,:,:,:,:)
17766 logical,
allocatable:: judge(:,:,:,:,:,:,:)
17767 logical,
allocatable:: judge_rev(:,:,:,:,:,:,:)
17768 logical,
allocatable:: answer_negative(:,:,:,:,:,:,:)
17769 logical,
allocatable:: check_negative(:,:,:,:,:,:,:)
17770 logical,
allocatable:: both_negative(:,:,:,:,:,:,:)
17774 if (
present(negative_support))
then
17775 negative_support_on = negative_support
17777 negative_support_on = .true.
17783 answer_shape = shape(answer)
17784 check_shape = shape(check)
17786 consist_shape = answer_shape == check_shape
17788 if (.not. all(consist_shape))
then
17789 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
17791 write(*,*)
' shape of check is (', check_shape,
')'
17792 write(*,*)
' is INCORRECT'
17793 write(*,*)
' Correct shape of answer is (', answer_shape,
')'
17799 allocate( mask_array( &
17800 & answer_shape(1), &
17802 & answer_shape(2), &
17804 & answer_shape(3), &
17806 & answer_shape(4), &
17808 & answer_shape(5), &
17810 & answer_shape(6), &
17812 & answer_shape(7) ) &
17816 & answer_shape(1), &
17818 & answer_shape(2), &
17820 & answer_shape(3), &
17822 & answer_shape(4), &
17824 & answer_shape(5), &
17826 & answer_shape(6), &
17828 & answer_shape(7) ) &
17831 allocate( judge_rev( &
17832 & answer_shape(1), &
17834 & answer_shape(2), &
17836 & answer_shape(3), &
17838 & answer_shape(4), &
17840 & answer_shape(5), &
17842 & answer_shape(6), &
17844 & answer_shape(7) ) &
17847 allocate( answer_negative( &
17848 & answer_shape(1), &
17850 & answer_shape(2), &
17852 & answer_shape(3), &
17854 & answer_shape(4), &
17856 & answer_shape(5), &
17858 & answer_shape(6), &
17860 & answer_shape(7) ) &
17863 allocate( check_negative( &
17864 & answer_shape(1), &
17866 & answer_shape(2), &
17868 & answer_shape(3), &
17870 & answer_shape(4), &
17872 & answer_shape(5), &
17874 & answer_shape(6), &
17876 & answer_shape(7) ) &
17879 allocate( both_negative( &
17880 & answer_shape(1), &
17882 & answer_shape(2), &
17884 & answer_shape(3), &
17886 & answer_shape(4), &
17888 & answer_shape(5), &
17890 & answer_shape(6), &
17892 & answer_shape(7) ) &
17895 answer_negative = answer < 0.0_dp
17896 check_negative = check < 0.0_dp
17897 both_negative = answer_negative .and. check_negative
17898 if (.not. negative_support_on) both_negative = .false.
17900 judge = answer > check
17901 where (both_negative) judge = .not. judge
17903 judge_rev = .not. judge
17904 err_flag = any(judge_rev)
17906 pos = maxloc(mask_array, judge_rev)
17940 write(unit=pos_array(1), fmt=
"(i20)") pos(1)
17942 write(unit=pos_array(2), fmt=
"(i20)") pos(2)
17944 write(unit=pos_array(3), fmt=
"(i20)") pos(3)
17946 write(unit=pos_array(4), fmt=
"(i20)") pos(4)
17948 write(unit=pos_array(5), fmt=
"(i20)") pos(5)
17950 write(unit=pos_array(6), fmt=
"(i20)") pos(6)
17952 write(unit=pos_array(7), fmt=
"(i20)") pos(7)
17956 & trim(adjustl(pos_array(1))) //
',' // &
17958 & trim(adjustl(pos_array(2))) //
',' // &
17960 & trim(adjustl(pos_array(3))) //
',' // &
17962 & trim(adjustl(pos_array(4))) //
',' // &
17964 & trim(adjustl(pos_array(5))) //
',' // &
17966 & trim(adjustl(pos_array(6))) //
',' // &
17968 & trim(adjustl(pos_array(7))) //
')'
17970 if ( both_negative( &
17985 abs_mes =
'ABSOLUTE value of'
17992 deallocate(mask_array, judge, judge_rev)
17993 deallocate(answer_negative, check_negative, both_negative)
17999 write(*,*)
' *** Error [AssertLT] *** Checking ' // trim(message) //
' FAILURE'
18001 write(*,*)
' ' // trim(abs_mes) // &
18002 &
' check' // trim(pos_str) //
' = ', wrong
18003 write(*,*)
' is NOT LESS THAN'
18004 write(*,*)
' ' // trim(abs_mes) // &
18005 &
' answer' // trim(pos_str) //
' = ', right
18009 write(*,*)
' *** MESSAGE [AssertLT] *** Checking ' // trim(message) //
' OK'
18013 end subroutine dctestassertlessthandouble7
Support making test programs .
Provides kind type parameter values.
integer, parameter, public token
Character length for word, token
integer, parameter, public dp
Double Precision Real number
integer, parameter, public string
Character length for string
Provides interface for system dependent procedures.
subroutine, public abortprogram(message)
Abort program execution.