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

Changeset 2301


Ignore:
Timestamp:
2010-10-21T10:09:17+02:00 (14 years ago)
Author:
flavoni
Message:

improvement of makenemo , see ticket : #740

Location:
branches/nemo_v3_3_beta/NEMOGCM
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/CONFIG/makenemo

    r2263 r2301  
    4646# 
    4747# - TAB         : NEMO subdirectory used (read)   
    48 # - MAIN_DIR : self explaining 
     48# - MAIN_DIR    : self explaining 
    4949# - CONFIG_DIR  :   "    "    "    
    5050# - MODELES_DIR :   "    "    "  
     
    107107           echo " -h  : help"; 
    108108           echo " -n name : config name, [-n help] to list existing configurations"; 
    109            echo " -m arch : choose compiler, [-m help] to list exiting compilers"; 
     109           echo " -m arch : choose compiler, [-m help] to list existing compilers"; 
    110110           echo " -d dir  : choose NEMO sub-directories"; 
    111111           echo " -r conf : choose reference configuration"; 
    112112           echo " -j No  : number of processes used to compile (0=nocompilation)"; 
    113            echo " -t dir  : remporary directory for compilation" 
     113           echo " -t dir  : temporary directory for compilation" 
    114114           echo ""; 
    115115           echo "Example to install a new configuration MY_CONFIG"; 
     
    119119                          echo "Available configurations :"; cat ${COMPIL_DIR}/cfg.txt;  
    120120           echo ""; 
     121           echo "Example to remove bad configuration "; 
     122           echo "./makenemo -n MY_CONFIG clean_config"; 
     123                          echo ""; 
     124           echo "Example to clean "; 
     125           echo "./makenemo clean"; 
     126                          echo ""; 
    121127                          . ${COMPIL_DIR}/Flist_archfile.sh  ; 
    122128                          echo ""; 
     
    137143shift $(($OPTIND-1)); 
    138144 
    139 #- 
    140 #- Get the clean option 
    141 [[ "${#@}" -ne 0 && "${@}" != clean ]] && echo "Invalid option "$@" " && exit 
    142 [ "${#@}" -ne 0 ] && x_c="--$@" 
     145 
     146while [ ${#1} -gt 0 ]   # Get clean, clean_config options 
     147do 
     148    case "$1" in 
     149   clean) 
     150         echo "command $1"  
     151      x_c="--$1" 
     152         ;; 
     153   clean_config) 
     154         echo "command $1"  
     155      . ${COMPIL_DIR}/Fclean_config.sh 
     156      exit 
     157         ;; 
     158   *) 
     159         echo "BAD OPTION"  
     160      exit 
     161         ;; 
     162 
     163   esac 
     164shift 
     165done 
    143166 
    144167#- 
     
    216239. ${COMPIL_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} || exit 
    217240 
     241#- and test whether we need to build the ioserver 
     242export USEBLD=bldxio.cfg 
     243grep key_iomput ${COMPIL_DIR}/cpp.fcm && export USEBLD=bld.cfg 
     244 
    218245#- 
    219246#_ END OF CONFIGURATION PHASE 
     
    228255   #if AGRIF we do a first preprocessing 
    229256   if [ ${#x_c} -eq 0 ]; then 
    230       [ "$AGRIFUSE" == 1 ] && fcm build --ignore-lock -s 2 ${COMPIL_DIR}/bld.cfg  
     257      [ "$AGRIFUSE" == 1 ] && fcm build --ignore-lock -s 2 ${COMPIL_DIR}/$USEBLD  
    231258      [ "$AGRIFUSE" == 1 ] && rm -rf  ${NEMO_TDIR}/${NEW_CONF}/BLD/* 
    232259   fi 
    233    fcm build ${x_c} --ignore-lock -v 1 -j ${NBR_PRC} ${COMPIL_DIR}/bld.cfg || cd - 
     260   fcm build ${x_c} --ignore-lock -v 1 -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd - 
    234261   [ -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 
    235262   [ -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 
     263 
     264   #add remove for clean option 
     265   if  [ ${#x_c} -ne 0 ]; then 
     266   echo "cleaning ${NEW_CONF} WORK, BLD" 
     267   rm -rf ${NEMO_TDIR}/${NEW_CONF}/WORK 
     268   rm -rf ${NEMO_TDIR}/${NEW_CONF}/BLD 
     269   rm -rf ${NEMO_TDIR}/${NEW_CONF}/EXP00/opa 
     270   rm -rf ${NEMO_TDIR}/${NEW_CONF}/EXP00/server.exe 
     271  fi 
     272       
    236273fi 
    237274 
Note: See TracChangeset for help on using the changeset viewer.