Skip to content

Commit 57f530b

Browse files
Incorporate weight_gen program. (#677)
Add new "weight_gen" utility from the global-workflow. Include new consistency test, and scripts to run the utility on supported machines. Update doxygen and 'readthedocs' documentation. Fixes #673.
1 parent 32137cc commit 57f530b

21 files changed

+3567
-30
lines changed

README.md

+14-28
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ grid_tools | R. J. Purser (regional_esg_grid), Tom Black/Ben Blake (shave.fd), G
2727
orog_mask_tools | Ning Wang, Jordan Alpert, Shan Sun and Ning Wang
2828
sfc_climo_gen | George Gayno
2929
vcoord_gen | Fanglin Yang, Mark Iredell
30+
weight_gen | George Gayno
3031

3132
UFS_UTILS Code managers: George Gayno, Kyle Gerheiser, Jeff Beck, Larissa Reames
3233

@@ -76,51 +77,36 @@ make install
7677

7778
## Contents
7879

79-
The UFS_UTILS package contains the following utilities (under the sorc
80-
directory):
81-
- chgres_cube
82-
- cpld_gridgen
83-
- emcsfc_ice_blend
84-
- emcsfc_snow2mdl
85-
- fre-nctools
86-
- fvcom_tools
87-
- gblevents
88-
- global_cycle
89-
- grid_tools
90-
- orog_mask_tools
91-
- sfc_climo_gen
92-
- vcoord_gen
93-
94-
The reg_tests directory contains the consistency test code.
95-
96-
The fix directory is where we set links to directories containing
80+
The `sorc` directory contains the source code.
81+
82+
The `reg_tests` directory contains the consistency test code.
83+
84+
The `fix` directory contains links to directories containing
9785
large, static data files used by UFS_UTILS programs.
9886

99-
The tests directory contains unit tests.
87+
The `tests` directory contains unit tests.
10088

101-
The ush directory contains scripts to run UFS_UTILS programs. Most
89+
The `ush` directory contains scripts to run UFS_UTILS programs. Most
10290
are called from driver scripts.
10391

104-
The util directory contains utility scripts to create coldstart
105-
initial conditions for GFS parallels, and to run the vertical
106-
coordinate generator.
92+
The `util` directory contains utility scripts.
10793

108-
The parm directory contains variable mapping parameter tables used by
94+
The `parm` directory contains variable mapping parameter tables used by
10995
the chgres_cube program.
11096

111-
The driver_scripts directory contains high-level driver scripts to
97+
The `driver_scripts` directory contains high-level driver scripts to
11298
create a model grid on officially supported HPC platforms.
11399

114-
The modulefiles directory contains modules loaded when building
100+
The `modulefiles` directory contains modules loaded when building
115101
UFS_UTILS on supported HPC platforms. They are also loaded at runtime
116102
by utility and consistency test scripts.
117103

118-
The docs directory contains the control file for the doxygen
104+
The `docs` directory contains the control file for the doxygen
119105
documentation build, as well as some markdown files which are part of
120106
the documentation. It also contains (in the source subdirectory) the
121107
ReadTheDocs documentation files.
122108

123-
The cmake directory contains CMake package find utilities, and utilities to
109+
The `cmake` directory contains CMake package find utilities, and utilities to
124110
run units tests on some supported HPC platforms.
125111

126112
## References

docs/source/ufs_utils.rst

+48
Original file line numberDiff line numberDiff line change
@@ -600,3 +600,51 @@ Run script
600600
----------
601601

602602
To run, use script ./util/vcoord_gen/run.sh
603+
604+
weight_gen
605+
==========
606+
607+
Introduction
608+
------------
609+
610+
Creates ESMF 'scrip' files for gaussian grids.
611+
612+
Code structure
613+
--------------
614+
615+
Location of the source code: ./sorc/weight_gen.fd.
616+
617+
Program inputs
618+
--------------
619+
620+
The global FV3 grid resolution from standard output. Valid choices are:
621+
622+
* C48
623+
* C96
624+
* C128
625+
* C192
626+
* C384
627+
* C768
628+
* C1152
629+
* C3072
630+
631+
Program outputs
632+
---------------
633+
634+
Two gaussian grid 'scrip' files in NetCDF format. One includes two extra rows for the poles.
635+
636+
* C48 => 192x94 and 192x96 gaussian files
637+
* C96 => 384x192 and 384x194 gaussian files
638+
* C128 => 512x256 and 512x258 gaussian files
639+
* C192 => 768x384 and 768x386 gaussian files
640+
* C384 => 1536x768 and 1536x770 gaussian files
641+
* C768 => 3072x1536 and 3072x1538 gaussian files
642+
* C1152 => 4608x2304 and 4608x2406 gaussian files
643+
* C3072 => 12288x6144 and 12288x6146 gaussian files
644+
645+
Files contain center and corner point latitude and longitudes.
646+
647+
Run script
648+
----------
649+
650+
To run, use the machine-dependent script under ./util/weight_gen

docs/user_guide.md

+3
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,6 @@ https://github.com/ufs-community/UFS_UTILS.
7676
- <a href="cpld_gridgen/index.html">cpld_gridgen</a> - Utility to
7777
create the Fix and IC files for the S2SW and S2S applications
7878

79+
- <a href="weight_gen/index.html">weight_gen</a> - Utility to
80+
create gaussian grid ESMF 'scrip' files for use in creating
81+
ESMF interpolation weight files.

reg_tests/rt.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ for dir in snow2mdl global_cycle chgres_cube grid_gen; do
114114
cd ..
115115
done
116116

117-
for dir in ice_blend; do
117+
for dir in weight_gen ice_blend; do
118118
cd $dir
119119
if [[ $target == "hera" ]] || [[ $target == "jet" ]] || [[ $target == "orion" ]] || [[ $target == "s4" ]] ; then
120120
sbatch -A ${PROJECT_CODE} ./driver.$target.sh
@@ -140,7 +140,7 @@ echo "Commit hash: ${current_hash}" >> ${WORK_DIR}/reg_test_results.txt
140140
echo "" >> ${WORK_DIR}/reg_test_results.txt
141141

142142
success=true
143-
for dir in cpld_gridgen chgres_cube grid_gen global_cycle ice_blend snow2mdl; do
143+
for dir in weight_gen cpld_gridgen chgres_cube grid_gen global_cycle ice_blend snow2mdl; do
144144
if grep -qi "FAILED" ${dir}/summary.log; then
145145
success=false
146146
echo "${dir} consistency tests FAILED" >> ${WORK_DIR}/reg_test_results.txt

reg_tests/weight_gen/driver.hera.sh

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
#-----------------------------------------------------------------------------
4+
#
5+
# Run weight_gen consistency test on Hera.
6+
#
7+
# Set $DATA to your working directory. Set the project code (SBATCH -A)
8+
# and queue (SBATCH -q) as appropriate.
9+
#
10+
# Invoke the script as follows: sbatch $script
11+
#
12+
# Log output is placed in consistency.log. A summary is
13+
# placed in summary.log
14+
#
15+
# The test fails when its output does not match the baseline files
16+
# as determined by the 'nccmp' command. The baseline file is
17+
# stored in HOMEreg.
18+
#
19+
#-----------------------------------------------------------------------------
20+
21+
#SBATCH -J weight_gen
22+
#SBATCH -A fv3-cpu
23+
#SBATCH --open-mode=truncate
24+
#SBATCH -o consistency.log
25+
#SBATCH -e consistency.log
26+
#SBATCH --ntasks=1
27+
#SBATCH -q debug
28+
#SBATCH -t 00:03:00
29+
30+
set -x
31+
32+
compiler=${compiler:-"intel"}
33+
34+
source ../../sorc/machine-setup.sh > /dev/null 2>&1
35+
module use ../../modulefiles
36+
module load build.$target.$compiler
37+
module list
38+
39+
export DATA="${WORK_DIR:-/scratch2/NCEPDEV/stmp1/$LOGNAME}"
40+
export DATA="${DATA}/reg-tests/weight_gen"
41+
42+
#-----------------------------------------------------------------------------
43+
# Should not have to change anything below.
44+
#-----------------------------------------------------------------------------
45+
46+
export UPDATE_BASELINE="FALSE"
47+
#export UPDATE_BASELINE="TRUE"
48+
49+
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
50+
source ../get_hash.sh
51+
fi
52+
53+
export HOMEreg=/scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/weight_gen
54+
export HOMEufs=$PWD/../..
55+
56+
./weight_gen.sh
57+
58+
exit 0

reg_tests/weight_gen/driver.jet.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
#-----------------------------------------------------------------------------
4+
#
5+
# Run weight_gen consistency test on Jet.
6+
#
7+
# Set $DATA to your working directory. Set the project code
8+
# (SBATCH --account) as appropriate.
9+
#
10+
# Invoke the script as follows: sbatch $script
11+
#
12+
# Log output is placed in consistency.log. A summary is
13+
# placed in summary.log
14+
#
15+
# The test fails when its output does not match the baseline files
16+
# as determined by the 'nccmp' command. The baseline file is
17+
# stored in HOMEreg.
18+
#
19+
#-----------------------------------------------------------------------------
20+
21+
#SBATCH --nodes=1
22+
#SBATCH --partition=sjet
23+
#SBATCH --time 0:01
24+
#SBATCH --account=emcda
25+
#SBATCH --job-name=weight_gen
26+
#SBATCH -o consistency.log
27+
#SBATCH -e consistency.log
28+
29+
set -x
30+
31+
compiler=${compiler:-"intel"}
32+
33+
source ../../sorc/machine-setup.sh > /dev/null 2>&1
34+
module use ../../modulefiles
35+
module load build.$target.$compiler
36+
module list
37+
38+
export DATA="${WORK_DIR:-/lfs4/HFIP/emcda/$LOGNAME/stmp}"
39+
export DATA="${DATA}/reg-tests/weight_gen"
40+
41+
#-----------------------------------------------------------------------------
42+
# Should not have to change anything below.
43+
#-----------------------------------------------------------------------------
44+
45+
export UPDATE_BASELINE="FALSE"
46+
#export UPDATE_BASELINE="TRUE"
47+
48+
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
49+
source ../get_hash.sh
50+
fi
51+
52+
export HOMEreg=/lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/weight_gen
53+
export HOMEufs=$PWD/../..
54+
55+
./weight_gen.sh
56+
57+
exit 0

reg_tests/weight_gen/driver.orion.sh

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
#-----------------------------------------------------------------------------
4+
#
5+
# Run weight_gen consistency test on Orion.
6+
#
7+
# Set $DATA to your working directory. Set the project code (SBATCH -A)
8+
# and queue (SBATCH -q) as appropriate.
9+
#
10+
# Invoke the script as follows: sbatch $script
11+
#
12+
# Log output is placed in consistency.log. A summary is
13+
# placed in summary.log
14+
#
15+
# The test fails when its output does not match the baseline files
16+
# as determined by the 'nccmp' command. The baseline file is
17+
# stored in HOMEreg.
18+
#
19+
#-----------------------------------------------------------------------------
20+
21+
#SBATCH -J weight_gen
22+
#SBATCH -A fv3-cpu
23+
#SBATCH --open-mode=truncate
24+
#SBATCH -o consistency.log
25+
#SBATCH -e consistency.log
26+
#SBATCH --ntasks=1
27+
#SBATCH -q debug
28+
#SBATCH -t 00:03:00
29+
30+
set -x
31+
32+
compiler=${compiler:-"intel"}
33+
34+
source ../../sorc/machine-setup.sh > /dev/null 2>&1
35+
module use ../../modulefiles
36+
module load build.$target.$compiler
37+
module list
38+
39+
export DATA="${WORK_DIR:-/work/noaa/stmp/$LOGNAME}"
40+
export DATA="${DATA}/reg-tests/weight_gen"
41+
42+
#-----------------------------------------------------------------------------
43+
# Should not have to change anything below.
44+
#-----------------------------------------------------------------------------
45+
46+
export UPDATE_BASELINE="FALSE"
47+
#export UPDATE_BASELINE="TRUE"
48+
49+
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
50+
source ../get_hash.sh
51+
fi
52+
53+
export HOMEreg=/work/noaa/nems/role-nems/ufs_utils/reg_tests/weight_gen
54+
export HOMEufs=$PWD/../..
55+
56+
./weight_gen.sh
57+
58+
exit 0

reg_tests/weight_gen/driver.wcoss2.sh

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
#-----------------------------------------------------------------------------
4+
#
5+
# Run weight_gen consistency test on WCOSS2.
6+
#
7+
# Set $DATA to your working directory. Set the project code (PBS -A)
8+
# and queue (PBS -q) as appropriate.
9+
#
10+
# Invoke the script as follows: qsub $script
11+
#
12+
# Log output is placed in consistency.log. A summary is
13+
# placed in summary.log
14+
#
15+
# The test fails when its output does not match the baseline files
16+
# as determined by the 'nccmp' command. The baseline file is
17+
# stored in HOMEreg.
18+
#
19+
#-----------------------------------------------------------------------------
20+
21+
#PBS -l walltime=00:02:00
22+
#PBS -o consistency.log
23+
#PBS -e consistency.log
24+
#PBS -N wgt_regt
25+
#PBS -q debug
26+
#PBS -A GFS-DEV
27+
#PBS -l select=1:ncpus=1:mem=250MB
28+
29+
set -x
30+
31+
cd $PBS_O_WORKDIR
32+
33+
compiler=${compiler:-"intel"}
34+
35+
source ../../sorc/machine-setup.sh > /dev/null 2>&1
36+
module use ../../modulefiles
37+
module load build.$target.$compiler
38+
module list
39+
40+
export DATA="${WORK_DIR:-/lfs/h2/emc/stmp/$LOGNAME}"
41+
export DATA="${DATA}/reg-tests/weight_gen"
42+
43+
#-----------------------------------------------------------------------------
44+
# Should not have to change anything below.
45+
#-----------------------------------------------------------------------------
46+
47+
export UPDATE_BASELINE="FALSE"
48+
#export UPDATE_BASELINE="TRUE"
49+
50+
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
51+
source ../get_hash.sh
52+
fi
53+
54+
export HOMEreg=/lfs/h2/emc/global/noscrub/George.Gayno/ufs_utils.git/reg_tests/weight_gen
55+
export HOMEufs=$PBS_O_WORKDIR/../..
56+
57+
export NCCMP=/lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp
58+
59+
./weight_gen.sh
60+
61+
exit 0

0 commit comments

Comments
 (0)