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

Script to clone, build workflow and generate experiment for prototypes #470

Merged
merged 23 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8ae1a83
Commit to test on Hera
CoryMartin-NOAA May 8, 2023
4222119
Update to clone/checkout properly
CoryMartin-NOAA May 8, 2023
3e40d64
Incremental commit
CoryMartin-NOAA May 9, 2023
e47acf4
Merge branch 'feature/gen_proto' of https://github.com/NOAA-EMC/GDASA…
CoryMartin-NOAA May 9, 2023
0caf649
incremental commit
CoryMartin-NOAA May 10, 2023
af866cd
fix for CI with workflow change
CoryMartin-NOAA May 10, 2023
c54c4a0
actually fix CI
CoryMartin-NOAA May 10, 2023
40cf983
another attempt to fix CI
CoryMartin-NOAA May 10, 2023
08e30ed
Small change
CoryMartin-NOAA May 10, 2023
3593ab2
end of day commit
CoryMartin-NOAA May 11, 2023
7e8c510
Changes to be consistent with g-w
CoryMartin-NOAA May 12, 2023
3685fcf
typo fix
CoryMartin-NOAA May 12, 2023
89ffbc8
Change hashes
CoryMartin-NOAA May 12, 2023
0949755
Merge branch 'develop' into feature/gen_proto
CoryMartin-NOAA May 12, 2023
ac06b56
added gfs arg (#471)
guillaumevernieres May 12, 2023
d6f8eb4
Run rocotorun and rocotostat
CoryMartin-NOAA May 12, 2023
3292266
Merge branch 'feature/gen_proto' of https://github.com/NOAA-EMC/gdasa…
CoryMartin-NOAA May 12, 2023
fc5a92e
Merge branch 'develop' into feature/gen_proto
CoryMartin-NOAA May 12, 2023
7535781
comment out bad test
CoryMartin-NOAA May 12, 2023
95615d4
Fix issues russ pointed out in issue
CoryMartin-NOAA May 12, 2023
6c72f5a
replace NMEM_ENKF with NMEM_ENS in jjobs_ens_init.sh (#467)
RussTreadon-NOAA May 13, 2023
b06683a
modify run_jjobs
CoryMartin-NOAA May 15, 2023
0331671
Merge branch 'feature/gen_proto' of https://github.com/NOAA-EMC/GDASA…
CoryMartin-NOAA May 15, 2023
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
1 change: 1 addition & 0 deletions modulefiles/GDAS/hera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ load("netcdf-cxx4/4.3.1")
load("json/3.10.5")
load("py-pybind11/2.8.1")
--load("crtm/v2.4_jedi")
load("rocoto/1.3.3")

load("hpc/1.2.0")
load("miniconda3/4.6.14")
Expand Down
3 changes: 3 additions & 0 deletions modulefiles/GDAS/orion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ load("ncview/2.1.8")
load("netcdf-cxx4/4.3.1")
load("py-pybind11/2.8.1")
--load("crtm/v2.4_jedi")
load("contrib/0.1")
load("noaatools/2.0")
load("rocoto/1.3.3")

load("hpc/1.2.0")
load("miniconda3/4.6.14")
Expand Down
25 changes: 25 additions & 0 deletions prototypes/configs/cp0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# top level options
GWHASH=255d99b
GDASHASH=ab6f06d
BUILD="NO"
PSLOT=cp0
PROTOROOT=/scratch1/NCEPDEV/da/Cory.R.Martin/GDAS_prototypes
GWDIR=$PROTOROOT/$PSLOT
DUMPDIR=/scratch1/NCEPDEV/da/role.jedipara/dump/
ICSDIR=/scratch1/NCEPDEV/stmp4/Cory.R.Martin/tmp_ics
expdir=$PROTOROOT/expdirs
comrot=$PROTOROOT/rotdirs
idate=2021073118
edate=2021080118
app="ATM"
starttype="cold"
gfscyc=0
resdet=96
resens=96
nens=0
# config.* options
DO_JEDIATMVAR="YES"
DO_JEDIATMENS="NO"
DO_JEDIOCNVAR="NO"
DO_JEDILANDDA="NO"
DO_MERGENSST="NO"
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved
103 changes: 103 additions & 0 deletions prototypes/gen_prototype.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/bin/bash
set -e

# ==============================================================================
usage() {
set +x
echo
echo "Usage: $0 -c <config> -t <target> -h"
echo
echo " -c Configuration for prototype defined in shell script <config>"
echo " -t Supported platform script is running on <Hera|Orion>"
echo " -h display this message and quit"
echo
exit 1
}

# ==============================================================================
while getopts "c:t:h" opt; do
case $opt in
c)
config=$OPTARG
;;
t)
MACHINE=${MACHINE:-$OPTARG}
;;
h|\?|:)
usage
;;
esac
done

dir_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ >/dev/null 2>&1 && pwd )"

# source the input configuration
source $config

# create directories
mkdir -p $PROTOROOT/$PSLOT

# clone/build/link workflow and GDASApp
if [[ $BUILD == 'YES' ]]; then
cd $GWDIR
git clone https://github.com/NOAA-EMC/global-workflow.git
cd global-workflow/sorc
git checkout $GWHASH
./checkout.sh -ug
cd gdas.cd
git checkout $GDASHASH
cd ../
./build_all.sh
./link_workflow.sh
fi

# load modules to then generate experiment directory and rocoto XML
module use $dir_root/modulefiles
module load GDAS/$MACHINE

# move expdir if it exists, delete backup if it exists
if [[ -d $expdir/$PSLOT ]]; then
[[ -d $expdir/${PSLOT}.bak ]] && rm -rf $expdir/${PSLOT}.bak
mv $expdir/$PSLOT $expdir/${PSLOT}.bak
fi

# move rotdir if it exists, delete backup if it exists
if [[ -d $comrot/$PSLOT ]]; then
[[ -d $comrot/${PSLOT}.bak ]] && rm -rf $comrot/${PSLOT}.bak
mv $comrot/$PSLOT $comrot/${PSLOT}.bak
fi

# create YAML to override workflow config defaults
mkdir -p $expdir
cat > $expdir/config_${PSLOT}.yaml << EOF
base:
ACCOUNT: "da-cpu"
HPSS_PROJECT: "emc-da"
HOMEDIR: "/scratch1/NCEPDEV/da/${USER}"
DMPDIR: "${DUMPDIR}"
DO_JEDIATMVAR: "${DO_JEDIATMVAR}"
DO_JEDIATMENS: "${DO_JEDIATMENS}"
DO_JEDIOCNVAR: "${DO_JEDIOCNVAR}"
DO_JEDILANDDA: "${DO_JEDILANDDA}"
DO_MERGENSST: "${DO_MERGENSST}"
EOF

# setup experiment
cd $GWDIR/global-workflow/workflow
./setup_expt.py gfs cycled --idate $idate \
--edate $edate \
--app $app \
--start $starttype \
--gfs_cyc $gfscyc \
--resdet $resdet \
--resens $resens \
--nens $nens \
--pslot $PSLOT \
--configdir $GWDIR/global-workflow/parm/config/gfs \
--comrot $comrot \
--expdir $expdir \
--icsdir $ICSDIR \
--yaml $expdir/config_${PSLOT}.yaml

# setup XML for workflow
./setup_xml.py $expdir/$PSLOT
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions test/atm/global-workflow/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ export imp_physics=@IMP_PHYSICS@

# Shared parameters
# DA engine
export DO_JEDIVAR="@DO_JEDIVAR@"
export DO_JEDIENS="@DO_JEDIENS@"
export DO_JEDIATMVAR="@DO_JEDIATMVAR@"
export DO_JEDIATMENS="@DO_JEDIATMENS@"
export DO_JEDIOCNVAR="NO"
export DO_JEDILANDDA="NO"
export DO_MERGENSST="NO"
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
base:
NCDUMP: $CONDA_PREFIX/ncdump
DO_JEDIVAR: "YES"
DO_JEDIENS: "YES"
DO_JEDIATMVAR: "YES"
DO_JEDIATMENS: "YES"
UTILROOT: /apps/contrib/NCEP/libs/hpc-stack/intel-2018.4/prod_util/1.2.2
DATAPATH: "@bindir@/test/atm/global-workflow/testrun"
DUMPDIR: "@dumpdir@"
Expand Down
2 changes: 1 addition & 1 deletion test/atm/global-workflow/jjob_ens_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export COM_TOP=$ROTDIR

# Set GFS COM paths
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/parm/config/config.com"
source "${HOMEgfs}/parm/config/gfs/config.com"

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
Expand Down
2 changes: 1 addition & 1 deletion test/atm/global-workflow/jjob_var_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export COM_TOP=$ROTDIR

# Set GFS COM paths
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/parm/config/config.com"
source "${HOMEgfs}/parm/config/gfs/config.com"

# Set python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
Expand Down
4 changes: 2 additions & 2 deletions test/atm/global-workflow/setup_workflow_exp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resdet='48'
resens='48'
nens=3
pslot='gdas_test'
configdir=$srcdir/../../parm/config
configdir=$srcdir/../../parm/config/gfs
comrot=$bindir/test/atm/global-workflow/testrun/ROTDIRS
expdir=$bindir/test/atm/global-workflow/testrun/experiments

Expand All @@ -37,7 +37,7 @@ ln -sf $srcdir/../../workflow/setup_expt.py .


echo "Running global-workflow experiment generation script"
$srcdir/../../workflow/setup_expt.py cycled --idate $idate \
$srcdir/../../workflow/setup_expt.py gfs cycled --idate $idate \
--edate $edate \
--app $app \
--start $starttype \
Expand Down
4 changes: 2 additions & 2 deletions test/setup_workflow_exp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resdet='48'
resens='24'
nens=0
pslot='gdas_test'
configdir=$srcdir/../../parm/config
configdir=$srcdir/../../parm/config/gfs
comrot=$bindir/test/testrun/ROTDIRS
expdir=$bindir/test/testrun/experiments

Expand All @@ -24,6 +24,6 @@ rm -rf "${comrot}" "${expdir}"
cd $srcdir/../../workflow

echo "Running global-workflow experiment generation script"
./setup_expt.py cycled --idate $idate --edate $edate --app $app --start $starttype --gfs_cyc $gfscyc --resdet $resdet --resens $resens --nens $nens --pslot $pslot --configdir $configdir --comrot $comrot --expdir $expdir
./setup_expt.py gfs cycled --idate $idate --edate $edate --app $app --start $starttype --gfs_cyc $gfscyc --resdet $resdet --resens $resens --nens $nens --pslot $pslot --configdir $configdir --comrot $comrot --expdir $expdir

exit $?
Loading