Skip to content

Commit

Permalink
rrfs_ci: Update to top of authoritative develop (#374)
Browse files Browse the repository at this point in the history
* Add missing user-defined stochastic physics options; fix stochastic physics seed generation script (ufs-community#704)

## DESCRIPTION OF CHANGES: 
Add missing user-defined options for tendency-based stochastic physics and fix the ensemble-based seed generation script to work regardless of whether stochastic physics is turned on or not.

## TESTS CONDUCTED: 
Tested on Hera using the following WE2E configurations with and without stochastic physics:

config.grid_RRFS_CONUS_3km_ics_HRRR_lbcs_RAP_suite_HRRR.sh
config.community_ensemble_2mems.sh

## ISSUE (optional): 
[Issue ufs-community#702](ufs-community#702)

## CONTRIBUTORS (optional): 
Thanks to @mkavulich and @chan-hoo for finding this problem.

* Add namelist option for netCDF4 when running with the 3-km NA domain; update NAM HPSS settings and WE2E tests (ufs-community#707)

* Change to netcdf4 when using the NA 3-km domain

* Update HPSS paths for NAM data

* Update NAM HPSS locations and dates for WE2E tests.

* Remove lines from merge.

* Tweaks to allow compiler and build_env_fn to be specified in the run_WE2E_test.sh script (ufs-community#711)

* Changed 20200304 to 20200303 in ush/mrms_pull_topofhour.py (ufs-community#712)

* Remove unused rocoto directory in ush (ufs-community#720)

* Fix bug for nco we2e tests on Orion; re-organize we2e input data and nco we2e tests (ufs-community#713)

* Update machine script for orion

* Update machine script for wcoss_dell_p3

* Update we2e run script for wcoss and orion

* Reorganize nco we2e tests

* remove machine based logic

* Add symlink for nco inline post test

* Added stand-alone verification scripts (feature/issue_683_standaloneVX) (ufs-community#726)

* Grid-stat and point-stat run scripts.

* Stand-alone scripts for verification.

* Added comments to gridvx scripts.

* Added qsub_job.sh and added comments to provide context on running Vx.

* remove machine base logic (ufs-community#727)

* Allow user-defined file names for input template files (ufs-community#717)

* Allow multiple template names

* parameterize file_TMPL_FN and add a we2e test

* Increase maxtries_task for make_grid/orog/sfc_climo

* Modify file name and description

* Changes to RRFS 3- and 13-km domains, setup.sh script bug fixes, make_ics task modification, and tweaks to stochastic physics namelist settings (ufs-community#721)

* Modify RRFS North America 3- and 13-km domain configuration and WE2E test.

* Change sotyp_from_climo to "true" based on operational RAP grib2 files.

* Update for changes to stochastic physics namelist options.

* Check for DO_ENSEMBLE="TRUE" when running ensemble verification and turn of VX when running in NCO mode.

* Revert to 3-km domain.

* Remove commented-out GFDL grid for the RRFS_NA_13km domain

* Add RRFS_NA_13km WE2E test

* Changes to comments.

* Adding 25 km tests to Jet/Hera suites. (ufs-community#718)

* Add a small 3km predefined grid over Indianapolis for testing (ufs-community#725)

* Add 3km grid over Indianapolis.  This is about 600km x 600km in extent (200 x 200 grid points).  It is intended for use in the WE2E tests.

* Edit comments.

* Use Python tool for get_extrnl_mdl_file tasks (ufs-community#681)

These changes hook in the Python-based data ingest tool, replacing the previous scripts that handled this work as part of the get_extrn_mdl_file task. No attempt was made in this PR to replace the NOMADS fetching script with the Python utility, but the NOMADS data location has been added to the data_locations.yml file.

The functionality to write the data summary file has also been added to the Python tool to match the capabilities of the existing workflow tools.

* Increase size of RRFS CONUS grid (ufs-community#724)

Co-authored-by: Benjamin.Blake EMC <[email protected]>
Co-authored-by: Benjamin.Blake EMC <[email protected]>
Co-authored-by: Benjamin.Blake EMC <[email protected]>
Co-authored-by: chan-hoo <[email protected]>

* add include-style quality mark options in metplus confs (ufs-community#738)

* Add Gaea as a supported platform for the regional_workflow (ufs-community#734)

* Updates to port regional workflow to gaea

* Temp change with -v as batch option

* new fixes for gaea/slurm

* Updated time for make lbcs

* added TEST data directory path

* Update gaea.sh

* fixes for PR

* Add more parameters to CSV file containing WE2E test info (ufs-community#740)

## DESCRIPTION OF CHANGES: 
The script/function `get_WE2Etest_names_subdirs_descs.sh` (which is called from `run_WE2E_tests.sh` if needed) creates a CSV (Comma-Separated Value) file named `WE2E_test_info.csv` that contains information about the WE2E tests.  Currently, this CSV file contains only 3 columns: the test name, the names of any alternate names for the test, and the test description.  In order to have a more complete summary of the WE2E tests, this PR modifies `get_WE2Etest_names_subdirs_descs.sh` so that additional information is included in the CSV file.  This additional information consists of the values of the following experiment variables for each test:
```
PREDEF_GRID_NAME
CCPP_PHYS_SUITE
EXTRN_MDL_NAME_ICS
EXTRN_MDL_NAME_LBCS
DATE_FIRST_CYCL
DATE_LAST_CYCL
CYCL_HRS
INCR_CYCL_FREQ
FCST_LEN_HRS
LBC_SPEC_INTVL_HRS
NUM_ENS_MEMBERS
```
In addition, the script uses this information to calculate the number of times each test calls the forecast model (e.g. if the test uses 3 different cycle dates, then the forecast model will be called 3 times; if it is an ensemble test for a single cycle, the test will call the forecast model as many times as the number of ensemble members).  

## TESTS CONDUCTED: 
The script `run_WE2E_tests.sh` was called that in turn calls `get_WE2Etest_names_subdirs_descs.sh`.  This created a new CSV file that contained the new fields (columns).  The CSV file was imported into Google Sheets (using "|" as the field/column separator) and looked correct.

## DOCUMENTATION:
The documentation is for the most part already within the `get_WE2Etest_names_subdirs_descs.sh`.  This PR slightly modifies that documentation to update it.

* Update directory structure of NCO mode (ufs-community#743)

* update vertical structure of NCO mode

* update sample script for nco

* Fix typo on write component of new RRFS CONUS

* Default CCPP physics option is FV3_GFS_v16 (ufs-community#746)

* Updated the default CCPP physics option to FV3_GFS_v16

* Updated the default CCPP physics option to FV3_GFS_v16 in config_defaults.sh

Co-authored-by: Natalie Perlin <[email protected]>

* Adds an alternative python workflow generation path (ufs-community#698)

* Workflow in python starting to work.

* Use new python_utils package structure.

* Some bug fixes.

* Use uppercase TRUE/FALSE in var_dfns

* Use config.sh by default.

* Minor bug fixes.

* Remove config.yaml

* Update to the latest develop

* Remove quotes from numbers in predef grid.

* Minor bug fix.

* Move validity checker to the bottom of setup

* Add more unit tests.

* Update with python_utils changes.

* Update to latest develop additions (Need to re-run regression test)

* Use set_namelist and fill_jinja_template as python functions.

* Replace sed regex searches with python re.

* Use python realpath.

* Construct settings as dictionary before passing to fill_jinja and set_namelist

* Use yaml for setting predefined grid parameters.

* Use xml parser for ccpp phys suite definition file.

* Remove more run_command calls.

* Simplify some func argument processing.

* Move different config format parsers to same file.

* Use os.path.join for the sake of macosx

* Remove remaining func argument processing via os.environ.

* Minor bug fix in set_extrn_mdl_params.sh

* Add suite defn in test_data.

* Minor fixes on unittest on jet.

* Simplify boolean condition checks.

* Include old in renaming of old directories

* Fix conflicting yaml !join tag for paths and strings.

* Bug fix with setting sfcperst dict.

* Imitate "readlink -m" with os.path.realpath instead of os.readlink

* Don't use /tmp as that is shared by multiple users.

* Bug fix with cron line, maintain quotes around TRUE/FALSE.

* Update to latest develop (untested)

* Bug fix with existing cron line and quotes.

* Bug fix with case-sensitive MACHINE name, and empty EXPT_DIR.

* Update to latest develop

* More updates.

* Bug fix thanks to @willmayfield! Check both starting/ending
characters are brackets for shell variable to be considered an array.

* Make empty EXPT_BASEDIR workable.

* Update to latest develop

* Update in predef grid.

* Check f90nml as well.

Co-authored-by: Daniel Abdi <[email protected]>

* Fix typo and crontab issue on wcoss dell in workflow python scripts (ufs-community#750)

* Fix typo and failure on wcoss

* fix new line issue on wcoss dell

* remove capture_output

* Get USER from environment

Co-authored-by: Daniel Abdi <[email protected]>

* Add new WE2E configs (ufs-community#748)

## DESCRIPTION OF CHANGES: 
Added two new WE2E config files for the Sub-CONUS Indianapolis domain to support the upcoming SRW release. 

In addition, modified the external data used in the `config.specify_EXTRN_MDL_SYSBASEDIR_ICS_LBCS.sh` to match more common datasets used in the WE2E testing process. 

## TESTS CONDUCTED: 
Successfully ran the new WE2E tests (`config.SUBCONUS_Ind_3km_ics_HRRR_lbcs_RAP_suite_HRRR.sh`, `config.SUBCONUS_Ind_3km_ics_HRRR_lbcs_RAP_suite_RRFS_v1beta.sh`) and `config.specify_EXTRN_MDL_SYSBASEDIR_ICS_LBCS.sh` on NOAA Parallel Works AWS instance.

## DEPENDENCIES:
None.

## DOCUMENTATION:
No documentation changes are required.

* Added a fixed WoF grid and the python tool to determine the write component parameters (ufs-community#733)

* Added a fixed WoF grid and the python tool to determine the write component parameters

* Update set_predef_grid_params.sh

* Renamed file as recommended and removed unused lines

* Modified comment

Co-authored-by: JeffBeck-NOAA <[email protected]>
Co-authored-by: WYH@MBP <[email protected]>

* Replace env with modulefiles in scripts (ufs-community#752)

* change env to mod

* update we2e script

* WE2E script improvements for usability (ufs-community#745)

## DESCRIPTION OF CHANGES: 
* Modifications to `run_WE2E_tests.sh`:
  * Add examples to help/usage statement
* Modifications to `check_expts_status.sh`:
  * Add arguments list that can be processed by `process_args`
  * Add new optional arguments:  `num_log_lines`, `verbose`
  * Include a help/usage message

## TESTS CONDUCTED:
* Ran `run_WE2E_tests.sh --help` from the command line and got the expected help message.
* Ran `check_expts_status.sh --help` from the command line and got the expected help message.
* Used `run_WE2E_tests.sh` to run a set of 2 WE2E tests -- works as expected.
* Used `check_expts_status` to check on the status of the 2 tests run above and got the expected status message.
 
## DEPENDENCIES:
PR #[241](ufs-community/ufs-srweather-app#241)

## DOCUMENTATION:
A lot of this PR is documentation in the scripts.  There is an accompanying documentation PR #[241](ufs-community/ufs-srweather-app#241) into ufs-srweather-app.

* Standardize static data across Tier-1 platforms; fix and improve IC and LBC data retrieval (ufs-community#744)

* Bug fixes (grid size + suppress screen output from module load) (ufs-community#756)

## DESCRIPTION OF CHANGES: 
1) Adjust y-direction size of write-component grid of `SUBCONUS_Ind_3km` predefined grid from 195 to 197 (this was just an oversight in PR ufs-community#725 ).
2) Redirect output of module load in launch script (`launch_FV3LAM_wflow.sh`) to `/dev/null` to avoid unwanted screen output (which was introduced in PR #[238](ufs-community/ufs-srweather-app#238) in ufs-srweather-app and is about how to load the `regional_workflow` environment and is not relevant in this context).

## TESTS CONDUCTED: 
1) Plotted the `SUBCONUS_Ind_3km` grid to ensure it has correct size (it does).
2) Manually ran `launch_FV3LAM_wflow.sh` from the command line to verify that screen output is suppressed (it is).

* Update default SPP ISEED array in config_defaults.sh to use unique values (ufs-community#759)

* Modify RRFS North America 3- and 13-km domain configuration and WE2E test.

* Modify default ISEED values for SPP

* Fix grid in WE2E test

* Update workflow python scripts (ufs-community#760)

* update python scripts

* Change output file name of run_post to meet NCO standards (ufs-community#758)

* change output file name

* change variable name

* update python script

* remove duplicates

* add a check for empty variables

* move variable to common area

* clean up unnecessary comments

* update scripts

* remove duplicate

* update python scripts

* fix user-staged dir path issue in python script

* Add POST_OUTPUT_DOMAIN_NAME to WE2E tests for new grids (ufs-community#763)

* Add new var to we2e tests for new grids

* rename we2e tests for custom grid

* remove unnecessary $

* Modifications to `CODEOWNERS` file (ufs-community#757)

* Add @gspetro-NOAA, @natalie-perlin, and @EdwardSnyder-NOAA to CODEOWNERS so they are notified of all PRs and can review them.

* Remove duplicates in CODEOWNERS; remove users who will no longer be working with the repo.

* Adding a python utility for summarizing compute. (ufs-community#769)

Adds a utility that summarizes Rocoto database computational usage information.

* Add github actions for python unittests. (ufs-community#747)

* Add github actions for python unittests.

* Include all python script in ush

* Skip defining QUILTING params when it is set to False

* Update py_workflow

* Update unittest for set_extrn_mdl_params.

* Updates from develop.

Co-authored-by: Daniel Shawul <[email protected]>

* Update sample script for NCO mode (ufs-community#771)

* update config.nco.sh

* Add comment

* Feature/noaacloud (ufs-community#767)

* updates for noaacloud

* working version

* fixes for noaacloud

* added extra modules for post

* removed cheyenne-specific crontab editing section (ufs-community#773)

* Pin down hera miniconda3 module file version. (ufs-community#770)

Pin down the version of miniconda3 on Hera, and do not append to the module path.

* update staged data dir (ufs-community#774)

Co-authored-by: JeffBeck-NOAA <[email protected]>
Co-authored-by: Mark Potts <[email protected]>
Co-authored-by: michelleharrold <[email protected]>
Co-authored-by: Chan-Hoo.Jeon-NOAA <[email protected]>
Co-authored-by: gsketefian <[email protected]>
Co-authored-by: BenjaminBlake-NOAA <[email protected]>
Co-authored-by: Benjamin.Blake EMC <[email protected]>
Co-authored-by: Benjamin.Blake EMC <[email protected]>
Co-authored-by: Benjamin.Blake EMC <[email protected]>
Co-authored-by: chan-hoo <[email protected]>
Co-authored-by: Will Mayfield <[email protected]>
Co-authored-by: Natalie Perlin <[email protected]>
Co-authored-by: Natalie Perlin <[email protected]>
Co-authored-by: danielabdi-noaa <[email protected]>
Co-authored-by: Daniel Abdi <[email protected]>
Co-authored-by: Daniel Abdi <[email protected]>
Co-authored-by: EdwardSnyder-NOAA <[email protected]>
Co-authored-by: Yunheng Wang <[email protected]>
Co-authored-by: WYH@MBP <[email protected]>
Co-authored-by: Michael Kavulich <[email protected]>
Co-authored-by: Daniel Shawul <[email protected]>
  • Loading branch information
22 people authored Jun 7, 2022
1 parent 6fd3304 commit 2b09194
Show file tree
Hide file tree
Showing 236 changed files with 12,046 additions and 7,573 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/python_unittests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Python unittests
on: [push, pull_request]
jobs:

python_unittests:
name: Python unittests
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Install dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install python3 python3-pip netcdf-bin
sudo pip3 install pyyaml jinja2 f90nml
sudo pip3 install numpy matplotlib basemap
# Run python unittests
- name: Run python unittests
run: |
cd ush
python3 -m unittest -b python_utils/test_python_utils.py
python3 -m unittest -b *.py
260 changes: 97 additions & 163 deletions jobs/JREGIONAL_GET_EXTRN_MDL_FILES
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
#
#-----------------------------------------------------------------------
#
# Source the file defining the function that will be used to set various
# external-model-associated variables.
#
#-----------------------------------------------------------------------
#
. $USHDIR/get_extrn_mdl_file_dir_info.sh
#
#-----------------------------------------------------------------------
#
# Save current shell options (in a global array). Then set new options
# for this script/function.
#
Expand Down Expand Up @@ -72,66 +63,130 @@ print_info_msg "
Entering script: \"${scrfunc_fn}\"
In directory: \"${scrfunc_dir}\"
This is the J-job script for the task that copies/fetches to a local
directory (either from disk or HPSS) the external model files from which
initial or boundary condition files for the FV3 will be generated.
This is the J-job script for the task that copies or fetches external
model files from disk, HPSS, or URL, and stages them for downstream use
to generate initial or lateral boundary conditions for the FV3 model.
========================================================================"


#
#-----------------------------------------------------------------------
#
# Check whether the environment variable ICS_OR_LBCS is set to a valid
# value. This variable specifies whether we are getting the external
# model files for the purpose of generating initial conditions (ICs) or
# lateral boundary condtions (LBCs) for the forecast model.
#
#-----------------------------------------------------------------------
#
valid_vals_ICS_OR_LBCS=( "ICS" "LBCS" )
check_var_valid_value "ICS_OR_LBCS" "valid_vals_ICS_OR_LBCS"
#
#-----------------------------------------------------------------------
#
# Set parameters for grabbing either the initial conditions from analysis or
# forecast files of external models, or the lateral boundary conditions
# from external models. This script has been called to do the work for
# one or the other.
#
#-----------------------------------------------------------------------
#
if [ "${ICS_OR_LBCS}" = "ICS" ]; then
time_offset_hrs=${EXTRN_MDL_ICS_OFFSET_HRS:-0}
extrn_mdl_name=${EXTRN_MDL_NAME_ICS}

elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then
time_offset_hrs=${EXTRN_MDL_LBCS_OFFSET_HRS:-0}
extrn_mdl_name=${EXTRN_MDL_NAME_LBCS}
fi

#
#-----------------------------------------------------------------------
#
# Set the external model start time
#
#-----------------------------------------------------------------------
#

hh=${CDATE:8:2}
yyyymmdd=${CDATE:0:8}
extrn_mdl_cdate=$( $DATE_UTIL --utc --date "${yyyymmdd} ${hh} UTC - ${time_offset_hrs} hours" "+%Y%m%d%H" )

#
#-----------------------------------------------------------------------
#
# Check whether output files from the specified external model (EXTRN_MDL_NAME)
# are available on the specified cycle date and time (CDATE).
# Check whether output files from the specified external model
# (extrn_mdl_name) are available on the specified cycle date and time
# (extrn_mdl_cdate).
#
#-----------------------------------------------------------------------
#
case ${EXTRN_MDL_NAME} in

function data_unavailable() {

local name cdate end_date min_max

name=$1
cdate=$2
end_date=$3
min_max=$4

if [ ${min_max} = max ]; then
msg="\
Output from the specified external model (extrn_mdl_name) is not availa-
ble for the specified cycle date and time (extrn_mdl_cdate) because the latter is
later than the last forecast date and time (cdate_max) with this model:
extrn_mdl_name = \"${name}\"
CDATE_max = \"${end_date}\"
extrn_mdl_cdate = \"${cdate}\""

elif [ ${min_max} = min ]; then
msg="\
Output from the specified external model (extrn_mdl_name) is not availa-
ble for the specified cycle date and time (extrn_mdl_cdate) because the latter is
earlier than the implementation date of this model:
extrn_mdl_name = \"${name}\"
CDATE_min = \"${end_date}\"
extrn_mdl_cdate = \"${cdate}\""
fi

echo ${msg}
}


case ${extrn_mdl_name} in

"GSMGFS")
# The transition date from the GSMGFS to the FV3GFS was 2019061212, i.e.
# this was the first official forecast with the FV3GFS. So we set the
# last CDATE for the GSMGFS to the one 6 hours before this.
cdate_max="2019061206"
if [ "$CDATE" -gt "$cdate_max" ]; then
if [ "$extrn_mdl_cdate" -gt "$cdate_max" ]; then
print_err_msg_exit "\
Output from the specified external model (EXTRN_MDL_NAME) is not availa-
ble for the specified cycle date and time (CDATE) because the latter is
later than the last forecast date and time (cdate_max) with this model:
EXTRN_MDL_NAME = \"${EXTRN_MDL_NAME}\"
cdate_max = \"${cdate_max}\"
CDATE = \"${CDATE}\""
$(data_unavailable $extrn_mdl_name $extrn_mdl_cdate $cdate_max max)"
fi
;;

"FV3GFS")
# The transition date from the GSMGFS to the FV3GFS was 2019061212, i.e.
# this was the first official forecast with the FV3GFS. However, paral-
# lel runs with the FV3GFS go back to 2018121500. So we set the first
# CDATE for the FV3GFS to this date and time.
# extrn_mdl_cdate for the FV3GFS to this date and time.
# CDATE_min="2019061212"
CDATE_min="2018121500"
if [ "$CDATE" -lt "$CDATE_min" ]; then
if [ "$extrn_mdl_cdate" -lt "$CDATE_min" ]; then
print_err_msg_exit "\
Output from the specified external model (EXTRN_MDL_NAME) is not availa-
ble for the specified cycle date and time (CDATE) because the latter is
earlier than the implementation date of this model:
EXTRN_MDL_NAME = \"${EXTRN_MDL_NAME}\"
CDATE_min = \"${CDATE_min}\"
CDATE = \"${CDATE}\""
$(data_unavailable $extrn_mdl_name $extrn_mdl_cdate $cdate_min min)"
fi
;;

"RAP")
# Examination of the HPSS archives shows that the RAPX data goes back to
# July 01, 2015.
CDATE_min="2015070100"
if [ "$CDATE" -lt "$CDATE_min" ]; then
if [ "$extrn_mdl_cdate" -lt "$CDATE_min" ]; then
print_err_msg_exit "\
Output from the specified external model (EXTRN_MDL_NAME) is not availa-
ble for the specified cycle date and time (CDATE) because the latter is
earlier than the implementation date of this model:
EXTRN_MDL_NAME = \"${EXTRN_MDL_NAME}\"
CDATE_min = \"${CDATE_min}\"
CDATE = \"${CDATE}\""
$(data_unavailable $extrn_mdl_name $extrn_mdl_cdate $cdate_min min)"
fi
;;

Expand All @@ -140,156 +195,35 @@ earlier than the implementation date of this model:
# implementation of the first version of the operational HRRR was
# September 30, 2014.
CDATE_min="2014103000"
if [ "$CDATE" -lt "$CDATE_min" ]; then
if [ "$extrn_mdl_cdate" -lt "$CDATE_min" ]; then
print_err_msg_exit "\
Output from the specified external model (EXTRN_MDL_NAME) is not availa-
ble for the specified cycle date and time (CDATE) because the latter is
earlier than the implementation date of this model:
EXTRN_MDL_NAME = \"${EXTRN_MDL_NAME}\"
CDATE_min = \"${CDATE_min}\"
CDATE = \"${CDATE}\""
$(data_unavailable $extrn_mdl_name $extrn_mdl_cdate $cdate_min min)"
fi
;;

esac
#
#-----------------------------------------------------------------------
#
# Check whether the environment variable ICS_OR_LBCS is set to a valid
# value. This variable specifies whether we are getting the external
# model files for the purpose of generating initial conditions (ICs) or
# lateral boundary condtions (LBCs) for the forecast model.
#
#-----------------------------------------------------------------------
#
valid_vals_ICS_OR_LBCS=( "ICS" "LBCS" )
check_var_valid_value "ICS_OR_LBCS" "valid_vals_ICS_OR_LBCS"
#
#-----------------------------------------------------------------------
#
# Set parameters for grabbing either the initial conditions from analysis or
# forecast files of external models, or the lateral boundary conditions
# from external models. The script has been called to do the work for
# one or the other.
#
#-----------------------------------------------------------------------
#
if [ "${ICS_OR_LBCS}" = "ICS" ]; then
if [ ${EXTRN_MDL_ICS_OFFSET_HRS} -eq 0 ] ; then
anl_or_fcst="ANL"
time_offset_hrs=0
else
anl_or_fcst="FCST"
time_offset_hrs=${EXTRN_MDL_ICS_OFFSET_HRS:-0}
fi
elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then
anl_or_fcst="FCST"
time_offset_hrs=${EXTRN_MDL_LBCS_OFFSET_HRS:-0}
fi
#
#-----------------------------------------------------------------------
#
# Create the directory where the exetrnal model files should be stored
#
#-----------------------------------------------------------------------
#
extrn_mdl_staging_dir="${CYCLE_DIR}/${EXTRN_MDL_NAME}/for_${ICS_OR_LBCS}"
extrn_mdl_staging_dir="${CYCLE_DIR}/${extrn_mdl_name}/for_${ICS_OR_LBCS}"
mkdir_vrfy -p "${extrn_mdl_staging_dir}"
cd_vrfy "${extrn_mdl_staging_dir}"
#
#-----------------------------------------------------------------------
#
# Call the function that sets various external-model-associated variables.
# See the function defintion file for the definitions of these variables.
#
#-----------------------------------------------------------------------
#
get_extrn_mdl_file_dir_info \
extrn_mdl_name="${EXTRN_MDL_NAME}" \
anl_or_fcst="${anl_or_fcst}" \
cdate_FV3LAM="${CDATE}" \
time_offset_hrs="${time_offset_hrs}" \
varname_extrn_mdl_cdate="extrn_mdl_cdate" \
varname_extrn_mdl_lbc_spec_fhrs="extrn_mdl_lbc_spec_fhrs" \
varname_extrn_mdl_fns_on_disk="extrn_mdl_fns_on_disk" \
varname_extrn_mdl_fns_in_arcv="extrn_mdl_fns_in_arcv" \
varname_extrn_mdl_sysdir="extrn_mdl_sysdir" \
varname_extrn_mdl_arcv_fmt="extrn_mdl_arcv_fmt" \
varname_extrn_mdl_arcv_fns="extrn_mdl_arcv_fns" \
varname_extrn_mdl_arcv_fps="extrn_mdl_arcv_fps" \
varname_extrn_mdl_arcvrel_dir="extrn_mdl_arcvrel_dir" || \
print_err_msg_exit "\
Call to function get_extrn_mdl_file_dir_info failed."
#
#-----------------------------------------------------------------------
#
# Set the directory in which to check for the external model files (which
# we refer to here as the "source" directory) to the default one set above
# for the current machine and external model.
#
#-----------------------------------------------------------------------
#
extrn_mdl_source_dir="${extrn_mdl_sysdir}"
#
#-----------------------------------------------------------------------
#
# If the user has specified that the external model files to be used for
# generating ICs or LBCs are staged, then reset extrn_mdl_source_dir to
# the user-specified directory in which these files are staged, and reset
# extrn_mdl_fns_on_disk to the user-specified array containing the names
# of the files.
#
#-----------------------------------------------------------------------
#
if [ "${USE_USER_STAGED_EXTRN_FILES}" = "TRUE" ]; then

if [ "${ICS_OR_LBCS}" = "ICS" ]; then
extrn_mdl_source_dir="${EXTRN_MDL_SOURCE_BASEDIR_ICS}/$CDATE"
extrn_mdl_fns_on_disk=( $( printf "%s " "${EXTRN_MDL_FILES_ICS[@]}" ))
elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then
extrn_mdl_source_dir="${EXTRN_MDL_SOURCE_BASEDIR_LBCS}/$CDATE"
extrn_mdl_fns_on_disk=( $( printf "%s " "${EXTRN_MDL_FILES_LBCS[@]}" ))
fi

if [ ! -d "${extrn_mdl_source_dir}" ]; then
print_err_msg_exit "\
The directory extrn_mdl_source_dir containing the user-staged external
model files does not exist:
extrn_mdl_source_dir = \"${extrn_mdl_source_dir}\"
Please ensure that the directory specified by extrn_mdl_source_dir exists
and that all the files specified in the array extrn_mdl_fns_on_disk exist
within it:
extrn_mdl_source_dir = \"${extrn_mdl_source_dir}\"
extrn_mdl_fns_on_disk = ( $( printf "\"%s\" " "${extrn_mdl_fns_on_disk[@]}" ))"
fi

fi
#
#-----------------------------------------------------------------------
#
# Call the ex-script for this J-job and pass to it the necessary variables.
#
#-----------------------------------------------------------------------
#
extrn_mdl_lbc_spec_fhrs_str="( "$( printf "\"%s\" " "${extrn_mdl_lbc_spec_fhrs[@]}" )")"
extrn_mdl_fns_on_disk_str="( "$( printf "\"%s\" " "${extrn_mdl_fns_on_disk[@]}" )")"
extrn_mdl_fns_in_arcv_str="( "$( printf "\"%s\" " "${extrn_mdl_fns_in_arcv[@]}" )")"
extrn_mdl_arcv_fns_str="( "$( printf "\"%s\" " "${extrn_mdl_arcv_fns[@]}" )")"
extrn_mdl_arcv_fps_str="( "$( printf "\"%s\" " "${extrn_mdl_arcv_fps[@]}" )")"

$SCRIPTSDIR/exregional_get_extrn_mdl_files.sh \
ics_or_lbcs="${ICS_OR_LBCS}" \
use_user_staged_extrn_files="${USE_USER_STAGED_EXTRN_FILES}" \
extrn_mdl_cdate="${extrn_mdl_cdate}" \
extrn_mdl_lbc_spec_fhrs="${extrn_mdl_lbc_spec_fhrs_str}" \
extrn_mdl_fns_on_disk="${extrn_mdl_fns_on_disk_str}" \
extrn_mdl_fns_in_arcv="${extrn_mdl_fns_in_arcv_str}" \
extrn_mdl_source_dir="${extrn_mdl_source_dir}" \
extrn_mdl_name="${extrn_mdl_name}" \
extrn_mdl_staging_dir="${extrn_mdl_staging_dir}" \
extrn_mdl_arcv_fmt="${extrn_mdl_arcv_fmt}" \
extrn_mdl_arcv_fns="${extrn_mdl_arcv_fns_str}" \
extrn_mdl_arcv_fps="${extrn_mdl_arcv_fps_str}" \
extrn_mdl_arcvrel_dir="${extrn_mdl_arcvrel_dir}" || \
time_offset_hrs=${time_offset_hrs} ||
print_err_msg_exit "\
Call to ex-script corresponding to J-job \"${scrfunc_fn}\" failed."
#
Expand Down
5 changes: 2 additions & 3 deletions modulefiles/tasks/cheyenne/get_extrn_ics
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#%Module#####################################################
## Module file intentionally blank for Cheyenne
#############################################################
#%Module

module load pylib_regional_workflow

5 changes: 2 additions & 3 deletions modulefiles/tasks/cheyenne/get_extrn_lbcs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#%Module#####################################################
## Module file intentionally blank for Cheyenne
#############################################################
#%Module

module load pylib_regional_workflow

9 changes: 1 addition & 8 deletions modulefiles/tasks/cheyenne/make_grid.local
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
#%Module
if [module-info mode load] {
system "ncar_pylib /glade/p/ral/jntp/UFS_CAM/ncar_pylib_20200427"
}

if [module-info mode remove] {
system "deactivate"
}

module load pylib_regional_workflow
Loading

0 comments on commit 2b09194

Please sign in to comment.