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

Ignore:
Timestamp:
2011-04-29T17:16:07+02:00 (13 years ago)
Author:
flavoni
Message:

add copy_original function in SETTE to solve pb during re-run tests,... it not the best solution but it is one for the moment, see ticket #819

File:
1 edited

Legend:

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

    r2675 r2756  
    3030# :: 
    3131# 
    32 #  $ ./set_namelist.sh INPUT_NAMELIST VARIABLE VALUE  
     32#  $ ./set_namelist INPUT_NAMELIST VARIABLE VALUE  
     33#  $ ./copy_original INPUT_NAMELIST  
    3334# 
    3435# 
     
    3839# function superegrep 
    3940#   input variable value 
     41# 
     42# function copy_original 
     43#   input namelist_name 
     44#   output namelist  
    4045# 
    4146# function set_namelist 
     
    4853# :: 
    4954# 
    50 #  $ ./set_namelist.sh namelist          nn_itend        75 
    51 #  $ ./set_namelist.sh namelist_ice_lim2 cn_icerst_in  \"00101231_restart_ice\" 
     55#  $ ./copy_original namelist_pisces          
     56#  $ ./set_namelist namelist          nn_itend        75 
     57#  $ ./set_namelist namelist_ice_lim2 cn_icerst_in  \"00101231_restart_ice\" 
    5258# 
    5359# 
     
    6773# 
    6874 
     75 
     76# function to copy original namelists in ORIGINAL_namelist directory in ${INPUT_DIR} directory 
     77# to allow re-run same tests in same directory and start with all correct values of namelist 
     78copy_original () { 
     79        `mkdir -p ${INPUT_DIR}/ORIGINAL_namelist` 
     80   if [ -d ${INPUT_DIR}/ORIGINAL_namelist ] ; then 
     81           echo "created ${INPUT_DIR}/ORIGINAL_namelist directory in ${INPUT_DIR}"   >> ${SETTE_DIR}/output.sette 
     82   else 
     83           echo "problems in creating ${INPUT_DIR}/ORIGINAL_namelist directory"   >> ${SETTE_DIR}/output.sette 
     84           echo "EXIT," 
     85           exit 1 
     86   fi 
     87        `cp ${CONFIG_DIR}/${REF_CONF}/EXP00/$1 ${INPUT_DIR}/ORIGINAL_namelist/$1.ori` 
     88   if [ -n "$(ls ${INPUT_DIR}/ORIGINAL_namelist/$1.ori)" ] ; then 
     89      echo "copied namelist of reference configuration in ${INPUT_DIR}/ORIGINAL_namelist/$1.ori " >> ${SETTE_DIR}/output.sette 
     90   else 
     91      echo "problem in copying namelist of reference configuration in ${INPUT_DIR}/ORIGINAL_namelist/$1.ori " >> ${SETTE_DIR}/output.sette 
     92           echo "EXIT," 
     93           exit 1 
     94   fi 
     95        `cp ${INPUT_DIR}/ORIGINAL_namelist/$1.ori ${INPUT_DIR}/$1` 
     96   if [ -n "$(ls ${INPUT_DIR}/$1)" ] ; then 
     97      echo "copied original namelist in ${INPUT_DIR} directory " >> ${SETTE_DIR}/output.sette 
     98   else 
     99           echo "problem in copying  original namelist in ${INPUT_DIR} directory"  >> ${SETTE_DIR}/output.sette 
     100           echo "EXIT," 
     101           exit 1 
     102   fi 
     103} 
    69104 
    70105# function to find namelists parameters 
Note: See TracChangeset for help on using the changeset viewer.