c=========================================================================== c c NAME: hqc c c PURPOSE: Quality control subroutine for the HIRS scan line data c c INPUTS: name data type dimension description c ---------------------------------------------------------------- c time real 1D (nspot) GMT time in seconds from midnight c xlon real 1D (nspot) longitude in degrees c xlat real 1D (nspot) latitude in degrees c alt real 1D (nspot) altitude in km c line integer 1D (nspot) line number c isp integer 1D (nspot) scan position c tb real 2D (nspot x nchn2) brightness temperatures c c OUTPUT: c bad logical 1D (nspot) bad pixel flag (T = bad pixel) c c EXTERNALS: c hirs1c.inc c lza.f c c NOTES: Tests the following QC problems. c Gross errors in latitude and time field. c Compute time in seconds from beginning of year. c HIRS12 test added to remove data from 3rd calibration line. c Altitude test added after finding missing values in TIROS-N data c Missing data for channels 1,4 but not 5 removes 1st calibration line. c HIRS8 test for excessively warm value c c AUTHOR: Darren Jackson CIRES/ETL April 2002 c c================================================================================ subroutine hqc(time,xlon,xlat,alt,line,isp,tb,bad) implicit none include 'hirs1c.inc' integer m,miscnt,i integer isp(nspot),line(nspot) real xlon(nspot),xlat(nspot),tb(nspot,nchn2) real time(nspot),alt(nspot),lza logical bad(nspot) external lza c do m=1,nspot bad(m)=.false. if(xlon(m) .lt. 0. .or. xlon(m) .gt. 360.) bad(m)=.true. if(xlat(m) .lt. -90. .or. xlat(m) .gt. 90.) bad(m)=.true. if(xlat(m) .eq. 0. .and. xlon(m) .eq. 0.) bad(m)=.true. if(time(m) .lt. 0 .or. time(m) .gt. 86421.) bad(m)=.true. if(cosd(lza(alt(m),isp(m))) .le. 0.48) bad(m)=.true. if(alt(m) .gt. 998.) bad(m)=.true. if(tb(m,12) .gt. 279. .and. tb(m,12) .lt. missing) then bad(m)=.true. endif c if(tb(m,12) .gt. 279.) then c write(*,*) "hqc: ",m,tb(m,12),missing,bad(m) c endif if(tb(m,8) .gt. 325.) bad(m)=.true. if(isp(m) .eq. 5 .and. tb(m,12) .ne. missing .and. . tb(m+1,12) .eq. missing) bad(m)=.true. if(.not. bad(m)) then miscnt=0 do i=1,nchn2 if(tb(m,i) .eq. missing) miscnt=miscnt+1 enddo if(miscnt .eq. 19) bad(m)=.true. endif enddo return end