Skip to content

Commit

Permalink
Changed all filename template tags for datetime objects (init/valid/d…
Browse files Browse the repository at this point in the history
…a_init/etc.) to use %H instead of %2H. We discovered that Python 3.6.8 interprets %2H as the same as %H (correctly substituting the hour), however Python 3.8.8 interprets %2H as 2H. The number in between the % and letter is not supported by strftime so it is not valid for these datetime values. The logic to zero-pad using this notation was written in the METplus string substitution logic and only applies to lead and level template tags. ci-run-all-diff
  • Loading branch information
georgemccabe committed Mar 8, 2022
1 parent 2347682 commit 419e91d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion parm/use_cases/met_tool_wrapper/Example/Example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ EXAMPLE_INPUT_DIR = /dir/containing/example/data
[filename_templates]
# Fake template to use to look for input data. This template is substituted with the time information of each
# run time that is executed
EXAMPLE_INPUT_TEMPLATE = {init?fmt=%Y%m%d}/file_{init?fmt=%Y%m%d}_{init?fmt=%2H}_F{lead?fmt=%3H}.{custom?fmt=%s}
EXAMPLE_INPUT_TEMPLATE = {init?fmt=%Y%m%d}/file_{init?fmt=%Y%m%d}_{init?fmt=%H}_F{lead?fmt=%3H}.{custom?fmt=%s}
2 changes: 1 addition & 1 deletion parm/use_cases/met_tool_wrapper/PB2NC/PB2NC.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PB2NC_OFFSETS = 12
PB2NC_SKIP_IF_OUTPUT_EXISTS = True

PB2NC_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_obs/prepbufr
PB2NC_INPUT_TEMPLATE = ndas.t{da_init?fmt=%2H}z.prepbufr.tm{offset?fmt=%2H}.{da_init?fmt=%Y%m%d}.nr
PB2NC_INPUT_TEMPLATE = ndas.t{da_init?fmt=%H}z.prepbufr.tm{offset?fmt=%2H}.{da_init?fmt=%Y%m%d}.nr

PB2NC_OUTPUT_DIR = {OUTPUT_BASE}/pb2nc
PB2NC_OUTPUT_TEMPLATE = sample_pb.nc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ PLOT_DATA_PLANE_OUTPUT_DIR =
[filename_templates]

# Template to look for input to PlotDataPlane relative to PLOT_DATA_PLANE_INPUT_DIR
PLOT_DATA_PLANE_INPUT_TEMPLATE = {INPUT_BASE}/met_test/data/sample_fcst/{valid?fmt=%Y%m%d%H}/nam.t{valid?fmt=%2H}z.awip1236.tm00.{valid?fmt=%Y%m%d}.grb
PLOT_DATA_PLANE_INPUT_TEMPLATE = {INPUT_BASE}/met_test/data/sample_fcst/{valid?fmt=%Y%m%d%H}/nam.t{valid?fmt=%H}z.awip1236.tm00.{valid?fmt=%Y%m%d}.grb

# Template to use to write output from PlotDataPlane
PLOT_DATA_PLANE_OUTPUT_TEMPLATE = {OUTPUT_BASE}/met_tool_wrapper/plot_data_plane/nam.t00z.awip1236.tm{valid?fmt=%2H}.{valid?fmt=%Y%m%d}_TMPZ2.ps
PLOT_DATA_PLANE_OUTPUT_TEMPLATE = {OUTPUT_BASE}/met_tool_wrapper/plot_data_plane/nam.t00z.awip1236.tm{valid?fmt=%H}.{valid?fmt=%Y%m%d}_TMPZ2.ps
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ENSEMBLE_STAT_OUTPUT_DIR = {OUTPUT_BASE}/model_applications/convection_allowing_
[filename_templates]

# input and output templates for pb2nc
PB2NC_INPUT_TEMPLATE = {da_init?fmt=%Y%m%d}/{da_init?fmt=%Y%j%H%M}.rap.t{da_init?fmt=%2H}z.prepbufr.tm{offset?fmt=%2H}.{da_init?fmt=%Y%m%d}
PB2NC_INPUT_TEMPLATE = {da_init?fmt=%Y%m%d}/{da_init?fmt=%Y%j%H%M}.rap.t{da_init?fmt=%H}z.prepbufr.tm{offset?fmt=%2H}.{da_init?fmt=%Y%m%d}

PB2NC_OUTPUT_TEMPLATE = {valid?fmt=%Y%m%d}/{valid?fmt=%Y%m%d%H}.rap.nc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ OBS_POINT_STAT_INPUT_DIR = {PB2NC_OUTPUT_DIR}
POINT_STAT_OUTPUT_DIR = {OUTPUT_BASE}/{OBTYPE}

[filename_templates]
PB2NC_INPUT_TEMPLATE = nam.{da_init?fmt=%Y%m%d}/nam.t{da_init?fmt=%2H}z.prepbufr.tm{offset?fmt=%2H}
PB2NC_INPUT_TEMPLATE = nam.{da_init?fmt=%Y%m%d}/nam.t{da_init?fmt=%H}z.prepbufr.tm{offset?fmt=%2H}

PB2NC_OUTPUT_TEMPLATE = {valid?fmt=%Y%m%d}/nam.{valid?fmt=%Y%m%d%H}.nc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ PB2NC_OFFSETS = 0, 12
PB2NC_SKIP_IF_OUTPUT_EXISTS = True

PB2NC_INPUT_DIR = {INPUT_BASE}/model_applications/precipitation/PointStat_fcstMULTI_obsMETAR_PtypeComparisons
PB2NC_INPUT_TEMPLATE = nam.{valid?fmt=%Y%m%d}.t{valid?fmt=%2H}z.prepbufr.tm00
PB2NC_INPUT_TEMPLATE = nam.{valid?fmt=%Y%m%d}.t{valid?fmt=%H}z.prepbufr.tm00

PB2NC_OUTPUT_DIR = {OUTPUT_BASE}/model_applications/precipitation
PB2NC_OUTPUT_TEMPLATE = nam.obsfile_sfc_prwe.{valid?fmt=%m%d%Y}_{valid?fmt=%2H}z.nc
PB2NC_OUTPUT_TEMPLATE = nam.obsfile_sfc_prwe.{valid?fmt=%m%d%Y}_{valid?fmt=%H}z.nc


PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NCConfig_wrapped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ FCST_IS_PROB = false
# Increase verbosity of MET tools
#LOG_MET_VERBOSITY=4

GRID_STAT_OUTPUT_PREFIX = {MODEL}-hindcast_{CURRENT_OBS_NAME}_vs_{OBTYPE}_IC{init?fmt=%Y%b}_V{valid?fmt=%Y%2m%d}
GRID_STAT_OUTPUT_PREFIX = {MODEL}-hindcast_{CURRENT_OBS_NAME}_vs_{OBTYPE}_IC{init?fmt=%Y%b}_V{valid?fmt=%Y%m%d}

# sets the desc variable in the SeriesAnalysis config file
SERIES_ANALYSIS_DESC = hindcast
Expand Down Expand Up @@ -137,12 +137,12 @@ SERIES_ANALYSIS_CLIMO_MEAN_INPUT_DIR =

# format of filenames
# FCST
FCST_GRID_STAT_INPUT_TEMPLATE = nmme_pr_hcst_{init?fmt=%b}IC_{valid?fmt=%2m}_*.nc
FCST_GRID_STAT_INPUT_TEMPLATE = nmme_pr_hcst_{init?fmt=%b}IC_{valid?fmt=%m}_*.nc

# ANLYS
OBS_GRID_STAT_INPUT_TEMPLATE = obs_cpc_pp.1x1.nc

BOTH_SERIES_ANALYSIS_INPUT_TEMPLATE = grid_stat_{MODEL}-hindcast_precip_vs_{OBTYPE}_IC{init?fmt=%Y%b}_V{valid?fmt=%Y%2m}01_*pairs.nc
BOTH_SERIES_ANALYSIS_INPUT_TEMPLATE = grid_stat_{MODEL}-hindcast_precip_vs_{OBTYPE}_IC{init?fmt=%Y%b}_V{valid?fmt=%Y%m}01_*pairs.nc

SERIES_ANALYSIS_OUTPUT_TEMPLATE = series_analysis_{MODEL}_{OBTYPE}_stats_F{lead?fmt=%2m}_{instance?fmt=%s}.nc

Expand Down

0 comments on commit 419e91d

Please sign in to comment.