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

Automate update of consistency test baseline data. #603

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
67bbcdb
An initial idea of updating the cycle reg test scripts
GeorgeGayno-NOAA Oct 13, 2021
c07db3a
New script - update.sh - that will update the baseline data directory.
GeorgeGayno-NOAA Oct 14, 2021
4ef2152
Generalize the scripts and start testing them from chgres_cube.
GeorgeGayno-NOAA Oct 14, 2021
12106cf
Rename some scripts
GeorgeGayno-NOAA Oct 14, 2021
5d0ee75
Incorporate baseline scripts into grid_gen reg tests.
GeorgeGayno-NOAA Oct 15, 2021
a0efdd2
Updates to run the chgres and global_cycle tests on Hera.
GeorgeGayno-NOAA Oct 18, 2021
b0b12e4
Merge branch 'develop' into feature/baseline
GeorgeGayno-NOAA Oct 22, 2021
6c57168
Merge branch 'develop' into feature/baseline
GeorgeGayno-NOAA Nov 19, 2021
3e3294f
Merge branch 'develop' into feature/baseline
GeorgeGayno-NOAA Dec 17, 2021
a919025
Add logic to run the 'get_hash.sh' script only when
GeorgeGayno-NOAA Jan 11, 2022
a6bda24
Updates for the snow2mdl test.
GeorgeGayno-NOAA Jan 12, 2022
ae33ff7
Update for ice_blend test.
GeorgeGayno-NOAA Jan 12, 2022
94deb26
Update chgres script for Orion.
GeorgeGayno-NOAA Jan 12, 2022
a24edc5
Update grid_gen scripts.
GeorgeGayno-NOAA Jan 12, 2022
86cac23
Update scripts for Jet.
GeorgeGayno-NOAA Jan 12, 2022
f564cd7
Update snow and ice scripts on WCOSS-Dell.
GeorgeGayno-NOAA Jan 13, 2022
c2db9c9
Updates scripts on Hera.
GeorgeGayno-NOAA Jan 13, 2022
63b18ef
Update scripts on WCOSS-Cray.
GeorgeGayno-NOAA Jan 13, 2022
ea4e891
Update remaining chgres regression test scripts.
GeorgeGayno-NOAA Jan 13, 2022
41b550f
Minor cleanup of scripts.
GeorgeGayno-NOAA Jan 14, 2022
216e9b1
Merge branch 'develop' into feature/baseline
GeorgeGayno-NOAA Jan 14, 2022
a418c7b
More minor script clean up.
GeorgeGayno-NOAA Jan 14, 2022
bbc0fa5
Merge branch 'develop' into feature/baseline
GeorgeGayno-NOAA Jan 14, 2022
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
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/25km.conus.gfs.grib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< 25-KM CONUS GFS GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "25km_conus_gfs_grib2" $commit_num
fi
else
echo "<<< 25-KM CONUS GFS GRIB2 TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/25km.conus.gfs.pbgrib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< 25-KM CONUS GFS PGRIB2+BGRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "25km_conus_gfs_pbgrib2" $commit_num
fi
else
echo "<<< 25-KM CONUS GFS PGRIB2+BGRIB2 TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c96.fv3.restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 FV3 RESTART TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_fv3_restart" $commit_num
fi
else
echo "<<< C96 FV3 RESTART TEST PASSED. >>>"
fi
Expand Down
12 changes: 11 additions & 1 deletion reg_tests/chgres_cube/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ QUEUE="${QUEUE:-batch}"
# and baseline data for each test.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
export HOMEufs=$PWD/../..

export HOMEreg=/scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/chgres_cube
export HOMEreg=/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube.test

JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
LOG_FILE=consistency.log
SUM_FILE=summary.log
Expand All @@ -67,6 +74,9 @@ export OMP_NUM_THREADS=1 # should match cpus-per-task
TEST1=$(sbatch --parsable --ntasks-per-node=6 --nodes=1 -t 0:15:00 -A $PROJECT_CODE -q $QUEUE -J c96.fv3.restart \
-o $LOG_FILE -e $LOG_FILE ./c96.fv3.restart.sh)


exit

#-----------------------------------------------------------------------------
# Initialize C192 using FV3 tiled history files.
#-----------------------------------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions reg_tests/chgres_cube/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,17 @@ QUEUE="${QUEUE:-batch}"
# and baseline data for each test.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

export HOMEufs=$PWD/../..

export HOMEreg=/work/noaa/nems/role-nems/ufs_utils/reg_tests/chgres_cube
#export HOMEreg=/work/noaa/da/ggayno/save/ufs_utils.git/reg_tests.test/chgres_cube

LOG_FILE=consistency.log
SUM_FILE=summary.log
Expand Down
12 changes: 11 additions & 1 deletion reg_tests/chgres_cube/driver.wcoss_dell_p3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ PROJECT_CODE="${PROJECT_CODE:-GFS-DEV}"
# and baseline data for each test.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

export HOMEufs=$PWD/../..

export HOMEreg=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/reg_tests/chgres_cube
export HOMEreg=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/reg_tests/chgres_cube.test

SUM_FILE=summary.log

Expand All @@ -63,6 +70,9 @@ export OMP_NUM_THREADS=1
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J chgres01 -W 0:05 -x -n 6 \
-R "span[ptile=6]" -R "affinity[core(${OMP_NUM_THREADS}):distribute=balance]" "$PWD/25km.conus.gfs.grib2.sh"


exit

#-----------------------------------------------------------------------------
# Initialize CONUS 3-KM USING HRRR GRIB2 file WITH GFS PHYSICS.
#-----------------------------------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions reg_tests/get_hash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

#set -x

commit_string=$(git log -1 --oneline)

commit_num=$(echo $commit_string | cut -c1-7)

echo ${commit_num}

export commit_num
3 changes: 3 additions & 0 deletions reg_tests/global_cycle/C768.fv3gfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ if [ $test_failed -ne 0 ]; then
echo "*********************************"
echo "<<< C768 GLOBAL CYCLE TEST FAILED. >>>"
echo "*********************************"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$BASE_GSM/reg_tests/update_baseline.sh $HOMEreg "c768.fv3gfs" $commit_num
fi
else
echo
echo "*********************************"
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/global_cycle/C768.lndincsnow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ if [ $test_failed -ne 0 ]; then
echo "****************************************"
echo "<<< C768 LANDINC SNOW CYCLE TEST FAILED. >>>"
echo "****************************************"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$BASE_GSM/reg_tests/update_baseline.sh $HOMEreg "c768.lndincsnow" $commit_num
fi
else
echo
echo "***************************************"
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/global_cycle/C768.lndincsoil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ if [ $test_failed -ne 0 ]; then
echo "*****************************************"
echo "<<< C768 LANDINC SOILT CYCLE TEST FAILED. >>>"
echo "*****************************************"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$BASE_GSM/reg_tests/update_baseline.sh $HOMEreg "c768.lndincsoil" $commit_num
fi
else
echo
echo "*****************************************"
Expand Down
9 changes: 8 additions & 1 deletion reg_tests/global_cycle/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ QUEUE="${QUEUE:-batch}"
# Should not have to change anything below.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

DATA_DIR="${WORK_DIR}/reg-tests/global-cycle"

export HOMEreg=/scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/global_cycle
export HOMEreg=/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/global_cycle.test

export OMP_NUM_THREADS_CY=2

Expand Down
7 changes: 7 additions & 0 deletions reg_tests/global_cycle/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ QUEUE="${QUEUE:-batch}"
# Should not have to change anything below.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

export DATA_DIR="${WORK_DIR}/reg-tests/global-cycle"

export HOMEreg=/work/noaa/nems/role-nems/ufs_utils/reg_tests/global_cycle
Expand Down
9 changes: 8 additions & 1 deletion reg_tests/global_cycle/driver.wcoss_dell_p3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,16 @@ QUEUE="${QUEUE:-dev}"
# Should not have to change anything below.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

DATA_DIR="${WORK_DIR}/reg-tests/global-cycle"

export HOMEreg=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/reg_tests/global_cycle
export HOMEreg=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/reg_tests/global_cycle.test

export OMP_NUM_THREADS_CY=2

Expand Down
3 changes: 3 additions & 0 deletions reg_tests/grid_gen/c96.uniform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 UNIFORM TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$home_dir/reg_tests/update_baseline.sh "${HOMEreg}/.." "c96.uniform" $commit_num
fi
else
echo "<<< C96 UNIFORM TEST PASSED. >>>"
fi
Expand Down
12 changes: 11 additions & 1 deletion reg_tests/grid_gen/driver.wcoss_dell_p3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,21 @@ export WORK_DIR="${WORK_DIR}/reg-tests/grid-gen"
# Should not have to change anything below here.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

LOG_FILE=consistency.log
SUM_FILE=summary.log
export home_dir=$PWD/../..
export APRUN=time
export APRUN_SFC="mpirun -l"
export OMP_STACKSIZE=2048m
export machine=WCOSS_DELL_P3
export HOMEreg=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/reg_tests/grid_gen/baseline_data
export HOMEreg=/gpfs/dell2/emc/modeling/noscrub/George.Gayno/ufs_utils.git/reg_tests/grid_gen.test/baseline_data
export OMP_NUM_THREADS=24

rm -fr $WORK_DIR
Expand All @@ -57,6 +64,9 @@ ulimit -s unlimited
bsub -e $LOG_FILE -o $LOG_FILE -q $QUEUE -P $PROJECT_CODE -J c96.uniform -W 0:15 -x -n 24 \
-R "span[ptile=24]" -R "affinity[core(1):distribute=balance]" "$PWD/c96.uniform.sh"


exit

#-----------------------------------------------------------------------------
# C96 uniform grid using viirs vegetation type data.
#-----------------------------------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions reg_tests/ice_blend/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@ export DATA="${DATA}/reg-tests/ice-blend"
# Should not have to change anything below.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

export WGRIB=/apps/contrib/NCEPLIBS/orion/utils/grib_util.v1.2.0/exec/wgrib
export WGRIB2=/apps/contrib/NCEPLIBS/orion/utils/grib_util.v1.2.0/exec/wgrib2
export COPYGB=/apps/contrib/NCEPLIBS/lib/NCEPLIBS-grib_util/v1.1.1/exec/copygb
export COPYGB2=/apps/contrib/NCEPLIBS/orion/utils/grib_util.v1.2.0/exec/copygb2
export CNVGRIB=/apps/contrib/NCEPLIBS/orion/utils/grib_util.v1.2.0/exec/cnvgrib

export HOMEreg=/work/noaa/nems/role-nems/ufs_utils/reg_tests/ice_blend
#export HOMEreg=/work/noaa/da/ggayno/save/ufs_utils.git/reg_tests.test/ice_blend
export HOMEgfs=$PWD/../..

rm -fr $DATA
Expand Down
6 changes: 5 additions & 1 deletion reg_tests/ice_blend/ice_blend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ $iret -ne 0 ]; then
exit $iret
fi

cmp ${DATA}/seaice.5min.blend $HOMEreg/baseline_data/seaice.5min.blend
cmp ${DATA}/seaice.5min.blend $HOMEreg/baseline_data/t1534/seaice.5min.blend
iret=$?
test_failed=0
if [ $iret -ne 0 ]; then
Expand All @@ -32,6 +32,10 @@ if [ $test_failed -ne 0 ]; then
echo "<<< ICE BLEND TEST FAILED. >>>"
echo "*********************************"
echo "<<< ICE BLEND TEST FAILED. >>>" > ./summary.log
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
cd $DATA
$HOMEgfs/reg_tests/update_baseline.sh $HOMEreg "t1534" $commit_num
fi
else
echo
echo "*********************************"
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/snow2mdl/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export DATA="${DATA}/reg-tests/snow2mdl"
# Should not have to change anything below.
#-----------------------------------------------------------------------------

export UPDATE_BASELINE="FALSE"
#export UPDATE_BASELINE="TRUE"

if [ "$UPDATE_BASELINE" = "TRUE" ]; then
source ../get_hash.sh
fi

rm -fr $DATA

export HOMEreg=/work/noaa/nems/role-nems/ufs_utils/reg_tests/snow2mdl
Expand Down
6 changes: 5 additions & 1 deletion reg_tests/snow2mdl/snow2mdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

test_failed=0

cmp ${DATA}/snogrb_model $HOMEreg/baseline_data/snogrb_model
cmp ${DATA}/snogrb_model $HOMEreg/baseline_data/t1534/snogrb_model
iret=$?
if [ $iret -ne 0 ]; then
test_failed=1
Expand All @@ -44,6 +44,10 @@ if [ $test_failed -ne 0 ]; then
echo "<<< SNOW2MDL TEST FAILED. >>>"
echo "*********************************"
echo "<<< SNOW2MDL TEST FAILED. >>>" > ./summary.log
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
cd $DATA
$HOMEgfs/reg_tests/update_baseline.sh $HOMEreg "t1534" $commit_num
fi
else
echo
echo "*********************************"
Expand Down
56 changes: 56 additions & 0 deletions reg_tests/update_baseline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

set -x

HOMEreg=$1
test_name=$2
commit_num=$3

base_dir=$HOMEreg/baseline_data
base_dir_commit=${base_dir}/$test_name.$commit_num

chmod 755 $base_dir

if [ -d $base_dir_commit ];then
chmod 777 $base_dir_commit
if [ -d $base_dir_commit/fix_sfc ]; then
chmod 777 $base_dir_commit/fix_sfc
fi
rm -fr $base_dir_commit
fi

mkdir -p $base_dir_commit

for files in *.nc snogrb_model seaice.5min.blend
do
JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
if [ -f $files ]; then
cp $files $base_dir_commit
chmod 444 $base_dir_commit/$files
fi
done

# The grid_gen tests have a subdirectory for
# the surface climo fields.

if [ -d ./fix_sfc ]; then
mkdir -p $base_dir_commit/fix_sfc
cd fix_sfc
for files in *.nc
do
if [ -f $files ]; then
cp $files $base_dir_commit/fix_sfc
chmod 444 $base_dir_commit/fix_sfc/$files
fi
done
chmod 555 $base_dir_commit/fix_sfc
fi

chmod 555 $base_dir_commit
rm -f $base_dir/$test_name
cd $base_dir
ln -fs $test_name.$commit_num $test_name

# move this to driver?
###chmod 555 $base_dir

exit