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))
2064 COMMON /gbevdd/errs(300,33,6)
2065 COMMON /gbevff/ bmiss
2074 p = max(0.,min(p,2000.))
2076 IF(p.GE.errs(kx,1,1)) k1 = 1
2079 IF(p.GE.errs(kx,kl+1,1).AND.p.LE.errs(kx,kl,1)) k1 = kl
2082 IF(p.LE.errs(kx,33,1)) k1 = 5
2086 ediff = errs(kx,k2,1) - errs(kx,k1,1)
2087 IF(abs(ediff).GT.0.0)
THEN
2088 del = (p - errs(kx,k1,1))/ediff
2093 del = max(0.,min(del,1.0))
2095 oefg01 = ((1.0 - del) * errs(kx,k1,ie)) + (del * errs(kx,k2,ie))
2207 SUBROUTINE gblevn08(IUNITP,SUBSET) ! FORMERLY SUBROUTINE VTPEVN
2209 parameter(rd=287.04, g=9.81)
2210 CHARACTER*80 evnstq,evnstv,evnstp
2211 CHARACTER*8 subset,stnid
2212 REAL(8) tdp_8(255),tqm_8(255),qqm_8(255),bakq_8(4,255),
2213 $ bakv_8(4,255),bakp_8(3),obs_8,qms_8,bak_8,
2215 real(8) pmo_8,zob_8,pmsl_8
2218 LOGICAL evnq,evnv,dovtmp,trop,adpupa_virt,doberr,dofcst,
2219 $ some_fcst,fcst,virt,satmqc,recalc_q,doprev,
2222 COMMON /gbevaa/ sid_8,obs_8(13,255),qms_8(12,255),bak_8(12,255),
2223 $ xob,yob,dhr,typ,nlev
2224 COMMON /gbevbb/ pvcd,vtcd
2225 COMMON /gbevcc/ dovtmp,dofcst,some_fcst,doberr,fcst,virt,
2226 $ qtop_rej,satmqc,adpupa_virt,recalc_q,doprev,dopmsl
2227 COMMON /gbevff/ bmiss
2229 DATA evnstq /
'QOB QQM QPC QRC'/
2230 DATA evnstv /
'TOB TQM TPC TRC'/
2231 data evnstp /
'PMO PMQ PMIN'/
2233 equivalence(sid_8,stnid)
2238 es(t) = 6.1078*exp((17.269*(t - 273.16))/((t - 273.16)+237.3))
2239 qs(t,p) = (0.622*es(t))/(p-(0.378*es(t)))
2245 pmsl_fcn(p,tv,z) = p*exp((g*z)/(rd*tv))
2259 surf = (subset.eq.
'ADPSFC'.or.subset.eq.
'SFCSHP'.or.
2260 $ subset.eq.
'MSONET')
2267 CALL ufbint(-iunitp,tdp_8,1,255,nltd,
'TDO')
2268 CALL ufbint(-iunitp,qqm_8,1,255,nlqq,
'QQM')
2269 CALL ufbint(-iunitp,tqm_8,1,255,nltq,
'TQM')
2270 if(surf.and.dopmsl)
then
2271 call ufbint(-iunitp,pmo_8,1,1,nlpm,
'PMO')
2272 call ufbint(-iunitp,zob_8,1,1,nlzo,
'ZOB')
2273 call ufbint(-iunitp,pqm_8,1,1,nlpq,
'PQM')
2275 IF(subset.NE.
'RASSDA '.AND.subset.NE.
'SATEMP ')
THEN
2276 IF(nltd.EQ.0)
RETURN
2277 IF(nlqq.EQ.0)
RETURN
2279 IF(nltq.EQ.0)
RETURN
2280 IF(subset.NE.
'RASSDA '.AND.subset.NE.
'SATEMP ')
THEN
2281 IF(nltd.NE.nlev)
THEN
2282 print.NE.
'(" ##GBLEVENTS/GBLEVN08 - NLTD NLEV - STOP 61")'
2285 IF(nlqq.NE.nlev)
THEN
2286 print.NE.
'(" ##GBLEVENTS/GBLEVN08 - NLQQ NLEV - STOP 63")'
2290 IF(nltq.NE.nlev)
THEN
2291 print.NE.
'(" ##GBLEVENTS/GBLEVN08 - NLTQ NLEV - STOP 62")'
2307 IF(subset.EQ.
'RASSDA '.OR.subset.EQ.
'SATEMP ')
THEN
2308 IF(tob.LT.bmiss)
THEN
2310 bakv_8(2,l) = tqm_8(l)
2318 IF(pob.LT.bmiss .AND. tob.LT.bmiss
2319 $ .AND. tdo.LT.bmiss)
THEN
2320 IF(qqm_8(l).GT.3)
THEN
2326 IF(tdo.LT.-103.15 .OR. tdo.GT.46.83 .OR. pob.LT.0.1 .OR.
2327 $ pob.GT.1100.) cycle
2329 qob = qs(tdo+273.16,pob)
2337 IF(qob*1e6.LT.bmiss .AND. qob.GT.0.) bakq_8(1,l) = qob*1e6
2338 bakq_8(2,l) = qqm_8(l)
2348 trop = (subset.EQ.
'ADPUPA ' .AND.
2349 $ ((cat.EQ.5 .AND. pob.LT.500.) .OR. pob.LT. 80. .OR. trop))
2350 IF(dovtmp .AND. .NOT.trop)
THEN
2351 bakv_8(1,l) = (tob+273.16)*(1.+.61*qob)-273.16
2353 IF(subset.EQ.
'ADPUPA ')
THEN
2355 IF((qqm_8(l).LT.4.OR.qqm_8(l).EQ.9.OR.qqm_8(l).EQ.15)
2356 $ .OR. tqm_8(l).EQ.0 .OR. tqm_8(l).GT.3
2357 $ .OR. pob.LE.700.)
THEN
2358 bakv_8(2,l) = tqm_8(l)
2369 IF(qqm_8(l).LT.4)
THEN
2370 bakv_8(2,l) = tqm_8(l)
2373 ELSE IF((qqm_8(l).EQ.9.OR.qqm_8(l).EQ.15).AND.
2374 $ (tqm_8(l).LE.3.OR.tqm_8(l).GE.15.OR.
2375 $ tqm_8(l).EQ.9))
THEN
2403 if(ibfms(pmo_8).ne.0)
then
2404 tv = bakv_8(1,1) + 273.16
2406 pmsl_8=pmsl_fcn(pob,tv,zob)
2408 bakp_8(2) = max(3,int(pqm_8))
2411 4000
format(
'--> ID ',a8,
' Pmsl missing - derived from Pstn; ',
2412 $
'PMIN = ',f4.1,
' PMQ = ',f4.1,
'')
2415 if(pmsl_8.gt.1060)
then
2416 write(*,4001) stnid,pob,bakp_8(1)
2417 4001
format(
'--> ID ',a8,
' Derived PMSL unrealistic; FLAG; ',
2418 $
'POB = ',f7.2,
' PMO = ',f7.2,
'')
2434 IF(evnq) CALL ufbint(iunitp,bakq_8,4,nlev,iret,evnstq)
2435 IF(evnv) CALL ufbint(iunitp,bakv_8,4,nlev,iret,evnstv)
2436 if(nlev.eq.1.and.evnp)
2437 $ call ufbint(iunitp,bakp_8,3,nlev,iret,evnstp)
2479 SUBROUTINE gblevn10(IUNITF,IDATEP,IM,JM,IDRT) ! FORMERLY
2486 INTEGER iunitf(2), idatep, im, jm, idrt
2487 REAL,
PARAMETER :: pi180=.0174532
2488 INTEGER*4,
PARAMETER :: one=1, ten=10
2490 TYPE(sigio_head
) :: head(2)
2491 TYPE(sigio_dats
) :: dats
2492 TYPE(sigio_datm
) :: datm
2494 INTEGER*4 iret,iret1,irets,imjm4,km4,idvm,ntrac,iunit4(2)
2496 INTEGER kfiles,ifile,jfile,idatgs_cor,jcap,jcap1,jcap2,jcap1x2,
2497 $ mdima,mdimb,mdimc,iromb,maxwv,idir,ns,i,j,k,l,ii,jj,ib,ie
2499 INTEGER idate(8,2),jdate(8,2),kdate(8,2),kindx(2)
2501 CHARACTER*6 coord(3)
2506 DATA coord /
'SIGMA ',
'HYBRID',
'GENHYB'/
2508 REAL,
ALLOCATABLE :: cofs(:,:), cofv(:,:,:)
2509 REAL,
ALLOCATABLE :: cofs_f(:,:,:), cofv_f(:,:,:,:)
2510 REAL (KIND=4),
ALLOCATABLE :: grds(:,:,:), grdv(:,:,:,:),
2511 $ wrk1(:,:), wrk2(:,:)
2516 iunit4(:) = iunitf(:)
2518 IF(mod(mod(idatep,100),3).EQ.0)
THEN
2521 print 331, mod(idatep,100)
2522 331
FORMAT(/
' --> GBLEVENTS: THE PREPBUFR CENTER HOUR (',i2.2,
2523 $
') IS A MULTIPLE OF 3 - ONLY ONE SIGIO (SIGMA OR HYBRID) ',
2524 $
'INPUT GLOBAL FILE IS READ,'/16x,
'NO TIME INTERPOLATION OF ',
2525 $
'SPECTRAL COEFFICIENTS IS PERFORMED'/)
2528 kindx(1) = mod(mod(idatep,100),3)
2529 kindx(2) = kindx(1) - 3
2530 print 332, mod(idatep,100)
2531 332
FORMAT(/
' --> GBLEVENTS: THE PREPBUFR CENTER HOUR (',i2.2,
2532 $
') IS NOT A MULTIPLE OF 3 - TWO SPANNING SIGIO (SIGMA OR ',
2533 $
'HYBRID) INPUT GLOBAL FILES'/16x,
'ARE READ AND THE SPECTRAL ',
2534 $
'COEFFICIENTS ARE INTERPOLATED TO THE PREPBUFR CENTER TIME'/)
2545 WRITE(cfile,
'("fort.",I2.2)') iunitf(ifile)
2547 CALL sigio_rropen(iunit4(ifile),cfile,iret)
2548 CALL sigio_rrhead(iunit4(ifile),head(ifile),iret1)
2549 print *,
' cfile_sig=',cfile,
'sigio_rropen: iret=',iret,
2550 $
'sigio_rrhead: iret1=',iret1
2552 IF(iret.NE.0) go to 903
2553 IF(iret1.NE.0) go to 904
2557 idate(1,ifile) = head(ifile)%IDATE(4)
2558 idate(2:3,ifile) = head(ifile)%IDATE(2:3)
2559 idate(5,ifile) = head(ifile)%IDATE(1)
2561 fhour = head(ifile)%FHOUR
2562 print
'(" idate=",I5,7I3.2," fhour=",F7.3)', idate(:,ifile),
2565 IF(idate(1,ifile).LT.100)
THEN
2573 print
'(" ##GBLEVENTS/GBLEVN10 - 2-DIGIT YEAR FOUND IN ",
2574 $ "SIGIO (SIGMA OR HYBRID) INPUT GLOBAL FILE ",I0,
2575 $ "; INITIAL DATE (YEAR IS: ",I0,")")', ifile,idate(1,ifile)
2576 print
'(" - USE WINDOWING TECHNIQUE TO OBTAIN 4-DIGIT",
2578 IF(idate(1,ifile).GT.20)
THEN
2579 idate(1,ifile) = 1900 + idate(1,ifile)
2581 idate(1,ifile) = 2000 + idate(1,ifile)
2583 print
'(" ##GBLEVENTS/GBLEVN10 - CORRECTED 4-DIGIT YEAR IS",
2584 $ " NOW: ",I0)', idate(1,ifile)
2588 CALL w3movdat(rinc,idate(:,ifile),jdate(:,ifile))
2590 print 1, ifile,head(ifile)%FHOUR,
2591 $ (idate(ii,ifile),ii=1,3),idate(5,ifile),(jdate(ii,ifile),
2592 $ ii=1,3),jdate(5,ifile)
2593 1
FORMAT(
' --> GBLEVENTS: SIGIO (SIGMA OR HYBRID) INPUT GLOBAL ',
2594 $
'FILE',i2,
' HERE IS A ',f5.1,
' HOUR FORECAST FROM ',i5.4,
2595 $ 3i3.2,
' VALID AT ',i5.4,3i3.2)
2597 kdate(:,ifile) = jdate(:,ifile)
2599 IF(kfiles.EQ.2)
THEN
2600 rinc(2) =
REAL(kindx(ifile))
2601 CALL w3movdat(rinc,jdate(:,ifile),kdate(:,ifile))
2604 idatgs_cor = (kdate(1,ifile) * 1000000) + (kdate(2,ifile) *
2605 $ 10000) + (kdate(3,ifile) * 100) + kdate(5,ifile)
2610 IF(idatep.NE.idatgs_cor) go to 901
2624 ntrac = head(1)%NTRAC
2625 nvcoord = head(1)%NVCOORD
2626 ALLOCATE (vcoord(kmax+1,nvcoord))
2628 vcoord = head(1)%VCOORD
2630 sfcpress_id = mod(head(1)%IDVM,ten)
2631 thermodyn_id = mod(head(1)%IDVM/ten,ten)
2632 IF(idvc == 3 .AND. thermodyn_id == 3)
THEN
2633 kmaxs = (ntrac+1)*kmax + 2
2639 ALLOCATE (iar12z(im,jm), iar13p(im,jm))
2640 ALLOCATE (iar14t(im,jm,kmax), iar15u(im,jm,kmax),
2641 $ iar16v(im,jm,kmax), iar17q(im,jm,kmax),
2642 $ iarpsl(im,jm,kmax), iarpsi(im,jm,kmax+1))
2645 if(idvc.eq.0) idvc = 1
2646 IF(idvc < 0 .or. idvc > 3)
THEN
2647 print *,
'##GBLEVENTS/GBLEVN10: INVALID VERT COORD ID (=',idvc
2658 mdimb = mdima/2+jcap1
2663 dlat = 180./(jmax-1)
2666 print 2, jcap,imax,jmax,kmax,kmaxs,dlat,dlon,coord(idvc)
2667 2
FORMAT(/
' --> GBLEVENTS: GLOBAL MODEL SPECS: T',i5,
' ',
2668 $ i5,
' x ',i5,
' GRID WITH ',i3,
' LEVELS ',i3,
2669 $
' SCALARS -------> ',f5.2,
' X ',f5.2,
' VERT. ',
2675 print 9901, jfile,(jdate(ii,jfile),ii=1,3),jdate(5,jfile),idatep
2676 9901
FORMAT(/
' ##GBLEVENTS/GBLEVN10 - SIGMA OR HYBRID FILE',i2,
' DATE',
2677 $
' (',i4.4,3(i2.2),
'), DOES NOT MATCH -OR SPAN- PREPBUFR FILE ',
2678 $
'CENTER DATE (',i10,
') -STOP 68'/)
2681 print 9903, jfile,iret
2682 9903
FORMAT(/
' ##GBLEVENTS/GBLEVN10 - SIGMA OR HYBRID FILE',i2,
2683 $
' RETURNED FROM SIGIO_RROPEN WITH R.C.',i3,
' -STOP 70'/)
2686 print 9904, jfile,iret1
2687 9904
FORMAT(/
' ##GBLEVENTS/GBLEVN10 - SIGMA OR HYBRID FILE',i2,
2688 $
' RETURNED FROM SIGIO_RRHEAD WITH R.C.',i3,
' -STOP 71'/)
2691 IF(kmax.GT.500)
then
2692 print
'(" ##GBLEVENTS/GBLEVN10 - KMAX TOO BIG = ",I0,
2693 $ " - UNABLE TO TRANSFORM GLOBAL SIGMA FILE(S) - STOP 69")',
2745 allocate (cofs_f(mdima,kmaxs,2), cofv_f(mdima,kmax,2,2))
2749 if (idrt < 0 .or. idrt > 256) idrt = 0
2752 IF(kindx(1).EQ.0)
THEN
2761 sfcpress_id = mod(head(1)%IDVM,ten)
2762 thermodyn_id = mod(head(1)%IDVM/ten,ten)
2764 print *,
'in sig sfcpress_id=',sfcpress_id,
' thermodyn_id=',
2765 $ thermodyn_id,
' ntrac=',ntrac
2766 print *,
' idvc=',idvc,
' idsl=',idsl,
' idvm=',idvm,
2767 $
' nvcoord=',nvcoord
2770 CALL sigio_aldats(head(ifile),dats,irets)
2771 CALL sigio_aldatm(head(ifile),one,km4,datm,irets)
2773 CALL sigio_rrdats(iunit4(ifile),head(ifile),dats,irets)
2776 print *,
' irets from sigio_rrdats = ', irets
2781 cofs_f(i,1,ifile) = dats%HS(i)
2782 cofs_f(i,2,ifile) = dats%PS(i)
2786 CALL sigio_rrdatm(iunit4(ifile),head(ifile),datm,irets)
2788 print *,
' irets from sigio_rrdatm = ', irets
2794 cofs_f(:,3:ie,ifile) = datm%T
2798 cofs_f(:,ib:ie,ifile) = datm%Q(:,1:kmax,i)
2800 cofv_f(:,:,1,ifile) = datm%D
2801 cofv_f(:,:,2,ifile) = datm%Z
2803 CALL sigio_axdats(dats,irets)
2804 CALL sigio_axdatm(datm,irets)
2809 ALLOCATE (cofs(mdima,kmaxs), cofv(mdima,kmax,2))
2810 ALLOCATE (grds(imax,jmax,kmaxs), grdv(imax,jmax,kmax,2))
2811 ALLOCATE (wrk1(imax*jmax,kmax), wrk2(imax*jmax,kmax+1))
2813 IF(kfiles.EQ.1)
THEN
2815 cofs(i,1:kmaxs) = cofs_f(i,1:kmaxs,1)
2816 cofv(i,1:kmax,1:2) = cofv_f(i,1:kmax,1:2,1)
2821 $ ((abs(kindx(2))*cofs_f(:,:,1)) +(kindx(1)*cofs_f(:,:,2)))/3.
2823 $ ((abs(kindx(2))*cofv_f(:,:,:,1))+(kindx(1)*cofv_f(:,:,:,2)))/3.
2826 DEALLOCATE (cofs_f, cofv_f)
2828 CALL sptezm(iromb,maxwv,idrt,imax,jmax,kmaxs,cofs,grds,idir)
2829 CALL sptezmv(iromb,maxwv,idrt,imax,jmax,kmax,
2830 & cofv(1,1,1),cofv(1,1,2),grdv(1,1,1,1),grdv(1,1,1,2),idir)
2832 IF( sfcpress_id == 2 )
THEN
2833 grds(:,:,2) = 1000.0*grds(:,:,2)
2835 grds(:,:,2) = 1000.0*exp(grds(:,:,2))
2839 CALL
gblevn11(imax,jmax,grds(1,1,ns))
2843 iar12z(i,j) = grds(i,j,1)
2844 iar13p(i,j) = grds(i,j,2) * 0.01
2848 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
2849 grds(:,:,3:2+kmax) = grds(:,:,3:2+kmax) / head(1)%CPI(1)
2850 print *,
' cpi(0)=',head(1)%cpi(1)
2852 CALL sigio_modpr(imjm4,imjm4,km4,nvcoord,idvc,idsl,vcoord,iret,
2853 $ grds(1,1,2),grds(1,1,3),pm=wrk1,pd=wrk2(1,2))
2858 wrk2(i+jj,1) = grds(i,j,2)
2862 wrk2(:,l+1) = wrk2(:,l) - wrk2(:,l+1)
2874 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
2876 grds(:,:,3:2+kmax) = grds(:,:,3:2+kmax) * head(1)%CPI(1)
2877 CALL sigio_cnvtdv(imjm4,imjm4,km4,idvc,idvm,ntrac,iret,
2878 $ grds(1,1,3),grds(1,1,3+kmax),head(1)%CPI,1_4)
2880 grds(:,:,3:kmax+2) = grds(:,:,3:kmax+2) *
2881 $ (1.+(461.50/287.05-1)*grds(:,:,3+kmax:2+kmax*2))
2886 CALL
gblevn11(imax,jmax,grdv(1,1,l,k))
2891 iar14t(i,j,l) = grds(i,j,2+l)
2892 iar15u(i,j,l) = grdv(i,j,l,1)
2893 iar16v(i,j,l) = grdv(i,j,l,2)
2895 iar17q(i,j,l) = max(0.0,grds(i,j,2+kmax+l)*1.0e6)
2896 iarpsl(i,j,l) = wrk1(i+jj,l)*0.01
2904 iarpsi(i,j,l) = wrk2(i+jj,l)*0.01
2917 DEALLOCATE (cofs, cofv)
2918 DEALLOCATE (grds, grdv, wrk1, wrk2)
2920 print *,
' RETURNING from GBLENV10'
2928 subroutine gblevn11(imax,jmax,grid) ! formerly subroutine n_s_swap
2931 real grid(imax,jmax)
2939 grid(i,j) = grid(i,jj)
2940 grid(i,jj) = temp(i)
2951 real(kind=8) grid(imax,jmax)
2952 real(kind=8) temp (imax)
2959 grid(i,j) = grid(i,jj)
2960 grid(i,jj) = temp(i)
3005 USE nemsio_openclose
3011 INTEGER iunitf(2), idatep, im, jm, idrt
3012 REAL(KIND=8),
PARAMETER:: con_rv=4.6150e+2,con_rd=2.8705e+2,
3013 $ fv=con_rv/con_rd-1.,oner=1.0,qmin=1.0e-10
3014 INTEGER*4,
PARAMETER :: ten=10
3017 INTEGER*4 iret,imjm4,km4,idvm,ntrac
3019 INTEGER idatgs_cor,jcap,jcap1,jcap2,jcap1x2,mdima,mdimb,mdimc,
3020 $ iromb,maxwv,idir,i,j,k,l,ii,jj
3022 INTEGER(4) idate7(7),jcap4,idvc4,dimz4,k4,im4,jm4,kindreal,kindint
3023 INTEGER(4) nfhour,nfminute,nfsecondn,nfsecondd,idsl4,idvm4
3025 REAL(4),
ALLOCATABLE :: vcoord4(:,:,:),cpi(:)
3026 REAL,
ALLOCATABLE :: tmp(:)
3027 TYPE(nemsio_gfile
) :: gfile
3029 INTEGER idate(8),jdate(8)
3032 REAL (KIND=4),
ALLOCATABLE :: psfc(:,:), tv(:,:,:),
3033 $ wrk1(:,:), wrk2(:,:)
3044 print 331, mod(idatep,100)
3045 331
format(/
' --> GBLEVENTS: ONLY ONE NEMSIO INPUT GLOBAL FILE IS ',
3046 $
'READ SINCE FILES ARE AVAILABLE EACH HOUR (NO NEED TO ',
3047 $
'INTERPOLATE'/16x,
'SPANNING FILES WHEN THE PREPBUFR CENTER HOUR',
3048 $
' (',i2.2,
') IS NOT A MULTIPLE OF 3)'/)
3056 WRITE(cfile2,
'("fort.",I2.2)') iunitf(1)
3058 CALL nemsio_open(gfile,trim(cfile2),
'read',iret=iret)
3059 print *,
' cfile_nems2=',cfile2,
'nemsio open,iret=',iret
3062 CALL nemsio_getfilehead(gfile,idate=idate7,
3063 & jcap=jcap4,dimx=im4,dimy=jm4,
3064 & dimz=dimz4,idvc=idvc4,ntrac=ntrac,idrt=idrtnems,
3065 & nfhour=nfhour,nfminute=nfminute,nfsecondn=nfsecondn,
3066 & nfsecondd=nfsecondd,idsl=idsl4,idvm=idvm4,iret=iret)
3074 if(idrt==-9999) idrt=4
3075 idate(1:3)=idate7(1:3)
3078 ALLOCATE(vcoord(kmax+1,3))
3081 IF(nfsecondd/=0.AND. nfsecondd/=-9999)
THEN
3082 fhour=
REAL(nfhour,8)+
REAL(nfminute/60.,8)+
3083 $
REAL(NFSECONDN*1./(NFSECONDD*360.),8)
3085 fhour=
REAL(nfhour,8)+
REAL(nfminute/60.,8)
3087 print
'(" idate=",I5,7I3.2," fhour=",F7.3)', idate,fhour
3089 ALLOCATE(vcoord4(kmax+1,3,2))
3090 CALL nemsio_getfilehead(gfile,vcoord=vcoord4,iret=iret)
3092 IF(maxval(vcoord4(:,3,1))==0..AND.minval(vcoord4(:,3,1))==0.)
THEN
3094 IF(maxval(vcoord4(:,2,1))==0..AND.minval(vcoord4(:,2,1))==0.)
3098 vcoord(1:kmax+1,1:nvcoord)=vcoord4(1:kmax+1,1:nvcoord,1)
3101 ALLOCATE(cpi(ntrac+1))
3102 CALL nemsio_getheadvar(gfile,
'CPI',cpi,iret=iret)
3105 CALL w3movdat(rinc,idate,jdate)
3107 print 1, fhour,(idate(ii),ii=1,3),idate(5),(jdate(ii),ii=1,3),
3109 1
FORMAT(
' --> GBLEVENTS: GLOBAL NEMSIO FILE: HERE IS A ',f5.1,
3110 $
' HOUR FORECAST FROM ',i5.4,3i3.2,
' VALID AT ',i5.4,3i3.2)
3112 idatgs_cor = (jdate(1) * 1000000) + (jdate(2) * 10000) +
3113 $ (jdate(3) * 100) + jdate(5)
3118 IF(idatep.NE.idatgs_cor) go to 901
3122 sfcpress_id = mod(idvm,ten)
3123 thermodyn_id = mod(idvm/ten,ten)
3125 IF(idvc == 3 .AND. thermodyn_id == 3)
THEN
3126 kmaxs = (ntrac+1)*kmax + 2
3132 ALLOCATE (iar12z(imax,jmax), iar13p(imax,jmax))
3133 ALLOCATE (iar14t(imax,jmax,kmax), iar15u(imax,jmax,kmax),
3134 $ iar16v(imax,jmax,kmax), iar17q(imax,jmax,kmax),
3135 $ iarpsl(imax,jmax,kmax), iarpsi(imax,jmax,kmax+1),
3136 $ iarpsd(imax,jmax,kmax))
3139 if(idvc.eq.0) idvc = 1
3140 IF(idvc < 0 .or. idvc > 3)
THEN
3141 print *,
'##GBLEVENTS/GBLEVN12: INVALID VERT COORD ID (=',idvc
3152 mdimb = mdima/2+jcap1
3155 dlat = 180./(jmax-1)
3158 print 2, jcap,imax,jmax,kmax,kmaxs,dlat,dlon,idvc
3161 2
FORMAT(/
' --> GBLEVENTS: GLOBAL MODEL SPECS: T',i5,
' ',
3162 $ i5,
' x ',i5,
' GRID WITH ',i3,
' LEVELS ',i3,
3163 $
' SCALARS -------> ',f5.2,
' X ',f5.2,
' VERT. ',
3164 $
'COORD ID IS: ',i0,
' (not sure what this means!')
3170 if (idrt < 0 .or. idrt > 256) idrt = 0
3173 print *,
'in nem sfcpress_id=',sfcpress_id,
' thermodyn_id=',
3174 $ thermodyn_id,
' ntrac=',ntrac
3175 print *,
' idvc=',idvc,
' idsl=',idsl,
' idvm=',idvm,
' nvcoord=',
3178 call w3kind(kindreal,kindint)
3181 allocate(tmp(imax*jmax))
3185 if(kindreal==4)
then
3186 CALL nemsio_readrecvw34(gfile,
'hgt',
'sfc',k4,tmp,iret=iret)
3188 CALL nemsio_readrecv(gfile,
'hgt',
'sfc',k4,tmp,iret=iret)
3192 iar12z(:,:)=reshape(tmp,(/imax,jmax/))
3197 if(kindreal==4)
then
3198 CALL nemsio_readrecvw34(gfile,
'pres',
'sfc',k4,tmp,iret=iret)
3200 CALL nemsio_readrecv(gfile,
'pres',
'sfc',k4,tmp,iret=iret)
3204 iar13p(:,:)=reshape(tmp*0.01,(/imax,jmax/))
3239 if(kindreal==4)
then
3240 CALL nemsio_readrecvw34(gfile,
'tmp',
'mid layer',k4,tmp,
3243 CALL nemsio_readrecv(gfile,
'tmp',
'mid layer',k4,tmp,
3248 iar14t(:,:,k4)=reshape(tmp,(/imax,jmax/))
3249 call
gblevn11d(imax,jmax,iar14t(1,1,k4))
3254 if(kindreal==4)
then
3255 CALL nemsio_readrecvw34(gfile,
'ugrd',
'mid layer',k4,tmp,
3258 CALL nemsio_readrecv(gfile,
'ugrd',
'mid layer',k4,tmp,
3263 iar15u(:,:,k4)=reshape(tmp,(/imax,jmax/))
3264 call
gblevn11d(imax,jmax,iar15u(1,1,k4))
3275 if(kindreal==4)
then
3276 CALL nemsio_readrecvw34(gfile,
'vgrd',
'mid layer',k4,tmp,
3279 CALL nemsio_readrecv(gfile,
'vgrd',
'mid layer',k4,tmp,
3283 iar16v(:,:,k4)=reshape(tmp,(/imax,jmax/))
3284 call
gblevn11d(imax,jmax,iar16v(1,1,k4))
3290 if(kindreal==4)
then
3291 CALL nemsio_readrecvw34(gfile,
'spfh',
'mid layer',k4,tmp,
3294 CALL nemsio_readrecv(gfile,
'spfh',
'mid layer',k4,tmp,
3298 iar17q(:,:,k4)=max(0.0,reshape(tmp*1.0e6,(/imax,jmax/)) )
3299 call
gblevn11d(imax,jmax,iar17q(1,1,k4))
3306 CALL nemsio_close(gfile,iret=iret)
3316 tfac=oner+fv*max(iar17q(i,j,k)*1.0e-6,qmin)
3317 iar14t(i,j,k)=iar14t(i,j,k)*tfac
3325 ALLOCATE (psfc(imax,jmax), tv(imax,jmax,kmax))
3326 ALLOCATE (wrk1(imax*jmax,kmax), wrk2(imax*jmax,kmax+1))
3330 psfc(:,:) = iar13p(:,:)*100.
3331 tv(:,:,:) = iar14t(:,:,:)
3333 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
3334 tv(:,:,:) = tv(:,:,:) / cpi(1)
3335 print *,
' cpi(1)=',cpi(1)
3338 CALL sigio_modpr(imjm4,imjm4,km4,nvcoord,idvc,idsl,vcoord,iret,
3339 $ psfc,tv,pm=wrk1,pd=wrk2(1,2))
3343 wrk2(i+jj,1) = psfc(i,j)
3347 wrk2(:,l+1) = wrk2(:,l) - wrk2(:,l+1)
3354 iarpsl(i,j,l) = wrk1(i+jj,l)*0.01
3362 iarpsi(i,j,l) = wrk2(i+jj,l)*0.01
3371 CALL nemsio_finalize()
3378 print 9901, (jdate(ii),ii=1,3),jdate(5),idatep
3379 9901
FORMAT(/
' ##GBLEVENTS/GBLEVN12 - NEMSIO INPUT GLOBAL FILE DATE',
3380 $
' (',i4.4,3(i2.2),
'), DOES NOT MATCH PREPBUFR FILE CENTER ',
3381 $
'DATE (',i10,
') -STOP 68'/)
3423 INTEGER iunitf(2), idatep, idrt,imx,jmx
3424 INTEGER yyyy,mm,dd,hh
3426 integer*4 error, id_var, dimid, len
3427 integer*4 im,jm,km, lm,n, k,nargs
3428 REAL(KIND=8),
PARAMETER:: con_rv=4.6150e+2,con_rd=2.8705e+2,
3429 $ fv=con_rv/con_rd-1.,oner=1.0,qmin=1.0e-10
3430 INTEGER*4,
PARAMETER :: ten=10
3432 INTEGER*4 iret,imjm4,km4,idvm,ntrac
3434 INTEGER idatgs_cor,jcap,jcap1,jcap2,jcap1x2,mdima,mdimb,mdimc,
3435 $ iromb,maxwv,idir,i,j,l,ii,jj
3437 INTEGER(4) idate7(7),jcap4,idvc4,dimz4,k4,im4,jm4,kindreal,kindint
3438 INTEGER(4) nfhour,nfminute,nfsecondn,nfsecondd,idsl4,idvm4,kr
3440 REAL(4),
ALLOCATABLE :: vcoord4(:,:,:),cpi(:),ak(:),bk(:)
3441 REAL,
ALLOCATABLE :: temp(:,:), temp3d(:,:,:)
3443 character (len = 80) :: attone
3445 character(len=10) :: dim_nam, grid
3448 INTEGER(4) idate(8),jdate(8)
3449 REAL(4) fhour,rinc(5)
3451 REAL (KIND=4),
ALLOCATABLE :: psfc(:,:), tv(:,:,:),
3452 $ wrk1(:,:), wrk2(:,:)
3462 print 331, mod(idatep,100)
3463 331
format(/
' --> GBLEVENTS: ONLY ONE NETCDF INPUT GLOBAL FILE IS ',
3464 $
'READ SINCE FILES ARE AVAILABLE EACH HOUR (NO NEED TO ',
3465 $
'INTERPOLATE'/16x,
'SPANNING FILES WHEN THE PREPBUFR CENTER HOUR',
3466 $
' (',i2.2,
') IS NOT A MULTIPLE OF 3)'/)
3471 WRITE(gfname,
'("fort.",I2.2)') iunitf(1)
3473 error=nf90_open(trim(gfname),nf90_nowrite,ncid)
3474 error=nf90_inq_dimid(ncid,
"grid_xt",dimid)
3475 error=nf90_inquire_dimension(ncid,dimid,dim_nam,im)
3476 error=nf90_inq_dimid(ncid,
"grid_yt",dimid)
3477 error=nf90_inquire_dimension(ncid,dimid,dim_nam,jm)
3478 error=nf90_inq_dimid(ncid,
"pfull",dimid)
3479 error=nf90_inquire_dimension(ncid,dimid,dim_nam,km)
3480 error=nf90_inq_dimid(ncid,
"phalf",dimid)
3481 error=nf90_inquire_dimension(ncid,dimid,dim_nam,lm)
3482 print*,
"im,jm,kmi,lm:",im,jm,km,lm
3483 print*,
"IMX, JMX:", imx, jmx
3484 IF (imx .NE. im .OR. jmx .NE. jm) print*,
"Different Resolutions"
3499 error=nf90_inq_varid(ncid,
"time", id_var)
3500 error=nf90_inquire_attribute(ncid, id_var,
"units", len=len)
3502 error=nf90_get_att(ncid, id_var,
"units", attone)
3503 read(attone(len-18:len-15),
'(i4)') yyyy
3504 read(attone(len-13:len-12),
'(i2)') mm
3505 read(attone(len-10:len-9),
'(i2)') dd
3506 read(attone(len-7:len-6),
'(i2)') hh
3507 IF(attone(1:5) .NE.
"hours")
THEN
3508 print*,
"checkout the time unit, not hourly",attone
3510 print*,
"base time", yyyy,mm,dd,hh
3513 error=nf90_get_var(ncid, id_var, time)
3525 CALL w3movdat(rinc,idate,jdate)
3527 print 1, fhour,(idate(ii),ii=1,3),idate(5),(jdate(ii),ii=1,3),
3529 1
FORMAT(
' --> GBLEVENTS: GLOBAL NEMSIO FILE: HERE IS A ',f5.1,
3530 $
' HOUR FORECAST FROM ',i5.4,3i3.2,
' VALID AT ',i5.4,3i3.2)
3532 idatgs_cor = (jdate(1) * 1000000) + (jdate(2) * 10000) +
3533 $ (jdate(3) * 100) + jdate(5)
3538 IF(idatep.NE.idatgs_cor) go to 901
3542 ALLOCATE (iar12z(im,jm), iar13p(im,jm))
3543 ALLOCATE (iar14t(im,jm,km), iar15u(im,jm,km),
3544 $ iar16v(im,jm,km), iar17q(im,jm,km),
3545 $ iarpsl(im,jm,km), iarpsi(im,jm,km+1),
3548 error=nf90_get_att(ncid, nf90_global,
"grid", grid)
3549 IF (grid ==
"gaussian")
THEN
3559 sfcpress_id = mod(idvm,ten)
3560 thermodyn_id = mod(idvm/ten,ten)
3562 IF(idvc == 3 .AND. thermodyn_id == 3)
THEN
3563 kmaxs = (ntrac+1)*kmax + 2
3572 dlat = 180./(jmax-1)
3575 print 2, jcap,imax,jmax,kmax,kmaxs,dlat,dlon,idvc
3577 2
FORMAT(/
' --> GBLEVENTS: GLOBAL MODEL SPECS: T',i5,
' ',
3578 $ i5,
' x ',i5,
' GRID WITH ',i3,
' LEVELS ',i3,
3579 $
' SCALARS -------> ',f5.2,
' X ',f5.2,
' VERT. ',
3580 $
'COORD ID IS: ',i0)
3582 print *,
'in netcdf sfcpress_id=',sfcpress_id,
' thermodyn_id=',
3583 $ thermodyn_id,
' ntrac=',ntrac
3584 print *,
' idvc=',idvc,
' idsl=',idsl,
' idvm=',idvm,
' nvcoord=',
3587 ALLOCATE(vcoord(km+1,3))
3592 error=nf90_get_att(ncid, nf90_global,
"ak", ak)
3593 error=nf90_get_att(ncid, nf90_global,
"bk", bk)
3597 vcoord(k,1) = ak(kr)
3598 vcoord(k,2) = bk(kr)
3603 allocate(temp(im,jm))
3604 error=nf90_inq_varid(ncid,
'hgtsfc', id_var)
3605 error=nf90_get_var(ncid, id_var, temp)
3607 iar12z(:,:)=temp(:,:)
3611 error=nf90_inq_varid(ncid,
'pressfc', id_var)
3612 error=nf90_get_var(ncid, id_var, temp)
3614 iar13p(:,:)=temp(:,:)*0.01
3624 allocate(temp3d(im,jm,km))
3625 error=nf90_inq_varid(ncid,
'tmp', id_var)
3626 error=nf90_get_var(ncid, id_var, temp3d)
3629 iar14t(:,:,k4)=temp3d(:,:,kr)
3630 call
gblevn11d(imax,jmax,iar14t(1,1,k4))
3635 error=nf90_inq_varid(ncid,
'ugrd', id_var)
3636 error=nf90_get_var(ncid, id_var, temp3d)
3639 iar15u(:,:,k4)=temp3d(:,:,kr)
3640 call
gblevn11d(imax,jmax,iar15u(1,1,k4))
3645 error=nf90_inq_varid(ncid,
'vgrd', id_var)
3646 error=nf90_get_var(ncid, id_var, temp3d)
3649 iar16v(:,:,k4)=temp3d(:,:,kr)
3650 call
gblevn11d(imax,jmax,iar16v(1,1,k4))
3655 error=nf90_inq_varid(ncid,
'spfh', id_var)
3656 error=nf90_get_var(ncid, id_var, temp3d)
3659 iar17q(:,:,k4)=max(0.0,temp3d(:,:,kr)*1.e6)
3660 call
gblevn11d(imax,jmax,iar17q(1,1,k4))
3673 tfac=oner+fv*max(iar17q(i,j,k)*1.0e-6,qmin)
3674 iar14t(i,j,k)=iar14t(i,j,k)*tfac
3684 ALLOCATE (psfc(im,jm), tv(im,jm,km))
3685 ALLOCATE (wrk1(im*jm,km), wrk2(im*jm,km+1))
3689 psfc(:,:) = iar13p(:,:)*100.
3690 tv(:,:,:) = iar14t(:,:,:)
3692 IF(thermodyn_id == 3 .AND. idvc == 3)
THEN
3693 tv(:,:,:) = tv(:,:,:) / cpi(1)
3694 print *,
' cpi(1)=',cpi(1)
3697 CALL sigio_modpr(imjm4,imjm4,km4,nvcoord,idvc,idsl,vcoord,iret,
3698 $ psfc,tv,pm=wrk1,pd=wrk2(1,2))
3702 wrk2(i+jj,1) = psfc(i,j)
3706 wrk2(:,l+1) = wrk2(:,l) - wrk2(:,l+1)
3713 iarpsl(i,j,l) = wrk1(i+jj,l)*0.01
3721 iarpsi(i,j,l) = wrk2(i+jj,l)*0.01
3727 error=nf90_close(ncid)
3737 print 9901, idatep,idatgs_cor
3738 9901
FORMAT(/
' ##GBLEVENTS/GBLEVN13 - NETCDF INPUT GLOBAL FILE DATE',
3739 $
' (',i4.4,3(i2.2),
'), DOES NOT MATCH PREPBUFR FILE CENTER ',
3740 $
'DATE (',i10,
') -STOP 68'/)
3758 real,
allocatable :: slats(:)
3759 real(4) slat(jmax),wlat(jmax),rad2deg
3763 call splat(idrt,jmax,slat,wlat)
3764 rad2deg=180./acos(-1.)
3765 allocate(slats(jmax));
3766 rad2deg=180./acos(-1.)
3767 slats(:)=-asin(slat(:))*rad2deg
3768 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.