C*---------------------------------------------------------------------* C| G E T B U F : GET INPUT BUFFER FROM FILE | C*---------------------------------------------------------------------* LOGICAL FUNCTION GETBUF(INBUF,INLEN) C C INBUF - INPUT BUFFER AREA TO RECEIVE DATA C INLEN - LENGTH (IN CHARACTERS) OF INPUT BUFFER "INBUF" C C----------------------------------------------- COMMON DATA STRUCTURES COMMON /CFLCOM/ FILNAM(12,6),INUNIT,BEGLUN,MAXLUN,FNAMSZ,DIFFIL - ,FILDMP,ERRFIL(6),POPSTK,TRACE,QUIT,CONT INTEGER*4 FILNAM INTEGER INUNIT,BEGLUN,MAXLUN,FNAMSZ LOGICAL DIFFIL,FILDMP BYTE ERRFIL,POPSTK,TRACE,QUIT,CONT C----------------------------------------------- SUBPROGRAM PARAMETERS INTEGER INLEN BYTE INBUF(INLEN) C----------------------------------------------- LOCAL DATA STRUCTURES INTEGER INPERR/0/ C*---------------------------------------------------------------------* C C----------------------------------------------- READ INPUT LINE GETBUF=.TRUE. 10 READ(INUNIT,701,END=20,ERR=30) INBUF 701 FORMAT(132A1) GETBUF=.FALSE. 20 RETURN C----------------------------------------------- READ ERROR 30 WRITE(6,703) INUNIT 703 FORMAT(' READ ERROR ON FORTRAN UNIT',I3,', RETYPE') INPERR = INPERR + 1 IF (INPERR .LT. 10) GO TO 10 WRITE(6,705) INUNIT 705 FORMAT(' GETBUF - 10 READ ERRORS; UNIT',I3, - ' FILE MAY BE ACCESS PROTECTED.') CALL EXIT END C*---------------------------------------------------------------------* C| B L O C K D A T A : INITIALIZE NESTED-FILE COMMON BLOCK | C*---------------------------------------------------------------------* BLOCK DATA C----------------------------------------------- COMMON DATA STRUCTURES COMMON /CFLCOM/ FILNAM(12,6),INUNIT,BEGLUN,MAXLUN,FNAMSZ,DIFFIL - ,FILDMP,ERRFIL(6),POPSTK,TRACE,QUIT,CONT INTEGER*4 FILNAM INTEGER INUNIT,BEGLUN,MAXLUN,FNAMSZ LOGICAL DIFFIL,FILDMP BYTE ERRFIL,POPSTK,TRACE,QUIT,CONT C----------------------------------------------- INTEGER*4 FILNM1(12) EQUIVALENCE (FILNAM,FILNM1) DATA FILNM1/'(MAI','N)',10*' '/ DATA INUNIT/11/,BEGLUN/11/,MAXLUN/16/,FNAMSZ/48/ DATA DIFFIL/.FALSE./,FILDMP/.FALSE./ DATA ERRFIL(1)/'C'/, POPSTK,TRACE,QUIT,CONT/'P','T','Q','C'/ END