c========================================================================= c c NAME: time_constrast c c PURPOSE: Applies time constrast test to specified pixel. Uses HIRS IR surface c channel information. Compares previous and next day grid to current c observations. See Rossow and Garder (1993, JClim). c c INPUT: name data type description c ----------------------------------------------------- c pixel real Brightness temperature of observation (K) c ichn integer HIRS channel number c lmask2 byte land/sea designation (2=coastal,1=land,0=ocean) c tb_time real Max. Brightness temperatures from grid c for previous,current, and next day c c OUTPUT: c time: 0 -> cloudy, 1 -> undecided, 2 -> mixed, 3 -> clear c c EXTERNALS: c hirs1c.inc c HISTORY: c Darren Jackson CIRES/ETL April 2002 c c========================================================================= subroutine time_contrast(pixel,ichn,lmask2,tb_time,time) include 'hirs1c.inc' byte lmask,lmask2 real pixel,tb_time(3),delta2(0:1),delta3(0:1) integer ytime,ttime,time,sum integer ichn data delta2/1.1,2.5/ ! ISCCP values data delta3/3.5,8.0/ ! ISCCP values if(lmask2 .eq. 2) then lmask=1 !set coastal regions to land setting else lmask=lmask2 endif c c* Yesterday's test c ytime=1 ! undecided if(tb_time(1) .ne. missing) then ydif=abs(pixel - tb_time(1)) if(ydif .lt. delta2(lmask)) ytime=2 if(delta2(lmask).le.ydif .and. ydif.le.delta3(lmask)) ytime=1 if(ydif .gt. delta3(lmask) .and. pixel .lt. tb_time(1)) ytime=0 endif c c* Tomorrow's test c ttime=1 !undecided if(tb_time(3) .ne. missing) then tdif=abs(pixel - tb_time(3)) if(tdif .lt. delta2(lmask)) ttime=2 if(delta2(lmask).le.tdif .and. tdif.le.delta3(lmask)) ttime=1 if(tdif .gt. delta3(lmask) .and. pixel .lt. tb_time(3)) ttime=0 endif c c* Combine yesterday and tomorrow tests c sum=ytime+ttime if(sum .le. 1) time=0 ! cloudy if(sum .ge. 3) time=3 ! clear if(sum .eq. 2) then if (ytime .eq. 1 .and. ttime .eq. 1) then time=1 ! undecided else time=2 ! mixed endif endif return end