SUBROUTINE readin(success) c============================================================================ c PROCEDURE NAME: _readin c PROCEDURE TYPE: _subroutine c VERSION DATE: _1.VII.98 c c PURPOSE: c read in the run-time parameters for the TOMS overpass program c c CALLING PARAMETERS: c Name Type i/o units Description c -------- ---- --- ----- -------------- c success l4 o Successful completion flag c c EXTERNAL ROUTINES REQUIRED: c get_lun gets a logical unit number for i/o c unget_lun un-gets a logical unit number (entry point in get_lun) c satset gets information about a satellite c c NOTES & CAVEATS: c c REVISION HISTORY: c c============================================================================ IMPLICIT NONE c---------------------------------------------------------------------------- c Compile parameters c INCLUDE "ovpindex.prm" c---------------------------------------------------------------------------- c Calling parameters c LOGICAL success c---------------------------------------------------------------------------- c Common blocks c INCLUDE "ovpindex.cmn" c---------------------------------------------------------------------------- c Local variables c INTEGER*4 inputlun CHARACTER*7 yeardoy_ix, yeardoy_fx CHARACTER*8 instdir /'InstData'/ INTEGER*4 waves(6) REAL*8 radeg /57.295779513082323/ !deg-rad conversion c============================================================================ WRITE(loglun,'(A)')'READIN ...' c--Read the input file CALL get_lun(inputlun) OPEN(UNIT=inputlun,FILE='INPUT',FORM='formatted',STATUS='old', & ERR= 900) READ(inputlun,2) satlet READ(inputlun,3) yeardoy_init READ(inputlun,3) yeardoy_final READ(inputlun,*) acceptang READ(inputlun,*) acceptsza READ(inputlun,1) lvl2dir READ(inputlun,1) lvl2ext READ(inputlun,1) ovxdir READ(inputlun,1) ovxname READ(inputlun,1) slfile write(6,1) lvl2dir write(6,1) lvl2ext write(6,1) ovxdir write(6,1) ovxname CLOSE(inputlun) CALL unget_lun(inputlun) c--Precompute a value acceptpar= SIN(acceptang/radeg/2.)**2 c--Translate the appropriate two-letter code for the instrument IF(satlet .EQ. 'N') sat2lc= 'N7' IF(satlet .EQ. 'M') sat2lc= 'M3' IF(satlet .EQ. 'A') sat2lc= 'A1' IF(satlet .EQ. 'E') sat2lc= 'EP' CALL instdates(sat2lc, yeardoy_ix, yeardoy_fx,instdir) IF(yeardoy_init .EQ. '0000000') yeardoy_init= yeardoy_ix IF(yeardoy_final .EQ. '0000000') yeardoy_final= yeardoy_fx yeardoy= yeardoy_init success= .TRUE. c--Log the results of the readin. WRITE(loglun,10) sat2lc, yeardoy_init(1:4),yeardoy_init(5:7), & yeardoy_final(1:4),yeardoy_final(5:7), & yeardoy_ix(1:4),yeardoy_ix(5:7), & yeardoy_fx(1:4),yeardoy_fx(5:7) WRITE(loglun,11) acceptang, acceptsza WRITE(loglun,12) lvl2dir, lvl2ext WRITE(loglun,13) ovxdir, ovxname WRITE(loglun,14) slfile WRITE(loglun,*)'' 10 FORMAT('Satellite inst. designator:',t30,A2/ & 'Dates to be processed:'t30,a4,'+',a3,' to ',a4,'+',a3, & ' (Instrument dates: ',a4,'+',a3,' to ',a4,'+',a3,')') 11 FORMAT('Prefiltering acceptance angle:',t30,f7.2,' deg.'/ & 'Maximum accepted SZA:',t30,f7.2,' deg.') 12 FORMAT('Level-2 files in:',t30,a50/ & 'Level-2 file extension:',t30,A10) 13 FORMAT('Destination directory: ',t30,a50/ & 'Destination file base name:',t30,A10) 14 FORMAT('Site list file: ',t30,A) RETURN 900 CONTINUE WRITE(6,*)'Error opening input file INPUT.' success= .FALSE. RETURN 1 FORMAT(A) 2 FORMAT(A1) 3 FORMAT(A7) END