FUNCTION eryth_si (sza, az, sat, pt_ifov, pt_site, & rs_ifov, rs_site, rad, oz, p, q, snowflag, & tomsrefl, success) c Function eryth_si c PURPOSE: wrapper for function eryth, which implements a chosen c policy on how to treat cases where there is snow cover: c c POLICY: c The snow/ice flag (snowflag) is passed in as a 1 or 0 (integer*4). c This corresponds to the usage in the TOMS Level-2 product, where the c flag is set (indicating greater than 50% chance of snow cover) or c reset (otherwise). c c The snow/ice flag determines whether there is special handling to c be done with the assumed surface reflectivity. For the purpose c of this program (where level-2 data are being used) so the fov c surface reflectivity and the "site" surface reflectivity are the same. c c The following table shows which reflectivities are to be used in c the different cases. c c snow toms Use this reflectivity c flag refl for call to eryth c ---- ---- --------------------- c 0 any rs_ifov (climatological), as passed in c 1 >snowrefl snowrefl (assumes this means clouds over snow) c 1 <=snowrefl tomsrefl (so tau will be zero; clear sky over snow) c c c CALLING PARAMETERS: c Name Type i/o units Description c -------- ---- --- ----- -------------- c eryth R8 o arb. "Erythemal Exposure" c sza R8 i deg Solar zenith angle of TOMS observation c az R8 i deg Azimuth angle of TOMS observation c sat R8 i deg Satellite zenith angle of TOMS obs'n. c pt_ifov R8 i atm Terrain pressure at centroid of c TOMS IFOV. c pt_site R8 i atm Terrain pressure at "overpass" site. c rs_ifov R8 i frac. Surface reflectivity at TOMS IFOV c rs_site R8 i frac. Surface reflectivity at "overpass" site c rad R8 i norm. I/F ratio (calc'd from N-value) at c the reflectivity wavelength (360 or c 380 nm) c oz R8 i DU TOMS ozone (above terrain) c p R8 i cos(latitude - solar dec. ang.) c q R8 i cos(latitude + solar dec. ang.) c snowflag I4 i 0 if no snow; 1 if snow c tomsrefl R8 i frac. TOMS reflectivity c success L o successful completion flag. c AUTHOR: Edward A. Celarier, Software Corporation of America, Lanham, MD c VERSION: December 18, 1997 c REVISION HISTORY: c 97.12.18 : Changed to 1/0 snow-flag instead of R*8 number (eac) c Added TOMS reflectivity as a calling parameter (eac) c Documentation enhanced (eac) c Set up snowrefl in a type data statement. (eac) c 97.12.08 : Original version (eac) c----------------------------------------------------------------------- c Calling Parameters c REAL*8 sza, az, sat, pt_ifov, pt_site, rs_ifov, rs_site, & rad, oz, p, q, eryth_si, tomsrefl INTEGER*4 snowflag LOGICAL success c----------------------------------------------------------------------- c Local variables c REAL*8 snowrefl /0.4d0/ REAL*8 rs_ifov_use, rs_site_use, eryth, temp d INTEGER*4 diaglun d LOGICAL diagq /.FALSE./ d SAVE diaglun, diagq c----------------------------------------------------------------------- c Optional diagnostics d IF(.NOT. diagq) THEN d CALL get_lun(diaglun) d OPEN(UNIT=diaglun, FILE='DIAG.OUT', FORM='FORMATTED') d WRITE(diaglun,*)'sza az sat p_fov p_sit '// d & 'rs_fov rs_site rad oz p q snw rtoms' d diagq= .TRUE. d END IF d WRITE(diaglun, 99) sza, az, sat, pt_ifov, pt_site, d & rs_ifov, rs_site, rad, oz, p, q, snowflag, d & tomsrefl d 99 FORMAT(f5.2,1x, f6.2, 1x, f5.2, 1x, f5.3, 1x, f5.3, 1x, d & f5.3,1x,f5.3,1x,f8.5,1x,f5.1,1x,f6.3,1x,f6.3,1x, d & i2,1x,f6.3) c----------------------------------------------------------------------- rs_ifov_use= rs_ifov rs_site_use= rs_site IF (snowflag .EQ. 1) THEN IF (tomsrefl .GT. snowrefl) THEN rs_ifov_use= snowrefl rs_site_use= snowrefl ELSE rs_ifov_use= tomsrefl rs_site_use= tomsrefl END IF END IF temp= eryth(sza, az, sat, pt_ifov, pt_site, & rs_ifov_use, rs_site_use, rad, oz, p, q, success) eryth_si= temp d write(6,*)'eryth_si returning: ',temp RETURN END