Changeset 8868 for branches/2017/dev_METO_2017/NEMOGCM/SETTE/sette_rpt.sh
- Timestamp:
- 2017-12-01T09:43:23+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_METO_2017/NEMOGCM/SETTE/sette_rpt.sh
r7715 r8868 1 1 #!/bin/bash -f 2 #set -vx 2 3 # 3 4 # simple SETTE report generator. … … 10 11 ######################### Start of function definitions ################################# 11 12 ## 13 14 function restfile() { 15 # Rebuild ice restart for SAS CONFIG, and restartability checks. Expects LONG and SHORT run directories. 16 # For Stand Alone Surface configuration ocean is not running, just run ice model; so no outputs ocean files. 17 # Compares LONG rebuild restart ice file with equivalent entry from the SHORT rebuild restart ice file. 18 # 19 vdir=$1 20 nam=$2 21 pass=$3 22 # 23 if [ -d $vdir/$nam ]; then 24 dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l ` 25 dorv=`echo $dorv | sed -e 's:.*/::'` 26 rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 ` 27 rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l` 28 cd ${SAS_RESTART_DIR}/LONG 29 #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files 30 cd ${TOOLS_DIR} 31 ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1 32 cd ${TOOLS_DIR}/REBUILD_NEMO 33 #SF echo "REBUILD LONG restart SAS files, without standard output" 34 ./rebuild_nemo -t 4 ../../CONFIG/SAS_LONG/LONG/SAS_00000100_restart_ice $NPROC > /dev/null 2>&1 35 #SF echo "REBUILD SHORT restart SAS files, without standard output" 36 ./rebuild_nemo -t 4 ../../CONFIG/SAS_LONG/SHORT/SAS_00000100_restart_ice $NPROC >&- 37 cd ${SAS_RESTART_DIR}/LONG 38 #SF echo "COPY rebuild restart files" 39 cp SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/. 40 cp ../SHORT/SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/. 41 42 f1o=$vdir/$nam/$mach/$dorv/LONG/SAS_00000100_restart_ice.nc 43 f2o=$vdir/$nam/$mach/$dorv/SHORT/SAS_00000100_restart_ice.nc 44 if [ ! -f $f1o ] && [ ! -f $f2o ] ; then 45 printf "%-20s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test"; 46 return; 47 fi 48 # 49 done_oce=0 50 # 51 if [ -f $f1o ] && [ -f $f2o ]; then 52 cmp -s $f1o $f2o 53 #SF cmp SAS_00000100_restart_ice.nc ../SHORT/SAS_00000100_restart_ice.nc > diff_restart.txt 54 if [ $? == 0 ]; then 55 if [ $pass == 0 ]; then 56 printf "%-20s %s %s\n" $nam " SAS restart files are IDENTICAL : passed : " $dorv 57 fi 58 else 59 printf "%-20s %s %s\n" $nam " SAS restart files are DIFFERENT : FAILED : " $dorv 60 # 61 # Offer view of differences on the second pass 62 # 63 if [ $pass == 1 ]; then 64 echo "BE CAREFUL: NEED cdo to see differences!!!!! " 65 echo "DO which cdo and replace cdo PATH to the cdo command in SETTE_rpt.sh " 66 echo "IF cdo is not available you need to do difference of netcdf file by hand" 67 echo "<return> to view restart_ice.nc differences" 68 read y 69 cdo -diffv $f1o $f2o 70 done_oce=1 71 #echo "<return> to continue" 72 #read y 73 fi 74 fi 75 fi 76 # 77 fi 78 } 79 12 80 function resttest() { 13 81 # … … 199 267 mach=`grep "COMPILER=" ./sette.sh | sed -e 's/COMPILER=//'` 200 268 NEMO_VALID=`grep "NEMO_VALIDATION_DIR=" ./param.cfg | sed -e 's/NEMO_VALIDATION_DIR=//'` 269 # Directory to run the tests 270 SETTE_DIR=$(cd $(dirname "$0"); pwd) 271 MAIN_DIR=$(dirname $SETTE_DIR) 272 CONFIG_DIR0=${MAIN_DIR}/CONFIG 273 TOOLS_DIR=${MAIN_DIR}/TOOLS 274 COMPIL_DIR=${TOOLS_DIR}/COMPILE 275 NPROC=32 276 277 SAS_RESTART_DIR=${CONFIG_DIR0}/SAS_LONG 201 278 # 202 279 if [ ! -d $NEMO_VALID ]; then … … 205 282 fi 206 283 # 284 207 285 # The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory 208 286 # … … 212 290 if [ $pass == 1 ]; then echo "---------------2nd pass------------------";fi 213 291 # 292 293 # Rebuild and restartability test for SAS 294 # 295 for restart_file in WSAS_LONG 296 do 297 # restfile $SAS_RESTART_DIR LONG $pass 298 restfile $NEMO_VALID $restart_file $pass 299 done 300 # 214 301 # Restartability test 215 302 # 216 for restart_test in WGYREPIS_LONG WORCA2LIM3PIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG W SAS_LONG WISOMIP_LONG WORCA2AGUL_LONG303 for restart_test in WGYREPIS_LONG WORCA2LIM3PIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG WISOMIP_LONG WORCA2AGUL_LONG 217 304 do 218 305 resttest $NEMO_VALID $restart_test $pass
Note: See TracChangeset
for help on using the changeset viewer.