gblevents  1.6.0
 All Data Structures Files Functions
gblevents.f File Reference

Pre/Post processing of of prepbufr events. More...

Go to the source code of this file.

Data Types

module  gblevn_module
 

Functions/Subroutines

subroutine gblevents (IDATEP, IUNITF, IUNITE, IUNITP, IUNITS, SUBSET, NEWTYP)
 SUBPROGRAM: GBLEVENTS PRE/POST PROCESSING OF PREPBUFR EVENTS PRGMMR: DENNIS KEYSER ORG: EMC DATE: 2017-02-22. More...
 
subroutine gblevn01 (IUNITE)
 Read observation error table. More...
 
subroutine gblevn02 (IUNITP, IUNITS, NEWTYP, subset)
 Filter data. More...
 
subroutine gblevn03 (SUBSET)
 GBLEVN03 - INTERPOLATE MODEL DATA (FIRST GUESS OR ANALYSIS) TO OB LOCATIONS. More...
 
subroutine gblevn04
 Get observation error. More...
 
subroutine gblevn06 (XOB, YOB)
 SUBROUTINE GBLEVN06 - 2D LINEAR HORIZONTAL INTERPOLATION. More...
 
subroutine gblevn08 (IUNITP, SUBSET)
 SUBPROGRAM: GBLEVN08 PRGMMR: S. More...
 
subroutine gblevn10 (IUNITF, IDATEP, IM, JM, IDRT)
 Do something. More...
 
subroutine gblevn11 (imax, jmax, grid)
 North-south swap. More...
 
subroutine gblevn11d (imax, jmax, grid)
 Does something. More...
 
subroutine gblevn12 (IUNITF, IDATEP, IM, JM, IDRT)
 Does something. More...
 
subroutine gblevn13 (IUNITF, IDATEP, IMX, JMX, IDRT)
 NetCDF Input. More...
 
subroutine getlats (idrt)
 get latitudes More...
 
function oefg01 (P, TYP, IE, OEMIN)
 SUBPROGRAM: OEFG01 PRGMMR: D. More...
 

Detailed Description

Pre/Post processing of of prepbufr events.

Definition in file gblevents.f.


Data Type Documentation

module gblevn_module

Definition at line 3 of file gblevents.f.

Data Fields
real dlat
real dlon
real(kind=8), dimension(:,:),
allocatable
iar12z
real(kind=8), dimension(:,:),
allocatable
iar13p
real(kind=8), dimension(:,:,:),
allocatable
iar14t
real(kind=8), dimension(:,:,:),
allocatable
iar15u
real(kind=8), dimension(:,:,:),
allocatable
iar16v
real(kind=8), dimension(:,:,:),
allocatable
iar17q
real(kind=8), dimension(:,:,:),
allocatable
iarpsd
real(kind=8), dimension(:,:,:),
allocatable
iarpsi
real(kind=8), dimension(:,:,:),
allocatable
iarpsl
integer *4 idsl
integer *4 idvc
integer imax
integer jmax
integer kmax
integer kmaxs
integer *4 nvcoord
integer *4 sfcpress_id
integer *4 thermodyn_id
real(kind=4), dimension(:,:),
allocatable
vcoord

Function/Subroutine Documentation

subroutine gblevents (   IDATEP,
integer*4, dimension(2)  IUNITF,
  IUNITE,
  IUNITP,
  IUNITS,
character*8  SUBSET,
  NEWTYP 
)

SUBPROGRAM: GBLEVENTS PRE/POST PROCESSING OF PREPBUFR EVENTS PRGMMR: DENNIS KEYSER ORG: EMC DATE: 2017-02-22.

RUNS IN TWO MODES: "PREVENTS" AND "POSTEVENTS". IN THE PREVENTS MODE, PREPARES OBSERVATIONAL PREPBUFR REPORTS FOR SUBSEQUENT QUALITY CONTROL AND ANALYSIS PROGRAMS. THIS IS DONE THROUGH THE FOLLOWING: INTERPOLATION OF GLOBAL FIRST GUESS {FROM EITHER SIGIO (SIGMA OR HYBRID) OR NEMSIO INPUT} TO PREPBUFR OBSERVATION LOCATIONS WITH ENCODING OF FIRST GUESS VALUES INTO PREPBUFR REPORTS; ENCODING OF "PREVENT" AND/OR "VIRTMP" EVENTS INTO PREPBUFR REPORTS; IN CERTAIN CASES, ENCODING OF A DERIVED PMSL INTO SURFACE PREPBUFR REPORTS; AND ENCODING OF OBSERVATION ERRORS FROM THE ERROR SPECIFICATION FILE INTO PREPBUFR REPORTS. IN THE POSTEVENTS MODE, AFTER ALL QUALITY CONTROL AND ANALYSIS PROGRAMS HAVE RUN, INTERPOLATES THE GLOBAL ANALYSIS {FROM EITHER SIGIO (SIGMA OR HYBRID) INPUT OR NEMSIO INPUT} TO PREPBUFR OBSERVATION LOCATIONS AND ENCODES THESE ANALYZED VALUES INTO PREPBUFR REPORTS. THE REMAINDER OF THIS ABSTRACT APPLIES ONLY TO THE PREVENTS MODE. THE "PREVENT" EVENT CAN CHANGE A QUALITY MARKER TO FLAG AN OBSERVATION DATUM FOR NON-USE BY SUBSEQUENT QC AND ANALYSIS PROGRAMS (FILTERING). EXAMPLES WHERE THIS SUBROUTINE WILL WRITE AN EVENT TO FLAG A DATUM INCLUDE: THE OBSERVATION ERROR FOR THAT DATUM IS READ IN AS MISSING IN THE INPUT ERROR FILE, THE DATUM ITSELF VIOLATES A GROSS OR "SANITY" CHECK, OR THE OBSERVED PRESSURE DATUM IS MORE THAN 100 MB BELOW THE GUESS SURFACE PRESSURE. THE "VIRTMP" EVENT CAN CHANGE THE SPECIFIC HUMIDITY OBSERVATION (RE-CALCULATED) AS WELL AS THE TEMPERATURE OBSERVATION (FROM SENSIBLE TO VIRTUAL TEMPERATURE, BASED ON JUST-CALCULATED SPECIFIC HUMIDITY). CURRENTLY THIS APPLIES ONLY TO SURFACE (LAND, MARINE AND MESONET) DATA TYPES, POSSIBLY TO RAOB, DROP AND MULTI-LEVEL RECCO DATA TYPES IF THE SWITCH "ADPUPA_VIRT" IS TRUE (NORMALLY, HOWEVER IT IS FALSE) [OTHER DATA TYPES WITH REPORTED SENSIBLE TEMPERATURE EITHER HAVE MISSING MOISTURE (E.G., ALL AIRCRAFT TYPES EXCEPT FOR SOME ACARS, SATELLITE WIND TYPES), FLAGGED MOISTURE (E.G., SOME ACARS) OR CALCULATE SPECIFIC HUMIDITY/VIRTUAL TEMPERATURE IN SUBSEQUENT PROGRAMS (E.G., RAOBS, DROPS AND MULTI-LEVEL RECCOS WHICH CALCULATE THESE IN PROGRAM "CQCBUFR", IN WHICH CASE THE SWITCH "ADPUPA_VIRT" HERE MUST BE FALSE!)]. FOR CASES WHERE THE SWITCH "DOBERR" IS FALSE, THE OBSERVATION ERROR FOR ALL DATA REMAINS MISSING IN THE PREPBUFR FILE. IN THIS CASE, THE INPUT ERROR FILE IS USUALLY A NULL FILE AND THE "PREVENT" EVENT TO FLAG THE DATUM IS NOT INVOKED. FOR CASES WHERE THE SWITCH "DOFCST" IS FALSE, IF THE SWITCH "SOME_FCST" IS ALSO FALSE, THEN FORECAST VALUES ARE NOT ENCODED FOR ANY MESSAGE TYPE; IF "SOME_FCST" IS TRUE THEN FORECAST VALUES ARE ENCODED, BUT ONLY FOR REPORTS IN THOSE MESSAGE TYPES FOR WHICH A GUESS VALUE IS NEEDED BY SUBSEQUENT QC PROGRAMS. IT SHOULD BE NOTED THAT THE FILTERING OF DATA ASSOCIATED WITH THE "PREVENT" EVENT PROCESSING IS NOT INVOKED IF ALL THREE ARE TRUE: DOBERR= FALSE, THE FORECAST VALUES ARE MISSING (DOFCST=FALSE & SOME_FCST=TRUE & MESSAGE TYPE IS NOT "ADPUPA", "AIRCFT", "AIRCAR", "PROFLR", OR "VADWND" – OR – DOFCST=FALSE & SOME_FCST=FALSE), AND "VIRTMP" EVENT PROCESSING IS NOT INVOKED (EITHER MESSAGE TYPE IS NOT "ADPSFC", "SFCSHP" OR "MSONET" WHEN "ADPUPA_VIRT" IS FALSE, OR MESSAGE TYPE IS NOT "ADPSFC", "SFCSHP", "MSONET" OR "ADPUPA" WHEN "ADPUPA_VIRT" IS TRUE). ALSO, IF VIRTUAL TEMPERATURE PROCESSING IS PERFORMED, ALL SURFACE REPORTS WITH MISSING PMSL WILL ENCODE A DERIVED PMSL INTO PREPBUFR IF THE SWITCH DOPMSL IS TRUE AND A VIRTUAL TEMPERATURE WAS SUCCESSFULLY CALCULATED.

PROGRAM HISTORY LOG: -1999-07-01 D. A. KEYSER – ORIGINAL AUTHOR (ADAPTED FROM PREVENTS SUBROUTINE IN PREPDATA PROGRAM, BUT NOW GENERALIZED FOR POSTEVENTS MODE) -1999-07-12 D. A. KEYSER – MODIFIED TO INTERPOLATE MODEL SPECIFIC HUMIDITY TO OBSERVATION LOCATION WHEN OBS. SPECIFIC HUMIDITY IS MISSING AS LONG AS OBS. TEMPERATURE IS NON-MISSING -1999-09-09 D. A. KEYSER – ADDED "VADWND" TO THE LIST OF MESSAGE TYPES FOR WHICH FORECAST VALUES MUST BE ENCODED, EVEN WHEN DOFCST=FALSE (NECESSARY BECAUSE THE NEW PROGRAM CQCVAD NEEDS THE BACKGROUND DATA) -1999-09-09 D. A. KEYSER – CHANGES TO MAKE CODE MORE PORTABLE; 'TFC' NOW GENERATED FOR VADWND MESSAGE TYPES EVEN THOUGH TOB IS MISSING (NEEDED BY CQCVAD PROGRAM) -1999-12-01 D. A. KEYSER – SPEC. HUMIDITY AND VIRT. TEMPERATURE ARE NOW CALCULATED WHEN SPEC. HUMIDITY QUAL. MARKER IS BAD (SUBJECT TO A SANITY CHECK), HOWEVER THE VIRT. TEMPERATURE GETS A BAD QUAL. MARKER (8) -2000-09-21 D. A. KEYSER – THE PRESSURE LEVEL ABOVE WHICH ALL SPEC. HUMIDITY QUAL. MARKERS ARE "REJECTED" (Q.M. SET TO 9) IS NOW READ IN AS A N-LIST SWITCH (QTOP_REJ), BEFORE IT WAS HARDWIRED TO 300 MB -2000-12-13 D. A. KEYSER – WILL NO LONGER PERFORM VIRTUAL TEMPERATURE PROCESSING FOR ACARS DATA SINCE MOISTURE IS FLAGGED RIGHT NOW (ACARS MOISTURE ONLY WRITTEN INTO PREPBUFR FILE FOR STATISTICAL REASONS) -2001-02-02 D. A. KEYSER – RESTORED LEGACY LOGIC TO FLAG CERTAIN SATELLITE TEMPERATURE SOUNDINGS EITHER BELOW 100 MB (TEMP. OBS) OR ON ALL LEVELS (SPEC. HUM. OBS), CONTROLLED BY NEW NAMELIST SWITCH "SATMQC" -2001-09-27 D. A. KEYSER – 'TFC' AND 'QFC' NOW GENERATED FOR REPORT TYPE 111 (SYNDAT REPORTS AT STORM CENTER) EVEN THOUGH "TOB" AND "QOB" ARE MISSING (NEEDED BY SYNDATA PROGRAM); IN PREPARATION FOR CHANGE FROM T170L42 TO T254L64 SGES, NOW MAKES COEFFICIENT ARRAYS ALLOCATABLE TO ALLOW THEM TO OBTAIN MEMORY FROM "HEAP" RATHER THAN FROM "STACK", ALSO HAVE INCREASED THE MAX NUMBER OF LEVELS IN ARRAYS FROM 42 TO 64, FINALLY ALSO NO LONGER STOPS WITH C. CODE 70 IF EVEN NUMBER OF LONGITUDES IN SIGMA GUESS (IMAX, HARDWIRED TO 384) IS .LT. SPECTRAL RESOLUTION (JCAP) * 2 -2001-10-10 D. A. KEYSER – AT PREPBUFR CENTER DATES WITH AN HOUR THAT IS NOT A MULTIPLE OF 3 (WHEN A GLOBAL SIGMA GUESS/ANAL FILE IS NOT AVAILABLE; E.G., IN RUC2A RUNS) NOW PERFORMS A LINEAR INTERPOLATION BETWEEN SPECTRAL COEFFICIENTS IN 2 SPANNING SIGMA GUESS/ANAL FILES 3-HRS APART TO CENERATE A GUESS/ANAL FILE VALID AT THE PREPBUFR CENTER TIME -2002-05-10 D. A. KEYSER – ADDED "AIRCAR" TO THE LIST OF TABLE A MESSAGE TYPES THAT WILL STILL HAVE THE BACKGROUND ENCODED WHEN DOFCST IS FALSE (BECAUSE ACARS ARE NOW Q.C.'d IN PREPOBS_ACARSQC PROGRAM) -2003-09-02 D. A. KEYSER – ADDED "MSONET" TO THE LIST OF TABLE A MESSAGE TYPES THAT WILL HAVE THE VIRTUAL TEMPERATURE CALCULATED; DOES NOT CALL UFBINT FOR OUTPUTTING DATA IF "NLEV" (4'TH ARGUMENT) IS ZERO (NOW CAN ONLY HAPPEN FOR GOESND FORECAST DATA WHEN ONLY RADIANCES ARE PRESENT) -2004-08-30 D. A. KEYSER – NOW INCLUDES THE 4 LAYER PWATERS, THESE GET AN OBS. ERROR (EACH THE SAME AS TOTAL PWATER) AND AN EVENT IS GENERATED WITH A REJECTED Q.M. FOR THE 4 LAYER PWATERS IF THE PWATER OBS. ERROR READ IN IS MISSING (THIS CHANGE ALLOWS THE ETA/ GSI TO PROCESS OBS. ERRORS IN THE PREPBUFR FILE THE SAME AS THE ETA/3DVAR DID WHEN READING THE OBS. ERRORS FROM AN EXTERNAL FILE); FOR "RASSDA" TYPES, ENCODES A SIMPLE COPY OF THE REPORTED (VIRTUAL) TEMPERATURE AS A "VIRTMP" EVENT IF DOVTMP IS TRUE, GETS NEW REASON CODE 3 -2004-09-10 D. T. KLEIST – ADDED CAPABILITY TO READ GUESS FIELDS FROM EITHER HYBRID OR, AS BEFORE, SIGMA GLOBAL FORECAST FILES -2005-01-03 D. A. KEYSER – FIXED ERROR READING CDAS SGES FILE WHICH STILL HAS A 207-WORD HEADER (T62) {2004-09-10 CHANGE ASSUMED ALL SGES FILES HAD A 226-WORD HEADER (T254), BUT THIS IS VALID ONLY FOR GFS SGES) -2006-05-05 R. E. TREADON – CHANGE VERTICAL INTERPOLATION TO DIRECTLY USE PRESSURE PROFILE, NOT PRESSURE PROFILE CONVERTED TO SIGMA. THIS CHANGE IS IN SUBROUTINE GBLEVN03. AS A RESULT OF THIS CHANGE, SUBROUTINE GBLEVN07 WAS REMOVED. -2006-07-14 D. A. KEYSER – ADDED NEW NAMELIST SWITCH "SOME_FCST" WHICH APPLIES ONLY WHEN EXISTING SWITCH "DOFCST" IS FALSE: IF DOFCST=F AND SOME_FCST=T THEN, JUST AS BEFORE WHEN DOFCST=F, A FORECAST WILL STILL BE ENCODED FOR REPORTS IN CERTAIN MESSAGE TYPES USED IN SUBSEQUENT Q.C. PROGRAMS (I.E, "ADPUPA", "AIRCFT", "AIRCAR", "PROFLR" OR "VADWND") (THE DEFAULT FOR SOME_FCST IS TRUE); HOWEVER IF DOFCST=F AND SOME_FCST=F THEN A FORECAST WILL NOT BE ENCODED INTO REPORTS IN ANY MESSAGE TYPE (THIS ALLOWS THIS PROGRAM TO ENCODE OBS ERRORS AND/OR VIRTUAL TEMPERATURE EVENTS INTO A PREPBUFR FILE WITHOUT ENCODING A FORECAST); ADDED NEW NAMELIST SWITCH "ADPUPA_VIRT" WHICH, WHEN TRUE, INCLUDES REPORTS IN MESSAGE TYPE ADPUPA (I.E., RAOBS, DROPS, MULTI-LEVEL RECCOS) IN THE "VIRTMP" PROCESSING (PROCESSING THEM WITH SAME LOGIC AS IN SUBROUTINE VTPEVN OF PROGRAM PREPOBS_CQCBUFR) {NORMALLY "ADPUPA_VIRT" IS FALSE (DEFAULT) BECAUSE SUBSEQUENT PROGRAM PREPOBS_CQCBUFR PERFORMS THIS FUNCTION} -2007-09-14 S. MOORTHI – ADDED CAPABILITY TO READ GENERALIZED SIGMA/ HYBRID FILES FROM THE GFS USING "SIGIO" UTILITY; ALSO, CLEANED UP SOME CODE; NEW ERROR CONDITION CODES 70 AND 71 ADDED -2007-09-14 D. A. KEYSER – FUNCTION OEFG01, WHICH RETURNS THE OBS ERROR FOR A REQUESTED VARIABLE INTERP. TO A DEFINED PRESSURE LEVEL FOR A DEFINED REPORT TYPE, MODIFIED TO USE EXACT LOGIC AS IN GSI (MINIMUM LIMITING VALUE FOR OBS ERROR BASED ON VARIABLE TYPE, LEVEL PRESSURE LIMITED TO MAX OF 2000 MB AND MIN OF ZERO MB, A FEW OTHER MINOR CHANGES) - THIS WILL ALLOW GSI TO READ OBS ERROR DIRECTLY OUT OF PREPBUFR FILE RATHER THAN OUT OF AN EXTERNAL FILE; FOR PW TYPES, NOW PASSES REPORTED SURFACE PRESSURE (PRSS * 0.01) INTO FUNCTION OEFG01 RATHER THAN VERTICAL COORDINATE PRESSURE (POB), SINCE LATTER IS ALWAYS MISSING FOR THESE TYPES (DOESN'T CHANGE VALUE COMING OUT OF OEFG01 SINCE IT IS CONSTANT ON ALL LEVELS ANYWAY FOR PW); IN SUBR. GBLEVN02, Q.M. 9 IS NOW ASSIGNED TO A VARIABLE ONLY IF ITS OBS ERROR IS MISSING, OR IN THE CASE OF MOISTURE IF THE LEVEL IS ABOVE PRESSURE LEVEL "QTOP_REJ" OR IF ITS TEMPERATURE OBS ERROR IS MISSING, ALL OTHER EVENT (E.G., GROSS CHECK ERRORS) ASSIGN Q.M. 8 (EVEN IF OBS ERROR IS MISSING), PRIOR TO THIS ONLY REJECTION OF PRESSURE ON LEVEL RESULTED IN Q.M. 8, ALL OTHER REJECTIONS GOT Q.M. 9 - THIS MEANS TRULY "BAD" OBS WILL NOW ALWAYS GET Q.M. 8 AND ONLY OBS FLAGGED FOR NON-USE BY ASSIMILATION (BUT STILL "GOOD") WILL NOW GET Q.M. 9 (GSI MONITORS, BUT DOES NOT USE, OBS WITH Q.M. 9, BUT IT DOES NOT EVEN CONSIDER OBS WITH Q.M. 8); CORRECTED ERROR WHICH MISTAKENLY ASSIGNED REASON CODE OF 9 INSTEAD OF 3 TO MOISTURE WITH MISSING OBS ERROR; IN SUBR. GBLEVN02, Q.M. 9 WILL NOT BE ASSIGNED TO A VARIABLE IF THAT VARIABLE ALREADY HAS A "BAD" Q.M. (I.E., > 3 BUT < 15), IN FACT THE "PREVENT" EVENT WHICH WOULD ASSIGN Q.M. 9 IS SKIPPED ENTIRELY (DO NOT WANT THE GSI TO MONITOR THE OBS WHICH REALLY ARE ARE "BAD"); IN SUBR. GBLEVN08, FOR NON- "ADPUPA" TYPES, Q.M. 9 IS NOW ASSIGNED TO CALCULATED VIRT. TEMPS IF THE MOISTURE Q.M. IS 9 OR 15 AND ORIG. TEMP NOT "BAD", THESE "VIRTMP" EVENTS RECEIVE NEW REASON CODE 4, HAD RECEIVED Q.M. 8 WITH REASON CODE 2 LIKE VIRT. TEMPS CALCULATED FROM "BAD" MOISTURE - THIS MEANS ONLY TRULY "BAD" VIRT. TEMPS WILL NOW GET Q.M. 8 AND VIRT. TEMPS FLAGGED FOR NON-USE BY ASSIMILATION (BUT STILL "GOOD") WILL NOW GET Q.M. 9 (GSI MONITORS, BUT DOES NOT USE, OBS WITH Q.M. 9, BUT IT DOES NOT EVEN CONSIDER OBS WITH Q.M. 8); IN SUBR. GBLEVN08, FOR "ADPUPA" TYPES, Q.M. 3 IS NOW ASSIGNED TO CALCULATED VIRT. TEMPS ONLY IF THE MOISTURE Q.M. IS TRULY BAD (I.E. > 3 BUT NOT 9 OR 15) (AND, AS BEFORE, ORIG. TQM IS 1 OR 2 AND POB IS BELOW 700 MB) - BEFORE, TQM SET TO 3 WHEN QQM WAS 9 OR 15 AND ALL OTHER CONDITIONS MET; FOR "SATEMP" TYPES, ENCODES A SIMPLE COPY OF THE REPORTED (VIRTUAL) TEMPERATURE AS A "VIRTMP" EVENT IF DOVTMP IS TRUE, GETS REASON CODE 3 (SIMILAR TO WHAT IS ALREADY DONE FOR "RASSDA" TYPES) -2010-01-29 D. A. KEYSER – ADDED NEW NAMELIST SWITCH "RECALC_Q" WHICH APPLIES ONLY WHEN EXISTING SWITCH "DOVTMP" IS FALSE: IF DOVTMP=F AND RECALC_Q=T THEN, JUST AS BEFORE WHEN DOVTMP=F, SPEC. HUMIDITY IS STILL RE-CALCULATED AND THE EVENT IS ENCODED INTO THE PREPBUFR FILE (BUT VIRTUAL TEMP. IS NOT ENCODED) (THE DEFAULT FOR RECALC_Q IS TRUE), HOWEVER IF DOVTMP=F AND RECALC_Q=F THEN SPEC. HUMIDITY IS NOT RE-CALCULATED (AND NEITHER IS VIRTUAL TEMPERATURE) (THIS ALLOWS THIS PROGRAM TO BYPASS ALL "VIRTMP" EVENT PROCESSING); ADDED NEW NAMELIST SWITCH "DOPREV" WHICH, WHEN TRUE, WRITES "PREVENT" EVENTS INTO THE PREPBUFR FILE (IT ALWAYS DID THIS BEFORE) (DEFAULT), BUT NOW ALLOWS THE PROGRAM TO BYPASS "PREVENT" EVENT PROCESSING WHEN DOPREV=F; INITIALIZED ARRAY IDATE AS ZERO IN SUBR. GBLEVN10, CORRECTED BUG WHICH EXPOSED PREVIOUSLY HIDDEN MEMORY CLOBBERING WHEN CALLING PROGRAMS WERE LINKED TO NEW BUFRLIB; RULES IN SUBROUTINE GBLEVN02 REFINED TO INCLUDE FULL SFC PRESSURE SANITY CHECK FOR ALL SFC REPORTS (MASS, 18x, & WIND, 28x), BEFORE ONLY DONE FOR SFC MASS REPORTS (18x) AND STILL NOT DONE FOR NON-SFC WIND REPORTS SINCE LOWEST LEVEL PRESSURE NOT NECESSARILY AT THE SFC), AS A RESULT 28x WINDS WILL NOW GET QM=8 IF PRESSURE FAILS SANITY CHECK (OFTEN HAPPENS IN MESONET REPORTS) (GSI WAS ALREADY NOT USING THESE WINDS SINCE PRESSURE QM SET TO 8 ALL ALONG) -2012-11-20 J. WOOLLEN INITIAL PORT TO WCOSS. ADDED CALL TO BUFRLIB ROUTINE GETBMISS TO ADAPT BMISS TO LINUX ENVIRONMENT IF NEED BE {I.E., OBTAINS BUFRLIB MISSING (BMISS) VIA CALL TO GETBMISS RATHER THAN HARDWIRING IT TO 10E10 (10E10 CAN CAUSE INTEGER OVERFLOW ON WCOSS - SEE CALLING PROGRAM FOR MORE INFO)} -2013-02-13 D. A. KEYSER – FINAL CHANGES TO RUN ON WCOSS: USE FORMATTED PRINT STATEMENTS WHERE PREVIOUSLY UNFORMATTED PRINT WAS > 80 CHARACTERS; RENAME ALL REAL(8) VARIABLES AS *_8 -2013-04-12 D. A. KEYSER – IN SUBROUTINE GBLEVN08, DON'T ALLOW CALCULATED Q TO BE < 0 WHICH CAN OCCUR ON WCOSS FOR CASES OF HORRIBLY BAD MESONET DATA -2014-03-25 S. MELCHIOR – ADDED NEW NAMELIST SWITCH "DOPMSL" WHICH, WHEN TRUE, DERIVES PMSL (MNEMONIC "PMO") FROM REPORTED STATION PRESSURE ("POB"), STATION HEIGHT/ELEVATION ("ZOB") AND THE JUST- COMPUTED VIRTUAL TEMPERATURE FOR SURFACE REPORTS IN CASES WHEN REPORTED PMSL IS MISSING (DONE IN SUBROUTINE GBLEVN08). DOVTMP MUST BE TRUE AND DOANLS MUST BE FALSE ("PREVENTS" MODE). THE DERIVED PMSL EITHER GETS A QUALITY MARK ("PMQ") OF 3 OR INHERITS THE STATION PRESSURE QUALITY MARK ("PQM"), WHICHEVER IS GREATER. THE VALUE OF THE PMSL INDICATOR (NEW MNEMONIC "PMIN") IS SET TO 1 TO DENOTE PMSL WAS DERIVED RATHER THAN OBSERVED. THE DEFAULT FOR "DOPMSL" IS FALSE (NORMALLY ONLY TRUE IN RTMA AND URMA RUNS). IT IS FORCED TO BE FALSE IN "POSTEVENTS" MODE (DOANLS=TRUE). IN SUBROUTINE GBLEVN02, SFCSHP REPORTS WITH CALM WINDS AND NON- MISSING BACKGROUND U- OR V-COMPONENT WIND .GE. 5 M/SEC ARE FLAGGED WITH Q.M. 8 (EVENT PGM "PREVENT", REASON CODE 8). -2014-05-08 JWhiting – altered print statement (2 format) in GBLEVN10 subroutine; increased field width for spectral resolution to accommodate models w/ up to 5-digit resolution (I3 to I5). -2016-06-13 FANGLIN YANG AND RUSS TREADON – HANG LEI ADDED NEMSIO TO SUBROUTINE GBLEVN10 AND REMOVED ALL SIGIO CAPABILITY. THIS UPDATE RESTORES GBLEVN10 FOR PROCESSING SIGIO INPUT, AND ADDS A NEW GBLEVN12 FOR PROCESSING NEMSIO INPUT. THE INPUT GFS FILE TYPE SIGIO VS NEMSIO IS NOW DETERMINED IN THE MAIN PROGRAM. THE CODE IS ALSO UPDATED TO REMOVE BUGS. SUBROUTINE SIGIO_MODPR IS USED TO COMPUTE LAYER AND INTERFACE PRESSURE FOR NEMSIO INPUT. -2017-02-17 D Keyser & J Whiting – In subroutine GBLEVN12, removed references to multiple input files, since only 1 nemsio formatted input is needed (no interpolation is attempted; c.f.; what is done with sigio formatted inputs); GBLEVN12 routine still retains input. Updated comments and docblock to account for new NEMSIO input. -2017-02-22 D. Keyser – Further changes to subr. GBLEVN12 to remove array and logic references to multiple input files. -2019-10-31 Hang Lei – Add GBLEVN13 to process netcdf input.

USAGE: CALL GBLEVENTS(IDATEP,IUNITF,IUNITE,IUNITP,IUNITS,SUBSET, $ NEWTYP)

INPUT ARGUMENT LIST:

Parameters
IDATEP- CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH
IUNITF- 2-WORD ARRAY: For SIGIO input:
  • WORD 1 - UNIT NUMBER OF FIRST INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE DATE IN IDATEP, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME PRIOR TO THE DATE IN IDATEP THAT IS A MULTIPLE OF 3
  • WORD 2 - UNIT NUMBER OF SECOND INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS EMPTY, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME AFTER THE DATE IN IDATEP THAT IS A MULTIPLE OF 3 For NEMSIO input:
  • WORD 1 - UNIT NUMBER OF INPUT NEMSIO-BASED GLOBAL FILE (EITHER FIRST GUESS OR ANALYSIS); ALWAYS VALID AT AT THE DATE IN IDATEP
  • WORD 2 - NOT USED, SHOULD BE A NULL FILE
IUNITE- UNIT NUMBER OF INPUT OBSERVATION ERROR FILE
  • (USED ONLY IN PREVENTS MODE)
IUNITP- UNIT NUMBER OF OUTPUT PREPBUFR DATA SET
IUNITS- UNIT NUMBER OF "PREVENT" EVENTS DATA FILTERING
  • SUMMARY PRINT FILE
  • (USED ONLY IN PREVENTS MODE)
SUBSET- THE BUFR MESSAGE TABLE A ENTRY FOR THE PARTICULAR
  • REPORT BEING PROCESSED
NEWTYP- INDICATOR IF THE BUFR MESSAGE TABLE A ENTRY HAS
  • CHANGED FROM THAT OF THE PREVIOUS REPORT (=0 - NO,
  • =1 - YES)

INPUT FILES:

  • UNIT 05 - STANDARD INPUT (DATA CARDS - SEE NAMELIST DOCUMENTATION BELOW) (NOTE: IF STANDARD INPUT FILE IS NULL, THEN THIS SUBROUTINE RUNS IN POSTEVENTS MODE)
  • UNIT AA - PREPBUFR DATA SET (WHERE AA IS UNIT NUMBER DEFINED AS IUNITP IN INPUT ARGUMENT LIST)
  • UNIT BB - GUESS (PREVENTS MODE) OR ANALYSIS (POSTEVENTS MODE) FILE (WHERE BB IS UNIT NUMBER DEFINED AS IUNITF(1) IN INPUT ARGUMENT LIST)
  • UNIT CC - GUESS (PREVENTS MODE) OR ANALYSIS (POSTEVENTS MODE) FILE (WHERE CC IS UNIT NUMBER DEFINED AS IUNITF(2) IN INPUT ARGUMENT LIST) NOTE: only valid for SIGIO input
  • UNIT DD - OBSERVATION ERROR FILE (WHERE DD IS UNIT NUMBER DEFINED AS IUNITE IN INPUT ARGUMENT LIST) (USED ONLY IN PREVENTS MODE)

OUTPUT FILES:

  • UNIT 06 - STANDARD OUTPUT PRINT
  • UNIT AA - PREPBUFR DATA SET (WHERE AA IS UNIT NUMBER DEFINED AS IUNITP IN INPUT ARGUMENT LIST)
  • UNIT DD - "PREVENT" EVENTS DATA FILTERING SUMMARY PRINT FILE (WHERE DD IS UNIT NUMBER DEFINED AS IUNITS IN INPUT ARGUMENT LIST) (USED ONLY IN PREVENTS MODE)

SUBPROGRAMS CALLED: UNIQUE: GBLEVN02 GBLEVN03 GBLEVN04 GBLEVN06 OEFG01 GBLEVN08 GBLEVN10 GBLEVN11 GBLEVN11D GBLEVN12 GBLEVN13 GETLATS MODULES: GBLEVN_MODULE SIGIO_MODULE SIGIO_R_MODULE NEMSIO_MODULE NEMSIO_OPENCLOSE NEMSIO_READ NEMSIO_WRITE LIBRARY: SIGIO - SIGIO_RROPEN SIGIO_RRHEAD SIGIO_SCLOSE SIGIO_ALDATS SIGIO_ALDATM SIGIO_RRDATS SIGIO_RRDATM SIGIO_AXDATS SIGIO_AXDATM SIGIO_MODPR SIGIO_CNVTDV SPLIB - SPTEZM SPTEZMV SPLAT W3NCO - W3MOVDAT ERREXIT BUFRLIB - UFBINT UFBQCD GETBMISS IBFMS NEMSIO - NEMSIO_OPEN NEMSIO_CLOSE NEMSIO_INIT NEMSIO_GETFILEHEAD NEMSIO_READRECV NEMSIO_FINALIZE NEMSIO_GETHEADVAR NEMSIO_READRECVw34

EXIT STATES:

  • COND = 0 - SUCCESSFUL RUN
  • COND = 60 - OBSERVATION ERROR TABLE EMPTY OR DOES NOT EXIST
  • COND = 61 - VARIABLE NLTD .NE. VARIABLE NLEV
  • COND = 62 - VARIABLE NLTQ .NE. VARIABLE NLEV
  • COND = 63 - VARIABLE NLQQ .NE. VARIABLE NLEV
  • COND = 68 - DATE OF FIRST GUESS/ANALYSIS FILE(S) DOES NOT MATCH, OR AT LEAST SPAN, THE CENTER DATE FOR THE PREPBUFR FILE
  • COND = 69 - FOR SIGIO INPUT GLOBAL FILES, VARIABLE KMAX TOO BIG
    • UNABLE TO TRANSFORM FIRST GUESS OR ANALYSIS FILE(S)
  • COND = 70 - FOR SIGIO INPUT GLOBAL FILES, CALL TO SIGIO_RROPEN RETURNED WITH NON-ZERO R.C.
  • COND = 71 - FOR SIGIO INPUT GLOBAL FILES, CALL TO SIGIO_RRHEAD RETURNED WITH NON-ZERO R.C.

REMARKS: THIS SUBROUTINE MAY NOT WORK CORRECTLY IN THE EIGHT BYTE INTEGER W3NCO (_8) LIBRARY. PLEASE COMPILE APPLICATION CODE USING A FOUR BYTE REAL W3NCO LIBRARY (_4 OR _d).

THIS ROUTINE PROCESSES ONE REPORT AT A TIME. IT EXPECTS THAT THE CALLING PROGRAM HAS ALREADY ENCODED THE REPORT INTO THE PREPBUFR FILE VIA THE UFBINT OR UFBCPY ROUTINES. THE CALLING PROGRAM SHOULD THEN CALL THIS ROUTINE AND, UPON ITS RETURN, THE CALLING PROGRAM SHOULD CALL WRITSB TO ACTUALLY WRITE THE UPDATED SUBSET (REPORT) INTO THE BUFR MESSAGE. C ***** VARIABLES IN NAMELIST PREVDATA READ IN BY THIS SUBROUTINE ***** (NOTE: IF STANDARD INPUT FILE IS NULL, THEN THIS SUBROUTINE RUNS IN POSTEVENTS MODE - DOANLS=TRUE AND ALL OTHER VARIABLES ARE SET TO FALSE) C C

  • DOPREV - WRITE "PREVENT" EVENT INTO THE PREPBUFR FILE? DOPREV = .TRUE. —> YES (DEFAULT) DOPREV = .FALSE. —> NO
  • DOVTMP, ADPUPA_VIRT & RECALC_Q: DOVTMP - WRITE VIRTUAL TEMPERATURE EVENT ("VIRTMP") INTO THE PREPBUFR FILE (I.E., RE-CALCULATE SPECIFIC HUMIDITY THEN CALCULATE VIRTUAL TEMPERATURE) FOR THE FOLLOWING TYPES OF REPORTS: ADPUPA_VIRT = .FALSE. —> SURFACE LAND, MARINE, MESONET AND RASS REPORTS? ADPUPA_VIRT = .TRUE. —> SURFACE LAND, MARINE, MESONET RASS, RAOB, DROP AND MULTI-LEVEL RECCO REPORTS? FOR ALL TYPES EXCEPT RASS, THIS WILL ATTEMPT TO CALCULATE VIRTUAL TEMPERATURE FROM SENSIBLE TEMPERATURE AND THE JUST RE-CALCULATED SPECIFIC HUMIDITY AND ENCODE IT AS A STACKED EVENT IN THE PREPBUFR FILE. FOR RASS REPORTS THIS WILL JUST ENCODE THE REPORTED TEMPERATURE AS A STACKED EVENT IN THE PREPBUFR FILE SINCE THE REPORTED TEMPERATURE IS ALREADY VIRTUAL (NO MOISTURE IS PRESENT SO Q IS NOT RE-CALCULATED FOR RASS REPORTS). DOVTMP = .TRUE. —> YES (DEFAULT) DOVTMP = .FALSE. RECALC_Q = .TRUE. —> RE-CALCULATE SPECIFIC HUMIDITY BUT DO NOT THEN CALCULATE VIRTUAL TEMPERATURE (DEFAULT) RECALC_Q = .FALSE. —> NO, DO NOT RE-CALCULATE SPECIFIC HUMIDITY AND DO NOT CALCULATE VIRTUAL TEMPERATURE {NOTE1: FOR SURFACE LAND, MARINE AND MESONET REPORTS, (AND RAOB, DROP AND MULTI-LEVEL RECCO REPORTS IF "ADPUPA_VIRT"=TRUE) DOVTMP=FALSE WILL STILL RE-CALCULATE SPECIFIC HUMIDITY AND ENCODE IT AS A STACKED EVENT IN THE PREPBUFR FILE UNLESS EITHER DOANLS IS TRUE OR RECALC_Q IS FALSE.) (NOTE2: DOES NOT APPLY TO ANY REPORT TYPES OTHER THAN THOSE MENTIONED ABOVE) (NOTE3: IF DOANLS=TRUE, THEN DOVTMP IS NOT ONLY FORCED TO BE FALSE, BUT ALSO SPECIFIC HUMIDITY IS NOT RE-CALCULATED.) (NOTE4: ADPUPA_VIRT DEFAULTS TO FALSE.) (NOTE5: IF DOVTMP=TRUE, THEN RECALC_Q IS MEANINGLESS.) (NOTE6: RECALC_Q DEFAULTS TO TRUE.)
  • DOFCST & SOME_FCST: DOFCST - ENCODE FORECAST (FIRST GUESS) VALUES, INTERPOLATED FROM EITHER A SIGIO (SIGMA OR HYBRID) INPUT OR NEMSIO INPUT GLOBAL FILE, INTO THE PREPBUFR FILE FOR ALL MESSAGE TYPES OR AT LEAST SOME MESSAGE TYPES? DOFCST = .TRUE. —> YES, ENCODE FORECST FOR ALL MESSAGE TYPES (DEFAULT) DOFCST = .FALSE. SOME_FCST = .FALSE. —> NO, DO NOT ENCODE FORECAST FOR ANY MESSAGE TYPE (VALUES REMAIN MISSING) SOME_FCST = .TRUE. —> YES, BUT ONLY FOR MESSAGE TYPES "ADPUPA", "AIRCFT", "AIRCAR", "PROFLR" OR "VADWND" (VALUES REMAIN MISSING FOR ALL OTHER MESSAGE TYPES) (NOTE1: THE CASE DOFCST=FALSE & SOME_FCST=TRUE WRITES THE FORECAST VALUES FOR THE TYPES MENTIONED ABOVE BECAUSE THEY ARE NEEDED BY SUBSEQUENT QUALITY CONTROL PROGRAMS.) (NOTE2: THIS WAS ADDED AS A TIME SAVING FEATURE IN THE NON-GLOBAL VERSIONS SINCE ONLY THE GLOBAL REQUIRES A FIRST GUESS TO BE PRESENT FOR ALL CONVENTIONAL MESSAGE TYPES IN THE PREPBUFR FILE.) (NOTE3: IF DOANLS=TRUE, THEN DOFCST & SOME_FCST ARE FORCED TO BE FALSE, MEANING A GUESS WILL NOT BE ENCODED FOR ANY MESSAGE TYPE.) (NOTE4: IF DOFCST=TRUE, THEN SOME_FCST IS MEANINGLESS.) (NOTE5: SOME_FCST DEFAULTS TO TRUE.)
  • DOANLS - ENCODE ANALYZED VALUES, INTERPOLATED FROM EITHER A SIGIO (SIGMA OR HYBRID) INPUT OR NEMSIO INPUT GLOBAL FILE, INTO THE PREPBUFR FILE - POSTEVENTS MODE - ? DOANLS = .TRUE. —> YES, FOR ALL MESSAGE TYPES DOANLS = .FALSE. —> NO, FOR ALL MESSAGE TYPES
    • PREVENTS MODE - (DEFAULT) (NOTE: DOANLS=TRUE WILL OVERRIDE AND FORCE TO FALSE ALL OTHER SWITCHES. IN ADDITION, THE FORECAST VALUES WILL NOT BE ENCODED FOR ANY MESSAGE TYPE AND SPECIFIC HUMIDITY WILL NOT BE RE-CALCULATED.)
  • DOBERR - ENCODE OBSERVATIONAL ERROR VALUES, AS READ FROM OBS. ERROR FILE, INTO THE PREPBUFR FILE? DOBERR = .TRUE. —> YES (DEFAULT) DOBERR = .FALSE. —> NO (VALUES REMAIN MISSING) (NOTE1: THIS WAS ADDED AS A TIME SAVING FEATURE IN THE RAP -AND PREVIOUS RUC- VERSION SINCE IT DOES NOT REQUIRE OBSERVATIONAL ERRORS TO BE PRESENT IN THE PREPBUFR FILE.) (NOTE2: IF DOANLS=TRUE, THEN DOBERR IS FORCED TO BE FALSE.)
  • QTOP_REJ - THE PRESSURE LEVEL (IN MB) ABOVE WHICH ALL SPECIFIC HUMIDITY QUALITY MARKERS ARE "REJECTED" (THE QUALITY MARKER IS SET TO 9 ON ALL PRESSURE LEVELS LESS THAN THIS LEVEL) (DEFAULT=300.)
  • SATMQC - PERFORM SPECIAL QUALITY CONTROL ON SATELLITE TEMPERATURE SOUNDINGS IN REPORT TYPES 160-179? SATMQC = .TRUE. —> YES SATMQC = .FALSE. —> NO (DEFAULT) (NOTE: THIS APPLIES ONLY TO THE CDAS OR HISTORICAL RE-RUNS WITH TEMPERATURE SOUNDINGS IN THESE REPORT TYPES)
  • DOPMSL - ENCODE DERIVED PMSL ("PMO") FOR ALL SURFACE REPORTS WHEN REPORTED PMSL IS MISSING - ? DOPMSL = .TRUE. —> YES DOPMSL = .FALSE. —> NO ("PMO" REMAINS MISSING)(DEFAULT) {NOTE: THIS APPLIES ONLY WHEN DOVTMP=TRUE AND DOANLS=FALSE ("PREVENTS" MODE), VIRTUAL TEMPERATURE CAN BE CALCULATED, AND STATION PRESSURE AND SURFACE HEIGHT/ELEVATION ARE BOTH PRESENT. THE DERIVED PMSL EITHER GETS A QUALITY MARK ("PMQ") OF 3 OR INHERITS THE STATION PRESSURE QUALITY MARK ("PQM") PQM, WHICHEVER IS GREATER. THE VALUE OF THE PMSL INDICATOR ("PMIN") IS SET TO 1 TO DENOTE PMSL WAS DERIVED RATHER THAN OBSERVED.}

Definition at line 531 of file gblevents.f.

References gblevn01(), gblevn02(), gblevn03(), gblevn04(), gblevn08(), gblevn10(), gblevn12(), and gblevn13().

subroutine gblevn01 (   IUNITE)

Read observation error table.

Parameters
IUNITE- UNIT NUMBER OF INPUT OBSERVATION ERROR FILE (USED ONLY IN PREVENTS MODE)

Definition at line 900 of file gblevents.f.

Referenced by gblevents().

subroutine gblevn02 (   IUNITP,
  IUNITS,
  NEWTYP,
character*8  subset 
)

Filter data.

Parameters
IUNITP- UNIT NUMBER OF OUTPUT PREPBUFR DATA SET
IUNITS- UNIT NUMBER OF "PREVENT" EVENTS DATA FILTERING
  • SUMMARY PRINT FILE
  • (USED ONLY IN PREVENTS MODE)
SUBSET- THE BUFR MESSAGE TABLE A ENTRY FOR THE PARTICULAR
  • REPORT BEING PROCESSED
NEWTYP- INDICATOR IF THE BUFR MESSAGE TABLE A ENTRY HAS
  • CHANGED FROM THAT OF THE PREVIOUS REPORT (=0 - NO,
  • =1 - YES)

Definition at line 942 of file gblevents.f.

References oefg01().

Referenced by gblevents().

subroutine gblevn03 ( character*8  SUBSET)

GBLEVN03 - INTERPOLATE MODEL DATA (FIRST GUESS OR ANALYSIS) TO OB LOCATIONS.

Parameters
SUBSET- THE BUFR MESSAGE TABLE A ENTRY FOR THE PARTICULAR REPORT BEING PROCESSED

Definition at line 1660 of file gblevents.f.

References gblevn06().

Referenced by gblevents().

subroutine gblevn04 ( )

Get observation error.

Definition at line 1837 of file gblevents.f.

References oefg01().

Referenced by gblevents().

subroutine gblevn06 (   XOB,
  YOB 
)

SUBROUTINE GBLEVN06 - 2D LINEAR HORIZONTAL INTERPOLATION.

Definition at line 1890 of file gblevents.f.

Referenced by gblevn03().

subroutine gblevn08 (   IUNITP,
character*8  SUBSET 
)

SUBPROGRAM: GBLEVN08 PRGMMR: S.

MELCHIOR ORG: NP22 DATE: 2014-03-25

ABSTRACT: CREATE VIRTUAL TEMPERATURE EVENTS WITHIN GBLEVENTS SUBROUTINE. FOR ALL TYPES EXCEPT RASS, THIS CONSISTS OF FIRST RE- CALCULATING THE SPECIFIC HUMIDITY FROM THE REPORTED DEWPOINT TEMPERATURE AND PRESSURE, FOLLOWED BY THE CALCULATION OF VIRTUAL TEMPERATURE FROM THE JUST-CALCULATED SPECIFIC HUMIDITY AND THE REPORTED (SENSIBLE) TEMPERATURE. THE RE-CALCULATED SPECIFIC HUMIDITY IS THEN ENCODED AS A STACKED EVENT TO BE LATER WRITTEN INTO THE PREPBUFR FILE (UNDER PROGRAM "VIRTMP", REASON CODE 0). IF THE NAMELIST SWITCH DOVTMP IS TRUE, THEN THE JUST-CALCULATED VIRTUAL TEMPERATURE IS THEN ALSO ENCODED AS A STACKED EVENT TO BE LATER WRITTEN INTO THE PREPBUFR FILE (UNDER PROGRAM "VIRTMP", REASON CODE 0, 2 OR 6). FOR RASS DATA, SPECIFIC HUMIDITY IS MISSING HOWEVER IF THE NAMELIST SWITCH DOVTMP IS TRUE, A SIMPLE COPY OF THE REPORTED (VIRTUAL) TEMPERATURE IS ENCODED AS A STACKED EVENT TO BE LATER WRITTEN INTO THE PREPBUFR FILE (UNDER PROGRAM "VIRTMP", REASON CODE 3). FOR SURFACE DATA WITH A MISSING PMSL, IF DOVTMP=T AND DOPMSL=T AND A VIRTUAL TEMPERATURE HAS BEEN COMPUTED, CALCULATE AN ESTIMATED PMSL AND ENCODE IT INTO PREPBUFR FILE ALONG WITH AN INDICATOR THAT IS WAS DERIVED HERE. THIS SUBROUTINE IS CURRENTLY ONLY CALLED FOR SURFACE LAND ("ADPSFC"), MARINE ("SFCSHP"), MESONET ("MSONET"), RASS ("RASSDA") OR SATELLITE TEMPERATURE RETRIEVAL ("SATEMP") DATA TYPES WHEN SWITCH "ADPUPA_VIRT" IS FALSE AND ONLY FOR SURFACE LAND ("ADPSFC"), MARINE ("SFCSHP"), MESONET ("MSONET"), RASS ("RASSDA"), SATELLITE TEMPERATURE RETRIEVAL ("SATEMP") OR RAOB/DROP/MULTI-LVL RECCO ("ADPUPA") DATA TYPES WHEN SWITCH "ADPUPA_VIRT" IS TRUE. IT IS ALSO ONLY CALLED IN THE PREVENTS MODE. THIS ROUTINE IS CALLED ONCE FOR EACH VALID REPORT IN THE PREPBUFR FILE.

PROGRAM HISTORY LOG: 1995-05-17 J. WOOLLEN (NP20) - ORIGINAL AUTHOR 1997-06-01 D.A. KEYSER - STREAMLINED, ADDED SWITCH DOVTMP 1999-12-01 D. A. KEYSER – SPEC. HUMIDITY AND VIRT. TEMPERATURE ARE NOW CALCULATED WHEN SPEC. HUMIDITY QUAL. MARKER IS BAD (SUBJECT TO A SANITY CHECK), HOWEVER THE VIRT. TEMPERATURE GETS A BAD QUAL. MARKER (8) 2004-08-30 D. A. KEYSER – FOR "RASSDA" TYPES, ENCODES A SIMPLE COPY OF THE REPORTED (VIRTUAL) TEMPERATURE AS A "VIRTMP" EVENT IF DOVTMP IS TRUE, GETS NEW REASON CODE 3 2006-07-14 D. A. KEYSER – PROCESSES REPORTS IN MESSAGE TYPE ADPUPA (I.E., RAOBS, DROPS, MULTI-LEVEL RECCOS) WITH SAME LOGIC AS IN SUBROUTINE VTPEVN OF PROGRAM PREPOBS_CQCBUFR WHEN NEW NAMELIST SWITCH "ADPUPA_VIRT" IS TRUE {NORMALLY "ADPUPA_VIRT" IS FALSE (DEFAULT) BECAUSE SUBSEQUENT PROGRAM PREPOBS_CQCBUFR PERFORMS THIS FUNCTION} 2007-09-14 D. A. KEYSER – FOR NON-"ADPUPA" TYPES, Q.M. 9 IS NOW ASSIGNED TO CALCULATED VIRT. TEMPS IF THE MOISTURE Q.M. IS 9 OR 15 AND ORIG. TEMP NOT "BAD", THESE "VIRTMP" EVENTS RECEIVE NEW REASON CODE 4, HAD RECEIVED Q.M. 8 WITH REASON CODE 2 LIKE VIRT. TEMPS CALCULATED FROM "BAD" MOISTURE - THIS MEANS ONLY TRULY "BAD" VIRT. TEMPS WILL NOW GET Q.M. 8 AND VIRT. TEMPS FLAGGED FOR NON-USE BY ASSIMILATION (BUT STILL "GOOD") WILL NOW GET Q.M. 9 (GSI MONITORS, BUT DOES NOT USE, OBS WITH Q.M. 9, BUT IT DOES NOT EVEN CONSIDER OBS WITH Q.M. 8); FOR "ADPUPA" TYPES, Q.M. 3 IS NOW ASSIGNED TO CALCULATED VIRT. TEMPS ONLY IF THE MOISTURE Q.M. IS TRULY BAD (I.E. > 3 BUT NOT 9 OR 15) (AND, AS BEFORE, ORIG. TQM IS 1 OR 2 AND POB IS BELOW 700 MB) - BEFORE, TQM SET TO 3 WHEN QQM WAS 9 OR 15 AND ALL OTHER CONDITIONS MET; FOR "SATEMP" TYPES, ENCODES A SIMPLE COPY OF THE REPORTED (VIRTUAL) TEMPERATURE AS A "VIRTMP" EVENT IF DOVTMP IS TRUE, GETS REASON CODE 3 (SIMILAR TO WHAT IS ALREADY DONE FOR "RASSDA" TYPES) 2013-04-12 D. A. KEYSER – DON'T ALLOW CALCULATED Q TO BE < 0 WHICH CAN OCCUR ON WCOSS FOR CASES OF HORRIBLY BAD MESONET DATA 2014-03-25 S. MELCHIOR – ADDED NEW NAMELIST SWITCH "DOPMSL" WHICH, WHEN TRUE, DERIVES PMSL (MNEMONIC "PMO") FROM REPORTED STATION PRESSURE ("POB"), STATION HEIGHT/ELEVATION ("ZOB") AND THE JUST- COMPUTED VIRTUAL TEMPERATURE FOR SURFACE REPORTS IN CASES WHEN REPORTED PMSL IS MISSING. DOVTMP MUST BE TRUE AND DOANLS MUST BE FALSE ("PREVENTS" MODE). THE DERIVED PMSL EITHER GETS A QUALITY MARK ("PMQ") OF 3 OR INHERITS THE STATION PRESSURE QUALITY MARK ("PQM"), WHICHEVER IS GREATER. THE VALUE OF THE PMSL INDICATOR (NEW MNEMONIC "PMIN") IS SET TO 1 TO DENOTE PMSL WAS DERIVED RATHER THAN OBSERVED. THE DEFAULT FOR "DOPMSL" IS FALSE (NORMALLY ONLY TRUE IN RTMA AND URMA RUNS). IT IS FORCED TO BE FALSE IN "POSTEVENTS" MODE (DOANLS=TRUE).

USAGE: CALL GBLEVN08(IUNITP) INPUT ARGUMENT LIST:

Parameters
IUNITP- BUFR OUTPUT FILE UNIT
SUBSET- THE BUFR MESSAGE TABLE A ENTRY FOR THE PARTICULAR
  • REPORT BEING PROCESSED

REMARKS: WILL IMMEDIATELY RETURN TO CALLING PROGRAM IF ANY OF THE FOLLOWING CONDITIONS EXIST: THERE ARE NO LEVELS OF VALID DEWPOINT, OBS, TEMPERATURE Q.M. OR SPEC. HUMIDITY Q.M. IN THE INPUT PREPBUFR FILE FOR THE REPORT. WILL NOT ATTEMPT EITHER SPEC. HUMIDITY NOR VIRT. TEMP CALC. ON A GIVEN LEVEL IF ANY OF THE FOLLOWING CONDITIONS EXIST: REPORTED PRESSURE OBS IS MISSING, REPORTED (SENSIBLE) TEMPERATURE OBS IS MISSING, OR REPORTED DEWPOINT OBS IS MISSING.

ATTRIBUTES: LANGUAGE: FORTRAN 90 MACHINE: NCEP WCOSS

Definition at line 2206 of file gblevents.f.

Referenced by gblevents().

subroutine gblevn10 ( integer, dimension(2)  IUNITF,
integer  IDATEP,
integer  IM,
integer  JM,
integer  IDRT 
)

Do something.

Parameters
IUNITF- 2-WORD ARRAY: For SIGIO input:
  • WORD 1 - UNIT NUMBER OF FIRST INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE DATE IN IDATEP, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME PRIOR TO THE DATE IN IDATEP THAT IS A MULTIPLE OF 3
  • WORD 2 - UNIT NUMBER OF SECOND INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS EMPTY, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME AFTER THE DATE IN IDATEP THAT IS A MULTIPLE OF 3 For NEMSIO input:
  • WORD 1 - UNIT NUMBER OF INPUT NEMSIO-BASED GLOBAL FILE (EITHER FIRST GUESS OR ANALYSIS); ALWAYS VALID AT AT THE DATE IN IDATEP
  • WORD 2 - NOT USED, SHOULD BE A NULL FILE
IDATEP- CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH
im
jm
IDRTINTEGER GRID IDENTIFIER (IDRT=4 FOR GAUSSIAN GRID, IDRT=0 FOR EQUALLY-SPACED GRID INCLUDING POLES, IDRT=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)

Definition at line 2478 of file gblevents.f.

References gblevn11().

Referenced by gblevents().

subroutine gblevn11 ( integer  imax,
integer  jmax,
real, dimension(imax,jmax)  grid 
)

North-south swap.

Definition at line 2927 of file gblevents.f.

Referenced by gblevn10().

subroutine gblevn11d ( integer  imax,
integer  jmax,
real(kind=8), dimension(imax,jmax)  grid 
)

Does something.

Definition at line 2947 of file gblevents.f.

Referenced by gblevn12(), and gblevn13().

subroutine gblevn12 ( integer, dimension(2)  IUNITF,
integer  IDATEP,
integer  IM,
integer  JM,
integer  IDRT 
)

Does something.

Parameters
iunitf
idatep
im
jm
IUNITF- 2-WORD ARRAY: For SIGIO input:
  • WORD 1 - UNIT NUMBER OF FIRST INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE DATE IN IDATEP, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME PRIOR TO THE DATE IN IDATEP THAT IS A MULTIPLE OF 3
  • WORD 2 - UNIT NUMBER OF SECOND INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS EMPTY, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME AFTER THE DATE IN IDATEP THAT IS A MULTIPLE OF 3 For NEMSIO input:
  • WORD 1 - UNIT NUMBER OF INPUT NEMSIO-BASED GLOBAL FILE (EITHER FIRST GUESS OR ANALYSIS); ALWAYS VALID AT AT THE DATE IN IDATEP
  • WORD 2 - NOT USED, SHOULD BE A NULL FILE
IDATEP- CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH
im
jm
IDRTINTEGER GRID IDENTIFIER (IDRT=4 FOR GAUSSIAN GRID, IDRT=0 FOR EQUALLY-SPACED GRID INCLUDING POLES, IDRT=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)

Definition at line 2997 of file gblevents.f.

References gblevn11d(), and getlats().

Referenced by gblevents().

subroutine gblevn13 ( integer, dimension(2)  IUNITF,
integer  IDATEP,
integer  IMX,
integer  JMX,
integer  IDRT 
)

NetCDF Input.

Parameters
IUNITF- 2-WORD ARRAY: For SIGIO input:
  • WORD 1 - UNIT NUMBER OF FIRST INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE DATE IN IDATEP, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME PRIOR TO THE DATE IN IDATEP THAT IS A MULTIPLE OF 3
  • WORD 2 - UNIT NUMBER OF SECOND INPUT SIGIO-BASED GLOBAL (SIGMA OR HYBRID) FILE (EITHER FIRST GUESS OR ANALYSIS); IF HH IN IDATEP IS A MULTIPLE OF 3 THEN THIS FILE IS EMPTY, IF HH IN IDATEP IS NOT A MULTIPLE OF 3 THEN THIS FILE IS VALID AT THE CLOSEST TIME AFTER THE DATE IN IDATEP THAT IS A MULTIPLE OF 3 For NEMSIO input:
  • WORD 1 - UNIT NUMBER OF INPUT NEMSIO-BASED GLOBAL FILE (EITHER FIRST GUESS OR ANALYSIS); ALWAYS VALID AT AT THE DATE IN IDATEP
  • WORD 2 - NOT USED, SHOULD BE A NULL FILE
IDATEP- CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH
IMX
JMX
IDRTINTEGER GRID IDENTIFIER (IDRT=4 FOR GAUSSIAN GRID, IDRT=0 FOR EQUALLY-SPACED GRID INCLUDING POLES, IDRT=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)

Definition at line 3413 of file gblevents.f.

References gblevn11d(), and getlats().

Referenced by gblevents().

subroutine getlats (   idrt)

get latitudes

Parameters
IDRTINTEGER GRID IDENTIFIER (IDRT=4 FOR GAUSSIAN GRID, IDRT=0 FOR EQUALLY-SPACED GRID INCLUDING POLES, IDRT=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)

Definition at line 3751 of file gblevents.f.

Referenced by gblevn12(), and gblevn13().

function oefg01 (   P,
  TYP,
  IE,
  OEMIN 
)

SUBPROGRAM: OEFG01 PRGMMR: D.

A. KEYSER ORG: NP22 DATE: 2007-09-14

ABSTRACT: FUNCTION WHICH RETURNS THE OBSERVATION ERROR FOR A REQUESTED VARIABLE INTERPOLATED TO A DEFINED PRESSURE LEVEL FOR A DEFINED REPORT TYPE. IT IS OBTAINED FROM AN INPUT ARRAY CONTAINING OBSERVATION ERRORS ON FIXED PRESSURE LEVELS BY VARIABLE AND REPORT TYPE (READ EARLIER FROM THE EXTERNAL OBSERVATION ERROR TABLE)

PROGRAM HISTORY LOG: 1995-05-17 J. WOOLLEN (NP20) - ORIGINAL AUTHOR (FUNCTION OEF) 2007-09-14 D. A. KEYSER – MODIFIED TO USE EXACT LOGIC AS IN GSI (MINIMUM LIMITING VALUE FOR OBS ERROR BASED ON VARIABLE TYPE, LEVEL PRESSURE LIMITED TO MAX OF 2000 MB AND MIN OF ZERO MB, A FEW OTHER MINOR CHANGES)

USAGE: XX = OEFG01(P,TYP,IE,OEMIN) INPUT ARGUMENT LIST:

Parameters
P- REAL PRESSURE LEVEL (MB) TO INTERPOLATE OBS ERROR TO
TYP- REAL PREPBUFR REPORT TYPE
IE- VARIABLE TYPE BEING INTERPOLATED (=2 - TEMPERATURE,
  • =3 - MOISTURE, =4 - WIND, =5 - SURFACE PRESSURE, =6 -
  • PRECIPITABLE WATER)
  • (USED ONLY IN PREVENTS MODE)
OEMIN- REAL MINIMUM VALUE FOR OBS ERROR (FOR VARIABLE BEING
  • INTERPOLATED)

REMARKS: 'OEFG01' RETURNED IS OBSERVATION ERROR FOR VARIABLE "IE" IN REPORT TYPE "TYP", INTERPOLATED TO PRESSURE LEVEL "P".

ATTRIBUTES: LANGUAGE: FORTRAN 90 MACHINE: NCEP WCOSS

Definition at line 2059 of file gblevents.f.

Referenced by gblevn02(), and gblevn04().