diff --git a/internal/tests/pytests/util/run_util/test_run_util.py b/internal/tests/pytests/util/run_util/test_run_util.py index 661d106c56..6815e0b9d2 100644 --- a/internal/tests/pytests/util/run_util/test_run_util.py +++ b/internal/tests/pytests/util/run_util/test_run_util.py @@ -48,6 +48,8 @@ 'METPLUS_BASE', 'PARM_BASE', 'METPLUS_VERSION', + 'ALLOW_MISSING_INPUTS', + 'INPUT_THRESH', ] diff --git a/metplus/wrappers/extract_tiles_wrapper.py b/metplus/wrappers/extract_tiles_wrapper.py index 141cb225f7..641bbcfc14 100755 --- a/metplus/wrappers/extract_tiles_wrapper.py +++ b/metplus/wrappers/extract_tiles_wrapper.py @@ -212,6 +212,7 @@ def run_at_time_once(self, time_info): location_input = self.c_dict.get('LOCATION_INPUT') input_path = self.get_location_input_file(time_info, location_input) if not input_path: + self.missing_input_count += 1 return # get unique storm ids or object cats from the input file diff --git a/metplus/wrappers/pcp_combine_wrapper.py b/metplus/wrappers/pcp_combine_wrapper.py index 77b5b0b823..8fce625291 100755 --- a/metplus/wrappers/pcp_combine_wrapper.py +++ b/metplus/wrappers/pcp_combine_wrapper.py @@ -537,6 +537,7 @@ def setup_derive_method(self, time_info, lookback, data_src): data_type=data_src, return_list=True) if not input_files: + self.missing_input_count += 1 return None files_found = [] diff --git a/metplus/wrappers/runtime_freq_wrapper.py b/metplus/wrappers/runtime_freq_wrapper.py index d4673c3712..ef40128fc5 100755 --- a/metplus/wrappers/runtime_freq_wrapper.py +++ b/metplus/wrappers/runtime_freq_wrapper.py @@ -38,6 +38,8 @@ class RuntimeFreqWrapper(CommandBuilder): def __init__(self, config, instance=None): super().__init__(config, instance=instance) + self.run_count = 0 + self.missing_input_count = 0 def create_c_dict(self): c_dict = super().create_c_dict() @@ -59,6 +61,13 @@ def create_c_dict(self): ) self.validate_runtime_freq(c_dict) + # check if missing inputs are allowed and threshold of missing inputs + name = 'ALLOW_MISSING_INPUTS' + c_dict[name] = self.get_wrapper_or_generic_config(name, 'bool') + if c_dict[name]: + name = 'INPUT_THRESH' + c_dict[name] = self.get_wrapper_or_generic_config(name, 'float') + return c_dict def validate_runtime_freq(self, c_dict): @@ -195,6 +204,7 @@ def run_once(self, custom): return None self.clear() + self.run_count += 1 return self.run_at_time_once(time_info) def run_once_per_init_or_valid(self, custom): @@ -222,6 +232,7 @@ def run_once_per_init_or_valid(self, custom): self.c_dict['ALL_FILES'] = self.get_all_files_from_leads(time_info) self.clear() + self.run_count += 1 if not self.run_at_time_once(time_info): success = False @@ -253,6 +264,7 @@ def run_once_per_lead(self, custom): self.c_dict['ALL_FILES'] = self.get_all_files_for_lead(time_info) self.clear() + self.run_count += 1 if not self.run_at_time_once(time_info): success = False @@ -307,6 +319,7 @@ def run_at_time(self, input_dict): # Run for given init/valid time and forecast lead combination self.clear() + self.run_count += 1 if not self.run_at_time_once(time_info): success = False diff --git a/parm/metplus_config/defaults.conf b/parm/metplus_config/defaults.conf index ba67ccd233..4d27e017a9 100644 --- a/parm/metplus_config/defaults.conf +++ b/parm/metplus_config/defaults.conf @@ -65,6 +65,10 @@ GFDL_TRACKER_EXEC = /path/to/standalone_gfdl-vortextracker_v3.9a/trk_exec # that value will be used instead of the value set in this file. # # * SCRUB_STAGING_DIR removes intermediate files generated by a METplus run # # Set to False to preserve these files # +# * ALLOW_MISSING_INPUTS determines if an error should be reported if input # +# files are not found, or if a warning should be reported instead # +# * INPUT_THRESH specifies the percentage (0-1) of inputs that must be # +# found to prevent an error (only used if ALLOW_MISSING_INPUTS=True) # ############################################################################### PROCESS_LIST = Usage @@ -73,6 +77,9 @@ OMP_NUM_THREADS = 1 SCRUB_STAGING_DIR = True +ALLOW_MISSING_INPUTS = False +INPUT_THRESH = 0.0 + ############################################################################### # Log File Information (Where to write logs files) #