SUBROUTINE riwi_i(sza_t, sat_t, az_t, oz_t, r_t, ai_t, radlong_t, & pt_t, rs_t, sza_s, pt_s, rs_s, lat_s, & nn, irradiance) IMPLICIT NONE c--------------------------------------------------------------------------- c FORTRAN SUBROUTINE riwi_i c c PURPOSE: one-call driver for calculation of instantaneous weighted c irradiance integral. c c NOTES: c (1) Irradiances must be corrected for earth-sun distance by the calling c routine. c c--------------------------------------------------------------------------- c CALLING PARAMETERS c c--parameters for thresholds, etc. REAL*8 aithresh, rtthresh PARAMETER (aithresh=1.0d0, rtthresh=1.5d-1) c--toms data REAL*8 sza_t, !solar zenith angle, degrees. & sat_t, !satellite zenith angle, degrees. & az_t, !view geometry azimuth angle, degrees. & oz_t, !TOMS total ozone above terrain, DU. & r_t, !TOMS reflectivity, fraction. & ai_t, !TOMS aerosol index, N-value units. & radlong_t, !TOMS radiance (I/F) at longest wavelength. & pt_t, !Terrain pressure used in TOMS retrieval, atm. & rs_t !Surface reflectivity at TOMS FOV, fraction. c--site data REAL*8 sza_s, !solar zenith angle at desired time, degrees. & pt_s, !Terrain pressure at site, degrees. & rs_s, !Surface reflectivity at site, fraction. & lat_s !latitude of the site, degrees. INTEGER*4 nn !number of elements in irradiance. c--returned value REAL*8 irradiance(nn) !weighted instantaneous irradiance c------------------------------------------------------------------------- c LOCAL VARIABLES c REAL*8 poz, tcl REAL*8 profoz, taucloud INTEGER*4 i LOGICAL success c------------------------------------------------------------------------- c EXECUTABLE CODE c--correct to profile ozone amount. poz= profoz(oz_t, pt_t, success) IF(.NOT.success) GOTO 900 IF( (ai_t .GT. aithresh) .AND. (r_t .LT. rtthresh)) THEN c--aerosols case CALL ld_cloud_unity(success) IF(.NOT.success) GOTO 900 CALL gfluxquad(poz, sza_s, pt_s, rs_s, lat_s, nn, & irradiance, success) IF(.NOT.success) GOTO 900 DO i= 1, nn irradiance(i)= irradiance(i)*EXP(-0.25*ai_t) END DO ELSE c--nonaerosols case tcl= taucloud(sza_t, az_t, sat_t, pt_t, rs_t, radlong_t, & success) IF(.NOT.success) GOTO 900 CALL ld_cloud_ccf (tcl, rs_s, pt_s, sza_s, success) IF(.NOT.success) GOTO 900 CALL gfluxquad(poz, sza_s, pt_s, rs_s, lat_s, nn, & irradiance, success) IF(.NOT.success) GOTO 900 END IF RETURN 900 CONTINUE DO i=1, nn irradiance(i)= -999.d0 END DO RETURN END