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

[develop] Transition the var_defns bash file to YAML. #1098

Merged
merged 43 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
55b500b
WIP
christinaholtNOAA Apr 11, 2024
46c4805
Add machine to command
christinaholtNOAA Apr 11, 2024
87e549f
Keep same environment behavior for AQM jobs.
christinaholtNOAA Apr 11, 2024
59d07d4
WIP
christinaholtNOAA Apr 18, 2024
446f6eb
Finished up first round of ex-scripts
christinaholtNOAA Apr 18, 2024
38f9daa
Order docs.
christinaholtNOAA Apr 18, 2024
8496c68
Order jobs.
christinaholtNOAA Apr 18, 2024
e5b28da
Ordering for sourced files.
christinaholtNOAA Apr 18, 2024
16da1ef
Cleaning up old functionality.
christinaholtNOAA Apr 18, 2024
444f1f0
WIP
christinaholtNOAA Apr 18, 2024
a12f6fb
WIP
christinaholtNOAA Apr 19, 2024
4bec6b7
WIP
christinaholtNOAA Apr 19, 2024
0d86ab0
Fix all the subshell problems.
christinaholtNOAA Apr 19, 2024
a6513cb
Merge remote-tracking branch 'origin/develop' into to_yaml
christinaholtNOAA Apr 23, 2024
f08e3ef
Boolified.
christinaholtNOAA Apr 27, 2024
94d7970
WIP
christinaholtNOAA Jun 11, 2024
4ef89f6
Merge remote-tracking branch 'origin/develop' into to_yaml
christinaholtNOAA Jun 11, 2024
874af4b
Bump uwtools version.
christinaholtNOAA Jun 11, 2024
d2a0bc2
Source from a function.
christinaholtNOAA Jun 11, 2024
253590f
WIP
christinaholtNOAA Jun 17, 2024
e242490
Add nco section to be sourced always.
christinaholtNOAA Jun 18, 2024
241ef5d
A bit of clean up
christinaholtNOAA Jun 18, 2024
f360da3
Update jobs/JREGIONAL_MAKE_OROG
christinaholtNOAA Jun 28, 2024
b31f6c7
Applying suggested changes from review.
christinaholtNOAA Jul 12, 2024
2ed368f
Update docs for default values.
christinaholtNOAA Jul 12, 2024
8b9eb07
Merge branch 'to_yaml' of https://github.com/ChristinaholtNOAA/ufs-sr…
christinaholtNOAA Jul 12, 2024
0a8cf97
Merge branch 'develop' of https://github.com/ufs-community/ufs-srweat…
christinaholtNOAA Jul 12, 2024
5502cdc
This should no longer be an executable bash file.
christinaholtNOAA Jul 12, 2024
b368974
Linting.
christinaholtNOAA Jul 13, 2024
b7bacbc
Addressing PR comments.
christinaholtNOAA Jul 15, 2024
d7378dc
Apply suggestions from code review
christinaholtNOAA Jul 15, 2024
e29b3b4
Fix reported stat namespace collision.
christinaholtNOAA Jul 16, 2024
d3f40c6
Merge branch 'to_yaml' of https://github.com/ChristinaholtNOAA/ufs-sr…
christinaholtNOAA Jul 16, 2024
8f7ac15
Apply suggestions from code review
christinaholtNOAA Jul 17, 2024
50be36a
Missed one!
christinaholtNOAA Jul 17, 2024
1acdb48
Making additional PR requested changes.
christinaholtNOAA Jul 17, 2024
ce0a6e6
Merge branch 'to_yaml' of https://github.com/ChristinaholtNOAA/ufs-sr…
christinaholtNOAA Jul 17, 2024
ff4f030
[to_yaml] Update wrapper scripts to allow them to run using var_defns…
MichaelLueken Jul 23, 2024
1afdf51
Merge pull request #4 from MichaelLueken/to_yaml
christinaholtNOAA Jul 23, 2024
060ecc9
Remove tests that are no longer relevant.
christinaholtNOAA Jul 23, 2024
072e8eb
Merge branch 'to_yaml' of https://github.com/ChristinaholtNOAA/ufs-sr…
christinaholtNOAA Jul 23, 2024
2ce08ae
[to_yaml] Update .cicd/scripts/wrapper_srw_ftest.sh to add third argu…
MichaelLueken Jul 25, 2024
85070ad
Merge pull request #5 from MichaelLueken/to_yaml
christinaholtNOAA Jul 25, 2024
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
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
christinaholtNOAA committed Apr 18, 2024
commit 59d07d42427aab5e3fca9ddea277abfe58560d20
95 changes: 3 additions & 92 deletions jobs/JREGIONAL_MAKE_GRID
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,9 @@
#
#-----------------------------------------------------------------------
#
# This script generates grid and orography files in NetCDF format that
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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
Expand Down
45 changes: 44 additions & 1 deletion scripts/exregional_check_post_output.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
#!/usr/bin/env bash

#
#-----------------------------------------------------------------------
#
# The ex-script for checking the post output.
#
# Run-time environment variables:
#
# GLOBAL_VAR_DEFNS_FP
# ENSMEM_INDX
# CDATE
# VAR
# ACCUM_HH
#
# Experiment variables
#
# user:
# USHdir
#
# workflow:
# FCST_LEN_HRS
#
# global:
# DO_ENSEMBLE
# ENS_TIME_LAG_HRS
#
# constants:
# SECS_PER_HOUR
#
# verification:
# VX_NDIGITS_ENSMEM_NAMES
# FCST_SUBDIR_TEMPLATE
# FCST_FN_TEMPLATE
# VX_FCST_INPUT_BASEDIR
# NUM_MISSING_FCST_FILES_MAX
#
#-----------------------------------------------------------------------
#

#
#-----------------------------------------------------------------------
#
Expand All @@ -8,7 +46,12 @@
#-----------------------------------------------------------------------
#
. $USHdir/source_util_funcs.sh
source_config_for_task "task_run_met_pcpcombine|task_run_post" ${GLOBAL_VAR_DEFNS_FP}
for sect in (user workflow global constants verification) ; do
for var in $(uw config realize -i ${GLOBAL_VAR_DEFNS_FP} --output-format sh \
--output-block ${sect}) ; do
export $var
done
done
#
#-----------------------------------------------------------------------
#
Expand Down
73 changes: 71 additions & 2 deletions scripts/exregional_get_extrn_mdl_files.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
#!/usr/bin/env bash


#
#-----------------------------------------------------------------------
#
# The ex-script for getting the model files that will be used for either
# initial conditions or lateral boundary conditions for the experiment.
#
# Run-time environment variables:
#
# GLOBAL_VAR_DEFNS_FP
# ICS_OR_LBCS
# PDY
# cyc
# CDATE
# DATA
# COMIN
# EXTRN_MDL_STAGING_DIR
# TIME_OFFSET_HRS
# EXTRN_MDL_NAME
# EXTRN_MDL_CDATE
# NET
#
# Experiment variables
#
# user:
# USHdir
# RUN_ENVIR
# PARMdir
# MACHINE
#
# workflow:
# DATE_FIRST_CYCL
# INCR_CYCL_FREQ
# FCST_LEN_CYCL
# SYMLINK_FIX_FILES
# EXTRN_MDL_VAR_DEFNS_FN
#
# global:
# DO_ENSEMBLE
# NUM_ENS_MEMBERS
#
# platform:
# EXTRN_MDL_DATA_STORES
#
# task_get_extrn_ics:
# EXTRN_MDL_FILES_ICS
# FV3GFS_FILE_FMT_ICS
# EXTRN_MDL_SOURCE_BASEDIR_ICS
# EXTRN_MDL_SYSBASEDIR_ICS
#
# task_get_extrn_lbcs:
# LBC_SPEC_INTVL_HRS
# EXTRN_MDL_FILES_LBCS
# FV3GFS_FILE_FMT_LBCS
# EXTRN_MDL_SOURCE_BASEDIR_LBCS
# EXTRN_MDL_SYSBASEDIR_LBCS
#
#-----------------------------------------------------------------------
#




#
#-----------------------------------------------------------------------
#
Expand All @@ -8,7 +71,13 @@
#-----------------------------------------------------------------------
#
. $USHdir/source_util_funcs.sh
source_config_for_task "task_get_extrn_ics|task_get_extrn_lbcs" ${GLOBAL_VAR_DEFNS_FP}
for sect in (user workflow global platform task_get_extrn_ics \
task_get_extrn_lbcs) ; do
for var in $(uw config realize -i ${GLOBAL_VAR_DEFNS_FP} --output-format sh \
--output-block ${sect}) ; do
export $var
done
done
#
#-----------------------------------------------------------------------
#
Expand Down Expand Up @@ -222,7 +291,7 @@ if [ "${EXTRN_MDL_NAME}" = "GEFS" ]; then
for num in $(seq -f "%02g" ${NUM_ENS_MEMBERS}); do
sorted_fn=( )
for fcst_hr in "${all_fcst_hrs_array[@]}"; do
# Read in filenames from $EXTRN_MDL_FNS and sort them
# Read in filenames from EXTRN_MDL_FNS and sort them
base_path="${EXTRN_MDL_STAGING_DIR}/mem`printf %03d $num`"
filenames_array=`awk -F= '/EXTRN_MDL_FNS/{print $2}' $base_path/${EXTRN_DEFNS}`
for filename in ${filenames_array[@]}; do
Expand Down
30 changes: 29 additions & 1 deletion scripts/exregional_get_verif_obs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
#!/usr/bin/env bash

#
#-----------------------------------------------------------------------
#
# The ex-script that checks, pulls, and stages observation data for
# model verification.
#
# Run-time environment variables:
#
# GLOBAL_VAR_DEFNS_FP
# OBS_DIR
# PDY
# FHR
# OBTYPE
# VAR
#
# Experiment variables
#
# user:
# USHdir
# PARMdir
#
#-----------------------------------------------------------------------

#
#-----------------------------------------------------------------------
#
Expand All @@ -8,7 +31,12 @@
#-----------------------------------------------------------------------
#
. $USHdir/source_util_funcs.sh
source_config_for_task " " ${GLOBAL_VAR_DEFNS_FP}
for sect in (user) ; do
for var in $(uw config realize -i ${GLOBAL_VAR_DEFNS_FP} --output-format sh \
--output-block ${sect}) ; do
export $var
done
done
#
#-----------------------------------------------------------------------
#
Expand Down
6 changes: 3 additions & 3 deletions scripts/exregional_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
#### Python Script Documentation Block
#
# Script name: exregional_integration_test.py
# Script description: Ensures the correct number of netcdf files are generated
# Script description: Ensures the correct number of netcdf files are generated
# for each experiment
#
# Author: Eddie Snyder Org: NOAA EPIC Date: 2024-02-05
#
#
# Instructions: 1. Pass the appropriate info for the required arguments:
# --fcst_dir=/path/to/forecast/files
# --fcst_len=<forecast length as Int>
# 2. Run script with arguments
#
#
# Notes/future work: - Currently SRW App only accepts netcdf as the UFS WM
# output file format. If that changes, then additional
# logic is needed to address the other file formats.
Expand Down
Loading