9 INTEGER imax,jmax,kmax,kmaxs
10 INTEGER*4 idvc,idsl,nvcoord,sfcpress_id,thermodyn_id
11 REAL (KIND=8),
ALLOCATABLE :: iar14t(:,:,:), iar15u(:,:,:),
12 $ iar16v(:,:,:), iar17q(:,:,:),
13 $ iar12z(:,:), iar13p(:,:),
14 $ iarpsi(:,:,:), iarpsl(:,:,:),
16 REAL (KIND=4),
ALLOCATABLE :: vcoord(:,:)
531 SUBROUTINE gblevents(IDATEP,IUNITF,IUNITE,IUNITP,IUNITS,SUBSET,
542 INTEGER,
PARAMETER :: im=384, jm=im/2+1
545 CHARACTER*80 headr,obstr,qmstr,fcstr,oestr,anstr
547 REAL(8) obs_8,qms_8,bak_8,sid_8,hdr_8(10)
548 REAL(8) bmiss,getbmiss
549 LOGICAL dovtmp,dofcst,some_fcst,doberr,fcst,virt,doanls,
550 $ satmqc,adpupa_virt,recalc_q,doprev,dopmsl
552 INTEGER*4 iunitf(2),ncid
555 TYPE(sigio_head
) :: head1
556 TYPE(nemsio_gfile
) :: gfile1
558 COMMON /gbevaa/ sid_8,obs_8(13,255),qms_8(12,255),bak_8(12,255),
559 $ xob,yob,dhr,typ,nlev
560 COMMON /gbevbb/ pvcd,vtcd
561 COMMON /gbevcc/ dovtmp,dofcst,some_fcst,doberr,fcst,virt,
562 $ qtop_rej,satmqc,adpupa_virt,recalc_q,doprev,dopmsl
563 COMMON /gbevdd/ errs(300,33,6)
564 COMMON /gbevff/ bmiss
571 $
'SID XOB YOB DHR TYP '/
573 $
'POB QOB TOB ZOB UOB VOB PWO PW1O PW2O PW3O PW4O CAT PRSS '/
575 $
'PQM QQM TQM ZQM WQM PWQ PW1Q PW2Q PW3Q PW4Q NUL NUL '/
577 $
'PFC QFC TFC ZFC UFC VFC PWF PW1F PW2F PW3F PW4F NUL '/
579 $
'PAN QAN TAN ZAN UAN VAN PWA PW1A PW2A PW3A PW4A NUL '/
581 $
'POE QOE TOE ZOE WOE PWE PW1E PW2E PW3E PW4E NUL NUL '/
583 namelist /prevdata/dovtmp,dofcst,some_fcst,doberr,doanls,
584 $ qtop_rej,satmqc,adpupa_virt,recalc_q,doprev,dopmsl
597 700
FORMAT(/1x,100(
'#')/
' =====> SUBROUTINE GBLEVENTS INVOKED FOR ',
598 $
'THE FIRST TIME - VERSION LAST UPDATED 2017-02-22'/)
602 print *,
'BUFRLIB value for missing passed into GBLEVENTS ',
618 adpupa_virt = .false.
620 READ(5,prevdata,err=101,end=102)
629 7013
FORMAT(/
' ##> GBLEVENTS: ERROR READING STANDARD INPUT DATA CARDS',
630 $
' -- DEFAULTS TO "POSTEVENTS" MODE'/)
641 7014
FORMAT(/
' ##> GBLEVENTS: STANDARD INPUT DATA CARDS DO NOT ',
642 $
'EXIST -- DEFAULTS TO "POSTEVENTS" MODE'/)
653 adpupa_virt = .false.
656 IF(dovtmp) recalc_q=.true.
668 IF(.NOT.dofcst.AND..NOT.some_fcst)
THEN
670 901
FORMAT(/
' --> GBLEVENTS: PREVENTS MODE - FIRST GUESS NOT READ ',
674 701
FORMAT(/
' --> GBLEVENTS: PREVENTS MODE - DATE CHECK AND ',
675 $
'TRANSFORM THE FIRST GUESS'/)
679 7701
FORMAT(/
' --> GBLEVENTS: POSTEVENTS MODE - DATE CHECK AND ',
680 $
'TRANSFORM THE ANALYSIS'/)
683 IF(dofcst .OR. some_fcst .OR. doanls)
THEN
684 WRITE(cfile1,
'("fort.",I2.2)') iunitf(1)
686 iret = nf90_open(trim(cfile1),nf90_nowrite,ncid)
688 print *,
' ===> GFS FCST/ANAL INPUT IS NETCDF'
689 CALL
gblevn13(iunitf,idatep,im,jm,idrt)
691 CALL sigio_rropen(iunitf(1),cfile1,iret)
692 CALL sigio_srhead(iunitf(1),head1,iret1)
693 IF(iret == 0 .AND. iret1 == 0)
THEN
694 print *,
' ===> GLOBAL FCST/ANAL INPUT IS SIGIO'
695 CALL sigio_sclose(iunitf(1),iret)
696 CALL
gblevn10(iunitf,idatep,im,jm,idrt)
698 CALL nemsio_open(gfile1,trim(cfile1),
'read',iret=iret)
700 CALL nemsio_close(gfile1,iret=iret)
701 print *,
' ===> GFS FCST/ANAL INPUT IS NEMSIO'
702 CALL
gblevn12(iunitf,idatep,im,jm,idrt)
708 print*,
'after returning from GBLEVN10, GBLEVN12,',
709 $
' or GBLEVN13. idrt=',idrt
717 702
FORMAT(/
' --> GBLEVENTS: READ ERROR FILES'/)
724 IF(.NOT.doanls) print 3702
725 3702
FORMAT(/
' --> GBLEVENTS: OBS. ERROR NOT ENCODED IN PREPBUFR ',
733 CALL ufbqcd(iunitp,
'PREVENT',pvcd)
734 CALL ufbqcd(iunitp,
'VIRTMP ',vtcd)
737 703
FORMAT(/1x,100(
'#')/)
743 IF(.NOT.doanls)
WRITE(iunits,1701) idatep
744 1701
FORMAT(//130(
'#')//38x,
'*** "PREVENT" EVENTS DATA FILTERING ',
745 $
'SUMMARY ***'/35x,
'--> CENTER DATE FOR PREPBUFR FILE IS: ',i10,
755 IF(newtyp.EQ.1)
WRITE(iunits,1702) subset
756 1702
FORMAT(130(
'-')/39x,
'--> SUMMARY FOR TABLE A ENTRY "',a8,
'" <--'/)
758 IF(.NOT.dofcst .AND. some_fcst) fcst = (subset.EQ.
'ADPUPA '
759 $ .OR.subset.EQ.
'PROFLR '.OR.subset .EQ.
'AIRCFT '.OR.subset
760 $ .EQ.
'AIRCAR '.OR.subset .EQ.
'VADWND ')
769 virt = (recalc_q.AND.(subset.EQ.
'ADPSFC '.OR.
770 $ subset.EQ.
'SFCSHP '.OR.
771 $ subset.EQ.
'MSONET '.OR.
772 $ subset.EQ.
'RASSDA '.OR.
773 $ subset.EQ.
'SATEMP '.OR.
774 $ (subset.EQ.
'ADPUPA '.AND.adpupa_virt)))
777 IF(.NOT.(fcst.OR.doberr.OR.virt.OR.doprev))
THEN
778 IF(newtyp.EQ.1)
WRITE(iunits,1703)
779 1703
FORMAT(/
' ==> DATA FILTERING NOT PERFORMED FOR THIS TABLE A ',
780 $
'ENTRY -- FORECAST, OBS ERROR, "VIRTMP", "PREVENT" PROCESSING ',
794 CALL ufbint(-iunitp,obs_8,13,255,nlev,obstr)
795 CALL ufbint(-iunitp,qms_8,12,255,nlev,qmstr)
796 CALL ufbint(-iunitp,hdr_8,10, 1,iret,headr)
803 IF(fcst.OR.doanls)
THEN
816 CALL ufbint(iunitp,bak_8,12,nlev,iret,fcstr)
818 CALL ufbint(iunitp,bak_8,12,nlev,iret,anstr)
832 IF(newtyp.EQ.1)
WRITE(iunits,1710)
833 1710
FORMAT(/
' ==> OBS ERROR VALUES ARE ENCODED FOR THIS TABLE A ',
834 $
'ENTRY'//
' ==> FILTERING VIA MISSING OBS ERROR TEST IS ',
835 $
'PERFORMED FOR THIS TABLE A ENTRY SINCE OBS ERROR VALUES ARE ',
836 $
'PROCESSED/STORED'/)
838 IF(nlev.GT.0) CALL ufbint(iunitp,bak_8,12,nlev,iret,oestr)
840 IF(newtyp.EQ.1)
WRITE(iunits,1705)
841 1705
FORMAT(/
' ==> OBS ERROR VALUES NOT ENCODED FOR THIS TABLE A ',
842 $
'ENTRY'//
' ==> FILTERING VIA MISSING OBS ERROR TEST NOT ',
843 $
'PERFORMED FOR THIS TABLE A ENTRY SINCE OBS ERROR VALUES NOT ',
844 $
'PROCESSED/STORED'/)
851 IF(newtyp.EQ.1)
WRITE(iunits,1704)
852 1704
FORMAT(/
' ==> FORECAST VALUES NOT ENCODED FOR THIS TABLE A ',
853 $
'ENTRY'//
' ==> FILTERING VIA POB VS. GESS PSFC TEST NOT ',
854 $
'PERFORMED FOR THIS TABLE A ENTRY SINCE FORECAST VALUES NOT ',
855 $
'PROCESSED/STORED'/)
857 IF(newtyp.EQ.1)
WRITE(iunits,1708)
858 1708
FORMAT(/
' ==> FORECAST VALUES ARE ENCODED FOR THIS TABLE A ',
859 $
'ENTRY'//
' ==> FILTERING VIA POB VS. GESS PSFC TEST IS ',
860 $
'PERFORMED FOR THIS TABLE A ENTRY SINCE FORECAST VALUES ARE ',
861 $
'PROCESSED/STORED'/)
865 IF(newtyp.EQ.1)
WRITE(iunits,1807)
866 1807
FORMAT(/
' ==> "PREVENT" EVENT PROCESSING IS PERFORMED FOR THIS',
868 CALL
gblevn02(iunitp,iunits,newtyp,subset)
870 IF(newtyp.EQ.1)
WRITE(iunits,1806)
871 1806
FORMAT(/
' ==> "PREVENT" EVENT PROCESSING NOT PERFORMED FOR THIS',
879 IF(newtyp.EQ.1)
WRITE(iunits,1706)
880 1706
FORMAT(/
' ==> "VIRTMP" EVENT PROCESSING NOT PERFORMED FOR THIS ',
883 IF(newtyp.EQ.1)
WRITE(iunits,1707)
884 1707
FORMAT(/
' ==> "VIRTMP" EVENT PROCESSING IS PERFORMED FOR THIS ',
900 SUBROUTINE gblevn01(IUNITE) ! FORMERLY SUBROUTINE ETABLE
902 COMMON /gbevdd/ errs(300,33,6)
912 READ(iunite,
'(1X,I3)',end=100) kx
915 READ(iunite,
'(1X,6E12.5)') (errs(kx,k,m),m=1,6)
921 print
'(" ##GBLEVENTS/GBLEVN01 - OBS. ERROR TABLE EMPTY OR ",
922 $ "DOES NOT EXIST - STOP 60")'
945 dimension nflgrt(100:299,12),oemin(2:6)
946 CHARACTER*8 stnid,subset
947 CHARACTER*40 pevn,qevn,tevn,wevn,pwvn,pw1vn,pw2vn,pw3vn,pw4vn
948 REAL(8) pev_8(4,255),qev_8(4,255),tev_8(4,255),wev_8(5,255),
949 $ pwv_8(4,255),pw1v_8(4,255),pw2v_8(4,255),
950 $ pw3v_8(4,255),pw4v_8(4,255),obs_8,qms_8,bak_8,sid_8,
952 LOGICAL fcst,rejp_ps,rejps,rejt,rejq,rejw,rejpw,rejpw1,
953 $ rejpw2,rejpw3,rejpw4,satmqc,satemp,soln60,sols60,
954 $ moerr_p,moerr_t,adpupa_virt,doberr,dofcst,some_fcst,
955 $ dovtmp,virt,recalc_q,doprev
958 COMMON /gbevaa/ sid_8,obs_8(13,255),qms_8(12,255),bak_8(12,255),
959 $ xob,yob,dhr,typ,nlev
960 COMMON /gbevbb/ pvcd,vtcd
961 COMMON /gbevcc/ dovtmp,dofcst,some_fcst,doberr,fcst,virt,
962 $ qtop_rej,satmqc,adpupa_virt,recalc_q,doprev,dopmsl
963 COMMON /gbevee/psg01,zsg01,tg01(500),ug01(500),vg01(500),
964 x qg01(500),zint(500),pint(500),pintlog(500),plev(500),
966 COMMON /gbevff/ bmiss
968 equivalence(sid_8,stnid)
970 DATA pevn /
'POB PQM PPC PRC '/
971 DATA qevn /
'QOB QQM QPC QRC '/
972 DATA tevn /
'TOB TQM TPC TRC '/
973 DATA wevn /
'UOB VOB WQM WPC WRC '/
974 DATA pwvn /
'PWO PWQ PWP PWR '/
975 DATA pw1vn /
'PW1O PW1Q PW1P PW1R '/
976 DATA pw2vn /
'PW2O PW2Q PW2P PW2R '/
977 DATA pw3vn /
'PW3O PW3Q PW3P PW3R '/
978 DATA pw4vn /
'PW4O PW4Q PW4P PW4R '/
982 DATA oemin /0.5,0.1,1.0,0.5,1.0/
984 ni = mod((nint(typ)/10),10)
986 IF(newtyp.EQ.1) nflgrt = 0
991 satemp = ((typ.GE.160.AND.typ.LE.179).AND.satmqc)
992 soln60 = ((typ.GE.160.AND.typ.LE.163).AND.yob.GE.-60.AND.satmqc)
993 sols60 = ((typ.EQ.160.OR.typ.EQ.162.OR.typ.EQ.163).AND.yob.LT.-60
1065 IF(pob.LT.bmiss)
THEN
1066 IF(.NOT.fcst) psg01 = pob
1067 IF(pob-psg01.GE.100. .OR. pob.LE.0. .OR.
1068 $ ((pob.LE.450..OR.pob.GE.1100.) .AND. ni.EQ.8))
THEN
1069 IF(pob.LE.0..OR.pob.LE.450..OR.pob.GE.1100.)
THEN
1071 WRITE(iunits,302) stnid,nint(typ),yob,xob,pob
1072 302
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1073 $
'E, REJECT ALL DATA ON SFC LVL - POB=',f6.1,
' MB, FAILS SANITY ',
1076 WRITE(iunits,101) stnid,nint(typ),yob,xob,pob
1077 101
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1078 $
'E, REJECT ALL DATA ON LVL - POB=',f6.1,
' MB, FAILS SANITY CHECK')
1083 WRITE(iunits,303) stnid,nint(typ),yob,xob,pob,psg01
1084 303
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1085 $
'E, REJECT ALL DATA ON SFC LVL - POB=',f6.1,
' MB, > 100 MB ',
1086 $
'BELOW GES PSFC(=',f6.1,
'MB)')
1088 WRITE(iunits,102) stnid,nint(typ),yob,xob,pob,psg01
1089 102
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1090 $
'E, REJECT ALL DATA ON LVL - POB=',f6.1,
' MB, > 100 MB BELOW ',
1091 $
'GES PSFC(=',f6.1,
' MB)')
1123 IF(pob.LT.bmiss .AND. cat.EQ.0)
THEN
1124 IF(.NOT.fcst) psg01 = pob
1125 rejps =
oefg01(pob,typ,5,oemin(5)).GE.bmiss .OR.
1126 $ abs(pob-psg01).GE.100. .OR.
1129 IF(rejps.OR.rejp_ps)
THEN
1131 IF(.NOT.rejp_ps)
THEN
1132 IF(abs(pob-psg01).GE.100.)
THEN
1133 WRITE(iunits,104) stnid,nint(typ),yob,xob,pob,psg01
1134 104
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1135 $
'E, REJECT ALL DATA ON SFC LVL - POB=',f6.1,
' MB, > 100 MB ',
1136 $
'ABOVE GES PSFC(=',f6.1,
'MB)')
1138 ELSE IF(pob.LE.450..OR.pob.GE.1100.)
THEN
1139 WRITE(iunits,105) stnid,nint(typ),yob,xob,pob
1140 105
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1141 $
'E, REJECT ALL DATA ON SFC LVL - POB=',f6.1,
' MB, FAILS SANITY ',
1142 $
'CHECK - this should never be printed since test now made in ',
1146 IF(nflgrt(nint(typ),1).EQ.0)
THEN
1147 WRITE(iunits,201) nint(typ)
1148 201
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1149 $
'ALL DATA ON SURFACE LEVEL DUE TO MISSING SFC-P OBS ERROR'/)
1150 nflgrt(nint(typ),1) = 1
1161 IF(rcd.EQ.3) moerr_p = .true.
1162 IF(rej.EQ.9.AND.(pqm.GT.3.AND.pqm.LT.15))
THEN
1164 1401
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1165 $
'E, INPUT PQM =',f4.0,
' -- DO NOT APPLY PSFC QM=9 EVENT')
1200 IF(tob.LT.bmiss)
THEN
1201 rejt =
oefg01(pob,typ,2,oemin(2)).GE.bmiss .OR.
1202 $ (soln60.AND.nint(pob*10.).GE.1000) .OR.
1203 $ (sols60.AND.nint(pob*10.).GT.1000)
1204 IF(rejt.OR.rejp_ps)
THEN
1206 IF(.NOT.rejp_ps)
THEN
1207 IF(soln60.AND.nint(pob*10.).GE.1000)
THEN
1208 IF(nflgrt(nint(typ),6).EQ.0)
THEN
1209 WRITE(iunits,7304) nint(typ)
1210 7304
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1211 $
'TOB/QOB AT AND BELOW 100 MB IF REPORT IS NORTH OF 60S LATITUDE'/)
1212 nflgrt(nint(typ),6) = 1
1215 ELSE IF(sols60.AND.nint(pob*10.).GT.1000)
THEN
1216 IF(nflgrt(nint(typ),7).EQ.0)
THEN
1217 WRITE(iunits,7305) nint(typ)
1218 7305
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1219 $
'TOB/QOB BELOW 100 MB IF REPORT IS SOUTH OF 60S LATITUDE'/)
1220 nflgrt(nint(typ),7) = 1
1224 IF(nflgrt(nint(typ),2).EQ.0)
THEN
1226 WRITE(iunits,304) nint(typ)
1227 304
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1228 $
'TOB/QOB ON SFC LVL DUE TO MISSING OBS ERROR'/)
1230 WRITE(iunits,202) nint(typ)
1231 202
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1232 $
'TOB/QOB ON AT LEAST ONE LVL (IF AVAILABLE ON THAT LVL) DUE TO ',
1233 $
'MISSING OBS ERROR'/)
1235 nflgrt(nint(typ),2) = 1
1249 IF(rcd.EQ.3) moerr_t = .true.
1250 IF(rej.EQ.9.AND.(tqm.GT.3.AND.tqm.LT.15))
THEN
1252 1402
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1253 $
'E, INPUT TQM =',f4.0,
' -- DO NOT APPLY TEMP QM=9 EVENT')
1295 IF(qob.LT.bmiss)
THEN
1296 rejq =
oefg01(pob,typ,3,oemin(3)).GE.bmiss .OR.
1299 $ nint(pob * 10.).LT.nint(qtop_rej * 10.) .OR.
1303 IF(rejq.OR.rejp_ps)
THEN
1305 IF(.NOT.rejp_ps.AND..NOT.rejt)
THEN
1307 IF(nflgrt(nint(typ),8).EQ.0)
THEN
1308 WRITE(iunits,7306) nint(typ)
1309 7306
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1310 $
'QOB ON ALL LEVELS'/)
1311 nflgrt(nint(typ),8) = 1
1314 ELSE IF(qob.LE.0..OR.tob.GE.bmiss.OR.tob.LE.-150.)
THEN
1315 WRITE(iunits,111) stnid,nint(typ),yob,xob,
1317 111
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1318 $
'E, REJECT QOB ON LVL - QOB=',f6.3,
' G/KG, FAILS SANITY CHECK ',
1319 $
'(TOB=',f5.1,
' C)')
1321 ELSE IF(
oefg01(pob,typ,3,oemin(3)).GE.bmiss)
THEN
1322 IF(nflgrt(nint(typ),3).EQ.0)
THEN
1324 WRITE(iunits,305) nint(typ)
1325 305
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1326 $
'QOB ON SFC LVL DUE TO MISSING OBS ERROR'/)
1328 WRITE(iunits,203) nint(typ)
1329 203
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1330 $
'QOB ON AT LEAST ONE LEVEL (IF AVAILABLE ON THAT LEVEL) DUE TO ',
1331 $
'MISSING OBS ERROR'/)
1333 nflgrt(nint(typ),3) = 1
1341 WRITE(iunits,109) stnid,nint(typ),yob,xob,
1342 $ qob/1000.,qtop_rej,pob
1343 109
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1344 $
'E, REJECT QOB ON LVL - QOB=',f6.3,
' G/KG, ABOVE ',f6.1,
1345 $
'MB (POB=',f6.1,
' MB)')
1350 IF(moerr_p.OR.moerr_t)
THEN
1355 IF(rej.EQ.9.AND.(qqm.GT.3.AND.qqm.LT.15))
THEN
1357 1403
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1358 $
'E, INPUT QQM =',f4.0,
' -- DO NOT APPLY MSTR QM=9 EVENT')
1392 IF(min(uob,vob).LT.bmiss)
THEN
1393 rejw =
oefg01(pob,typ,4,oemin(4)).GE.bmiss
1394 IF(rejw.OR.rejp_ps)
THEN
1396 IF(.NOT.rejp_ps)
THEN
1397 IF(nflgrt(nint(typ),4).EQ.0)
THEN
1399 WRITE(iunits,1304) nint(typ)
1400 1304
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1401 $
'UOB/VOB ON SFC LVL DUE TO MISSING OBS ERROR'/)
1403 WRITE(iunits,204) nint(typ)
1404 204
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1405 $
'UOB/VOB ON AT LEAST ONE LVL (IF AVAILABLE ON THAT LVL) DUE TO ',
1406 $
'MISSING OBS ERROR'/)
1408 nflgrt(nint(typ),4) = 1
1423 IF(rej.EQ.9.AND.(wqm.GT.3.AND.wqm.LT.15))
THEN
1425 1404
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1426 $
'E, INPUT WQM =',f4.0,
' -- DO NOT APPLY WIND QM=9 EVENT')
1437 if(subset.eq.
"SFCSHP".and.uob.eq.0..and.vob.eq.0.)
then
1438 call ufbint(-iunitp,ufc_8,1,1,iret,
'UFC')
1439 call ufbint(-iunitp,vfc_8,1,1,iret,
'VFC')
1443 if(ibfms(ufc_8).eq.0.and.ibfms(vfc_8).eq.0)
then
1444 if(abs(ufc_8).ge.5..or.abs(vfc_8).ge.5.)
then
1446 write(iunits,1504) stnid,nint(typ),ufc_8,vfc_8
1447 1504
FORMAT(/
' --> ID ',a8,
', (RTP ',i3,
' UFC=',f5.2,
' VFC=',f5.2,
') ',
1448 $
'NEW WIND EVENT, UOB/VOB CALM (0 M/S) WHILE |UFC| AND/OR |VFC| ',
1449 $
'>= 5 M/S, QM SET TO 8'/)
1471 IF(pwo.LT.bmiss)
THEN
1472 rejpw =
oefg01(prss*0.01,typ,6,oemin(6)).GE.bmiss
1474 IF(nflgrt(nint(typ),5).EQ.0)
THEN
1475 WRITE(iunits,205) nint(typ)
1476 205
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1477 $
'PWO DUE TO MISSING OBS ERROR'/)
1478 nflgrt(nint(typ),5) = 1
1483 IF(pwq.GT.3.AND.pwq.LT.15)
THEN
1485 1405
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1486 $
'E, INPUT PWQ =',f4.0,
' -- DO NOT APPLY PWtO QM=9 EVENT')
1506 IF(pw1o.LT.bmiss)
THEN
1507 rejpw1 =
oefg01(prss*0.01,typ,6,oemin(6)).GE.bmiss
1509 IF(nflgrt(nint(typ),9).EQ.0)
THEN
1510 WRITE(iunits,206) nint(typ)
1511 206
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1512 $
'PW1O DUE TO MISSING OBS ERROR'/)
1513 nflgrt(nint(typ),9) = 1
1518 IF(pw1q.GT.3.AND.pw1q.LT.15)
THEN
1520 1406
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1521 $
'E, INPUT PW1Q =',f4.0,
' -- DO NOT APPLY PW1O QM=9 EVENT')
1541 IF(pw2o.LT.bmiss)
THEN
1542 rejpw2 =
oefg01(prss*0.01,typ,6,oemin(6)).GE.bmiss
1544 IF(nflgrt(nint(typ),10).EQ.0)
THEN
1545 WRITE(iunits,207) nint(typ)
1546 207
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1547 $
'PW2O DUE TO MISSING OBS ERROR'/)
1548 nflgrt(nint(typ),10) = 1
1553 IF(pw2q.GT.3.AND.pw2q.LT.15)
THEN
1555 1407
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1556 $
'E, INPUT PW2Q =',f4.0,
' -- DO NOT APPLY PW2O QM=9 EVENT')
1576 IF(pw3o.LT.bmiss)
THEN
1577 rejpw3 =
oefg01(prss*0.01,typ,6,oemin(6)).GE.bmiss
1579 IF(nflgrt(nint(typ),11).EQ.0)
THEN
1580 WRITE(iunits,208) nint(typ)
1581 208
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1582 $
'PW3O DUE TO MISSING OBS ERROR'/)
1583 nflgrt(nint(typ),11) = 1
1588 IF(pw3q.GT.3.AND.pw3q.LT.15)
THEN
1590 1408
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1591 $
'E, INPUT PW3Q =',f4.0,
' -- DO NOT APPLY PW3O QM=9 EVENT')
1611 IF(pw4o.LT.bmiss)
THEN
1612 rejpw4 =
oefg01(prss*0.01,typ,6,oemin(6)).GE.bmiss
1614 IF(nflgrt(nint(typ),12).EQ.0)
THEN
1615 WRITE(iunits,209) nint(typ)
1616 209
FORMAT(/
' --> FOR ALL REPORTS WITH REPORT TYPE ',i3,
', REJECT ',
1617 $
'PW4O DUE TO MISSING OBS ERROR'/)
1618 nflgrt(nint(typ),12) = 1
1623 IF(pw4q.GT.3.AND.pw4q.LT.15)
THEN
1625 1409
FORMAT(
' ~~> ID ',a8,
' (RTP ',i3,
'), LAT=',f6.2,
'N, LON=',f6.2,
1626 $
'E, INPUT PW4Q =',f4.0,
' -- DO NOT APPLY PW4O QM=9 EVENT')
1643 IF(maxpev .GT.0) CALL ufbint(iunitp,pev_8, 4,maxpev, iret,pevn)
1644 IF(maxqev .GT.0) CALL ufbint(iunitp,qev_8, 4,maxqev, iret,qevn)
1645 IF(maxtev .GT.0) CALL ufbint(iunitp,tev_8, 4,maxtev, iret,tevn)
1646 IF(maxwev .GT.0) CALL ufbint(iunitp,wev_8, 5,maxwev, iret,wevn)
1647 IF(maxpwv .GT.0) CALL ufbint(iunitp,pwv_8, 4,maxpwv, iret,pwvn)
1648 IF(maxpw1v.GT.0) CALL ufbint(iunitp,pw1v_8,4,maxpw1v,iret,pw1vn)
1649 IF(maxpw2v.GT.0) CALL ufbint(iunitp,pw2v_8,4,maxpw2v,iret,pw2vn)
1650 IF(maxpw3v.GT.0) CALL ufbint(iunitp,pw3v_8,4,maxpw3v,iret,pw3vn)
1651 IF(maxpw4v.GT.0) CALL ufbint(iunitp,pw4v_8,4,maxpw4v,iret,pw4vn)
1660 SUBROUTINE gblevn03(SUBSET) ! FORMERLY SUBROUTINE GETFC
1664 REAL(8) obs_8,qms_8,bak_8,sid_8
1668 COMMON /gbevaa/ sid_8,obs_8(13,255),qms_8(12,255),bak_8(12,255),
1669 $ xob,yob,dhr,typ,nlev
1670 COMMON /gbevee/psg01,zsg01,tg01(500),ug01(500),vg01(500),
1671 x qg01(500),zint(500),pint(500),pintlog(500),plev(500),
1673 COMMON /gbevff/ bmiss
1676 DATA tzero / 273.15 /
1677 DATA betap / .0552 /
1678 DATA beta / .00650 /
1710 IF(pob.LE.0. .OR. pob.GE.bmiss) goto 10
1717 if (poblog<=plevlog(k) .and. poblog>plevlog(k+1))
then
1724 wt = (poblog-plevlog(lb)) / (plevlog(la)-plevlog(lb))
1733 if (poblog<=pintlog(k) .and. poblog>pintlog(k+1))
then
1742 IF(cat.EQ.0 .AND. zob.LT.bmiss)
THEN
1743 ts = tg01(1) + (psg01-plev(1))*betap
1745 tm = ts - dz*beta*.5
1746 pfc = psg01*exp(-dz/(tm*rog))
1754 IF(qob.LT.bmiss.OR.tob.LT.bmiss.OR.typ.EQ.111)
THEN
1758 qob = qg01(lb) + (qg01(la)-qg01(lb))*wt
1764 IF(tob.LT.bmiss.OR.subset.EQ.
'VADWND '.OR.typ.EQ.111)
THEN
1769 IF(pob.GT.plev(1))
THEN
1770 tob = tg01(1) + (pob-plev(1))*betap
1772 tob = tg01(lb) + (tg01(la)-tg01(lb))*wt
1780 IF(zob.LT.bmiss)
THEN
1781 IF(pob.GT.plev(1))
THEN
1782 tm = tg01(1) + (.5*(pint(1)+pob)-plev(1))*betap
1783 zob = zint(1) - rog*tm*log(pob/pint(1))
1785 tm = tg01(lb) + (tg01(la)-tg01(lb))*wt
1786 zob = zint(li) - rog*tm*log(pob/pint(li))
1793 IF(uob.LT.bmiss .OR. vob.LT.bmiss)
THEN
1794 uob = ug01(lb) + (ug01(la)-ug01(lb))*wt
1795 vob = vg01(lb) + (vg01(la)-vg01(lb))*wt
1839 dimension oemin(2:6)
1840 REAL(8) obs_8,qms_8,bak_8,sid_8
1843 COMMON /gbevaa/ sid_8,obs_8(13,255),qms_8(12,255),bak_8(12,255),
1844 $ xob,yob,dhr,typ,nlev
1845 COMMON /gbevff/ bmiss
1847 DATA oemin /0.5,0.1,1.0,0.5,1.0/
1863 wob = max(obs_8(5,l),obs_8(6,l))
1871 IF(cat .EQ.0 ) bak_8( 1,l) =
oefg01(pob,typ,5,oemin(5))
1872 IF(qob .LT.bmiss) bak_8( 2,l) =
oefg01(pob,typ,3,oemin(3))
1873 IF(tob .LT.bmiss) bak_8( 3,l) =
oefg01(pob,typ,2,oemin(2))
1874 IF(wob .LT.bmiss) bak_8( 5,l) =
oefg01(pob,typ,4,oemin(4))
1875 IF(pwo .LT.bmiss) bak_8( 6,l) =
oefg01(pob,typ,6,oemin(6))
1876 IF(pw1o.LT.bmiss) bak_8( 7,l) =
oefg01(pob,typ,6,oemin(6))
1877 IF(pw2o.LT.bmiss) bak_8( 8,l) =
oefg01(pob,typ,6,oemin(6))
1878 IF(pw3o.LT.bmiss) bak_8( 9,l) =
oefg01(pob,typ,6,oemin(6))
1879 IF(pw4o.LT.bmiss) bak_8(10,l) =
oefg01(pob,typ,6,oemin(6))
1890 SUBROUTINE gblevn06(XOB,YOB) ! FORMERLY SUBROUTINE HTERP
1894 COMMON /gbevee/ psi,zsi,ti(500),ui(500),vi(500),qi(500),
1895 x zint(500),pint(500),pintlog(500),plev(500),plevlog(500)
1905 i1 = mod(i0,imax) + 1
1908 wy = (yob+90.)/dlat + 1.0
1940 p1 = iar14t(i0,j0,k)
1941 p2 = iar14t(i0,j1,k)
1942 p3 = iar14t(i1,j0,k)
1943 p4 = iar14t(i1,j1,k)
1946 ti(k) = p5+(p6-p5)*wx
1948 p1 = iar15u(i0,j0,k)
1949 p2 = iar15u(i0,j1,k)
1950 p3 = iar15u(i1,j0,k)
1951 p4 = iar15u(i1,j1,k)
1954 ui(k) = p5+(p6-p5)*wx
1956 p1 = iar16v(i0,j0,k)
1957 p2 = iar16v(i0,j1,k)
1958 p3 = iar16v(i1,j0,k)
1959 p4 = iar16v(i1,j1,k)
1962 vi(k) = p5+(p6-p5)*wx
1964 p1 = iar17q(i0,j0,k)
1965 p2 = iar17q(i0,j1,k)
1966 p3 = iar17q(i1,j0,k)
1967 p4 = iar17q(i1,j1,k)
1970 qi(k) = p5+(p6-p5)*wx
1975 p1 = iarpsl(i0,j0,k)
1976 p2 = iarpsl(i0,j1,k)
1977 p3 = iarpsl(i1,j0,k)
1978 p4 = iarpsl(i1,j1,k)
1981 plev(k) = p5+(p6-p5)*wx
1986 p1 = iarpsi(i0,j0,k+1)
1987 p2 = iarpsi(i0,j1,k+1)
1988 p3 = iarpsi(i1,j0,k+1)
1989 p4 = iarpsi(i1,j1,k+1)
1992 pint(k+1) = p5+(p6-p5)*wx
2001 pintlog(1) = log(pint(1))
2004 zint(k) = zint(k0) - rog*ti(k0)*log(pint(k)/pint(k0))
2005 pintlog(k) = log(pint(k))
2013 plevlog(k) = log(plev(k))
2063 COMMON /gbevdd/errs(300,33,6)
2064 COMMON /gbevff/ bmiss
2073 p = max(0.,min(p,2000.))
2075 IF(p.GE.errs(kx,1,1)) k1 = 1
2078 IF(p.GE.errs(kx,kl+1,1).AND.p.LE.errs(kx,kl,1)) k1 = kl
2081 IF(p.LE.errs(kx,33,1)) k1 = 5
2085 ediff = errs(kx,k2,1) - errs(kx,k1,1)
2086 IF(abs(ediff).GT.0.0)
THEN
2087 del = (p - errs(kx,k1,1))/ediff
2092 del = max(0.,min(del,1.0))
2094 oefg01 = ((1.0 - del) * errs(kx,k1,ie)) + (del * errs(kx,k2,ie))
2206 SUBROUTINE gblevn08(IUNITP,SUBSET) ! FORMERLY SUBROUTINE VTPEVN
2208 parameter(rd=287.04, g=9.81)
2209 CHARACTER*80 evnstq,evnstv,evnstp
2210 CHARACTER*8 subset,stnid
2211 REAL(8) tdp_8(255),tqm_8(255),qqm_8(255),bakq_8(4,255),
2212 $ bakv_8(4,255),bakp_8(3),obs_8,qms_8,bak_8,
2214 real(8) pmo_8,zob_8,pmsl_8
2217 LOGICAL evnq,evnv,dovtmp,trop,adpupa_virt,doberr,dofcst,
2218 $ some_fcst,fcst,virt,satmqc,recalc_q,doprev,
2221 COMMON /gbevaa/ sid_8,obs_8(13,255),qms_8(12,255),bak_8(12,255),
2222 $ xob,yob,dhr,typ,nlev
2223 COMMON /gbevbb/ pvcd,vtcd
2224 COMMON /gbevcc/ dovtmp,dofcst,some_fcst,doberr,fcst,virt,
2225 $ qtop_rej,satmqc,adpupa_virt,recalc_q,doprev,dopmsl
2226 COMMON /gbevff/ bmiss
2228 DATA evnstq /
'QOB QQM QPC QRC'/
2229 DATA evnstv /
'TOB TQM TPC TRC'/
2230 data evnstp /
'PMO PMQ PMIN'/
2232 equivalence(sid_8,stnid)
2237 es(t) = 6.1078*exp((17.269*(t - 273.16))/((t - 273.16)+237.3))
2238 qs(t,p) = (0.622*es(t))/(p-(0.378*es(t)))
2244 pmsl_fcn(p,tv,z) = p*exp((g*z)/(rd*tv))
2258 surf = (subset.eq.
'ADPSFC'.or.subset.eq.
'SFCSHP'.or.
2259 $ subset.eq.
'MSONET')
2266 CALL ufbint(-iunitp,tdp_8,1,255,nltd,
'TDO')
2267 CALL ufbint(-iunitp,qqm_8,1,255,nlqq,
'QQM')
2268 CALL ufbint(-iunitp,tqm_8,1,255,nltq,
'TQM')
2269 if(surf.and.dopmsl)
then
2270 call ufbint(-iunitp,pmo_8,1,1,nlpm,
'PMO')
2271 call ufbint(-iunitp,zob_8,1,1,nlzo,
'ZOB')
2272 call ufbint(-iunitp,pqm_8,1,1,nlpq,
'PQM')
2274 IF(subset.NE.
'RASSDA '.AND.subset.NE.
'SATEMP ')
THEN
2275 IF(nltd.EQ.0)
RETURN
2276 IF(nlqq.EQ.0)
RETURN
2278 IF(nltq.EQ.0)
RETURN
2279 IF(subset.NE.
'RASSDA '.AND.subset.NE.
'SATEMP ')
THEN
2280 IF(nltd.NE.nlev)
THEN
2281 print.NE.
'(" ##GBLEVENTS/GBLEVN08 - NLTD NLEV - STOP 61")'
2284 IF(nlqq.NE.nlev)
THEN
2285 print.NE.
'(" ##GBLEVENTS/GBLEVN08 - NLQQ NLEV - STOP 63")'
2289 IF(nltq.NE.nlev)
THEN
2290 print.NE.
'(" ##GBLEVENTS/GBLEVN08 - NLTQ NLEV - STOP 62")'
2306 IF(subset.EQ.
'RASSDA '.OR.subset.EQ.
'SATEMP ')
THEN
2307 IF(tob.LT.bmiss)
THEN
2309 bakv_8(2,l) = tqm_8(l)
2317 IF(pob.LT.bmiss .AND. tob.LT.bmiss
2318 $ .AND. tdo.LT.bmiss)
THEN
2319 IF(qqm_8(l).GT.3)
THEN
2325 IF(tdo.LT.-103.15 .OR. tdo.GT.46.83 .OR. pob.LT.0.1 .OR.
2326 $ pob.GT.1100.) cycle
2328 qob = qs(tdo+273.16,pob)
2336 IF(qob*1e6.LT.bmiss .AND. qob.GT.0.) bakq_8(1,l) = qob*1e6
2337 bakq_8(2,l) = qqm_8(l)
2347 trop = (subset.EQ.
'ADPUPA ' .AND.
2348 $ ((cat.EQ.5 .AND. pob.LT.500.) .OR. pob.LT. 80. .OR. trop))
2349 IF(dovtmp .AND. .NOT.trop)
THEN
2350 bakv_8(1,l) = (tob+273.16)*(1.+.61*qob)-273.16
2352 IF(subset.EQ.
'ADPUPA ')
THEN
2354 IF((qqm_8(l).LT.4.OR.qqm_8(l).EQ.9.OR.qqm_8(l).EQ.15)
2355 $ .OR. tqm_8(l).EQ.0 .OR. tqm_8(l).GT.3
2356 $ .OR. pob.LE.700.)
THEN
2357 bakv_8(2,l) = tqm_8(l)
2368 IF(qqm_8(l).LT.4)
THEN
2369 bakv_8(2,l) = tqm_8(l)
2372 ELSE IF((qqm_8(l).EQ.9.OR.qqm_8(l).EQ.15).AND.
2373 $ (tqm_8(l).LE.3.OR.tqm_8(l).GE.15.OR.
2374 $ tqm_8(l).EQ.9))
THEN
2402 if(ibfms(pmo_8).ne.0)
then
2403 tv = bakv_8(1,1) + 273.16
2405 pmsl_8=pmsl_fcn(pob,tv,zob)
2407 bakp_8(2) = max(3,int(pqm_8))
2410 4000
format(
'--> ID ',a8,
' Pmsl missing - derived from Pstn; ',
2411 $
'PMIN = ',f4.1,
' PMQ = ',f4.1,
'')
2414 if(pmsl_8.gt.1060)
then
2415 write(*,4001) stnid,pob,bakp_8(1)
2416 4001
format(
'--> ID ',a8,
' Derived PMSL unrealistic; FLAG; ',
2417 $
'POB = ',f7.2,
' PMO = ',f7.2,
'')
2433 IF(evnq) CALL ufbint(iunitp,bakq_8,4,nlev,iret,evnstq)
2434 IF(evnv) CALL ufbint(iunitp,bakv_8,4,nlev,iret,evnstv)
2435 if(nlev.eq.1.and.evnp)
2436 $ call ufbint(iunitp,bakp_8,3,nlev,iret,evnstp)
2478 SUBROUTINE gblevn10(IUNITF,IDATEP,IM,JM,IDRT) ! FORMERLY
2485 INTEGER iunitf(2), idatep, im, jm, idrt
2486 REAL,
PARAMETER :: pi180=.0174532
2487 INTEGER*4,
PARAMETER :: one=1, ten=10
2489 TYPE(sigio_head
) :: head(2)
2490 TYPE(sigio_dats
) :: dats
2491 TYPE(sigio_datm
) :: datm
2493 INTEGER*4 iret,iret1,irets,imjm4,km4,idvm,ntrac,iunit4(2)
2495 INTEGER kfiles,ifile,jfile,idatgs_cor,jcap,jcap1,jcap2,jcap1x2,
2496 $ mdima,mdimb,mdimc,iromb,maxwv,idir,ns,i,j,k,l,ii,jj,ib,ie
2498 INTEGER idate(8,2),jdate(8,2),kdate(8,2),kindx(2)
2500 CHARACTER*6 coord(3)
2505 DATA coord /
'SIGMA ',
'HYBRID',
'GENHYB'/
2507 REAL,
ALLOCATABLE :: cofs(:,:), cofv(:,:,:)
2508 REAL,
ALLOCATABLE :: cofs_f(:,:,:), cofv_f(:,:,:,:)
2509 REAL (KIND=4),
ALLOCATABLE :: grds(:,:,:), grdv(:,:,:,:),
2510 $ wrk1(:,:), wrk2(:,:)
2515 iunit4(:) = iunitf(:)
2517 IF(mod(mod(idatep,100),3).EQ.0)
THEN
2520 print 331, mod(idatep,100)
2521 331
FORMAT(/
' --> GBLEVENTS: THE PREPBUFR CENTER HOUR (',i2.2,
2522 $
') IS A MULTIPLE OF 3 - ONLY ONE SIGIO (SIGMA OR HYBRID) ',
2523 $
'INPUT GLOBAL FILE IS READ,'/16x,
'NO TIME INTERPOLATION OF ',
2524 $
'SPECTRAL COEFFICIENTS IS PERFORMED'/)
2527 kindx(1) = mod(mod(idatep,100),3)
2528 kindx(2) = kindx(1) - 3
2529 print 332, mod(idatep,100)
2530 332
FORMAT(/
' --> GBLEVENTS: THE PREPBUFR CENTER HOUR (',i2.2,
2531 $
') IS NOT A MULTIPLE OF 3 - TWO SPANNING SIGIO (SIGMA OR ',
2532 $
'HYBRID) INPUT GLOBAL FILES'/16x,
'ARE READ AND THE SPECTRAL ',
2533 $
'COEFFICIENTS ARE INTERPOLATED TO THE PREPBUFR CENTER TIME'/)
2544 WRITE(cfile,
'("fort.",I2.2)') iunitf(ifile)
2546 CALL sigio_rropen(iunit4(ifile),cfile,iret)
2547 CALL sigio_rrhead(iunit4(ifile),head(ifile),iret1)
2548 print *,
' cfile_sig=',cfile,
'sigio_rropen: iret=',iret,
2549 $
'sigio_rrhead: iret1=',iret1
2551 IF(iret.NE.0) go to 903
2552 IF(iret1.NE.0) go to 904
2556 idate(1,ifile) = head(ifile)%IDATE(4)
2557 idate(2:3,ifile) = head(ifile)%IDATE(2:3)
2558 idate(5,ifile) = head(ifile)%IDATE(1)
2560 fhour = head(ifile)%FHOUR
2561 print
'(" idate=",I5,7I3.2," fhour=",F7.3)', idate(:,ifile),
2564 IF(idate(1,ifile).LT.100)
THEN
2572 print
'(" ##GBLEVENTS/GBLEVN10 - 2-DIGIT YEAR FOUND IN ",
2573 $ "SIGIO (SIGMA OR HYBRID) INPUT GLOBAL FILE ",I0,
2574 $ "; INITIAL DATE (YEAR IS: ",I0,")")', ifile,idate(1,ifile)
2575 print
'(" - USE WINDOWING TECHNIQUE TO OBTAIN 4-DIGIT",
2577 IF(idate(1,ifile).GT.20)
THEN
2578 idate(1,ifile) = 1900 + idate(1,ifile)
2580 idate(1,ifile) = 2000 + idate(1,ifile)
2582 print
'(" ##GBLEVENTS/GBLEVN10 - CORRECTED 4-DIGIT YEAR IS",
2583 $ " NOW: ",I0)', idate(1,ifile)
2587 CALL w3movdat(rinc,idate(:,ifile),jdate(:,ifile))
2589 print 1, ifile,head(ifile)%FHOUR,
2590 $ (idate(ii,ifile),ii=1,3),idate(5,ifile),(jdate(ii,ifile),
2591 $ ii=1,3),jdate(5,ifile)
2592 1
FORMAT(
' --> GBLEVENTS: SIGIO (SIGMA OR HYBRID) INPUT GLOBAL ',
2593 $
'FILE',i2,
' HERE IS A ',f5.1,
' HOUR FORECAST FROM ',i5.4,
2594 $ 3i3.2,
' VALID AT ',i5.4,3i3.2)
2596 kdate(:,ifile) = jdate(:,ifile)
2598 IF(kfiles.EQ.2)
THEN
2599 rinc(2) =
REAL(kindx(ifile))
2600 CALL w3movdat(rinc,jdate(:,ifile),kdate(:,ifile))
2603 idatgs_cor = (kdate(1,ifile) * 1000000) + (kdate(2,ifile) *
2604 $ 10000) + (kdate(3,ifile) * 100) + kdate(5,ifile)
2609 IF(idatep.NE.idatgs_cor) go to 901
2623 ntrac = head(1)%NTRAC
2624 nvcoord = head(1)%NVCOORD
2625 ALLOCATE (vcoord(kmax+1,nvcoord))
2627 vcoord = head(1)%VCOORD
2629 sfcpress_id = mod(head(1)%IDVM,ten)
2630 thermodyn_id = mod(head(1)%IDVM/ten,ten)
2631 IF(idvc == 3 .AND. thermodyn_id == 3)
THEN
2632 kmaxs = (ntrac+1)*kmax + 2
2638 ALLOCATE (iar12z(im,jm), iar13p(im,jm))
2639 ALLOCATE (iar14t(im,jm,kmax), iar15u(im,jm,kmax),
2640 $ iar16v(im,jm,kmax), iar17q(im,jm,kmax),
2641 $ iarpsl(im,jm,kmax), iarpsi(im,jm,kmax+1))
2644 if(idvc.eq.0) idvc = 1
2645 IF(idvc < 0 .or. idvc > 3)
THEN
2646 print *,
'##GBLEVENTS/GBLEVN10: INVALID VERT COORD ID (=',idvc
2657 mdimb = mdima/2+jcap1
2662 dlat = 180./(jmax-1)
2665 print 2, jcap,imax,jmax,kmax,kmaxs,dlat,dlon,coord(idvc)
2666 2
FORMAT(/
' --> GBLEVENTS: GLOBAL MODEL SPECS: T',i5,
' ',
2667 $ i5,
' x ',i5,
' GRID WITH ',i3,
' LEVELS ',i3,
2668 $
' SCALARS -------> ',f5.2,
' X ',f5.2,
' VERT. ',
2674 print 9901, jfile,(jdate(ii,jfile),ii=1,3),jdate(5,jfile),idatep
2675 9901
FORMAT(/
' ##GBLEVENTS/GBLEVN10 - SIGMA OR HYBRID FILE',i2,
' DATE',
2676 $
' (',i4.4,3(i2.2),
'), DOES NOT MATCH -OR SPAN- PREPBUFR FILE ',
2677 $
'CENTER DATE (',i10,
') -STOP 68'/)
2680 print 9903, jfile,iret
2681 9903
FORMAT(/
' ##GBLEVENTS/GBLEVN10 - SIGMA OR HYBRID FILE',i2,
2682 $
' RETURNED FROM SIGIO_RROPEN WITH R.C.',i3,
' -STOP 70'/)
2685 print 9904, jfile,iret1
2686 9904
FORMAT(/
' ##GBLEVENTS/GBLEVN10 - SIGMA OR HYBRID FILE',i2,
2687 $
' RETURNED FROM SIGIO_RRHEAD WITH R.C.',i3,
' -STOP 71'/)
2690 IF(kmax.GT.500)
then
2691 print
'(" ##GBLEVENTS/GBLEVN10 - KMAX TOO BIG = ",I0,
2692 $ " - UNABLE TO TRANSFORM GLOBAL SIGMA FILE(S) - STOP 69")',
2744 allocate (cofs_f(mdima,kmaxs,2), cofv_f(mdima,kmax,2,2))
2748 if (idrt < 0 .or. idrt > 256) idrt = 0
2751 IF(kindx(1).EQ.0)
THEN
2760 sfcpress_id = mod(head(1)%IDVM,ten)
2761 thermodyn_id = mod(head(1)%IDVM/ten,ten)
2763 print *,
'in sig sfcpress_id=',sfcpress_id,
' thermodyn_id=',
2764 $ thermodyn_id,
' ntrac=',ntrac
2765 print *,
' idvc=',idvc,
' idsl=',idsl,
' idvm=',idvm,
2766 $
' nvcoord=',nvcoord
2769 CALL sigio_aldats(head(ifile),dats,irets)
2770 CALL sigio_aldatm(head(ifile),one,km4,datm,irets)
2772 CALL sigio_rrdats(iunit4(ifile),head(ifile),dats,irets)
2775 print *,
' irets from sigio_rrdats = ', irets
2780 cofs_f(i,1,ifile) = dats%HS(i)
2781 cofs_f(i,2,ifile) = dats%PS(i)
2785 CALL sigio_rrdatm(iunit4(ifile),head(ifile),datm,irets)
2787 print *,
' irets from sigio_rrdatm = ', irets
2793 cofs_f(:,3:ie,ifile) = datm%T
2797 cofs_f(:,ib:ie,ifile) = datm%Q(:,1:kmax,i)
2799 cofv_f(:,:,1,ifile) = datm%D
2800 cofv_f(:,:,2,ifile) = datm%Z
2802 CALL sigio_axdats(dats,irets)
2803 CALL sigio_axdatm(datm,irets)
2808 ALLOCATE (cofs(mdima,kmaxs), cofv(mdima,kmax,2))
2809 ALLOCATE (grds(imax,jmax,kmaxs), grdv(imax,jmax,kmax,2))
2810 ALLOCATE (wrk1(imax*jmax,kmax), wrk2(imax*jmax,kmax+1))
2812 IF(kfiles.EQ.1)
THEN
2814 cofs(i,1:kmaxs) = cofs_f(i,1:kmaxs,1)
2815 cofv(i,1:kmax,1:2) = cofv_f(i,1:kmax,1:2,1)
2820 $ ((abs(kindx(2))*cofs_f(:,:,1)) +(kindx(1)*cofs_f(:,:,2)))/3.
2822 $ ((abs(kindx(2))*cofv_f(:,:,:,1))+(kindx(1)*cofv_f(:,:,:,2)))/3.
2825 DEALLOCATE (cofs_f, cofv_f)
2827 CALL sptezm(iromb,maxwv,idrt,imax,jmax,kmaxs,cofs,grds,idir)
2828 CALL sptezmv(iromb,maxwv,idrt,imax,jmax,kmax,
2829 & cofv(1,1,1),cofv(1,1,2),grdv(1,1,1,1),grdv(1,1,1,2),idir)
2831 IF( sfcpress_id == 2 )
THEN
2832 grds(:,:,2) = 1000.0*grds(:,:,2)
2834 grds(:,:,2) = 1000.0*exp(grds(:,:,2))
2838 CALL
gblevn11(imax,jmax,grds(1,1,ns))
2842 iar12z(i,j) = grds(i,j,1)
2843 iar13p(i,j) = grds(i,j,2) * 0.01
2847 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
2848 grds(:,:,3:2+kmax) = grds(:,:,3:2+kmax) / head(1)%CPI(1)
2849 print *,
' cpi(0)=',head(1)%cpi(1)
2851 CALL sigio_modpr(imjm4,imjm4,km4,nvcoord,idvc,idsl,vcoord,iret,
2852 $ grds(1,1,2),grds(1,1,3),pm=wrk1,pd=wrk2(1,2))
2857 wrk2(i+jj,1) = grds(i,j,2)
2861 wrk2(:,l+1) = wrk2(:,l) - wrk2(:,l+1)
2873 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
2875 grds(:,:,3:2+kmax) = grds(:,:,3:2+kmax) * head(1)%CPI(1)
2876 CALL sigio_cnvtdv(imjm4,imjm4,km4,idvc,idvm,ntrac,iret,
2877 $ grds(1,1,3),grds(1,1,3+kmax),head(1)%CPI,1_4)
2879 grds(:,:,3:kmax+2) = grds(:,:,3:kmax+2) *
2880 $ (1.+(461.50/287.05-1)*grds(:,:,3+kmax:2+kmax*2))
2885 CALL
gblevn11(imax,jmax,grdv(1,1,l,k))
2890 iar14t(i,j,l) = grds(i,j,2+l)
2891 iar15u(i,j,l) = grdv(i,j,l,1)
2892 iar16v(i,j,l) = grdv(i,j,l,2)
2894 iar17q(i,j,l) = max(0.0,grds(i,j,2+kmax+l)*1.0e6)
2895 iarpsl(i,j,l) = wrk1(i+jj,l)*0.01
2903 iarpsi(i,j,l) = wrk2(i+jj,l)*0.01
2916 DEALLOCATE (cofs, cofv)
2917 DEALLOCATE (grds, grdv, wrk1, wrk2)
2919 print *,
' RETURNING from GBLENV10'
2927 subroutine gblevn11(imax,jmax,grid) ! formerly subroutine n_s_swap
2930 real grid(imax,jmax)
2938 grid(i,j) = grid(i,jj)
2939 grid(i,jj) = temp(i)
2950 real(kind=8) grid(imax,jmax)
2951 real(kind=8) temp (imax)
2958 grid(i,j) = grid(i,jj)
2959 grid(i,jj) = temp(i)
3004 USE nemsio_openclose
3010 INTEGER iunitf(2), idatep, im, jm, idrt
3011 REAL(KIND=8),
PARAMETER:: con_rv=4.6150e+2,con_rd=2.8705e+2,
3012 $ fv=con_rv/con_rd-1.,oner=1.0,qmin=1.0e-10
3013 INTEGER*4,
PARAMETER :: ten=10
3016 INTEGER*4 iret,imjm4,km4,idvm,ntrac
3018 INTEGER idatgs_cor,jcap,jcap1,jcap2,jcap1x2,mdima,mdimb,mdimc,
3019 $ iromb,maxwv,idir,i,j,k,l,ii,jj
3021 INTEGER(4) idate7(7),jcap4,idvc4,dimz4,k4,im4,jm4,kindreal,kindint
3022 INTEGER(4) nfhour,nfminute,nfsecondn,nfsecondd,idsl4,idvm4
3024 REAL(4),
ALLOCATABLE :: vcoord4(:,:,:),cpi(:)
3025 REAL,
ALLOCATABLE :: tmp(:)
3026 TYPE(nemsio_gfile
) :: gfile
3028 INTEGER idate(8),jdate(8)
3031 REAL (KIND=4),
ALLOCATABLE :: psfc(:,:), tv(:,:,:),
3032 $ wrk1(:,:), wrk2(:,:)
3043 print 331, mod(idatep,100)
3044 331
format(/
' --> GBLEVENTS: ONLY ONE NEMSIO INPUT GLOBAL FILE IS ',
3045 $
'READ SINCE FILES ARE AVAILABLE EACH HOUR (NO NEED TO ',
3046 $
'INTERPOLATE'/16x,
'SPANNING FILES WHEN THE PREPBUFR CENTER HOUR',
3047 $
' (',i2.2,
') IS NOT A MULTIPLE OF 3)'/)
3055 WRITE(cfile2,
'("fort.",I2.2)') iunitf(1)
3057 CALL nemsio_open(gfile,trim(cfile2),
'read',iret=iret)
3058 print *,
' cfile_nems2=',cfile2,
'nemsio open,iret=',iret
3061 CALL nemsio_getfilehead(gfile,idate=idate7,
3062 & jcap=jcap4,dimx=im4,dimy=jm4,
3063 & dimz=dimz4,idvc=idvc4,ntrac=ntrac,idrt=idrtnems,
3064 & nfhour=nfhour,nfminute=nfminute,nfsecondn=nfsecondn,
3065 & nfsecondd=nfsecondd,idsl=idsl4,idvm=idvm4,iret=iret)
3073 if(idrt==-9999) idrt=4
3074 idate(1:3)=idate7(1:3)
3077 ALLOCATE(vcoord(kmax+1,3))
3080 IF(nfsecondd/=0.AND. nfsecondd/=-9999)
THEN
3081 fhour=
REAL(nfhour,8)+
REAL(nfminute/60.,8)+
3082 $
REAL(NFSECONDN*1./(NFSECONDD*360.),8)
3084 fhour=
REAL(nfhour,8)+
REAL(nfminute/60.,8)
3086 print
'(" idate=",I5,7I3.2," fhour=",F7.3)', idate,fhour
3088 ALLOCATE(vcoord4(kmax+1,3,2))
3089 CALL nemsio_getfilehead(gfile,vcoord=vcoord4,iret=iret)
3091 IF(maxval(vcoord4(:,3,1))==0..AND.minval(vcoord4(:,3,1))==0.)
THEN
3093 IF(maxval(vcoord4(:,2,1))==0..AND.minval(vcoord4(:,2,1))==0.)
3097 vcoord(1:kmax+1,1:nvcoord)=vcoord4(1:kmax+1,1:nvcoord,1)
3100 ALLOCATE(cpi(ntrac+1))
3101 CALL nemsio_getheadvar(gfile,
'CPI',cpi,iret=iret)
3104 CALL w3movdat(rinc,idate,jdate)
3106 print 1, fhour,(idate(ii),ii=1,3),idate(5),(jdate(ii),ii=1,3),
3108 1
FORMAT(
' --> GBLEVENTS: GLOBAL NEMSIO FILE: HERE IS A ',f5.1,
3109 $
' HOUR FORECAST FROM ',i5.4,3i3.2,
' VALID AT ',i5.4,3i3.2)
3111 idatgs_cor = (jdate(1) * 1000000) + (jdate(2) * 10000) +
3112 $ (jdate(3) * 100) + jdate(5)
3117 IF(idatep.NE.idatgs_cor) go to 901
3121 sfcpress_id = mod(idvm,ten)
3122 thermodyn_id = mod(idvm/ten,ten)
3124 IF(idvc == 3 .AND. thermodyn_id == 3)
THEN
3125 kmaxs = (ntrac+1)*kmax + 2
3131 ALLOCATE (iar12z(imax,jmax), iar13p(imax,jmax))
3132 ALLOCATE (iar14t(imax,jmax,kmax), iar15u(imax,jmax,kmax),
3133 $ iar16v(imax,jmax,kmax), iar17q(imax,jmax,kmax),
3134 $ iarpsl(imax,jmax,kmax), iarpsi(imax,jmax,kmax+1),
3135 $ iarpsd(imax,jmax,kmax))
3138 if(idvc.eq.0) idvc = 1
3139 IF(idvc < 0 .or. idvc > 3)
THEN
3140 print *,
'##GBLEVENTS/GBLEVN12: INVALID VERT COORD ID (=',idvc
3151 mdimb = mdima/2+jcap1
3154 dlat = 180./(jmax-1)
3157 print 2, jcap,imax,jmax,kmax,kmaxs,dlat,dlon,idvc
3160 2
FORMAT(/
' --> GBLEVENTS: GLOBAL MODEL SPECS: T',i5,
' ',
3161 $ i5,
' x ',i5,
' GRID WITH ',i3,
' LEVELS ',i3,
3162 $
' SCALARS -------> ',f5.2,
' X ',f5.2,
' VERT. ',
3163 $
'COORD ID IS: ',i0,
' (not sure what this means!')
3169 if (idrt < 0 .or. idrt > 256) idrt = 0
3172 print *,
'in nem sfcpress_id=',sfcpress_id,
' thermodyn_id=',
3173 $ thermodyn_id,
' ntrac=',ntrac
3174 print *,
' idvc=',idvc,
' idsl=',idsl,
' idvm=',idvm,
' nvcoord=',
3177 call w3kind(kindreal,kindint)
3180 allocate(tmp(imax*jmax))
3184 if(kindreal==4)
then
3185 CALL nemsio_readrecvw34(gfile,
'hgt',
'sfc',k4,tmp,iret=iret)
3187 CALL nemsio_readrecv(gfile,
'hgt',
'sfc',k4,tmp,iret=iret)
3191 iar12z(:,:)=reshape(tmp,(/imax,jmax/))
3196 if(kindreal==4)
then
3197 CALL nemsio_readrecvw34(gfile,
'pres',
'sfc',k4,tmp,iret=iret)
3199 CALL nemsio_readrecv(gfile,
'pres',
'sfc',k4,tmp,iret=iret)
3203 iar13p(:,:)=reshape(tmp*0.01,(/imax,jmax/))
3238 if(kindreal==4)
then
3239 CALL nemsio_readrecvw34(gfile,
'tmp',
'mid layer',k4,tmp,
3242 CALL nemsio_readrecv(gfile,
'tmp',
'mid layer',k4,tmp,
3247 iar14t(:,:,k4)=reshape(tmp,(/imax,jmax/))
3248 call
gblevn11d(imax,jmax,iar14t(1,1,k4))
3253 if(kindreal==4)
then
3254 CALL nemsio_readrecvw34(gfile,
'ugrd',
'mid layer',k4,tmp,
3257 CALL nemsio_readrecv(gfile,
'ugrd',
'mid layer',k4,tmp,
3262 iar15u(:,:,k4)=reshape(tmp,(/imax,jmax/))
3263 call
gblevn11d(imax,jmax,iar15u(1,1,k4))
3274 if(kindreal==4)
then
3275 CALL nemsio_readrecvw34(gfile,
'vgrd',
'mid layer',k4,tmp,
3278 CALL nemsio_readrecv(gfile,
'vgrd',
'mid layer',k4,tmp,
3282 iar16v(:,:,k4)=reshape(tmp,(/imax,jmax/))
3283 call
gblevn11d(imax,jmax,iar16v(1,1,k4))
3289 if(kindreal==4)
then
3290 CALL nemsio_readrecvw34(gfile,
'spfh',
'mid layer',k4,tmp,
3293 CALL nemsio_readrecv(gfile,
'spfh',
'mid layer',k4,tmp,
3297 iar17q(:,:,k4)=max(0.0,reshape(tmp*1.0e6,(/imax,jmax/)) )
3298 call
gblevn11d(imax,jmax,iar17q(1,1,k4))
3305 CALL nemsio_close(gfile,iret=iret)
3315 tfac=oner+fv*max(iar17q(i,j,k)*1.0e-6,qmin)
3316 iar14t(i,j,k)=iar14t(i,j,k)*tfac
3324 ALLOCATE (psfc(imax,jmax), tv(imax,jmax,kmax))
3325 ALLOCATE (wrk1(imax*jmax,kmax), wrk2(imax*jmax,kmax+1))
3329 psfc(:,:) = iar13p(:,:)*100.
3330 tv(:,:,:) = iar14t(:,:,:)
3332 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
3333 tv(:,:,:) = tv(:,:,:) / cpi(1)
3334 print *,
' cpi(1)=',cpi(1)
3337 CALL sigio_modpr(imjm4,imjm4,km4,nvcoord,idvc,idsl,vcoord,iret,
3338 $ psfc,tv,pm=wrk1,pd=wrk2(1,2))
3342 wrk2(i+jj,1) = psfc(i,j)
3346 wrk2(:,l+1) = wrk2(:,l) - wrk2(:,l+1)
3353 iarpsl(i,j,l) = wrk1(i+jj,l)*0.01
3361 iarpsi(i,j,l) = wrk2(i+jj,l)*0.01
3370 CALL nemsio_finalize()
3377 print 9901, (jdate(ii),ii=1,3),jdate(5),idatep
3378 9901
FORMAT(/
' ##GBLEVENTS/GBLEVN12 - NEMSIO INPUT GLOBAL FILE DATE',
3379 $
' (',i4.4,3(i2.2),
'), DOES NOT MATCH PREPBUFR FILE CENTER ',
3380 $
'DATE (',i10,
') -STOP 68'/)
3422 INTEGER iunitf(2), idatep, idrt,imx,jmx
3423 INTEGER yyyy,mm,dd,hh
3425 integer*4 error, id_var, dimid, len
3426 integer*4 im,jm,km, lm,n, k,nargs
3427 REAL(KIND=8),
PARAMETER:: con_rv=4.6150e+2,con_rd=2.8705e+2,
3428 $ fv=con_rv/con_rd-1.,oner=1.0,qmin=1.0e-10
3429 INTEGER*4,
PARAMETER :: ten=10
3431 INTEGER*4 iret,imjm4,km4,idvm,ntrac
3433 INTEGER idatgs_cor,jcap,jcap1,jcap2,jcap1x2,mdima,mdimb,mdimc,
3434 $ iromb,maxwv,idir,i,j,l,ii,jj
3436 INTEGER(4) idate7(7),jcap4,idvc4,dimz4,k4,im4,jm4,kindreal,kindint
3437 INTEGER(4) nfhour,nfminute,nfsecondn,nfsecondd,idsl4,idvm4,kr
3439 REAL(4),
ALLOCATABLE :: vcoord4(:,:,:),cpi(:),ak(:),bk(:)
3440 REAL,
ALLOCATABLE :: temp(:,:), temp3d(:,:,:)
3442 character (len = 80) :: attone
3444 character(len=10) :: dim_nam, grid
3447 INTEGER(4) idate(8),jdate(8)
3448 REAL(4) fhour,rinc(5)
3450 REAL (KIND=4),
ALLOCATABLE :: psfc(:,:), tv(:,:,:),
3451 $ wrk1(:,:), wrk2(:,:)
3461 print 331, mod(idatep,100)
3462 331
format(/
' --> GBLEVENTS: ONLY ONE NETCDF INPUT GLOBAL FILE IS ',
3463 $
'READ SINCE FILES ARE AVAILABLE EACH HOUR (NO NEED TO ',
3464 $
'INTERPOLATE'/16x,
'SPANNING FILES WHEN THE PREPBUFR CENTER HOUR',
3465 $
' (',i2.2,
') IS NOT A MULTIPLE OF 3)'/)
3470 WRITE(gfname,
'("fort.",I2.2)') iunitf(1)
3472 error=nf90_open(trim(gfname),nf90_nowrite,ncid)
3473 error=nf90_inq_dimid(ncid,
"grid_xt",dimid)
3474 error=nf90_inquire_dimension(ncid,dimid,dim_nam,im)
3475 error=nf90_inq_dimid(ncid,
"grid_yt",dimid)
3476 error=nf90_inquire_dimension(ncid,dimid,dim_nam,jm)
3477 error=nf90_inq_dimid(ncid,
"pfull",dimid)
3478 error=nf90_inquire_dimension(ncid,dimid,dim_nam,km)
3479 error=nf90_inq_dimid(ncid,
"phalf",dimid)
3480 error=nf90_inquire_dimension(ncid,dimid,dim_nam,lm)
3481 print*,
"im,jm,kmi,lm:",im,jm,km,lm
3482 print*,
"IMX, JMX:", imx, jmx
3483 IF (imx .NE. im .OR. jmx .NE. jm) print*,
"Different Resolutions"
3498 error=nf90_inq_varid(ncid,
"time", id_var)
3499 error=nf90_inquire_attribute(ncid, id_var,
"units", len=len)
3501 error=nf90_get_att(ncid, id_var,
"units", attone)
3502 read(attone(len-18:len-15),
'(i4)') yyyy
3503 read(attone(len-13:len-12),
'(i2)') mm
3504 read(attone(len-10:len-9),
'(i2)') dd
3505 read(attone(len-7:len-6),
'(i2)') hh
3506 IF(attone(1:5) .NE.
"hours")
THEN
3507 print*,
"checkout the time unit, not hourly",attone
3509 print*,
"base time", yyyy,mm,dd,hh
3512 error=nf90_get_var(ncid, id_var, time)
3524 CALL w3movdat(rinc,idate,jdate)
3526 print 1, fhour,(idate(ii),ii=1,3),idate(5),(jdate(ii),ii=1,3),
3528 1
FORMAT(
' --> GBLEVENTS: GLOBAL NEMSIO FILE: HERE IS A ',f5.1,
3529 $
' HOUR FORECAST FROM ',i5.4,3i3.2,
' VALID AT ',i5.4,3i3.2)
3531 idatgs_cor = (jdate(1) * 1000000) + (jdate(2) * 10000) +
3532 $ (jdate(3) * 100) + jdate(5)
3537 IF(idatep.NE.idatgs_cor) go to 901
3541 ALLOCATE (iar12z(im,jm), iar13p(im,jm))
3542 ALLOCATE (iar14t(im,jm,km), iar15u(im,jm,km),
3543 $ iar16v(im,jm,km), iar17q(im,jm,km),
3544 $ iarpsl(im,jm,km), iarpsi(im,jm,km+1),
3547 error=nf90_get_att(ncid, nf90_global,
"grid", grid)
3548 IF (grid ==
"gaussian")
THEN
3558 sfcpress_id = mod(idvm,ten)
3559 thermodyn_id = mod(idvm/ten,ten)
3561 IF(idvc == 3 .AND. thermodyn_id == 3)
THEN
3562 kmaxs = (ntrac+1)*kmax + 2
3571 dlat = 180./(jmax-1)
3574 print 2, jcap,imax,jmax,kmax,kmaxs,dlat,dlon,idvc
3576 2
FORMAT(/
' --> GBLEVENTS: GLOBAL MODEL SPECS: T',i5,
' ',
3577 $ i5,
' x ',i5,
' GRID WITH ',i3,
' LEVELS ',i3,
3578 $
' SCALARS -------> ',f5.2,
' X ',f5.2,
' VERT. ',
3579 $
'COORD ID IS: ',i0)
3581 print *,
'in netcdf sfcpress_id=',sfcpress_id,
' thermodyn_id=',
3582 $ thermodyn_id,
' ntrac=',ntrac
3583 print *,
' idvc=',idvc,
' idsl=',idsl,
' idvm=',idvm,
' nvcoord=',
3586 ALLOCATE(vcoord(km+1,3))
3591 error=nf90_get_att(ncid, nf90_global,
"ak", ak)
3592 error=nf90_get_att(ncid, nf90_global,
"bk", bk)
3596 vcoord(k,1) = ak(kr)
3597 vcoord(k,2) = bk(kr)
3602 allocate(temp(im,jm))
3603 error=nf90_inq_varid(ncid,
'hgtsfc', id_var)
3604 error=nf90_get_var(ncid, id_var, temp)
3606 iar12z(:,:)=temp(:,:)
3610 error=nf90_inq_varid(ncid,
'pressfc', id_var)
3611 error=nf90_get_var(ncid, id_var, temp)
3613 iar13p(:,:)=temp(:,:)*0.01
3623 allocate(temp3d(im,jm,km))
3624 error=nf90_inq_varid(ncid,
'tmp', id_var)
3625 error=nf90_get_var(ncid, id_var, temp3d)
3628 iar14t(:,:,k4)=temp3d(:,:,kr)
3629 call
gblevn11d(imax,jmax,iar14t(1,1,k4))
3634 error=nf90_inq_varid(ncid,
'ugrd', id_var)
3635 error=nf90_get_var(ncid, id_var, temp3d)
3638 iar15u(:,:,k4)=temp3d(:,:,kr)
3639 call
gblevn11d(imax,jmax,iar15u(1,1,k4))
3644 error=nf90_inq_varid(ncid,
'vgrd', id_var)
3645 error=nf90_get_var(ncid, id_var, temp3d)
3648 iar16v(:,:,k4)=temp3d(:,:,kr)
3649 call
gblevn11d(imax,jmax,iar16v(1,1,k4))
3654 error=nf90_inq_varid(ncid,
'spfh', id_var)
3655 error=nf90_get_var(ncid, id_var, temp3d)
3658 iar17q(:,:,k4)=max(0.0,temp3d(:,:,kr)*1.e6)
3659 call
gblevn11d(imax,jmax,iar17q(1,1,k4))
3672 tfac=oner+fv*max(iar17q(i,j,k)*1.0e-6,qmin)
3673 iar14t(i,j,k)=iar14t(i,j,k)*tfac
3683 ALLOCATE (psfc(im,jm), tv(im,jm,km))
3684 ALLOCATE (wrk1(im*jm,km), wrk2(im*jm,km+1))
3688 psfc(:,:) = iar13p(:,:)*100.
3689 tv(:,:,:) = iar14t(:,:,:)
3691 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
3692 tv(:,:,:) = tv(:,:,:) / cpi(1)
3693 print *,
' cpi(1)=',cpi(1)
3696 CALL sigio_modpr(imjm4,imjm4,km4,nvcoord,idvc,idsl,vcoord,iret,
3697 $ psfc,tv,pm=wrk1,pd=wrk2(1,2))
3701 wrk2(i+jj,1) = psfc(i,j)
3705 wrk2(:,l+1) = wrk2(:,l) - wrk2(:,l+1)
3712 iarpsl(i,j,l) = wrk1(i+jj,l)*0.01
3720 iarpsi(i,j,l) = wrk2(i+jj,l)*0.01
3726 error=nf90_close(ncid)
3736 print 9901, idatep,idatgs_cor
3737 9901
FORMAT(/
' ##GBLEVENTS/GBLEVN13 - NETCDF INPUT GLOBAL FILE DATE',
3738 $
' (',i4.4,3(i2.2),
'), DOES NOT MATCH PREPBUFR FILE CENTER ',
3739 $
'DATE (',i10,
') -STOP 68'/)
3757 real,
allocatable :: slats(:)
3758 real(4) slat(jmax),wlat(jmax),rad2deg
3762 call splat(idrt,jmax,slat,wlat)
3763 rad2deg=180./acos(-1.)
3764 allocate(slats(jmax));
3765 rad2deg=180./acos(-1.)
3766 slats(:)=-asin(slat(:))*rad2deg
3767 dlat=180./float(jmax-1)
subroutine gblevn10(IUNITF, IDATEP, IM, JM, IDRT)
Do something.
subroutine gblevents(IDATEP, IUNITF, IUNITE, IUNITP, IUNITS, SUBSET, NEWTYP)
SUBPROGRAM: GBLEVENTS PRE/POST PROCESSING OF PREPBUFR EVENTS PRGMMR: DENNIS KEYSER ORG: EMC DATE: 201...
subroutine getlats(idrt)
get latitudes
subroutine gblevn03(SUBSET)
GBLEVN03 - INTERPOLATE MODEL DATA (FIRST GUESS OR ANALYSIS) TO OB LOCATIONS.
subroutine gblevn11d(imax, jmax, grid)
Does something.
subroutine gblevn13(IUNITF, IDATEP, IMX, JMX, IDRT)
NetCDF Input.
subroutine gblevn01(IUNITE)
Read observation error table.
subroutine gblevn06(XOB, YOB)
SUBROUTINE GBLEVN06 - 2D LINEAR HORIZONTAL INTERPOLATION.
subroutine gblevn12(IUNITF, IDATEP, IM, JM, IDRT)
Does something.
subroutine gblevn08(IUNITP, SUBSET)
SUBPROGRAM: GBLEVN08 PRGMMR: S.
subroutine gblevn04
Get observation error.
function oefg01(P, TYP, IE, OEMIN)
SUBPROGRAM: OEFG01 PRGMMR: D.
subroutine gblevn11(imax, jmax, grid)
North-south swap.
subroutine gblevn02(IUNITP, IUNITS, NEWTYP, subset)
Filter data.