SUBROUTINE ld_radhigh(wvl, success) c c PROCEDURE NAME: ld_radhigh c PROCEDURE TYPE: fortran subroutine c VERSION DATE: 19.VII.98 c c PURPOSE: c Loads the lookup table requred to obtain the radiance from the c putative cloud optical thickness (or vice versa). c c The lookup table is stored in common block /radhighcom/. c c CALLING PARAMETERS: c Name Type i/o units Description c -------- ---- --- ----- -------------- c wvl I4 i nm reflectivity channel wavelength c success L o Flags successful completion. c c EXTERNAL ROUTINES REQUIRED: c c NOTES & CAVEATS: c c REVISION HISTORY: c 19.VII.98 Added use of get_lun/unget_lun, instead of static lun. c 27.VI.97 Documentation added (eac). c c============================================================================ IMPLICIT NONE INTEGER*4 nsza_p, naz_p, nsat_p, ntcl_p, nrs_p PARAMETER(nsza_p=10, naz_p=7, nsat_p=9, ntcl_p=6, nrs_p=5) c----------------------------------------------------------------------- c Calling parameters c INTEGER*4 wvl LOGICAL success c----------------------------------------------------------------------- c Common blocks c INTEGER*4 nsza_h, naz_h, nsat_h, ntcl_h, nrs_h REAL*8 sza_h(0:nsza_p-1), az_h(0:naz_p-1), sat_h(0:nsat_p-1), & tcl_h(0:ntcl_p-1), rs_h(0:nrs_p-1), & rad_h(0:nsza_p-1, 0:naz_p-1, 0:nsat_p-1, 0:ntcl_p-1, 0:nrs_p-1) COMMON /radhighcom/ sza_h, az_h, sat_h, tcl_h, rs_h, rad_h, & nsza_h, naz_h, nsat_h, ntcl_h, nrs_h SAVE /radhighcom/ c----------------------------------------------------------------------- c Local variables c INTEGER*2 nsza_i, naz_i, nsat_i, ntcl_i, nrs_i REAL*4 sza_i(0:nsza_p-1), az_i(0:naz_p-1), sat_i(0:nsat_p-1), & tcl_i(0:ntcl_p-1), rs_i(0:nrs_p-1), & rad_i(0:nsza_p-1, 0:naz_p-1, 0:nsat_p-1, 0:ntcl_p-1, 0:nrs_p-1) INTEGER*4 i, isza, iaz, isat, itcl, irs INTEGER*4 lun CHARACTER*14 filename /'radhigh000.bin'/ d write(6,*)'> ld_radhigh' WRITE(filename(8:10),'(I3.3)') wvl CALL get_lun(lun) OPEN(UNIT=lun,FILE=filename, FORM='unformatted', STATUS='old', $ ERR=900) READ(lun) nsza_i IF (nsza_i .NE. nsza_p) GOTO 901 READ(lun) sza_i READ(lun) naz_i IF (naz_i .NE. naz_p) GOTO 902 READ(lun) az_i READ(lun) nsat_i IF (nsat_i .NE. nsat_p) GOTO 903 READ(lun) sat_i READ(lun) ntcl_i IF (ntcl_i .NE. ntcl_p) GOTO 904 READ(lun) tcl_i READ(lun) nrs_i IF (nrs_i .NE. nrs_p) GOTO 905 READ(lun) rs_i READ(lun) rad_i CLOSE(lun) CALL unget_lun(lun) c c--type conversions c nsza_h= nsza_i DO i= 0, nsza_h-1 sza_h(i)= sza_i(i) END DO naz_h= naz_i DO i= 0, naz_h-1 az_h(i)= az_i(i) END DO nsat_h= nsat_i DO i= 0, nsat_h-1 sat_h(i)= sat_i(i) END DO ntcl_h= ntcl_i DO i= 0, ntcl_h-1 tcl_h(i)= tcl_i(i) END DO nrs_h= nrs_i DO i= 0, nrs_h-1 rs_h(i)= rs_i(i) END DO DO isza= 0, nsza_h-1 DO iaz= 0, naz_h-1 DO isat= 0, nsat_h-1 DO itcl= 0, ntcl_h-1 DO irs= 0, nrs_h-1 rad_h(isza, iaz, isat, itcl, irs)= & rad_i(isza, iaz, isat, itcl, irs) END DO END DO END DO END DO END DO success=.TRUE. d write(6,*)'< ld_radhigh' RETURN 900 CONTINUE WRITE(6,90) filename GOTO 999 901 CONTINUE WRITE(6,91) filename, 'sza', nsza_p, nsza_i GOTO 999 902 CONTINUE WRITE(6,91) filename, 'az', naz_p, naz_i GOTO 999 903 CONTINUE WRITE(6,91) filename, 'sat', nsat_p, nsat_i GOTO 999 904 CONTINUE WRITE(6,91) filename, 'tcl', ntcl_p, ntcl_i GOTO 999 905 CONTINUE WRITE(6,91) filename, 'rs', nrs_p, nrs_i GOTO 999 999 CONTINUE success=.FALSE. RETURN 90 FORMAT(' !!! ld_radhigh !!! could not open the file ',A20) 91 FORMAT(' !!! ld_radhigh !!! encountered unexpected value in ', & ' file ',A20/ & t20,'Number of values for ',A4,' : expected=',i3,', found=', & i3) END