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 2545 for trunk – NEMO

Changeset 2545 for trunk


Ignore:
Timestamp:
2011-01-10T17:48:53+01:00 (13 years ago)
Author:
flavoni
Message:

improved READE and SETTE.pdf for SETTE, add small debug, see ticket #752

Location:
trunk/NEMOGCM/SETTE
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/SETTE/README

    r2539 r2545  
    4646if you want a completly verbose makenemo you can uncomment "set -x" in makenemo script 
    4747and then launch ./sette.sh 2>&1 | tee out.sette 
     48 
     49TO ADD NEW CONFIGURATION: 
     501. makenemo -n NEW_CONFIG (see makenemo -h for help) OR 
     512. makenemo -n NEW_CONFIG -r REF_CONFIG (if it is based on another reference configuration) 
     523. for fcm_job.sh creates a new input_NEW_CONFIG.cfg if you need tar file (if you use same tar file of GYRE, ORCA2_LIM or ORCA2_LIM_PISCES you can use it) 
     53 
     54TO ADD NEW MACHINE: 
     551. add arch-compiler.fcm in NEMOGCM/ARCH directory 
     562. makenemo -m new_compiler  (see makenemo -h for help) 
  • trunk/NEMOGCM/SETTE/all_functions.sh

    r2511 r2545  
    1 #!/bin/bash 
    21###################################################### 
    32# Author : Simona Flavoni for NEMO 
     
    3332# 
    3433# function superegrep 
    35 # input variable value 
     34#   input variable value 
    3635# 
    3736# function set_namelist 
    38 # input namelist_name variable value 
    39 # output namelist 
     37#   input namelist_name variable value 
     38#   output namelist 
    4039# 
    4140# EXAMPLES 
     
    7574set_namelist () { 
    7675   minargcount=3 
    77       if [ ${#} -lt ${minargcount} ] 
    78       then 
    79       echo "not enought arguments" 
     76   if [ ${#} -lt ${minargcount} ] 
     77   then 
     78      echo "not enought arguments for set_namelist" 
    8079      echo "${usage}" 
    8180      exit 1 
    82       fi 
     81   fi 
    8382   unset minargcount 
     83   if [  -f ${SETTE_DIR}/output.sette ] ; then 
     84         echo "file output already present. Append comments" 
     85                echo "`ls ${SETTE_DIR}/output.sette`" 
     86        else 
     87                echo "file output not present" 
     88                touch ${SETTE_DIR}/output.sette 
     89                echo "`ls ${SETTE_DIR}/output.sette`" 
     90        fi 
     91        echo "executing script : set_namelist $@" >> ${SETTE_DIR}/output.sette 
     92        echo "################" >> ${SETTE_DIR}/output.sette 
     93       
    8494   VAR_NAME=$( supergrep $2 ${INPUT_DIR}/$1 ) 
    8595      sed -e "s/${VAR_NAME}/$2=$3/"  ${INPUT_DIR}/$1 > ${INPUT_DIR}/$1.tmp 
    8696      mv ${INPUT_DIR}/$1.tmp ${INPUT_DIR}/$1 
     97     
     98   if [  -f ${INPUT_DIR}/$1 ] ; then 
     99         echo "namelist not empty: ok" 
     100        else 
     101      echo "some problems in sed namelist: exit" 
     102      exit 1 
     103        fi 
     104        echo "finished script : set_namelist $@" >> ${SETTE_DIR}/output.sette 
     105        echo "++++++++++++++++" >> ${SETTE_DIR}/output.sette 
     106        echo "                " >> ${SETTE_DIR}/output.sette 
    87107} 
  • trunk/NEMOGCM/SETTE/fcm_job.sh

    r2507 r2545  
    1 #!/bin/bash 
    21###################################################### 
    32# Author : Simona Flavoni for NEMO 
     
    6766#- 
    6867# 
     68 
     69usage=" Usage : ./fcm_job.sh input_CONFIG_NAME.cfg  NUMBER_OF_PROCS" 
     70usage=" example : ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8" 
     71 
     72 
     73minargcount=2 
     74        if [ ${#} -lt ${minargcount} ] 
     75        then 
     76                echo "not enought arguments for fcm_job.sh script" 
     77                echo "control number of argument of fcm_job.sh in sette.sh" 
     78                echo "${usage}" 
     79        exit 1 
     80        fi 
     81        unset minargcount 
     82   if [  -f ${SETTE_DIR}/output.sette ] ; then 
     83           echo "file output already present. Append comments" 
     84           echo "`ls ${SETTE_DIR}/output.sette`" 
     85   else 
     86           echo "file output not present" 
     87           touch ${SETTE_DIR}/output.sette 
     88           echo "`ls ${SETTE_DIR}/output.sette`" 
     89   fi 
     90   echo "executing script : fcm_job $@" >> ${SETTE_DIR}/output.sette 
     91   echo "            " >> ${SETTE_DIR}/output.sette 
     92 
    6993# SET INPUT 
    7094# get the input tarfile if needed 
    7195tar_file=$(sed -ne "1,1p" $1) 
    7296if [ "$(cat $1 | grep -c ".tar" )" -ne 0 ] ; then 
     97   echo "looking for tar file" >> ${SETTE_DIR}/output.sette 
     98   echo "            " >> ${SETTE_DIR}/output.sette 
    7399   cp ${FORCING_DIR}/${tar_file} ${INPUT_DIR}/. 
    74100   cd ${INPUT_DIR} ; tar xvf ${INPUT_DIR}/*.tar ; gunzip *gz 
     
    76102 
    77103if [ -f ${INPUT_DIR}/namelist_ice_lim2 ] ; then  
     104   echo "choosing for namelist ice " >> ${SETTE_DIR}/output.sette 
     105   echo "            " >> ${SETTE_DIR}/output.sette 
    78106   cp ${INPUT_DIR}/namelist_ice_lim2 ${INPUT_DIR}/namelist_ice 
    79107elif  [ -f ${INPUT_DIR}/namelist_ice_lim3 ] ; then  
     
    84112if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "agrif" )" -ne 0 ] ; then 
    85113   #- Namelist for ocean and ice (agrif fine grid) 
     114      echo "choosing for namelist for AGRIF" >> ${SETTE_DIR}/output.sette 
     115      echo "            " >> ${SETTE_DIR}/output.sette 
    86116   cp ${INPUT_DIR}/1_namelist_ice_lim2 ${INPUT_DIR}/1_namelist_ice  
    87117fi 
     
    93123NB_PROC=$2 
    94124 if [ ${NB_PROC} == 1 ] ; then 
     125 opa_command='./opa'  # !! to test if executable is created 
     126          type ${opa_command} 
     127          status_type=${?} 
     128          if [ ${status_type} -ne 0 ] 
     129          then 
     130              echo "opa not found" 
     131              exit 1 
     132          fi 
     133   echo "running opa" >> ${SETTE_DIR}/output.sette 
     134   echo "            " >> ${SETTE_DIR}/output.sette 
    95135   ./opa 
    96136else 
     137opa_command='mpirun'  # !! to test if executable is created 
     138          type ${opa_command} 
     139          status_type=${?} 
     140          if [ ${status_type} -ne 0 ] 
     141          then 
     142              echo "mpi opa not found" 
     143              exit 1 
     144          fi 
    97145# example for brodie (NEC SX8) machine 
     146   echo "running opa in MPI" >> ${SETTE_DIR}/output.sette 
     147   echo "            " >> ${SETTE_DIR}/output.sette 
    98148   mpirun -np ${NB_PROC} opa 
    99149# example for dedale machine 
     
    108158 
    109159#- Save ocean output files 
     160echo "saving ocean & ice output, debug & restarts files" >> ${SETTE_DIR}/output.sette 
     161echo "            " >> ${SETTE_DIR}/output.sette 
    110162[ ! -d ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR} 
    111163[ -f *ocean.output ] && mv *ocean.output ${OUTPUT_DIR}/. 
  • trunk/NEMOGCM/SETTE/param.cfg

    r2354 r2545  
    11EXE_DIR=${CONFIG_DIR}      
    2 #- input files storing  
     2#- forcing files storing  
    33FORCING_DIR=~/FORCING 
    44#- input files storing  
  • trunk/NEMOGCM/SETTE/sette.sh

    r2539 r2545  
    2929# DESCRIPTION 
    3030# =========== 
     31# 
     32# principal script is sette.sh, that calls  
     33# 
     34#  makenemo  
     35# 
     36#   creates the exectuable in ${CONFIG_NAME}/BLD/bin/nemo.exe  
     37# 
     38#   (and its link opa in ${CONFIG_NAME}/EXP00) 
     39# 
     40#  param.cfg : sets and loads following directories 
     41# 
     42#   Executing directory (EXE_DIR) 
     43# 
     44#   Forcing files storing (FORCING_DIR) 
     45# 
     46#   Input files storing (INPUT_DIR) 
     47# 
     48#   Temporary directory (if needed) (TMPDIR) 
     49# 
     50#   Output files storing (OUTPUT_DIR) 
     51# 
     52#   (note: this file is the same for all configrations to be tested with sette) 
     53# 
     54#  all_functions.sh : loads functions used by sette (note: new functions can added here) 
     55# 
     56#  set_namelist : function declared in all_functions that set namelist parameters for tests 
     57# 
     58#  fcm_job.sh  
     59# 
     60#   runs job and saves output files (ocean.output, solver.stat, grid_files, restart, ice_evolu, ftrace.out) 
     61#  
     62#   (note this job needs to have an input_CONFIG.cfg in which found tar input file) 
     63# 
     64#   (note other files can be saved adding at the end of fcm_job list of saved files) 
     65#  
     66#  NOTE: if job is not launched for some problems you have executable ready in ${CONFIG_NAME}/EXP00 directory 
     67# 
     68#  at the end the directory ${CONFIG_NAME}/EXP00/VALIDATION is created 
     69# 
     70#  and output files, solver.stat, ocean.output are put in ${CONFIG_NAME}/EXP00/VALIDATION directory 
     71# 
     72#  and restart files and changed namelists are leaved in ${CONFIG_NAME}/EXP00 directory 
     73#  
     74#  in ${SETTE_DIR} is created output.sette with the echo of commands run 
     75# 
     76#  if sette.sh is stopped in output.sette there is written the last command executed by sette.sh 
     77# 
     78#  if you run: ./sette.sh 2>&1 | tee out.sette 
     79# 
     80#  in ${SETTE_DIR} out.sette is redirected standard error & standard output 
    3181# 
    3282# 
Note: See TracChangeset for help on using the changeset viewer.