Skip to content

Commit

Permalink
Minor script clean up. Add print of elasped time.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Feb 26, 2025
1 parent 9c07dda commit 4d7b12a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions reg_tests/cpld_gridgen/rt2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ if [[ $CREATE_BASELINE = true ]]; then
mkdir -p $NEW_BASELINE_ROOT
fi

export compiler=${compiler:-intelllvm}
compiler=${compiler:-intelllvm}
if [[ "$compiler" == "intelllvm" ]]; then
if [[ ! -f ${PATHTR}/modulefiles/build.$target.$compiler.lua ]];then
echo "IntelLLVM not available. Will use Intel Classic."
compiler=intel
fi
fi
export compiler
echo "Compiler: $compiler"

# Build the executable file
Expand Down Expand Up @@ -163,7 +164,7 @@ done < ./rt.conf

export target

sbatch --nodes=1 -t 0:01:00 -A fv3-cpu -J summary -o temp -e temp \
sbatch --nodes=1 -t 0:01:00 -A fv3-cpu -J summary -o /dev/null -e /dev/null \
--open-mode=append -q batch -d afterok${all_tests} ./rt.summary.sh

exit
6 changes: 6 additions & 0 deletions ush/cpld_gridgen.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -eux

SECONDS=0

function edit_namelist {

sed -e "s/NI_GLB/$NI/g" \
Expand Down Expand Up @@ -179,3 +181,7 @@ export FDST=${OUTDIR_PATH}/kmtu_cice_NEMS_mx${RESNAME}.nc
ncks -O -v kmt ${FSRC} ${FDST}

check_results

elapsed_time=$( printf '%02dh:%02dm:%02ds\n' $((SECONDS%86400/3600)) $((SECONDS%3600/60)) $((SECONDS%60)) )
echo "Elapsed time: ${elapsed_time}. Have a nice day!" >> $PATHRT/${REGRESSIONTEST_LOG}
echo "Elapsed time: ${elapsed_time}. Have a nice day!"

0 comments on commit 4d7b12a

Please sign in to comment.