c=========================================================================== c c NAME: daygrid c c PURPOSE: Computes daily grids for either the all-sky data in hirs1c.f (l=0) c or the clear-sky data in hcloud.f (l=1). c c INPUTS: c l....................l=0 all-sky grids, l !=0 clear-sky grids c n....................number of spots c bad_data.............flagged bad data values are true c time.................time in seconds from midnight c xlon.................longitude (0 to 360 going east) c xlat.................latitude (-90 to 90) c szen.................solar zenith angle in degrees c refl.................HIRS20 reflectance c tblc.................limb corrected HIRS channel 8 BT. c c OUTPUT: c xmxmn................Grid of HIRS 8 Max,sum,#obs, and minimum HIRS20 c c EXTERNALS: c hirs1c.inc c binit.f c c NOTES: c For the all-sky data, the gridded values are c (1) maximum TBs for HIRS8 c (2) Minimum reflectances for HIRS Chn 20 c (3) # of obs. for HIRS8 c c For the clear-sky data, the gridded values are c (1) sum of TBs for HIRS8 c (2) # of obs. for HIRS8 c c HISTORY: c Darren Jackson CIRES/ETL April 2002 c c=============================================================================== subroutine daygrid(l,n,bad_data,time,xlon,xlat,szen,refl, . tblc,xmxmn) implicit none include 'hirs1c.inc' integer l,n,m,ii,jj,ichn(1),it real xlon(nspot),xlat(nspot),refl(nspot),tblc(nspot,1) real time(nspot),szen(nspot) real xmxmn(nlon,nlat,ntim,3),tovs_hr logical bad_data(nspot),nite data ichn/1/ c c* loop through each pixel c do m=1,n if((tblc(m,ichn(1)) .ne. missing) .and. . (.not. bad_data(m))) then c c* find time index tovs_hr=time(m)/3600. it=ifix(tovs_hr/tinc)+1 if(it .ge. itmax) it=1 c c* find bin indices call binit(gres,1,1,xlon(m),xlat(m),ii,jj) c write(*,*) m,xlon(m),xlat(m),ii,jj c c* night or day nite=.false. if(szen(m) .ge. 90.) nite=.true. c c* Compute grids c if(l .eq. 0) then xmxmn(ii,jj,it,1)=amax1(xmxmn(ii,jj,it,1), . tblc(m,ichn(1))) xmxmn(ii,jj,it,3)=xmxmn(ii,jj,it,3)+1. if((.not. nite) .and. refl(m) .le. 1.) then xmxmn(ii,jj,it,2)=amin1(xmxmn(ii,jj,it,2),refl(m)) endif else xmxmn(ii,jj,it,1)=xmxmn(ii,jj,it,1)+tblc(m,ichn(1)) xmxmn(ii,jj,it,2)=xmxmn(ii,jj,it,2)+1. endif endif enddo return end