SUBROUTINE INIT_LOOKUP_ROUTINES ( IO_UNIT, FILE_NAME, STATUS ) C---------------------------------------------------------------------- C- C- Purpose and Methods : Initialize the common block for subsequent direct C- access or use of library routines. C- C- This subroutine opens the Lookup Management File, C- initializes the common block from the file, and C- then closes the file. C- C- Inputs : C- IO_UNIT Is the logical unit number to use for input file. C- C- FILE_NAME Is the name of the Lookup System Management file C- to use as input in filling the common block. C- C- Outputs : C- STATUS Is the initialization status. C- The normally returned success status is 1. C- In case of file open or read failure, the FORTRAN C- IO error code is returned (positive number). C- Negative numbers are reserved for file syntax C- interpretation error codes. C- C- filled common block : LEVEL1_LOOKUP. C- C- Controls: None C- C- Comments : C- A call to INIT_LOOKUP_ROUTINES must be made C- before any routine can be called, or any varible C- accessed. C- C- The file name is passed as argument to allow C- selection of a CURRENT hardware description file or C- any other EXPLORATORY configuration, or retrieval C- from ARCHIVES. C- C- The routine will fill with zeros all variables C- referencing trigger towers whose description does C- not appear in the lookup tables. The existence test C- is made on the downloaded DAC byte that by C- definition is non-zero only for existing Trigger C- Towers. C- C- Defined 21-FEB-1990 MICHIGAN STATE UNIVERSTITY, TRIGGER CONTROL SOFTWARE C- Created 6-JUN-1990 MICHIGAN STATE UNIVERSITY, TRIGGER CONTROL SOFTWARE C- Updated 10-AUG-1990 MICHIGAN STATE UNIVERSITY, TRIGGER CONTROL SOFTWARE C- C---------------------------------------------------------------------- IMPLICIT NONE C---------------------------------------------------------------------- C C global declarations C INCLUDE 'D0$LEVEL1:PARSE_TOKENS.PARAMS' INCLUDE 'D0$LEVEL1:PARSE_TOKENS.INC' C C C Argument declarations C INTEGER IO_UNIT CHARACTER*(*) FILE_NAME INTEGER STATUS C C Local variables C LOGICAL OK, ERROR C C LSM_ERROR_SEVERITY = ERROR_NONE LSM_ERROR_LINE = 0 LSM_ERROR_CODE = 0 LSM_IOSTAT = 0 C C open the Lookup System Management File CALL D0OPEN( IO_UNIT, FILE_NAME, 'IF', OK) C IF (VERBOSE) THEN IF ( OK .EQV. .TRUE. ) THEN WRITE (6,*) 'Lookup description file opened.' ELSE WRITE (6,*) 'Error opening description file.' ENDIF ENDIF IF ( OK .EQV. .TRUE. ) THEN C CALL INIT_COMMON_BLOCK_MINIMAL() CALL INIT_NEXT_WORD() CALL INIT_WIDTHS() CALL INIT_STRINGS() CALL INIT_CLASSES() CALL DISPATCH_MINIMAL( IO_UNIT, ERROR ) CALL CLOSE_MGMT_FILE( IO_UNIT ) IF (.NOT. ERROR) CALL DERIVED_QUANTITIES() ELSE LSM_ERROR_SEVERITY = ERROR_READING LSM_ERROR_CODE = 19 LSM_ERROR_LINE = 0 ENDIF C IF (LSM_IOSTAT .NE. 0) THEN STATUS = LSM_IOSTAT ELSE IF (LSM_ERROR_SEVERITY .GT. ERROR_NONE) THEN STATUS = -LSM_ERROR_CODE ELSE STATUS = 1 ENDIF C 999 CONTINUE END