Skip to content

Commit

Permalink
Feature #2924 fcst climo, PR 2 of 3 (#2942)
Browse files Browse the repository at this point in the history
* Per #2924, Update the MPR and ORANK output line types to just write duplicate existing climo values, update the header tables and MPR/ORANK documentation tables.

* Per #2924, update get_n_orank_columns() logic

* Per #2924, update the Stat-Analysis parsing logic to parse the new MPR and ORANK climatology columns.

* Per #2924, making some changes to the vx_statistics library to store climo data... but more work to come. Committing this first set of changes that are incomplete but do compile.

* Per #2924, this big set of changes does compile but make test produces a segfault for ensemble-stat

* Per #2924, fix return value for is_keeper_obs()

* Per #2924, move fcst_info/obs_info into the VxPairBase pointer.

* Per #2924, update Ensemble-Stat to set the VxPairBase::fcst_info pointer

* Per #2924 udpate handling of fcst_info and obs_info pointers in Ensemble-Stat

* Per #2924, update the GSI tools to handle the new fcst climo columns.

* Per #2924, add backward compatibility logic so that when old climo column names are requested, the new ones are used.

* Per #2924, print a DEBUG(2) log message if old column names are used.

* Per #2924, switch the unit tests to reference the updated MPR column names rather than the old ones.

* Per #2924, working progress. Not fully compiling yet

* Per #2924, another round of changes. Removing MPR:FCST_CLIMO_CDF output column. This compiles but not sure if it actually runs yet

* Per #2924, work in progress

* Per #2924, work in progress. Almost compiling again.

* Per #2924, get it compiling

* Per #2924, add back in support for SCP and CDP which are interpreted as SOCP and OCDP, resp

* Per #2924, update docs about SCP and CDP threshold types

* Per #2924, minor whitespace changes

* Per #2924, fix an uninitialized pointer bug by defining/calling SeepsClimoGrid::init_from_scratch() member function. The constructor had been calling clear() to delete pointers that weren't properly initialized to nullptr. Also, simplify some map processing logic.

* Per #2924, rename SeepsAggScore from seeps to seeps_agg for clarity and to avoid conflicts in member function implementations.

* Per #2924, fix seeps compilation error in Point-Stat

* Per #2924, fix bug in the boolean logic for handling the do_climo_cdp NetCDF output option.

* Per #2924, add missing exit statement.

* Per #2924, tweak threshold.h

* Per #2924, define one perc_thresh_info entry for each enumerated PercThreshType value

* Per #2924, simplify the logic for handling percentile threshold types and print a log message once when the old versions are still used.

* Per #2924, update the string comparison return value logic

* Per #2924, fix the perc thresh string parsing logic by calling ConcatString::startswith()

* Per #2924, switch all instances of CDP to OCDP. Gen-Ens-Prod was writing NetCDF files with OCDP in the output variable names, but Grid-Stat was requesting that the wrong variable name be read. So the unit tests failed.

* Per #2924, add more doc details

* Per #2924, update default config file to indicate when climo_mean and climo_stdev can be set seperately in the fcst and obs dictionaries.

* Per #2924, update the MET tools to parse climo_mean and climo_stdev separately from the fcst and obs dictionaries.

* Per #2924, backing out new/modified columns to minimize reg test diffs

* Per #2924, one more section to be commented out later.

* Per #2924, replace several calls to strncmp() with ConcatString::startswith() to simplify the code

* Per #2924, strip out some more references to OBS_CLIMO_... in the unit tests.

* Per #2924, delete accidental file

* Per #2924 fix broken XML comments

* Per #2924, fix comments

* Per #2924, address SonarQube findings

* Per #2924, tweak a Point-Stat and Grid-Stat unit test config file to make the output more comparable to develop.

* Per #2924, fix bug in the logic of PairDataPoint and PairDataEnsemble, when looping over the 3-dim array do not return when checking the climo and fcst values. Instead we need to continue to the next loop iteration.

* Per #2924, address more SonarQube code smells to reduce the overall number in MET for this PR.

* Per #2924, correct the logic for parsing climo data from MPR lines.

* Per #2924, update MPR and ORANK line types to update/add FCST/OBS_CLIMO_MEAN/STDEV/CDF columns.

* Per #2924, cleanup grid_stat.cc source code by making calls to DataPlane::is_empty() and Grid::nxy().

* Per #2924, remove unneeded ==0

* Per #2924, working on PR2.

* Per #2924, update User's Guide with notional example of specifying climo_mean and climo_stdev separately in the fcst and obs dicts.

* Per #2924, adding a new unit test. It does NOT yet run as expected. Will debug on seneca

* Per #2924, pass the description string to the read_climo_data_plane*() function to provide better log messages

* Per #2924, more work on consistent log messages

* Per #2924, tweak the configuration to define both field, climo_mean, and climo_stdev in both the fcst and obs dictionaries

* Per #2924, tweak the unit_climatology_mixed.xml test

* Per #2924, only whitespace changes.

* Per #2924, missed swapping MET #2924 changes in 3 test files

* Per #2924, delete accidentally committed file

* Per #2924, delete accidentally committed files

* Per #2924, add support for GRIB1 time range indicator value of 123 used for the corresponding METplus Use Case. Note that there are 22 other TRI values not currently supported.
  • Loading branch information
JohnHalleyGotway authored Aug 21, 2024
1 parent 03cd070 commit e5ad6b2
Show file tree
Hide file tree
Showing 26 changed files with 498 additions and 276 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ jobs:
- jobid: 'job3'
tests: 'climatology_2.5deg'
- jobid: 'job4'
tests: 'climatology_mixed'
- jobid: 'job5'
tests: 'python point2grid plot_data_plane mode mode_analysis perc_thresh hira plot_point_obs quality_filter obs_summary duplicate_flag'
fail-fast: false
steps:
Expand Down
4 changes: 2 additions & 2 deletions data/table_files/met_header_columns_V12.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ V12.0 : STAT : FHO : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID
V12.0 : STAT : ISC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL TILE_DIM TILE_XLL TILE_YLL NSCALE ISCALE MSE ISC FENERGY2 OENERGY2 BASER FBIAS
V12.0 : STAT : MCTC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL (N_CAT) F[0-9]*_O[0-9]* EC_VALUE
V12.0 : STAT : MCTS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_CAT ACC ACC_NCL ACC_NCU ACC_BCL ACC_BCU HK HK_BCL HK_BCU HSS HSS_BCL HSS_BCU GER GER_BCL GER_BCU HSS_EC HSS_EC_BCL HSS_EC_BCU EC_VALUE
V12.0 : STAT : MPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX OBS_SID OBS_LAT OBS_LON OBS_LVL OBS_ELV FCST OBS OBS_QC CLIMO_MEAN CLIMO_STDEV CLIMO_CDF
V12.0 : STAT : MPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX OBS_SID OBS_LAT OBS_LON OBS_LVL OBS_ELV FCST OBS OBS_QC OBS_CLIMO_MEAN OBS_CLIMO_STDEV OBS_CLIMO_CDF FCST_CLIMO_MEAN FCST_CLIMO_STDEV
V12.0 : STAT : SEEPS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL S12 S13 S21 S23 S31 S32 PF1 PF2 PF3 PV1 PV2 PV3 MEAN_FCST MEAN_OBS SEEPS
V12.0 : STAT : SEEPS_MPR : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE OBS_SID OBS_LAT OBS_LON FCST OBS OBS_QC FCST_CAT OBS_CAT P1 P2 T1 T2 SEEPS
V12.0 : STAT : NBRCNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FBS FBS_BCL FBS_BCU FSS FSS_BCL FSS_BCU AFSS AFSS_BCL AFSS_BCU UFSS UFSS_BCL UFSS_BCU F_RATE F_RATE_BCL F_RATE_BCU O_RATE O_RATE_BCL O_RATE_BCU
V12.0 : STAT : NBRCTC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FY_OY FY_ON FN_OY FN_ON
V12.0 : STAT : NBRCTS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL BASER BASER_NCL BASER_NCU BASER_BCL BASER_BCU FMEAN FMEAN_NCL FMEAN_NCU FMEAN_BCL FMEAN_BCU ACC ACC_NCL ACC_NCU ACC_BCL ACC_BCU FBIAS FBIAS_BCL FBIAS_BCU PODY PODY_NCL PODY_NCU PODY_BCL PODY_BCU PODN PODN_NCL PODN_NCU PODN_BCL PODN_BCU POFD POFD_NCL POFD_NCU POFD_BCL POFD_BCU FAR FAR_NCL FAR_NCU FAR_BCL FAR_BCU CSI CSI_NCL CSI_NCU CSI_BCL CSI_BCU GSS GSS_BCL GSS_BCU HK HK_NCL HK_NCU HK_BCL HK_BCU HSS HSS_BCL HSS_BCU ODDS ODDS_NCL ODDS_NCU ODDS_BCL ODDS_BCU LODDS LODDS_NCL LODDS_NCU LODDS_BCL LODDS_BCU ORSS ORSS_NCL ORSS_NCU ORSS_BCL ORSS_BCU EDS EDS_NCL EDS_NCU EDS_BCL EDS_BCU SEDS SEDS_NCL SEDS_NCU SEDS_BCL SEDS_BCU EDI EDI_NCL EDI_NCU EDI_BCL EDI_BCU SEDI SEDI_NCL SEDI_NCU SEDI_BCL SEDI_BCU BAGSS BAGSS_BCL BAGSS_BCU
V12.0 : STAT : GRAD : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FGBAR OGBAR MGBAR EGBAR S1 S1_OG FGOG_RATIO DX DY
V12.0 : STAT : DMAP : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL FY OY FBIAS BADDELEY HAUSDORFF MED_FO MED_OF MED_MIN MED_MAX MED_MEAN FOM_FO FOM_OF FOM_MIN FOM_MAX FOM_MEAN ZHU_FO ZHU_OF ZHU_MIN ZHU_MAX ZHU_MEAN G GBETA BETA_VALUE
V12.0 : STAT : ORANK : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX OBS_SID OBS_LAT OBS_LON OBS_LVL OBS_ELV OBS PIT RANK N_ENS_VLD (N_ENS) ENS_[0-9]* OBS_QC ENS_MEAN CLIMO_MEAN SPREAD ENS_MEAN_OERR SPREAD_OERR SPREAD_PLUS_OERR CLIMO_STDEV
V12.0 : STAT : ORANK : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL INDEX OBS_SID OBS_LAT OBS_LON OBS_LVL OBS_ELV OBS PIT RANK N_ENS_VLD (N_ENS) ENS_[0-9]* OBS_QC ENS_MEAN OBS_CLIMO_MEAN SPREAD ENS_MEAN_OERR SPREAD_OERR SPREAD_PLUS_OERR OBS_CLIMO_STDEV FCST_CLIMO_MEAN FCST_CLIMO_STDEV
V12.0 : STAT : PCT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL (N_THRESH) THRESH_[0-9]* OY_[0-9]* ON_[0-9]*
V12.0 : STAT : PJC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL (N_THRESH) THRESH_[0-9]* OY_TP_[0-9]* ON_TP_[0-9]* CALIBRATION_[0-9]* REFINEMENT_[0-9]* LIKELIHOOD_[0-9]* BASER_[0-9]*
V12.0 : STAT : PRC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL (N_THRESH) THRESH_[0-9]* PODY_[0-9]* POFD_[0-9]*
Expand Down
54 changes: 41 additions & 13 deletions docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ The configuration file language supports the following data types:

.. note::

Prior to MET version 12.0.0, forecast climatological inputs were not
supported. The observation climatological inputs were used to process
threshold types named "SCP" and "CDP".
Prior to MET version 12.0.0, forecast climatological inputs were not
supported. The observation climatological inputs were used to process
threshold types named "SCP" and "CDP".

For backward compatibility, the "SCP" threshold type is processed the same
as "SOCP" and "CDP" the same as "OCDP".
For backward compatibility, the "SCP" threshold type is processed the same
as "SOCP" and "CDP" the same as "OCDP".

Users are encouraged to replace the deprecated "SCP" and "CDP" threshold
types with the updated "SOCP" and "OCDP" types, respectively.
Users are encouraged to replace the deprecated "SCP" and "CDP" threshold
types with the updated "SOCP" and "OCDP" types, respectively.

* Piecewise-Linear Function (currently used only by MODE):

Expand Down Expand Up @@ -324,8 +324,10 @@ To run this utility:
-e EXISTING_FILE, --existing=EXISTING_FILE
Save the text into the named file (optional, default: ../../../data/table_files/ndbc_stations.xml)
NOTE: The downloaded files are written to a subdirectory ndbc_temp_data which
can be deleted once the final output file is created.
.. note::

The downloaded files are written to a subdirectory ndbc_temp_data which
can be deleted once the final output file is created.

MET_BASE
--------
Expand Down Expand Up @@ -1508,8 +1510,11 @@ the climatology file names and fields to be used.
with 6 and 12 being common choices. Use "NA" if the timing of the
climatology data should not be checked.

* The "day_interval" and "hour_interval" entries replace the deprecated
entries "match_month", "match_day", and "time_step".
.. note::

As of MET version 11.0.0, the "day_interval" and "hour_interval" entries
replace the "match_month", "match_day", and "time_step" entries, which are
now deprecated.

.. code-block:: none
Expand Down Expand Up @@ -1563,6 +1568,27 @@ over the "climo_mean" setting and then updating the "file_name" entry.
file_name = [ "/path/to/climatological/standard/deviation/files" ];
}
Prior to MET version 12.0.0, forecast climatological inputs were not supported.
If the "climo_mean" and "climo_stdev" dictionaries are defined at the top-level
configuration file context, the same data is used for both the forecast and
observation climatologies. To specify separate forecast and observation
climatologies, define "climo_mean" and "climo_stdev" inside the "fcst" and "obs"
dictionaries, as shown below.

.. code-block:: none
fcst = {
field = [ ... ];
climo_mean = { ... };
climo_stdev = { ... };
}
obs = {
field = [ ... ];
climo_mean = { ... };
climo_stdev = { ... };
}
climo_cdf
---------

Expand Down Expand Up @@ -2297,8 +2323,10 @@ For example:
| nc_pairs_var_suffix = "FREEZING"; (for the freezing level height)
|
NOTE: This option was previously named "nc_pairs_var_str", which is
now deprecated.
.. note::

Prior to MET version 9.0.0, this option was named "nc_pairs_var_str",'
which is now deprecated.

.. code-block:: none
Expand Down
4 changes: 3 additions & 1 deletion docs/Users_Guide/grid-diag.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ The following sections describe the usage statement, required arguments, and opt
[-v level]
[-compress level]
NOTE: The "-data" option can be used once to read all fields from each input file or once for each field to be processed.
.. note::

The "-data" option can be used once to read all fields from each input file or once for each field to be processed.

grid_diag has required arguments and can accept several optional arguments.

Expand Down
2 changes: 1 addition & 1 deletion docs/Users_Guide/mode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ The contents of the columns in this ASCII file are summarized in :numref:`MODE_o
* - 50
- AREA_RATIO
- The forecast object area divided by the observation object area (unitless) :raw-html:`<br />`
**NOTE:** Prior to met-10.0.0, defined as the lesser of the two object areas divided by the greater of the two
**NOTE:** Prior to MET version 10.0.0, the AREA_RATIO was defined as the lesser of the two object areas divided by the greater of the two.
* - 51
- INTERSECTION :raw-html:`<br />` \_AREA
- Intersection area of two objects (in grid squares)
Expand Down
1 change: 1 addition & 0 deletions internal/test_unit/bin/unit_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ UNIT_XML="unit_ascii2nc.xml \
unit_climatology_1.0deg.xml \
unit_climatology_1.5deg.xml \
unit_climatology_2.5deg.xml \
unit_climatology_mixed.xml \
unit_grib_tables.xml \
unit_grid_weight.xml \
unit_netcdf.xml \
Expand Down
Loading

0 comments on commit e5ad6b2

Please sign in to comment.