Public Instance methods
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | character(*), intent(in)
|
check : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar0
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | integer, intent(in)
|
check : | integer, intent(in)
|
Alias for DCTestAssertEqualInt0
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | logical, intent(in)
|
check : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical0
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble0
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
Alias for DCTestAssertEqualReal0
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | character(*), intent(in)
|
check(:) : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar1
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | integer, intent(in)
|
check(:) : | integer, intent(in)
|
Alias for DCTestAssertEqualInt1
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | logical, intent(in)
|
check(:) : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical1
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble1
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
Alias for DCTestAssertEqualReal1
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | character(*), intent(in)
|
check(:,:) : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar2
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | integer, intent(in)
|
check(:,:) : | integer, intent(in)
|
Alias for DCTestAssertEqualInt2
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | logical, intent(in)
|
check(:,:) : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical2
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble2
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
Alias for DCTestAssertEqualReal2
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | character(*), intent(in)
|
check(:,:,:) : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar3
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | integer, intent(in)
|
check(:,:,:) : | integer, intent(in)
|
Alias for DCTestAssertEqualInt3
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | logical, intent(in)
|
check(:,:,:) : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical3
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble3
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
Alias for DCTestAssertEqualReal3
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:) : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar4
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:) : | integer, intent(in)
|
Alias for DCTestAssertEqualInt4
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:) : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical4
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble4
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
Alias for DCTestAssertEqualReal4
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:,:) : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar5
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:) : | integer, intent(in)
|
Alias for DCTestAssertEqualInt5
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:,:) : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical5
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble5
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
Alias for DCTestAssertEqualReal5
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:,:,:) : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar6
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:) : | integer, intent(in)
|
Alias for DCTestAssertEqualInt6
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:,:,:) : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical6
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble6
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
Alias for DCTestAssertEqualReal6
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:,:,:,:) : | character(*), intent(in)
|
Alias for DCTestAssertEqualChar7
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:,:) : | integer, intent(in)
|
Alias for DCTestAssertEqualInt7
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:,:,:,:) : | logical, intent(in)
|
Alias for DCTestAssertEqualLogical7
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
Alias for DCTestAssertEqualDouble7
AssertEqual( message, answer, check )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
Alias for DCTestAssertEqualReal7
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble0Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal0Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble1Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal1Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble2Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal2Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble3Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal3Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble4Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal4Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble5Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal5Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble6Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal6Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualDouble7Digits
AssertEqual( message, answer, check, significant_digits, ignore_digits )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
Alias for DCTestAssertEqualReal7Digits
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | integer, intent(in)
|
check : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt0
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble0
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal0
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | integer, intent(in)
|
check(:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt1
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble1
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal1
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | integer, intent(in)
|
check(:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt2
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble2
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal2
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | integer, intent(in)
|
check(:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt3
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble3
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal3
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt4
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble4
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal4
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt5
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble5
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal5
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt6
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble6
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal6
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanInt7
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanDouble7
AssertGreaterThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertGreaterThanReal7
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | integer, intent(in)
|
check : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt0
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble0
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal0
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | integer, intent(in)
|
check(:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt1
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble1
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal1
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | integer, intent(in)
|
check(:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt2
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble2
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal2
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | integer, intent(in)
|
check(:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt3
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble3
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal3
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt4
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble4
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal4
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt5
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble5
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal5
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt6
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble6
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal6
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanInt7
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanDouble7
AssertLessThan( message, answer, check, [negative_support] )
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
Alias for DCTestAssertLessThanReal7
Private Instance methods
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | character(*), intent(in)
|
check : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar0(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer
character(*), intent(in):: check
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
continue
err_flag = .false.
err_flag = .not. trim(answer) == trim(check)
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | character(*), intent(in)
|
check(:) : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar1(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer(:)
character(*), intent(in):: check(:)
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
character(STRING), allocatable:: answer_fixed_length(:)
character(STRING), allocatable:: check_fixed_length(:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_fixed_length ( answer_shape(1) ) )
allocate( check_fixed_length ( check_shape(1) ) )
answer_fixed_length = answer
check_fixed_length = check
judge = answer_fixed_length == check_fixed_length
deallocate(answer_fixed_length, check_fixed_length)
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | character(*), intent(in)
|
check(:,:) : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar2(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer(:,:)
character(*), intent(in):: check(:,:)
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
character(STRING), allocatable:: answer_fixed_length(:,:)
character(STRING), allocatable:: check_fixed_length(:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_fixed_length ( answer_shape(1), answer_shape(2) ) )
allocate( check_fixed_length ( check_shape(1), check_shape(2) ) )
answer_fixed_length = answer
check_fixed_length = check
judge = answer_fixed_length == check_fixed_length
deallocate(answer_fixed_length, check_fixed_length)
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | character(*), intent(in)
|
check(:,:,:) : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar3(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer(:,:,:)
character(*), intent(in):: check(:,:,:)
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
character(STRING), allocatable:: answer_fixed_length(:,:,:)
character(STRING), allocatable:: check_fixed_length(:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_fixed_length ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_fixed_length ( check_shape(1), check_shape(2), check_shape(3) ) )
answer_fixed_length = answer
check_fixed_length = check
judge = answer_fixed_length == check_fixed_length
deallocate(answer_fixed_length, check_fixed_length)
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:) : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar4(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer(:,:,:,:)
character(*), intent(in):: check(:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
character(STRING), allocatable:: answer_fixed_length(:,:,:,:)
character(STRING), allocatable:: check_fixed_length(:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_fixed_length ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_fixed_length ( check_shape(1), check_shape(2), check_shape(3), check_shape(4) ) )
answer_fixed_length = answer
check_fixed_length = check
judge = answer_fixed_length == check_fixed_length
deallocate(answer_fixed_length, check_fixed_length)
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:,:) : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar5(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer(:,:,:,:,:)
character(*), intent(in):: check(:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
character(STRING), allocatable:: answer_fixed_length(:,:,:,:,:)
character(STRING), allocatable:: check_fixed_length(:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_fixed_length ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_fixed_length ( check_shape(1), check_shape(2), check_shape(3), check_shape(4), check_shape(5) ) )
answer_fixed_length = answer
check_fixed_length = check
judge = answer_fixed_length == check_fixed_length
deallocate(answer_fixed_length, check_fixed_length)
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:,:,:) : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar6(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer(:,:,:,:,:,:)
character(*), intent(in):: check(:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
character(STRING), allocatable:: answer_fixed_length(:,:,:,:,:,:)
character(STRING), allocatable:: check_fixed_length(:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_fixed_length ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_fixed_length ( check_shape(1), check_shape(2), check_shape(3), check_shape(4), check_shape(5), check_shape(6) ) )
answer_fixed_length = answer
check_fixed_length = check
judge = answer_fixed_length == check_fixed_length
deallocate(answer_fixed_length, check_fixed_length)
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | character(*), intent(in)
|
check(:,:,:,:,:,:,:) : | character(*), intent(in)
|
[Source]
subroutine DCTestAssertEqualChar7(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
character(*), intent(in):: answer(:,:,:,:,:,:,:)
character(*), intent(in):: check(:,:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
character(STRING):: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
character(STRING), allocatable:: answer_fixed_length(:,:,:,:,:,:,:)
character(STRING), allocatable:: check_fixed_length(:,:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_fixed_length ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_fixed_length ( check_shape(1), check_shape(2), check_shape(3), check_shape(4), check_shape(5), check_shape(6), check_shape(7) ) )
answer_fixed_length = answer
check_fixed_length = check
judge = answer_fixed_length == check_fixed_length
deallocate(answer_fixed_length, check_fixed_length)
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', trim(wrong)
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', trim(right)
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualChar7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble0(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer
real(DP), intent(in):: check
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
continue
err_flag = .false.
err_flag = .not. answer == check
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble0
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble0Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer
real(DP), intent(in):: check
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
real(DP):: answer_max
real(DP):: answer_min
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
if ( answer < 0.0_DP .and. check < 0.0_DP ) then
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
else
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end if
wrong = check
right_max = answer_max
right_min = answer_min
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
err_flag = .not. (answer_max > check .and. check > answer_min)
pos_str = ''
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble0Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble1(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:)
real(DP), intent(in):: check(:)
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble1Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:)
real(DP), intent(in):: check(:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
real(DP), allocatable:: answer_max(:)
real(DP), allocatable:: answer_min(:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
allocate( answer_max ( answer_shape(1) ) )
allocate( answer_min ( answer_shape(1) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right_max = answer_max ( pos(1) )
right_min = answer_min ( pos(1) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble1Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble2(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:)
real(DP), intent(in):: check(:,:)
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble2Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:)
real(DP), intent(in):: check(:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
real(DP), allocatable:: answer_max(:,:)
real(DP), allocatable:: answer_min(:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right_max = answer_max ( pos(1), pos(2) )
right_min = answer_min ( pos(1), pos(2) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble2Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble3(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:)
real(DP), intent(in):: check(:,:,:)
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble3Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:)
real(DP), intent(in):: check(:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
real(DP), allocatable:: answer_max(:,:,:)
real(DP), allocatable:: answer_min(:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right_max = answer_max ( pos(1), pos(2), pos(3) )
right_min = answer_min ( pos(1), pos(2), pos(3) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble3Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble4(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:)
real(DP), intent(in):: check(:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble4Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:)
real(DP), intent(in):: check(:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
real(DP), allocatable:: answer_max(:,:,:,:)
real(DP), allocatable:: answer_min(:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble4Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble5(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble5Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
real(DP), allocatable:: answer_max(:,:,:,:,:)
real(DP), allocatable:: answer_min(:,:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4), pos(5) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble5Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble6(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble6Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
real(DP), allocatable:: answer_max(:,:,:,:,:,:)
real(DP), allocatable:: answer_min(:,:,:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble6Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble7(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble7
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualDouble7Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real(DP):: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real(DP):: right_tmp
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
real(DP), allocatable:: answer_max(:,:,:,:,:,:,:)
real(DP), allocatable:: answer_min(:,:,:,:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0_DP + 0.1_DP ** significant_digits ) + 0.1_DP ** (- ignore_digits)
answer_min = answer * ( 1.0_DP - 0.1_DP ** significant_digits ) - 0.1_DP ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualDouble7Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | integer, intent(in)
|
check : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt0(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer
integer, intent(in):: check
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
continue
err_flag = .false.
err_flag = .not. answer == check
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | integer, intent(in)
|
check(:) : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt1(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:)
integer, intent(in):: check(:)
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | integer, intent(in)
|
check(:,:) : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt2(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:)
integer, intent(in):: check(:,:)
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | integer, intent(in)
|
check(:,:,:) : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt3(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:)
integer, intent(in):: check(:,:,:)
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:) : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt4(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:)
integer, intent(in):: check(:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:) : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt5(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:) : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt6(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:,:) : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualInt7(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
integer:: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualInt7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | logical, intent(in)
|
check : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical0(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer
logical, intent(in):: check
character(STRING):: answer_str
character(STRING):: check_str
continue
if (answer) then
answer_str = ".true."
else
answer_str = ".false."
end if
if (check) then
check_str = ".true."
else
check_str = ".false."
end if
call DCTestAssertEqualChar0(message, answer_str, check_str)
end subroutine DCTestAssertEqualLogical0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | logical, intent(in)
|
check(:) : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical1(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer(:)
logical, intent(in):: check(:)
integer:: answer_shape(1), check_shape(1), i
logical, allocatable:: answer_tmp(:), check_tmp(:)
character(STRING), allocatable:: answer_str_tmp(:), check_str_tmp(:)
character(STRING), allocatable:: answer_str(:)
character(STRING), allocatable:: check_str(:)
continue
allocate(answer_tmp(size(answer)))
allocate(check_tmp(size(check)))
allocate(answer_str_tmp(size(answer)))
allocate(check_str_tmp(size(check)))
answer_tmp = pack(answer, .true.)
check_tmp = pack(check, .true.)
do i = 1, size(answer_tmp)
if (answer_tmp(i)) then
answer_str_tmp(i) = '.true.'
else
answer_str_tmp(i) = '.false.'
end if
end do
do i = 1, size(check_tmp)
if (check_tmp(i)) then
check_str_tmp(i) = '.true.'
else
check_str_tmp(i) = '.false.'
end if
end do
answer_shape = shape(answer)
check_shape = shape(check)
allocate( answer_str ( answer_shape(1) ) )
allocate( check_str ( check_shape(1) ) )
answer_str = reshape(answer_str_tmp, answer_shape)
check_str = reshape(check_str_tmp, check_shape)
call DCTestAssertEqualChar1(message, answer_str, check_str)
deallocate(answer_str, answer_tmp, answer_str_tmp)
deallocate(check_str, check_tmp, check_str_tmp)
end subroutine DCTestAssertEqualLogical1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | logical, intent(in)
|
check(:,:) : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical2(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer(:,:)
logical, intent(in):: check(:,:)
integer:: answer_shape(2), check_shape(2), i
logical, allocatable:: answer_tmp(:), check_tmp(:)
character(STRING), allocatable:: answer_str_tmp(:), check_str_tmp(:)
character(STRING), allocatable:: answer_str(:,:)
character(STRING), allocatable:: check_str(:,:)
continue
allocate(answer_tmp(size(answer)))
allocate(check_tmp(size(check)))
allocate(answer_str_tmp(size(answer)))
allocate(check_str_tmp(size(check)))
answer_tmp = pack(answer, .true.)
check_tmp = pack(check, .true.)
do i = 1, size(answer_tmp)
if (answer_tmp(i)) then
answer_str_tmp(i) = '.true.'
else
answer_str_tmp(i) = '.false.'
end if
end do
do i = 1, size(check_tmp)
if (check_tmp(i)) then
check_str_tmp(i) = '.true.'
else
check_str_tmp(i) = '.false.'
end if
end do
answer_shape = shape(answer)
check_shape = shape(check)
allocate( answer_str ( answer_shape(1), answer_shape(2) ) )
allocate( check_str ( check_shape(1), check_shape(2) ) )
answer_str = reshape(answer_str_tmp, answer_shape)
check_str = reshape(check_str_tmp, check_shape)
call DCTestAssertEqualChar2(message, answer_str, check_str)
deallocate(answer_str, answer_tmp, answer_str_tmp)
deallocate(check_str, check_tmp, check_str_tmp)
end subroutine DCTestAssertEqualLogical2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | logical, intent(in)
|
check(:,:,:) : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical3(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer(:,:,:)
logical, intent(in):: check(:,:,:)
integer:: answer_shape(3), check_shape(3), i
logical, allocatable:: answer_tmp(:), check_tmp(:)
character(STRING), allocatable:: answer_str_tmp(:), check_str_tmp(:)
character(STRING), allocatable:: answer_str(:,:,:)
character(STRING), allocatable:: check_str(:,:,:)
continue
allocate(answer_tmp(size(answer)))
allocate(check_tmp(size(check)))
allocate(answer_str_tmp(size(answer)))
allocate(check_str_tmp(size(check)))
answer_tmp = pack(answer, .true.)
check_tmp = pack(check, .true.)
do i = 1, size(answer_tmp)
if (answer_tmp(i)) then
answer_str_tmp(i) = '.true.'
else
answer_str_tmp(i) = '.false.'
end if
end do
do i = 1, size(check_tmp)
if (check_tmp(i)) then
check_str_tmp(i) = '.true.'
else
check_str_tmp(i) = '.false.'
end if
end do
answer_shape = shape(answer)
check_shape = shape(check)
allocate( answer_str ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_str ( check_shape(1), check_shape(2), check_shape(3) ) )
answer_str = reshape(answer_str_tmp, answer_shape)
check_str = reshape(check_str_tmp, check_shape)
call DCTestAssertEqualChar3(message, answer_str, check_str)
deallocate(answer_str, answer_tmp, answer_str_tmp)
deallocate(check_str, check_tmp, check_str_tmp)
end subroutine DCTestAssertEqualLogical3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:) : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical4(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer(:,:,:,:)
logical, intent(in):: check(:,:,:,:)
integer:: answer_shape(4), check_shape(4), i
logical, allocatable:: answer_tmp(:), check_tmp(:)
character(STRING), allocatable:: answer_str_tmp(:), check_str_tmp(:)
character(STRING), allocatable:: answer_str(:,:,:,:)
character(STRING), allocatable:: check_str(:,:,:,:)
continue
allocate(answer_tmp(size(answer)))
allocate(check_tmp(size(check)))
allocate(answer_str_tmp(size(answer)))
allocate(check_str_tmp(size(check)))
answer_tmp = pack(answer, .true.)
check_tmp = pack(check, .true.)
do i = 1, size(answer_tmp)
if (answer_tmp(i)) then
answer_str_tmp(i) = '.true.'
else
answer_str_tmp(i) = '.false.'
end if
end do
do i = 1, size(check_tmp)
if (check_tmp(i)) then
check_str_tmp(i) = '.true.'
else
check_str_tmp(i) = '.false.'
end if
end do
answer_shape = shape(answer)
check_shape = shape(check)
allocate( answer_str ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_str ( check_shape(1), check_shape(2), check_shape(3), check_shape(4) ) )
answer_str = reshape(answer_str_tmp, answer_shape)
check_str = reshape(check_str_tmp, check_shape)
call DCTestAssertEqualChar4(message, answer_str, check_str)
deallocate(answer_str, answer_tmp, answer_str_tmp)
deallocate(check_str, check_tmp, check_str_tmp)
end subroutine DCTestAssertEqualLogical4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:,:) : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical5(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer(:,:,:,:,:)
logical, intent(in):: check(:,:,:,:,:)
integer:: answer_shape(5), check_shape(5), i
logical, allocatable:: answer_tmp(:), check_tmp(:)
character(STRING), allocatable:: answer_str_tmp(:), check_str_tmp(:)
character(STRING), allocatable:: answer_str(:,:,:,:,:)
character(STRING), allocatable:: check_str(:,:,:,:,:)
continue
allocate(answer_tmp(size(answer)))
allocate(check_tmp(size(check)))
allocate(answer_str_tmp(size(answer)))
allocate(check_str_tmp(size(check)))
answer_tmp = pack(answer, .true.)
check_tmp = pack(check, .true.)
do i = 1, size(answer_tmp)
if (answer_tmp(i)) then
answer_str_tmp(i) = '.true.'
else
answer_str_tmp(i) = '.false.'
end if
end do
do i = 1, size(check_tmp)
if (check_tmp(i)) then
check_str_tmp(i) = '.true.'
else
check_str_tmp(i) = '.false.'
end if
end do
answer_shape = shape(answer)
check_shape = shape(check)
allocate( answer_str ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_str ( check_shape(1), check_shape(2), check_shape(3), check_shape(4), check_shape(5) ) )
answer_str = reshape(answer_str_tmp, answer_shape)
check_str = reshape(check_str_tmp, check_shape)
call DCTestAssertEqualChar5(message, answer_str, check_str)
deallocate(answer_str, answer_tmp, answer_str_tmp)
deallocate(check_str, check_tmp, check_str_tmp)
end subroutine DCTestAssertEqualLogical5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:,:,:) : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical6(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer(:,:,:,:,:,:)
logical, intent(in):: check(:,:,:,:,:,:)
integer:: answer_shape(6), check_shape(6), i
logical, allocatable:: answer_tmp(:), check_tmp(:)
character(STRING), allocatable:: answer_str_tmp(:), check_str_tmp(:)
character(STRING), allocatable:: answer_str(:,:,:,:,:,:)
character(STRING), allocatable:: check_str(:,:,:,:,:,:)
continue
allocate(answer_tmp(size(answer)))
allocate(check_tmp(size(check)))
allocate(answer_str_tmp(size(answer)))
allocate(check_str_tmp(size(check)))
answer_tmp = pack(answer, .true.)
check_tmp = pack(check, .true.)
do i = 1, size(answer_tmp)
if (answer_tmp(i)) then
answer_str_tmp(i) = '.true.'
else
answer_str_tmp(i) = '.false.'
end if
end do
do i = 1, size(check_tmp)
if (check_tmp(i)) then
check_str_tmp(i) = '.true.'
else
check_str_tmp(i) = '.false.'
end if
end do
answer_shape = shape(answer)
check_shape = shape(check)
allocate( answer_str ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_str ( check_shape(1), check_shape(2), check_shape(3), check_shape(4), check_shape(5), check_shape(6) ) )
answer_str = reshape(answer_str_tmp, answer_shape)
check_str = reshape(check_str_tmp, check_shape)
call DCTestAssertEqualChar6(message, answer_str, check_str)
deallocate(answer_str, answer_tmp, answer_str_tmp)
deallocate(check_str, check_tmp, check_str_tmp)
end subroutine DCTestAssertEqualLogical6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | logical, intent(in)
|
check(:,:,:,:,:,:,:) : | logical, intent(in)
|
[Source]
subroutine DCTestAssertEqualLogical7(message, answer, check)
use dc_types, only: STRING
implicit none
character(*), intent(in):: message
logical, intent(in):: answer(:,:,:,:,:,:,:)
logical, intent(in):: check(:,:,:,:,:,:,:)
integer:: answer_shape(7), check_shape(7), i
logical, allocatable:: answer_tmp(:), check_tmp(:)
character(STRING), allocatable:: answer_str_tmp(:), check_str_tmp(:)
character(STRING), allocatable:: answer_str(:,:,:,:,:,:,:)
character(STRING), allocatable:: check_str(:,:,:,:,:,:,:)
continue
allocate(answer_tmp(size(answer)))
allocate(check_tmp(size(check)))
allocate(answer_str_tmp(size(answer)))
allocate(check_str_tmp(size(check)))
answer_tmp = pack(answer, .true.)
check_tmp = pack(check, .true.)
do i = 1, size(answer_tmp)
if (answer_tmp(i)) then
answer_str_tmp(i) = '.true.'
else
answer_str_tmp(i) = '.false.'
end if
end do
do i = 1, size(check_tmp)
if (check_tmp(i)) then
check_str_tmp(i) = '.true.'
else
check_str_tmp(i) = '.false.'
end if
end do
answer_shape = shape(answer)
check_shape = shape(check)
allocate( answer_str ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_str ( check_shape(1), check_shape(2), check_shape(3), check_shape(4), check_shape(5), check_shape(6), check_shape(7) ) )
answer_str = reshape(answer_str_tmp, answer_shape)
check_str = reshape(check_str_tmp, check_shape)
call DCTestAssertEqualChar7(message, answer_str, check_str)
deallocate(answer_str, answer_tmp, answer_str_tmp)
deallocate(check_str, check_tmp, check_str_tmp)
end subroutine DCTestAssertEqualLogical7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal0(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer
real, intent(in):: check
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
continue
err_flag = .false.
err_flag = .not. answer == check
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal0
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal0Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer
real, intent(in):: check
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
real:: answer_max
real:: answer_min
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
if ( answer < 0.0 .and. check < 0.0 ) then
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
else
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end if
wrong = check
right_max = answer_max
right_min = answer_min
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
err_flag = .not. (answer_max > check .and. check > answer_min)
pos_str = ''
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal0Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal1(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:)
real, intent(in):: check(:)
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal1Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:)
real, intent(in):: check(:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
real, allocatable:: answer_max(:)
real, allocatable:: answer_min(:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
allocate( answer_max ( answer_shape(1) ) )
allocate( answer_min ( answer_shape(1) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right_max = answer_max ( pos(1) )
right_min = answer_min ( pos(1) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal1Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal2(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:)
real, intent(in):: check(:,:)
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal2Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:)
real, intent(in):: check(:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
real, allocatable:: answer_max(:,:)
real, allocatable:: answer_min(:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right_max = answer_max ( pos(1), pos(2) )
right_min = answer_min ( pos(1), pos(2) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal2Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal3(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:)
real, intent(in):: check(:,:,:)
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal3Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:)
real, intent(in):: check(:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
real, allocatable:: answer_max(:,:,:)
real, allocatable:: answer_min(:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right_max = answer_max ( pos(1), pos(2), pos(3) )
right_min = answer_min ( pos(1), pos(2), pos(3) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal3Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal4(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:)
real, intent(in):: check(:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal4Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:)
real, intent(in):: check(:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
real, allocatable:: answer_max(:,:,:,:)
real, allocatable:: answer_min(:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal4Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal5(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal5Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
real, allocatable:: answer_max(:,:,:,:,:)
real, allocatable:: answer_min(:,:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4), pos(5) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal5Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal6(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal6Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
real, allocatable:: answer_max(:,:,:,:,:,:)
real, allocatable:: answer_min(:,:,:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal6Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal7(message, answer, check)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:,:)
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
continue
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
judge = answer == check
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
if (err_flag) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal7
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
significant_digits : | integer, intent(in)
|
ignore_digits : | integer, intent(in)
|
[Source]
subroutine DCTestAssertEqualReal7Digits( message, answer, check, significant_digits, ignore_digits )
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:,:)
integer, intent(in):: significant_digits
integer, intent(in):: ignore_digits
logical:: err_flag
character(STRING):: pos_str
real:: wrong, right_max, right_min
character(STRING):: pos_str_space
integer:: pos_str_len
real:: right_tmp
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
real, allocatable:: answer_max(:,:,:,:,:,:,:)
real, allocatable:: answer_min(:,:,:,:,:,:,:)
continue
err_flag = .false.
if ( significant_digits < 1 ) then
write(*,*) ' *** Error [AssertEQ] *** '
write(*,*) ' Specify a number more than 1 to "significant_digits"'
call AbortProgram('')
end if
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_max ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_min ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
where (both_negative)
answer_max = answer * ( 1.0 - 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 + 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
elsewhere
answer_max = answer * ( 1.0 + 0.1 ** significant_digits ) + 0.1 ** (- ignore_digits)
answer_min = answer * ( 1.0 - 0.1 ** significant_digits ) - 0.1 ** (- ignore_digits)
end where
judge = answer_max > check .and. check > answer_min
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right_max = answer_max ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right_min = answer_min ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
if ( right_max < right_min ) then
right_tmp = right_max
right_max = right_min
right_min = right_tmp
end if
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
deallocate(answer_max, answer_min)
if (err_flag) then
pos_str_space = ''
pos_str_len = len_trim(pos_str)
write(*,*) ' *** Error [AssertEQ] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT EQUAL to'
write(*,*) ' ' // pos_str_space(1:pos_str_len) // ' ', right_min, ' < '
write(*,*) ' answer' // trim(pos_str) // ' < ', right_max
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertEQ] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertEqualReal7Digits
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble0( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer
real(DP), intent(in):: check
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
err_flag = .not. answer < check
abs_mes = ''
if ( answer < 0.0_DP .and. check < 0.0_DP .and. negative_support_on ) then
err_flag = .not. err_flag
abs_mes = 'ABSOLUTE value of'
end if
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble1( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:)
real(DP), intent(in):: check(:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
if ( both_negative ( pos(1) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble2( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:)
real(DP), intent(in):: check(:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
if ( both_negative ( pos(1), pos(2) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble3( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:)
real(DP), intent(in):: check(:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble4( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:)
real(DP), intent(in):: check(:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble5( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble6( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanDouble7( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanDouble7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | integer, intent(in)
|
check : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt0( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer
integer, intent(in):: check
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
err_flag = .not. answer < check
abs_mes = ''
if ( answer < 0 .and. check < 0 .and. negative_support_on ) then
err_flag = .not. err_flag
abs_mes = 'ABSOLUTE value of'
end if
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | integer, intent(in)
|
check(:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt1( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:)
integer, intent(in):: check(:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
if ( both_negative ( pos(1) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | integer, intent(in)
|
check(:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt2( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:)
integer, intent(in):: check(:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
if ( both_negative ( pos(1), pos(2) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | integer, intent(in)
|
check(:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt3( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:)
integer, intent(in):: check(:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt4( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:)
integer, intent(in):: check(:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt5( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt6( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanInt7( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanInt7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal0( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer
real, intent(in):: check
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
err_flag = .not. answer < check
abs_mes = ''
if ( answer < 0.0 .and. check < 0.0 .and. negative_support_on ) then
err_flag = .not. err_flag
abs_mes = 'ABSOLUTE value of'
end if
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal1( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:)
real, intent(in):: check(:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
if ( both_negative ( pos(1) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal2( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:)
real, intent(in):: check(:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
if ( both_negative ( pos(1), pos(2) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal3( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:)
real, intent(in):: check(:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal4( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:)
real, intent(in):: check(:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal5( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal6( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertGreaterThanReal7( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer < check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertGT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT GREATER THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertGT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertGreaterThanReal7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real(DP), intent(in)
|
check : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble0( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer
real(DP), intent(in):: check
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
err_flag = .not. answer > check
abs_mes = ''
if ( answer < 0.0_DP .and. check < 0.0_DP .and. negative_support_on ) then
err_flag = .not. err_flag
abs_mes = 'ABSOLUTE value of'
end if
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real(DP), intent(in)
|
check(:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble1( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:)
real(DP), intent(in):: check(:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
if ( both_negative ( pos(1) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real(DP), intent(in)
|
check(:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble2( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:)
real(DP), intent(in):: check(:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
if ( both_negative ( pos(1), pos(2) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real(DP), intent(in)
|
check(:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble3( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:)
real(DP), intent(in):: check(:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble4( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:)
real(DP), intent(in):: check(:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble5( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble6( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
check(:,:,:,:,:,:,:) : | real(DP), intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanDouble7( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real(DP), intent(in):: answer(:,:,:,:,:,:,:)
real(DP), intent(in):: check(:,:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real(DP):: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0.0_DP
check_negative = check < 0.0_DP
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanDouble7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | integer, intent(in)
|
check : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt0( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer
integer, intent(in):: check
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
err_flag = .not. answer > check
abs_mes = ''
if ( answer < 0 .and. check < 0 .and. negative_support_on ) then
err_flag = .not. err_flag
abs_mes = 'ABSOLUTE value of'
end if
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | integer, intent(in)
|
check(:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt1( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:)
integer, intent(in):: check(:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
if ( both_negative ( pos(1) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | integer, intent(in)
|
check(:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt2( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:)
integer, intent(in):: check(:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
if ( both_negative ( pos(1), pos(2) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | integer, intent(in)
|
check(:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt3( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:)
integer, intent(in):: check(:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt4( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:)
integer, intent(in):: check(:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt5( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt6( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | integer, intent(in)
|
check(:,:,:,:,:,:,:) : | integer, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanInt7( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
integer, intent(in):: answer(:,:,:,:,:,:,:)
integer, intent(in):: check(:,:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
integer:: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0
check_negative = check < 0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanInt7
Subroutine : |
|
message : | character(*), intent(in)
|
answer : | real, intent(in)
|
check : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal0( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer
real, intent(in):: check
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
err_flag = .not. answer > check
abs_mes = ''
if ( answer < 0.0 .and. check < 0.0 .and. negative_support_on ) then
err_flag = .not. err_flag
abs_mes = 'ABSOLUTE value of'
end if
wrong = check
right = answer
pos_str = ''
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal0
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:) : | real, intent(in)
|
check(:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal1( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:)
real, intent(in):: check(:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(1), check_shape(1), pos(1)
logical:: consist_shape(1)
character(TOKEN):: pos_array(1)
integer, allocatable:: mask_array(:)
logical, allocatable:: judge(:)
logical, allocatable:: judge_rev(:)
logical, allocatable:: answer_negative(:)
logical, allocatable:: check_negative(:)
logical, allocatable:: both_negative(:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1) ) )
allocate( judge ( answer_shape(1) ) )
allocate( judge_rev ( answer_shape(1) ) )
allocate( answer_negative ( answer_shape(1) ) )
allocate( check_negative ( answer_shape(1) ) )
allocate( both_negative ( answer_shape(1) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1) )
right = answer ( pos(1) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
pos_str = '(' // trim(adjustl(pos_array(1))) // ')'
if ( both_negative ( pos(1) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal1
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:) : | real, intent(in)
|
check(:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal2( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:)
real, intent(in):: check(:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(2), check_shape(2), pos(2)
logical:: consist_shape(2)
character(TOKEN):: pos_array(2)
integer, allocatable:: mask_array(:,:)
logical, allocatable:: judge(:,:)
logical, allocatable:: judge_rev(:,:)
logical, allocatable:: answer_negative(:,:)
logical, allocatable:: check_negative(:,:)
logical, allocatable:: both_negative(:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2) ) )
allocate( judge ( answer_shape(1), answer_shape(2) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2) )
right = answer ( pos(1), pos(2) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ')'
if ( both_negative ( pos(1), pos(2) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal2
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:) : | real, intent(in)
|
check(:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal3( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:)
real, intent(in):: check(:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(3), check_shape(3), pos(3)
logical:: consist_shape(3)
character(TOKEN):: pos_array(3)
integer, allocatable:: mask_array(:,:,:)
logical, allocatable:: judge(:,:,:)
logical, allocatable:: judge_rev(:,:,:)
logical, allocatable:: answer_negative(:,:,:)
logical, allocatable:: check_negative(:,:,:)
logical, allocatable:: both_negative(:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3) )
right = answer ( pos(1), pos(2), pos(3) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal3
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:) : | real, intent(in)
|
check(:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal4( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:)
real, intent(in):: check(:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(4), check_shape(4), pos(4)
logical:: consist_shape(4)
character(TOKEN):: pos_array(4)
integer, allocatable:: mask_array(:,:,:,:)
logical, allocatable:: judge(:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4) )
right = answer ( pos(1), pos(2), pos(3), pos(4) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal4
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal5( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(5), check_shape(5), pos(5)
logical:: consist_shape(5)
character(TOKEN):: pos_array(5)
integer, allocatable:: mask_array(:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal5
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal6( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(6), check_shape(6), pos(6)
logical:: consist_shape(6)
character(TOKEN):: pos_array(6)
integer, allocatable:: mask_array(:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal6
Subroutine : |
|
message : | character(*), intent(in)
|
answer(:,:,:,:,:,:,:) : | real, intent(in)
|
check(:,:,:,:,:,:,:) : | real, intent(in)
|
negative_support : | logical, intent(in), optional
|
[Source]
subroutine DCTestAssertLessThanReal7( message, answer, check, negative_support)
use sysdep, only: AbortProgram
use dc_types, only: STRING, TOKEN
implicit none
character(*), intent(in):: message
real, intent(in):: answer(:,:,:,:,:,:,:)
real, intent(in):: check(:,:,:,:,:,:,:)
logical, intent(in), optional:: negative_support
logical:: err_flag
logical:: negative_support_on
character(STRING):: pos_str
character(TOKEN):: abs_mes
real:: wrong, right
integer:: answer_shape(7), check_shape(7), pos(7)
logical:: consist_shape(7)
character(TOKEN):: pos_array(7)
integer, allocatable:: mask_array(:,:,:,:,:,:,:)
logical, allocatable:: judge(:,:,:,:,:,:,:)
logical, allocatable:: judge_rev(:,:,:,:,:,:,:)
logical, allocatable:: answer_negative(:,:,:,:,:,:,:)
logical, allocatable:: check_negative(:,:,:,:,:,:,:)
logical, allocatable:: both_negative(:,:,:,:,:,:,:)
continue
if (present(negative_support)) then
negative_support_on = negative_support
else
negative_support_on = .true.
end if
err_flag = .false.
answer_shape = shape(answer)
check_shape = shape(check)
consist_shape = answer_shape == check_shape
if (.not. all(consist_shape)) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' shape of check is (', check_shape, ')'
write(*,*) ' is INCORRECT'
write(*,*) ' Correct shape of answer is (', answer_shape, ')'
call AbortProgram('')
end if
allocate( mask_array ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( judge_rev ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( answer_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( check_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
allocate( both_negative ( answer_shape(1), answer_shape(2), answer_shape(3), answer_shape(4), answer_shape(5), answer_shape(6), answer_shape(7) ) )
answer_negative = answer < 0.0
check_negative = check < 0.0
both_negative = answer_negative .and. check_negative
if (.not. negative_support_on) both_negative = .false.
judge = answer > check
where (both_negative) judge = .not. judge
judge_rev = .not. judge
err_flag = any(judge_rev)
mask_array = 1
pos = maxloc(mask_array, judge_rev)
if (err_flag) then
wrong = check ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
right = answer ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) )
write(unit=pos_array(1), fmt="(i20)") pos(1)
write(unit=pos_array(2), fmt="(i20)") pos(2)
write(unit=pos_array(3), fmt="(i20)") pos(3)
write(unit=pos_array(4), fmt="(i20)") pos(4)
write(unit=pos_array(5), fmt="(i20)") pos(5)
write(unit=pos_array(6), fmt="(i20)") pos(6)
write(unit=pos_array(7), fmt="(i20)") pos(7)
pos_str = '(' // trim(adjustl(pos_array(1))) // ',' // trim(adjustl(pos_array(2))) // ',' // trim(adjustl(pos_array(3))) // ',' // trim(adjustl(pos_array(4))) // ',' // trim(adjustl(pos_array(5))) // ',' // trim(adjustl(pos_array(6))) // ',' // trim(adjustl(pos_array(7))) // ')'
if ( both_negative ( pos(1), pos(2), pos(3), pos(4), pos(5), pos(6), pos(7) ) ) then
abs_mes = 'ABSOLUTE value of'
else
abs_mes = ''
end if
end if
deallocate(mask_array, judge, judge_rev)
deallocate(answer_negative, check_negative, both_negative)
if (err_flag) then
write(*,*) ' *** Error [AssertLT] *** Checking ' // trim(message) // ' FAILURE'
write(*,*) ''
write(*,*) ' ' // trim(abs_mes) // ' check' // trim(pos_str) // ' = ', wrong
write(*,*) ' is NOT LESS THAN'
write(*,*) ' ' // trim(abs_mes) // ' answer' // trim(pos_str) // ' = ', right
call AbortProgram('')
else
write(*,*) ' *** MESSAGE [AssertLT] *** Checking ' // trim(message) // ' OK'
end if
end subroutine DCTestAssertLessThanReal7