diff --git a/.github/workflows/test_suite.yml b/.github/workflows/code_tests.yml similarity index 86% rename from .github/workflows/test_suite.yml rename to .github/workflows/code_tests.yml index acc0d411..8ded49cb 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/code_tests.yml @@ -1,4 +1,4 @@ -name: Swell Test Suite +name: Swell Code Testing on: push: @@ -12,7 +12,7 @@ on: jobs: testsuite: - name: Run swell test suite + name: Run swell coding testing runs-on: ubuntu-latest steps: @@ -49,6 +49,6 @@ jobs: - name: Put swell in the path run: echo "$HOME/.local/bin" >> $GITHUB_PATH - # Run the swell test suite - - name: Run swell test suite - run: swell_test_suite + # Run the swell code tests + - name: Run swell code tests + run: swell_tests_code diff --git a/setup.py b/setup.py index 26faecca..df7173aa 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,7 @@ 'suites/*/*', 'suites/*/*/*', 'tasks/task_questions.yaml', + 'test/suite_tests/*.yaml', 'configuration/*', 'configuration/*/*', 'configuration/*/*/*', @@ -60,7 +61,7 @@ 'swell_util_task_question_dicts = swell.utilities.bin.task_question_dicts:tq_dicts', 'swell_util_task_question_dicts_defaults = \ swell.utilities.bin.task_question_dicts_defaults:tq_dicts_defaults', - 'swell_test_suite = swell.test.test_suite:main', + 'swell_tests_code = swell.test.code_tests.code_tests:main', ], }, ) diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_aqua.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_aqua.yaml index 2d97b3b6..7e789975 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_aqua.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_aqua.yaml @@ -78,7 +78,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: 1-15 diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-a.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-a.yaml index 95ec60d6..f028fd5a 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-a.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-a.yaml @@ -80,7 +80,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: 1-15 diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-b.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-b.yaml index f86d2ef0..b5b50dee 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-b.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-b.yaml @@ -80,7 +80,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: 1-15 diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-c.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-c.yaml index 3e4e2939..a240487a 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-c.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_metop-c.yaml @@ -80,7 +80,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: 1-15 diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n15.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n15.yaml index bb2264a0..e347c56d 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n15.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n15.yaml @@ -80,7 +80,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: 1-15 diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n18.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n18.yaml index 4dfdd00b..4f7ece85 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n18.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n18.yaml @@ -80,7 +80,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: 1-15 diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n19.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n19.yaml index 6230551a..0b0a0e30 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n19.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/amsua_n19.yaml @@ -80,7 +80,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: 1-15 diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_n20.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_n20.yaml index 4d7ec8b4..145f076c 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_n20.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_n20.yaml @@ -78,7 +78,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: atms_n20_channels diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_npp.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_npp.yaml index 62be3a1c..37732705 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_npp.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/atms_npp.yaml @@ -78,7 +78,7 @@ obs filters: action: name: reject # Assign obs error - - filter: Bounds Check + - filter: Perform Action filter variables: - name: brightnessTemperature channels: atms_npp_channels diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/ompslpnc_npp.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/ompslpnc_npp.yaml deleted file mode 100644 index 8da30580..00000000 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/observations/ompslpnc_npp.yaml +++ /dev/null @@ -1,32 +0,0 @@ -obs space: - name: ompslpnc_npp - obsdatain: - engine: - type: H5File - obsfile: '{{cycle_dir}}/ompslpnc_npp.{{window_begin}}.nc4' - obsdataout: - engine: - type: H5File - obsfile: '{{cycle_dir}}/{{experiment_id}}.ompslpnc_npp.{{window_begin}}.nc4' - simulated variables: [ozoneTotal] -obs operator: - name: VertInterp - vertical coordinate: ["air_pressure"] - geovals: [mole_fraction_of_ozone_in_air] - observation alias file: '{{experiment_root}}/{{experiment_id}}/configuration/jedi/interfaces/{{model_component}}/observations/obsop_name_map.yaml' -obs filters: - # range sanity check - - filter: Bounds Check - filter variables: - - name: ozoneTotal - minvalue: 0 - maxvalue: 10000 - action: - name: reject - # threshold is really threshold*observation error (threshold= relative threshold) - - filter: Background Check - filter variables: - - name: ozoneTotal - threshold: 5.0 - action: - name: reject diff --git a/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml b/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml index 86d315c2..cc9844cd 100644 --- a/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_atmosphere/task_questions.yaml @@ -18,7 +18,7 @@ background_error_model: - GSIbec background_experiment: - default_value: x0044 + default_value: x0048 background_frequency: default_value: PT1H @@ -32,10 +32,6 @@ clean_patterns: - '*.txt' - logfile.*.out -forecast_duration: - default_value: - - PT6H - geos_background_restart_offset: default_value: TODO @@ -46,7 +42,7 @@ geos_bkg_tar_filename_template: default_value: TODO geovals_experiment: - default_value: x0044_test_obs_filters_geovals + default_value: x0048-geovals geovals_provider: default_value: ncdiag @@ -55,9 +51,9 @@ gradient_norm_reduction: default_value: 10e-5 horizontal_resolution: - default_value: C361 + default_value: '361' options: - - C361 + - '361' jedi_bkg_filename_template: default_value: TODO @@ -79,10 +75,11 @@ npy_proc: default_value: 2 number_of_iterations: - default_value: 50 + default_value: + - 50 obs_experiment: - default_value: x0044_v3 + default_value: x0048 obs_provider: default_value: ncdiag @@ -90,31 +87,67 @@ obs_provider: observations: default_value: - aircraft - - amsua_n19 + - gps + - satwind + - scatwind + - sfcship + - sfc + - sondes + - airs_aqua + - amsr2_gcom-w1 - amsua_aqua - - amsua_metop-a - amsua_metop-b - amsua_metop-c - amsua_n15 - amsua_n18 - amsua_n19 + - atms_n20 + - atms_npp + - avhrr3_metop-b + - avhrr3_n18 + - avhrr3_n19 + - cris-fsr_n20 + - cris-fsr_npp - gmi_gpm - - amsr2_gcom-w1 + - iasi_metop-b + - iasi_metop-c + - mhs_metop-b + - mhs_metop-c + - mhs_n19 + - ssmis_f17 - mls55_aura - omi_aura - ompsnm_npp options: - aircraft - - amsua_n19 + - gps + - satwind + - scatwind + - sfcship + - sfc + - sondes + - airs_aqua + - amsr2_gcom-w1 - amsua_aqua - - amsua_metop-a - amsua_metop-b - amsua_metop-c - amsua_n15 - amsua_n18 - amsua_n19 + - atms_n20 + - atms_npp + - avhrr3_metop-b + - avhrr3_n18 + - avhrr3_n19 + - cris-fsr_n20 + - cris-fsr_npp - gmi_gpm - - amsr2_gcom-w1 + - iasi_metop-b + - iasi_metop-c + - mhs_metop-b + - mhs_metop-c + - mhs_n19 + - ssmis_f17 - mls55_aura - omi_aura - ompsnm_npp @@ -123,12 +156,10 @@ path_to_geos_adas_background: default_value: /discover/nobackup/drholdaw/SwellTestData/geosadas/bkg/*bkg_clcv_rst* path_to_gsi_bc_coefficients: - default_value: - - /discover/nobackup/drholdaw/SwellTestData/geosadas/bc + default_value: /discover/nobackup/drholdaw/SwellTestData/ufo_testing/bc/2021121200 path_to_gsi_nc_diags: - default_value: - - /discover/nobackup/drholdaw/SwellTestData/geosadas/obs + default_value: /discover/nobackup/drholdaw/SwellTestData/ufo_testing/ncdiag/2021121200 produce_geovals: default_value: true @@ -142,9 +173,9 @@ static_background_error_model: - GSIbec vertical_resolution: - default_value: 72 + default_value: '72' options: - - 72 + - '72' window_length: default_value: PT6H @@ -152,3 +183,5 @@ window_length: window_offset: default_value: PT3H +window_type: + default_value: '4D' diff --git a/src/swell/configuration/jedi/interfaces/geos_ocean/suite_questions.yaml b/src/swell/configuration/jedi/interfaces/geos_ocean/suite_questions.yaml index a7abb26b..f29c4a4c 100644 --- a/src/swell/configuration/jedi/interfaces/geos_ocean/suite_questions.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_ocean/suite_questions.yaml @@ -1,3 +1,3 @@ cycle_times: default_value: ['T00', 'T12'] - options: ['T00', 'T06', 'T12', 'T18'] + options: ['T00', 'T12'] diff --git a/src/swell/configuration/jedi/interfaces/geos_ocean/task_questions.yaml b/src/swell/configuration/jedi/interfaces/geos_ocean/task_questions.yaml index 4739701f..7df43215 100644 --- a/src/swell/configuration/jedi/interfaces/geos_ocean/task_questions.yaml +++ b/src/swell/configuration/jedi/interfaces/geos_ocean/task_questions.yaml @@ -29,10 +29,6 @@ clean_patterns: - '*MOM*' - logfile.*.out -forecast_duration: - default_value: - - P1D - gradient_norm_reduction: default_value: 1e-10 @@ -53,7 +49,8 @@ minimizer: - RPCG number_of_iterations: - default_value: 5 + default_value: + - 5 obs_experiment: default_value: s2s @@ -80,9 +77,9 @@ total_processors: default_value: 24 vertical_resolution: - default_value: 75 + default_value: '75' options: - - 75 + - '75' window_length: default_value: PT12H @@ -90,3 +87,6 @@ window_length: window_offset: default_value: PT6H +window_type: + default_value: '3D' + diff --git a/src/swell/deployment/bin/swell_create_experiment.py b/src/swell/deployment/bin/swell_create_experiment.py index 3dcb24c5..9ec2fc90 100644 --- a/src/swell/deployment/bin/swell_create_experiment.py +++ b/src/swell/deployment/bin/swell_create_experiment.py @@ -30,9 +30,8 @@ @click.command() -@click.option('-c', '--config', 'config', default=None, help='Path to configuration file for the ' + - 'experiment. If not passed questions will be presented for setting up an experiment.') -def main(config): +@click.argument('config_file') +def main(config_file): # Welcome message # --------------- @@ -42,13 +41,6 @@ def main(config): # --------------- logger = Logger('SwellCreateExperiment') - # Generate the configuration file - # ------------------------------- - if config is None: - config_file = prepare_config('cli', 'hofx', 'nccs_discover') - else: - config_file = config - # Load experiment file # -------------------- with open(config_file, 'r') as ymlfile: @@ -60,7 +52,6 @@ def main(config): experiment_root = dict_get(logger, experiment_dict, 'experiment_root') platform = dict_get(logger, experiment_dict, 'platform', None) suite_to_run = dict_get(logger, experiment_dict, 'suite_to_run') - model_components = dict_get(logger, experiment_dict, 'model_components', None) # Make the suite directory # ------------------------ @@ -77,13 +68,13 @@ def main(config): swell_suite_path = os.path.join(get_swell_path(), 'suites', suite_to_run) copy_platform_files(logger, exp_suite_path, platform) - if model_components is not None: - copy_eva_files(logger, swell_suite_path, exp_suite_path, model_components) + if os.path.exists(os.path.join(swell_suite_path, 'eva')): + copy_eva_files(logger, swell_suite_path, exp_suite_path) # Create R2D2 database file # ------------------------- - data_assimilation_run = dict_get(logger, experiment_dict, 'data_assimilation_run', False) - if data_assimilation_run: + r2d2_local_path = dict_get(logger, experiment_dict, 'r2d2_local_path', None) + if r2d2_local_path is not None: r2d2_conf_path = os.path.join(exp_suite_path, 'r2d2_config.yaml') # Write R2D2_CONFIG to modules diff --git a/src/swell/deployment/bin/swell_prepare_config.py b/src/swell/deployment/bin/swell_prepare_config.py index 7a9dd329..9e831fd8 100644 --- a/src/swell/deployment/bin/swell_prepare_config.py +++ b/src/swell/deployment/bin/swell_prepare_config.py @@ -27,8 +27,10 @@ 'platform specific defaults.') @click.option('-o', '--override', 'override', default=None, help='After generating the config ' + 'file parameters inside can be overridden using value from the override config file.') +@click.option('-t', '--test', 'test', default=None, help='Override defaults with a preprepared ' + + 'test config file.') @click.argument('suite') -def main(input_method, suite, platform, override): +def main(input_method, suite, platform, override, test): """ SUITE argument determines which set of tasks are going to be run. """ @@ -39,7 +41,7 @@ def main(input_method, suite, platform, override): # Create suites object # -------------------- - prepare_config(input_method, suite, platform, override) + prepare_config(input_method, suite, platform, override, test) # -------------------------------------------------------------------------------------------------- diff --git a/src/swell/deployment/platforms/nccs_discover/task_questions.yaml b/src/swell/deployment/platforms/nccs_discover/task_questions.yaml index f8207772..4451ebf5 100644 --- a/src/swell/deployment/platforms/nccs_discover/task_questions.yaml +++ b/src/swell/deployment/platforms/nccs_discover/task_questions.yaml @@ -14,12 +14,10 @@ existing_jedi_source_directory: default_value: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/ geos_experiment_directory: - default_value: - - /discover/nobackup/drholdaw/SwellStaticFiles/geos/run_dirs/5deg_v11 + default_value: 5deg_v11 geos_restarts_directory: - default_value: - - /discover/nobackup/drholdaw/SwellStaticFiles/geos/restarts/restarts_20210620_000000 + default_value: restarts_20210620_000000 swell_static_files: default_value: /discover/nobackup/drholdaw/SwellStaticFiles diff --git a/src/swell/deployment/prep_config.py b/src/swell/deployment/prep_config.py index 6d9b5f41..eba1675e 100644 --- a/src/swell/deployment/prep_config.py +++ b/src/swell/deployment/prep_config.py @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------------------------------- +import copy import datetime import os import importlib @@ -15,13 +16,34 @@ from swell.utilities.logger import Logger from swell.swell_path import get_swell_path -from swell.utilities.dictionary import dict_get, add_comments_to_dictionary +from swell.utilities.dictionary import dict_get, add_comments_to_dictionary, dictionary_override # -------------------------------------------------------------------------------------------------- -def prepare_config(method, suite, platform, override): +def update_model_components(logger, experiment_dict, comment_dict): + + if 'models' in experiment_dict: + model_components_wanted = copy.copy(experiment_dict['model_components']) + model_components_actual = list(experiment_dict['models'].keys()) + + # If models element of experiment dictionary contains anything not in + # model_components_actual then remove it from model + for model in model_components_actual: + if model not in model_components_wanted: + logger.info(f'Removing model {model} from model_components') + del(experiment_dict['models'][model]) + # Loop over all elements of the comment dictionay and remove any redundant keys + for key in list(comment_dict.keys()): + if 'models.'+model in key: + del(comment_dict[key]) + + +# -------------------------------------------------------------------------------------------------- + + +def prepare_config(method, suite, platform, override, test): # Create a logger # --------------- @@ -70,36 +92,51 @@ def prepare_config(method, suite, platform, override): experiment_dict_string = os.path.expandvars(experiment_dict_string) experiment_dict = yaml.safe_load(experiment_dict_string) - # Override config with kay value pairs coming from override YAML + # Point to a particular pre-existing dictionary used for testing # -------------------------------------------------------------- - if override is not None: + if test is not None: + + # Method must be defaults if specifying test + logger.assert_abort(method == 'defaults', + f'If specifying a test override, the input method must be \'defaults\'') + + # Set an override to the test file + test_override_file = os.path.join(get_swell_path(), 'test', 'suite_tests', suite + '-' + + test + '.yaml') + + # Check that the test file choice is valid + logger.assert_abort(os.path.exists(test_override_file), f'Requested test \'{test}\' does ' + + f'not exist. Expected file is \'{test_override_file}\'') - # Open override dictionary - with open(override, 'r') as override_open: - override_dict = yaml.safe_load(override_open) + # Open the override file + with open(test_override_file, 'r') as file: + test_override_dict = yaml.safe_load(file) - # List of keys that are allowed to be overridden - overridable_keys = [ - 'experiment_id', - 'experiment_root', - 'existing_jedi_source_directory', - 'existing_jedi_build_directory' - ] + # Perform the override + logger.info(f'Overriding the experiment dictionary using suite test \'{test}\'') + dictionary_override(logger, experiment_dict, test_override_dict) + + # Update model components in case the test override changed which are turned on + # ----------------------------------------------------------------------------- + update_model_components(logger, experiment_dict, comment_dict) + + # Optionally override dictionary values (only used when method is 'defaults') + # ------------------------------------- + if override is not None: - # Loop over keys that user wants to override - for over_key, over_value in override_dict.items(): + # Method must be defaults if specifying override + logger.assert_abort(method == 'defaults', + f'If specifying an override, the input method must be \'defaults\'') - # Assert that the override choice is in fact overridable - logger.assert_abort(over_key in overridable_keys, f'The override key \'{over_key}\' ' + - f'is not overridable. Overridable keys: ' + - f'\'{overridable_keys}\'.') + with open(override, 'r') as file: + override_dict = yaml.safe_load(file) - # Assert that the override choice is in the experiment dictionary - logger.assert_abort(over_key in experiment_dict, f'The override key \'{over_key}\' ' + - f'is not part of the experiment dictionary.') + logger.info(f'Overriding experiment dictionary settings using {override}') + dictionary_override(logger, experiment_dict, override_dict) - # Overwrite the element in the experiment dictionary - experiment_dict[over_key] = over_value + # Update model components in case the user override changed which are turned on + # ----------------------------------------------------------------------------- + update_model_components(logger, experiment_dict, comment_dict) # Add comments to dictionary # -------------------------- diff --git a/src/swell/deployment/prep_config_base.py b/src/swell/deployment/prep_config_base.py index eb7574a4..071b9b94 100644 --- a/src/swell/deployment/prep_config_base.py +++ b/src/swell/deployment/prep_config_base.py @@ -59,7 +59,7 @@ def __init__(self, logger, dictionary_file, suite, platform): self.comment_dict = {} # Dictionary validation things - self.valid_types = ['string', 'integer', + self.valid_types = ['string', 'integer', 'float', 'iso-datetime', 'iso-duration', 'string-list', 'integer-list', 'string-drop-list', 'string-check-list', @@ -112,6 +112,17 @@ def execute(self): base_tasks_question_dict = self.task_dictionary_comber(base_tasks) self.base_questions_dictionary.update(base_tasks_question_dict) + # Base model questions (i.e. questions sent to model tasks that do not depend on model) + model_task_base_questions_tmp = self.task_dictionary_comber(model_tasks) + + model_task_base_questions = {} + for key in model_task_base_questions_tmp.keys(): + if 'models' not in model_task_base_questions_tmp[key].keys(): + model_task_base_questions[key] = model_task_base_questions_tmp[key] + + # Add to the base questions + self.base_questions_dictionary.update(model_task_base_questions) + # Iterate over base questions for k, v in self.base_questions_dictionary.items(): self.key_passer(k, v) @@ -131,8 +142,12 @@ def execute(self): # Prepend model suite question in front of model task questions self.prepend_model_dict() + model_questions_dictionary_copy = copy.deepcopy(self.model_questions_dictionary) + # Iterate over base questions for m in self.selected_models: + self.model_questions_dictionary[m] = + copy.deepcopy(model_questions_dictionary_copy[m]) self.model = m for k, v in self.model_questions_dictionary[m].items(): self.key_passer(k, v) @@ -301,7 +316,7 @@ def get_model_defaults(self): def show_deference(self, key, el_dict): - if 'defer_to_' in el_dict['default_value']: + if 'defer_to_' in str(el_dict['default_value']): pass else: return el_dict @@ -421,6 +436,7 @@ def add_to_experiment_dictionary(self, key, element_dict): # Check that dictionary does not already contain the key if key in self.experiment_dict.keys(): + self.logger.abort(f'Key \'{key}\' is already in the experiment dictionary.') # Check if models key is present in experiment dictionary diff --git a/src/swell/deployment/prep_config_cli.py b/src/swell/deployment/prep_config_cli.py index 19dca418..5880ec24 100644 --- a/src/swell/deployment/prep_config_cli.py +++ b/src/swell/deployment/prep_config_cli.py @@ -35,6 +35,8 @@ def get_answer(self, key, val): answer = self.make_string_widget(quest, default, questionary.text) elif widget_type == 'integer': answer = self.make_int_widget(quest, default, questionary.text) + elif widget_type == 'float': + answer = self.make_float_widget(quest, default, questionary.text) elif 'drop-list' in widget_type: options = val['options'] answer = self.make_drop_widget(key, quest, options, default, questionary.select) @@ -106,6 +108,17 @@ def make_int_widget(self, quest, default, prompt): # ---------------------------------------------------------------------------------------------- + def make_float_widget(self, quest, default, prompt): + default = str(default) + answer = prompt(f"{quest} [{default}]", + validate=lambda text: True if text.isdigit() + else 'Please enter a float value', + default=default).ask() + + return answer + + # ---------------------------------------------------------------------------------------------- + def make_drop_widget(self, method, quest, options, default, prompt): default = str(default) choices = [str(x) for x in options] diff --git a/src/swell/deployment/prep_exp_dirs.py b/src/swell/deployment/prep_exp_dirs.py index 962582d8..3b102a45 100644 --- a/src/swell/deployment/prep_exp_dirs.py +++ b/src/swell/deployment/prep_exp_dirs.py @@ -19,28 +19,26 @@ # -------------------------------------------------------------------------------------------------- -def copy_eva_files(logger, swell_suite_path, exp_suite_path, model_components): - - # Copy suite related files to the suite directory - # ----------------------------------------------- - for model_component in model_components: - # Path to where eva files are - eva_config_path = os.path.join(swell_suite_path, model_component) - # All eva files - eva_files = glob.glob(os.path.join(eva_config_path, 'eva*.yaml')) - # Loop over eva files and copy with model name appended - for eva_file in eva_files: - eva_file_basename = os.path.basename(eva_file) - eva_file_basename = os.path.splitext(eva_file_basename)[0] - dst_eva_file = f'{eva_file_basename}-{model_component}.yaml' - dst_path_file = os.path.join(exp_suite_path, dst_eva_file) - if os.path.exists(eva_file): - logger.trace(f'Copying {eva_file} to {dst_path_file}') - shutil.copy(eva_file, dst_path_file) + +def copy_eva_files(logger, swell_suite_path, exp_suite_path): + + # Repo eva files + eva_directory = os.path.join(swell_suite_path, 'eva') + + # Destination for eva files + destination_directory = os.path.join(exp_suite_path, 'eva') + + # If destination directory exists, delete it + if os.path.exists(destination_directory): + shutil.rmtree(destination_directory) + + # Copy all the files + shutil.copytree(eva_directory, destination_directory) # -------------------------------------------------------------------------------------------------- + def copy_platform_files(logger, exp_suite_path, platform=None): # Copy platform related files to the suite directory diff --git a/src/swell/deployment/prep_suite.py b/src/swell/deployment/prep_suite.py index f13a5e74..d053b195 100644 --- a/src/swell/deployment/prep_suite.py +++ b/src/swell/deployment/prep_suite.py @@ -9,6 +9,7 @@ import os +import yaml from swell.utilities.dictionary import dict_get from swell.utilities.jinja2 import template_string_jinja2 @@ -87,65 +88,68 @@ def prepare_cylc_suite_jinja2(logger, swell_suite_path, exp_suite_path, experime 'to gather them from or they are not provided in the experiment ' + 'dictionary.') - # Add scheduling to the render dictionary (TODO: do not hard code this) - # --------------------------------------- + # Look for a file called $HOME/.swell/slurm.yaml + # ---------------------------------------------- + yaml_path = os.path.expanduser("~/.swell/swell-slurm.yaml") + slurm_global = {} + if os.path.exists(yaml_path): + logger.info(f'Found file contianing swell slurm global values') + with open(yaml_path, "r") as yaml_file: + slurm_global = yaml.safe_load(yaml_file) + + # Set default values for global slurm values + account = 'g0613' + qos = 'allnccs' + partition = None + constraint = 'cas|sky' + + # Extract from slurm global file + if 'qos' in slurm_global: + qos = slurm_global['qos'] + + if 'partition' in slurm_global: + partition = slurm_global['partition'] + + if 'account' in slurm_global: + account = slurm_global['account'] + + if 'constraint' in slurm_global: + constraint = slurm_global['constraint'] + + # List of tasks using slurm + # ------------------------- + slurm_tasks = [ + 'BuildJedi', + 'BuildGeos', + 'GenerateBClimatology', + 'RunJediHofxExecutable', + 'RunJediVariationalExecutable', + 'RunJediUfoTestsExecutable', + 'RunGeosExecutable', + ] + + # Fill default values for slurm tasks + # ----------------------------------- render_dictionary['scheduling'] = {} - - render_dictionary['scheduling']['BuildJedi'] = {} + for slurm_task in slurm_tasks: + render_dictionary['scheduling'][slurm_task] = {} + render_dictionary['scheduling'][slurm_task]['execution_time_limit'] = 'PT1H' + render_dictionary['scheduling'][slurm_task]['account'] = account + render_dictionary['scheduling'][slurm_task]['qos'] = qos + render_dictionary['scheduling'][slurm_task]['nodes'] = 1 + render_dictionary['scheduling'][slurm_task]['ntasks_per_node'] = 24 + render_dictionary['scheduling'][slurm_task]['constraint'] = constraint + render_dictionary['scheduling'][slurm_task]['partition'] = partition + + # Set some specific values for: + # ----------------------------- + + # run time render_dictionary['scheduling']['BuildJedi']['execution_time_limit'] = 'PT3H' - render_dictionary['scheduling']['BuildJedi']['account'] = 'g0613' - render_dictionary['scheduling']['BuildJedi']['qos'] = 'allnccs' - render_dictionary['scheduling']['BuildJedi']['nodes'] = 1 - render_dictionary['scheduling']['BuildJedi']['ntasks_per_node'] = 24 - render_dictionary['scheduling']['BuildJedi']['constraint'] = 'cas|sky|hasw' - - render_dictionary['scheduling']['BuildGeos'] = {} - render_dictionary['scheduling']['BuildGeos']['execution_time_limit'] = 'PT1H' - render_dictionary['scheduling']['BuildGeos']['account'] = 'g0613' - render_dictionary['scheduling']['BuildGeos']['qos'] = 'allnccs' - render_dictionary['scheduling']['BuildGeos']['nodes'] = 1 - render_dictionary['scheduling']['BuildGeos']['ntasks_per_node'] = 24 - render_dictionary['scheduling']['BuildGeos']['constraint'] = 'cas|sky|hasw' - - render_dictionary['scheduling']['GenerateBClimatology'] = {} - render_dictionary['scheduling']['GenerateBClimatology']['execution_time_limit'] = 'PT15M' - render_dictionary['scheduling']['GenerateBClimatology']['account'] = 'g0613' - render_dictionary['scheduling']['GenerateBClimatology']['qos'] = 'allnccs' - render_dictionary['scheduling']['GenerateBClimatology']['nodes'] = 1 - render_dictionary['scheduling']['GenerateBClimatology']['ntasks_per_node'] = 24 - render_dictionary['scheduling']['GenerateBClimatology']['constraint'] = 'cas|sky|hasw' - - render_dictionary['scheduling']['RunJediHofxExecutable'] = {} render_dictionary['scheduling']['RunJediHofxExecutable']['execution_time_limit'] = 'PT2H' - render_dictionary['scheduling']['RunJediHofxExecutable']['account'] = 'g0613' - render_dictionary['scheduling']['RunJediHofxExecutable']['qos'] = 'allnccs' - render_dictionary['scheduling']['RunJediHofxExecutable']['nodes'] = 1 - render_dictionary['scheduling']['RunJediHofxExecutable']['ntasks_per_node'] = 24 - render_dictionary['scheduling']['RunJediHofxExecutable']['constraint'] = 'cas|sky|hasw' - - render_dictionary['scheduling']['RunJediVariationalExecutable'] = {} - render_dictionary['scheduling']['RunJediVariationalExecutable']['execution_time_limit'] = 'PT1H' - render_dictionary['scheduling']['RunJediVariationalExecutable']['account'] = 'g0613' - render_dictionary['scheduling']['RunJediVariationalExecutable']['qos'] = 'allnccs' - render_dictionary['scheduling']['RunJediVariationalExecutable']['nodes'] = 1 - render_dictionary['scheduling']['RunJediVariationalExecutable']['ntasks_per_node'] = 24 - render_dictionary['scheduling']['RunJediVariationalExecutable']['constraint'] = 'cas|sky|hasw' - - render_dictionary['scheduling']['RunGeosExecutable'] = {} - render_dictionary['scheduling']['RunGeosExecutable']['execution_time_limit'] = 'PT30M' - render_dictionary['scheduling']['RunGeosExecutable']['account'] = 'g0613' - render_dictionary['scheduling']['RunGeosExecutable']['qos'] = 'allnccs' - render_dictionary['scheduling']['RunGeosExecutable']['nodes'] = 1 - render_dictionary['scheduling']['RunGeosExecutable']['ntasks_per_node'] = 24 - render_dictionary['scheduling']['RunGeosExecutable']['constraint'] = 'cas|sky|hasw' - - render_dictionary['scheduling']['RunJediUfoTestsExecutable'] = {} - render_dictionary['scheduling']['RunJediUfoTestsExecutable']['execution_time_limit'] = 'PT30M' # noqa - render_dictionary['scheduling']['RunJediUfoTestsExecutable']['account'] = 'g0613' - render_dictionary['scheduling']['RunJediUfoTestsExecutable']['qos'] = 'allnccs' - render_dictionary['scheduling']['RunJediUfoTestsExecutable']['nodes'] = 1 + + # nodes render_dictionary['scheduling']['RunJediUfoTestsExecutable']['ntasks_per_node'] = 1 - render_dictionary['scheduling']['RunJediUfoTestsExecutable']['constraint'] = 'cas' # Render the template # ------------------- diff --git a/src/swell/suites_old/3dvar/geos_ocean/eva_jedi_log.yaml b/src/swell/suites/3dvar/eva/jedi_log-geos_ocean.yaml similarity index 100% rename from src/swell/suites_old/3dvar/geos_ocean/eva_jedi_log.yaml rename to src/swell/suites/3dvar/eva/jedi_log-geos_ocean.yaml diff --git a/src/swell/suites_old/3dvar/geos_ocean/eva_observations.yaml b/src/swell/suites/3dvar/eva/observations-geos_ocean.yaml similarity index 100% rename from src/swell/suites_old/3dvar/geos_ocean/eva_observations.yaml rename to src/swell/suites/3dvar/eva/observations-geos_ocean.yaml diff --git a/src/swell/suites_old/3dvar/flow.cylc b/src/swell/suites/3dvar/flow.cylc similarity index 95% rename from src/swell/suites_old/3dvar/flow.cylc rename to src/swell/suites/3dvar/flow.cylc index e6dc0477..1457de7c 100644 --- a/src/swell/suites_old/3dvar/flow.cylc +++ b/src/swell/suites/3dvar/flow.cylc @@ -117,6 +117,9 @@ --nodes={{scheduling["BuildJedi"]["nodes"]}} --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} --constraint={{scheduling["BuildJedi"]["constraint"]}} + {% if scheduling["BuildJedi"]["partition"] %} + --partition={{scheduling["BuildJedi"]["partition"]}} + {% endif %} {% for model_component in model_components %} [[StageJedi-{{model_component}}]] @@ -145,6 +148,9 @@ --nodes={{scheduling["RunJediVariationalExecutable"]["nodes"]}} --ntasks-per-node={{scheduling["RunJediVariationalExecutable"]["ntasks_per_node"]}} --constraint={{scheduling["RunJediVariationalExecutable"]["constraint"]}} + {% if scheduling["RunJediVariationalExecutable"]["partition"] %} + --partition={{scheduling["RunJediVariationalExecutable"]["partition"]}} + {% endif %} [[EvaJediLog-{{model_component}}]] script = "swell_task EvaJediLog $config -d $datetime -m {{model_component}}" diff --git a/src/swell/suites/3dvar/suite_questions.yaml b/src/swell/suites/3dvar/suite_questions.yaml new file mode 100644 index 00000000..71c889f6 --- /dev/null +++ b/src/swell/suites/3dvar/suite_questions.yaml @@ -0,0 +1,32 @@ +start_cycle_point: + ask_question: True + default_value: '2021-12-12T00:00:00Z' + prompt: What is the time of the first cycle (middle of the window)? + type: iso-datetime + +final_cycle_point: + ask_question: True + default_value: '2021-12-12T06:00:00Z' + prompt: What is the time of the final cycle (middle of the window)? + type: iso-datetime + +runahead_limit: + ask_question: True + default_value: 'P4' + prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? + type: string + +r2d2_local_path: + ask_question: False + default_value: defer_to_platform + prompt: Enter the path where R2D2 will store experiment output + type: string + +cycle_times: + ask_question: True + default_value: defer_to_model + options: defer_to_model + models: + - all + prompt: Enter the cycle times for this model. + type: string-check-list diff --git a/src/swell/suites_old/3dvar_cycle/geos_ocean/eva_jedi_log.yaml b/src/swell/suites/3dvar_cycle/eva/jedi_log-geos_ocean.yaml similarity index 100% rename from src/swell/suites_old/3dvar_cycle/geos_ocean/eva_jedi_log.yaml rename to src/swell/suites/3dvar_cycle/eva/jedi_log-geos_ocean.yaml diff --git a/src/swell/suites_old/3dvar_cycle/geos_ocean/eva_observations.yaml b/src/swell/suites/3dvar_cycle/eva/observations-geos_ocean.yaml similarity index 100% rename from src/swell/suites_old/3dvar_cycle/geos_ocean/eva_observations.yaml rename to src/swell/suites/3dvar_cycle/eva/observations-geos_ocean.yaml diff --git a/src/swell/suites_old/3dvar_cycle/flow.cylc b/src/swell/suites/3dvar_cycle/flow.cylc similarity index 94% rename from src/swell/suites_old/3dvar_cycle/flow.cylc rename to src/swell/suites/3dvar_cycle/flow.cylc index 333ecaae..4344968d 100644 --- a/src/swell/suites_old/3dvar_cycle/flow.cylc +++ b/src/swell/suites/3dvar_cycle/flow.cylc @@ -20,7 +20,6 @@ initial cycle point = {{start_cycle_point}} final cycle point = {{final_cycle_point}} - runahead limit = {{runahead_limit}} [[graph]] R1 = """ @@ -149,6 +148,9 @@ --job-name = BuildGeos --nodes={{scheduling["BuildGeos"]["nodes"]}} --ntasks-per-node={{scheduling["BuildGeos"]["ntasks_per_node"]}} + {% if scheduling["BuildGeos"]["partition"] %} + --partition={{scheduling["BuildGeos"]["partition"]}} + {% endif %} [[CloneJedi]] script = "swell_task CloneJedi $config" @@ -167,6 +169,9 @@ --nodes={{scheduling["BuildJedi"]["nodes"]}} --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} --constraint={{scheduling["BuildJedi"]["constraint"]}} + {% if scheduling["BuildJedi"]["partition"] %} + --partition={{scheduling["BuildJedi"]["partition"]}} + {% endif %} [[RunGeosExecutable]] script = "swell_task RunGeosExecutable $config -d $datetime" @@ -179,6 +184,9 @@ --nodes={{scheduling["RunGeosExecutable"]["nodes"]}} --ntasks-per-node={{scheduling["RunGeosExecutable"]["ntasks_per_node"]}} --constraint={{scheduling["RunGeosExecutable"]["constraint"]}} + {% if scheduling["RunGeosExecutable"]["partition"] %} + --partition={{scheduling["RunGeosExecutable"]["partition"]}} + {% endif %} [[PrepGeosRunDir]] script = "swell_task PrepGeosRunDir $config -d $datetime" @@ -223,6 +231,9 @@ --nodes={{scheduling["RunJediVariationalExecutable"]["nodes"]}} --ntasks-per-node={{scheduling["RunJediVariationalExecutable"]["ntasks_per_node"]}} --constraint={{scheduling["RunJediVariationalExecutable"]["constraint"]}} + {% if scheduling["RunJediVariationalExecutable"]["partition"] %} + --partition={{scheduling["RunJediVariationalExecutable"]["partition"]}} + {% endif %} [[EvaJediLog-{{model_component}}]] script = "swell_task EvaJediLog $config -d $datetime -m {{model_component}}" diff --git a/src/swell/suites/3dvar_cycle/suite_questions.yaml b/src/swell/suites/3dvar_cycle/suite_questions.yaml new file mode 100644 index 00000000..3e3090ee --- /dev/null +++ b/src/swell/suites/3dvar_cycle/suite_questions.yaml @@ -0,0 +1,26 @@ +start_cycle_point: + ask_question: True + default_value: '2021-12-12T00:00:00Z' + prompt: What is the time of the first cycle (middle of the window)? + type: iso-datetime + +final_cycle_point: + ask_question: True + default_value: '2021-12-12T06:00:00Z' + prompt: What is the time of the final cycle (middle of the window)? + type: iso-datetime + +r2d2_local_path: + ask_question: False + default_value: defer_to_platform + prompt: Enter the path where R2D2 will store experiment output + type: string + +cycle_times: + ask_question: True + default_value: defer_to_model + options: defer_to_model + models: + - all + prompt: Enter the cycle times for this model. + type: string-check-list diff --git a/src/swell/suites_old/build_geos/flow.cylc b/src/swell/suites/build_geos/flow.cylc similarity index 93% rename from src/swell/suites_old/build_geos/flow.cylc rename to src/swell/suites/build_geos/flow.cylc index 0556d737..8923ed33 100644 --- a/src/swell/suites_old/build_geos/flow.cylc +++ b/src/swell/suites/build_geos/flow.cylc @@ -55,5 +55,8 @@ --nodes={{scheduling["BuildGeos"]["nodes"]}} --ntasks-per-node={{scheduling["BuildGeos"]["ntasks_per_node"]}} --constraint={{scheduling["BuildGeos"]["constraint"]}} + {% if scheduling["BuildGeos"]["partition"] %} + --partition={{scheduling["BuildGeos"]["partition"]}} + {% endif %} # -------------------------------------------------------------------------------------------------- diff --git a/src/swell/suites/build_jedi/flow.cylc b/src/swell/suites/build_jedi/flow.cylc index a3c3cef2..13760ee8 100644 --- a/src/swell/suites/build_jedi/flow.cylc +++ b/src/swell/suites/build_jedi/flow.cylc @@ -55,5 +55,8 @@ --nodes={{scheduling["BuildJedi"]["nodes"]}} --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} --constraint={{scheduling["BuildJedi"]["constraint"]}} + {% if scheduling["BuildJedi"]["partition"] %} + --partition={{scheduling["BuildJedi"]["partition"]}} + {% endif %} # -------------------------------------------------------------------------------------------------- diff --git a/src/swell/suites/convert_ncdiags/flow.cylc b/src/swell/suites/convert_ncdiags/flow.cylc index 4456b23f..0f6fbd58 100644 --- a/src/swell/suites/convert_ncdiags/flow.cylc +++ b/src/swell/suites/convert_ncdiags/flow.cylc @@ -86,6 +86,9 @@ --nodes={{scheduling["BuildJedi"]["nodes"]}} --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} --constraint={{scheduling["BuildJedi"]["constraint"]}} + {% if scheduling["BuildJedi"]["partition"] %} + --partition={{scheduling["BuildJedi"]["partition"]}} + {% endif %} [[ GetGsiBc ]] script = "swell_task GetGsiBc $config -d $datetime -m geos_atmosphere" diff --git a/src/swell/suites/convert_ncdiags/geos_atmosphere/suites-convert_ncdiags-geos_atmosphere.yaml b/src/swell/suites/convert_ncdiags/geos_atmosphere/suites-convert_ncdiags-geos_atmosphere.yaml deleted file mode 100644 index 6480ac8b..00000000 --- a/src/swell/suites/convert_ncdiags/geos_atmosphere/suites-convert_ncdiags-geos_atmosphere.yaml +++ /dev/null @@ -1,85 +0,0 @@ -# Cycle frequency -cycle_times: - default_value: ['T00'] - prompt: List all cycle times, by middle of the window? - options: ['T00'] - type: string-check-list - -# Observations -observations: - default_value: - # Conventional - - aircraft - - gps - - satwind - - scatwind - - sfcship - - sfc - - sondes - # Radiances - - airs_aqua - - amsr2_gcom-w1 - - amsua_aqua - - amsua_metop-b - - amsua_metop-c - - amsua_n15 - - amsua_n18 - - amsua_n19 - - atms_n20 - - atms_npp - - avhrr3_metop-b - - avhrr3_n18 - - avhrr3_n19 - - cris-fsr_n20 - - cris-fsr_npp - - gmi_gpm - - iasi_metop-b - - iasi_metop-c - - mhs_metop-b - - mhs_metop-c - - mhs_n19 - - ssmis_f17 - # Ozone - - mls55_aura - - omi_aura - - ompsnm_npp - prompt: Select observations to run with. - options: use_method - type: string-check-list - -# Path to GSI ncdiags -path_to_gsi_nc_diags: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/ncdiag/2021121200' - prompt: Path to where the ncdiags will be held - type: string - -# Compute GeoVaLs and observations -produce_geovals: - default_value: true - prompt: Compute GeoVaLs as well as observations? - type: boolean - -# Location for bias correction coefficients -path_to_gsi_bc_coefficients: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/bc/2021121200' - prompt: Tar or directory containing BC files - type: string - -fixed_options: - window_offset: - default_value: PT3H - prompt: Time from beginning to middle of the window - background_time_offset: - default_value: PT9H - prompt: Time before the middle of the window that the background providing forecast began - clean_patterns: - default_value: - - gsi_bcs/*.nc4 - - gsi_bcs/*.txt - - gsi_bcs/*.yaml - - gsi_bcs - - gsi_ncdiags/*.nc4 - - gsi_ncdiags/aircraft/*.nc4 - - gsi_ncdiags/aircraft - - gsi_ncdiags - prompt: 'Patterns for the files to remove after completing a cycle' diff --git a/src/swell/suites/convert_ncdiags/suite_questions.yaml b/src/swell/suites/convert_ncdiags/suite_questions.yaml new file mode 100644 index 00000000..71c889f6 --- /dev/null +++ b/src/swell/suites/convert_ncdiags/suite_questions.yaml @@ -0,0 +1,32 @@ +start_cycle_point: + ask_question: True + default_value: '2021-12-12T00:00:00Z' + prompt: What is the time of the first cycle (middle of the window)? + type: iso-datetime + +final_cycle_point: + ask_question: True + default_value: '2021-12-12T06:00:00Z' + prompt: What is the time of the final cycle (middle of the window)? + type: iso-datetime + +runahead_limit: + ask_question: True + default_value: 'P4' + prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? + type: string + +r2d2_local_path: + ask_question: False + default_value: defer_to_platform + prompt: Enter the path where R2D2 will store experiment output + type: string + +cycle_times: + ask_question: True + default_value: defer_to_model + options: defer_to_model + models: + - all + prompt: Enter the cycle times for this model. + type: string-check-list diff --git a/src/swell/suites/convert_ncdiags/suites-convert_ncdiags.yaml b/src/swell/suites/convert_ncdiags/suites-convert_ncdiags.yaml deleted file mode 100644 index c77e8437..00000000 --- a/src/swell/suites/convert_ncdiags/suites-convert_ncdiags.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# Cycle start point -start_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the first cycle (middle of the window)? - type: iso-datetime - -# Cycle final point -final_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the final cycle (middle of the window)? - type: iso-datetime - -# Run ahead limit for workflow -runahead_limit: - default_value: 'P4' - prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? - type: string - -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: {{existing_jedi_source_directory}} - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: {{existing_jedi_build_directory}} - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - -# Models to use -model_components: - default_value: ['geos_atmosphere'] - prompt: Select models to use (choose at least one) - options: use_method - type: file-check-list - -# Fixed options -fixed_options: - data_assimilation_run: - default_value: true - prompt: Does this workflow include data assimilation? - -# R2D2 Configuration -r2d2_local_path: - default_value: {{r2d2_local_path}} - prompt: Enter the path where R2D2 will store experiment output - type: string diff --git a/src/swell/suites_old/forecast_geos/flow.cylc b/src/swell/suites/forecast_geos/flow.cylc similarity index 93% rename from src/swell/suites_old/forecast_geos/flow.cylc rename to src/swell/suites/forecast_geos/flow.cylc index 0eb4c8e5..4bffa71e 100644 --- a/src/swell/suites_old/forecast_geos/flow.cylc +++ b/src/swell/suites/forecast_geos/flow.cylc @@ -90,6 +90,9 @@ --job-name = BuildGeos --nodes={{scheduling["BuildGeos"]["nodes"]}} --ntasks-per-node={{scheduling["BuildGeos"]["ntasks_per_node"]}} + {% if scheduling["BuildGeos"]["partition"] %} + --partition={{scheduling["BuildGeos"]["partition"]}} + {% endif %} [[PrepGeosRunDir]] script = "swell_task PrepGeosRunDir $config -d $datetime" @@ -116,5 +119,8 @@ --job-name = RunGeosExecutable --nodes={{scheduling["RunGeosExecutable"]["nodes"]}} --ntasks-per-node={{scheduling["RunGeosExecutable"]["ntasks_per_node"]}} + {% if scheduling["RunGeosExecutable"]["partition"] %} + --partition={{scheduling["RunGeosExecutable"]["partition"]}} + {% endif %} # -------------------------------------------------------------------------------------------------- diff --git a/src/swell/suites/forecast_geos/suite_questions.yaml b/src/swell/suites/forecast_geos/suite_questions.yaml new file mode 100644 index 00000000..af75f762 --- /dev/null +++ b/src/swell/suites/forecast_geos/suite_questions.yaml @@ -0,0 +1,32 @@ +start_cycle_point: + ask_question: True + default_value: '2021-12-12T00:00:00Z' + prompt: What is the time of the first cycle (middle of the window)? + type: iso-datetime + +final_cycle_point: + ask_question: True + default_value: '2021-12-12T06:00:00Z' + prompt: What is the time of the final cycle (middle of the window)? + type: iso-datetime + +r2d2_local_path: + ask_question: False + default_value: defer_to_platform + prompt: Enter the path where R2D2 will store experiment output + type: string + +cycle_times: + ask_question: True + default_value: + - T00 + - T06 + - T12 + - T18 + options: + - T00 + - T06 + - T12 + - T18 + prompt: Enter the forecast times. + type: string-check-list diff --git a/src/swell/suites/geosadas/flow.cylc b/src/swell/suites/geosadas/flow.cylc index f697e15c..888d91ec 100644 --- a/src/swell/suites/geosadas/flow.cylc +++ b/src/swell/suites/geosadas/flow.cylc @@ -104,6 +104,9 @@ --nodes={{scheduling["RunJediVariationalExecutable"]["nodes"]}} --ntasks-per-node={{scheduling["RunJediVariationalExecutable"]["ntasks_per_node"]}} --constraint={{scheduling["RunJediVariationalExecutable"]["constraint"]}} + {% if scheduling["RunJediVariationalExecutable"]["partition"] %} + --partition={{scheduling["RunJediVariationalExecutable"]["partition"]}} + {% endif %} [[CleanCycle]] script = "swell_task CleanCycle $config -d $datetime -m geos_atmosphere" diff --git a/src/swell/suites/geosadas/geos_atmosphere/suites-geosadas-geos_atmosphere.yaml b/src/swell/suites/geosadas/geos_atmosphere/suites-geosadas-geos_atmosphere.yaml deleted file mode 100644 index cc93920f..00000000 --- a/src/swell/suites/geosadas/geos_atmosphere/suites-geosadas-geos_atmosphere.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# Window length -window_length: - default_value: 'PT6H' - prompt: Window length for ocean data assimilation - type: iso-duration - -# Horizontal resolution -horizontal_resolution: - default_value: '361' - prompt: What resolution for the atmospheric background (For c360 choose 361)? - options: ['181', '361', '721'] - type: string-drop-list - -# Vertical resolution -vertical_resolution: - default_value: '72' - prompt: What vertical resolution for the atmospheric background? - options: ['72'] - type: string-drop-list - -# Processor layout x direction -npx_proc: - default_value: '4' - prompt: What processor layout (x-direction) per cube face? - type: string - -# Processor layout y direction -npy_proc: - default_value: '1' - prompt: What processor layout (y-direction) per cube face? - type: string - -# Analysis -analysis_variables: - default_value: [ua,va,t,ps,q,qi,ql,o3ppmv,ts,phis,frocean,frlake,frseaice] - prompt: Variables to be assimilated? - type: string - -# Observations -observations: - default_value: - - sondes - - amsua_n19 - prompt: Select observations. - options: use_method - type: string-check-list - -# Path to GSI bias correction coefficients -path_to_gsi_bc_coefficients: - default_value: /discover/nobackup/drholdaw/SwellTestData/geosadas/bc - prompt: Tar or directory containing BC files - type: string - -# Path to GSI ncdiags -path_to_gsi_nc_diags: - default_value: /discover/nobackup/drholdaw/SwellTestData/geosadas/obs - prompt: Path to where the ncdiags will be held - type: string - -# Path to GEOS adas background files -path_to_geos_adas_background: - default_value: /discover/nobackup/drholdaw/SwellTestData/geosadas/bkg/*bkg_clcv_rst* - prompt: Tar or directory containing BC files - type: string - -# Compute GeoVaLs and observations -produce_geovals: - default_value: false - prompt: Compute GeoVaLs as well as observations? - type: boolean - -# Fixed options (user not prompted for these) -# ------------------------------------------- -fixed_options: - window_type: - default_value: 3D - prompt: Window type (3D or 4D) - minimizer: - default_value: DRIPCG - prompt: Minimizer to use for gradient descent - number_of_iterations: - default_value: [2] - prompt: Number of iterations to use in the minimization - gradient_norm_reduction: - default_value: 1e-6 - prompt: Threshold for convergence of the minimization - window_offset: - default_value: PT3H - prompt: Time from beginning to middle of the window - analysis_forecast_window_offset: - default_value: -PT3H - prompt: Time from the middle of the window when forecasts start - background_time_offset: - default_value: PT1H - prompt: Time before the middle of the window that the background providing forecast began - background_frequency: - default_value: PT1H - prompt: 'Frequency of 4D backgrounds' - background_source: - default_value: file - prompt: 'Source of the background files (file or from model)' - clean_patterns: - default_value: ['*.nc4','*.txt'] - prompt: 'Patterns for the files to remove after completing a cycle' - crtm_coeff_dir: - default_value: {{crtm_coeff_dir}} - prompt: 'Directory containing the CRTM coefficient files' diff --git a/src/swell/suites/geosadas/suite_questions.yaml b/src/swell/suites/geosadas/suite_questions.yaml new file mode 100644 index 00000000..3e3090ee --- /dev/null +++ b/src/swell/suites/geosadas/suite_questions.yaml @@ -0,0 +1,26 @@ +start_cycle_point: + ask_question: True + default_value: '2021-12-12T00:00:00Z' + prompt: What is the time of the first cycle (middle of the window)? + type: iso-datetime + +final_cycle_point: + ask_question: True + default_value: '2021-12-12T06:00:00Z' + prompt: What is the time of the final cycle (middle of the window)? + type: iso-datetime + +r2d2_local_path: + ask_question: False + default_value: defer_to_platform + prompt: Enter the path where R2D2 will store experiment output + type: string + +cycle_times: + ask_question: True + default_value: defer_to_model + options: defer_to_model + models: + - all + prompt: Enter the cycle times for this model. + type: string-check-list diff --git a/src/swell/suites/geosadas/suites-geosadas.yaml b/src/swell/suites/geosadas/suites-geosadas.yaml deleted file mode 100644 index 63a0b853..00000000 --- a/src/swell/suites/geosadas/suites-geosadas.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: /discover/nobackup/drholdaw/JediDev/gsibec - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: /discover/nobackup/drholdaw/JediDev/gsibec/build-intel-release/ - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - -# Models to use -model_components: - default_value: ['geos_atmosphere'] - prompt: Select models to use - options: use_method - type: file-check-list - -generate_yaml_and_exit: - default_value: True - prompt: Generate YAML and exit? - type: boolean diff --git a/src/swell/suites/hofx/eva/observations-geos_atmosphere.yaml b/src/swell/suites/hofx/eva/observations-geos_atmosphere.yaml new file mode 100644 index 00000000..220f8744 --- /dev/null +++ b/src/swell/suites/hofx/eva/observations-geos_atmosphere.yaml @@ -0,0 +1,408 @@ +diagnostics: + +- data: + type: IodaObsSpace + datasets: + + - name: experiment + filenames: + - {{obs_path_file}} + channels: &channels {{channels}} + groups: + - name: ObsValue + variables: &variables {{simulated_variables}} + - name: GsiHofXBc + #- name: GsiEffectiveQC + - name: hofx + - name: EffectiveQC + - name: MetaData + + transforms: + + # Generate omb for GSI + - transform: arithmetic + new name: experiment::ObsValueMinusGsiHofXBc::${variable} + equals: experiment::ObsValue::${variable}-experiment::GsiHofXBc::${variable} + for: + variable: *variables + + # Generate omb for JEDI + - transform: arithmetic + new name: experiment::ObsValueMinusHofx::${variable} + equals: experiment::ObsValue::${variable}-experiment::hofx::${variable} + for: + variable: *variables + + # Generate hofx difference + - transform: arithmetic + new name: experiment::HofxMinusGsiHofXBc::${variable} + equals: experiment::hofx::${variable}-experiment::GsiHofXBc::${variable} + for: + variable: *variables + + # Generate hofx that passed QC for JEDI + - transform: accept where + new name: experiment::hofxPassedQc::${variable} + starting field: experiment::hofx::${variable} + where: + - experiment::EffectiveQC::${variable} == 0 + for: + variable: *variables + + # Generate GSI hofx that passed JEDI QC + - transform: accept where + new name: experiment::GsiHofXBcPassedQc::${variable} + starting field: experiment::GsiHofXBc::${variable} + where: + - experiment::EffectiveQC::${variable} == 0 + for: + variable: *variables + + # Generate omb that passed QC for JEDI + - transform: accept where + new name: experiment::ObsValueMinushofxPassedQc::${variable} + starting field: experiment::ObsValueMinusHofx::${variable} + where: + - experiment::EffectiveQC::${variable} == 0 + for: + variable: *variables + + # Generate omb that passed QC for GSI + - transform: accept where + new name: experiment::ObsValueMinusGsiHofXBcPassedQc::${variable} + starting field: experiment::ObsValueMinusGsiHofXBc::${variable} + where: + - experiment::EffectiveQC::${variable} == 0 + for: + variable: *variables + + graphics: + + # Correlation scatter plots + # ------------------------- + + # JEDI h(x) vs Observations + - batch figure: + variables: *variables + channels: *channels + figure: + layout: [1,1] + title: 'Observations vs. JEDI h(x) | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/correlation_scatter/${variable}${channel}/jedi_hofx_vs_obs_{{instrument}}_${variable}${channel}.png' + plots: + - add_xlabel: 'Observation Value' + add_ylabel: 'JEDI h(x)' + add_grid: + add_legend: + loc: 'upper left' + layers: + - type: Scatter + x: + variable: experiment::ObsValue::${variable} + y: + variable: experiment::hofx::${variable} + channel: ${channel} + markersize: 5 + color: 'black' + label: 'JEDI h(x) versus obs (all obs)' + - type: Scatter + x: + variable: experiment::ObsValue::${variable} + y: + variable: experiment::hofxPassedQc::${variable} + channel: ${channel} + markersize: 5 + color: 'red' + label: 'JEDI h(x) versus obs (passed QC in JEDI)' + + # GSI h(x) vs Observations + - batch figure: + variables: *variables + channels: *channels + figure: + layout: [1,1] + title: 'Observations vs. GSI h(x) | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/correlation_scatter/${variable}${channel}/gsi_hofx_vs_obs_{{instrument}}_${variable}${channel}.png' + plots: + - add_xlabel: 'Observation Value' + add_ylabel: 'GSI h(x)' + add_grid: + add_legend: + loc: 'upper left' + layers: + - type: Scatter + x: + variable: experiment::ObsValue::${variable} + y: + variable: experiment::GsiHofXBc::${variable} + channel: ${channel} + markersize: 5 + color: 'black' + label: 'GSI h(x) versus obs (all obs)' + - type: Scatter + x: + variable: experiment::ObsValue::${variable} + y: + variable: experiment::GsiHofXBcPassedQc::${variable} + channel: ${channel} + markersize: 5 + color: 'red' + label: 'GSI h(x) versus obs (passed QC in JEDI)' + + # JEDI h(x) vs GSI h(x) + - batch figure: + variables: *variables + channels: *channels + figure: + layout: [1,1] + title: 'JEDI h(x) vs. GSI h(x) | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/correlation_scatter/${variable}${channel}/gsi_hofx_vs_jedi_hofx_{{instrument}}_${variable}${channel}.png' + plots: + - add_xlabel: 'GSI h(x)' + add_ylabel: 'JEDI h(x)' + add_grid: + add_legend: + loc: 'upper left' + layers: + - type: Scatter + x: + variable: experiment::GsiHofXBc::${variable} + y: + variable: experiment::hofx::${variable} + channel: ${channel} + markersize: 5 + color: 'black' + label: 'JEDI h(x) versus GSI h(x)' + - type: Scatter + x: + variable: experiment::GsiHofXBcPassedQc::${variable} + y: + variable: experiment::hofxPassedQc::${variable} + channel: ${channel} + markersize: 5 + color: 'red' + label: 'JEDI h(x) versus GSI h(x) (passed QC in JEDI)' + + # JEDI omb vs GSI omb + - batch figure: + variables: *variables + channels: *channels + figure: + layout: [1,1] + title: 'JEDI omb vs. GSI omb | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/correlation_scatter/${variable}${channel}/gsi_omb_vs_jedi_omb_{{instrument}}_${variable}${channel}.png' + plots: + - add_xlabel: 'GSI observation minus h(x)' + add_ylabel: 'JEDI observation minus h(x)' + add_grid: + add_legend: + loc: 'upper left' + layers: + - type: Scatter + x: + variable: experiment::ObsValueMinusGsiHofXBc::${variable} + y: + variable: experiment::ObsValueMinusHofx::${variable} + channel: ${channel} + markersize: 5 + color: 'black' + label: 'GSI omb vs JEDI omb (all obs)' + - type: Scatter + x: + variable: experiment::ObsValueMinusGsiHofXBcPassedQc::${variable} + y: + variable: experiment::ObsValueMinushofxPassedQc::${variable} + channel: ${channel} + markersize: 5 + color: 'red' + label: 'GSI omb vs JEDI omb (passed QC in JEDI)' + +# Map plots +# --------- + + # Observations + - batch figure: + variables: *variables + channels: *channels + dynamic options: + - type: vminvmaxcmap + channel: ${channel} + data variable: experiment::ObsValue::${variable} + figure: + figure size: [20,10] + layout: [1,1] + title: 'Observations | {{instrument_title}} | Obs Value' + output name: '{{cycle_dir}}/eva/{{instrument}}/map_plots/${variable}${channel}/observations_{{instrument}}_${variable}${channel}.png' + plots: + - mapping: + projection: plcarr + domain: global + add_map_features: ['coastline'] + add_colorbar: + label: ObsValue + add_grid: + layers: + - type: MapScatter + longitude: + variable: experiment::MetaData::longitude + latitude: + variable: experiment::MetaData::latitude + data: + variable: experiment::ObsValue::${variable} + channel: ${channel} + markersize: 2 + label: ObsValue + colorbar: true + cmap: ${dynamic_cmap} + vmin: ${dynamic_vmin} + vmax: ${dynamic_vmax} + + # omb jedi + - batch figure: + variables: *variables + channels: *channels + dynamic options: + - type: vminvmaxcmap + channel: ${channel} + data variable: experiment::ObsValueMinusHofx::${variable} + figure: + figure size: [20,10] + layout: [1,1] + title: 'JEDI OmB | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/map_plots/${variable}${channel}/omb_jedi_{{instrument}}_${variable}${channel}.png' + plots: + - mapping: + projection: plcarr + domain: global + add_map_features: ['coastline'] + add_colorbar: + label: '${variable}' + add_grid: + layers: + - type: MapScatter + longitude: + variable: experiment::MetaData::longitude + latitude: + variable: experiment::MetaData::latitude + data: + variable: experiment::ObsValueMinusHofx::${variable} + channel: ${channel} + markersize: 2 + label: '${variable}' + colorbar: true + cmap: ${dynamic_cmap} + vmin: ${dynamic_vmin} + vmax: ${dynamic_vmax} + + # omb gsi + - batch figure: + variables: *variables + channels: *channels + dynamic options: + - type: vminvmaxcmap + channel: ${channel} + data variable: experiment::ObsValueMinusGsiHofXBc::${variable} + figure: + figure size: [20,10] + layout: [1,1] + title: 'GSI OmB | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/map_plots/${variable}${channel}/omb_gsi_{{instrument}}_${variable}${channel}.png' + plots: + - mapping: + projection: plcarr + domain: global + add_map_features: ['coastline'] + add_colorbar: + label: '${variable}' + add_grid: + layers: + - type: MapScatter + longitude: + variable: experiment::MetaData::longitude + latitude: + variable: experiment::MetaData::latitude + data: + variable: experiment::ObsValueMinusGsiHofXBc::${variable} + channel: ${channel} + markersize: 2 + label: '${variable}' + colorbar: true + cmap: ${dynamic_cmap} + vmin: ${dynamic_vmin} + vmax: ${dynamic_vmax} + + # hofx difference + - batch figure: + variables: *variables + channels: *channels + dynamic options: + - type: vminvmaxcmap + channel: ${channel} + data variable: experiment::HofxMinusGsiHofXBc::${variable} + figure: + figure size: [20,10] + layout: [1,1] + title: 'Hofx Difference | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/map_plots/${variable}${channel}/hofx_difference_{{instrument}}_${variable}${channel}.png' + plots: + - mapping: + projection: plcarr + domain: global + add_map_features: ['coastline'] + add_colorbar: + label: '${variable}' + add_grid: + layers: + - type: MapScatter + longitude: + variable: experiment::MetaData::longitude + latitude: + variable: experiment::MetaData::latitude + data: + variable: experiment::HofxMinusGsiHofXBc::${variable} + channel: ${channel} + markersize: 2 + label: '${variable}' + colorbar: true + cmap: ${dynamic_cmap} + vmin: ${dynamic_vmin} + vmax: ${dynamic_vmax} + +# Histogram plots +# --------------- + + # omb vs omb + - batch figure: + variables: *variables + channels: *channels + dynamic options: + - type: histogram_bins + channel: ${channel} + number of bins rule: sturges + data variable: experiment::ObsValueMinusHofx::${variable} + figure: + layout: [1,1] + title: 'JEDI omb vs. GSI omb | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/histograms/${variable}${channel}/gsi_omb_vs_jedi_omb_{{instrument}}_${variable}${channel}.png' + plots: + - add_xlabel: 'Observation minus h(x)' + add_ylabel: 'Count' + add_legend: + loc: 'upper left' + layers: + - type: Histogram + data: + variable: experiment::ObsValueMinusGsiHofXBc::${variable} + channel: ${channel} + color: 'blue' + label: 'GSI omb (all obs)' + bins: ${dynamic_bins} + alpha: 0.5 + - type: Histogram + data: + variable: experiment::ObsValueMinusHofx::${variable} + channel: ${channel} + color: 'red' + label: 'JEDI omb (all obs)' + bins: ${dynamic_bins} + alpha: 0.5 diff --git a/src/swell/suites/hofx/eva/observations-geos_ocean.yaml b/src/swell/suites/hofx/eva/observations-geos_ocean.yaml new file mode 100644 index 00000000..3ca21583 --- /dev/null +++ b/src/swell/suites/hofx/eva/observations-geos_ocean.yaml @@ -0,0 +1,148 @@ +diagnostics: + +- data: + type: IodaObsSpace + datasets: + + - name: experiment + filenames: + - {{obs_path_file}} + groups: + - name: ObsValue + variables: &variables {{simulated_variables}} + - name: hofx + - name: EffectiveQC + - name: MetaData + + transforms: + + # Generate omb for JEDI + - transform: arithmetic + new name: experiment::ObsValueMinusHofx::${variable} + equals: experiment::ObsValue::${variable}-experiment::hofx::${variable} + for: + variable: *variables + + # Generate hofx that passed QC for JEDI + - transform: accept where + new name: experiment::hofxPassedQc::${variable} + starting field: experiment::hofx::${variable} + where: + - experiment::EffectiveQC::${variable} == 0 + for: + variable: *variables + + # Generate omb that passed QC for JEDI + - transform: accept where + new name: experiment::ObsValueMinushofxPassedQc::${variable} + starting field: experiment::ObsValueMinusHofx::${variable} + where: + - experiment::EffectiveQC::${variable} == 0 + for: + variable: *variables + + graphics: + + # Correlation scatter plots + # ------------------------- + + # JEDI h(x) vs Observations + - batch figure: + variables: *variables + figure: + layout: [1,1] + title: 'Observations vs. JEDI h(x) | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/correlation_scatter/${variable}/jedi_hofx_vs_obs_{{instrument}}_${variable}.png' + plots: + - add_xlabel: 'Observation Value' + add_ylabel: 'JEDI h(x)' + add_grid: + add_legend: + loc: 'upper left' + layers: + - type: Scatter + x: + variable: experiment::ObsValue::${variable} + y: + variable: experiment::hofx::${variable} + markersize: 5 + color: 'black' + label: 'JEDI h(x) versus obs (all obs)' + - type: Scatter + x: + variable: experiment::ObsValue::${variable} + y: + variable: experiment::hofxPassedQc::${variable} + markersize: 5 + color: 'red' + label: 'JEDI h(x) versus obs (passed QC in JEDI)' +# Map plots +# --------- + + # Observations + - batch figure: + variables: *variables + dynamic options: + - type: vminvmaxcmap + data variable: experiment::ObsValue::${variable} + figure: + figure size: [20,10] + layout: [1,1] + title: 'Observations | {{instrument_title}} | Obs Value' + output name: '{{cycle_dir}}/eva/{{instrument}}/map_plots/${variable}/observations_{{instrument}}_${variable}.png' + plots: + - mapping: + projection: plcarr + domain: global + add_map_features: ['coastline'] + add_colorbar: + label: ObsValue + add_grid: + layers: + - type: MapScatter + longitude: + variable: experiment::MetaData::longitude + latitude: + variable: experiment::MetaData::latitude + data: + variable: experiment::ObsValue::${variable} + markersize: 2 + label: ObsValue + colorbar: true + cmap: ${dynamic_cmap} + vmin: ${dynamic_vmin} + vmax: ${dynamic_vmax} + + # omb jedi + - batch figure: + variables: *variables + dynamic options: + - type: vminvmaxcmap + data variable: experiment::ObsValueMinusHofx::${variable} + figure: + figure size: [20,10] + layout: [1,1] + title: 'JEDI OmB | {{instrument_title}} | ${variable_title}' + output name: '{{cycle_dir}}/eva/{{instrument}}/map_plots/${variable}/omb_jedi_{{instrument}}_${variable}.png' + plots: + - mapping: + projection: plcarr + domain: global + add_map_features: ['coastline'] + add_colorbar: + label: '${variable}' + add_grid: + layers: + - type: MapScatter + longitude: + variable: experiment::MetaData::longitude + latitude: + variable: experiment::MetaData::latitude + data: + variable: experiment::ObsValueMinusHofx::${variable} + markersize: 2 + label: '${variable}' + colorbar: true + cmap: ${dynamic_cmap} + vmin: ${dynamic_vmin} + vmax: ${dynamic_vmax} diff --git a/src/swell/suites/hofx/flow.cylc b/src/swell/suites/hofx/flow.cylc index 41369ddc..7b09767d 100644 --- a/src/swell/suites/hofx/flow.cylc +++ b/src/swell/suites/hofx/flow.cylc @@ -110,6 +110,9 @@ --nodes={{scheduling["BuildJedi"]["nodes"]}} --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} --constraint={{scheduling["BuildJedi"]["constraint"]}} + {% if scheduling["BuildJedi"]["partition"] %} + --partition={{scheduling["BuildJedi"]["partition"]}} + {% endif %} {% for model_component in model_components %} [[StageJedi-{{model_component}}]] @@ -135,6 +138,9 @@ --nodes={{scheduling["RunJediHofxExecutable"]["nodes"]}} --ntasks-per-node={{scheduling["RunJediHofxExecutable"]["ntasks_per_node"]}} --constraint={{scheduling["RunJediHofxExecutable"]["constraint"]}} + {% if scheduling["RunJediHofxExecutable"]["partition"] %} + --partition={{scheduling["RunJediHofxExecutable"]["partition"]}} + {% endif %} [[EvaObservations-{{model_component}}]] script = "swell_task EvaObservations $config -d $datetime -m {{model_component}}" diff --git a/src/swell/suites/hofx/suite_questions.yaml b/src/swell/suites/hofx/suite_questions.yaml index de3d6f84..71c889f6 100644 --- a/src/swell/suites/hofx/suite_questions.yaml +++ b/src/swell/suites/hofx/suite_questions.yaml @@ -1,12 +1,12 @@ start_cycle_point: ask_question: True - default_value: '2020-12-15T00:00:00Z' + default_value: '2021-12-12T00:00:00Z' prompt: What is the time of the first cycle (middle of the window)? type: iso-datetime final_cycle_point: ask_question: True - default_value: '2020-12-15T06:00:00Z' + default_value: '2021-12-12T06:00:00Z' prompt: What is the time of the final cycle (middle of the window)? type: iso-datetime @@ -17,7 +17,7 @@ runahead_limit: type: string r2d2_local_path: - ask_question: True + ask_question: False default_value: defer_to_platform prompt: Enter the path where R2D2 will store experiment output type: string diff --git a/src/swell/suites/ufo_testing/geos_atmosphere/eva_observations.yaml b/src/swell/suites/ufo_testing/eva/observations-geos_atmosphere.yaml similarity index 100% rename from src/swell/suites/ufo_testing/geos_atmosphere/eva_observations.yaml rename to src/swell/suites/ufo_testing/eva/observations-geos_atmosphere.yaml diff --git a/src/swell/suites/ufo_testing/flow.cylc b/src/swell/suites/ufo_testing/flow.cylc index c1edb926..fd047820 100644 --- a/src/swell/suites/ufo_testing/flow.cylc +++ b/src/swell/suites/ufo_testing/flow.cylc @@ -97,6 +97,9 @@ --nodes={{scheduling["BuildJedi"]["nodes"]}} --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} --constraint={{scheduling["BuildJedi"]["constraint"]}} + {% if scheduling["BuildJedi"]["partition"] %} + --partition={{scheduling["BuildJedi"]["partition"]}} + {% endif %} [[ GetGsiBc ]] script = "swell_task GetGsiBc $config -d $datetime -m geos_atmosphere" @@ -124,6 +127,9 @@ --nodes={{scheduling["RunJediUfoTestsExecutable"]["nodes"]}} --ntasks-per-node={{scheduling["RunJediUfoTestsExecutable"]["ntasks_per_node"]}} --constraint={{scheduling["RunJediUfoTestsExecutable"]["constraint"]}} + {% if scheduling["RunJediUfoTestsExecutable"]["partition"] %} + --partition={{scheduling["RunJediUfoTestsExecutable"]["partition"]}} + {% endif %} [[EvaObservations]] script = "swell_task EvaObservations $config -d $datetime -m geos_atmosphere" diff --git a/src/swell/suites/ufo_testing/geos_atmosphere/suites-ufo_testing-geos_atmosphere.yaml b/src/swell/suites/ufo_testing/geos_atmosphere/suites-ufo_testing-geos_atmosphere.yaml deleted file mode 100644 index 25930f5d..00000000 --- a/src/swell/suites/ufo_testing/geos_atmosphere/suites-ufo_testing-geos_atmosphere.yaml +++ /dev/null @@ -1,120 +0,0 @@ -# Cycle frequency -cycle_times: - default_value: ['T00'] - prompt: List all cycle times, by middle of the window? - options: ['T00'] - type: string-check-list - -# Window length -window_length: - default_value: 'PT6H' - prompt: Window length - type: iso-duration - -# Observations -observations: - default_value: - - aircraft - - gmi_gpm - - -# - airs_aqua -# - amsr2_gcom-w1 -# - amsua_aqua -# - amsua_metop-a -# - amsua_metop-b -# - amsua_metop-c -# - amsua_n15 -# - amsua_n18 -# - amsua_n19 -# - atms_n20 -# - atms_npp -# - avhrr_metop-a -# - avhrr_n18 -# - cris-fsr_n20 -# - cris-fsr_npp -# - gmi_gpm -# - gps -# - iasi_metop-a -# - iasi_metop-b -# - mhs_metop-b -# - mhs_metop-c -# - mhs_n19 -# - mls55_aura -# - omi_aura -# - ompsnm_npp -# - satwind -# - scatwind -# - seviri_m08 -# - sfcship -# - sfc -# - ssmis_f17 -# - vadwind - prompt: Select observations to run with. - options: use_method - type: string-check-list - -# Path to GSI ncdiags -path_to_gsi_nc_diags: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/ncdiag/2021121200' - prompt: Path to where the ncdiags will be held - type: string - -# Compute GeoVaLs and observations -produce_geovals: - default_value: false - prompt: Compute GeoVaLs as well as observations? - type: boolean - -# Location for bias correction coefficients -path_to_gsi_bc_coefficients: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/bc/2021121200' - prompt: Tar or directory containing BC files - type: string - -# Observation experiment -geovals_experiment: - default_value: x0048-geovals - prompt: Experiment providing the GeoVaLs? - type: string - - -# Fixed options (user not prompted for these) -# ------------------------------------------- -fixed_options: - crtm_coeff_dir: - default_value: {{crtm_coeff_dir}} - prompt: 'Directory containing the CRTM coefficient files' - total_processors: - default_value: 1 - prompt: Equation to compute total number of processors - clean_patterns: - default_value: - - '*.nc4' - - '*.txt' - - '*.log' - - '*.yaml' - - gsi_bcs/*.nc4 - - gsi_bcs/*.txt - - gsi_bcs/*.yaml - - gsi_bcs - - gsi_ncdiags/*.nc4 - - gsi_ncdiags/aircraft/*.nc4 - - gsi_ncdiags/aircraft - - gsi_ncdiags - prompt: 'Patterns for the files to remove after completing a cycle' - # Needed because of config gen - window_type: - default_value: 4D - prompt: Window type (3D or 4D) - window_offset: - default_value: PT3H - prompt: Time from beginning to middle of the window - background_time_offset: - default_value: PT9H - prompt: Time before the middle of the window that the background providing forecast began - geovals_provider: - default_value: ncdiag - prompt: Database providing the geovals. - - diff --git a/src/swell/suites/ufo_testing/suite_questions.yaml b/src/swell/suites/ufo_testing/suite_questions.yaml new file mode 100644 index 00000000..71c889f6 --- /dev/null +++ b/src/swell/suites/ufo_testing/suite_questions.yaml @@ -0,0 +1,32 @@ +start_cycle_point: + ask_question: True + default_value: '2021-12-12T00:00:00Z' + prompt: What is the time of the first cycle (middle of the window)? + type: iso-datetime + +final_cycle_point: + ask_question: True + default_value: '2021-12-12T06:00:00Z' + prompt: What is the time of the final cycle (middle of the window)? + type: iso-datetime + +runahead_limit: + ask_question: True + default_value: 'P4' + prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? + type: string + +r2d2_local_path: + ask_question: False + default_value: defer_to_platform + prompt: Enter the path where R2D2 will store experiment output + type: string + +cycle_times: + ask_question: True + default_value: defer_to_model + options: defer_to_model + models: + - all + prompt: Enter the cycle times for this model. + type: string-check-list diff --git a/src/swell/suites/ufo_testing/suites-ufo_testing.yaml b/src/swell/suites/ufo_testing/suites-ufo_testing.yaml deleted file mode 100644 index a145c553..00000000 --- a/src/swell/suites/ufo_testing/suites-ufo_testing.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# Cycle start point -start_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the first cycle (middle of the window)? - type: iso-datetime - -# Cycle final point -final_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the final cycle (middle of the window)? - type: iso-datetime - -# Run ahead limit for workflow -runahead_limit: - default_value: 'P4' - prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? - type: string - -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: {{existing_jedi_source_directory}} - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: {{existing_jedi_build_directory}} - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - -# R2D2 Configuration -r2d2_local_path: - default_value: {{r2d2_local_path}} - prompt: Enter the path where R2D2 will store experiment output - type: string - -# Models to use -model_components: - default_value: ['geos_atmosphere'] - prompt: Select models to use (choose at least one) - options: use_method - type: file-check-list - -# Fixed options -fixed_options: - data_assimilation_run: - default_value: true - prompt: Does this workflow include data assimilation? diff --git a/src/swell/suites_old/3dvar/geos_ocean/suites-3dvar-geos_ocean.yaml b/src/swell/suites_old/3dvar/geos_ocean/suites-3dvar-geos_ocean.yaml deleted file mode 100644 index ef441cd5..00000000 --- a/src/swell/suites_old/3dvar/geos_ocean/suites-3dvar-geos_ocean.yaml +++ /dev/null @@ -1,114 +0,0 @@ -# Cycle frequency -cycle_times: - default_value: ['T12'] - prompt: List all ocean cycle times, by middle of the window? - type: iso-duration - -# Window length -window_length: - default_value: 'P1D' - prompt: Window length for ocean data assimilation - type: iso-duration - -# Horizontal resolution -horizontal_resolution: - default_value: '72x36' - prompt: What resolution for the hor. res (probably will become obsolete)? - options: ['360x320', '1440x1080'] - type: string-drop-list - -# Vertical resolution -vertical_resolution: - default_value: '50' - prompt: What vertical resolution for the ocean background? - options: ['75'] - type: string-drop-list - -# Backgrounds -background_experiment: - default_value: s2s - prompt: Experiment providing the background files? - type: string - -# Analysis -analysis_variables: - default_value: [socn, tocn, ssh, hocn] - prompt: Variables to be assimilated? - type: string - -obs_experiment: - default_value: s2s_v1 - prompt: Database providing the observations? - type: string - -# Observations -observations: - default_value: - # Gdas (NOAA) - - adt_3a_egm2008 - - adt_3b_egm2008 - - adt_c2_egm2008 - - adt_j3_egm2008 - - adt_sa_egm2008 - - sst_ostia - - salt_profile_fnmoc - - sss_smos_esa - - sss_trak_fnmoc - - sst_gmi_l3u - - sst_ship_fnmoc - - sst_trak_fnmoc - - temp_profile_fnmoc - - # ODAS (NASA) - # - adt - # - insitus - # - insitut - prompt: Select ocean observations. - options: use_method - type: string-check-list - - # Processor layout -total_processors: - default_value: '6' - prompt: What is the total number of required processors for JEDI? - type: string - -# Fixed options (user not prompted for these) -# ------------------------------------------- -fixed_options: - window_type: - default_value: 3D - prompt: Window type (3D or 4D) - minimizer: - default_value: RPCG - prompt: Minimizer to use for gradient descent - number_of_iterations: - default_value: [5] - prompt: Number of iterations to use in the minimization - gradient_norm_reduction: - default_value: 1e-10 - prompt: Threshold for convergence of the minimization - window_offset: - default_value: PT12H - prompt: Time from beginning to middle of the window - analysis_forecast_window_offset: - default_value: -PT12H - prompt: Time from the middle of the window when forecasts start - background_time_offset: - default_value: PT18H - prompt: Time before the middle of the window that the background providing forecast began - background_frequency: - default_value: PT1H - prompt: 'Frequency of 4D backgrounds' - background_source: - default_value: file - prompt: 'Source of the background files (file or from model)' - static_background_error_model: - default_value: bump - prompt: 'Method for calculating background error covariance' - obs_provider: - default_value: gdas_marine - prompt: Database providing the observations. - clean_patterns: - default_value: ['*.nc4','*.txt'] - prompt: 'Patterns for the files to remove after completing a cycle' diff --git a/src/swell/suites_old/3dvar/suites-3dvar.yaml b/src/swell/suites_old/3dvar/suites-3dvar.yaml deleted file mode 100644 index c068c7a7..00000000 --- a/src/swell/suites_old/3dvar/suites-3dvar.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Cycle start point -start_cycle_point: - default_value: '2021-07-01T12:00:00Z' - prompt: What is the time of the first cycle (middle of the window)? - type: iso-datetime - -# Cycle final point -final_cycle_point: - default_value: '2021-07-01T12:00:00Z' - prompt: What is the time of the final cycle (middle of the window)? - type: iso-datetime - -# Run ahead limit for workflow -runahead_limit: - default_value: 'P4' - prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? - type: iso-duration - -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: {{existing_jedi_source_directory}} - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: {{existing_jedi_build_directory}} - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - -# R2D2 Configuration -r2d2_local_path: - default_value: {{r2d2_local_path}} - prompt: Enter the path where R2D2 will store experiment output - type: string - -# Models to use -model_components: - default_value: ['geos_ocean'] - prompt: Select models to use - options: use_method - type: file-check-list - -# Fixed options -fixed_options: - data_assimilation_run: - default_value: true - prompt: Does this workflow include data assimilation? - diff --git a/src/swell/suites_old/3dvar_cycle/geos_ocean/suites-3dvar_cycle-geos_ocean.yaml b/src/swell/suites_old/3dvar_cycle/geos_ocean/suites-3dvar_cycle-geos_ocean.yaml deleted file mode 100644 index a6e42986..00000000 --- a/src/swell/suites_old/3dvar_cycle/geos_ocean/suites-3dvar_cycle-geos_ocean.yaml +++ /dev/null @@ -1,109 +0,0 @@ -# Cycle frequency -cycle_times: - default_value: ['T00', 'T06', 'T12', 'T18'] - prompt: List all cycle times - options: ['T00', 'T06', 'T12', 'T18'] - type: string-check-list - -# Window length -window_length: - default_value: 'P1D' - prompt: Window length for ocean data assimilation - type: iso-duration - -# Horizontal resolution -horizontal_resolution: - default_value: '72x36' - prompt: What resolution for the hor. res? - options: ['72x36', '540x458'] - type: string-drop-list - -# Vertical resolution -vertical_resolution: - default_value: '50' - prompt: What vertical resolution for the ocean background? - options: ['50', '75'] - type: string-drop-list - -# Backgrounds -background_experiment: - default_value: s2s - prompt: Experiment providing the background files? - type: string - -# Analysis -analysis_variables: - default_value: [socn, tocn, ssh, hocn] - prompt: Variables to be assimilated? - type: string - -obs_experiment: - default_value: s2s_v1 - prompt: Database providing the observations? - type: string - -# Observations -observations: - default_value: - # Gdas (NOAA) - - adt_3a_egm2008 - - adt_3b_egm2008 - - adt_c2_egm2008 - - adt_j3_egm2008 - - adt_sa_egm2008 - - sst_ostia - - salt_profile_fnmoc - - sss_smos_esa - - sss_trak_fnmoc - - sst_gmi_l3u - - sst_ship_fnmoc - - sst_trak_fnmoc - - temp_profile_fnmoc - - # ODAS (NASA) - # - adt - # - insitus - # - insitut - prompt: Select ocean observations. - options: use_method - type: string-check-list - -# Fixed options (user not prompted for these) -# ------------------------------------------- -fixed_options: - window_type: - default_value: 3D - prompt: Window type (3D or 4D) - minimizer: - default_value: RPCG - prompt: Minimizer to use for gradient descent - number_of_iterations: - default_value: [10] - prompt: Number of iterations to use in the minimization - gradient_norm_reduction: - default_value: 1e-10 - prompt: Threshold for convergence of the minimization - window_offset: - default_value: PT12H - prompt: Time from beginning to middle of the window - analysis_forecast_window_offset: - default_value: -PT12H - prompt: Time from the middle of the window when forecasts start - background_time_offset: - default_value: P1DT12H - prompt: Time before the middle of the window that the background providing forecast began - background_frequency: - default_value: PT1H - prompt: 'Frequency of 4D backgrounds' - background_source: - default_value: file - prompt: 'Source of the background files (file or from model)' - static_background_error_model: - default_value: bump - prompt: 'Method for calculating background error covariance' - obs_provider: - default_value: gdas_marine - prompt: Database providing the observations. - clean_patterns: - default_value: ['*.nc4', '*.txt', '*.rc', '*.bin'] - prompt: 'Patterns for the files to remove after completing a cycle' diff --git a/src/swell/suites_old/3dvar_cycle/suites-3dvar_cycle.yaml b/src/swell/suites_old/3dvar_cycle/suites-3dvar_cycle.yaml deleted file mode 100644 index 4b329052..00000000 --- a/src/swell/suites_old/3dvar_cycle/suites-3dvar_cycle.yaml +++ /dev/null @@ -1,128 +0,0 @@ -# Cycle start point -start_cycle_point: - default_value: '2021-06-21T12:00:00Z' - prompt: What is the time of the first cycle (middle of the window)? - type: iso-datetime - -# Cycle final point -final_cycle_point: - default_value: '2021-06-24T12:00:00Z' - prompt: What is the time of the final cycle (middle of the window)? - type: iso-datetime - -# Each forecast cycle consists of a set duration until DA -# Should be less than or equal to 1 day due to the ISO -> string conversion -forecast_duration: - default_value: 'P1D' - prompt: What is the GEOS forecast duration? - type: string - -# Run ahead limit for workflow -runahead_limit: - default_value: 'P4' - prompt: Since this suite is cycling choose how many hours the workflow can run ahead? - type: string - -# Models to use -model_components: - default_value: ['geos_ocean'] - prompt: Select models to use - options: use_method - type: file-check-list - -#------------------------------------------------------------------------------- -# GEOS Settings -#------------------------------------------------------------------------------- -# Geos build system -geos_build_method: - default_value: use_existing - prompt: Create a new GEOS build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing GEOS source directory -existing_geos_gcm_source_path: - default_value: {{existing_geos_gcm_source_path}} - prompt: Provide the path to an existing GEOS bundle directory containing source code repos - type: string - depends: - key: geos_build_method - value: use_existing - -# Existing GEOS build directory -existing_geos_gcm_build_path: - default_value: {{existing_geos_gcm_build_path}} - prompt: Provide the path to an existing GEOS build directory - type: string - depends: - key: geos_build_method - value: use_existing - -# R2D2 Configuration -r2d2_local_path: - default_value: {{r2d2_local_path}} - prompt: Enter the path where R2D2 will store experiment output - type: string - -# GEOS Experiment folder, created by gcm_setup script -geos_experiment_directory: - default_value: 5deg_v11 - prompt: What experiment folder should GEOS obtain settings? - options: ['experiment_directory'] - type: string-drop-list - -# GEOS restarts folder, produced by GEOS cold start -geos_restarts_directory: - default_value: restarts_20210620_000000 - prompt: What experiment folder should GEOS obtain settings? - options: ['restarts'] - type: string-drop-list - -total_processors: - default_value: 6 - prompt: Total number of processors required for - type: string - - -# Version of GCM being used -geos_gcm_tag: - default_value: 'v11.0.2' - prompt: Which tag of GEOS do you want to build? - options: ['v11.0.2'] - type: string-drop-list - -#------------------------------------------------------------------------------- -# JEDI Settings -#------------------------------------------------------------------------------- -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: {{existing_jedi_source_directory}} - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: {{existing_jedi_build_directory}} - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - - -# Fixed options (user not prompted for these) -# ------------------------------------------- -fixed_options: - data_assimilation_run: - default_value: true - prompt: Does this workflow include data assimilation? diff --git a/src/swell/suites_old/build_geos/suites-build_geos.yaml b/src/swell/suites_old/build_geos/suites-build_geos.yaml deleted file mode 100644 index 4285d326..00000000 --- a/src/swell/suites_old/build_geos/suites-build_geos.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# geos build system -geos_build_method: - default_value: create - prompt: Create a new geos build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing geos bundle directory -existing_source_directory: - default_value: {{existing_source_directory}} - prompt: Provide the path to an existing geos bundle directory containing source code repos - type: string - depends: - key: geos_build_method - value: use_existing - -# Existing geos build -existing_build_directory: - default_value: {{existing_build_directory}} - prompt: Provide the path to an existing geos build directory - type: string - depends: - key: geos_build_method - value: use_existing - -# Tag to build -geos_gcm_tag: - default_value: 'v10.25.1' - prompt: Which tag of GEOS do you want to build? - type: string - depends: - key: geos_build_method - value: create diff --git a/src/swell/suites_old/convert_ncdiags/flow.cylc b/src/swell/suites_old/convert_ncdiags/flow.cylc deleted file mode 100644 index 4456b23f..00000000 --- a/src/swell/suites_old/convert_ncdiags/flow.cylc +++ /dev/null @@ -1,105 +0,0 @@ -# (C) Copyright 2021- United States Government as represented by the Administrator of the -# National Aeronautics and Space Administration. All Rights Reserved. -# -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. - -# -------------------------------------------------------------------------------------------------- - -# Cylc suite for executing geos_atmosphere ObsFilters tests - -# -------------------------------------------------------------------------------------------------- - -[scheduler] - UTC mode = True - allow implicit tasks = False - -# -------------------------------------------------------------------------------------------------- - -[scheduling] - - initial cycle point = {{start_cycle_point}} - final cycle point = {{final_cycle_point}} - runahead limit = {{runahead_limit}} - - [[graph]] - R1 = """ - # Triggers for non cycle time dependent tasks - # ------------------------------------------- - # Clone JEDI source code - CloneJedi - - # Build JEDI source code by linking - CloneJedi => BuildJediByLinking? - - # If not able to link to build create the build - BuildJediByLinking:fail? => BuildJedi - """ - - {% for cycle_time in cycle_times %} - {{cycle_time.cycle_time}} = """ - - # Convert bias correction to ioda - GetGsiBc - GetGsiBc => GsiBcToIoda - BuildJediByLinking[^]? | BuildJedi[^] => GsiBcToIoda - - # Convert ncdiags to ioda - GetGsiNcdiag - GetGsiNcdiag => GsiNcdiagToIoda - BuildJediByLinking[^]? | BuildJedi[^] => GsiNcdiagToIoda - - # Clean up - GsiNcdiagToIoda => CleanCycle - """ - {% endfor %} - -# -------------------------------------------------------------------------------------------------- - -[runtime] - - # Task defaults - # ------------- - [[root]] - pre-script = "source $CYLC_SUITE_DEF_PATH/modules" - - [[[environment]]] - datetime = $CYLC_TASK_CYCLE_POINT - config = $CYLC_SUITE_DEF_PATH/experiment.yaml - - # Tasks - # ----- - [[CloneJedi]] - script = "swell_task CloneJedi $config" - - [[BuildJediByLinking]] - script = "swell_task BuildJediByLinking $config" - - [[BuildJedi]] - script = "swell_task BuildJedi $config" - platform = {{platform}} - execution time limit = {{scheduling["BuildJedi"]["execution_time_limit"]}} - [[[directives]]] - --account = {{scheduling["BuildJedi"]["account"]}} - --qos = {{scheduling["BuildJedi"]["qos"]}} - --job-name = BuildJedi - --nodes={{scheduling["BuildJedi"]["nodes"]}} - --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} - --constraint={{scheduling["BuildJedi"]["constraint"]}} - - [[ GetGsiBc ]] - script = "swell_task GetGsiBc $config -d $datetime -m geos_atmosphere" - - [[ GsiBcToIoda ]] - script = "swell_task GsiBcToIoda $config -d $datetime -m geos_atmosphere" - - [[ GetGsiNcdiag ]] - script = "swell_task GetGsiNcdiag $config -d $datetime -m geos_atmosphere" - - [[ GsiNcdiagToIoda ]] - script = "swell_task GsiNcdiagToIoda $config -d $datetime -m geos_atmosphere" - - [[CleanCycle]] - script = "swell_task CleanCycle $config -d $datetime -m geos_atmosphere" - -# -------------------------------------------------------------------------------------------------- diff --git a/src/swell/suites_old/convert_ncdiags/geos_atmosphere/suites-convert_ncdiags-geos_atmosphere.yaml b/src/swell/suites_old/convert_ncdiags/geos_atmosphere/suites-convert_ncdiags-geos_atmosphere.yaml deleted file mode 100644 index 6480ac8b..00000000 --- a/src/swell/suites_old/convert_ncdiags/geos_atmosphere/suites-convert_ncdiags-geos_atmosphere.yaml +++ /dev/null @@ -1,85 +0,0 @@ -# Cycle frequency -cycle_times: - default_value: ['T00'] - prompt: List all cycle times, by middle of the window? - options: ['T00'] - type: string-check-list - -# Observations -observations: - default_value: - # Conventional - - aircraft - - gps - - satwind - - scatwind - - sfcship - - sfc - - sondes - # Radiances - - airs_aqua - - amsr2_gcom-w1 - - amsua_aqua - - amsua_metop-b - - amsua_metop-c - - amsua_n15 - - amsua_n18 - - amsua_n19 - - atms_n20 - - atms_npp - - avhrr3_metop-b - - avhrr3_n18 - - avhrr3_n19 - - cris-fsr_n20 - - cris-fsr_npp - - gmi_gpm - - iasi_metop-b - - iasi_metop-c - - mhs_metop-b - - mhs_metop-c - - mhs_n19 - - ssmis_f17 - # Ozone - - mls55_aura - - omi_aura - - ompsnm_npp - prompt: Select observations to run with. - options: use_method - type: string-check-list - -# Path to GSI ncdiags -path_to_gsi_nc_diags: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/ncdiag/2021121200' - prompt: Path to where the ncdiags will be held - type: string - -# Compute GeoVaLs and observations -produce_geovals: - default_value: true - prompt: Compute GeoVaLs as well as observations? - type: boolean - -# Location for bias correction coefficients -path_to_gsi_bc_coefficients: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/bc/2021121200' - prompt: Tar or directory containing BC files - type: string - -fixed_options: - window_offset: - default_value: PT3H - prompt: Time from beginning to middle of the window - background_time_offset: - default_value: PT9H - prompt: Time before the middle of the window that the background providing forecast began - clean_patterns: - default_value: - - gsi_bcs/*.nc4 - - gsi_bcs/*.txt - - gsi_bcs/*.yaml - - gsi_bcs - - gsi_ncdiags/*.nc4 - - gsi_ncdiags/aircraft/*.nc4 - - gsi_ncdiags/aircraft - - gsi_ncdiags - prompt: 'Patterns for the files to remove after completing a cycle' diff --git a/src/swell/suites_old/convert_ncdiags/suites-convert_ncdiags.yaml b/src/swell/suites_old/convert_ncdiags/suites-convert_ncdiags.yaml deleted file mode 100644 index c77e8437..00000000 --- a/src/swell/suites_old/convert_ncdiags/suites-convert_ncdiags.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# Cycle start point -start_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the first cycle (middle of the window)? - type: iso-datetime - -# Cycle final point -final_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the final cycle (middle of the window)? - type: iso-datetime - -# Run ahead limit for workflow -runahead_limit: - default_value: 'P4' - prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? - type: string - -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: {{existing_jedi_source_directory}} - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: {{existing_jedi_build_directory}} - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - -# Models to use -model_components: - default_value: ['geos_atmosphere'] - prompt: Select models to use (choose at least one) - options: use_method - type: file-check-list - -# Fixed options -fixed_options: - data_assimilation_run: - default_value: true - prompt: Does this workflow include data assimilation? - -# R2D2 Configuration -r2d2_local_path: - default_value: {{r2d2_local_path}} - prompt: Enter the path where R2D2 will store experiment output - type: string diff --git a/src/swell/suites_old/forecast_geos/suites-forecast_geos.yaml b/src/swell/suites_old/forecast_geos/suites-forecast_geos.yaml deleted file mode 100644 index eb24dfa3..00000000 --- a/src/swell/suites_old/forecast_geos/suites-forecast_geos.yaml +++ /dev/null @@ -1,83 +0,0 @@ -# Cycle frequency -cycle_times: - default_value: ['T00', 'T06', 'T12', 'T18'] - prompt: List all cycle times - options: ['T00', 'T06', 'T12', 'T18'] - type: string-check-list - -# Cycle start point -start_cycle_point: - default_value: '2021-06-20T00:00:00Z' - prompt: What is the time of the first cycle (middle of the window)? - type: iso-datetime - -# Cycle final point -final_cycle_point: - default_value: '2021-06-21T00:00:00Z' - prompt: What is the time of the final cycle (middle of the window)? - type: iso-datetime - -# Each forecast cycle consists of a set duration until DA -# Should be less than or equal to 1 day due to the ISO -> string conversion -forecast_duration: - default_value: 'PT6H' - prompt: What is the GEOS forecast duration? - type: string - -# Geos build system -geos_build_method: - default_value: use_existing - prompt: Create a new GEOS build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing GEOS source directory -existing_geos_gcm_source_path: - default_value: {{existing_geos_gcm_source_path}} - prompt: Provide the path to an existing GEOS bundle directory containing source code repos - type: string - depends: - key: geos_build_method - value: use_existing - -# Existing GEOS build directory -existing_geos_gcm_build_path: - default_value: {{existing_geos_gcm_build_path}} - prompt: Provide the path to an existing GEOS build directory - type: string - depends: - key: geos_build_method - value: use_existing - -# R2D2 Configuration -r2d2_local_path: - default_value: {{r2d2_local_path}} - prompt: Enter the path where R2D2 will store experiment output - type: string - -# GEOS Experiment folder, created by gcm_setup script -geos_experiment_directory: - default_value: 5deg_v11 - prompt: What experiment folder should GEOS obtain settings? - options: ['experiment_directory'] - type: string-drop-list - -# GEOS restarts folder, produced by GEOS cold start -geos_restarts_directory: - default_value: restarts_20210620_000000 - prompt: What experiment folder should GEOS obtain settings? - options: ['restarts'] - type: string-drop-list - -# Processor layout -total_processors: - default_value: '6' - prompt: How many processors to use? - type: string - -# Version of GCM being used -geos_gcm_tag: - default_value: 'v11.0.2' - prompt: Which tag of GEOS do you want to build? - options: ['v11.0.2'] - type: string-drop-list diff --git a/src/swell/suites_old/geosadas/flow.cylc b/src/swell/suites_old/geosadas/flow.cylc deleted file mode 100644 index f697e15c..00000000 --- a/src/swell/suites_old/geosadas/flow.cylc +++ /dev/null @@ -1,111 +0,0 @@ -# (C) Copyright 2021- United States Government as represented by the Administrator of the -# National Aeronautics and Space Administration. All Rights Reserved. -# -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. - -# -------------------------------------------------------------------------------------------------- - -# Cylc suite for executing JEDI-based non-cycling variational data assimilation - -# -------------------------------------------------------------------------------------------------- - -[scheduler] - UTC mode = True - allow implicit tasks = False - -# -------------------------------------------------------------------------------------------------- - -[scheduling] - - initial cycle point = 2020-12-15T00:00:00Z - final cycle point = 2020-12-15T00:00:00Z - - [[graph]] - R1 = """ - # Clone JEDI source code - CloneJedi - - # Build JEDI source code by linking - BuildJediByLinking? - - # Stage JEDI static files - CloneJedi => StageJedi - """ - - T00 = """ - # Get and convert bias correction coefficients - GetGsiBc => GsiBcToIoda - - # Get and convert ncdiags - GetGsiNcdiag => GsiNcdiagToIoda - - # Get background - GetGeosAdasBackground - - # Run Jedi variational executable - BuildJediByLinking[^] => RunJediVariationalExecutable - StageJedi[^] => RunJediVariationalExecutable - GsiBcToIoda => RunJediVariationalExecutable - GsiNcdiagToIoda => RunJediVariationalExecutable - GetGeosAdasBackground => RunJediVariationalExecutable - - # Clean cycle - RunJediVariationalExecutable => CleanCycle - """ - -# -------------------------------------------------------------------------------------------------- - -[runtime] - - # Task defaults - # ------------- - [[root]] - pre-script = "source $CYLC_SUITE_DEF_PATH/modules" - - [[[environment]]] - datetime = $CYLC_TASK_CYCLE_POINT - config = $CYLC_SUITE_DEF_PATH/experiment.yaml - - # Tasks - # ----- - [[CloneJedi]] - script = "swell_task CloneJedi $config" - - [[BuildJediByLinking]] - script = "swell_task BuildJediByLinking $config" - - [[StageJedi]] - script = "swell_task StageJedi $config -m geos_atmosphere" - - [[ GetGsiBc ]] - script = "swell_task GetGsiBc $config -d $datetime -m geos_atmosphere" - - [[ GsiBcToIoda ]] - script = "swell_task GsiBcToIoda $config -d $datetime -m geos_atmosphere" - - [[ GetGsiNcdiag ]] - script = "swell_task GetGsiNcdiag $config -d $datetime -m geos_atmosphere" - - [[ GsiNcdiagToIoda ]] - script = "swell_task GsiNcdiagToIoda $config -d $datetime -m geos_atmosphere" - - [[ GetGeosAdasBackground ]] - script = "swell_task GetGeosAdasBackground $config -d $datetime -m geos_atmosphere" - - [[RunJediVariationalExecutable]] - script = "swell_task RunJediVariationalExecutable $config -d $datetime -m geos_atmosphere" - platform = {{platform}} - execution time limit = {{scheduling["RunJediVariationalExecutable"]["execution_time_limit"]}} - [[[directives]]] - --account = {{scheduling["RunJediVariationalExecutable"]["account"]}} - --qos = {{scheduling["RunJediVariationalExecutable"]["qos"]}} - --job-name = RunJediVariationalExecutable - --nodes={{scheduling["RunJediVariationalExecutable"]["nodes"]}} - --ntasks-per-node={{scheduling["RunJediVariationalExecutable"]["ntasks_per_node"]}} - --constraint={{scheduling["RunJediVariationalExecutable"]["constraint"]}} - - [[CleanCycle]] - script = "swell_task CleanCycle $config -d $datetime -m geos_atmosphere" - -# -------------------------------------------------------------------------------------------------- diff --git a/src/swell/suites_old/geosadas/geos_atmosphere/suites-geosadas-geos_atmosphere.yaml b/src/swell/suites_old/geosadas/geos_atmosphere/suites-geosadas-geos_atmosphere.yaml deleted file mode 100644 index cc93920f..00000000 --- a/src/swell/suites_old/geosadas/geos_atmosphere/suites-geosadas-geos_atmosphere.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# Window length -window_length: - default_value: 'PT6H' - prompt: Window length for ocean data assimilation - type: iso-duration - -# Horizontal resolution -horizontal_resolution: - default_value: '361' - prompt: What resolution for the atmospheric background (For c360 choose 361)? - options: ['181', '361', '721'] - type: string-drop-list - -# Vertical resolution -vertical_resolution: - default_value: '72' - prompt: What vertical resolution for the atmospheric background? - options: ['72'] - type: string-drop-list - -# Processor layout x direction -npx_proc: - default_value: '4' - prompt: What processor layout (x-direction) per cube face? - type: string - -# Processor layout y direction -npy_proc: - default_value: '1' - prompt: What processor layout (y-direction) per cube face? - type: string - -# Analysis -analysis_variables: - default_value: [ua,va,t,ps,q,qi,ql,o3ppmv,ts,phis,frocean,frlake,frseaice] - prompt: Variables to be assimilated? - type: string - -# Observations -observations: - default_value: - - sondes - - amsua_n19 - prompt: Select observations. - options: use_method - type: string-check-list - -# Path to GSI bias correction coefficients -path_to_gsi_bc_coefficients: - default_value: /discover/nobackup/drholdaw/SwellTestData/geosadas/bc - prompt: Tar or directory containing BC files - type: string - -# Path to GSI ncdiags -path_to_gsi_nc_diags: - default_value: /discover/nobackup/drholdaw/SwellTestData/geosadas/obs - prompt: Path to where the ncdiags will be held - type: string - -# Path to GEOS adas background files -path_to_geos_adas_background: - default_value: /discover/nobackup/drholdaw/SwellTestData/geosadas/bkg/*bkg_clcv_rst* - prompt: Tar or directory containing BC files - type: string - -# Compute GeoVaLs and observations -produce_geovals: - default_value: false - prompt: Compute GeoVaLs as well as observations? - type: boolean - -# Fixed options (user not prompted for these) -# ------------------------------------------- -fixed_options: - window_type: - default_value: 3D - prompt: Window type (3D or 4D) - minimizer: - default_value: DRIPCG - prompt: Minimizer to use for gradient descent - number_of_iterations: - default_value: [2] - prompt: Number of iterations to use in the minimization - gradient_norm_reduction: - default_value: 1e-6 - prompt: Threshold for convergence of the minimization - window_offset: - default_value: PT3H - prompt: Time from beginning to middle of the window - analysis_forecast_window_offset: - default_value: -PT3H - prompt: Time from the middle of the window when forecasts start - background_time_offset: - default_value: PT1H - prompt: Time before the middle of the window that the background providing forecast began - background_frequency: - default_value: PT1H - prompt: 'Frequency of 4D backgrounds' - background_source: - default_value: file - prompt: 'Source of the background files (file or from model)' - clean_patterns: - default_value: ['*.nc4','*.txt'] - prompt: 'Patterns for the files to remove after completing a cycle' - crtm_coeff_dir: - default_value: {{crtm_coeff_dir}} - prompt: 'Directory containing the CRTM coefficient files' diff --git a/src/swell/suites_old/geosadas/suites-geosadas.yaml b/src/swell/suites_old/geosadas/suites-geosadas.yaml deleted file mode 100644 index bfbfd645..00000000 --- a/src/swell/suites_old/geosadas/suites-geosadas.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: /discover/nobackup/drholdaw/JediDev/gsibec - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: /discover/nobackup/drholdaw/JediDev/gsibec/build-intel-release/ - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - -# Models to use -model_components: - default_value: ['geos_atmosphere'] - prompt: Select models to use - options: use_method - type: file-check-list - -# Generate the YAML and then exit -generate_yaml_and_exit: - default_value: True - prompt: Generate YAML and exit? - type: boolean - -# Bundles to build -bundles: - default_value: ['fv3-jedi', 'soca', 'iodaconv', 'ufo'] - prompt: List the bundles that you wish to build - type: string-check-list - options: use_method # This method would ask jedi_bundle for the default bundles - depends: - key: jedi_build_method - value: create diff --git a/src/swell/suites_old/suites.yaml b/src/swell/suites_old/suites.yaml deleted file mode 100644 index 6b199ea4..00000000 --- a/src/swell/suites_old/suites.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Experiment name -experiment_id: - default_value: swell-{{suite_to_run}} - prompt: Enter the experiment ID - type: string - -# Location to store the experiment -experiment_root: - default_value: {{experiment_root}} - prompt: Enter the path where experiment will be staged - type: string - -# Compute platform to use -platform: - default_value: {{platform}} - prompt: Which compute platform do you wish to use? - options: use_method - type: string-drop-list - -# Type of suite to run -suite_to_run: - default_value: {{suite_to_run}} - prompt: Choose the suite to run - options: use_method - type: file-drop-list - -# Options that are questions -fixed_options: - # Swell static files - swell_static_files: - default_value: {{swell_static_files}} - prompt: Path to where the swell static files are located diff --git a/src/swell/suites_old/ufo_testing/flow.cylc b/src/swell/suites_old/ufo_testing/flow.cylc deleted file mode 100644 index c1edb926..00000000 --- a/src/swell/suites_old/ufo_testing/flow.cylc +++ /dev/null @@ -1,134 +0,0 @@ -# (C) Copyright 2021- United States Government as represented by the Administrator of the -# National Aeronautics and Space Administration. All Rights Reserved. -# -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. - -# -------------------------------------------------------------------------------------------------- - -# Cylc suite for executing geos_atmosphere ObsFilters tests - -# -------------------------------------------------------------------------------------------------- - -[scheduler] - UTC mode = True - allow implicit tasks = False - -# -------------------------------------------------------------------------------------------------- - -[scheduling] - - initial cycle point = {{start_cycle_point}} - final cycle point = {{final_cycle_point}} - runahead limit = {{runahead_limit}} - - [[graph]] - R1 = """ - # Triggers for non cycle time dependent tasks - # ------------------------------------------- - # Clone JEDI source code - CloneJedi - - # Build JEDI source code by linking - CloneJedi => BuildJediByLinking? - - # If not able to link to build create the build - BuildJediByLinking:fail? => BuildJedi - """ - - {% for cycle_time in cycle_times %} - {{cycle_time.cycle_time}} = """ - - # Convert bias correction to ioda - GetGsiBc - GetGsiBc => GsiBcToIoda - BuildJediByLinking[^]? | BuildJedi[^] => GsiBcToIoda - - # Convert ncdiags to ioda - GetGsiNcdiag - GetGsiNcdiag => GsiNcdiagToIoda - BuildJediByLinking[^]? | BuildJedi[^] => GsiNcdiagToIoda - - GetGeovals - - # Run Jedi hofx executable - GsiNcdiagToIoda => RunJediUfoTestsExecutable - GsiBcToIoda => RunJediUfoTestsExecutable - GetGeovals => RunJediUfoTestsExecutable - - # EvaObservations - RunJediUfoTestsExecutable => EvaObservations - - # Clean up large files - EvaObservations => CleanCycle - - """ - {% endfor %} - -# -------------------------------------------------------------------------------------------------- - -[runtime] - - # Task defaults - # ------------- - [[root]] - pre-script = "source $CYLC_SUITE_DEF_PATH/modules" - - [[[environment]]] - datetime = $CYLC_TASK_CYCLE_POINT - config = $CYLC_SUITE_DEF_PATH/experiment.yaml - - # Tasks - # ----- - [[CloneJedi]] - script = "swell_task CloneJedi $config" - - [[BuildJediByLinking]] - script = "swell_task BuildJediByLinking $config" - - [[BuildJedi]] - script = "swell_task BuildJedi $config" - platform = {{platform}} - execution time limit = {{scheduling["BuildJedi"]["execution_time_limit"]}} - [[[directives]]] - --account = {{scheduling["BuildJedi"]["account"]}} - --qos = {{scheduling["BuildJedi"]["qos"]}} - --job-name = BuildJedi - --nodes={{scheduling["BuildJedi"]["nodes"]}} - --ntasks-per-node={{scheduling["BuildJedi"]["ntasks_per_node"]}} - --constraint={{scheduling["BuildJedi"]["constraint"]}} - - [[ GetGsiBc ]] - script = "swell_task GetGsiBc $config -d $datetime -m geos_atmosphere" - - [[ GsiBcToIoda ]] - script = "swell_task GsiBcToIoda $config -d $datetime -m geos_atmosphere" - - [[ GetGsiNcdiag ]] - script = "swell_task GetGsiNcdiag $config -d $datetime -m geos_atmosphere" - - [[ GsiNcdiagToIoda ]] - script = "swell_task GsiNcdiagToIoda $config -d $datetime -m geos_atmosphere" - - [[ GetGeovals ]] - script = "swell_task GetGeovals $config -d $datetime -m geos_atmosphere" - - [[RunJediUfoTestsExecutable]] - script = "swell_task RunJediUfoTestsExecutable $config -d $datetime -m geos_atmosphere" - platform = {{platform}} - execution time limit = {{scheduling["RunJediUfoTestsExecutable"]["execution_time_limit"]}} - [[[directives]]] - --account = {{scheduling["RunJediUfoTestsExecutable"]["account"]}} - --qos = {{scheduling["RunJediUfoTestsExecutable"]["qos"]}} - --job-name = RunJediUfoTestsExecutable - --nodes={{scheduling["RunJediUfoTestsExecutable"]["nodes"]}} - --ntasks-per-node={{scheduling["RunJediUfoTestsExecutable"]["ntasks_per_node"]}} - --constraint={{scheduling["RunJediUfoTestsExecutable"]["constraint"]}} - - [[EvaObservations]] - script = "swell_task EvaObservations $config -d $datetime -m geos_atmosphere" - - [[CleanCycle]] - script = "swell_task CleanCycle $config -d $datetime -m geos_atmosphere" - -# -------------------------------------------------------------------------------------------------- diff --git a/src/swell/suites_old/ufo_testing/geos_atmosphere/eva_observations.yaml b/src/swell/suites_old/ufo_testing/geos_atmosphere/eva_observations.yaml deleted file mode 100644 index 904bd387..00000000 --- a/src/swell/suites_old/ufo_testing/geos_atmosphere/eva_observations.yaml +++ /dev/null @@ -1,390 +0,0 @@ -diagnostics: - -- data: - type: IodaObsSpace - datasets: - - - name: experiment - filenames: - - {{obs_path_file}} - missing_value_threshold: 1.0e06 - channels: &channels {{channels}} - groups: - - name: ObsValue - variables: &variables {{simulated_variables}} - - name: MetaData - # Jedi - - name: hofx - - name: EffectiveQC - - name: EffectiveError - # Gsi - - name: GsiHofX - - name: GsiHofXBc - - name: GsiEffectiveQC - - name: GsiFinalObsError - - transforms: - - # Hofx differences - # ---------------- - - - transform: arithmetic - new name: experiment::hofxDiff::${variable} - equals: experiment::hofx::${variable}-experiment::GsiHofX::${variable} - for: - variable: *variables - - - transform: arithmetic - new name: experiment::hofxDiffBc::${variable} - equals: experiment::hofx::${variable}-experiment::GsiHofXBc::${variable} - for: - variable: *variables - - # Observation minus Hofx - # ---------------------- - - - transform: arithmetic - new name: experiment::ObsValueMinusHofx::${variable} - equals: experiment::ObsValue::${variable}-experiment::hofx::${variable} - for: - variable: *variables - - - transform: arithmetic - new name: experiment::ObsValueMinusGsiHofX::${variable} - equals: experiment::ObsValue::${variable}-experiment::GsiHofX::${variable} - for: - variable: *variables - - - transform: arithmetic - new name: experiment::ObsValueMinusGsiHofXBc::${variable} - equals: experiment::ObsValue::${variable}-experiment::GsiHofXBc::${variable} - for: - variable: *variables - - # Effective error that passed QC - # ------------------------------ - - - transform: accept where - new name: experiment::EffectiveErrorPassedQc::${variable} - starting field: experiment::EffectiveError::${variable} - where: - - experiment::EffectiveQC::${variable} == 0 - for: - variable: *variables - - - transform: accept where - new name: experiment::FinalObsErrorPassedQc::${variable} - starting field: experiment::GsiFinalObsError::${variable} - where: - - experiment::GsiFinalObsError::${variable} > 0 - for: - variable: *variables - - # Error Difference - # ---------------- - - transform: arithmetic - new name: experiment::EffectiveErrorPassedQcDiff::${variable} - equals: experiment::FinalObsErrorPassedQc::${variable}-experiment::EffectiveErrorPassedQc::${variable} - for: - variable: *variables - - # Observation minus Hofx passing QC - # --------------------------------- - - transform: accept where - new name: experiment::ObsValueMinusHofxPassedQc::${variable} - starting field: experiment::ObsValueMinusHofx::${variable} - where: - - experiment::EffectiveQC::${variable} == 0 - for: - variable: *variables - - - transform: accept where - new name: experiment::ObsValueMinusGsiHofXPassedQc::${variable} - starting field: experiment::ObsValueMinusGsiHofX::${variable} - where: - - experiment::GsiEffectiveQC::${variable} == 0 - for: - variable: *variables - - - transform: accept where - new name: experiment::ObsValueMinusGsiHofXBcPassedQc::${variable} - starting field: experiment::ObsValueMinusGsiHofXBc::${variable} - where: - - experiment::GsiEffectiveQC::${variable} == 0 - for: - variable: *variables - - - graphics: - - # Correlation scatter JEDI h(x) vs GSI h(x) - # ----------------------------------------- - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'JEDI h(x) vs. GSI h(x) | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_a_hofx_vs_gsihofx.png' - plots: - - add_xlabel: 'GSI h(x)' - add_ylabel: 'JEDI h(x)' - add_grid: - add_legend: - loc: 'upper left' - layers: - - type: Scatter - y: - variable: experiment::hofx::${variable} - x: - variable: experiment::GsiHofX::${variable} - channel: ${channel} - markersize: 5 - color: 'blue' - label: 'JEDI h(x) versus GSI h(x)' - - # Correlation scatter JEDI h(x) vs GSI h(x) BC - # -------------------------------------------- - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'JEDI h(x) vs. GSI h(x) BC | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_b_hofx_vs_gsihofxbc.png' - plots: - - add_xlabel: 'GSI h(x) BC' - add_ylabel: 'JEDI h(x)' - add_grid: - add_legend: - loc: 'upper left' - layers: - - type: Scatter - y: - variable: experiment::hofx::${variable} - x: - variable: experiment::GsiHofXBc::${variable} - channel: ${channel} - markersize: 5 - color: 'blue' - label: 'JEDI h(x) versus GSI h(x)' - - # Correlation scatter JEDI h(x) - GSI H(x) vs GSI h(x) - # ---------------------------------------------------- - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'JEDI h(x) - GSI h(x) vs. GSI h(x) | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_c_hofxdiff_vs_gsihofx.png' - plots: - - add_xlabel: 'GSI h(x)' - add_ylabel: 'JEDI h(x) - GSI h(x)' - add_grid: - add_legend: - loc: 'upper left' - layers: - - type: Scatter - y: - variable: experiment::hofxDiff::${variable} - x: - variable: experiment::GsiHofX::${variable} - channel: ${channel} - markersize: 5 - color: 'blue' - label: 'JEDI h(x) versus GSI h(x)' - - # Correlation scatter JEDI h(x) - GSI H(x) BC vs GSI h(x) BC - # ---------------------------------------------------------- - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'JEDI h(x) - GSI h(x) BC vs. GSI h(x) BC | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_d_hofxdiffbc_vs_gsihofxbc.png' - plots: - - add_xlabel: 'GSI h(x) BC' - add_ylabel: 'JEDI h(x) - GSI h(x) BC' - add_grid: - add_legend: - loc: 'upper left' - layers: - - type: Scatter - y: - variable: experiment::hofxDiffBc::${variable} - x: - variable: experiment::GsiHofXBc::${variable} - channel: ${channel} - markersize: 5 - color: 'blue' - label: 'JEDI h(x) versus GSI h(x)' - - - # Effective Error vs GSI Final Error (Passed QC) - # ---------------------------------------------- - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'JEDI Effective Error vs. GSI FinalObsError (Passing QC) | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_e_effectiveerror_vs_gsifinalerror.png' - plots: - - add_xlabel: 'GSI FinalObsError (Passed QC)' - add_ylabel: 'JEDI Effective Error (Passed QC)' - add_grid: - add_legend: - loc: 'upper left' - layers: - - type: Scatter - y: - variable: experiment::EffectiveErrorPassedQc::${variable} - x: - variable: experiment::FinalObsErrorPassedQc::${variable} - channel: ${channel} - markersize: 5 - color: 'blue' - label: 'JEDI h(x) versus GSI h(x)' - - - # Effective Error - GSI Final Error vs GSI Final Error (Passed QC) - # ---------------------------------------------------------------- - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'JEDI Effective Error vs. GSI FinalObsError (Passing QC) | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_f_effectiveerrordiff_vs_gsifinalerror.png' - plots: - - add_xlabel: 'GSI FinalObsError (Passed QC)' - add_ylabel: 'JEDI Effective Error (Passed QC) - GSI FinalObsError (Passed QC)' - add_grid: - add_legend: - loc: 'upper left' - layers: - - type: Scatter - y: - variable: experiment::EffectiveErrorPassedQcDiff::${variable} - x: - variable: experiment::FinalObsErrorPassedQc::${variable} - channel: ${channel} - markersize: 5 - color: 'blue' - label: 'JEDI h(x) versus GSI h(x)' - - - # Density plot for observation minus background passed QC - # ------------------------------------------------------- - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'Observation minus Background Density (Passing QC) | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_g_omb_density.png' - plots: - - add_xlabel: 'Observation minus h(x)' - add_ylabel: 'Density' - add_legend: - loc: 'upper left' - statistics: - fields: - - field_name: experiment::ObsValueMinusGsiHofXPassedQc::${variable} - channel: ${channel} - xloc: 0.5 - yloc: -0.10 - kwargs: - color: 'blue' - fontsize: 8 - fontfamily: monospace - - field_name: experiment::ObsValueMinusHofxPassedQc::${variable} - channel: ${channel} - xloc: 0.5 - yloc: -0.13 - kwargs: - color: 'red' - fontsize: 8 - fontfamily: monospace - statistics_variables: - - n - - min - - mean - - max - - std - layers: - - type: Density - data: - variable: experiment::ObsValueMinusGsiHofXPassedQc::${variable} - channel: ${channel} - color: 'blue' - label: 'GSI omb (Passed QC)' - alpha: 0.5 - bw_adjust: 0.1 # Reduce this value to fit the data more closely - - type: Density - data: - variable: experiment::ObsValueMinusHofxPassedQc::${variable} - channel: ${channel} - color: 'red' - label: 'JEDI omb (Passed QC)' - alpha: 0.5 - bw_adjust: 0.1 # Reduce this value to fit the data more closely - - - # Density plot for observation minus background passed QC (bias corrected) - # ------------------------------------------------------------------------ - - batch figure: - variables: *variables - channels: *channels - figure: - layout: [1,1] - title: 'Observation minus Background Density (Passing QC) | {{instrument_title}} | ${variable_title}' - output name: '{{cycle_dir}}/eva/{{instrument}}/${variable}${channel}_h_ombbc_density.png' - plots: - - add_xlabel: 'Observation minus h(x)' - add_ylabel: 'Density' - add_legend: - loc: 'upper left' - statistics: - fields: - - field_name: experiment::ObsValueMinusGsiHofXBcPassedQc::${variable} - channel: ${channel} - xloc: 0.5 - yloc: -0.10 - kwargs: - color: 'blue' - fontsize: 8 - fontfamily: monospace - - field_name: experiment::ObsValueMinusHofxPassedQc::${variable} - channel: ${channel} - xloc: 0.5 - yloc: -0.13 - kwargs: - color: 'red' - fontsize: 8 - fontfamily: monospace - statistics_variables: - - n - - min - - mean - - max - - std - layers: - - type: Density - data: - variable: experiment::ObsValueMinusGsiHofXBcPassedQc::${variable} - channel: ${channel} - color: 'blue' - label: 'GSI omb BC (Passed QC)' - alpha: 0.5 - bw_adjust: 0.1 # Reduce this value to fit the data more closely - - type: Density - data: - variable: experiment::ObsValueMinusHofxPassedQc::${variable} - channel: ${channel} - color: 'red' - label: 'JEDI omb (Passed QC)' - alpha: 0.5 - bw_adjust: 0.1 # Reduce this value to fit the data more closely diff --git a/src/swell/suites_old/ufo_testing/geos_atmosphere/suites-ufo_testing-geos_atmosphere.yaml b/src/swell/suites_old/ufo_testing/geos_atmosphere/suites-ufo_testing-geos_atmosphere.yaml deleted file mode 100644 index 25930f5d..00000000 --- a/src/swell/suites_old/ufo_testing/geos_atmosphere/suites-ufo_testing-geos_atmosphere.yaml +++ /dev/null @@ -1,120 +0,0 @@ -# Cycle frequency -cycle_times: - default_value: ['T00'] - prompt: List all cycle times, by middle of the window? - options: ['T00'] - type: string-check-list - -# Window length -window_length: - default_value: 'PT6H' - prompt: Window length - type: iso-duration - -# Observations -observations: - default_value: - - aircraft - - gmi_gpm - - -# - airs_aqua -# - amsr2_gcom-w1 -# - amsua_aqua -# - amsua_metop-a -# - amsua_metop-b -# - amsua_metop-c -# - amsua_n15 -# - amsua_n18 -# - amsua_n19 -# - atms_n20 -# - atms_npp -# - avhrr_metop-a -# - avhrr_n18 -# - cris-fsr_n20 -# - cris-fsr_npp -# - gmi_gpm -# - gps -# - iasi_metop-a -# - iasi_metop-b -# - mhs_metop-b -# - mhs_metop-c -# - mhs_n19 -# - mls55_aura -# - omi_aura -# - ompsnm_npp -# - satwind -# - scatwind -# - seviri_m08 -# - sfcship -# - sfc -# - ssmis_f17 -# - vadwind - prompt: Select observations to run with. - options: use_method - type: string-check-list - -# Path to GSI ncdiags -path_to_gsi_nc_diags: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/ncdiag/2021121200' - prompt: Path to where the ncdiags will be held - type: string - -# Compute GeoVaLs and observations -produce_geovals: - default_value: false - prompt: Compute GeoVaLs as well as observations? - type: boolean - -# Location for bias correction coefficients -path_to_gsi_bc_coefficients: - default_value: '/discover/nobackup/drholdaw/SwellTestData/ufo_testing/bc/2021121200' - prompt: Tar or directory containing BC files - type: string - -# Observation experiment -geovals_experiment: - default_value: x0048-geovals - prompt: Experiment providing the GeoVaLs? - type: string - - -# Fixed options (user not prompted for these) -# ------------------------------------------- -fixed_options: - crtm_coeff_dir: - default_value: {{crtm_coeff_dir}} - prompt: 'Directory containing the CRTM coefficient files' - total_processors: - default_value: 1 - prompt: Equation to compute total number of processors - clean_patterns: - default_value: - - '*.nc4' - - '*.txt' - - '*.log' - - '*.yaml' - - gsi_bcs/*.nc4 - - gsi_bcs/*.txt - - gsi_bcs/*.yaml - - gsi_bcs - - gsi_ncdiags/*.nc4 - - gsi_ncdiags/aircraft/*.nc4 - - gsi_ncdiags/aircraft - - gsi_ncdiags - prompt: 'Patterns for the files to remove after completing a cycle' - # Needed because of config gen - window_type: - default_value: 4D - prompt: Window type (3D or 4D) - window_offset: - default_value: PT3H - prompt: Time from beginning to middle of the window - background_time_offset: - default_value: PT9H - prompt: Time before the middle of the window that the background providing forecast began - geovals_provider: - default_value: ncdiag - prompt: Database providing the geovals. - - diff --git a/src/swell/suites_old/ufo_testing/suites-ufo_testing.yaml b/src/swell/suites_old/ufo_testing/suites-ufo_testing.yaml deleted file mode 100644 index a145c553..00000000 --- a/src/swell/suites_old/ufo_testing/suites-ufo_testing.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# Cycle start point -start_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the first cycle (middle of the window)? - type: iso-datetime - -# Cycle final point -final_cycle_point: - default_value: '2021-12-12T00:00:00Z' - prompt: What is the time of the final cycle (middle of the window)? - type: iso-datetime - -# Run ahead limit for workflow -runahead_limit: - default_value: 'P4' - prompt: Since this suite is non-cycling choose how many hours the workflow can run ahead? - type: string - -# Jedi build system -jedi_build_method: - default_value: use_existing - prompt: Create a new JEDI build or use an existing build? - options: ['create', 'use_existing'] - type: string-drop-list - -# Existing JEDI bundle directory -existing_jedi_source_directory: - default_value: {{existing_jedi_source_directory}} - prompt: Provide the path to an existing JEDI bundle directory containing source code repos - type: string - depends: - key: jedi_build_method - value: use_existing - -# Existing JEDI build -existing_jedi_build_directory: - default_value: {{existing_jedi_build_directory}} - prompt: Provide the path to an existing JEDI build directory - type: string - depends: - key: jedi_build_method - value: use_existing - -# R2D2 Configuration -r2d2_local_path: - default_value: {{r2d2_local_path}} - prompt: Enter the path where R2D2 will store experiment output - type: string - -# Models to use -model_components: - default_value: ['geos_atmosphere'] - prompt: Select models to use (choose at least one) - options: use_method - type: file-check-list - -# Fixed options -fixed_options: - data_assimilation_run: - default_value: true - prompt: Does this workflow include data assimilation? diff --git a/src/swell/tasks/eva_jedi_log.py b/src/swell/tasks/eva_jedi_log.py index 84563b90..ef19d0ab 100644 --- a/src/swell/tasks/eva_jedi_log.py +++ b/src/swell/tasks/eva_jedi_log.py @@ -30,8 +30,8 @@ def execute(self): # Read Eva template file into dictionary # -------------------------------------- - exp_suite_path = os.path.join(self.experiment_path(), self.experiment_id()+'-suite') - eva_config_file = os.path.join(exp_suite_path, f'eva_jedi_log-{model}.yaml') + eva_path = os.path.join(self.experiment_path(), self.experiment_id()+'-suite', 'eva') + eva_config_file = os.path.join(eva_path, f'jedi_log-{model}.yaml') with open(eva_config_file, 'r') as eva_config_file_open: eva_str_template = eva_config_file_open.read() diff --git a/src/swell/tasks/eva_observations.py b/src/swell/tasks/eva_observations.py index 5be0be46..07ee23ae 100644 --- a/src/swell/tasks/eva_observations.py +++ b/src/swell/tasks/eva_observations.py @@ -42,8 +42,8 @@ def execute(self): # Read Eva template file into dictionary # -------------------------------------- - exp_suite_path = os.path.join(self.experiment_path(), self.experiment_id()+'-suite') - eva_config_file = os.path.join(exp_suite_path, f'eva_observations-{model}.yaml') + eva_path = os.path.join(self.experiment_path(), self.experiment_id()+'-suite', 'eva') + eva_config_file = os.path.join(eva_path, f'observations-{model}.yaml') with open(eva_config_file, 'r') as eva_config_file_open: eva_str_template = eva_config_file_open.read() diff --git a/src/swell/tasks/prepare_analysis.py b/src/swell/tasks/prepare_analysis.py index d05765dd..b8ae1790 100644 --- a/src/swell/tasks/prepare_analysis.py +++ b/src/swell/tasks/prepare_analysis.py @@ -29,12 +29,6 @@ def execute(self): self.logger.info('Preparing analysis and updating restarts') - # This will change with different model types - # -------------------------------- - self.jedi_rendering.add_key('total_processors', self.config.total_processors(None)) - model_component_meta = self.jedi_rendering.render_interface_meta() - self.SOCA_dict = model_component_meta['variables'] - # Current and restart time objects # -------------------------------- self.current_cycle = os.path.basename(self.forecast_dir()) @@ -116,8 +110,15 @@ def replace_ocn(self, f_rst): ds_ana.renameDimension('yaxis_1', 'lath') ds_ana.renameDimension('zaxis_1', 'Layer') + SOCA_dict = { + 'h': 'hocn', + 'socn': 'Salt', + 'ssh': 'ave_ssh', + 'tocn': 'Temp', + } + for soca_var in self.soca_ana: - var = self.SOCA_dict[soca_var] + var = SOCA_dict[soca_var] self.logger.info(f'Updating {var} in restart') ds_rst.variables[var][:] = ds_ana.variables[var][:] diff --git a/src/swell/tasks/task_questions.yaml b/src/swell/tasks/task_questions.yaml index 68f87d47..9de915a8 100644 --- a/src/swell/tasks/task_questions.yaml +++ b/src/swell/tasks/task_questions.yaml @@ -85,6 +85,10 @@ bundles: - fv3-jedi - soca - iodaconv + - ufo + depends: + key: jedi_build_method + value: create options: - fv3-jedi - soca @@ -173,7 +177,7 @@ existing_jedi_source_directory: forecast_duration: ask_question: true - default_value: defer_to_model + default_value: P1D models: - all prompt: GEOS forecast duration @@ -224,7 +228,7 @@ geos_bkg_tar_filename_template: geos_build_method: ask_question: true - default_value: use_existing + default_value: create options: - use_existing - create @@ -323,7 +327,7 @@ jedi_bkg_filename_template: jedi_build_method: ask_question: true - default_value: use_existing + default_value: create options: - use_existing - create @@ -495,8 +499,8 @@ static_background_error_model: swell_static_files: ask_question: false default_value: defer_to_platform - models: - - all + #models: + #- all prompt: What is the path to the Swell Static files directory? tasks: - GenerateBClimatology @@ -509,8 +513,6 @@ swell_static_files: swell_static_files_user: ask_question: false default_value: None - models: - - all prompt: What is the path to the user provided Swell Static Files directory? tasks: - GenerateBClimatologyByLinking @@ -525,8 +527,6 @@ total_processors: tasks: - GenerateBClimatology - GenerateBClimatologyByLinking - - PrepareAnalysis - - RunGeosExecutable - RunJediHofxExecutable - RunJediVariationalExecutable type: integer @@ -585,12 +585,12 @@ window_offset: window_type: ask_question: true - default_value: 4D + default_value: defer_to_model models: - all options: - - 3D - - 4D + - '3D' + - '4D' prompt: Do you want to use a 3D or 4D (including FGAT) window? tasks: - GetBackground diff --git a/src/swell/suites_old/__init__.py b/src/swell/test/code_tests/__init__.py similarity index 100% rename from src/swell/suites_old/__init__.py rename to src/swell/test/code_tests/__init__.py diff --git a/src/swell/test/test_suite.py b/src/swell/test/code_tests/code_tests.py similarity index 88% rename from src/swell/test/test_suite.py rename to src/swell/test/code_tests/code_tests.py index e07feacd..fb20073e 100644 --- a/src/swell/test/test_suite.py +++ b/src/swell/test/code_tests/code_tests.py @@ -11,8 +11,8 @@ import os import unittest -from swell.test.question_dictionary_comparison_test import QuestionDictionaryTest -from swell.test.unused_variables_test import UnusedVariablesTest +from swell.test.code_tests.question_dictionary_comparison_test import QuestionDictionaryTest +from swell.test.code_tests.unused_variables_test import UnusedVariablesTest from swell.utilities.logger import Logger diff --git a/src/swell/test/question_dictionary_comparison_test.py b/src/swell/test/code_tests/question_dictionary_comparison_test.py similarity index 100% rename from src/swell/test/question_dictionary_comparison_test.py rename to src/swell/test/code_tests/question_dictionary_comparison_test.py diff --git a/src/swell/test/unused_variables_test.py b/src/swell/test/code_tests/unused_variables_test.py similarity index 100% rename from src/swell/test/unused_variables_test.py rename to src/swell/test/code_tests/unused_variables_test.py diff --git a/src/swell/test/suite_tests/3dvar-stable_build-ocean-5deg.yaml b/src/swell/test/suite_tests/3dvar-stable_build-ocean-5deg.yaml new file mode 100644 index 00000000..5cf93ff0 --- /dev/null +++ b/src/swell/test/suite_tests/3dvar-stable_build-ocean-5deg.yaml @@ -0,0 +1,36 @@ +start_cycle_point: '2021-07-01T12:00:00Z' +final_cycle_point: '2021-07-01T12:00:00Z' +jedi_build_method: use_existing +existing_jedi_source_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/ +existing_jedi_build_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/build-intel-release/ +model_components: ['geos_ocean'] +models: + geos_ocean: + cycle_times: + - T12 + window_length: P1D + window_offset: PT12H + horizontal_resolution: 72x36 + vertical_resolution: '50' + total_processors: 6 + obs_experiment: s2s_v1 + observations: + - adt_3a_egm2008 + - adt_3b_egm2008 + - adt_c2_egm2008 + - adt_j3_egm2008 + - adt_sa_egm2008 + - sst_ostia + - salt_profile_fnmoc + - sss_smos_esa + - sss_trak_fnmoc + - sst_gmi_l3u + - sst_ship_fnmoc + - sst_trak_fnmoc + - temp_profile_fnmoc + obs_provider: gdas_marine + analysis_forecast_window_offset: -PT12H + background_time_offset: PT18H + clean_patterns: + - '*.nc4' + - '*.txt' diff --git a/src/swell/test/suite_tests/3dvar_cycle-stable_build-ocean-5deg.yaml b/src/swell/test/suite_tests/3dvar_cycle-stable_build-ocean-5deg.yaml new file mode 100644 index 00000000..f618fb83 --- /dev/null +++ b/src/swell/test/suite_tests/3dvar_cycle-stable_build-ocean-5deg.yaml @@ -0,0 +1,46 @@ +start_cycle_point: '2021-06-21T12:00:00Z' +final_cycle_point: '2021-06-24T12:00:00Z' +jedi_build_method: use_existing +existing_jedi_source_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/ +existing_jedi_build_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/build-intel-release/ +geos_build_method: use_existing +existing_geos_gcm_source_path: /discover/nobackup/projects/gmao/SIteam/Models/GEOSgcm-v11.0.2/GEOSgcm +existing_geos_gcm_build_path: /discover/nobackup/projects/gmao/SIteam/Models/GEOSgcm-v11.0.2/GEOSgcm/install-Release +model_components: ['geos_ocean'] +models: + geos_ocean: + cycle_times: + - T00 + - T06 + - T12 + - T18 + window_length: P1D + window_offset: PT12H + horizontal_resolution: 72x36 + vertical_resolution: '50' + total_processors: 6 + obs_experiment: s2s_v1 + observations: + - adt_3a_egm2008 + - adt_3b_egm2008 + - adt_c2_egm2008 + - adt_j3_egm2008 + - adt_sa_egm2008 + - sst_ostia + - salt_profile_fnmoc + - sss_smos_esa + - sss_trak_fnmoc + - sst_gmi_l3u + - sst_ship_fnmoc + - sst_trak_fnmoc + - temp_profile_fnmoc + number_of_iterations: + - 10 + obs_provider: gdas_marine + analysis_forecast_window_offset: -PT12H + background_time_offset: P1DT12H + clean_patterns: + - '*.nc4' + - '*.txt' + - '*.rc' + - '*.bin' diff --git a/src/swell/test/suite_tests/convert_ncdiags-stable_build.yaml b/src/swell/test/suite_tests/convert_ncdiags-stable_build.yaml new file mode 100644 index 00000000..e9198eb7 --- /dev/null +++ b/src/swell/test/suite_tests/convert_ncdiags-stable_build.yaml @@ -0,0 +1,19 @@ +final_cycle_point: '2021-12-12T00:00:00Z' +jedi_build_method: use_existing +existing_jedi_source_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/ +existing_jedi_build_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/build-intel-release/ +bundles: REMOVE +model_components: ['geos_atmosphere'] +models: + geos_atmosphere: + cycle_times: + - T00 + clean_patterns: + - gsi_bcs/*.nc4 + - gsi_bcs/*.txt + - gsi_bcs/*.yaml + - gsi_bcs + - gsi_ncdiags/*.nc4 + - gsi_ncdiags/aircraft/*.nc4 + - gsi_ncdiags/aircraft + - gsi_ncdiags diff --git a/src/swell/test/suite_tests/forecast_geos-stable_build.yaml b/src/swell/test/suite_tests/forecast_geos-stable_build.yaml new file mode 100644 index 00000000..af650fed --- /dev/null +++ b/src/swell/test/suite_tests/forecast_geos-stable_build.yaml @@ -0,0 +1,6 @@ +start_cycle_point: '2021-06-20T00:00:00Z' +final_cycle_point: '2021-06-21T00:00:00Z' +geos_build_method: use_existing +existing_geos_gcm_source_path: /discover/nobackup/projects/gmao/SIteam/Models/GEOSgcm-v11.0.2/GEOSgcm +existing_geos_gcm_build_path: /discover/nobackup/projects/gmao/SIteam/Models/GEOSgcm-v11.0.2/GEOSgcm/install-Release +forecast_duration: PT6H diff --git a/src/swell/test/suite_tests/geosadas-stable_build.yaml b/src/swell/test/suite_tests/geosadas-stable_build.yaml new file mode 100644 index 00000000..c7440be4 --- /dev/null +++ b/src/swell/test/suite_tests/geosadas-stable_build.yaml @@ -0,0 +1,15 @@ +jedi_build_method: use_existing +existing_jedi_source_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/ +existing_jedi_build_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/build-intel-release/ +bundles: REMOVE +model_components: ['geos_atmosphere'] +models: + geos_atmosphere: + observations: + - sondes + - amsua_n19 + produce_geovals: false + window_type: 3D + gradient_norm_reduction: 1e-6 + number_of_iterations: + - 50 diff --git a/src/swell/test/suite_tests/hofx-stable_build.yaml b/src/swell/test/suite_tests/hofx-stable_build.yaml new file mode 100644 index 00000000..f73aa021 --- /dev/null +++ b/src/swell/test/suite_tests/hofx-stable_build.yaml @@ -0,0 +1,13 @@ +jedi_build_method: use_existing +existing_jedi_source_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/ +existing_jedi_build_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/build-intel-release/ +bundles: REMOVE +models: + geos_atmosphere: + observations: + - aircraft + - gmi_gpm + - amsr2_gcom-w1 + - mls55_aura + - omi_aura + - ompsnm_npp diff --git a/src/swell/test/suite_tests/ufo_testing-stable_build.yaml b/src/swell/test/suite_tests/ufo_testing-stable_build.yaml new file mode 100644 index 00000000..a7a2d90e --- /dev/null +++ b/src/swell/test/suite_tests/ufo_testing-stable_build.yaml @@ -0,0 +1,27 @@ +final_cycle_point: '2021-12-12T00:00:00Z' +jedi_build_method: use_existing +existing_jedi_source_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/ +existing_jedi_build_directory: /discover/nobackup/gmao_ci/swell/nightly/latest/jedi_build/build-intel-release/ +bundles: REMOVE +model_components: ['geos_atmosphere'] +models: + geos_atmosphere: + cycle_times: + - T00 + observations: + - aircraft + - gmi_gpm + produce_geovals: false + clean_patterns: + - '*.nc4' + - '*.txt' + - '*.log' + - '*.yaml' + - gsi_bcs/*.nc4 + - gsi_bcs/*.txt + - gsi_bcs/*.yaml + - gsi_bcs + - gsi_ncdiags/*.nc4 + - gsi_ncdiags/aircraft/*.nc4 + - gsi_ncdiags/aircraft + - gsi_ncdiags diff --git a/src/swell/utilities/config.py b/src/swell/utilities/config.py index 1df11841..bb9e82d6 100644 --- a/src/swell/utilities/config.py +++ b/src/swell/utilities/config.py @@ -56,7 +56,12 @@ def __init__(self, input_file, logger, task_name, model): # Save some things that all tasks can use self.__experiment_root__ = experiment_dict.get('experiment_root') self.__experiment_id__ = experiment_dict.get('experiment_id') - self.__model_components__ = experiment_dict.get('model_components') + + # If experiment_dict contains models key add the model components to the object + if 'models' in experiment_dict.keys(): + self.__model_components__ = list(experiment_dict['models'].keys()) + else: + self.__model_components__ = None # Step1: flatten the dictionary based on the model # ------------------------------------------------ diff --git a/src/swell/utilities/dictionary.py b/src/swell/utilities/dictionary.py index ee58d8d2..7bf41a06 100644 --- a/src/swell/utilities/dictionary.py +++ b/src/swell/utilities/dictionary.py @@ -75,7 +75,7 @@ def add_comments_to_dictionary(dictionary_string, comment_dictionary): for ind, dict_str_item in enumerate(dict_str_items): - if key + ':' in dict_str_item: + if dict_str_item[0:len(key)+1] == key + ':': dict_str_items.insert(max(0, ind), '\n# ' + comment_dictionary[key]) break @@ -87,7 +87,7 @@ def add_comments_to_dictionary(dictionary_string, comment_dictionary): for line in range(index_of_key, len(dict_str_items)): - if key_hierarchy + ':' in dict_str_items[line]: + if ' ' + key_hierarchy + ':' in dict_str_items[line]: index_of_key = line @@ -96,6 +96,10 @@ def add_comments_to_dictionary(dictionary_string, comment_dictionary): dict_str_items.insert(max(0, index_of_key), '\n' + indent + '# ' + comment_dictionary[key]) + # Remove empty line at the beginning + if dict_str_items[0][0] == '\n': + dict_str_items[0] = dict_str_items[0][1:] + dictionary_string_with_comments = '\n'.join(dict_str_items) return dictionary_string_with_comments @@ -132,10 +136,10 @@ def write_dict_to_yaml(dictionary, file): # -------------------------------------------------------------------------------------------------- -def update_dict(original_dict, overwrite_dict): +def update_dict(orig_dict, overwrite_dict): # Create output dictionary from original dictionary - output_dict = original_dict.copy() + output_dict = orig_dict.copy() for key, value in overwrite_dict.items(): if isinstance(value, dict) and key in output_dict and isinstance(output_dict[key], dict): @@ -147,3 +151,18 @@ def update_dict(original_dict, overwrite_dict): # -------------------------------------------------------------------------------------------------- + + +def dictionary_override(logger, orig_dict, override_dict): + for key, value in override_dict.items(): + if value == 'REMOVE': + orig_dict.pop(key, None) + elif isinstance(value, dict) and key in orig_dict and isinstance(orig_dict[key], dict): + dictionary_override(logger, orig_dict[key], value) + else: + orig_dict[key] = value + + return orig_dict + + +# -------------------------------------------------------------------------------------------------- diff --git a/src/swell/utilities/logger.py b/src/swell/utilities/logger.py index ab43ad26..8b02bc89 100644 --- a/src/swell/utilities/logger.py +++ b/src/swell/utilities/logger.py @@ -20,6 +20,19 @@ # # -------------------------------------------------------------------------------------------------- + +red = '\033[91m' +blue = '\033[94m' +cyan = '\033[96m' +green = '\033[92m' +end = '\033[0m' + +under = '\033[4m' + + +# -------------------------------------------------------------------------------------------------- + + class Logger: def __init__(self, task_name): @@ -65,7 +78,12 @@ def send_message(self, level, message, wrap): level_show = level_show+' '+self.task_name+': ' if level == 'ABORT': - level_show = 'ABORT IN '+self.task_name+': ' + task_name = under + self.task_name + end + level_show = red + 'ABORT IN ' + end + task_name+': ' + + color = end + if level == 'ABORT': + color = red if level == 'ABORT' or self.loggerdict[level]: if level == 'ABORT': @@ -73,7 +91,7 @@ def send_message(self, level, message, wrap): first_line = True for message_item in message_items: if not first_line: - message_item = ' ' + message_item + message_item = ' ' + color + message_item + end print(level_show+message_item) first_line = False @@ -111,10 +129,17 @@ def blank(self, message, wrap=True): def abort(self, message, wrap=True): + # Make the text red + message = red + message + end + self.send_message('ABORT', message, wrap) # Get traceback stack (without logger.py lines) filtered_stack = [line for line in traceback.format_stack() if 'logger.py' not in line] + + # Remove everything after 'logger.assert_abort' in last element of filtered_stack + filtered_stack[-1] = filtered_stack[-1].split('logger.assert_abort')[0] + traceback_str = '\n'.join(filtered_stack) # Exit with traceback