Skip to content

Commit

Permalink
Incorporate baseline scripts into grid_gen reg tests.
Browse files Browse the repository at this point in the history
Update the update_baseline.sh script to process the
fix_sfc baseline subdirectory used by the grid_gen.

Fixes ufs-community#574.
  • Loading branch information
GeorgeGayno-NOAA committed Oct 15, 2021
1 parent 12106cf commit 5d0ee75
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
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
10 changes: 9 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,19 @@ 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"

source ../get_hash.sh

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 +62,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
19 changes: 19 additions & 0 deletions reg_tests/update_baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ 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

Expand All @@ -26,6 +29,22 @@ do
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
Expand Down

0 comments on commit 5d0ee75

Please sign in to comment.