SUBROUTINE ld_eryth(success) c c PROCEDURE NAME: ld_eryth c PROCEDURE TYPE: fortran subroutine c VERSION DATE: 27.VI.97 c c PURPOSE: c Load the lookup table of erythemal exposures. c c CALLING PARAMETERS: c Name Type i/o units Description c -------- ---- --- ----- -------------- c success L o Flags successful completion c c EXTERNAL ROUTINES REQUIRED: c None. c c NOTES & CAVEATS: c c REVISION HISTORY: c 27.VI.97 Documentation added (eac). c c============================================================================ IMPLICIT NONE c----------------------------------------------------------------------- c Calling parameters c LOGICAL success c----------------------------------------------------------------------- c Common blocks c INCLUDE "eryth.cmn" c----------------------------------------------------------------------- c Local variables c INTEGER*2 i2in, j REAL*4 r4in(20) LOGICAL eof OPEN(UNIT=2, & FILE='eryth3.bin', & FORM='unformatted', & STATUS='old') READ(2) i2in IF(i2in .NE. noz_p) GOTO 901 eryth_noz= i2in READ(2) (r4in(j), j=1, i2in) DO j=1, i2in eryth_oz(j-1)=r4in(j) END DO READ(2) i2in IF(i2in .NE. npr_p) GOTO 902 eryth_npr= i2in READ(2) (r4in(j), j=1, i2in) DO j=1, i2in eryth_pr(j-1)= r4in(j) eryth_logpr(j-1)=log(eryth_pr(j-1)) END DO READ(2) i2in IF(i2in .NE. nrs_p) GOTO 903 eryth_nrs= i2in READ(2) (r4in(j), j=1, i2in) DO j=1, i2in eryth_rs(j-1)= r4in(j) END DO READ(2) i2in IF(i2in .NE. ntc_p) GOTO 904 eryth_ntc= i2in READ(2) (r4in(j), j=1, i2in) DO j=1, i2in eryth_tc(j-1)= r4in(j) END DO READ(2) i2in IF(i2in .NE. np_p) GOTO 905 eryth_np= i2in READ(2) (r4in(j), j=1, i2in) DO j=1, i2in eryth_p(j-1)= r4in(j) END DO READ(2) i2in IF(i2in .NE. nq_p) GOTO 906 eryth_nq= i2in READ(2) (r4in(j), j=1, i2in) DO j=1, i2in eryth_q(j-1)= r4in(j) END DO READ(2) eryth_val c c--check that we're really at the end of the file. c READ(2,END=100, ERR=100) i2in GOTO 900 100 CONTINUE CLOSE(2) success=.TRUE. RETURN 900 WRITE(6,1) GOTO 999 901 WRITE(6,2) 'noz', noz_p, i2in GOTO 999 902 WRITE(6,2) 'npr', npr_p, i2in GOTO 999 903 WRITE(6,2) 'nrs', nrs_p, i2in GOTO 999 904 WRITE(6,2) 'ntc', ntc_p, i2in GOTO 999 905 WRITE(6,2) 'np', np_p, i2in GOTO 999 906 WRITE(6,2) 'nq', nq_p, i2in GOTO 999 999 CONTINUE CLOSE(2) success=.FALSE. RETURN 1 FORMAT(' !!! ld_eryth !!! Read the binary data file, but was ', & 'not left at the EOF') 2 FORMAT(' !!! ld_eryth !!! Read unexpected value of the dimension ', & A3,' Expected: ',I3,' Read: ',I3) END