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 2637 – NEMO

Changeset 2637


Ignore:
Timestamp:
2011-03-02T14:44:33+01:00 (12 years ago)
Author:
flavoni
Message:

change debug test in st_namelist, see ticket #752

File:
1 edited

Legend:

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

    r2583 r2637  
    8686   fi 
    8787   unset minargcount 
    88    if [  -f ${SETTE_DIR}/output.sette ] ; then 
    89          echo "file output already present. Append comments" 
    90                 echo "`ls ${SETTE_DIR}/output.sette`" 
    91         else 
    92                 echo "file output not present" 
     88   if [  ! -f ${SETTE_DIR}/output.sette ] ; then 
    9389                touch ${SETTE_DIR}/output.sette 
    94                 echo "`ls ${SETTE_DIR}/output.sette`" 
    9590        fi 
    9691 
     
    9994       
    10095   VAR_NAME=$( supergrep $2 ${INPUT_DIR}/$1 ) 
     96   if [ ${#VAR_NAME} -eq 0 ]  
     97   then 
     98      echo "doing \"set_namelist $@\". " 
     99      echo "variable: \"$2\" is empty" 
     100      echo "control that variable $2 is in \"${INPUT_DIR}/$1\" " 
     101      echo "exit" 
     102      echo "error in executing script : set_namelist $@" >> ${SETTE_DIR}/output.sette 
     103      echo "....." >> ${SETTE_DIR}/output.sette 
     104      exit 1 
     105   fi 
    101106        sed -e "s/${VAR_NAME}.*/${VAR_NAME}/" ${INPUT_DIR}/$1 > ${INPUT_DIR}/$1.tmp 
    102107        mv ${INPUT_DIR}/$1.tmp ${INPUT_DIR}/$1 
     
    104109        mv ${INPUT_DIR}/$1.tmp ${INPUT_DIR}/$1 
    105110 
    106    if [  -f ${INPUT_DIR}/$1 ] ; then 
    107          echo "namelist not empty: ok" 
    108         else 
    109       echo "some problems in sed namelist: exit" 
    110       exit 1 
    111         fi 
    112111        echo "finished script : set_namelist $@" >> ${SETTE_DIR}/output.sette 
    113112        echo "++++++++++++++++" >> ${SETTE_DIR}/output.sette 
Note: See TracChangeset for help on using the changeset viewer.