Skip to content
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

Add columns for relative test and time step to CSV file containing WE2E test info #776

Merged
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bbb2978
Fix error in help message.
gsketefian May 12, 2022
69bbccd
Add the ESGgrid_PAZI parameter to the list of ESGgrid parameters that…
gsketefian May 12, 2022
9a3bfc2
Improvements to the way shell functions return arguments:
gsketefian May 16, 2022
a0d60f3
Improvements to set_gridparams_GFDLgrid() function to make it easier …
gsketefian May 18, 2022
d2ed446
Move constants NH0, NH3, and NH4 to the constants.sh file so that the…
gsketefian May 18, 2022
3123459
In the function set_gridparams_ESGgrid(), change USHDIR to the local …
gsketefian May 18, 2022
b919577
Changes to allow the function set_predef_grid_params() to be called o…
gsketefian May 18, 2022
3f585be
(1) Call the function set_predef_grid_params() with arguments (as req…
gsketefian May 18, 2022
6ec8321
Minor change.
gsketefian May 19, 2022
1b008af
Add new column listing the relative cost of running the dynamics in e…
gsketefian May 19, 2022
975c16f
Add DT_ATMOS as one of the columns; add units to some of the column t…
gsketefian May 19, 2022
d3122e7
Add single quote to field value in CSV file to make sure it gets trea…
gsketefian May 19, 2022
4b11c67
Update y-dimension of write-component grid for 3km Indianapolis domai…
gsketefian May 19, 2022
24de280
Merge branch 'develop' into feature/we2e_csv_add_columns
gsketefian May 19, 2022
8376e0c
In the WE2E test info CSV file, for readability split the test name a…
gsketefian May 20, 2022
d7d523c
Clean up comments and output messages involving the build and workflo…
gsketefian May 20, 2022
55a8960
Quote the argument to the boolify() function because without quotes, …
gsketefian May 20, 2022
85e8454
Add a check to ensure the experiment variable "COMPILER" is set to a …
gsketefian May 20, 2022
d8187ac
Use the variable valid_vals_BOOLEAN provided in constants.sh to check…
gsketefian May 20, 2022
8039468
Add quotes around argument to boolify() function to make sure it unde…
gsketefian May 20, 2022
eb9edb6
Edits to argument descriptions in the usage statement of run_WE2E_tes…
gsketefian May 21, 2022
0978a4d
Add the boolean flag "generate_csv_file" as an input argument to the …
gsketefian May 21, 2022
e88ea11
Use the same method as other variables to set the experiment variable…
gsketefian May 21, 2022
4d1deed
For boolean experiment variables, remove the corresponding "valid_val…
gsketefian May 23, 2022
0f1e896
Bug fix in the way __wrtcmp_write_tasks_per_group__ is set.
gsketefian May 23, 2022
4152dfb
Remove obsolete argument.
gsketefian May 24, 2022
14679b4
Edits to comments.
gsketefian May 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
530 changes: 430 additions & 100 deletions tests/WE2E/get_WE2Etest_names_subdirs_descs.sh

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/WE2E/get_expts_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Usage:

${scrfunc_fn} \\
expts_basedir=\"...\" \\
[num_log_lines=\"...\"] \\
Copy link
Collaborator Author

@gsketefian gsketefian May 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot in a previous PR to add this line to the usage statement. Do so here.

[verbose=\"...\"]

The arguments in brackets are optional. The arguments are defined as
Expand Down Expand Up @@ -144,7 +145,7 @@ num_log_lines=${num_log_lines:-"40"}
#
verbose=${verbose:-"FALSE"}
check_var_valid_value "verbose" "valid_vals_BOOLEAN"
verbose=$(boolify $verbose)
verbose=$(boolify "$verbose")
#
#-----------------------------------------------------------------------
#
Expand Down
163 changes: 92 additions & 71 deletions tests/WE2E/run_WE2E_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Usage:
[use_cron_to_relaunch=\"...\"] \\
[cron_relaunch_intvl_mnts=\"...\"] \\
[verbose=\"...\"] \\
[generate_csv_file=\"...\"] \\
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add flag generate_csv_file that allows the user to force a CSV file to be created or not (by setting generate_csv_file to "TRUE" or "FALSE"). It is sometimes convenient to skip the CSV file creation because it takes some time.

[machine_file=\"...\"] \\
[stmp=\"...\"] \\
[ptmp=\"...\"] \\
Expand Down Expand Up @@ -117,76 +118,84 @@ run. (A description of ACCOUNT can be found in the default experiment
configuration file.) This is a required argument.

expt_basedir:
Argument used to explicitly set the experiment variable EXPT_BASEDIR in
the experiment configuration files of all the WE2E tests the user wants
to run. (A description of EXPT_BASEDIR can be found in the default
experiment configuration file.) If expt_basedir is specified in the call
to this script, its value is used to set EXPT_BASEDIR in the configuration
files. If it is not specified, EXPT_BASEDIR is not set in the configuration
files, in which case the workflow generation script sets it to a default
value. Note that if expt_basedir is set to a relative path (e.g.
expt_basedir=\"testset1\" in the call to this script), then the workflow
generation script will set EXPT_BASEDIR for the experiment to a default
absolute path followed by \${expt_basedir}. This feature can be used to
group the WE2E tests into subdirectories for convenience, e.g. a set of
tests under subdirectory testset1, another set of tests under testset2,
etc.
Optional argument used to explicitly set the experiment variable
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates to argument descriptions.

EXPT_BASEDIR in the experiment configuration files of all the WE2E tests
the user wants to run. (A description of EXPT_BASEDIR can be found in
the default experiment configuration file.) If expt_basedir is specified
in the call to this script, its value is used to set EXPT_BASEDIR in the
configuration files. If it is not specified, EXPT_BASEDIR is not set in
the configuration files, in which case the workflow generation script
sets it to a default value. Note that if expt_basedir is set to a
relative path (e.g. expt_basedir=\"testset1\" in the call to this script),
then the experiment generation script will set EXPT_BASEDIR for the
experiment to a default absolute path followed by \${expt_basedir}.
This feature can be used to group the WE2E tests into subdirectories for
convenience, e.g. a set of tests under subdirectory testset1, another
set of tests under testset2, etc.

exec_subdir:
Optional. Argument used to set the EXEC_SUBDIR experiment variable.
Please see the default experiment configuration file \"config_defaults.sh\"
for a full description of EXEC_SUBDIR.
Optional argument used to explicitly set the experiment variable
EXEC_SUBDIR in the experiment configuration files of all the WE2E tests
the user wants to run. See the default experiment configuration file
\"config_defaults.sh\" for a full description of EXEC_SUBDIR.

use_cron_to_relaunch:
Argument used to explicitly set the experiment variable USE_CRON_TO_RELAUNCH
in the experiment configuration files of all the WE2E tests the user wants
to run. (A description of USE_CRON_TO_RELAUNCH can be found in the default
experiment configuration file.) If use_cron_to_relaunch is specified in
the call to this script, its value is used to set USE_CRON_TO_RELAUNCH
in the configuration files. If it is not specified, USE_CRON_TO_RELAUNCH
is set to \"TRUE\" in the configuration files, in which case cron jobs
are used to (re)launch the workflows for all tests (one cron job per test).
Thus, use_cron_to_relaunch needs to be specified only if the user wants
to turn off use of cron jobs for all tests (by specifying use_cron_to_relaunch=
\"FALSE\" on the command line). Note that it is not possible to specify
a different value for USE_CRON_TO_RELAUNCH for each test via this argument;
either all tests use cron jobs or none do.
Optional argument used to explicitly set the experiment variable
USE_CRON_TO_RELAUNCH in the experiment configuration files of all the
WE2E tests the user wants to run. (A description of USE_CRON_TO_RELAUNCH
can be found in the default experiment configuration file.) If
use_cron_to_relaunch is specified in the call to this script, its value
is used to set USE_CRON_TO_RELAUNCH in the configuration files. If it
is not specified, USE_CRON_TO_RELAUNCH is set to \"TRUE\" in the
configuration files, in which case cron jobs are used to (re)launch the
workflows for all tests (one cron job per test). Thus, use_cron_to_relaunch
needs to be specified only if the user wants to turn off use of cron jobs
for all tests (by specifying use_cron_to_relaunch=\"FALSE\" on the command
line). Note that it is not possible to specify a different value for
USE_CRON_TO_RELAUNCH for each test via this argument; either all tests
use cron jobs or none do.

cron_relaunch_intvl_mnts:
Argument used to explicitly set the experiment variable CRON_RELAUNCH_INTVL_MNTS
in the experiment configuration files of all the WE2E tests the user wants
to run. (A description of CRON_RELAUNCH_INTVL_MNTS can be found in the
default experiment configuration file.) If cron_relaunch_intvl_mnts is
specified in the call to this script, its value is used to set
CRON_RELAUNCH_INTVL_MNTS in the configuration files. If it is not
specified, CRON_RELAUNCH_INTVL_MNTS is set to \"02\" (i.e. two minutes)
in the configuration files. Note that it is not possible to specify a
different value for CRON_RELAUNCH_INTVL_MNTS for each test via this
argument; all tests will use the same value for USE_CRON_TO_RELAUNCH
(either the value specified in the call to this script or the default
value of \"02\"). Note also that the value of this argument matters only
if the argument use_cron_to_relaunch is not explicitly set to \"FALSE\"
in the call to this script.
Optional argument used to explicitly set the experiment variable
CRON_RELAUNCH_INTVL_MNTS in the experiment configuration files of
all the WE2E tests the user wants to run. (A description of
CRON_RELAUNCH_INTVL_MNTS can be found in the default experiment
configuration file.) If cron_relaunch_intvl_mnts is specified in the
call to this script, its value is used to set CRON_RELAUNCH_INTVL_MNTS
in the configuration files. If it is not specified, CRON_RELAUNCH_INTVL_MNTS
is set to \"02\" (i.e. two minutes) in the configuration files. Note
that it is not possible to specify a different value for
CRON_RELAUNCH_INTVL_MNTS for each test via this argument; all tests will
use the same value for USE_CRON_TO_RELAUNCH (either the value specified
in the call to this script or the default value of \"02\"). Note also
that the value of this argument matters only if the argument
use_cron_to_relaunch is not explicitly set to \"FALSE\" in the call to
this script.

verbose:
Argument used to explicitly set the experiment variable VERBOSE in the
experiment configuration files of all the WE2E tests the user wants to
run. (A description of VERBOSE can be found in the default experiment
configuration file.) If verbose is specified in the call to this script,
its value is used to set VERBOSE in the configuration files. If it is
not specified, VERBOSE is set to \"TRUE\" in the configuration files.
Note that it is not possible to specify a different value for VERBOSE
for each test via this argument; either all tests will have VERBOSE set
to \"TRUE\" or all will have it set to \"FALSE\".
Optional argument used to explicitly set the experiment variable VERBOSE
in the experiment configuration files of all the WE2E tests the user
wants to run. (A description of VERBOSE can be found in the default
experiment configuration file.) If verbose is specified in the call to
this script, its value is used to set VERBOSE in the configuration files.
If it is not specified, VERBOSE is set to \"TRUE\" in the configuration
files. Note that it is not possible to specify a different value for
VERBOSE for each test via this argument; either all tests will have
VERBOSE set to \"TRUE\" or all will have it set to \"FALSE\".

generate_csv_file:
Optional argument that specifies whether or not to generate a CSV file
containing summary information about all the tests available in the WE2E
testing system. Default value is \"TRUE\".

machine_file:
Optional argument to set the full path to a machine configuration file.
If not set, a supported platform machine file may be used.
Optional argument specifying the full path to a machine configuration
file. If not set, a supported platform machine file may be used.

stmp:
Argument used to explicitly set the experiment variable STMP in the
experiment configuration files of all the WE2E tests the user wants to
run that are in NCO mode, i.e. they have test configuration files that
Optional argument used to explicitly set the experiment variable STMP in
the experiment configuration files of all the WE2E tests the user wants
to run that are in NCO mode, i.e. they have test configuration files that
set the experiment variable RUN_ENVIR to \"nco\". (A description of
STMP can be found in the default experiment configuration file.) If
stmp is specified in the call to this script, its value is used to set
Expand All @@ -208,14 +217,23 @@ Same as the argument \"stmp\" described above but for setting the
experiment variable PTMP for all tests that will run in NCO mode.

compiler:
Type of compiler to use for the workflow. Options are \"intel\" and \"gnu\".
Default is \"intel\".
Optional argument used to explicitly set the experiment variable COMPILER
in the experiment configuration files of all the WE2E tests the user
wants to run. (A description of COMPILER can be found in the default
experiment configuration file.) If compiler is specified in the call to
this script, its value is used to set COMPILER in the configuration files.
If it is not specified, COMPILER is set to \"intel\" in the configuration
files. Note that it is not possible to specify a different value for
COMPILER for each test via this argument; all tests will use the same
value for COMPILER (either the value specified in the call to this script
or the default value of \"intel\").

build_mod_fn:
Specify the build module files (see ufs-srweather-app/modulefiles) to
use for the workflow. (e.g. build_cheyenne_gnu). If a
\"gnu\" compiler is specified, it must also be specified with
the \"compiler\" option.
Optional argument used to explicitly set the experiment variable
BUILD_MOD_FN in the experiment configuration files of all the WE2E tests
the user wants to run (e.g. \"build_cheyenne_gnu\"). If the string
\"gnu\" appears in this file name, the \"compiler\" option to this
function must also be specified with the value \"gnu\".


Usage Examples:
Expand Down Expand Up @@ -320,6 +338,7 @@ valid_args=( \
"use_cron_to_relaunch" \
"cron_relaunch_intvl_mnts" \
"verbose" \
"generate_csv_file" \
"machine_file" \
"stmp" \
"ptmp" \
Expand Down Expand Up @@ -483,18 +502,19 @@ done < "${user_spec_tests_fp}"
# avail_WE2E_test_subdirs[7]="dir1"
# avail_WE2E_test_subdirs[8]="dir2"
# avail_WE2E_test_subdirs[9]="dir3"
#
#
#-----------------------------------------------------------------------
#
print_info_msg "
Getting information about all available WE2E tests..."

get_WE2Etest_names_subdirs_descs \
WE2Edir="${WE2Edir}" \
output_varname_test_configs_basedir="avail_WE2E_test_configs_basedir" \
output_varname_test_names="avail_WE2E_test_names" \
output_varname_test_subdirs="avail_WE2E_test_subdirs" \
output_varname_test_ids="avail_WE2E_test_ids"
generate_csv_file="${generate_csv_file}" \
outvarname_test_configs_basedir="avail_WE2E_test_configs_basedir" \
outvarname_test_names="avail_WE2E_test_names" \
outvarname_test_subdirs="avail_WE2E_test_subdirs" \
outvarname_test_ids="avail_WE2E_test_ids"
#
# Get the total number of available WE2E test names (including alternate
# names).
Expand Down Expand Up @@ -759,6 +779,7 @@ Please correct and rerun."
BUILD_MOD_FN=${build_mod_fn:-"build_${machine}_${COMPILER}"}
EXPT_BASEDIR="${expt_basedir}"
EXPT_SUBDIR="${test_name}"
EXEC_SUBDIR="${exec_subdir}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, treat EXEC_SUBDIR like the other variables here.

USE_CRON_TO_RELAUNCH=${use_cron_to_relaunch:-"TRUE"}
CRON_RELAUNCH_INTVL_MNTS=${cron_relaunch_intvl_mnts:-"02"}
VERBOSE=${verbose:-"TRUE"}
Expand All @@ -783,9 +804,9 @@ ACCOUNT=\"${ACCOUNT}\"
COMPILER=\"${COMPILER}\"
BUILD_MOD_FN=\"${BUILD_MOD_FN}\""

if [ -n "${exec_subdir}" ]; then
if [ -n "${EXEC_SUBDIR}" ]; then
expt_config_str=${expt_config_str}"
EXEC_SUBDIR=\"${exec_subdir}\""
EXEC_SUBDIR=\"${EXEC_SUBDIR}\""
fi

if [ -n "${EXPT_BASEDIR}" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ ESGgrid_DELY="25000.0"
ESGgrid_NX="216"
ESGgrid_NY="156"

ESGgrid_PAZI="0.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgotten setting. Need it to have a complete description of this custom grid.


ESGgrid_WIDE_HALO_WIDTH="6"

DT_ATMOS="40"
Expand Down
4 changes: 2 additions & 2 deletions ush/bash_utils/get_bash_file_contents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function get_bash_file_contents() {

local valid_args=( \
"fp" \
"output_varname_contents" \
"outvarname_contents" \
)
process_args valid_args "$@"
print_input_args "valid_args"
Expand Down Expand Up @@ -63,7 +63,7 @@ read was not specified in the call to this function:
#
# Set output variables.
#
printf -v ${output_varname_contents} "${contents}"
printf -v ${outvarname_contents} "%s" "${contents}"

{ restore_shell_opts; } > /dev/null 2>&1

Expand Down
4 changes: 2 additions & 2 deletions ush/check_expt_config_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ function check_expt_config_vars() {
# configuration file.
#
get_bash_file_contents fp="${default_config_fp}" \
output_varname_contents="var_list_default"
outvarname_contents="var_list_default"

get_bash_file_contents fp="${config_fp}" \
output_varname_contents="var_list_user"
outvarname_contents="var_list_user"
#
# Loop through each line/variable in var_list_user. For each line,
# extract the the name of the variable that is being set (say VAR) and
Expand Down
16 changes: 12 additions & 4 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ RUN_ENVIR="nco"
# for supported machines.
#
# BUILD_MOD_FN:
# Name of alternative build module file to use if using an
# unsupported platform. Is set automatically for supported machines.
# Name of build module file to load before running a workflow task. If
# this is not specified by the user in the experiment configuration file
# (EXPT_CONFIG_FN), it will be set automatically for supported machines.
#
# WFLOW_MOD_FN:
# Name of alternative workflow module file to use if using an
# unsupported platform. Is set automatically for supported machines.
# Name of workflow module file to load before (re)launching the experiment's
# ROCOTO workflow (using the "rocotorun" command). If this is not specified
# by the user in the experiment configuration file (EXPT_CONFIG_FN), it
# will be set automatically for supported machines.
#
# SCHED:
# The job scheduler to use (e.g. slurm). Set this to an empty string in
Expand Down Expand Up @@ -307,6 +310,10 @@ DOT_OR_USCORE="_"
# EXPT_CONFIG_FN:
# Name of the user-specified configuration file for the forecast experiment.
#
# CONSTANTS_FN:
# Name of the file containing definitions of various mathematical, physical,
# and SRW App contants.
#
# RGNL_GRID_NML_FN:
# Name of file containing the namelist settings for the code that generates
# a "ESGgrid" type of regional grid.
Expand Down Expand Up @@ -388,6 +395,7 @@ DOT_OR_USCORE="_"
#-----------------------------------------------------------------------
#
EXPT_CONFIG_FN="config.sh"
CONSTANTS_FN="constants.sh"

RGNL_GRID_NML_FN="regional_grid.nml"

Expand Down
46 changes: 43 additions & 3 deletions ush/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,56 @@
pi_geom="3.14159265358979323846264338327"

# Degrees per radian.
degs_per_radian=$( bc -l <<< "360.0/(2.0*$pi_geom)" )
degs_per_radian=$( bc -l <<< "360.0/(2.0*${pi_geom})" )

# Radius of the Earth in meters.
radius_Earth="6371200.0"

#
#-----------------------------------------------------------------------
#
# Other.
# Valid values that a user may set a boolean variable to (e.g. in the
# SRW App's experiment configuration file).
#
#-----------------------------------------------------------------------
#
valid_vals_BOOLEAN=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
#
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the constants NH0, NH3, and NH4 from setup.sh to this file (constants.sh) since these parameters are constants. Then functions can get access to these by sourcing constants.sh (without the need to create and then source var_defns.sh).

#-----------------------------------------------------------------------
#
# Any regional model must be supplied lateral boundary conditions (in
# addition to initial conditions) to be able to perform a forecast. In
# the FV3-LAM model, these boundary conditions (BCs) are supplied using
# a "halo" of grid cells around the regional domain that extend beyond
# the boundary of the domain. The model is formulated such that along
# with files containing these BCs, it needs as input the following files
# (in NetCDF format):
#
# 1) A grid file that includes a halo of 3 cells beyond the boundary of
# the domain.
# 2) A grid file that includes a halo of 4 cells beyond the boundary of
# the domain.
# 3) A (filtered) orography file without a halo, i.e. a halo of width
# 0 cells.
# 4) A (filtered) orography file that includes a halo of 4 cells beyond
# the boundary of the domain.
#
# Note that the regional grid is referred to as "tile 7" in the code.
# We will let:
#
# * NH0 denote the width (in units of number of cells on tile 7) of
# the 0-cell-wide halo, i.e. NH0 = 0;
#
# * NH3 denote the width (in units of number of cells on tile 7) of
# the 3-cell-wide halo, i.e. NH3 = 3; and
#
# * NH4 denote the width (in units of number of cells on tile 7) of
# the 4-cell-wide halo, i.e. NH4 = 4.
#
# We define these variables next.
#
#-----------------------------------------------------------------------
#
NH0=0
NH3=3
NH4=4

2 changes: 1 addition & 1 deletion ush/get_crontab_contents.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function get_crontab_contents() {
#
source $USHDIR/constants.sh
check_var_valid_value "called_from_cron" "valid_vals_BOOLEAN"
called_from_cron=$( boolify ${called_from_cron} )
called_from_cron=$(boolify "${called_from_cron}")

if [ "$MACHINE" = "WCOSS_DELL_P3" ]; then
__crontab_cmd__=""
Expand Down
Loading