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 -- calling parameters integer*4 wvl logical success c -- common blocks 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 -- local variables 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'/ 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) nsza_h= nsza_i do i= 0, nsza_h-1 sza_h(i)= sza_i(i) enddo naz_h= naz_i do i= 0, naz_h-1 az_h(i)= az_i(i) enddo nsat_h= nsat_i do i= 0, nsat_h-1 sat_h(i)= sat_i(i) enddo ntcl_h= ntcl_i do i= 0, ntcl_h-1 tcl_h(i)= tcl_i(i) enddo nrs_h= nrs_i do i= 0, nrs_h-1 rs_h(i)= rs_i(i) enddo 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) enddo enddo enddo enddo enddo success=.true. 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