Skip to content

Commit

Permalink
Remove separate UPP clone
Browse files Browse the repository at this point in the history
Now that UPP is cloned within UFS, there is no need to create an independent
clone in global-workflow. Scripts are updated to use the UPP within UFS. In
addition to removing redundancy, this will eliminate version mismatch issues
when UFS and global-workflow checkout different versions. The upp directory
is now linked from within UFS to sorc as upp.fd (instead of the gfs_post.fd
the clone was placed in). Additionally, the build script is renamed to
`build_upp.sh`.

Fixes NOAA-EMC#770
Moots NOAA-EMC#797
  • Loading branch information
WalterKolczynski-NOAA committed May 20, 2022
1 parent 58728fb commit 885a882
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 59 deletions.
16 changes: 9 additions & 7 deletions sorc/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ function _usage() {

_build_ufs_opt=""
_verbose_opt=""
_build_ops_opt=""
# Reset option counter in case this script is sourced
OPTIND=1
while getopts ":a:c:hv" option; do
while getopts ":a:c:hov" option; do
case "${option}" in
a) _build_ufs_opt+="-a ${OPTARG} ";;
c) _partial_opt+="-c ${OPTARG} ";;
h) _usage;;
# s) _build_ufs_opt+="-s ${OPTARG} ";;
o) _build_ops_opt="-o";;
v) _verbose_opt="-v";;
\?)
echo "[$BASH_SOURCE]: Unrecognized option: ${option}"
Expand Down Expand Up @@ -133,15 +135,15 @@ $Build_gsi && {
}

#------------------------------------
# build ncep_post
# build UPP
#------------------------------------
$Build_ncep_post && {
echo " .... Building ncep_post .... "
./build_ncep_post.sh $_verbose_opt > $logs_dir/build_ncep_post.log 2>&1
$Build_upp && {
echo " .... Building UPP .... "
./build_upp.sh $_verbose_opt $_build_ops_opt > $logs_dir/build_upp.log 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
echo "Fatal error in building ncep_post."
echo "The log file is in $logs_dir/build_ncep_post.log"
echo "Fatal error in building UPP."
echo "The log file is in $logs_dir/build_upp.log"
fi
((err+=$rc))
}
Expand Down
2 changes: 1 addition & 1 deletion sorc/build_ncep_post.sh → sorc/build_upp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [ ! -d "../exec" ]; then
mkdir ../exec
fi

cd gfs_post.fd/tests
cd ufs_model.fd/FV3/upp/tests
./compile_upp.sh
37 changes: 14 additions & 23 deletions sorc/checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ if [[ ! -d ufs_model.fd ]] ; then
cd ufs_model.fd
git checkout ${ufs_model_hash:-Prototype-P8b}
git submodule update --init --recursive

################################################################################
# checkout_gtg
## yes: The gtg code at NCAR private repository is available for ops. GFS only.
# Only approved persons/groups have access permission.
## no: No need to check out gtg code for general GFS users.
################################################################################
checkout_gtg=${checkout_gtg:-"NO"}
if [[ ${checkout_gtg} == "YES" ]] ; then
cd FV3/upp
./manage_externals/checkout_externals
cp sorc/post_gtg.fd/*F90 sorc/ncep_post.fd/.
cp sorc/post_gtg.fd/gtg.config.gfs parm/gtg.config.gfs
fi
cd ${topdir}
else
echo 'Skip. Directory ufs_model.fd already exists.'
Expand Down Expand Up @@ -72,29 +86,6 @@ else
echo 'Skip. Directory ufs_utils.fd already exists.'
fi

echo UPP checkout ...
if [[ ! -d gfs_post.fd ]] ; then
rm -f ${topdir}/checkout-gfs_post.log
git clone https://github.com/NOAA-EMC/UPP.git gfs_post.fd >> ${logdir}/checkout-gfs_post.log 2>&1
cd gfs_post.fd
git checkout upp_v10.0.11
################################################################################
# checkout_gtg
## yes: The gtg code at NCAR private repository is available for ops. GFS only.
# Only approved persons/groups have access permission.
## no: No need to check out gtg code for general GFS users.
################################################################################
checkout_gtg=${checkout_gtg:-"NO"}
if [[ ${checkout_gtg} == "YES" ]] ; then
./manage_externals/checkout_externals
cp sorc/post_gtg.fd/*F90 sorc/ncep_post.fd/.
cp sorc/post_gtg.fd/gtg.config.gfs parm/gtg.config.gfs
fi
cd ${topdir}
else
echo 'Skip. Directory gfs_post.fd already exists.'
fi

checkout_wafs=${checkout_wafs:-"NO"}
if [[ ${checkout_wafs} == "YES" ]] ; then
echo EMC_gfs_wafs checkout ...
Expand Down
16 changes: 0 additions & 16 deletions sorc/cpl_build.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion sorc/gfs_build.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Building ww3_prepost (ww3_prepost) .................... yes
Building gsi (gsi) .................................... yes
Building gldas (gldas) ................................ yes
Building ncep_post (ncep_post) ........................ yes
Building UPP (upp) .................................... yes
Building ufs_utils (ufs_utils) ........................ yes
Building gfs_wafs (gfs_wafs) .......................... yes
Building workflow_utils (workflow_utils)............... yes
Expand Down
24 changes: 14 additions & 10 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ SLINK="ln -fs"

pwd=$(pwd -P)

# Link post
$LINK ufs_model.fd/FV3/upp upp.fd

#------------------------------
#--model fix fields
#------------------------------
Expand Down Expand Up @@ -88,32 +91,33 @@ if [ -d ${pwd}/ufs_utils.fd ]; then
./link_fixdirs.sh $RUN_ENVIR $machine
fi


#---------------------------------------
#--add files from external repositories
#---------------------------------------
cd ${pwd}/../jobs ||exit 8
$LINK ../sorc/gfs_post.fd/jobs/JGLOBAL_ATMOS_POST_MANAGER .
$LINK ../sorc/gfs_post.fd/jobs/JGLOBAL_ATMOS_NCEPPOST .
$LINK ../sorc/gldas.fd/jobs/JGDAS_ATMOS_GLDAS .
$LINK ../sorc/upp.fd/jobs/JGLOBAL_ATMOS_POST_MANAGER .
$LINK ../sorc/upp.fd/jobs/JGLOBAL_ATMOS_NCEPPOST .
$LINK ../sorc/gldas.fd/jobs/JGDAS_ATMOS_GLDAS .
cd ${pwd}/../parm ||exit 8
[[ -d post ]] && rm -rf post
$LINK ../sorc/gfs_post.fd/parm post
$LINK ../sorc/upp.fd/parm post
[[ -d gldas ]] && rm -rf gldas
$LINK ../sorc/gldas.fd/parm gldas
cd ${pwd}/../scripts ||exit 8
$LINK ../sorc/gfs_post.fd/scripts/exgdas_atmos_nceppost.sh .
$LINK ../sorc/upp.fd/scripts/exgdas_atmos_nceppost.sh .
if [ $model = "coupled" ]; then
$LINK exgfs_nceppost_cpl.sh exgfs_atmos_nceppost.sh
else
$LINK ../sorc/gfs_post.fd/scripts/exgfs_atmos_nceppost.sh .
$LINK ../sorc/upp.fd/scripts/exgfs_atmos_nceppost.sh .
fi
$LINK ../sorc/gfs_post.fd/scripts/exglobal_atmos_pmgr.sh .
$LINK ../sorc/upp.fd/scripts/exglobal_atmos_pmgr.sh .
$LINK ../sorc/ufs_utils.fd/scripts/exemcsfc_global_sfc_prep.sh .
$LINK ../sorc/gldas.fd/scripts/exgdas_atmos_gldas.sh .
cd ${pwd}/../ush ||exit 8
for file in fv3gfs_downstream_nems.sh fv3gfs_dwn_nems.sh gfs_nceppost.sh \
gfs_transfer.sh mod_icec.sh link_crtm_fix.sh trim_rh.sh fix_precip.sh; do
$LINK ../sorc/gfs_post.fd/ush/$file .
$LINK ../sorc/upp.fd/ush/$file .
done
if [ $model = "coupled" ]; then
rm fv3gfs_downstream_nems.sh
Expand Down Expand Up @@ -253,7 +257,7 @@ done
$LINK ../sorc/ufs_model.fd/build/ufs_model .

[[ -s gfs_ncep_post ]] && rm -f gfs_ncep_post
$LINK ../sorc/gfs_post.fd/exec/upp.x gfs_ncep_post
$LINK ../sorc/upp.fd/exec/upp.x gfs_ncep_post

if [ -d ${pwd}/gfs_wafs.fd ]; then
for wafsexe in \
Expand Down Expand Up @@ -340,7 +344,7 @@ cd ${pwd}/../sorc || exit 8
[[ -d recentersigp.fd ]] && rm -rf recentersigp.fd
$SLINK gsi.fd/util/EnKF/gfs/src/recentersigp.fd recentersigp.fd

$SLINK gfs_post.fd/sorc/ncep_post.fd gfs_ncep_post.fd
$SLINK upp.fd/sorc/ncep_post.fd gfs_ncep_post.fd

for prog in fregrid make_hgrid make_solo_mosaic ; do
$SLINK ufs_utils.fd/sorc/fre-nctools.fd/tools/$prog ${prog}.fd
Expand Down
2 changes: 1 addition & 1 deletion sorc/partial_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare -a Build_prg=("Build_ufs_model" \
"Build_ww3_prepost" \
"Build_reg2grb2" \
"Build_gldas" \
"Build_ncep_post" \
"Build_upp" \
"Build_ufs_utils" \
"Build_gfs_wafs" \
"Build_workflow_utils" \
Expand Down

0 comments on commit 885a882

Please sign in to comment.