-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[develop] Transition the var_defns bash file to YAML. #1098
Changes from 37 commits
55b500b
46c4805
87e549f
59d07d4
446f6eb
38f9daa
8496c68
e5b28da
16da1ef
444f1f0
a12f6fb
4bec6b7
0d86ab0
a6513cb
f08e3ef
94d7970
4ef89f6
874af4b
d2a0bc2
253590f
e242490
241ef5d
f360da3
b31f6c7
2ed368f
8b9eb07
0a8cf97
5502cdc
b368974
b7bacbc
d7378dc
e29b3b4
d3f40c6
8f7ac15
50be36a
1acdb48
ce0a6e6
ff4f030
1afdf51
060ecc9
072e8eb
2ce08ae
85070ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ dependencies: | |
- pylint=2.17* | ||
- pytest=7.2* | ||
- scipy=1.10.* | ||
- uwtools=2.1* | ||
- uwtools=2.3* | ||
- xarray=2022.11.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ channels: | |
dependencies: | ||
- pylint=2.17* | ||
- pytest=7.2* | ||
- uwtools=2.2* | ||
- uwtools=2.3* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,22 @@ | |
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# The J-Job script for checking the post output. | ||
# | ||
# Run-time environment variables: | ||
# | ||
# CDATE | ||
# ENSMEM_INDX | ||
# GLOBAL_VAR_DEFNS_FP | ||
# | ||
# Experiment variables | ||
# | ||
# user: | ||
# SCRIPTSdir | ||
# USHdir | ||
# | ||
# workflow: | ||
# EXPTDIR | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
|
@@ -16,7 +31,9 @@ | |
#----------------------------------------------------------------------- | ||
# | ||
. $USHdir/source_util_funcs.sh | ||
source_config_for_task "" ${GLOBAL_VAR_DEFNS_FP} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This command sources everything in the bash file that does not start with "task_", so the environment is now narrowed to the specific script with the new implementation. |
||
for sect in user nco workflow ; do | ||
mkavulich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
source_yaml ${GLOBAL_VAR_DEFNS_FP} ${sect} | ||
done | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the pattern I've added to explicitly state which sections of the var_defns file should be "sourced". The bash util helps us run a UW tool that translates YAML to bash and then exports it line-by-line. This sort of thing will go away with a full integration of uwtools drivers (planned work in upcoming EPIC PI 13). |
||
. $USHdir/job_preamble.sh | ||
# | ||
#----------------------------------------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,97 +3,25 @@ | |
# | ||
#----------------------------------------------------------------------- | ||
# | ||
# This script generates grid and orography files in NetCDF format that | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This text block was not consistent with what this script actually does, nor what its corresponding ex-script does. |
||
# are required as inputs for running the FV3-LAM model (i.e. the FV3 mo- | ||
# del on a regional domain). It in turn calls three other scripts whose | ||
# file names are specified in the variables grid_gen_scr, orog_gen_scr, | ||
# and orog_fltr_scr and then calls the executable defined in the varia- | ||
# ble shave_exec. These scripts/executable perform the following tasks: | ||
# | ||
# 1) grid_gen_scr: | ||
# | ||
# This script generates grid files that will be used by subsequent | ||
# preprocessing steps. It places its output in the directory defined | ||
# by GRID_DIR. Note that: | ||
# | ||
# a) This script creates grid files for each of the 7 tiles of the | ||
# cubed sphere grid (where tiles 1 through 6 cover the globe, and | ||
# tile 7 is the regional grid located somewhere within tile 6) | ||
# even though the forecast will be performed only on tile 7. | ||
# | ||
# b) The tile 7 grid file that this script creates includes a halo, | ||
# i.e. a layer of cells beyond the boundary of tile 7). The width | ||
# of this halo (i.e. the number of cells in the halo in the direc- | ||
# tion perpendicular to the boundary of the tile) must be made | ||
# large enough such that the "shave" steps later below (which take | ||
# this file as input and generate grid files with thinner halos) | ||
# have a wide enough starting halo to work with. More specifical- | ||
# ly, the FV3-LAM model needs as inputs two grid files: one with a | ||
# halo that is 3 cells and another with a halo that is 4 cells | ||
# wide. Thus, the halo in the grid file that the grid_gen_scr | ||
# script generates must be greater than 4 since otherwise, the | ||
# shave steps would shave off cells from within the interior of | ||
# tile 7. We will let NHW denote the width of the halo in the | ||
# grid file generated by grid_gen_scr. The "n" in this variable | ||
# name denotes number of cells, the "h" is used to indicate that | ||
# it refers to a halo region, the "w" is used to indicate that it | ||
# refers to a wide halo (i.e. wider than the 3-cell and 4-cell ha- | ||
# los that the FV3-LAM model requires as inputs, and the "T7" is | ||
# used to indicate that the cell count is on tile 7. | ||
# | ||
# 2) orog_gen_scr: | ||
# | ||
# This script generates the orography file. It places its output in | ||
# the directory defined by OROG_DIR. Note that: | ||
# | ||
# a) This script generates an orography file only on tile 7. | ||
# | ||
# b) This orography file contains a halo of the same width (NHW) | ||
# as the grid file for tile 7 generated by the grid_gen_scr script | ||
# in the previous step. | ||
# | ||
# 3) orog_fltr_scr: | ||
# | ||
# This script generates a filtered version of the orography file ge- | ||
# nerated by the script orog_gen_scr. This script places its output | ||
# in the temporary directory defined in WORKDIR_FLTR. Note that: | ||
# | ||
# a) The filtered orography file generated by this script contains a | ||
# halo of the same width (NHW) as the (unfiltered) orography file | ||
# generated by script orog_gen_scr (and the grid file generated by | ||
# grid_gen_scr). | ||
# | ||
# b) In analogy with the input grid files, the FV3-LAM model needs as | ||
# input two (filtered) orography files -- one with no halo cells | ||
# and another with 3. These are obtained later below by "shaving" | ||
# off layers of halo cells from the (filtered) orography file ge- | ||
# nerated in this step. | ||
# | ||
# 4) shave_exec: | ||
# | ||
# This "shave" executable is called 4 times to generate 4 files from | ||
# the tile 7 grid file generated by grid_gen_scr and the tile 7 fil- | ||
# tered orography file generated by orog_fltr_scr (both of which have | ||
# a halo of width NHW cells). The 4 output files are placed in the | ||
# temporary directory defined in WORKDIR_SHVE. More specifically: | ||
# | ||
# a) shave_exec is called to shave the halo in the tile 7 grid file | ||
# generated by grid_gen_scr down to a width of 3 cells and store | ||
# the result in a new grid file in WORKDIR_SHVE. | ||
# | ||
# b) shave_exec is called to shave the halo in the tile 7 grid file | ||
# generated by grid_gen_scr down to a width of 4 cells and store | ||
# the result in a new grid file in WORKDIR_SHVE. | ||
# | ||
# c) shave_exec is called to shave the halo in the tile 7 filtered | ||
# orography file generated by orog_fltr_scr down to a width of 0 | ||
# cells (i.e. no halo) and store the result in a new filtered oro- | ||
# graphy file in WORKDIR_SHVE. | ||
# | ||
# d) shave_exec is called to shave the halo in the tile 7 filtered | ||
# orography file generated by orog_fltr_scr down to a width of 4 | ||
# cells and store the result in a new filtered orography file in | ||
# WORKDIR_SHVE. | ||
# The J-Job that generates input NetCDF grid files for running the | ||
# regional configuration of FV3 | ||
# | ||
# Run-time environment variables: | ||
# | ||
# GLOBAL_VAR_DEFNS_FP | ||
# DATA | ||
# | ||
# Experiment variables | ||
# | ||
# user: | ||
# USHdir | ||
# SCRIPTSdir | ||
# | ||
# workflow: | ||
# PREEXISTING_DIR_METHOD | ||
# | ||
# task_make_grid: | ||
# GRID_DIR | ||
# | ||
#----------------------------------------------------------------------- | ||
# | ||
|
@@ -106,7 +34,9 @@ | |
#----------------------------------------------------------------------- | ||
# | ||
. $USHdir/source_util_funcs.sh | ||
source_config_for_task "task_make_grid" ${GLOBAL_VAR_DEFNS_FP} | ||
for sect in user nco workflow task_make_grid ; do | ||
source_yaml ${GLOBAL_VAR_DEFNS_FP} ${sect} | ||
done | ||
. $USHdir/job_preamble.sh | ||
# | ||
#----------------------------------------------------------------------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pattern that shows up regularly. I did my best to add a doc block to the top of each j-job and ex-script to list the variables that are used in the script and the sections they come from.
The run-time variables may be from Rocoto jobs or from the NCO preamble.