dtcenter / MET

Model Evaluation Tools
https://dtcenter.org/community-code/model-evaluation-tools-met
Apache License 2.0
74 stars 22 forks source link

Feature #2870 removing_MISSING_warning #2872

Closed JohnHalleyGotway closed 2 months ago

JohnHalleyGotway commented 2 months ago

This PR includes the following changes:

Note the following two tweaks to the logic:

Expected Differences

Pull Request Testing

  1. Ran Gen-Ens-Prod:
    cd scripts; export TEST_OUT_DIR=../out;
    ../bin/gen_ens_prod \
    -ens MISSING \
    ../data/sample_fcst/2009123112/*gep*/d01_2009123112_02400.grib \
    MISSING/path/info /a/real/bad/path -config config/GenEnsProdConfig \
    -out ${TEST_OUT_DIR}/gen_ens_prod/gen_ens_prod_20100101_120000V_ens.nc \
    -v 3 -log gen_ens_prod.log

    Observe the following log messages... 2 DEBUG and 1 WARNING:

    DEBUG 3: process_command_line() -> cannot open input ensemble file: MISSING
    DEBUG 3: process_command_line() -> cannot open input ensemble file: MISSING/path/info
    WARNING: 
    WARNING: process_command_line() -> cannot open input ensemble file: /a/real/bad/path
    WARNING: 
  2. Ran Ensemble-Stat:
    cd scripts; export TEST_OUT_DIR=../out;
    ../bin/ensemble_stat 9 \
    /a/bad/path \
    ../data/sample_fcst/2009123112/*gep*/d01_2009123112_02400.grib \
    MISSING \
    MISSING/path/to/MISSING config/EnsembleStatConfig \
    -grid_obs ../data/sample_obs/ST4/ST4.2010010112.24h \
    -point_obs /a/real/bad/path \
    -point_obs ${TEST_OUT_DIR}/ascii2nc/precip24_2010010112.nc \
    -outdir ${TEST_OUT_DIR}/ensemble_stat \
    -v 3 -log ensemble_stat.log

    Observe the following log messages...

    WARNING:
    WARNING: process_command_line() -> cannot open input ensemble file: /a/bad/path
    WARNING:
    DEBUG 3: process_command_line() -> cannot open input ensemble file: MISSING
    DEBUG 3: process_command_line() -> cannot open input ensemble file: MISSING/path/to/MISSING
    ...
    WARNING:
    WARNING: process_point_obs() -> cannot open observation netCDF file: /a/real/bad/path
    WARNING:

    I'll note that providing a -grid_obs bad path as the first one in the list (-grid_obs /a/bath/path) does result in a runtime error. So this PR doesn't solve all the issues with bad data inputs... just the ones described in the issue.

The first 2 should produce a DEBUG(3) log message and the 3rd should still produce a warning message.

Pull Request Checklist

See the METplus Workflow for details.

JohnHalleyGotway commented 2 months ago

Note that all of the differences flagged in this testing workflow run are unrelated to these changes. They are remaining diffs from @hsoh-u recent PR that modified the UGRID output. We need to update develop-ref to move past them, but @hsoh-u is making changes to reduce the overall number of new/modified files.

egrep -i "warning|error|file1:" comp_dir.log  | egrep -B 1 ERROR | grep file1
file1: /data/output/met_test_truth/grid_stat_ugrid/grid_stat_UGRID_MPAS_DIAG_000000L_20120409_120000V.stat
file1: /data/output/met_test_truth/grid_stat_ugrid/grid_stat_UGRID_MPAS_DIAG_000000L_20120409_120000V_pairs.nc
file1: /data/output/met_test_truth/grid_stat_ugrid/grid_stat_UGRID_MPAS_OUT_TO_GRID_000000L_20120409_120000V.stat
file1: /data/output/met_test_truth/grid_stat_ugrid/grid_stat_UGRID_MPAS_OUT_TO_GRID_000000L_20120409_120000V_pairs.nc
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V.stat
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_cnt.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_ctc.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_cts.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_eclv.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_fho.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_mpr.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V.stat
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_cnt.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_ctc.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_cts.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_eclv.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_fho.txt
file1: /data/output/met_test_truth/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_mpr.txt