Skip to content

Commit

Permalink
Automate update of consistency test baseline data. (#603)
Browse files Browse the repository at this point in the history
Add logic to the consistency test scripts to automatically update the baseline data
when code updates change results.

Fixes #574
  • Loading branch information
GeorgeGayno-NOAA authored Jan 20, 2022
1 parent 76e73d9 commit 04700f9
Show file tree
Hide file tree
Showing 53 changed files with 328 additions and 2 deletions.
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/13km.conus.nam.grib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< 13-KM CONUS NAM GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "13km_conus_nam_grib2" $commit_num
fi
else
echo "<<< 13-KM CONUS NAM GRIB2 TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/13km.conus.rap.grib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< 13-km CONUS RAP W/ GSD PHYSICS AND SFC FROM FILE GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "13km_conus_rap_grib2" $commit_num
fi
else
echo "<<< 13-km CONUS RAP W/ GSD PHYSICS AND SFC FROM FILE GRIB2 TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/13km.na.gfs.ncei.grib2.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 "<<< 13-KM NA GFS NCEI GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "13km_na_gfs_ncei_grib2" $commit_num
fi
else
echo "<<< 13-KM NA GFS NCEI GRIB2 TEST PASSED. >>>"
fi
Expand Down
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/3km.conus.hrrr.gfssdf.grib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< 3-km CONUS HRRR W/ GFS PHYSICS GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "3km_conus_hrrr_gfssdf_grib2" $commit_num
fi
else
echo "<<< 3-km CONUS HRRR W/ GFS PHYSICS GRIB2 TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/3km.conus.hrrr.newsfc.grib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< 3-km CONUS HRRR W/ GSD PHYSICS AND SFC FROM FILE GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "3km_conus_hrrr_newsfc_grib2" $commit_num
fi
else
echo "<<< 3-km CONUS HRRR W/ GSD PHYSICS AND SFC FROM FILE GRIB2 TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c192.fv3.history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C192 FV3 HISTORY TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c192_fv3_history" $commit_num
fi
else
echo "<<< C192 FV3 HISTORY TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c192.gfs.grib2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C192 GFS GRIB2 TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c192_gfs_grib2" $commit_num
fi
else
echo "<<< C192 GFS GRIB2 TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c96.fv3.nemsio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 FV3 GAUSSIAN NEMSIO TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_fv3_nemsio" $commit_num
fi
else
echo "<<< C96 FV3 GAUSSIAN NEMSIO TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c96.fv3.netcdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 FV3 GAUSSIAN NETCDF TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_fv3_netcdf" $commit_num
fi
else
echo "<<< C96 FV3 GAUSSIAN NETCDF TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c96.fv3.netcdf2wam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 FV3 GAUSSIAN NETCDF2WAM TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_fv3_netcdf2wam" $commit_num
fi
else
echo "<<< C96 FV3 GAUSSIAN NETCDF2WAM 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
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c96.gfs.nemsio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 GFS GAUSSIAN NEMSIO TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_gfs_nemsio" $commit_num
fi
else
echo "<<< C96 GFS GAUSSIAN NEMSIO TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c96.gfs.sigio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 GFS SIGIO TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_gfs_sigio" $commit_num
fi
else
echo "<<< C96 GFS SIGIO TEST PASSED. >>>"
fi
Expand Down
3 changes: 3 additions & 0 deletions reg_tests/chgres_cube/c96.regional.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 REGIONAL TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$HOMEufs/reg_tests/update_baseline.sh $HOMEreg "c96_regional" $commit_num
fi
else
echo "<<< C96 REGIONAL TEST PASSED. >>>"
fi
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/chgres_cube/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ 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=/scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/chgres_cube
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/chgres_cube/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ export HDF5_DISABLE_VERSION_CHECK=2
# 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=/lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/chgres_cube
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/chgres_cube/driver.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ 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
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/chgres_cube/driver.wcoss_cray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ PROJECT_CODE="${PROJECT_CODE:-GFS-DEV}"

export HOMEufs=$PWD/../..

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

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

export HOMEreg=/gpfs/hps3/emc/global/noscrub/George.Gayno/ufs_utils.git/reg_tests/chgres_cube

LOG_FILE=consistency.log
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/chgres_cube/driver.wcoss_dell_p3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ 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
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
7 changes: 7 additions & 0 deletions reg_tests/global_cycle/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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

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

export HOMEreg=/scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/global_cycle
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/global_cycle/driver.jet.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=/lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/global_cycle
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
7 changes: 7 additions & 0 deletions reg_tests/global_cycle/driver.wcoss_cray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ 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/hps3/emc/global/noscrub/George.Gayno/ufs_utils.git/reg_tests/global_cycle
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/global_cycle/driver.wcoss_dell_p3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ 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
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
3 changes: 3 additions & 0 deletions reg_tests/grid_gen/c96.viirs.vegt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ done
set +x
if [ $test_failed -ne 0 ]; then
echo "<<< C96 VIIRS VEGT TEST FAILED. >>>"
if [ "$UPDATE_BASELINE" = "TRUE" ]; then
$home_dir/reg_tests/update_baseline.sh "${HOMEreg}/.." "c96.viirs.vegt" $commit_num
fi
else
echo "<<< C96 VIIRS VEGT TEST PASSED. >>>"
fi
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/grid_gen/driver.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ PROJECT_CODE="${PROJECT_CODE:-fv3-cpu}"
# 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/../..
Expand Down
7 changes: 7 additions & 0 deletions reg_tests/grid_gen/driver.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ 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/../..
Expand Down
Loading

0 comments on commit 04700f9

Please sign in to comment.