Skip to content

Commit

Permalink
New script - update.sh - that will update the baseline data directory.
Browse files Browse the repository at this point in the history
Update test scripts to call the update script.

Fixes ufs-community#574
  • Loading branch information
GeorgeGayno-NOAA committed Oct 14, 2021
1 parent 67bbcdb commit c07db3a
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 11 deletions.
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/global_cycle/update.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/global_cycle/update.sh $HOMEreg "c768.lndincsnow" $commit_num
fi
else
echo
echo "***************************************"
Expand Down
9 changes: 3 additions & 6 deletions reg_tests/global_cycle/C768.lndincsoil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@

set -x

echo got here
echo $commit_num

exit


NCCMP=${NCCMP:-$(which nccmp)}

export MAX_TASKS_CY=6
Expand Down Expand Up @@ -83,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/global_cycle/update.sh $HOMEreg "c768.lndincsoil" $commit_num
fi
else
echo
echo "*****************************************"
Expand Down
4 changes: 2 additions & 2 deletions reg_tests/global_cycle/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

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

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

echo $commit_num
echo ${commit_num}

export commit_num
7 changes: 4 additions & 3 deletions reg_tests/global_cycle/driver.wcoss_dell_p3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ QUEUE="${QUEUE:-dev}"
# Should not have to change anything below.
#-----------------------------------------------------------------------------

source check.sh
#export UPDATE_BASELINE="FALSE"
export UPDATE_BASELINE="TRUE"

exit
source check.sh

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
37 changes: 37 additions & 0 deletions reg_tests/global_cycle/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/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
rm -fr $base_dir_commit
fi

mkdir -p $base_dir_commit

for files in *tile*.nc
do
if [ -f $files ]; then
cp $files $base_dir_commit
chmod 444 $base_dir_commit/$files
fi
done

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

0 comments on commit c07db3a

Please sign in to comment.