SUBROUTINE rd_cont_scan (sza, ozone_s, waveln, press, & fs, gg, sb, success) c============================================================================ c PROCEDURE NAME: rd_cont_scan c PROCEDURE TYPE: FORTRAN subroutine c VERSION DATE: 19.VII.98 c c PURPOSE: c Reads the continuous scan table from the binary file "cont_scan_uvb3.bin" c into the arrays that have been passed as calling parameters. Does a certain c amount of checking to ensure that the data are read in correctly, but this c checking is not exhaustive. c c CALLING PARAMETERS: c Name Type i/o units Description c -------- ---- --- ----- -------------- c sza r4 o deg Solar zenith angle array for tables c ozone_s c4 o (du) Ozone profile names (e.g. M325) c waveln r8 o AAng. Wavelength array for tables. c press r4 o Atm Pressure array for tables. c fs r4 o -- Normalized direct beam transfer function c gg r4 o -- Normalized diffuse beam transfer funct. c sb r4 o -- Downward reflectivity of atmosphere. c success l o Successful completion flag. c c EXTERNAL ROUTINES REQUIRED: c get_lun c unget_lun c c NOTES & CAVEATS: c c REVISION HISTORY: c 19.VII.98 Used get_lun/unget_lun for unit number, instead of static c assignment (eac) c c============================================================================ IMPLICIT NONE c---------------------------------------------------------------------------- c Compile parameters c INTEGER*2 n_sza, n_ozone, n_waveln, n_press PARAMETER(n_sza=10, n_ozone=26, n_waveln=2199, n_press=2) c---------------------------------------------------------------------------- c Calling parameters c REAL*4 sza(n_sza) CHARACTER*4 ozone_s(n_ozone) REAL*8 waveln(n_waveln) REAL*4 press(n_press) REAL*4 fs(n_sza,n_ozone,n_waveln,n_press) REAL*4 gg(n_sza,n_ozone,n_waveln,n_press) REAL*4 sb(n_ozone,n_waveln,n_press) LOGICAL success c---------------------------------------------------------------------------- c Common blocks c c---------------------------------------------------------------------------- c Local variables c INTEGER*2 n_sza_in, n_ozone_in, n_waveln_in, n_press_in INTEGER*4 lun c============================================================================ CALL get_lun(lun) OPEN(unit=lun, file='cont_scan_uvb3.bin',form='unformatted', & status='old', err=900) WRITE(6,*)'Reading continuous scan table file...' READ(lun,ERR=901) n_sza_in READ(lun,ERR=901) sza READ(lun,ERR=901) n_ozone_in READ(lun,ERR=901) ozone_s READ(lun,ERR=901) n_waveln_in READ(lun,ERR=901) waveln READ(lun,ERR=901) n_press_in READ(lun,ERR=901) press READ(lun,ERR=901) fs READ(lun,ERR=901) gg READ(lun,ERR=901) sb CLOSE(lun) CALL unget_lun(lun) WRITE(6,*)'... Done.' IF (n_sza_in .NE. n_sza) GOTO 100 IF (n_ozone_in .NE. n_ozone) GOTO 100 IF (n_waveln_in .NE. n_waveln) GOTO 100 IF (n_press_in .NE. n_press) GOTO 100 success=.TRUE. RETURN 100 CONTINUE WRITE(6,*)'rd_cont_scan: ' WRITE(6,*)' error in reading array dimensions.' success=.FALSE. RETURN 900 CONTINUE WRITE(6,*)'rd_cont_scan: ' WRITE(6,*)' could not open file cont_scan_uvb3.bin' success=.FALSE. RETURN 901 CONTINUE WRITE(6,*)'rd_cont_scan: ' WRITE(6,*)' error while reading data in file cont_scan_uvb3.bin' success=.FALSE. RETURN END