FUNCTION taucloud(sza,az,sat,pt,rs,rad,success) c c PROCEDURE NAME: taucloud c PROCEDURE TYPE: fortran function c VERSION DATE: 27.VI.97 c c PURPOSE: c Calculates the putative cloud optical thickness for a particular c viewing geometry, and for a terrain of a certain pressure and c reflectivity, given the TOMS-measured radiance in one of the c reflectivity channels. c c CALLING PARAMETERS: c Name Type i/o units Description c -------- ---- --- ----- -------------- c taucloud R8 o Calculated putative cloud optical c thickness c sza R8 i deg solar zenith angle c az R8 i deg solar-fov-satellite azimuth c sat R8 i deg satellite zenith angle c pt R8 i atm terrain surface pressure c rs R8 i frac surface reflectivity c rad R8 i I/F TOMS-measured radiance c success L o Successful completion flag c c EXTERNAL ROUTINES REQUIRED: c radlow calculates pairs (tcl, radiance) for low tcl. c radhigh calculates pairs (tcl, radiance) for high tcl. c lagrangeco calculates order and coefficients for Lagrange c polynomial interpolation. c c NOTES & CAVEATS: c c REVISION HISTORY: c c============================================================================ IMPLICIT NONE INTEGER*4 nsza_l, naz_l, nsat_l, ntcl_l, npt_l PARAMETER(nsza_l=11, naz_l=7, nsat_l=9, ntcl_l=5, npt_l=2) INTEGER*4 nsza_h, naz_h, nsat_h, ntcl_h, nrs_h PARAMETER(nsza_h=10, naz_h=7, nsat_h=9, ntcl_h=6, nrs_h=5) c----------------------------------------------------------------------- c Calling parameters c REAL*8 taucloud,sza,az,sat,pt,rs,rad LOGICAL success c----------------------------------------------------------------------- c Local variables c REAL*8 outrad(0:ntcl_l+ntcl_h-1), tcl(0:ntcl_l+ntcl_h-1) REAL*8 outrad_l(0:ntcl_l-1), outrad_h(0:ntcl_h-1) REAL*8 outtcl_l(0:ntcl_l-1), outtcl_h(0:ntcl_h-1) EQUIVALENCE(outrad_l(0), outrad(0)) EQUIVALENCE(outrad_h(0), outrad(ntcl_l)) EQUIVALENCE(outtcl_l(0), tcl(0)) EQUIVALENCE(outtcl_h(0), tcl(ntcl_l)) INTEGER*4 i0, deg, nout_l, nout_h, i, inrange REAL*8 coef(0:3), sum d write(6,*)'> taucloud' CALL radlow( rs, sza, az, sat, pt, & outrad_l, outtcl_l, nout_l, success) IF(.NOT.success) RETURN d write(6,'(1p6e12.4)')outtcl_l d write(6,'(1p6e12.4)')outrad_l IF (rad .LE. outrad_l(nout_l-1)) THEN IF(rad .LE. outrad_l(0)) THEN taucloud= 0.d0 success=.TRUE. RETURN END IF CALL lagrangeco(rad, outrad, nout_l, i0, deg, coef, inrange) ELSE CALL radhigh(sza, az, sat, rs, & outrad_h, outtcl_h, nout_h, success) IF(.NOT.success) RETURN d write(6,'(1p6e12.4)') tcl d write(6,'(1p6e12.4)') outrad IF (rad .GT. outrad_h(nout_h-1)) THEN taucloud= 100.d0 success=.TRUE. RETURN END IF CALL lagrangeco(rad, outrad, nout_l+nout_h, & i0, deg, coef, inrange) END IF sum=0.d0 DO i=0, deg sum=sum+coef(i)*tcl(i0+i) END DO taucloud= sum success=.TRUE. d write(6,*) '< taucloud' RETURN END