- Timestamp:
- 2011-03-09T16:02:46+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev_r2586_dynamic_mem/NEMOGCM/SETTE/all_functions.sh
r2583 r2678 49 49 # 50 50 # $ ./set_namelist.sh namelist nn_itend 75 51 # $ ./set_namelist.sh namelist_ice_lim2 cn_icerst_in \"00101231_restart_ice mod\"51 # $ ./set_namelist.sh namelist_ice_lim2 cn_icerst_in \"00101231_restart_ice\" 52 52 # 53 53 # … … 86 86 fi 87 87 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 93 89 touch ${SETTE_DIR}/output.sette 94 echo "`ls ${SETTE_DIR}/output.sette`"95 90 fi 96 91 … … 99 94 100 95 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 101 106 sed -e "s/${VAR_NAME}.*/${VAR_NAME}/" ${INPUT_DIR}/$1 > ${INPUT_DIR}/$1.tmp 102 107 mv ${INPUT_DIR}/$1.tmp ${INPUT_DIR}/$1 … … 104 109 mv ${INPUT_DIR}/$1.tmp ${INPUT_DIR}/$1 105 110 106 if [ -f ${INPUT_DIR}/$1 ] ; then107 echo "namelist not empty: ok"108 else109 echo "some problems in sed namelist: exit"110 exit 1111 fi112 111 echo "finished script : set_namelist $@" >> ${SETTE_DIR}/output.sette 113 112 echo "++++++++++++++++" >> ${SETTE_DIR}/output.sette
Note: See TracChangeset
for help on using the changeset viewer.