New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8979 for branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/SETTE/sette_rpt.sh – NEMO

Ignore:
Timestamp:
2017-12-11T17:45:55+01:00 (6 years ago)
Author:
acc
Message:

Branch 2017/dev_r8126_ROBUST08_no_ghost. Merge in trunk changes up to rev 8864 in preparation for the merge. Sette tests OK except for AGRIF restartability but uncertain about the trunks status for this?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/SETTE/sette_rpt.sh

    r8186 r8979  
    1111######################### Start of function definitions ################################# 
    1212## 
     13 
     14function 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# Directory to run the tests 
     24  SETTE_DIR=$(cd $(dirname "$0"); pwd) 
     25  MAIN_DIR=$(dirname $SETTE_DIR) 
     26  CONFIG_DIR0=${MAIN_DIR}/CONFIG 
     27  TOOLS_DIR=${MAIN_DIR}/TOOLS 
     28  COMPIL_DIR=${TOOLS_DIR}/COMPILE 
     29  NPROC=32 
     30  SAS_RESTART_DIR=${CONFIG_DIR0}/SAS_LONG 
     31# 
     32  if [ -d $vdir/$nam ]; then 
     33    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l ` 
     34    dorv=`echo $dorv | sed -e 's:.*/::'` 
     35    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 ` 
     36    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l` 
     37    cd ${SAS_RESTART_DIR}/LONG 
     38    #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files 
     39    cd ${TOOLS_DIR} 
     40    ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1 
     41    cd ${TOOLS_DIR}/REBUILD_NEMO 
     42    #SF echo "REBUILD LONG restart SAS files, without standard output" 
     43    ./rebuild_nemo -t 4 ../../CONFIG/SAS_LONG/LONG/SAS_00000240_restart_ice  $NPROC > /dev/null 2>&1 
     44    #SF echo "REBUILD SHORT restart SAS files, without standard output" 
     45    ./rebuild_nemo -t 4 ../../CONFIG/SAS_LONG/SHORT/SAS_00000240_restart_ice $NPROC >&- 
     46    cd ${SAS_RESTART_DIR}/LONG 
     47    #SF echo "COPY rebuild restart files" 
     48    cp SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/. 
     49    cp ../SHORT/SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/. 
     50 
     51    f1o=$vdir/$nam/$mach/$dorv/LONG/SAS_00000240_restart_ice.nc 
     52    f2o=$vdir/$nam/$mach/$dorv/SHORT/SAS_00000240_restart_ice.nc 
     53    if  [ ! -f $f1o ] &&  [ ! -f $f2o ] ; then 
     54      printf "%-20s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test"; 
     55      return; 
     56    fi 
     57    # 
     58    done_oce=0 
     59    # 
     60    if  [  -f $f1o ] && [  -f $f2o ]; then 
     61      cmp -s $f1o $f2o  
     62      #SF  cmp SAS_00000240_restart_ice.nc  ../SHORT/SAS_00000240_restart_ice.nc  > diff_restart.txt 
     63      if [ $? == 0 ]; then 
     64        if [ $pass == 0 ]; then 
     65          printf "%-20s %s %s\n" $nam  " SAS restart files are IDENTICAL :  passed : " $dorv 
     66        fi 
     67      else 
     68        printf "%-20s %s %s\n" $nam  " SAS restart files are DIFFERENT : FAILED : " $dorv  
     69        # 
     70   # Offer view of differences on the second pass 
     71   # 
     72        if [ $pass == 1 ]; then 
     73          echo "BE CAREFUL:  NEED cdo to see differences!!!!! " 
     74          echo "DO which cdo and replace cdo PATH to the cdo command in SETTE_rpt.sh " 
     75          echo "IF cdo is not available you need to do difference of netcdf file by hand" 
     76          echo "<return> to view restart_ice.nc differences" 
     77          read y 
     78          cdo -diffv $f1o $f2o 
     79          done_oce=1 
     80          #echo "<return> to continue" 
     81          #read y 
     82        fi 
     83      fi 
     84    fi 
     85# 
     86fi 
     87} 
     88 
    1389function resttest() {  
    1490# 
     
    207283  fi 
    208284# 
     285 
    209286# The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory 
    210287 
     
    214291 if [ $pass == 1 ]; then echo "---------------2nd pass------------------";fi 
    215292# 
     293 
     294# Rebuild and restartability test for SAS 
     295# 
     296 for restart_file in WSAS_LONG 
     297 do 
     298 #  restfile $SAS_RESTART_DIR LONG $pass 
     299   restfile $NEMO_VALID $restart_file $pass 
     300 done 
     301# 
    216302# Restartability test 
    217303# 
    218  for restart_test in WGYREPIS_LONG WORCA2LIM3PIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG WSAS_LONG WISOMIP_LONG WORCA2AGUL_LONG 
     304 for restart_test in WGYREPIS_LONG WORCA2LIM3PIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG WISOMIP_LONG WORCA2AGUL_LONG 
    219305 do 
    220306   resttest $NEMO_VALID $restart_test $pass 
Note: See TracChangeset for help on using the changeset viewer.