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 3294 for trunk/NEMOGCM/CONFIG/makenemo – NEMO

Ignore:
Timestamp:
2012-01-28T17:44:18+01:00 (12 years ago)
Author:
rblod
Message:

Merge of 3.4beta into the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/CONFIG/makenemo

    r2731 r3294  
    7676# 
    7777#- 
     78 
     79#- 
     80#- Initialization of the options --- 
     81x_d=""; 
     82x_h=""; 
     83x_n=""; 
     84x_r=""; 
     85x_m=""; 
     86x_t=""; 
     87x_c=""; 
     88x_j=1; 
     89x_e="none"; 
     90x_s=NEMO; 
     91x_v=1; 
    7892 
    7993#- Local variables --- 
     
    89103export TOOLS_DIR=${MAIN_DIR}/TOOLS 
    90104export COMPIL_DIR=${MAIN_DIR}/TOOLS/COMPILE 
    91 export NEMO_DIR=${MAIN_DIR}/NEMO 
     105export NEMO_DIR=${MAIN_DIR}/${x_s} 
    92106export AGRIFUSE=10 
    93  
    94107declare -a TAB 
    95108#- 
     
    99112#- 
    100113#- Choice of the options --- 
    101 x_d=""; 
    102 x_n=""; 
    103 x_r=""; 
    104 x_m=""; 
    105 x_t=""; 
    106 x_c=""; 
    107 x_j=1; 
    108 while getopts :hd:n:r:m:j:t: V 
     114while getopts :hd:n:r:m:j:e:s:v:t: V 
    109115do 
    110116    case $V in 
    111    (h)  echo "Usage   : "${b_n} \ 
    112        " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-j No]"; 
    113    echo " -h    : help"; 
    114    echo " -n name : config name, [-n help] to list existing configurations"; 
    115    echo " -m arch : choose compiler, [-m help] to list existing compilers"; 
    116    echo " -d dir  : choose NEMO sub-directories"; 
    117    echo " -r conf : choose reference configuration"; 
    118    echo " -j No    : number of processes used to compile (0=nocompilation)"; 
    119    echo " -t dir  : temporary directory for compilation" 
     117   (h) x_h=${OPTARG}; 
     118        echo "Usage   : "${b_n} \ 
     119       " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No]"; 
     120   echo " -h           : help"; 
     121   echo " -h institute : specific help for consortium members"; 
     122   echo " -n name      : config name, [-n help] to list existing configurations"; 
     123   echo " -m arch      : choose compiler, [-m help] to list existing compilers"; 
     124   echo " -d dir       : choose NEMO sub-directories"; 
     125   echo " -r conf      : choose reference configuration"; 
     126        echo " -s Path      : choose alternative location for NEMO main directory"; 
     127        echo " -e Path      : choose alternative location for MY_SRC directory"; 
     128        echo " -j No        : number of processes used to compile (0=nocompilation)"; 
     129        echo " -v No        : set verbosity level for compilation [0-3]"; 
     130   echo " -t dir       : temporary directory for compilation" 
    120131   echo ""; 
    121132   echo "Example to install a new configuration MY_CONFIG"; 
     
    123134   echo "makenemo -n MY_CONFIG -d \"OPA_SRC LIM_SRC_2\""; 
    124135   echo ""; 
    125    echo "Available configurations :"; cat ${COMPIL_DIR}/cfg.txt;  
     136   echo "Available configurations :"; cat ${CONFIG_DIR}/cfg.txt;  
    126137   echo ""; 
    127138   echo "Example to remove bad configuration "; 
     
    137148   echo "./makenemo -n MY_CONFIG -j0 add_key \"key_iomput key_mpp_mpi\" del_key \"key_agrif\" "; 
    138149   echo ""; 
    139    . ${COMPIL_DIR}/Flist_archfile.sh ; 
     150   . ${COMPIL_DIR}/Flist_archfile.sh ${x_h} ; 
    140151   echo ""; 
    141152   echo "Default : previous configuration and compiler"; 
     
    147158   (j)  x_j=${OPTARG};; 
    148159   (t)  x_t=${OPTARG};; 
     160    (e)  x_e=${OPTARG};; 
     161    (s)  x_s=${OPTARG};; 
     162    (v)  x_v=${OPTARG};; 
    149163   (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
    150164   exit 2;; 
     
    198212NEMO_TDIR=${x_t:-$NEMO_TDIR} 
    199213export NEMO_TDIR=${NEMO_TDIR:-$CONFIG_DIR} 
     214export NEMO_DIR=${MAIN_DIR}/${x_s} 
    200215 
    201216#- Check if the tool or the compiler exist or list it 
    202217if [ "${NEW_CONF}" == help ] ; then 
    203218    echo "Available configurations :"  
    204     cat ${COMPIL_DIR}/cfg.txt 
     219    cat ${CONFIG_DIR}/cfg.txt 
    205220    exit 
    206221fi 
    207 [ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh && exit 
     222[ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit 
    208223 
    209224#- When used for the first time, choose a compiler --- 
     
    238253    . ${COMPIL_DIR}/Fmake_config.sh ${NEW_CONF} ${REF_CONF} 
    239254else 
    240     sed -e "/${NEW_CONF} /d"  ${COMPIL_DIR}/cfg.txt >  ${COMPIL_DIR}/cfg.tmp 
    241     \mv  ${COMPIL_DIR}/cfg.tmp  ${COMPIL_DIR}/cfg.txt 
     255    sed -e "/${NEW_CONF} /d"  ${CONFIG_DIR}/cfg.txt >  ${COMPIL_DIR}/cfg.tmp 
     256    \mv  ${COMPIL_DIR}/cfg.tmp  ${CONFIG_DIR}/cfg.txt 
    242257fi 
    243258 
    244259#- 
    245260#- Save new configuration and directories names --- 
    246 echo ${NEW_CONF} ${TAB[*]} >> ${COMPIL_DIR}/cfg.txt 
     261echo ${NEW_CONF} ${TAB[*]} >> ${CONFIG_DIR}/cfg.txt 
    247262 
    248263#- 
     
    250265#- Clean links and librairies --- 
    251266#- Creating the good links, at first on OPA_SRC --- 
    252 . ${COMPIL_DIR}/Fmake_WORK.sh ${NEW_CONF} ${TAB[*]} || exit 
     267. ${COMPIL_DIR}/Fmake_WORK.sh ${x_e} ${NEW_CONF} ${TAB[*]} || exit 
    253268 
    254269. ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF}  ${NEMO_TDIR} || exit 
     
    290305        [ "$AGRIFUSE" == 1 ] && rm -rf  ${NEMO_TDIR}/${NEW_CONF}/BLD/* 
    291306    fi 
    292     fcm build ${x_c} --ignore-lock -v 1 -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd - 
     307    fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd - 
    293308    [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe  ${CONFIG_DIR}/${NEW_CONF}/EXP00/opa 
    294309    [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/server.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/server.exe  ${CONFIG_DIR}/${NEW_CONF}/EXP00/server.exe 
Note: See TracChangeset for help on using the changeset viewer.