gblevents
1.12.0
|
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... | |
Pre/Post processing of of prepbufr events.
Definition in file gblevents.f.
module gblevn_module |
Definition at line 3 of file gblevents.f.
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:
IDATEP | - CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH |
IUNITF | - 2-WORD ARRAY: For SIGIO input:
|
IUNITE | - UNIT NUMBER OF INPUT OBSERVATION ERROR FILE
|
IUNITP | - UNIT NUMBER OF OUTPUT PREPBUFR DATA SET |
IUNITS | - UNIT NUMBER OF "PREVENT" EVENTS DATA FILTERING
|
SUBSET | - THE BUFR MESSAGE TABLE A ENTRY FOR THE PARTICULAR
|
NEWTYP | - INDICATOR IF THE BUFR MESSAGE TABLE A ENTRY HAS
|
INPUT FILES:
OUTPUT FILES:
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:
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
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.
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.
IUNITP | - UNIT NUMBER OF OUTPUT PREPBUFR DATA SET |
IUNITS | - UNIT NUMBER OF "PREVENT" EVENTS DATA FILTERING
|
SUBSET | - THE BUFR MESSAGE TABLE A ENTRY FOR THE PARTICULAR
|
NEWTYP | - INDICATOR IF THE BUFR MESSAGE TABLE A ENTRY HAS
|
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.
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:
IUNITP | - BUFR OUTPUT FILE UNIT |
SUBSET | - THE BUFR MESSAGE TABLE A ENTRY FOR THE PARTICULAR
|
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 2207 of file gblevents.f.
Referenced by gblevents().
subroutine gblevn10 | ( | integer, dimension(2) | IUNITF, |
integer | IDATEP, | ||
integer | IM, | ||
integer | JM, | ||
integer | IDRT | ||
) |
Do something.
IUNITF | - 2-WORD ARRAY: For SIGIO input:
|
IDATEP | - CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH |
im | |
jm | |
IDRT | INTEGER 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 2479 of file gblevents.f.
References gblevn11().
Referenced by gblevents().
subroutine gblevn11 | ( | integer | imax, |
integer | jmax, | ||
real, dimension(imax,jmax) | grid | ||
) |
subroutine gblevn11d | ( | integer | imax, |
integer | jmax, | ||
real(kind=8), dimension(imax,jmax) | grid | ||
) |
Does something.
Definition at line 2948 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.
iunitf | |
idatep | |
im | |
jm | |
IUNITF | - 2-WORD ARRAY: For SIGIO input:
|
IDATEP | - CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH |
im | |
jm | |
IDRT | INTEGER 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 2998 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.
IUNITF | - 2-WORD ARRAY: For SIGIO input:
|
IDATEP | - CENTER DATE FOR PREPBUFR FILE IN THE FORM YYYYMMDDHH |
IMX | |
JMX | |
IDRT | INTEGER 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 3414 of file gblevents.f.
References gblevn11d(), and getlats().
Referenced by gblevents().
subroutine getlats | ( | idrt | ) |
get latitudes
IDRT | INTEGER 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 3752 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:
P | - REAL PRESSURE LEVEL (MB) TO INTERPOLATE OBS ERROR TO |
TYP | - REAL PREPBUFR REPORT TYPE |
IE | - VARIABLE TYPE BEING INTERPOLATED (=2 - TEMPERATURE,
|
OEMIN | - REAL MINIMUM VALUE FOR OBS ERROR (FOR VARIABLE BEING
|
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 2060 of file gblevents.f.
Referenced by gblevn02(), and gblevn04().