Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow names of external model files to be different on disk vs. from …
…HPSS (#221) Allow names of external model files to be different on disk vs. from HPSS. Motivation: ---------- At least on jet, the names of the external model files can be different depending on whether they are being copied from disk or are being extracted from an archive file in HPSS (for the same external model). Currently, the workflow assumes that these file names are the same regardless of where/how they are being obtained. Thus, the workflow breaks on jet. This PR generalizes the workflow to allow for the external model file names to be different (if necessary) depending on where/how they're being obtained. Summary of Modifications: ------------------------ * Allow the names of the external model files copied from or linked to on disk to be different than the ones extracted from an archive file in HPSS. This is the case on jet. * In each of the get_extrn_ics and get_extrn_lbcs workflow tasks, after obtaining the external model files (either from disk or from HPSS), create a new file and save in it certain parameters that depend on this process of obtaining the external model files (e.g. the names of the external model files that were obtained, since now these names depend on whether they are obtained from disk or HPSS). Note that one file is created for the get_extrn_ics task and another one for the get_extrn_lbcs task. These two files are actually shell scripts containing variable definitions that get sourced later by the make_ics and make_lbcs tasks, respectively. This change removes the need to call the get_extrn_mdl_file_dir_info again as part of the make_ics and make_lbcs tasks. * Modify the way the temporary fix for the suite_FV3_GFS_2017_gfdlmp_regional physics suite works such that the suite definition file (SDF) is not changed in the ufs_weather_model directory where the clone of the ufs-weather-model repo is located (so that no changes to tracked files are reported in the clone of that repo) and instead, the SDF is first copied to the experiment directory and changed there. Modifications common to more than one file (used below in listing of file-by-file modifications): ------------------------------------------------------------------------------------------------ (A) Rename local variables to be lower case. (B) Fix/add/delete comments and/or informational and/or error messages. (C) Remove theia stanza in machine-dependent case-statement. (D) Remove calls to save_shell_opts and restore_shell_opts in the machine-dependent case-statement because those calls were to suppress output from the "module load" commands that were previously located in this case-statement, but the "module load"s have been moved out of this case-statement and into the ush/load_modules_run_task.sh script. (E) Remove the call to the get_extrn_mdl_file_dir_info funtion because the information that this call returned is now obtained by sourcing new variable definition files created by the get_extrn_ics and get_extrn_lbcs workflow tasks. The full paths to these new files (actually shell scripts that just contain the variable definitions) are, respectively: ${EXPT_DIR}/${CYCLE_DIR}/${EXTRN_MDL_NAME_ICS}/ICS/extrn_mdl_ics_var_defns.sh ${EXPT_DIR}/${CYCLE_DIR}/${EXTRN_MDL_NAME_LBCS}/LBCS/extrn_mdl_ics_var_defns.sh (F) Remove some of the arguments to the call to scripts/exregional_make_ics.sh since those arguments are now obtained by sourcing the new variable definitions file extrn_mdl_ics_var_defns.sh created by the get_extrn_ics task. (G) Remove some of the arguments to the call to scripts/exregional_make_lbcs.sh since those arguments are now obtained by sourcing the new variable definitions file extrn_mdl_lbcs_var_defns.sh created by the get_extrn_lbcs task. (H) For clarity, change name of workflow variable from EXTRN_MDL_LBC_UPDATE_FHRS to EXTRN_MDL_LBC_SPEC_FHRS (where "SPEC_FHRS" stands for specification forecast hours, because the LBCs aren't being updated at these forecast hours, they're being specified). Also, do same for the local (i.e. lowercase) version of this variable. (I) For clarity, change name of workflow variable from LBC_UPDATE_INTVL_HRS to LBC_SPEC_INTVL_HRS for the same reason as explained above in (I). (J) Change LBC_SPEC_INTVL_HRS from 6 to 3 to test having more than one LBC specification time after hour 0 (the forecast goes to hour 6). For now, do this only for those WE2E tests having both EXTRN_MDL_NAME_ICS and EXTRN_MDL_NAME_LBCS set to "FV3GFS". Don't do it for the external model being set to "GSMGFS" because that model does not provide output with 3-hour frequency, only 6-hour frequency (I think). File-by-file modifications: -------------------------- jobs/JREGIONAL_GET_EXTRN_MDL_FILES: (A), (B), (H) * Use the function check_var_valid_vals to ensure that the value specified for ICS_OR_LBCS is valid. * In the call to the function get_extrn_mdl_file_dir_info, instead of returning only one set of external model file names (varname_extrn_mdl_fns), return two sets -- one if the files are on disk (varname_extrn_mdl_fns_on_disk) and another if the files are in archive file on HPSS (varname_extrn_mdl_fns_in_arcv). jobs/JREGIONAL_MAKE_ICS: (A), (B), (C), (D), (E), (F) jobs/JREGIONAL_MAKE_LBCS: (A), (B), (C), (D), (E), (G) jobs/JREGIONAL_RUN_POST: (B) scripts/exregional_get_extrn_files.sh: * Rename to scripts/exregional_get_extrn_mdl_files.sh. See below for other changes. scripts/exregional_get_extrn_mdl_files.sh: (A), (B), (H) * Add new input argument ics_or_lbcs instead of assuming that an environment variable named ICS_OR_LBCS exists. * Add new input argument extrn_mdl_cdate that will be written to the new variable definition file (extrn_mdl_ics_var_defns.sh or extrn_mdl_lbcs_var_defns.sh) that this script now creates (see bullet point below). * Replace input argument EXTRN_MDL_FNS with the two new input arguments extrn_mdl_fns_on_disk and extrn_mdl_fns_in_arcv that are the external model file names if copying them from disk and if extracting them from an archive file(s), respectively. Also, replace EXTRN_MDL_FNS throughout the script with either extrn_mdl_fns_on_disk or extrn_mdl_fns_in_arcv as appropriate. This is part of the modifications to allow the names of the external model files copied from or linked to on disk to be different than the ones extracted from an archive file in HPSS (which is the case on jet). * Remove the fix for resetting external model file names on jet because this is now done by the use of two different input arguments for the file names (extrn_mdl_fns_on_disk and extrn_mdl_fns_in_arcv). * Add code that, after the external model files are obtained (copied, linked to, or extracted from archive), creates a new file (a shell script) that contains the definitions of several external-model related variables that will be needed by downstream tasks. For the ICs (i.e. the get_extrn_ics task), the full path to this file is at ${EXPT_DIR}/${CYCLE_DIR}/${EXTRN_MDL_NAME_ICS}/ICS/extrn_mdl_ics_var_defns.sh For the LBCs (i.e. the get_extrn_ics task), the full path to this file is at ${EXPT_DIR}/${CYCLE_DIR}/${EXTRN_MDL_NAME_LBCS}/LBCS/extrn_mdl_ics_var_defns.sh These files are sourced by the make_ics and make_lbcs tasks, respectively, to obtain the necessary variable definitions. scripts/exregional_make_ics.sh: (A), (B), (F) scripts/exregional_make_lbcs.sh: (A), (B), (G), (H) tests/baseline_configs/config.nco_conus.sh: (I), (J) tests/baseline_configs/config.nco_conus_c96.sh: (I), (J) tests/baseline_configs/config.new_JPgrid.sh: (I), (J) tests/baseline_configs/config.regional_001.sh: (I) tests/baseline_configs/config.regional_002.sh: (I), (J) tests/baseline_configs/config.regional_003.sh: (I) tests/baseline_configs/config.regional_004.sh: (I) tests/baseline_configs/config.regional_005.sh: (I) tests/baseline_configs/config.regional_006.sh: (I), (J) tests/baseline_configs/config.regional_007.sh: (I), (J) tests/baseline_configs/config.regional_008.sh: (I), (J) tests/baseline_configs/config.regional_009.sh: (I) tests/baseline_configs/config.regional_010.sh: (I) tests/baseline_configs/config.regional_011.sh: (I) tests/baseline_configs/config.regional_012.sh: (I) tests/baseline_configs/config.regional_013.sh: (I) tests/baseline_configs/config.regional_014.sh: (I) tests/baseline_configs/config.regional_015.sh: (I), (J) ush/config_defaults.sh: (B), (I) * Add the new workflow variables EXTRN_MDL_ICS_VAR_DEFNS_FN and EXTRN_MDL_LBCS_VAR_DEFNS_FN that specify the names of the two new external-model-associated variable definitions files that the get_extrn_ics and get_extrn_lbcs now create. * Remove extra spaces at ends of elements of array CYCLEDIR_LINKS_TO_FIXam_FILES_MAPPING. ush/generate_FV3SAR_wflow.sh: (I) * Put in an if-statement that renames the temporary SDF (suite_FV3_GFS_2017_gfdlmp_regional.xml.tmp) created in the experiment directory by the temporay fix in ush/setup.sh (see below) for the FV3_GFS_2017_gfdlmp_regional physics suite to the actual suite file (suite_FV3_GFS_2017_gfdlmp_regional.xml). This code needs to be removed once the SDF for this physics suite is fixed in the dtc/develop branch of the NCAR fork of the ufs-weather-model repo. ush/get_extrn_mdl_file_dir_info.sh: (A), (C), (H) * In the arguments list, instead of returning only one set of external model file names (varname_extrn_mdl_fns), return two sets -- one if the files are on disk (varname_extrn_mdl_fns_on_disk) and another if the files are in archive file on HPSS (varname_extrn_mdl_fns_in_arcv). * Remove some unused code. * Add new local variables needed to create sets of file names for both the on-disk case and the in-archive-file case. * Allow the input argument anl_or_fcst to contain a value that is either upper case or lower case (instead of just upper case as before). * Change code to specify both the local array variables fns_on_disk and fns_in_arcv instead of the single array variable fns. These two new variables are (so far) the same on all machines except Jet, in which case they may be different depending on the external model considered. * Change the way output variables are set so that each is set only if the corresponding input argument that specifies its name is not empty. This way, if certain output variables are not needed, the user can simply not specify them in the call to this function (in which case the process_args function will simply set them to empty strings) and not obtain any errors. ush/set_ozone_param.sh: (B) ush/setup.sh: (A), (I) * Change the code that is a temporary fix for the fact that the SDF for the FV3_GFS_2017_gfdlmp_regional physics suite in the dtc/develop branch of the NCAR fork of the ufs-weather-model repo is currently incorrect so that it first copies the suite defintion file to the experiment directory and makes fixes to it there (instead of fixing it directly in its original location at sorc/ufs_weather_model/...). As part of this change: a) Move the creation of the experiment directory (EXPTDIR) to before the temporary code. b) Move the original code that calls the function set_ozone_param in the else" portion of the "if" statement that runs the temporary code. These two changes can be undone later after the temporary code is removed.
- Loading branch information