Skip to content

Commit

Permalink
Issue #120: updates to address NCO GFS v16 DA bugzillas
Browse files Browse the repository at this point in the history
 * scripts/exgdas_enkf_fcst.sh - remove hardwired default path for NDATE
 * ush/build_all_cmake.sh - add NCO build option
 * ush/prune_4nco_global.sh - remove non GFS DA components from working directory
  • Loading branch information
RussTreadon-NOAA committed Apr 7, 2021
1 parent cfadd3c commit 532fa23
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 9 deletions.
1 change: 0 additions & 1 deletion scripts/exgdas_enkf_fcst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export FIX_AM=${FIX_AM:-$FIX_DIR/fix_am}
export NCP=${NCP:-"/bin/cp -p"}
export NMV=${NMV:-"/bin/mv"}
export NLN=${NLN:-"/bin/ln -sf"}
export NDATE=${NDATE:-/$NWPROD/util/exec/ndate}

# Scripts.
FORECASTSH=${FORECASTSH:-$HOMEgfs/scripts/exglobal_forecast.sh}
Expand Down
43 changes: 35 additions & 8 deletions ush/build_all_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
set -ex

cd ..
pwd=$(pwd)
dir_root=$(pwd)

build_type=${1:-'PRODUCTION'}
dir_root=${2:-$pwd}
dir_root=${2:-$dir_root}
mode=${3:-'EMC'}


# If NCO build, prune directories and files before build
if [ $mode = NCO ]; then
cd $dir_root/ush
$dir_root/ush/prune_4nco_global.sh prune
fi


# Initialize and load modules
if [[ -d /dcom && -d /hwrf ]] ; then
. /usrx/local/Modules/3.2.10/init/sh
target=wcoss
Expand Down Expand Up @@ -53,11 +63,6 @@ if [ ! -d $dir_modules ]; then
echo "modulefiles does not exist in $dir_modules"
exit 10
fi
[ -d $dir_root/exec ] || mkdir -p $dir_root/exec

rm -rf $dir_root/build
mkdir -p $dir_root/build
cd $dir_root/build

if [ $target = wcoss_d ]; then
module purge
Expand All @@ -79,12 +84,34 @@ else
source $dir_modules/modulefile.ProdGSI.$target
fi


# Create exec and build directories
[ -d $dir_root/exec ] || mkdir -p $dir_root/exec
rm -rf $dir_root/build
mkdir -p $dir_root/build
cd $dir_root/build


# Execute cmake
if [ $build_type = PRODUCTION -o $build_type = DEBUG ] ; then
cmake -DBUILD_UTIL=ON -DBUILD_NCDIAG_SERIAL=ON -DCMAKE_BUILD_TYPE=$build_type -DBUILD_CORELIBS=OFF ..
else
cmake ..
fi

make -j 8

# Build apps. Echo extra printout for NCO build
if [ $mode = NCO ]; then
make VERBOSE=1 -j 8
else
make -j 8
fi
rc=$?


# If NCO build is successful, remove build directory
if [ $mode = NCO -a $rc -eq 0 ]; then
rm -rf $dir_root/build
fi

exit
210 changes: 210 additions & 0 deletions ush/prune_4nco_global.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
#!/bin/sh

# This script removes or restores directories and/or files found in
# the rlist below from the current working directory. This script
# is intended to be executed when NCO implements GFS DA updates.
# NCO does not want package installations for operations to include
# non-operational code. This script removes directories and files
# not used by operations from the installation directory.
#
# Two modes are supported: prune, restore
# prune: use git rm -r to remove directories and files.
# The directories and files to remove are found
# in rlist below
# restore: use git RESET head and git checkout to restore
# removed directories and files
#

set -ex

mode=$1

# Check mode and set string
if [[ "$mode" = "prune" ]]; then
string="rm -r"
elif [[ "$mode" = "restore" ]]; then
string="reset HEAD"
else
echo " "
echo "***ERROR*** invalid mode= $mode"
echo " valid modes are prune or restore"
echo " "
exit
fi


# Set root directory
cd ..
topdir=$(pwd)

echo " "
echo "Execute git $string in $topdir"
echo " "


# Process top level directories
cd $topdir
rlist="regression src/GSD unit-tests"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done


# Process doc directories and files
cd $topdir/doc
rlist="EnKF_user_guide GSI_user_guide README.discover"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done


# Process scripts directories and files
cd $topdir/scripts
rlist="exurma2p5_gsianl.sh"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done


# Process ush directories and files
cd $topdir/ush
rlist="build.comgsi EnKF com Get_Initial_Files gfs_truncate_enkf llsub para refactor_4nco_global run_arw rungsi sub"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done


# Process util directories and files
cd $topdir/util
rlist="Aero Analysis_Utilities Baseline Config Correlated_Obs DTC EFSOI FOV GEN_BE_V2.0 GMI_BUFR MODIS_AOD Misc NCEP NMC_Bkerror README Radar_Monitor Radiance_bias_correction_Utilities Radiance_Utilities Single_Observation bufr_tools global_angupdate gsienvreport.sh ndate python_utilities radar_process zero_biascoeff"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done


# Process util/EnKF directories and files
cd $topdir/util/EnKF
rlist="arw python_utilities"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done


# Process util/EnKF/gfs/src directories and files
cd $topdir/util/EnKF/gfs/src
rlist="adjustps misc preproc gribmean recenterncio_hybgain recenternemsiop_hybgain"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done


# Process util/Radiance_Monitor/nwprod
cd $topdir/util/Radiance_Monitor/nwprod
rlist="gdas_radmon.v2.0.2 nam_radmon.v2.0.0 radmon_shared.v2.0.0 radmon_shared.v2.0.1 radmon_shared.v2.0.2 radmon_shared.v2.0.3 radmon_shared.v2.0.4"
for type in $rlist; do
git $string ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git $string ${type}"
exit
fi
if [[ "$mode" = "restore" ]]; then
git checkout ${type}*
rc=$?
if [[ $rc -ne 0 ]]; then
echo "***ERROR* git checkout ${type}"
exit
fi
fi
done

0 comments on commit 532fa23

Please sign in to comment.