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 8849 for trunk/NEMOGCM/SETTE/new_sette_rpt.sh – NEMO

Ignore:
Timestamp:
2017-11-29T17:56:35+01:00 (6 years ago)
Author:
clevy
Message:

correct SAS check and AGRIF test, ticket #1983

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/SETTE/new_sette_rpt.sh

    r8839 r8849  
    1616# For Stand Alone Surface configuration ocean is not running, just run ice model; so no outputs ocean files. 
    1717# Compares LONG rebuild restart ice file with equivalent entry from the SHORT rebuild restart ice file. 
     18# 
     19# check nco module loaded, and load it if not 
     20if [ ! $( echo $LOADEDMODULES | grep cdo ) ]; then module load cdo >& /dev/null ; fi 
    1821# 
    1922  vdir=$1 
     
    2730    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l` 
    2831    cd ${SAS_RESTART_DIR}/LONG 
    29     #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files 
     32#SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files 
    3033    cd ${TOOLS_DIR} 
    3134    ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1 
    3235    cd ${TOOLS_DIR}/REBUILD_NEMO 
    33     #SF echo "REBUILD LONG restart SAS files, without standard output" 
     36#SF echo "REBUILD LONG restart SAS files, without standard output" 
    3437    ./rebuild_nemo -t 4 ../../CONFIG/SAS_ST/LONG/SAS_00000240_restart_ice  $NPROC > /dev/null 2>&1 
    35     #SF echo "REBUILD SHORT restart SAS files, without standard output" 
     38#SF echo "REBUILD SHORT restart SAS files, without standard output" 
    3639    ./rebuild_nemo -t 4 ../../CONFIG/SAS_ST/SHORT/SAS_00000240_restart_ice $NPROC >&- 
    3740    cd ${SAS_RESTART_DIR}/LONG 
    38     #SF echo "COPY rebuild restart files" 
     41#SF echo "COPY rebuild restart files" 
    3942    cp SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/. 
    4043    cp ../SHORT/SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/. 
     
    4548      printf "%-20s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test"; 
    4649      return; 
    47     fi 
     50  fi 
    4851    # 
    49     done_oce=0 
     52  done_oce=0 
    5053    # 
    51     if  [  -f $f1o ] && [  -f $f2o ]; then 
    52       cmp -s $f1o $f2o  
    53       #SF  cmp SAS_00000240_restart_ice.nc  ../SHORT/SAS_00000240_restart_ice.nc  > diff_restart.txt 
    54       if [ $? == 0 ]; then 
     54  if  [  -f $f1o ] && [  -f $f2o ]; then 
     55## Compare the two netcdf files 
     56    cdo diffn $f1o $f2o \ 
     57            > cdo_diff.out 2> /dev/null 
     58## echo cdo_diff.out 
     59## Identical if first character of $dif ==0 
     60    [ ! -s cdo_diff.out ] && continue 
     61    dif=$( grep -om1 '[0-9]* of [0-9]* records differ' cdo_diff.out ) 
     62     
     63       if [ -n "$dif" ]; then 
     64                difi=`echo $dif | cut -c -1` 
     65        fi   
     66   \rm cdo_diff.out  
     67 
     68     if [ $difi == 0 ]; then   
    5569        if [ $pass == 0 ]; then 
    5670          printf "%-20s %s %s\n" $nam  " SAS restart files are IDENTICAL :  passed : " $dorv 
     
    6276   # 
    6377        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" 
    6778          echo "<return> to view restart_ice.nc differences" 
    6879          read y 
Note: See TracChangeset for help on using the changeset viewer.