298 CHARACTER(LEN=*),
INTENT(IN) :: SHORT
299 CHARACTER(LEN=*),
INTENT(IN) :: LONG
300 INTEGER(INTG),
INTENT(IN) :: MIN_NUM_CHARACTERS
302 LOGICAL :: IS_ABBREVIATION_C_C
304 INTEGER(INTG) :: noch,NUM_CHARACTERS
305 CHARACTER(LEN=LEN(SHORT)) :: UPPER_SHORT
306 CHARACTER(LEN=LEN(LONG)) :: UPPER_LONG
308 is_abbreviation_c_c=.false.
311 num_characters=min(
len(long),
len(short))
312 DO noch=min_num_characters,num_characters
313 IF(upper_short==upper_long(:noch))
THEN 314 is_abbreviation_c_c=.true.
330 CHARACTER(LEN=*),
INTENT(IN) :: SHORT
332 INTEGER(INTG),
INTENT(IN) :: MIN_NUM_CHARACTERS
334 LOGICAL :: IS_ABBREVIATION_C_VS
336 INTEGER(INTG) :: noch,NUM_CHARACTERS
337 CHARACTER(LEN=LEN(SHORT)) :: UPPER_SHORT
340 is_abbreviation_c_vs=.false.
343 num_characters=min(
len(long),
len(short))
344 DO noch=min_num_characters,num_characters
345 IF(upper_short==
extract(upper_long,1,noch))
THEN 346 is_abbreviation_c_vs=.true.
363 CHARACTER(LEN=*),
INTENT(IN) :: LONG
364 INTEGER(INTG),
INTENT(IN) :: MIN_NUM_CHARACTERS
366 LOGICAL :: IS_ABBREVIATION_VS_C
368 INTEGER(INTG) :: noch,NUM_CHARACTERS
370 CHARACTER(LEN=LEN(LONG)) :: UPPER_LONG
372 is_abbreviation_vs_c=.false.
375 num_characters=min(
len(long),
len(short))
376 DO noch=min_num_characters,num_characters
377 IF(upper_short==upper_long(:noch))
THEN 378 is_abbreviation_vs_c=.true.
396 INTEGER(INTG),
INTENT(IN) :: MIN_NUM_CHARACTERS
398 LOGICAL :: IS_ABBREVIATION_VS_VS
400 INTEGER(INTG) :: noch,NUM_CHARACTERS
403 is_abbreviation_vs_vs=.false.
406 num_characters=min(
len(long),
len(short))
407 DO noch=min_num_characters,num_characters
408 IF(upper_short==
extract(upper_long,1,noch))
THEN 409 is_abbreviation_vs_vs=.true.
425 CHARACTER(LEN=1),
INTENT(IN) :: CHARAC
443 CHARACTER(LEN=1),
INTENT(IN) :: CHARAC
462 CHARACTER(LEN=1),
INTENT(IN) :: CHARC
464 LOGICAL :: IS_LOWERCASE
467 IF(
lge(charc,
"a").AND.
lle(charc,
"z"))
THEN 484 CHARACTER(LEN=1),
INTENT(IN) :: CHARC
486 LOGICAL :: IS_UPPERCASE
489 IF(
lge(charc,
"A").AND.
lle(charc,
"Z"))
THEN 506 CHARACTER(LEN=1),
INTENT(IN) :: CHARAC
508 LOGICAL :: IS_WHITESPACE
512 is_whitespace=(charac==
char(32).OR.charac==
char(9))
525 INTEGER(INTG),
INTENT(IN) :: NUMBER_IN_LIST
526 CHARACTER(LEN=*),
INTENT(IN) :: LIST(number_in_list)
527 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
528 INTEGER(INTG),
INTENT(OUT) :: ERR
530 INTEGER(INTG),
OPTIONAL,
INTENT(IN) :: LIST_LENGTHS(number_in_list)
532 CHARACTER(LEN=MAXSTRLEN) :: LIST_TO_CHARACTER_C
534 INTEGER(INTG) :: i,POSITION,LENGTH
536 enters(
"LIST_TO_CHARACTER_C",err,error,*999)
538 list_to_character_c=
"" 539 IF(number_in_list>0)
THEN 540 IF(
PRESENT(list_lengths))
THEN 541 length=list_lengths(1)
542 list_to_character_c=list(1)(1:length)
543 DO i=2,number_in_list
544 IF(length+list_lengths(i)+1<=
maxstrlen)
THEN 545 list_to_character_c=list_to_character_c(1:length)//
","//list(i)(1:list_lengths(i))
546 length=length+list_lengths(i)+1
548 list_to_character_c=list_to_character_c(1:length)//
",...." 553 list_to_character_c=list_to_character_c(1:position)//
"...." 555 list_to_character_c=list_to_character_c(1:
maxstrlen-5)//
",...." 561 list_to_character_c=list(1)(1:
len_trim(list(1)))
562 DO i=2,number_in_list
564 list_to_character_c=list_to_character_c(1:
len_trim(list_to_character_c))//
","//list(i)(1:
len_trim(list(i)))
566 list_to_character_c=list_to_character_c(1:
len_trim(list_to_character_c))//
",...." 571 list_to_character_c=list_to_character_c(1:position)//
"...." 573 list_to_character_c=list_to_character_c(1:
maxstrlen-5)//
",...." 581 exits(
"LIST_TO_CHARACTER_C")
583 999 errorsexits(
"LIST_TO_CHARACTER_C",err,error)
595 INTEGER(INTG),
INTENT(IN) :: NUMBER_IN_LIST
596 INTEGER(INTG),
INTENT(IN) :: LIST(number_in_list)
597 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
598 INTEGER(INTG),
INTENT(OUT) :: ERR
601 CHARACTER(LEN=MAXSTRLEN) :: LIST_TO_CHARACTER_INTG
603 INTEGER(INTG) :: i,POSITION
604 CHARACTER(LEN=MAXSTRLEN) :: LIST_VALUE
606 enters(
"LIST_TO_CHARACTER_INTG",err,error,*999)
608 list_to_character_intg=
"" 609 IF(number_in_list>0)
THEN 612 DO i=2,number_in_list
616 list_to_character_intg=list_to_character_intg(1:
len_trim(list_to_character_intg))//
","// &
617 & list_value(1:
len_trim(list_value))
619 list_to_character_intg=list_to_character_intg(1:
len_trim(list_to_character_intg))//
",...." 624 list_to_character_intg=list_to_character_intg(1:position)//
"...." 626 list_to_character_intg=list_to_character_intg(1:
maxstrlen-5)//
",...." 633 exits(
"LIST_TO_CHARACTER_INTG")
635 999 errorsexits(
"LIST_TO_CHARACTER_INTG",err,error)
647 INTEGER(INTG),
INTENT(IN) :: NUMBER_IN_LIST
648 INTEGER(LINTG),
INTENT(IN) :: LIST(number_in_list)
649 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
650 INTEGER(INTG),
INTENT(OUT) :: ERR
653 CHARACTER(LEN=MAXSTRLEN) :: LIST_TO_CHARACTER_LINTG
655 INTEGER(INTG) :: i,POSITION
656 CHARACTER(LEN=MAXSTRLEN) :: LIST_VALUE
658 enters(
"LIST_TO_CHARACTER_LINTG",err,error,*999)
660 list_to_character_lintg=
"" 661 IF(number_in_list>0)
THEN 664 DO i=2,number_in_list
668 list_to_character_lintg=list_to_character_lintg(1:
len_trim(list_to_character_lintg))//
","// &
669 & list_value(1:
len_trim(list_value))
671 list_to_character_lintg=list_to_character_lintg(1:
len_trim(list_to_character_lintg))//
",...." 676 list_to_character_lintg=list_to_character_lintg(1:position)//
"...." 678 list_to_character_lintg=list_to_character_lintg(1:
maxstrlen-5)//
",...." 685 exits(
"LIST_TO_CHARACTER_LINTG")
687 999 errorsexits(
"LIST_TO_CHARACTER_LINTG",err,error)
699 INTEGER(INTG),
INTENT(IN) :: NUMBER_IN_LIST
700 LOGICAL,
INTENT(IN) :: LIST(number_in_list)
701 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
702 INTEGER(INTG),
INTENT(OUT) :: ERR
705 CHARACTER(LEN=MAXSTRLEN) :: LIST_TO_CHARACTER_L
707 INTEGER(INTG) :: i,POSITION
708 CHARACTER(LEN=MAXSTRLEN) :: LIST_VALUE
710 enters(
"LIST_TO_CHARACTER_L",err,error,*999)
712 list_to_character_l=
"" 713 IF(number_in_list>0)
THEN 716 DO i=2,number_in_list
720 list_to_character_l=list_to_character_l(1:
len_trim(list_to_character_l))//
","//list_value(1:
len_trim(list_value))
722 list_to_character_l=list_to_character_l(1:
len_trim(list_to_character_l))//
",...." 727 list_to_character_l=list_to_character_l(1:position)//
"...." 729 list_to_character_l=list_to_character_l(1:
maxstrlen-5)//
",...." 736 exits(
"LIST_TO_CHARACTER_L")
738 999 errorsexits(
"LIST_TO_CHARACTER_L",err,error)
750 INTEGER(INTG),
INTENT(IN) :: NUMBER_IN_LIST
751 REAL(SP),
INTENT(IN) :: LIST(number_in_list)
752 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
753 INTEGER(INTG),
INTENT(OUT) :: ERR
756 CHARACTER(LEN=MAXSTRLEN) :: LIST_TO_CHARACTER_SP
758 INTEGER(INTG) :: i,POSITION
759 CHARACTER(LEN=MAXSTRLEN) :: LIST_VALUE
761 enters(
"LIST_TO_CHARACTER_SP",err,error,*999)
763 list_to_character_sp=
"" 764 IF(number_in_list>0)
THEN 767 DO i=2,number_in_list
771 list_to_character_sp=list_to_character_sp(1:
len_trim(list_to_character_sp))//
","//list_value(1:
len_trim(list_value))
773 list_to_character_sp=list_to_character_sp(1:
len_trim(list_to_character_sp))//
",...." 778 list_to_character_sp=list_to_character_sp(1:position)//
"...." 780 list_to_character_sp=list_to_character_sp(1:
maxstrlen-5)//
",...." 787 exits(
"LIST_TO_CHARACTER_SP")
789 999 errorsexits(
"LIST_TO_CHARACTER_SP",err,error)
801 INTEGER(INTG),
INTENT(IN) :: NUMBER_IN_LIST
802 REAL(DP),
INTENT(IN) :: LIST(number_in_list)
803 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
804 INTEGER(INTG),
INTENT(OUT) :: ERR
807 CHARACTER(LEN=MAXSTRLEN) :: LIST_TO_CHARACTER_DP
809 INTEGER(INTG) :: i,POSITION
810 CHARACTER(LEN=MAXSTRLEN) :: LIST_VALUE
812 enters(
"LIST_TO_CHARACTER_DP",err,error,*999)
814 list_to_character_dp=
"" 815 IF(number_in_list>0)
THEN 818 DO i=2,number_in_list
822 list_to_character_dp=list_to_character_dp(1:
len_trim(list_to_character_dp))//
","//list_value(1:
len_trim(list_value))
824 list_to_character_dp=list_to_character_dp(1:
len_trim(list_to_character_dp))//
",...." 829 list_to_character_dp=list_to_character_dp(1:position)//
"...." 831 list_to_character_dp=list_to_character_dp(1:
maxstrlen-5)//
",...." 838 exits(
"LIST_TO_CHARACTER_DP")
840 999 errorsexits(
"LIST_TO_CHARACTER_DP",err,error)
852 LOGICAL,
INTENT(IN) :: LOGICALVALUE
853 INTEGER(INTG),
INTENT(OUT) :: ERR
856 CHARACTER(LEN=MAXSTRLEN) :: LOGICAL_TO_CHARACTER
859 enters(
"LOGICAL_TO_CHARACTER",err,error,*999)
861 IF(logicalvalue)
THEN 862 logical_to_character=
"TRUE" 864 logical_to_character=
"FALSE" 867 exits(
"LOGICAL_TO_CHARACTER")
869 999 errorsexits(
"LOGICAL_TO_CHARACTER",err,error)
881 LOGICAL,
INTENT(IN) :: LOGICALVALUE
882 INTEGER(INTG),
INTENT(OUT) :: ERR
888 enters(
"LOGICAL_TO_VSTRING",err,error,*999)
890 IF(logicalvalue)
THEN 891 logical_to_vstring=
"TRUE" 893 logical_to_vstring=
"FALSE" 896 exits(
"LOGICAL_TO_VSTRING")
898 999 errorsexits(
"LOGICAL_TO_VSTRING",err,error)
910 INTEGER(INTG),
INTENT(IN) :: NUMBER
911 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
912 INTEGER(INTG),
INTENT(OUT) :: ERR
915 CHARACTER(LEN=MAXSTRLEN) :: NUMBER_TO_CHARACTER_INTG
917 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT
919 enters(
"NUMBER_TO_CHARACTER_INTG",err,error,*999)
921 IF(
FORMAT(1:1)==
"*")
THEN 924 local_format=
"("//
FORMAT(1:
len_trim(format))//
")" 926 WRITE(number_to_character_intg,local_format,err=999) number
929 number_to_character_intg=
adjustl(number_to_character_intg)
931 exits(
"NUMBER_TO_CHARACTER_INTG")
933 999
CALL flagerror(
"Error converting an integer to a character string",err,error,*998)
934 998 errorsexits(
"NUMBER_TO_CHARACTER_INTG",err,error)
946 INTEGER(LINTG),
INTENT(IN) :: NUMBER
947 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
948 INTEGER(INTG),
INTENT(OUT) :: ERR
951 CHARACTER(LEN=MAXSTRLEN) :: NUMBER_TO_CHARACTER_LINTG
953 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT
955 enters(
"NUMBER_TO_CHARACTER_LINTG",err,error,*999)
957 IF(
FORMAT(1:1)==
"*")
THEN 960 local_format=
"("//
FORMAT(1:
len_trim(format))//
")" 962 WRITE(number_to_character_lintg,local_format,err=999) number
965 number_to_character_lintg=
adjustl(number_to_character_lintg)
967 exits(
"NUMBER_TO_CHARACTER_LINTG")
969 999
CALL flagerror(
"Error converting a long integer to a character string",err,error,*998)
970 998 errorsexits(
"NUMBER_TO_CHARACTER_LINTG",err,error)
982 REAL(SP),
INTENT(IN) :: NUMBER
983 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
984 INTEGER(INTG),
INTENT(OUT) :: ERR
987 CHARACTER(LEN=MAXSTRLEN) :: NUMBER_TO_CHARACTER_SP
989 INTEGER(INTG) :: ASTERISK_POS,i0,i1,LENGTH
990 CHARACTER(LEN=MAXSTRLEN) :: CI0,CI1
991 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT
993 enters(
"NUMBER_TO_CHARACTER_SP",err,error,*999)
995 asterisk_pos=
index(
FORMAT,
"*")
997 IF(asterisk_pos==1.AND.length==1)
THEN 998 WRITE(number_to_character_sp,*,err=999) number
999 ELSE IF(asterisk_pos>0)
THEN 1000 ci0=
FORMAT(asterisk_pos+1:
len_trim(format))
1001 READ(ci0,
'(BN,I2)') i0
1003 IF(number>=0.0_sp)
THEN 1004 IF((number<10.0_sp**(i0-1)).AND.(number>=0.1_sp**(min(i0-2,5))))
THEN 1005 IF(number>1.0_sp)
THEN 1006 i1=i0-2-floor(log10(number))
1008 WRITE(ci1,local_format) i1
1010 WRITE(number_to_character_sp,local_format,err=999) number
1013 WRITE(ci1,local_format) i0-2
1015 WRITE(number_to_character_sp,local_format,err=999) number
1019 WRITE(ci1,local_format) i0-6
1021 WRITE(number_to_character_sp,local_format,err=999) number
1024 IF((-number<10.0_sp**(i0-2)).AND.(-number>=0.01_sp**(min(i0-2,5))))
THEN 1025 IF(-number>=1.0_sp)
THEN 1026 i1=i0-3-floor(log10(number))
1028 WRITE(ci1,
'(I2)') i1
1030 WRITE(number_to_character_sp,local_format,err=999) number
1033 WRITE(ci1,local_format) i0-2
1035 WRITE(number_to_character_sp,local_format,err=999) number
1039 WRITE(ci1,local_format) i0-6
1041 WRITE(number_to_character_sp,local_format,err=999) number
1045 CALL flagerror(
"Invalid FORMAT",err,error,*999)
1049 local_format=
'('//
FORMAT(1:
len_trim(format))//
')' 1050 WRITE(number_to_character_sp,local_format,err=999) number
1054 IF(number_to_character_sp(
len_trim(number_to_character_sp):
len_trim(number_to_character_sp))==
".") &
1055 & number_to_character_sp=number_to_character_sp(1:
len_trim(number_to_character_sp))//
"0" 1057 number_to_character_sp=
adjustl(number_to_character_sp)
1059 exits(
"NUMBER_TO_CHARACTER_SP")
1061 999
CALL flagerror(
"Error converting a single precision number to a character string",err,error,*998)
1062 998 errorsexits(
"NUMBER_TO_CHARACTER_SP",err,error)
1074 REAL(DP),
INTENT(IN) :: NUMBER
1075 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
1076 INTEGER(INTG),
INTENT(OUT) :: ERR
1079 CHARACTER(LEN=MAXSTRLEN) :: NUMBER_TO_CHARACTER_DP
1081 INTEGER(INTG) :: ASTERISK_POS,i0,i1,LENGTH
1082 CHARACTER(LEN=2) :: CI0,CI1
1083 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT
1085 enters(
"NUMBER_TO_CHARACTER_DP",err,error,*999)
1087 asterisk_pos=
index(
FORMAT,
"*")
1089 IF(asterisk_pos==1.AND.length==1)
THEN 1090 WRITE(number_to_character_dp,*,err=999) number
1091 ELSE IF(asterisk_pos>0)
THEN 1092 ci0=
FORMAT(asterisk_pos+1:
len_trim(format))
1093 READ(ci0,
'(BN,I2)') i0
1095 IF(number>=0.0_dp)
THEN 1096 IF((number<10.0_dp**(i0-1)).AND.(number>=0.1_dp**(min(i0-2,5))))
THEN 1097 IF(number>1.0_dp)
THEN 1098 i1=i0-2-floor(log10(number))
1100 WRITE(ci1,local_format) i1
1102 WRITE(number_to_character_dp,local_format,err=999) number
1105 WRITE(ci1,local_format) i0-2
1107 WRITE(number_to_character_dp,local_format,err=999) number
1111 WRITE(ci1,local_format) i0-6
1113 WRITE(number_to_character_dp,local_format,err=999) number
1116 IF((-number<10.0_dp**(i0-2)).AND.(-number>=0.01_dp**(min(i0-2,5))))
THEN 1117 IF(-number>=1.0_dp)
THEN 1118 i1=i0-3-floor(log10(number))
1120 WRITE(ci1,
'(I2)') i1
1122 WRITE(number_to_character_dp,local_format,err=999) number
1125 WRITE(ci1,local_format) i0-2
1127 WRITE(number_to_character_dp,local_format,err=999) number
1131 WRITE(ci1,local_format) i0-6
1133 WRITE(number_to_character_dp,local_format,err=999) number
1137 CALL flagerror(
"Invalid format",err,error,*999)
1140 local_format=
'('//
FORMAT(1:
len_trim(format))//
')' 1141 WRITE(number_to_character_dp,local_format,err=999) number
1145 IF(number_to_character_dp(
len_trim(number_to_character_dp):
len_trim(number_to_character_dp))==
".") &
1146 & number_to_character_dp=number_to_character_dp(1:
len_trim(number_to_character_dp))//
"0" 1148 number_to_character_dp=
adjustl(number_to_character_dp)
1150 exits(
"NUMBER_TO_CHARACTER_DP")
1152 999
CALL flagerror(
"Error converting double precision number to a character string",err,error,*998)
1153 998 errorsexits(
"NUMBER_TO_CHARACTER_DP",err,error)
1165 INTEGER(INTG),
INTENT(IN) :: NUMBER
1166 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
1167 INTEGER(INTG),
INTENT(OUT) :: ERR
1172 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT,LOCAL_STRING
1180 number_to_vstring_intg=
"" 1182 IF(
FORMAT(1:1)==
"*")
THEN 1183 local_format=
"(I12)" 1185 local_format=
"("//
FORMAT(1:
len_trim(format))//
")" 1187 WRITE(local_string,local_format,err=999) number
1190 number_to_vstring_intg=
adjustl(local_string(1:
len_trim(local_string)))
1194 999
CALL flagerror(
"Error converting an integer to a varying string",err,error,*998)
1195 998 errorsexits(
"NUMBER_TO_VSTRING_INTG",err,error)
1207 INTEGER(LINTG),
INTENT(IN) :: NUMBER
1208 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
1209 INTEGER(INTG),
INTENT(OUT) :: ERR
1214 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT,LOCAL_STRING
1222 number_to_vstring_lintg=
"" 1224 IF(
FORMAT(1:1)==
"*")
THEN 1225 local_format=
"(I18)" 1227 local_format=
"("//
FORMAT(1:
len_trim(format))//
")" 1229 WRITE(local_string,local_format,err=999) number
1232 number_to_vstring_lintg=
adjustl(local_string(1:
len_trim(local_string)))
1236 999
CALL flagerror(
"Error converting a long integer to a varying string",err,error,*998)
1237 998 errorsexits(
"NUMBER_TO_VSTRING_LINTG",err,error)
1250 REAL(SP),
INTENT(IN) :: NUMBER
1251 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
1252 INTEGER(INTG),
INTENT(OUT) :: ERR
1257 INTEGER(INTG) :: ASTERISK_POS,i0,i1,LENGTH
1258 CHARACTER(LEN=MAXSTRLEN) :: CI0,CI1
1259 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT,LOCAL_STRING
1261 enters(
"NUMBER_TO_VSTRING_SP",err,error,*999)
1265 number_to_vstring_sp=
"" 1267 asterisk_pos=
index(
FORMAT,
"*")
1269 IF(asterisk_pos==1.AND.length==1)
THEN 1270 WRITE(local_string,*,err=999) number
1271 ELSE IF(asterisk_pos>0)
THEN 1272 ci0=
FORMAT(asterisk_pos+1:
len_trim(format))
1273 READ(ci0,
'(BN,I2)') i0
1275 IF(number>=0.0_sp)
THEN 1276 IF((number<10.0_sp**(i0-1)).AND.(number>=0.1_sp**(min(i0-2,5))))
THEN 1277 IF(number>1.0_sp)
THEN 1278 i1=i0-2-floor(log10(number))
1280 WRITE(ci1,local_format) i1
1282 WRITE(local_string,local_format,err=999) number
1285 WRITE(ci1,local_format) i0-2
1287 WRITE(local_string,local_format,err=999) number
1291 WRITE(ci1,local_format) i0-6
1293 WRITE(local_string,local_format,err=999) number
1296 IF((-number<10.0_sp**(i0-2)).AND.(-number>=0.01_sp**(min(i0-2,5))))
THEN 1297 IF(-number>=1.0_sp)
THEN 1298 i1=i0-3-floor(log10(number))
1300 WRITE(ci1,
'(I2)') i1
1302 WRITE(local_string,local_format,err=999) number
1305 WRITE(ci1,local_format) i0-2
1307 WRITE(local_string,local_format,err=999) number
1311 WRITE(ci1,local_format) i0-6
1313 WRITE(local_string,local_format,err=999) number
1317 CALL flagerror(
"Invalid format",err,error,*999)
1321 local_format=
'('//
FORMAT(1:
len_trim(format))//
')' 1322 WRITE(local_string,local_format,err=999) number
1326 IF(local_string(
len_trim(local_string):
len_trim(local_string))==
".") local_string=local_string(1:
len_trim(local_string))//
"0" 1331 exits(
"NUMBER_TO_VSTRING_SP")
1333 999
CALL flagerror(
"Error converting a single precision number to a varying string",err,error,*998)
1334 998 errorsexits(
"NUMBER_TO_VSTRING_SP",err,error)
1346 REAL(DP),
INTENT(IN) :: NUMBER
1347 CHARACTER(LEN=*),
INTENT(IN) :: FORMAT
1348 INTEGER(INTG),
INTENT(OUT) :: ERR
1353 INTEGER(INTG) :: ASTERISK_POS,i0,i1,LENGTH
1354 CHARACTER(LEN=2) :: CI0,CI1
1355 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_FORMAT,LOCAL_STRING
1363 number_to_vstring_dp=
"" 1365 asterisk_pos=
index(
FORMAT,
"*")
1367 IF(asterisk_pos==1.AND.length==1)
THEN 1368 WRITE(local_string,*,err=999) number
1369 ELSE IF(asterisk_pos>0)
THEN 1370 ci0=
FORMAT(asterisk_pos+1:
len_trim(format))
1371 READ(ci0,
'(BN,I2)') i0
1373 IF(number>=0.0_dp)
THEN 1374 IF((number<10.0_dp**(i0-1)).AND.(number>=0.1_dp**(min(i0-2,5))))
THEN 1375 IF(number>1.0_dp)
THEN 1376 i1=i0-2-floor(log10(number))
1378 WRITE(ci1,local_format) i1
1380 WRITE(local_string,local_format,err=999) number
1383 WRITE(ci1,local_format) i0-2
1385 WRITE(local_string,local_format,err=999) number
1389 WRITE(ci1,local_format) i0-6
1391 WRITE(local_string,local_format,err=999) number
1394 IF((-number<10.0_dp**(i0-2)).AND.(-number>=0.01_dp**(min(i0-2,5))))
THEN 1395 IF(-number>=1.0_dp)
THEN 1396 i1=i0-3-floor(log10(number))
1398 WRITE(ci1,
'(I2)') i1
1400 WRITE(local_string,local_format,err=999) number
1403 WRITE(ci1,local_format) i0-2
1405 WRITE(local_string,local_format,err=999) number
1409 WRITE(ci1,local_format) i0-6
1411 WRITE(local_string,local_format,err=999) number
1415 CALL flagerror(
"Invalid format",err,error,*999)
1418 local_format=
'('//
FORMAT(1:
len_trim(format))//
')' 1419 WRITE(local_string,local_format,err=999) number
1423 IF(local_string(
len_trim(local_string):
len_trim(local_string))==
".") local_string=local_string(1:
len_trim(local_string))//
"0" 1428 number_to_vstring_dp=local_string(1:
len_trim(local_string))
1432 999
CALL flagerror(
"Error converting double precision number to a varying string",err,error,*998)
1433 998 errorsexits(
"NUMBER_TO_VSTRING_DP",err,error)
1446 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1447 INTEGER(INTG),
INTENT(OUT) :: ERR
1450 REAL(DP) :: STRING_TO_DOUBLE_C
1453 enters(
"STRING_TO_DOUBLE_C",err,error,*999)
1455 READ(string,*,iostat=err,err=999) string_to_double_c
1457 exits(
"STRING_TO_DOUBLE_C")
1459 999
CALL flagerror(
"Cannot convert '"//string(1:
len_trim(string))//
"' to a double real",err,error,*998)
1460 998 errorsexits(
"STRING_TO_DOUBLE_C",err,error)
1473 INTEGER(INTG),
INTENT(OUT) :: ERR
1476 REAL(DP) :: STRING_TO_DOUBLE_VS
1478 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_STRING
1480 enters(
"STRING_TO_DOUBLE_VS",err,error,*999)
1484 local_string=
char(string)
1485 READ(local_string,*,iostat=err,err=999) string_to_double_vs
1487 exits(
"STRING_TO_DOUBLE_VS")
1489 999
CALL flagerror(
"Cannot convert '"//
char(string)//
"' to a double real",err,error,*998)
1490 998 errorsexits(
"STRING_TO_DOUBLE_VS",err,error)
1502 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1503 INTEGER(INTG),
INTENT(OUT) :: ERR
1506 INTEGER(INTG) :: STRING_TO_INTEGER_C
1509 enters(
"STRING_TO_INTEGER_C",err,error,*999)
1511 READ(string,*,iostat=err,err=999) string_to_integer_c
1513 exits(
"STRING_TO_INTEGER_C")
1515 999
CALL flagerror(
"Cannot convert '"//string(1:
len_trim(string))//
"' to an integer",err,error,*998)
1516 998 errorsexits(
"STRING_TO_INTEGER_C",err,error)
1529 INTEGER(INTG),
INTENT(OUT) :: ERR
1532 INTEGER(INTG) :: STRING_TO_INTEGER_VS
1534 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_STRING
1536 enters(
"STRING_TO_INTEGER_VS",err,error,*999)
1540 local_string=
char(string)
1541 READ(local_string,*,iostat=err,err=999) string_to_integer_vs
1543 exits(
"STRING_TO_INTEGER_VS")
1545 999
CALL flagerror(
"Cannot convert '"//
char(string)//
"' to an integer",err,error,*998)
1546 998 errorsexits(
"STRING_TO_INTEGER_VS",err,error)
1558 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1559 INTEGER(INTG),
INTENT(OUT) :: ERR
1562 INTEGER(LINTG) :: STRING_TO_LONG_INTEGER_C
1565 enters(
"STRING_TO_LONG_INTEGER_C",err,error,*999)
1567 READ(string,*,iostat=err,err=999) string_to_long_integer_c
1569 exits(
"STRING_TO_LONG_INTEGER_C")
1571 999
CALL flagerror(
"Cannot convert '"//string(1:
len_trim(string))//
"' to a long integer",err,error,*998)
1572 998 errorsexits(
"STRING_TO_LONG_INTEGER_C",err,error)
1585 INTEGER(INTG),
INTENT(OUT) :: ERR
1588 INTEGER(LINTG) :: STRING_TO_LONG_INTEGER_VS
1590 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_STRING
1592 enters(
"STRING_TO_LONG_INTEGER_VS",err,error,*999)
1596 local_string=
char(string)
1597 READ(local_string,*,iostat=err,err=999) string_to_long_integer_vs
1599 exits(
"STRING_TO_LONG_INTEGER_VS")
1601 999
CALL flagerror(
"Cannot convert '"//
char(string)//
"' to a long integer",err,error,*998)
1602 998 errorsexits(
"STRING_TO_LONG_INTEGER_VS",err,error)
1614 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1615 INTEGER(INTG),
INTENT(OUT) :: ERR
1618 LOGICAL :: STRING_TO_LOGICAL_C
1621 enters(
"STRING_TO_LOGICAL_C",err,error,*999)
1623 READ(string,*,iostat=err,err=999) string_to_logical_c
1625 exits(
"STRING_TO_LOGICAL_C")
1627 999
CALL flagerror(
"Cannot convert '"//string(1:
len_trim(string))//
"' to a logical",err,error,*998)
1628 998 errorsexits(
"STRING_TO_LOGICAL_C",err,error)
1641 INTEGER(INTG),
INTENT(OUT) :: ERR
1644 LOGICAL :: STRING_TO_LOGICAL_VS
1646 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_STRING
1648 enters(
"STRING_TO_LOGICAL_VS",err,error,*999)
1650 local_string=
char(string)
1651 READ(local_string,*,iostat=err,err=999) string_to_logical_vs
1653 exits(
"STRING_TO_LOGICAL_VS")
1655 999
CALL flagerror(
"Cannot convert '"//
char(string)//
"' to a logical",err,error,*998)
1656 998 errorsexits(
"STRING_TO_LOGICAL_VS",err,error)
1668 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1669 INTEGER(INTG),
INTENT(OUT) :: ERR
1672 REAL(SP) :: STRING_TO_SINGLE_C
1675 enters(
"STRING_TO_SINGLE_C",err,error,*999)
1677 READ(string,*,iostat=err,err=999) string_to_single_c
1679 exits(
"STRING_TO_SINGLE_C")
1681 999
CALL flagerror(
"Cannot convert '"//string(1:
len_trim(string))//
"' to a single real",err,error,*998)
1682 998 errorsexits(
"STRING_TO_SINGLE_C",err,error)
1695 INTEGER(INTG),
INTENT(OUT) :: ERR
1698 REAL(SP) :: STRING_TO_SINGLE_VS
1700 CHARACTER(LEN=MAXSTRLEN) :: LOCAL_STRING
1702 enters(
"STRING_TO_SINGLE_VS",err,error,*999)
1706 local_string=
char(string)
1707 READ(local_string,*,iostat=err,err=999) string_to_single_vs
1709 exits(
"STRING_TO_SINGLE_VS")
1711 999
CALL flagerror(
"Cannot convert '"//
char(string)//
"' to a single real",err,error,*998)
1712 998 errorsexits(
"STRING_TO_SINGLE_VS",err,error)
1724 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1726 CHARACTER(LEN=LEN(STRING)) :: CHARACTER_TO_LOWERCASE_C
1728 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"a")-
ichar(
"A"))
1731 character_to_lowercase_c=string
1734 character_to_lowercase_c(i:i)=
char(
ichar(string(i:i))+offset)
1751 CHARACTER(LEN=LEN(STRING)) :: CHARACTER_TO_LOWERCASE_VS
1753 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"a")-
ichar(
"A"))
1756 character_to_lowercase_vs=
char(string)
1774 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1778 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"a")-
ichar(
"A"))
1781 vstring_to_lowercase_c=string
1784 vstring_to_lowercase_c=
insert(vstring_to_lowercase_c,i,
char(
ichar(string(i:i))+offset))
1803 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"a")-
ichar(
"A"))
1806 vstring_to_lowercase_vs=string
1824 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1826 CHARACTER(LEN=LEN(STRING)) :: CHARACTER_TO_UPPERCASE_C
1828 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"A")-
ichar(
"a"))
1831 character_to_uppercase_c=string
1834 character_to_uppercase_c(i:i)=
char(
ichar(string(i:i))+offset)
1851 CHARACTER(LEN=LEN(STRING)) :: CHARACTER_TO_UPPERCASE_VS
1853 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"A")-
ichar(
"a"))
1856 character_to_uppercase_vs=
char(string)
1874 CHARACTER(LEN=*),
INTENT(IN) :: STRING
1878 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"A")-
ichar(
"a"))
1881 vstring_to_uppercase_c=string
1884 vstring_to_uppercase_c=
insert(vstring_to_uppercase_c,i,
char(
ichar(string(i:i))+offset))
1903 INTEGER(INTG),
PARAMETER :: OFFSET=(
ichar(
"A")-
ichar(
"a"))
1906 vstring_to_uppercase_vs=string
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
Converts a number to its equivalent character string representation.
Returns .TRUE. if a supplied string is a valid abbreviation of a second supplied string.
Converts a number to its equivalent varying string representation.
character(len=maxstrlen) function number_to_character_lintg(NUMBER, FORMAT, ERR, ERROR)
Converts a long integer number to its equivalent character string representation as determined by the...
type(varying_string) function vstring_to_lowercase_vs(STRING)
Returns a varying string that is the lowercase equivalent of the supplied varying string...
Returns a varying string which is the uppercase equivalent of the supplied string.
logical function is_abbreviation_vs_vs(SHORT, LONG, MIN_NUM_CHARACTERS)
IS_ABBREVIATION returns .TRUE. if the varying string SHORT is an abbreviation of the varying string L...
Returns a character string which is the lowercase equivalent of the supplied string.
logical function, public is_whitespace(CHARAC)
IS_WHITESPACE returns .TRUE. if the character CHARAC is a whitespace character (i.e. space, tabs, etc.)
This module contains all string manipulation and transformation routines.
Returns a varying string which is the lowercase equivalent of the supplied string.
logical function string_to_logical_vs(STRING, ERR, ERROR)
Converts a varying string representation of a boolean (TRUE or FALSE) to a logical.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
Returns a character string which is the uppercase equivalent of the supplied string.
integer(lintg) function string_to_long_integer_c(STRING, ERR, ERROR)
Converts a character string representation of a number to a long integer.
Converts a list to its equivalent character string representation.
character(len=maxstrlen) function list_to_character_sp(NUMBER_IN_LIST, LIST, FORMAT, ERR, ERROR)
Converts a single precision list to its equivalent character string representation as determined by t...
character(len=len(string)) function character_to_uppercase_vs(STRING)
Returns a character string which is uppercase equivalent of the supplied varying string.
This module contains all program wide constants.
Returns a character string which is the uppercase equivalent of the supplied string.
Converts a string representation of a boolean value (TRUE or FALSE) to a logical. ...
Converts a number to its equivalent character string representation.
Converts a list to its equivalent character string representation.
Returns .TRUE. if a supplied string is a valid abbreviation of a second supplied string.
Converts a string representation of a boolean value (TRUE or FALSE) to a logical. ...
integer(intg), parameter maxstrlen
Maximum string length fro character strings.
logical function, public is_digit(CHARAC)
IS_DIGIT returns .TRUE. if the character CHARAC is a digit character (i.e. 0..9)
character(len=maxstrlen) function number_to_character_intg(NUMBER, FORMAT, ERR, ERROR)
Converts an integer number to its equivalent character string representation as determined by the sup...
logical function string_to_logical_c(STRING, ERR, ERROR)
Converts a character string representation of a boolean (TRUE or FALSE) to a logical.
Converts a string representation of a number to a long integer.
subroutine, public exits(NAME)
Records the exit out of the named procedure.
character(len=len(string)) function character_to_lowercase_vs(STRING)
Returns a character string that is the lowercase equivalent of the supplied varying string...
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
character(len=len(string)) function character_to_uppercase_c(STRING)
Returns a character string which is uppercase equivalent of the supplied character string...
type(varying_string) function vstring_to_uppercase_vs(STRING)
Returns a varying string which is uppercase equivalent of the supplied varying string.
logical function is_abbreviation_vs_c(SHORT, LONG, MIN_NUM_CHARACTERS)
IS_ABBREVIATION returns .TRUE. if the varying string SHORT is an abbreviation of the character string...
character(len=maxstrlen) function list_to_character_c(NUMBER_IN_LIST, LIST, FORMAT, ERR, ERROR, LIST_LENGTHS)
Converts a character list to its equivalent character string representation as determined by the supp...
character(len=maxstrlen) function list_to_character_intg(NUMBER_IN_LIST, LIST, FORMAT, ERR, ERROR)
Converts an integer list to its equivalent character string representation as determined by the suppl...
character(len=maxstrlen) function number_to_character_sp(NUMBER, FORMAT, ERR, ERROR)
Converts a single precision number to its equivalent character string representation as determined by...
Converts a string representation of a number to a long integer.
Converts a string representation of a number to a double precision number.
character(len=maxstrlen) function, public logical_to_character(LOGICALVALUE, ERR, ERROR)
Converts a logical value to either a "TRUE" or "FALSE" character string.
type(varying_string) function vstring_to_uppercase_c(STRING)
Returns a varying string which is uppercase equivalent of the supplied character string.
Converts a string representation of a number to a single precision number.
logical function is_uppercase(CHARC)
Returns .TRUE. if the supplied character is an uppercase character.
real(dp) function string_to_double_c(STRING, ERR, ERROR)
Converts a character string representation of a number to a double precision number.
Converts a string representation of a number to a double precision number.
type(varying_string) function vstring_to_lowercase_c(STRING)
Returns a varying string that is the lowercase equivalent of the supplied character string...
type(varying_string) function, public logical_to_vstring(LOGICALVALUE, ERR, ERROR)
Converts a logical value to either a "TRUE" or "FALSE" varying string.
character(len=maxstrlen) function list_to_character_l(NUMBER_IN_LIST, LIST, FORMAT, ERR, ERROR)
Converts a logical list to its equivalent character string representation as determined by the suppli...
real(sp) function string_to_single_c(STRING, ERR, ERROR)
Converts a character string representation of a number to a single precision number.
type(varying_string) function number_to_vstring_sp(NUMBER, FORMAT, ERR, ERROR)
Converts a single precision number to its equivalent varying string representation as determined by t...
type(varying_string) function number_to_vstring_lintg(NUMBER, FORMAT, ERR, ERROR)
Converts a long integer number to its equivalent varying string representation as determined by the s...
type(varying_string) function number_to_vstring_dp(NUMBER, FORMAT, ERR, ERROR)
Converts a double precision number to its equivalent varying string representation as determined by t...
integer(intg) function string_to_integer_vs(STRING, ERR, ERROR)
Converts a varying string representation of a number to an integer.
Returns a character string which is the lowercase equivalent of the supplied string.
Converts a string representation of a number to an integer.
Returns a varying string which is the uppercase equivalent of the supplied string.
character(len=len(string)) function character_to_lowercase_c(STRING)
character(len=maxstrlen) function list_to_character_lintg(NUMBER_IN_LIST, LIST, FORMAT, ERR, ERROR)
Converts an long integer list to its equivalent character string representation as determined by the ...
logical function is_lowercase(CHARC)
Returns .TRUE. if the supplied character is a lowercase character.
real(sp) function string_to_single_vs(STRING, ERR, ERROR)
Converts a varying string representation of a number to a single precision number.
Converts a string representation of a number to an integer.
logical function, public is_letter(CHARAC)
IS_LETTER returns .TRUE. if the character CHARAC is a letter character (i.e. A..Z or a...
character(len=maxstrlen) function number_to_character_dp(NUMBER, FORMAT, ERR, ERROR)
Converts a double precision number to its equivalent character string representation as determined by...
character(len=maxstrlen) function list_to_character_dp(NUMBER_IN_LIST, LIST, FORMAT, ERR, ERROR)
Converts a double precision list to its equivalent character string representation as determined by t...
logical function is_abbreviation_c_c(SHORT, LONG, MIN_NUM_CHARACTERS)
IS_ABBREVIATION returns .TRUE. if the character string SHORT is an abbreviation of the character stri...
Flags an error condition.
Returns a varying string which is the lowercase equivalent of the supplied string.
real(dp) function string_to_double_vs(STRING, ERR, ERROR)
Converts a varying string representation of a number to a double precision number.
type(varying_string) function number_to_vstring_intg(NUMBER, FORMAT, ERR, ERROR)
Converts an integer number to its equivalent varying string representation as determined by the suppl...
integer(lintg) function string_to_long_integer_vs(STRING, ERR, ERROR)
Converts a varying string representation of a number to a long integer.
integer(intg) function string_to_integer_c(STRING, ERR, ERROR)
Converts a character string representation of a number to an integer.
Converts a string representation of a number to a single precision number.
This module contains all kind definitions.
logical function is_abbreviation_c_vs(SHORT, LONG, MIN_NUM_CHARACTERS)
IS_ABBREVIATION returns .TRUE. if the character string SHORT is an abbreviation of the varying string...