268 INTEGER(INTG) :: file_number
269 INTEGER(INTG) :: binary_file_revision
271 INTEGER(INTG) :: os_type
272 INTEGER(INTG) :: endian_type
273 INTEGER(INTG) :: char_format
274 INTEGER(INTG) :: int_format
275 INTEGER(INTG) :: sp_format
276 INTEGER(INTG) :: dp_format
279 INTEGER(INTG) :: sinteger_size
280 INTEGER(INTG) :: linteger_size
281 INTEGER(INTG) :: sp_real_size
282 INTEGER(INTG) :: dp_real_size
284 INTEGER(INTG) :: spc_real_size
285 INTEGER(INTG) :: dpc_real_size
286 CHARACTER(LEN=MAXSTRLEN) :: file_name
287 INTEGER(INTG) :: access_type
296 INTEGER(INTG) :: num_subtags
297 INTEGER(INTG) :: num_bytes
298 INTEGER(INTG) :: num_header_bytes
299 CHARACTER(LEN=MAXSTRLEN) :: header
310 SUBROUTINE binaryclosefile(FILE_NUMBER,ERR,CERROR)
313 INTEGER(INTG),
INTENT(IN) :: FILE_NUMBER
314 INTEGER(INTG),
INTENT(OUT) :: ERR,CERROR(*)
315 END SUBROUTINE binaryclosefile
317 SUBROUTINE binaryopenfile(FILE_NUMBER,CFNAME,CACCESSCODE,ERR,CERROR)
320 INTEGER(INTG),
INTENT(IN) :: FILE_NUMBER,CFNAME(*),CACCESSCODE(*)
321 INTEGER(INTG),
INTENT(OUT) :: ERR,CERROR(*)
322 END SUBROUTINE binaryopenfile
326 SUBROUTINE binarysetfile(FILE_NUMBER,SET_CODE,ERR,CERROR)
329 INTEGER(INTG),
INTENT(IN) :: FILE_NUMBER,SET_CODE
330 INTEGER(INTG),
INTENT(OUT) :: ERR,CERROR(*)
331 END SUBROUTINE binarysetfile
333 SUBROUTINE binaryskipfile(FILE_NUMBER,NUMBER_BYTES,ERR,CERROR)
336 INTEGER(INTG),
INTENT(IN) :: FILE_NUMBER,NUMBER_BYTES
337 INTEGER(INTG),
INTENT(OUT) :: ERR,CERROR(*)
338 END SUBROUTINE binaryskipfile
344 SUBROUTINE isbinaryfileopen(FILE_NUMBER,RETURNCODE,ERR,CERROR)
347 INTEGER(INTG),
INTENT(IN) :: FILE_NUMBER
348 INTEGER(INTG),
INTENT(OUT) :: RETURNCODE, ERR, CERROR(*)
349 END SUBROUTINE isbinaryfileopen
351 SUBROUTINE isendbinaryfile(FILE_NUMBER,RETURN_CODE,ERR,CERROR)
354 INTEGER(INTG),
INTENT(IN) :: FILE_NUMBER
355 INTEGER(INTG),
INTENT(OUT) :: RETURN_CODE,ERR,CERROR(*)
356 END SUBROUTINE isendbinaryfile
421 LOGICAL :: INQUIRE_OPEN_BINARY_FILE
424 inquire_open_binary_file=
ASSOCIATED(fileid%FILE_INFORMATION)
443 INTEGER(INTG),
INTENT(OUT) :: ERR
446 LOGICAL :: INQUIRE_EOF_BINARY_FILE
448 INTEGER(INTG) :: CERROR(100),RETURNCODE
449 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
451 enters(
"INQUIRE_EOF_BINARY_FILE",err,error,*999)
453 inquire_eof_binary_file=.false.
454 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 455 CALL isendbinaryfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
456 & returncode,err,cerror)
458 CALL c2fstring(cerror,dummy_error,err,error,*999)
459 CALL flagerror(dummy_error,err,error,*999)
461 inquire_eof_binary_file=(returncode==1)
463 CALL flagerror(
"Invalid FILEID",err,error,*999)
466 exits(
"INQUIRE_EOF_BINARY_FILE")
468 999 errorsexits(
"INQUIRE_EOF_BINARY_FILE",err,error)
485 INTEGER(INTG),
INTENT(OUT) :: ERR
488 INTEGER(INTG) :: CERROR(100)
489 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
491 enters(
"CLOSE_BINARY_FILE",err,error,*999)
493 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 494 CALL binaryclosefile(fileid%FILE_INFORMATION%FILE_NUMBER, err,&
497 CALL c2fstring(cerror,dummy_error,err,error,*999)
498 CALL flagerror(dummy_error,err,error,*999)
504 DEALLOCATE(fileid%FILE_INFORMATION)
506 CALL flagerror(
"Invalid FILEID",err,error,*999)
509 exits(
"CLOSE_BINARY_FILE")
511 999 errorsexits(
"CLOSE_BINARY_FILE",err,error)
528 INTEGER(INTG),
INTENT(OUT) :: ERR
531 INTEGER(INTG) :: CERROR(100)
533 enters(
"CLOSE_CMISS_BINARY_FILE",err,error,*999)
537 exits(
"CLOSE_CMISS_BINARY_FILE")
539 999 errorsexits(
"CLOSE_CMISS_BINARY_FILE",err,error)
558 CHARACTER(LEN=*),
INTENT(IN) :: COMMAND, FILENAME
559 INTEGER(INTG),
INTENT(OUT) :: ERR
562 INTEGER(INTG) :: CACCESSCODE(2), CERROR(100), CFNAME(100),&
564 CHARACTER(LEN=6) :: FACCESSCODE
565 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
567 enters(
"OPEN_BINARY_FILE",err,error,*999)
576 IF(filenumber/=0)
THEN 577 ALLOCATE(fileid%FILE_INFORMATION,stat=err)
580 fileid%FILE_INFORMATION%FILE_NUMBER=filenumber
581 fileid%FILE_INFORMATION%FILE_NAME=filename
583 CALL f2cstring(cfname,filename,err,error,*999)
584 IF(command(1:4)==
"READ")
THEN 587 ELSE IF(command(1:5)==
"WRITE")
THEN 591 CALL flagerror(
"Invalid command",err,error,*999)
593 CALL f2cstring(caccesscode,faccesscode,err,error,*999)
594 CALL binaryopenfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
595 & cfname,caccesscode,err,cerror)
597 CALL c2fstring(cerror,dummy_error,err,error,*999)
598 CALL flagerror(dummy_error,err,error,*999)
601 CALL flagerror(
"Could not allocate binary file information",&
605 CALL flagerror(
"No free binary files available",err,error,*999)
608 exits(
"OPEN_BINARY_FILE")
610 999
IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 612 DEALLOCATE(fileid%FILE_INFORMATION)
614 errorsexits(
"OPEN_BINARY_FILE",err,error)
623 & version,fileversion,command,extension,filename,err,error,*)
635 INTEGER(INTG),
INTENT(IN) :: FILE_TYPE
636 INTEGER(INTG),
INTENT(INOUT) :: NUMBER_TAGS
637 INTEGER(INTG),
INTENT(IN) :: VERSION(3)
638 INTEGER(INTG),
INTENT(OUT) :: FILEVERSION(3)
639 CHARACTER(LEN=*),
INTENT(IN) :: COMMAND, EXTENSION, FILENAME
640 INTEGER(INTG),
INTENT(OUT) :: ERR
643 INTEGER(INTG) :: FILE_NUM, FILE_NUMBER, FILETYPE, HEADINGSIZE,&
646 CHARACTER(LEN=17) :: CHARDATA
647 CHARACTER(LEN=MAXSTRLEN) :: ERROR_STRING,FULL_FILENAME,HEADING,&
650 enters(
"OPEN_CMISS_BINARY_FILE",err,error,*999)
652 full_filename=filename(1:
len_trim(filename))//
".bin"&
653 & //extension(1:
len_trim(extension))
655 IF(command(1:4)==
"READ")
THEN 659 &
CALL flagerror(
"Not a CMISS binary file",err,error,*999)
660 fileid%FILE_INFORMATION%BINARY_FILE_REVISION=
ichar(chardata(2:2))
662 SELECT CASE(fileid%FILE_INFORMATION%BINARY_FILE_REVISION)
666 & found. Please update file.",err,error,*999)
672 & found. Please update file.",err,error,*999)
674 nummachheaderbytes=
ichar(chardata(1:1))
677 IF(nummachheaderbytes==11)
THEN 678 fileid%FILE_INFORMATION%MACHINE_TYPE=
ichar(chardata(1:1))
679 fileid%FILE_INFORMATION%OS_TYPE=
ichar(chardata(2:2))
680 fileid%FILE_INFORMATION%ENDIAN_TYPE=
ichar(chardata(3:3))
681 fileid%FILE_INFORMATION%SP_FORMAT=
ichar(chardata(4:4))
682 fileid%FILE_INFORMATION%DP_FORMAT=
ichar(chardata(5:5))
683 fileid%FILE_INFORMATION%CHARACTER_SIZE=
ichar(chardata(6:6))
684 fileid%FILE_INFORMATION%INTEGER_SIZE=
ichar(chardata(7:7))
685 fileid%FILE_INFORMATION%SINTEGER_SIZE=
ichar(chardata(8:8))
686 fileid%FILE_INFORMATION%SP_REAL_SIZE=
ichar(chardata(9:9))
687 fileid%FILE_INFORMATION%DP_REAL_SIZE=
ichar(chardata(10:10))
688 fileid%FILE_INFORMATION%LOGICAL_SIZE=
ichar(chardata(11:11))
690 CALL flagerror(
"Invalid number of machine header bytes",&
696 nummachheaderbytes=
ichar(chardata(1:1))
699 IF(nummachheaderbytes==16)
THEN 700 fileid%FILE_INFORMATION%MACHINE_TYPE=
ichar(chardata(1:1))
701 fileid%FILE_INFORMATION%OS_TYPE=
ichar(chardata(2:2))
702 fileid%FILE_INFORMATION%ENDIAN_TYPE=
ichar(chardata(3:3))
703 fileid%FILE_INFORMATION%CHAR_FORMAT=
ichar(chardata(4:4))
704 fileid%FILE_INFORMATION%INT_FORMAT=
ichar(chardata(5:5))
705 fileid%FILE_INFORMATION%SP_FORMAT=
ichar(chardata(6:6))
706 fileid%FILE_INFORMATION%DP_FORMAT=
ichar(chardata(7:7))
707 fileid%FILE_INFORMATION%CHARACTER_SIZE=
ichar(chardata(8:8))
708 fileid%FILE_INFORMATION%INTEGER_SIZE=
ichar(chardata(9:9))
709 fileid%FILE_INFORMATION%SINTEGER_SIZE=
ichar(chardata(10:10))
710 fileid%FILE_INFORMATION%LINTEGER_SIZE=
ichar(chardata(11:11))
711 fileid%FILE_INFORMATION%SP_REAL_SIZE=
ichar(chardata(12:12))
712 fileid%FILE_INFORMATION%DP_REAL_SIZE=
ichar(chardata(13:13))
713 fileid%FILE_INFORMATION%LOGICAL_SIZE=
ichar(chardata(14:14))
714 fileid%FILE_INFORMATION%SPC_REAL_SIZE=
ichar(chardata(15:15))
715 fileid%FILE_INFORMATION%DPC_REAL_SIZE=
ichar(chardata(16:16))
717 CALL flagerror(
"Invalid number of machine header bytes",&
721 CALL flagerror(
"Unknown binary file header identity format",&
727 IF(filetype/=file_type)
THEN 728 WRITE(error_string,
'("File has a different file type:",/,& 729 & " File type is ",I3,/," Expected file type is ",I3)')&
731 CALL flagerror(warning_string,err,error,*999)
733 SELECT CASE(fileid%FILE_INFORMATION%BINARY_FILE_REVISION)
736 fileversion(1)=int(fversion,
intg)
739 IF(fileversion(1)/=version(1))
THEN 740 WRITE(warning_string,
'("File has a different version number:",/,& 741 & " File version is ",I2,".",I2,".",I2,/,& 742 & " Expected file version is ",I2,".",I2,".",I2)') &
743 & fileversion(1),fileversion(2),fileversion(3),&
744 & version(1),version(2),version(3)
749 IF(fileversion(1)/=version(1).OR.&
750 & fileversion(2)/=version(2).OR.&
751 & fileversion(3)/=version(3))
THEN 752 WRITE(warning_string,
'("File has a different version number:",/,& 753 & " File version is ",I2,".",I2,".",I2,/,& 754 & " Expected file version is ",I2,".",I2,".",I2)') &
755 & fileversion(1),fileversion(2),fileversion(3),&
756 & version(1),version(2),version(3)
760 CALL flagerror(
"Invalid binary file identity format",err,error,*999)
763 IF(headingsize==0)
THEN 767 WRITE(
op_string,
'("File heading: ",A)') heading(1:headingsize)
771 ELSE IF(command(1:5)==
"WRITE")
THEN 774 chardata(2:2)=
char(2)
777 chardata(1:1)=
char(16)
821 exits(
"OPEN_CMISS_BINARY_FILE")
823 999 errorsexits(
"OPEN_CMISS_BINARY_FILE",err,error)
859 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
860 INTEGER(INTG),
INTENT(OUT) :: DATA(*)
861 INTEGER(INTG),
INTENT(OUT) :: ERR
864 INTEGER(INTG) :: CERROR(100),ENDIAN
865 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
867 enters(
"READ_BINARY_FILE_INTG",err,error,*999)
869 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 875 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
876 ENDIAN,NUM_DATA,INTEGER_TYPE,DATA,ERR,CERROR)
878 CALL c2fstring(cerror,dummy_error,err,error,*999)
879 CALL flagerror(dummy_error,err,error,*999)
882 CALL flagerror(
"Invalid FILEID",err,error,*999)
885 exits(
"READ_BINARY_FILE_INTG")
887 999 errorsexits(
"READ_BINARY_FILE_INTG",err,error)
905 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
906 INTEGER(INTG),
INTENT(OUT) :: DATA
907 INTEGER(INTG),
INTENT(OUT) :: ERR
908 TYPE(varying_string),
INTENT(OUT) :: ERROR
910 INTEGER(INTG) :: CERROR(100),ENDIAN
911 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
913 enters(
"READ_BINARY_FILE_INTG1",err,error,*999)
915 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 917 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
919 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 924 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
925 & endian,1,integer_type,
DATA,err,cerror)
927 CALL c2fstring(cerror,dummy_error,err,error,*999)
928 CALL flagerror(dummy_error,err,error,*999)
932 CALL flagerror(
"Invalid FILEID",err,error,*999)
935 exits(
"READ_BINARY_FILE_INTG1")
937 999 errorsexits(
"READ_BINARY_FILE_INTG1",err,error)
955 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
956 INTEGER(SINTG),
INTENT(OUT) :: DATA(*)
957 INTEGER(INTG),
INTENT(OUT) :: ERR
958 TYPE(varying_string),
INTENT(OUT) :: ERROR
960 INTEGER(INTG) :: CERROR(100),ENDIAN
961 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
963 enters(
"READ_BINARY_FILE_SINTG",err,error,*999)
965 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 966 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 971 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
972 & endian,num_data,short_integer_type,
DATA,err,cerror)
974 CALL c2fstring(cerror,dummy_error,err,error,*999)
975 CALL flagerror(dummy_error,err,error,*999)
978 CALL flagerror(
"Invalid FILEID",err,error,*999)
981 exits(
"READ_BINARY_FILE_SINTG")
983 999 errorsexits(
"READ_BINARY_FILE_SINTG",err,error)
1001 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1002 INTEGER(SINTG),
INTENT(OUT) :: DATA
1003 INTEGER(INTG),
INTENT(OUT) :: ERR
1004 TYPE(varying_string),
INTENT(OUT) :: ERROR
1006 INTEGER(INTG) :: CERROR(100),ENDIAN
1007 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1009 enters(
"READ_BINARY_FILE_SINTG1",err,error,*999)
1011 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1012 IF(num_data/=1)
THEN 1013 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
1015 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1020 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1021 & endian,1,short_integer_type,
DATA,err,cerror)
1023 CALL c2fstring(cerror,dummy_error,err,error,*999)
1024 CALL flagerror(dummy_error,err,error,*999)
1028 CALL flagerror(
"Invalid FILEID",err,error,*999)
1031 exits(
"READ_BINARY_FILE_SINTG1")
1033 999 errorsexits(
"READ_BINARY_FILE_SINTG1",err,error)
1051 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1052 INTEGER(LINTG),
INTENT(OUT) :: DATA(*)
1053 INTEGER(INTG),
INTENT(OUT) :: ERR
1054 TYPE(varying_string),
INTENT(OUT) :: ERROR
1056 INTEGER(INTG) :: CERROR(100),ENDIAN
1057 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1059 enters(
"READ_BINARY_FILE_LINTG",err,error,*999)
1061 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1062 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1067 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1068 & endian,num_data,long_integer_type,
DATA,err,cerror)
1070 CALL c2fstring(cerror,dummy_error,err,error,*999)
1071 CALL flagerror(dummy_error,err,error,*999)
1074 CALL flagerror(
"Invalid FILEID",err,error,*999)
1077 exits(
"READ_BINARY_FILE_LINTG")
1079 999 errorsexits(
"READ_BINARY_FILE_LINTG",err,error)
1097 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1098 INTEGER(LINTG),
INTENT(OUT) :: DATA
1099 INTEGER(INTG),
INTENT(OUT) :: ERR
1100 TYPE(varying_string),
INTENT(OUT) :: ERROR
1102 INTEGER(INTG) :: CERROR(100),ENDIAN
1103 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1105 enters(
"READ_BINARY_FILE_LINTG1",err,error,*999)
1107 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1108 IF(num_data/=1)
THEN 1109 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
1111 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1116 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1117 & endian,1,long_integer_type,
DATA,err,cerror)
1119 CALL c2fstring(cerror,dummy_error,err,error,*999)
1120 CALL flagerror(dummy_error,err,error,*999)
1124 CALL flagerror(
"Invalid FILEID",err,error,*999)
1127 exits(
"READ_BINARY_FILE_LINTG1")
1129 999 errorsexits(
"READ_BINARY_FILE_LINTG1",err,error)
1147 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1148 REAL(SP),
INTENT(OUT) :: DATA(*)
1149 TYPE(varying_string),
INTENT(OUT) :: ERROR
1150 INTEGER(INTG),
INTENT(OUT) :: ERR
1152 INTEGER(INTG) :: CERROR(100),ENDIAN
1153 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1155 enters(
"READ_BINARY_FILE_SP",err,error,*999)
1157 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1158 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1163 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1164 & endian,num_data,single_real_type,
DATA,err,cerror)
1166 CALL c2fstring(cerror,dummy_error,err,error,*999)
1167 CALL flagerror(dummy_error,err,error,*999)
1170 CALL flagerror(
"Invalid FILEID",err,error,*999)
1173 exits(
"READ_BINARY_FILE_SP")
1175 999 errorsexits(
"READ_BINARY_FILE_SP",err,error)
1193 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1194 REAL(SP),
INTENT(OUT) :: DATA
1195 TYPE(varying_string),
INTENT(OUT) :: ERROR
1196 INTEGER(INTG),
INTENT(OUT) :: ERR
1198 INTEGER(INTG) :: CERROR(100),ENDIAN
1199 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1201 enters(
"READ_BINARY_FILE_SP1",err,error,*999)
1203 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1204 IF(num_data/=1)
THEN 1205 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
1207 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1212 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1213 & endian,1,single_real_type,
DATA,err,cerror)
1215 CALL c2fstring(cerror,dummy_error,err,error,*999)
1216 CALL flagerror(dummy_error,err,error,*999)
1220 CALL flagerror(
"Invalid FILEID",err,error,*999)
1223 exits(
"READ_BINARY_FILE_SP1")
1225 999 errorsexits(
"READ_BINARY_FILE_SP1",err,error)
1243 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1244 REAL(DP),
INTENT(OUT) :: DATA(*)
1245 INTEGER(INTG),
INTENT(OUT) :: ERR
1246 TYPE(varying_string),
INTENT(OUT) :: ERROR
1248 INTEGER(INTG) :: CERROR(100),ENDIAN
1249 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1251 enters(
"READ_BINARY_FILE_DP",err,error,*999)
1253 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1254 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1259 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1260 & endian,num_data,double_real_type,
DATA,err,cerror)
1262 CALL c2fstring(cerror,dummy_error,err,error,*999)
1263 CALL flagerror(dummy_error,err,error,*999)
1266 CALL flagerror(
"Invalid FILEID",err,error,*999)
1269 exits(
"READ_BINARY_FILE_DP")
1271 999 errorsexits(
"READ_BINARY_FILE_DP",err,error)
1289 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1290 REAL(DP),
INTENT(OUT) :: DATA
1291 INTEGER(INTG),
INTENT(OUT) :: ERR
1292 TYPE(varying_string),
INTENT(OUT) :: ERROR
1294 INTEGER(INTG) :: CERROR(100),ENDIAN
1295 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1297 enters(
"READ_BINARY_FILE_DP1",err,error,*999)
1299 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1300 IF(num_data/=1)
THEN 1301 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
1303 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1308 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1309 & endian,1,double_real_type,
DATA,err,cerror)
1311 CALL c2fstring(cerror,dummy_error,err,error,*999)
1312 CALL flagerror(dummy_error,err,error,*999)
1316 CALL flagerror(
"Invalid FILEID",err,error,*999)
1319 exits(
"READ_BINARY_FILE_DP1")
1321 999 errorsexits(
"READ_BINARY_FILE_DP1",err,error)
1339 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1340 CHARACTER(LEN=*),
INTENT(OUT) :: DATA
1341 INTEGER(INTG),
INTENT(OUT) :: ERR
1342 TYPE(varying_string),
INTENT(OUT) :: ERROR
1344 INTEGER(INTG) :: CERROR(100),CSTRING(250),LENGTH
1345 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1347 enters(
"READ_BINARY_FILE_CHARACTER",err,error,*999)
1349 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1350 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER, &
1354 CALL c2fstring(cerror,dummy_error,err,error,*999)
1355 CALL flagerror(dummy_error,err,error,*999)
1357 length=cstringlength(cstring)
1358 IF(length==0.AND.num_data==1)
THEN 1363 CALL c2fstring(cstring,
DATA,err,error,*999)
1367 CALL flagerror(
"Invalid FILEID",err,error,*999)
1370 exits(
"READ_BINARY_FILE_CHARACTER")
1372 999 errorsexits(
"READ_BINARY_FILE_CHARACTER",err,error)
1390 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1391 LOGICAL,
INTENT(OUT) :: DATA(*)
1392 INTEGER(INTG),
INTENT(OUT) :: ERR
1393 TYPE(varying_string),
INTENT(OUT) :: ERROR
1395 INTEGER(INTG) :: CERROR(100),ENDIAN
1396 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1398 enters(
"READ_BINARY_FILE_LOGICAL",err,error,*999)
1400 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1401 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1406 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1407 & endian,num_data,logical_type,
DATA,err,cerror)
1409 CALL c2fstring(cerror,dummy_error,err,error,*999)
1410 CALL flagerror(dummy_error,err,error,*999)
1413 CALL flagerror(
"Invalid FILEID",err,error,*999)
1416 exits(
"READ_BINARY_FILE_LOGICAL")
1418 999 errorsexits(
"READ_BINARY_FILE_LOGICAL",err,error)
1436 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1437 LOGICAL,
INTENT(OUT) :: DATA
1438 INTEGER(INTG),
INTENT(OUT) :: ERR
1439 TYPE(varying_string),
INTENT(OUT) :: ERROR
1441 INTEGER(INTG) :: CERROR(100),ENDIAN
1442 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1444 enters(
"READ_BINARY_FILE_LOGICAL1",err,error,*999)
1446 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1447 IF(num_data/=1)
THEN 1448 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
1450 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1455 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1456 & endian,1,logical_type,
DATA,err,cerror)
1458 CALL c2fstring(cerror,dummy_error,err,error,*999)
1459 CALL flagerror(dummy_error,err,error,*999)
1463 CALL flagerror(
"Invalid FILEID",err,error,*999)
1466 exits(
"READ_BINARY_FILE_LOGICAL1")
1468 999 errorsexits(
"READ_BINARY_FILE_LOGICAL1",err,error)
1487 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1488 COMPLEX(SPC),
INTENT(OUT) :: DATA(*)
1489 INTEGER(INTG),
INTENT(OUT) :: ERR
1490 TYPE(varying_string),
INTENT(OUT) :: ERROR
1492 INTEGER(INTG) :: CERROR(100),ENDIAN
1493 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1495 enters(
"READ_BINARY_FILE_SPC",err,error,*999)
1497 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1498 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1503 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1504 & endian,num_data,single_complex_type,
DATA,err,cerror)
1506 CALL c2fstring(cerror,dummy_error,err,error,*999)
1507 CALL flagerror(dummy_error,err,error,*999)
1510 CALL flagerror(
"Invalid FILEID",err,error,*999)
1513 exits(
"READ_BINARY_FILE_SPC")
1515 999 errorsexits(
"READ_BINARY_FILE_SPC",err,error)
1534 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1535 COMPLEX(SPC),
INTENT(OUT) :: DATA
1536 INTEGER(INTG),
INTENT(OUT) :: ERR
1537 TYPE(varying_string),
INTENT(OUT) :: ERROR
1539 INTEGER(INTG) :: CERROR(100),ENDIAN
1540 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1542 enters(
"READ_BINARY_FILE_SPC1",err,error,*999)
1544 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1545 IF(num_data/=1)
THEN 1546 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
1548 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1553 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1554 & endian,1,single_complex_type,
DATA,err,cerror)
1556 CALL c2fstring(cerror,dummy_error,err,error,*999)
1557 CALL flagerror(dummy_error,err,error,*999)
1561 CALL flagerror(
"Invalid FILEID",err,error,*999)
1564 exits(
"READ_BINARY_FILE_SPC1")
1566 999 errorsexits(
"READ_BINARY_FILE_SPC1",err,error)
1585 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1586 COMPLEX(DPC),
INTENT(OUT) :: DATA(*)
1587 INTEGER(INTG),
INTENT(OUT) :: ERR
1588 TYPE(varying_string),
INTENT(OUT) :: ERROR
1590 INTEGER(INTG) :: CERROR(100),ENDIAN
1591 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1593 enters(
"READ_BINARY_FILE_DPC",err,error,*999)
1595 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1596 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1601 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1602 & endian,num_data,double_complex_type,
DATA,err,cerror)
1604 CALL c2fstring(cerror,dummy_error,err,error,*999)
1605 CALL flagerror(dummy_error,err,error,*999)
1608 CALL flagerror(
"Invalid FILEID",err,error,*999)
1611 exits(
"READ_BINARY_FILE_DPC")
1613 999 errorsexits(
"READ_BINARY_FILE_DPC",err,error)
1632 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
1633 COMPLEX(DPC),
INTENT(OUT) :: DATA
1634 INTEGER(INTG),
INTENT(OUT) :: ERR
1635 TYPE(varying_string),
INTENT(OUT) :: ERROR
1637 INTEGER(INTG) :: CERROR(100),ENDIAN
1638 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1640 enters(
"READ_BINARY_FILE_DPC1",err,error,*999)
1642 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1643 IF(num_data/=1)
THEN 1644 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
1646 IF(fileid%FILE_INFORMATION%ENDIAN_TYPE/=machine_endian)
THEN 1651 CALL binaryreadfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1652 & endian,1,double_complex_type,
DATA,err,cerror)
1654 CALL c2fstring(cerror,dummy_error,err,error,*999)
1655 CALL flagerror(dummy_error,err,error,*999)
1659 CALL flagerror(
"Invalid FILEID",err,error,*999)
1662 exits(
"READ_BINARY_FILE_DPC1")
1664 999 errorsexits(
"READ_BINARY_FILE_DPC1",err,error)
1682 INTEGER(INTG),
INTENT(OUT) :: ERR
1683 TYPE(varying_string),
INTENT(OUT) :: ERROR
1685 INTEGER(INTG) :: INTDATA(2)
1687 enters(
"READ_BINARY_TAG_HEADER",err,error,*999)
1689 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1691 tag%INDEX=intdata(1)
1692 tag%NUM_HEADER_BYTES=intdata(2)
1693 IF(tag%NUM_HEADER_BYTES>maxstrlen)
THEN 1694 CALL flagerror(
"Tag header length greater than maximum & 1695 &string length",err,error,*999)
1699 SELECT CASE(fileid%FILE_INFORMATION%BINARY_FILE_REVISION)
1705 CALL flagerror(
"Invalid binary file header identity format",&
1708 IF(tag%NUM_SUBTAGS==0)
THEN 1713 IF(tag%NUM_BYTES<0)
CALL flagerror(
"Invalid number of tag bytes",&
1716 CALL flagerror(
"Invalid FILEID",err,error,*999)
1719 exits(
"READ_BINARY_TAG_HEADER")
1721 999 errorsexits(
"READ_BINARY_TAG_HEADER",err,error)
1742 INTEGER(INTG),
INTENT(IN) :: NUMBER_TAGS
1743 INTEGER(INTG),
INTENT(OUT) :: ERR
1744 TYPE(varying_string),
INTENT(OUT) :: ERROR
1746 INTEGER(INTG) :: NUMBER_HEADER_BYTES,NUMBER_SKIP_BYTES
1748 enters(
"RESET_BINARY_NUMBER_TAGS",err,error,*999)
1750 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1757 number_skip_bytes=integer_size+single_real_size
1769 CALL flagerror(
"Invalid FILEID",err,error,*999)
1772 exits(
"RESET_BINARY_NUMBER_TAGS")
1774 999 errorsexits(
"RESET_BINARY_NUMBER_TAGS",err,error)
1794 INTEGER(INTG),
INTENT(IN) :: SET_CODE
1795 INTEGER(INTG),
INTENT(OUT) :: ERR
1796 TYPE(varying_string),
INTENT(OUT) :: ERROR
1798 INTEGER(INTG) :: CERROR(100)
1799 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1801 enters(
"SET_BINARY_FILE",err,error,*999)
1803 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1804 CALL binarysetfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1805 & set_code,err,cerror)
1807 CALL c2fstring(cerror,dummy_error,err,error,*999)
1808 CALL flagerror(dummy_error,err,error,*999)
1811 CALL flagerror(
"Invalid FILEID",err,error,*999)
1814 exits(
"SET_BINARY_FILE")
1816 999 errorsexits(
"SET_BINARY_FILE",err,error)
1838 INTEGER(INTG),
INTENT(IN) :: SKIP
1839 INTEGER(INTG),
INTENT(OUT) :: ERR
1840 TYPE(varying_string),
INTENT(OUT) :: ERROR
1842 INTEGER(INTG) :: BINARY_FILE_REVISION,INTDATA(1),NUMBER_SKIP_BYTES
1843 CHARACTER(LEN=11) :: CHARDATA
1845 enters(
"SKIP_CM_BINARY_HEADER",err,error,*999)
1847 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1851 &
CALL flagerror(
"Invalid SKIP code",err,error,*999)
1856 &
CALL flagerror(
"Not a CMISS binary file",err,error,*999)
1860 binary_file_revision=ichar(chardata(2:2))
1861 SELECT CASE(binary_file_revision)
1866 number_skip_bytes=ichar(chardata(1:1))
1868 CALL flagerror(
"Unknown binary file header identity format",&
1875 number_skip_bytes=integer_size+single_real_size
1878 number_skip_bytes=intdata(1)*character_size+integer_size
1882 CALL flagerror(
"Invalid FILEID",err,error,*999)
1885 exits(
"SKIP_CM_BINARY_HEADER")
1887 999 errorsexits(
"SKIP_CM_BINARY_HEADER",err,error)
1904 INTEGER(INTG),
INTENT(IN) :: NUMBER_BYTES
1905 INTEGER(INTG),
INTENT(OUT) :: ERR
1906 TYPE(varying_string),
INTENT(OUT) :: ERROR
1908 INTEGER(INTG) :: CERROR(100)
1909 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1911 enters(
"SKIP_BINARY_FILE",err,error,*999)
1913 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1914 IF(number_bytes<=0) &
1915 &
CALL flagerror(
"NUMBER_BYTES to skip is <= 0",err,error,*999)
1916 CALL binaryskipfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1917 & number_bytes,err,cerror)
1919 CALL c2fstring(cerror,dummy_error,err,error,*999)
1920 CALL flagerror(dummy_error,err,error,*999)
1923 CALL flagerror(
"Invalid FILEID",err,error,*999)
1926 exits(
"SKIP_BINARY_FILE")
1928 999 errorsexits(
"SKIP_BINARY_FILE",err,error)
1946 INTEGER(INTG),
INTENT(OUT) :: ERR
1947 TYPE(varying_string),
INTENT(OUT) :: ERROR
1949 INTEGER(INTG) :: CERROR(100),i
1950 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
1953 enters(
"SKIP_BINARY_TAGS",err,error,*999)
1955 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 1956 IF(tag%NUM_SUBTAGS>0)
THEN 1957 DO i=1,tag%NUM_SUBTAGS
1962 CALL binaryskipfile(fileid%FILE_INFORMATION%FILE_NUMBER,&
1963 & tag%NUM_BYTES,err,cerror)
1966 CALL flagerror(
"Invalid FILEID",err,error,*999)
1969 exits(
"SKIP_BINARY_TAGS")
1971 999 errorsexits(
"SKIP_BINARY_TAGS",err,error)
2007 INTEGER(INTG),
INTENT(IN) :: NUM_DATA, DATA(*)
2008 INTEGER(INTG),
INTENT(OUT) :: ERR
2009 TYPE(varying_string),
INTENT(OUT) :: ERROR
2011 INTEGER(INTG) :: CERROR(100)
2012 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2014 enters(
"WRITE_BINARY_FILE_INTG",err,error,*999)
2016 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2017 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2020 CALL c2fstring(cerror,dummy_error,err,error,*999)
2021 CALL flagerror(dummy_error,err,error,*999)
2024 CALL flagerror(
"Invalid FILEID",err,error,*999)
2027 exits(
"WRITE_BINARY_FILE_INTG")
2029 999 errorsexits(
"WRITE_BINARY_FILE_INTG",err,error)
2047 INTEGER(INTG),
INTENT(IN) :: NUM_DATA, DATA
2048 INTEGER(INTG),
INTENT(OUT) :: ERR
2049 TYPE(varying_string),
INTENT(OUT) :: ERROR
2051 INTEGER(INTG) :: CERROR(100)
2052 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2054 enters(
"WRITE_BINARY_FILE_INTG1",err,error,*999)
2056 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2057 IF(num_data/=1)
THEN 2058 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
2060 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2063 CALL c2fstring(cerror,dummy_error,err,error,*999)
2064 CALL flagerror(dummy_error,err,error,*999)
2068 CALL flagerror(
"Invalid FILEID",err,error,*999)
2071 exits(
"WRITE_BINARY_FILE_INTG1")
2073 999 errorsexits(
"WRITE_BINARY_FILE_INTG1",err,error)
2091 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2092 INTEGER(SINTG),
INTENT(IN) :: DATA(*)
2093 INTEGER(INTG),
INTENT(OUT) :: ERR
2094 TYPE(varying_string),
INTENT(OUT) :: ERROR
2096 INTEGER(INTG) :: CERROR(100)
2097 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2099 enters(
"WRITE_BINARY_FILE_SINTG",err,error,*999)
2101 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2102 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2106 CALL c2fstring(cerror,dummy_error,err,error,*999)
2107 CALL flagerror(dummy_error,err,error,*999)
2110 CALL flagerror(
"Invalid FILEID",err,error,*999)
2113 exits(
"WRITE_BINARY_FILE_SINTG")
2115 999 errorsexits(
"WRITE_BINARY_FILE_SINTG",err,error)
2133 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2134 INTEGER(SINTG),
INTENT(IN) :: DATA
2135 INTEGER(INTG),
INTENT(OUT) :: ERR
2136 TYPE(varying_string),
INTENT(OUT) :: ERROR
2138 INTEGER(INTG) :: CERROR(100)
2139 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2141 enters(
"WRITE_BINARY_FILE_SINTG1",err,error,*999)
2143 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2144 IF(num_data/=1)
THEN 2145 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
2147 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2150 CALL c2fstring(cerror,dummy_error,err,error,*999)
2151 CALL flagerror(dummy_error,err,error,*999)
2155 CALL flagerror(
"Invalid FILEID",err,error,*999)
2158 exits(
"WRITE_BINARY_FILE_SINTG1")
2160 999 errorsexits(
"WRITE_BINARY_FILE_SINTG1",err,error)
2178 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2179 INTEGER(LINTG),
INTENT(IN) :: DATA(*)
2180 INTEGER(INTG),
INTENT(OUT) :: ERR
2181 TYPE(varying_string),
INTENT(OUT) :: ERROR
2183 INTEGER(INTG) :: CERROR(100)
2184 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2186 enters(
"WRITE_BINARY_FILE_LINTG",err,error,*999)
2188 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2189 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2193 CALL c2fstring(cerror,dummy_error,err,error,*999)
2194 CALL flagerror(dummy_error,err,error,*999)
2197 CALL flagerror(
"Invalid FILEID",err,error,*999)
2200 exits(
"WRITE_BINARY_FILE_LINTG")
2202 999 errorsexits(
"WRITE_BINARY_FILE_LINTG",err,error)
2220 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2221 INTEGER(LINTG),
INTENT(IN) :: DATA
2222 INTEGER(INTG),
INTENT(OUT) :: ERR
2223 TYPE(varying_string),
INTENT(OUT) :: ERROR
2225 INTEGER(INTG) :: CERROR(100)
2226 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2228 enters(
"WRITE_BINARY_FILE_LINTG1",err,error,*999)
2230 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2231 IF(num_data/=1)
THEN 2232 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
2234 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2237 CALL c2fstring(cerror,dummy_error,err,error,*999)
2238 CALL flagerror(dummy_error,err,error,*999)
2242 CALL flagerror(
"Invalid FILEID",err,error,*999)
2245 exits(
"WRITE_BINARY_FILE_LINTG1")
2247 999 errorsexits(
"WRITE_BINARY_FILE_LINTG1",err,error)
2266 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2267 REAL(SP),
INTENT(IN) :: DATA(*)
2268 INTEGER(INTG),
INTENT(OUT) :: ERR
2269 TYPE(varying_string),
INTENT(OUT) :: ERROR
2271 INTEGER(INTG) :: CERROR(100)
2272 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2274 enters(
"WRITE_BINARY_FILE_SP",err,error,*999)
2276 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2277 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2281 CALL c2fstring(cerror,dummy_error,err,error,*999)
2282 CALL flagerror(dummy_error,err,error,*999)
2285 CALL flagerror(
"Invalid FILEID",err,error,*999)
2288 exits(
"WRITE_BINARY_FILE_SP")
2290 999 errorsexits(
"WRITE_BINARY_FILE_SP",err,error)
2308 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2309 REAL(SP),
INTENT(IN) :: DATA
2310 INTEGER(INTG),
INTENT(OUT) :: ERR
2311 TYPE(varying_string),
INTENT(OUT) :: ERROR
2313 INTEGER(INTG) :: CERROR(100)
2314 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2316 enters(
"WRITE_BINARY_FILE_SP1",err,error,*999)
2318 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2319 IF(num_data/=1)
THEN 2320 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
2322 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2325 CALL c2fstring(cerror,dummy_error,err,error,*999)
2326 CALL flagerror(dummy_error,err,error,*999)
2330 CALL flagerror(
"Invalid FILEID",err,error,*999)
2333 exits(
"WRITE_BINARY_FILE_SP1")
2335 999 errorsexits(
"WRITE_BINARY_FILE_SP1",err,error)
2354 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2355 REAL(DP),
INTENT(IN) :: DATA(*)
2356 INTEGER(INTG),
INTENT(OUT) :: ERR
2357 TYPE(varying_string),
INTENT(OUT) :: ERROR
2359 INTEGER(INTG) :: CERROR(100)
2360 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2362 enters(
"WRITE_BINARY_FILE_DP",err,error,*999)
2364 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2365 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2369 CALL c2fstring(cerror,dummy_error,err,error,*999)
2370 CALL flagerror(dummy_error,err,error,*999)
2373 CALL flagerror(
"Invalid FILEID",err,error,*999)
2376 exits(
"WRITE_BINARY_FILE_DP")
2378 999 errorsexits(
"WRITE_BINARY_FILE_DP",err,error)
2396 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2397 REAL(DP),
INTENT(IN) :: DATA
2398 INTEGER(INTG),
INTENT(OUT) :: ERR
2399 TYPE(varying_string),
INTENT(OUT) :: ERROR
2401 INTEGER(INTG) :: CERROR(100)
2402 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2404 enters(
"WRITE_BINARY_FILE_DP1",err,error,*999)
2406 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2407 IF(num_data/=1)
THEN 2408 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
2410 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2413 CALL c2fstring(cerror,dummy_error,err,error,*999)
2414 CALL flagerror(dummy_error,err,error,*999)
2418 CALL flagerror(
"Invalid FILEID",err,error,*999)
2421 exits(
"WRITE_BINARY_FILE_DP1")
2423 999 errorsexits(
"WRITE_BINARY_FILE_DP1",err,error)
2441 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2442 CHARACTER(LEN=*),
INTENT(IN) :: DATA
2443 INTEGER(INTG),
INTENT(OUT) :: ERR
2444 TYPE(varying_string),
INTENT(OUT) :: ERROR
2446 INTEGER(INTG) :: CERROR(100),CSTRING(250)
2447 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2449 enters(
"WRITE_BINARY_FILE_CHARACTER",err,error,*999)
2451 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2452 CALL f2cstring(cstring,
DATA,err,error,*999)
2453 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2457 CALL c2fstring(cerror,dummy_error,err,error,*999)
2458 CALL flagerror(dummy_error,err,error,*999)
2461 CALL flagerror(
"Invalid FILEID",err,error,*999)
2464 exits(
"WRITE_BINARY_FILE_CHARACTER")
2466 999 errorsexits(
"WRITE_BINARY_FILE_CHARACTER",err,error)
2484 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2485 LOGICAL,
INTENT(IN) :: DATA(*)
2486 INTEGER(INTG),
INTENT(OUT) :: ERR
2487 TYPE(varying_string),
INTENT(OUT) :: ERROR
2489 INTEGER(INTG) :: CERROR(100)
2490 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2492 enters(
"WRITE_BINARY_FILE_LOGICAL",err,error,*999)
2494 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2495 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2498 CALL c2fstring(cerror,dummy_error,err,error,*999)
2499 CALL flagerror(dummy_error,err,error,*999)
2502 CALL flagerror(
"Invalid FILEID",err,error,*999)
2505 exits(
"WRITE_BINARY_FILE_LOGICAL")
2507 999 errorsexits(
"WRITE_BINARY_FILE_LOGICAL",err,error)
2525 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2526 LOGICAL,
INTENT(IN) :: DATA
2527 INTEGER(INTG),
INTENT(OUT) :: ERR
2528 TYPE(varying_string),
INTENT(OUT) :: ERROR
2530 INTEGER(INTG) :: CERROR(100)
2531 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2533 enters(
"WRITE_BINARY_FILE_LOGICAL1",err,error,*999)
2535 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2536 IF(num_data/=1)
THEN 2537 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
2539 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2542 CALL c2fstring(cerror,dummy_error,err,error,*999)
2543 CALL flagerror(dummy_error,err,error,*999)
2547 CALL flagerror(
"Invalid FILEID",err,error,*999)
2550 exits(
"WRITE_BINARY_FILE_LOGICAL1")
2552 999 errorsexits(
"WRITE_BINARY_FILE_LOGICAL1",err,error)
2571 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2572 COMPLEX(SPC),
INTENT(IN) :: DATA(*)
2573 INTEGER(INTG),
INTENT(OUT) :: ERR
2574 TYPE(varying_string),
INTENT(OUT) :: ERROR
2576 INTEGER(INTG) :: CERROR(100)
2577 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2579 enters(
"WRITE_BINARY_FILE_SPC",err,error,*999)
2581 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2582 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2586 CALL c2fstring(cerror,dummy_error,err,error,*999)
2587 CALL flagerror(dummy_error,err,error,*999)
2590 CALL flagerror(
"Invalid FILEID",err,error,*999)
2593 exits(
"WRITE_BINARY_FILE_SPC")
2595 999 errorsexits(
"WRITE_BINARY_FILE_SPC",err,error)
2613 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2614 COMPLEX(SPC),
INTENT(IN) :: DATA
2615 INTEGER(INTG),
INTENT(OUT) :: ERR
2616 TYPE(varying_string),
INTENT(OUT) :: ERROR
2618 INTEGER(INTG) :: CERROR(100)
2619 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2621 enters(
"WRITE_BINARY_FILE_SPC1",err,error,*999)
2623 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2624 IF(num_data/=1)
THEN 2625 CALL flagerror(
"Number of data items not equal to one",err,error,*999)
2627 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2631 CALL c2fstring(cerror,dummy_error,err,error,*999)
2632 CALL flagerror(dummy_error,err,error,*999)
2636 CALL flagerror(
"Invalid FILEID",err,error,*999)
2639 exits(
"WRITE_BINARY_FILE_SPC1")
2641 999 errorsexits(
"WRITE_BINARY_FILE_SPC1",err,error)
2660 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2661 COMPLEX(DPC),
INTENT(IN) :: DATA(*)
2662 INTEGER(INTG),
INTENT(OUT) :: ERR
2663 TYPE(varying_string),
INTENT(OUT) :: ERROR
2665 INTEGER(INTG) :: CERROR(100)
2666 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2668 enters(
"WRITE_BINARY_FILE_DPC",err,error,*999)
2670 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2671 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2675 CALL c2fstring(cerror,dummy_error,err,error,*999)
2676 CALL flagerror(dummy_error,err,error,*999)
2679 CALL flagerror(
"Invalid FILEID",err,error,*999)
2682 exits(
"WRITE_BINARY_FILE_DPC")
2684 999 errorsexits(
"WRITE_BINARY_FILE_DPC",err,error)
2702 INTEGER(INTG),
INTENT(IN) :: NUM_DATA
2703 COMPLEX(DPC),
INTENT(IN) :: DATA
2704 INTEGER(INTG),
INTENT(OUT) :: ERR
2705 TYPE(varying_string),
INTENT(OUT) :: ERROR
2707 INTEGER(INTG) :: CERROR(100)
2708 CHARACTER(LEN=MAXSTRLEN) :: DUMMY_ERROR
2710 enters(
"WRITE_BINARY_FILE_DPC1",err,error,*999)
2712 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2713 IF(num_data/=1)
THEN 2714 CALL flagerror(
"Number of data item not equal to one",err,error,*999)
2716 CALL binarywritefile(fileid%FILE_INFORMATION%FILE_NUMBER,&
2720 CALL c2fstring(cerror,dummy_error,err,error,*999)
2721 CALL flagerror(dummy_error,err,error,*999)
2725 CALL flagerror(
"Invalid FILEID",err,error,*999)
2728 exits(
"WRITE_BINARY_FILE_DPC1")
2730 999 errorsexits(
"WRITE_BINARY_FILE_DPC1",err,error)
2748 INTEGER(INTG),
INTENT(OUT) :: ERR
2749 TYPE(varying_string),
INTENT(OUT) :: ERROR
2751 INTEGER(INTG) :: INTDATA(2)
2753 enters(
"WRITE_BINARY_TAG_HEADER",err,error,*999)
2755 IF(
ASSOCIATED(fileid%FILE_INFORMATION))
THEN 2756 intdata(1)=tag%INDEX
2757 tag%NUM_HEADER_BYTES=len_trim(tag%HEADER)
2758 intdata(2)=tag%NUM_HEADER_BYTES
2761 & tag%HEADER,err,error,*999)
2763 IF(tag%NUM_SUBTAGS>0) &
2766 CALL flagerror(
"Invalid FILEID",err,error,*999)
2769 exits(
"WRITE_BINARY_TAG_HEADER")
2771 999 errorsexits(
"WRITE_BINARY_TAG_HEADER",err,error)
integer(intg), parameter machine_char_format
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
subroutine read_binary_file_sintg(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter, public cmiss_binary_matrix_file
logical function inquire_eof_binary_file(FILEID, ERR, ERROR)
integer(intg), parameter cmiss_binary_identity_header
logical, dimension(max_num_binary_files), save binary_file_used
subroutine reset_binary_number_tags(FILEID, NUMBER_TAGS, ERR, ERROR,)
subroutine write_binary_file_dpc1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine read_binary_file_dpc(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine read_binary_file_dp1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter integer_size
subroutine read_binary_file_sp1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_intg1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_tag_header(FILEID, TAG, ERR, ERROR,)
recursive subroutine skip_binary_tags(FILEID, TAG, ERR, ERROR,)
subroutine close_binary_file(FILEID, ERR, ERROR,)
integer(intg), parameter, public file_current
integer, parameter intg
Standard integer kind.
integer(intg), parameter file_change_endian
subroutine read_binary_file_logical1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
logical function inquire_open_binary_file(FILEID)
integer(intg), parameter cmiss_binary_machine_header
integer(intg), parameter machine_os
subroutine write_binary_file_logical1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter double_complex_size
integer(intg), parameter machine_endian
subroutine read_binary_file_dpc1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_intg(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine read_binary_file_lintg(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_sp(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_spc1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter binary_file_readable
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine read_binary_file_logical(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter, public cmiss_binary_history_file
subroutine read_binary_file_spc(FILEID, NUM_DATA, DATA, ERR, ERROR,)
This module contains all program wide constants.
integer(intg), parameter cmiss_binary_identity
Flags a warning to the user.
integer(intg), parameter machine_type
integer(intg), parameter, public cmiss_binary_signal_file
subroutine read_binary_file_sp(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine read_binary_file_dp(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_lintg(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter machine_dp_format
integer(intg), parameter logical_size
integer(intg), parameter, public file_beginning
subroutine, public exits(NAME)
Records the exit out of the named procedure.
integer(intg), parameter machine_int_format
subroutine read_binary_file_intg1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_sintg(FILEID, NUM_DATA, DATA, ERR, ERROR,)
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
integer(intg), parameter binary_file_writable
integer(intg), parameter, public general_output_type
General output type.
subroutine read_binary_file_character(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter short_integer_size
integer(intg), parameter single_complex_size
subroutine read_binary_file_intg(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine skip_cm_binary_header(FILEID, SKIP, ERR, ERROR,)
integer(intg), parameter double_real_size
subroutine write_binary_file_spc(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine skip_binary_file(FILEID, NUMBER_BYTES, ERR, ERROR,)
subroutine read_binary_file_sintg1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine read_binary_file_lintg1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_dp1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine read_binary_file_spc1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
This module handles the reading and writing of binary files.
integer(intg), parameter cmiss_binary_file_header
integer(intg), parameter machine_sp_format
integer(intg), parameter character_size
integer(intg), parameter max_num_binary_files
subroutine read_binary_tag_header(FILEID, TAG, ERR, ERROR,)
integer(intg), parameter long_integer_size
subroutine write_binary_file_logical(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_dp(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_sintg1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
integer(intg), parameter, public file_end
subroutine write_binary_file_dpc(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_sp1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine write_binary_file_character(FILEID, NUM_DATA, DATA, ERR, ERROR,)
subroutine set_binary_file(FILEID, SET_CODE, ERR, ERROR,)
subroutine open_binary_file(FILEID, COMMAND, FILENAME, ERR, ERROR,)
character(len=maxstrlen), dimension(max_output_lines), save, public op_string
The array of lines to output.
This module contains all machine dependent constants for AIX systems.
integer(intg), parameter single_real_size
Flags an error condition.
subroutine close_cmiss_binary_file(FILEID, ERR, ERROR,)
subroutine open_cmiss_binary_file(FILEID, FILE_TYPE, NUMBER_TAGS, VERSION, FILEVERSION, COMMAND, EXTENSION, FILENAME, ERR, ERROR,)
subroutine write_binary_file_lintg1(FILEID, NUM_DATA, DATA, ERR, ERROR,)
This module contains all kind definitions.
integer(intg), parameter file_same_endian