function isetflag(cdfam,kodtyp,kvnam,zlev,zbgchk,lmodif1020) 1 IMPLICIT NONE #if defined (DOC) * ***s/r isetflag - SET BACKGROUND CHECK FLAGS * * *Author : P. Koclas *CMC/CMSV September 1998 *Revision: * P. Koclas * - adjust criterias for winds ( tuneing for background check) * - 02/2002 - adjust criterias for dropsonde winds * - 02/2006 -adjust criterias for radiosonde < 20Mbars * Y.J. Rochon ARQX March 2006 * - Added species criteria. * Y.J. Rochon ARQX June 2008 * - Added Doppler wind speed identifier NEDW * ** Purpose: - Set BACKGROUND CHECK FLAGS According * to values set in a table * Original values in table come from ecmwf * * Arguments: * KVNAM= VARIABLE NAME ( BURP ) * KODTYP=BURP CODE TYPE * CDFAM= FAMILY NAME ( 'UA' , 'AI' ...etc.. ) * ZLEV = LEVEL * zbgchk=NORMALIZED BACKGROUND DEPARTURE * lmodif1020=switch to activate special criteria for backound check (*ua 10-20 mb) * #endif #include "pardim.cdk"
#include "comdim.cdk"
#include "comgem.cdk"
#include "comnumbr.cdk"
#include "comchem.cdk"
C integer isetflag integer kvnam,kodtyp,j real*8 zlev,zbgchk character*2 cdfam logical lmodif1020 ccc real*8 zgzcrit(3),zttcrit(3),zuvcrit(3),zescrit(3),zdzcrit(3) + ,zpscrit(3),zpncrit(3),ztscrit(3),zswcrit(3),ztrcrit(3) C C------------------------------------------------------------------------------- C isetflag=0 C if(cvcord .eq. 'ETAGE') then zttcrit(1) = 5.00D0 zttcrit(2) = 10.00D0 zttcrit(3) = 12.00D0 * zuvcrit(1) = 8.00D0 zuvcrit(2) = 14.00D0 zuvcrit(3) = 20.00D0 * zescrit(1) = 9.00D0 zescrit(2) = 16.00D0 zescrit(3) = 25.00D0 * zpscrit(1) = 9.00D0 zpscrit(2) = 16.00D0 zpscrit(3) = 25.00D0 * zpncrit(1) = 9.00D0 zpncrit(2) = 16.00D0 zpncrit(3) = 25.00D0 * zswcrit(1) = 8.00D0 zswcrit(2) = 14.00D0 zswcrit(3) = 20.00D0 * ztscrit(1) = 2.00D0 ztscrit(2) = 10.00D0 ztscrit(3) = 12.00D0 * zdzcrit(1) = 2.25D0 zdzcrit(2) = 5.06D0 zdzcrit(3) = 7.56D0 * zgzcrit(1) = 12.25D0 zgzcrit(2) = 25.00D0 zgzcrit(3) = 36.00D0 * if ( cdfam .eq. 'UA') then if ( kodtyp .eq. 37 ) then zuvcrit(2)=18. else zuvcrit(2)=14. endif * * ------>>> TEMPORARILY MODIFY REJECTION LIMITs <<<-------------- * FOR RADIOSONDE DATA ABOVE 20Mbars * if ( lmodif1020 ) then if ( zlev .le. 2000. .and. zlev .gt. 1000. ) then zuvcrit(2)=17. zuvcrit(3)=20. * zttcrit(2)=17. zttcrit(3)=20. endif if ( zlev .le. 1000. ) then zuvcrit(2)=20. zuvcrit(3)=23. * zttcrit(2)=23. zttcrit(3)=26. endif endif ztrcrit(1) = 9.00D0 ztrcrit(2) = 16.00D0 ztrcrit(3) = 25.00D0 * endif endif if(cvcord(1:3).eq.'MAM' .or.cvcord.eq.'GEMHYB' ) then zttcrit(1) = 9.00D0 zttcrit(2) = 16.00D0 zttcrit(3) = 25.00D0 * zuvcrit(1) = 10.00D0 zuvcrit(2) = 20.00D0 zuvcrit(3) = 30.00D0 * zescrit(1) = 10.00D0 zescrit(2) = 20.00D0 zescrit(3) = 30.00D0 * zpscrit(1) = 9.00D0 zpscrit(2) = 16.00D0 zpscrit(3) = 25.00D0 * zpncrit(1) = 10.00D0 zpncrit(2) = 20.00D0 zpncrit(3) = 30.00D0 * zswcrit(1) = 10.00D0 zswcrit(2) = 20.00D0 zswcrit(3) = 30.00D0 * ztscrit(1) = 5.00D0 ztscrit(2) = 25.00D0 ztscrit(3) = 30.00D0 * zdzcrit(1) = 2.25D0 zdzcrit(2) = 5.06D0 zdzcrit(3) = 7.56D0 * zgzcrit(1) = 12.25D0 zgzcrit(2) = 25.00D0 zgzcrit(3) = 36.00D0 * ztrcrit(1) = 9.00D0 ztrcrit(2) = 16.00D0 ztrcrit(3) = 25.00D0 * if ( kodtyp .eq. 37 ) then zuvcrit(2)=25. else zuvcrit(2)=20. endif endif C C SET FLAG FOR HEIGHTS C if ( kvnam .eq. NEGZ ) then if ( zbgchk .gt. zgzcrit(1) .and. zbgchk .lt. zgzcrit(2) ) then isetflag=1 else if ( zbgchk .gt. zgzcrit(2) .and. zbgchk .lt. zgzcrit(3) ) then isetflag=2 else if ( zbgchk .ge. zgzcrit(3) )then isetflag =3 endif endif C C SET FLAG FOR TEMPERATURE C if ( kvnam .eq. NETT ) then if ( zbgchk .gt. zttcrit(1) .and. zbgchk .lt. zttcrit(2) ) then isetflag=1 else if ( zbgchk .gt. zttcrit(2) .and. zbgchk .lt. zttcrit(3) ) then isetflag=2 else if ( zbgchk .ge. zttcrit(3) )then isetflag =3 endif endif C C SET FLAG FOR SATEMS C if ( kvnam .eq. NEDZ ) then if ( zbgchk .gt. zdzcrit(1) .and. zbgchk .lt. zdzcrit(2) ) then isetflag=1 else if ( zbgchk .gt. zdzcrit(2) .and. zbgchk .lt. zdzcrit(3) ) then isetflag=2 else if ( zbgchk .ge. zdzcrit(3) )then isetflag =3 endif endif C C SET FLAG FOR WIND COMPONENTS C if ( kvnam .eq. NEUU .or. kvnam .eq. NEVV .or. kvnam .eq. NEDW) then if ( zbgchk .gt. zuvcrit(1) .and. zbgchk .lt. zuvcrit(2) ) then isetflag=1 else if ( zbgchk .gt. zuvcrit(2) .and. zbgchk .lt. zuvcrit(3) ) then isetflag=2 else if ( zbgchk .ge. zuvcrit(3) )then isetflag =3 endif endif C C SET FLAG FOR SURFACE WIND COMPONENTS C if ( kvnam .eq. NEUS .or. kvnam .eq. NEVS ) then if ( zbgchk .gt. zswcrit(1) .and. zbgchk .lt. zswcrit(2) ) then isetflag=1 else if ( zbgchk .gt. zuvcrit(2) .and. zbgchk .lt. zswcrit(3) ) then isetflag=2 else if ( zbgchk .ge. zswcrit(3) )then isetflag =3 endif endif C C SET FLAG FOR DEW POINT DEPRESSION C if ( kvnam .eq. NEES ) then if ( zbgchk .gt. zescrit(1) .and. zbgchk .lt. zescrit(2) ) then isetflag=1 else if ( zbgchk .gt. zescrit(2) .and. zbgchk .lt. zescrit(3) ) then isetflag=2 else if ( zbgchk .ge. zescrit(3) )then isetflag =3 endif endif C C SET FLAG FOR SURFACE PRESSURE C if ( kvnam .eq. NEPS ) then if ( zbgchk .gt. zpscrit(1) .and. zbgchk .lt. zpscrit(2) ) then isetflag=1 else if ( zbgchk .gt. zpscrit(2) .and. zbgchk .lt. zpscrit(3) ) then isetflag=2 else if ( zbgchk .ge. zpscrit(3) )then isetflag =3 endif endif ccc C C SET FLAG FOR MEAN SEA LEVEL PRESSURE C if ( kvnam .eq. NEPN ) then if ( zbgchk .gt. zpncrit(1) .and. zbgchk .lt. zpncrit(2) ) then isetflag=1 else if ( zbgchk .gt. zpncrit(2) .and. zbgchk .lt. zpncrit(3) ) then isetflag=2 else if ( zbgchk .ge. zpncrit(3) )then isetflag =3 endif endif ccc C C SET FLAG FOR SURFACE TEMPERATURE C if ( kvnam .eq. NETS ) then if ( zbgchk .gt. ztscrit(1) .and. zbgchk .lt. ztscrit(2) ) then isetflag=1 else if ( zbgchk .gt. ztscrit(2) .and. zbgchk .lt. ztscrit(3) ) then isetflag=2 else if ( zbgchk .ge. ztscrit(3) )then isetflag =3 endif endif ccc C C SET FLAG FOR SPECIES OBS C IF (NCMTASSI.GT.0) THEN if (kvnam.ne.NETS.and.kvnam.ne.NEPN.and. & kvnam.ne.NEPS.and.kvnam.ne.NEES.and.kvnam.ne.NEUS.and. & kvnam.ne.NEVS.and.kvnam.ne.NEUU.and.kvnam.ne.NEVV.and. & kvnam.ne.NEDW.and. & kvnam.ne.NEDZ.and.kvnam.ne.NEGZ.and.kvnam.ne.NETT) then DO J=1,NCMTASSI if (kvnam.EQ.NETR(J)) then c if (zbgchk.gt.ztrcrit(1).and.zbgchk.lt.ztrcrit(2)) then c isetflag=1 c else if (zbgchk.gt.ztrcrit(2).and.zbgchk.lt.ztrcrit(3)) then c isetflag=2 c else if (zbgchk.ge.ztrcrit(3))then c isetflag =3 c end if if (zbgchk.gt.ztrcrit(1)*qcfact1(j).and. & zbgchk.lt.ztrcrit(2)*qcfact1(j)) then isetflag=1 else if (zbgchk.gt.ztrcrit(2)*qcfact1(j).and. & zbgchk.lt.ztrcrit(3)*qcfact1(j)) then isetflag=2 else if (zbgchk.ge.ztrcrit(3)*qcfact1(j))then isetflag =3 end if go to 700 end if END DO 700 CONTINUE END IF END IF C C C------------------------------------------------------------------------------- C return end