@@ -503,7 +503,7 @@ subroutine test_initialization()
503
503
end if
504
504
505
505
set5 = log1
506
- call extract( set4, set5, 1 , 33 )
506
+ call extract( set4, set5, 1_bits_kind , 33_bits_kind )
507
507
if ( set4 % bits() /= 33 ) then
508
508
error stop procedure // &
509
509
' initialization with extract failed to set' // &
@@ -517,7 +517,7 @@ subroutine test_initialization()
517
517
end if
518
518
519
519
set5 = log11
520
- call extract( set4, set5, 1 , 65 )
520
+ call extract( set4, set5, 1_bits_kind , 65_bits_kind )
521
521
if ( set4 % bits() /= 65 ) then
522
522
error stop procedure // &
523
523
' initialization with extract failed to set' // &
@@ -677,7 +677,7 @@ end subroutine test_initialization
677
677
678
678
subroutine test_bitset_inquiry ()
679
679
character (* ), parameter :: procedure = ' TEST_BITSET_INQUIRY'
680
- integer :: i
680
+ integer (bits_kind) :: i
681
681
682
682
write (* ,* )
683
683
write (* ,* ) ' Test bitset inquiry: all, any, bits, none, test, and value'
@@ -898,9 +898,9 @@ subroutine test_bit_operations()
898
898
error stop procedure // ' set1 is not all set.'
899
899
end if
900
900
901
- call set1 % clear(0 )
902
- if ( .not. set1 % test(0 ) ) then
903
- if ( set1 % test(1 ) ) then
901
+ call set1 % clear(0_bits_kind )
902
+ if ( .not. set1 % test(0_bits_kind ) ) then
903
+ if ( set1 % test(1_bits_kind ) ) then
904
904
write (* ,* ) ' Cleared one bit in set1 as expected.'
905
905
else
906
906
error stop procedure // ' cleared more than one bit in set1.'
@@ -909,17 +909,17 @@ subroutine test_bit_operations()
909
909
error stop procedure // ' did not clear the first bit in set1.'
910
910
end if
911
911
912
- call set1 % clear(1 , 32 )
912
+ call set1 % clear(1_bits_kind , 32_bits_kind )
913
913
if ( set1 % none() ) then
914
914
write (* ,* ) ' Cleared remaining bits in set1 as expected.'
915
915
else
916
916
error stop procedure // ' did not clear remaining bits ' // &
917
917
' in set1.'
918
918
end if
919
919
920
- call set1 % flip(0 )
921
- if ( set1 % test(0 ) ) then
922
- if ( .not. set1 % test(1 ) ) then
920
+ call set1 % flip(0_bits_kind )
921
+ if ( set1 % test(0_bits_kind ) ) then
922
+ if ( .not. set1 % test(1_bits_kind ) ) then
923
923
write (* ,* ) ' Flipped one bit in set1 as expected.'
924
924
else
925
925
error stop procedure // ' flipped more than one bit in set1.'
@@ -928,7 +928,7 @@ subroutine test_bit_operations()
928
928
error stop procedure // ' did not flip the first bit in set1.'
929
929
end if
930
930
931
- call set1 % flip(1 , 32 )
931
+ call set1 % flip(1_bits_kind , 32_bits_kind )
932
932
if ( set1 % all () ) then
933
933
write (* ,* ) ' Flipped remaining bits in set1 as expected.'
934
934
else
@@ -943,9 +943,9 @@ subroutine test_bit_operations()
943
943
error stop procedure // ' did not unset bits in set1.'
944
944
end if
945
945
946
- call set1 % set(0 )
947
- if ( set1 % test(0 ) ) then
948
- if ( .not. set1 % test(1 ) ) then
946
+ call set1 % set(0_bits_kind )
947
+ if ( set1 % test(0_bits_kind ) ) then
948
+ if ( .not. set1 % test(1_bits_kind ) ) then
949
949
write (* ,* ) ' Set first bit in set1 as expected.'
950
950
else
951
951
error stop procedure // ' set more than one bit in set1.'
@@ -954,23 +954,23 @@ subroutine test_bit_operations()
954
954
error stop procedure // ' did not set the first bit in set1.'
955
955
end if
956
956
957
- call set1 % set(1 , 32 )
957
+ call set1 % set(1_bits_kind , 32_bits_kind )
958
958
if ( set1 % all () ) then
959
959
write (* ,* ) ' Set the remaining bits in set1 as expected.'
960
960
else
961
961
error stop procedure // ' did not set the remaining bits ' // &
962
962
' in set1.'
963
963
end if
964
964
965
- call set11 % init( 166 )
965
+ call set11 % init( 166_bits_kind )
966
966
call set11 % not ()
967
967
if ( .not. set11 % all () ) then
968
968
error stop procedure // ' set11 is not all set.'
969
969
end if
970
970
971
- call set11 % clear(0 )
972
- if ( .not. set11 % test(0 ) ) then
973
- if ( set11 % test(1 ) ) then
971
+ call set11 % clear(0_bits_kind )
972
+ if ( .not. set11 % test(0_bits_kind ) ) then
973
+ if ( set11 % test(1_bits_kind ) ) then
974
974
write (* ,* ) ' Cleared one bit in set11 as expected.'
975
975
else
976
976
error stop procedure // ' cleared more than one bit in set11.'
@@ -979,9 +979,9 @@ subroutine test_bit_operations()
979
979
error stop procedure // ' did not clear the first bit in set11.'
980
980
end if
981
981
982
- call set11 % clear(165 )
983
- if ( .not. set11 % test(165 ) ) then
984
- if ( set11 % test(164 ) ) then
982
+ call set11 % clear(165_bits_kind )
983
+ if ( .not. set11 % test(165_bits_kind ) ) then
984
+ if ( set11 % test(164_bits_kind ) ) then
985
985
write (* ,* ) ' Cleared the last bit in set11 as expected.'
986
986
else
987
987
error stop procedure // ' cleared more than one bit in set11.'
@@ -990,17 +990,17 @@ subroutine test_bit_operations()
990
990
error stop procedure // ' did not clear the last bit in set11.'
991
991
end if
992
992
993
- call set11 % clear(1 , 164 )
993
+ call set11 % clear(1_bits_kind , 164_bits_kind )
994
994
if ( set11 % none() ) then
995
995
write (* ,* ) ' Cleared remaining bits in set11 as expected.'
996
996
else
997
997
error stop procedure // ' did not clear remaining bits ' // &
998
998
' in set11.'
999
999
end if
1000
1000
1001
- call set11 % flip(0 )
1002
- if ( set11 % test(0 ) ) then
1003
- if ( .not. set11 % test(1 ) ) then
1001
+ call set11 % flip(0_bits_kind )
1002
+ if ( set11 % test(0_bits_kind ) ) then
1003
+ if ( .not. set11 % test(1_bits_kind ) ) then
1004
1004
write (* ,* ) ' Flipped one bit in set11 as expected.'
1005
1005
else
1006
1006
error stop procedure // ' flipped more than one bit in set11.'
@@ -1009,9 +1009,9 @@ subroutine test_bit_operations()
1009
1009
error stop procedure // ' did not flip the first bit in set11.'
1010
1010
end if
1011
1011
1012
- call set11 % flip(165 )
1013
- if ( set11 % test(165 ) ) then
1014
- if ( .not. set11 % test(164 ) ) then
1012
+ call set11 % flip(165_bits_kind )
1013
+ if ( set11 % test(165_bits_kind ) ) then
1014
+ if ( .not. set11 % test(164_bits_kind ) ) then
1015
1015
write (* ,* ) ' Flipped last bit in set11 as expected.'
1016
1016
else
1017
1017
error stop procedure // ' flipped more than one bit in set11.'
@@ -1020,7 +1020,7 @@ subroutine test_bit_operations()
1020
1020
error stop procedure // ' did not flip the last bit in set11.'
1021
1021
end if
1022
1022
1023
- call set11 % flip(1 , 164 )
1023
+ call set11 % flip(1_bits_kind , 164_bits_kind )
1024
1024
if ( set11 % all () ) then
1025
1025
write (* ,* ) ' Flipped remaining bits in set11 as expected.'
1026
1026
else
@@ -1035,9 +1035,9 @@ subroutine test_bit_operations()
1035
1035
error stop procedure // ' did not unset bits in set11.'
1036
1036
end if
1037
1037
1038
- call set11 % set(0 )
1039
- if ( set11 % test(0 ) ) then
1040
- if ( .not. set11 % test(1 ) ) then
1038
+ call set11 % set(0_bits_kind )
1039
+ if ( set11 % test(0_bits_kind ) ) then
1040
+ if ( .not. set11 % test(1_bits_kind ) ) then
1041
1041
write (* ,* ) ' Set first bit in set11 as expected.'
1042
1042
else
1043
1043
error stop procedure // ' set more than one bit in set11.'
@@ -1046,9 +1046,9 @@ subroutine test_bit_operations()
1046
1046
error stop procedure // ' did not set the first bit in set11.'
1047
1047
end if
1048
1048
1049
- call set11 % set(165 )
1050
- if ( set11 % test(165 ) ) then
1051
- if ( .not. set11 % test(164 ) ) then
1049
+ call set11 % set(165_bits_kind )
1050
+ if ( set11 % test(165_bits_kind ) ) then
1051
+ if ( .not. set11 % test(164_bits_kind ) ) then
1052
1052
write (* ,* ) ' Set last bit in set11 as expected.'
1053
1053
else
1054
1054
error stop procedure // ' set more than one bit in set11.'
@@ -1057,7 +1057,7 @@ subroutine test_bit_operations()
1057
1057
error stop procedure // ' did not set the last bit in set11.'
1058
1058
end if
1059
1059
1060
- call set11 % set(1 , 164 )
1060
+ call set11 % set(1_bits_kind , 164_bits_kind )
1061
1061
if ( set11 % all () ) then
1062
1062
write (* ,* ) ' Set the remaining bits in set11 as expected.'
1063
1063
else
@@ -1123,15 +1123,15 @@ subroutine test_bitset_comparisons()
1123
1123
' equal tests.'
1124
1124
end if
1125
1125
1126
- call set10 % init(166 )
1127
- call set11 % init(166 )
1126
+ call set10 % init(166_bits_kind )
1127
+ call set11 % init(166_bits_kind )
1128
1128
call set11 % not ()
1129
- call set12 % init(166 )
1130
- call set12 % set(165 )
1131
- call set13 % init(166 )
1132
- call set13 % set(65 )
1133
- call set14 % init(166 )
1134
- call set14 % set(0 )
1129
+ call set12 % init(166_bits_kind )
1130
+ call set12 % set(165_bits_kind )
1131
+ call set13 % init(166_bits_kind )
1132
+ call set13 % set(65_bits_kind )
1133
+ call set14 % init(166_bits_kind )
1134
+ call set14 % set(0_bits_kind )
1135
1135
if ( set10 == set10 .and. set11 == set11 .and. set12 == set12 .and. &
1136
1136
set13 == set13 .and. set14 == set14 .and. &
1137
1137
.not. set13 == set14 .and. .not. set12 == set13 .and. &
@@ -1337,9 +1337,9 @@ subroutine test_bitset_operations()
1337
1337
error stop procedure // ' fourth test of < 64 bit XOR failed.'
1338
1338
end if
1339
1339
1340
- call set0 % init(166 )
1340
+ call set0 % init(166_bits_kind )
1341
1341
call set0 % not ()
1342
- call set4 % init(166 )
1342
+ call set4 % init(166_bits_kind )
1343
1343
call set4 % not ()
1344
1344
call and( set0, set4 ) ! all all
1345
1345
if ( set0 % all () ) then
@@ -1348,15 +1348,15 @@ subroutine test_bitset_operations()
1348
1348
error stop procedure // ' first test of > 64 bit AND failed.'
1349
1349
end if
1350
1350
1351
- call set4 % init(166 )
1351
+ call set4 % init(166_bits_kind )
1352
1352
call and( set0, set4 ) ! all none
1353
1353
if ( set0 % none() ) then
1354
1354
write (* ,* ) ' Second test of > 64 bit AND worked.'
1355
1355
else
1356
1356
error stop procedure // ' second test of > 64 bit AND failed.'
1357
1357
end if
1358
1358
1359
- call set3 % init(166 )
1359
+ call set3 % init(166_bits_kind )
1360
1360
call set3 % not ()
1361
1361
call and( set4, set3 ) ! none all
1362
1362
if ( set4 % none() ) then
@@ -1365,7 +1365,7 @@ subroutine test_bitset_operations()
1365
1365
error stop procedure // ' third test of > 64 bit AND failed.'
1366
1366
end if
1367
1367
1368
- call set3 % init(166 )
1368
+ call set3 % init(166_bits_kind )
1369
1369
call and( set4, set3 ) ! none none
1370
1370
if ( set4 % none() ) then
1371
1371
write (* ,* ) ' Fourth test of > 64 bit AND worked.'
@@ -1404,9 +1404,9 @@ subroutine test_bitset_operations()
1404
1404
error stop procedure // ' fourth test of > 64 bit AND_NOT failed.'
1405
1405
end if
1406
1406
1407
- call set3 % init(166 )
1407
+ call set3 % init(166_bits_kind )
1408
1408
call set3 % not ()
1409
- call set4 % init(166 )
1409
+ call set4 % init(166_bits_kind )
1410
1410
call set4 % not ()
1411
1411
call or( set3, set4 ) ! all all
1412
1412
if ( set3 % all () ) then
@@ -1415,7 +1415,7 @@ subroutine test_bitset_operations()
1415
1415
error stop procedure // ' first test of > 64 bit OR failed.'
1416
1416
end if
1417
1417
1418
- call set3 % init(166 )
1418
+ call set3 % init(166_bits_kind )
1419
1419
call or( set4, set3 ) ! all none
1420
1420
if ( set4 % all () ) then
1421
1421
write (* ,* ) ' Second test of > 64 bit OR worked.'
@@ -1430,8 +1430,8 @@ subroutine test_bitset_operations()
1430
1430
error stop procedure // ' third test of > 64 bit OR failed.'
1431
1431
end if
1432
1432
1433
- call set3 % init(166 )
1434
- call set4 % init(166 )
1433
+ call set3 % init(166_bits_kind )
1434
+ call set4 % init(166_bits_kind )
1435
1435
call or( set4, set3 ) ! none none
1436
1436
if ( set4 % none() ) then
1437
1437
write (* ,* ) ' Fourth test of > 64 bit OR worked.'
0 commit comments