Ignore:
Timestamp:
2017-11-24T15:03:07+01:00 (3 years ago)
Author:
nicolasmartin
Message:

Continuation of global refactoring of the tool, in particular a intelligible variables namelist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh

    r8797 r8808  
    66## Set defaults 
    77##--------------------------------------------------- 
    8 TRUS_DBUG=0; TRUS_PROD=0; TRUS_HELP=0 
     8TRUST_FLAG_DEBUG=0; TRUST_FLAG_PROD=0; TRUST_FLAG_HELP=0 
    99 
    1010 
     
    1313while [ $# -ne 0 ]; do 
    1414    case $1 in 
    15    '-d'|'--debug'  ) TRUS_DBUG=1 ; shift  ;; '-j'|'--job'     ) TRUS_NPRO=$2; shift 2;; 
    16    '-m'|'--machine') TRUS_HPCC=$2; shift 2;; '-h'|'--help'    ) TRUS_HELP=1 ; shift  ;; 
    17    '-u'|'--user'   ) TRUS_USER=$2; shift 2;; "*"             ) TRUS_HELP=1 ; shift  ;; 
     15   '-d'|'--debug'  ) TRUST_FLAG_DEBUG=1 ; shift  ;; '-j'|'--job'    ) TRUST_COMPILE_NPROC=$2; shift 2;; 
     16   '-m'|'--machine') TRUST_MAIN_HPCC=$2; shift 2;; '-h'|'--help'    ) TRUST_FLAG_HELP=1 ; shift  ;; 
     17   '-u'|'--user'   ) TRUST_MAIN_USER=$2; shift 2;; "*"             ) TRUST_FLAG_HELP=1 ; shift  ;; 
    1818    esac 
    1919done 
     
    2222## Initialization (HPC & user environment) 
    2323##--------------------------------------------------- 
    24 if [[ ! -e cfg/${TRUS_USER}.cfg || ! -e cfg/${TRUS_HPCC}.cfg || ${TRUS_HELP} -eq 1 ]]; then 
     24if [[ ! -e cfg/${TRUST_MAIN_USER}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg || ${TRUST_FLAG_HELP} -eq 1 ]]; then 
    2525    cat ./inc/trusting_help.txt 
    2626 
    27     if [ ${TRUS_HELP} -eq 0 ]; then 
     27    if [ ${TRUST_FLAG_HELP} -eq 0 ]; then 
    2828   printf "\n\n\033[0;33m" 
    2929   printf "At least one configuration (arch or user) file is missing or misspelled:" 
    30    printf "\t'%s'.cfg\t'%s'.cfg" ${TRUS_USER} ${TRUS_HPCC} 
     30   printf "\t'%s'.cfg\t'%s'.cfg" ${TRUST_MAIN_USER} ${TRUST_MAIN_HPCC} 
    3131   printf "\033[0m" 
    3232    fi 
     
    3838else 
    3939    . ./inc/trusting.env 
    40     [ ${TRUS_DBUG} -eq 1 ] && set -vx 
     40    [ ${TRUST_FLAG_DEBUG} -eq 1 ] && set -vx 
    4141fi 
    4242 
     
    4444## List last branches from NEMO Forge 
    4545##--------------------------------------------------- 
    46 printf "\nWhat branch do you want to install in "${TRUS_WORK}" for trusting test ? " 
     46printf "\nWhat branch do you want to install in "${TRUST_DIR_WORK}" for trusting test ? " 
    4747echo 'Enter 0 to abort' 
    48 select branch in 'trunk' $( svn ls ${TRUS_SVNR}/branches/2015 | tr -d / | sort -r ); do 
     48select branch in 'trunk' $( svn ls ${TRUST_SVN_REPO}/branches/2015 | tr -d / | sort -r ); do 
    4949 
    50     if [ $REPLY -eq 0 ]; then exit 1; else export TRUS_BRAN=$branch; fi 
     50    if [ $REPLY -eq 0 ]; then exit 1; else export TRUST_SVN_BRANCH=$branch; fi 
    5151 
    52     printf "\nInstallation of a working copy of '%s' branch in '%s'? " ${TRUS_BRAN} ${TRUS_WORK} 
     52    printf "\nInstallation of a working copy of '%s' branch in '%s'? " ${TRUST_SVN_BRANCH} ${TRUST_DIR_WORK} 
    5353    printf "\nType [Y|y|yes] to confirm, if not back to branches list number\n" 
    5454    read answer 
     
    6262## First checkout of selected branch 
    6363##--------------------------------------------------- 
    64 echo 'Initial checkout of '${TRUS_BRAN}' branch' 
    65 mkdir -p ${TRUS_WORK}/${TRUS_BRAN}/NEMOGCM 
    66 cd       ${TRUS_WORK}/${TRUS_BRAN}/NEMOGCM 
     64echo 'Initial checkout of '${TRUST_SVN_BRANCH}' branch' 
     65mkdir -p ${TRUST_DIR_WORK}/${TRUST_SVN_BRANCH}/NEMOGCM 
     66cd       ${TRUST_DIR_WORK}/${TRUST_SVN_BRANCH}/NEMOGCM 
    6767 
    68 svn_bran=branches/2015/${TRUS_BRAN} 
    69 [ ${TRUS_BRAN} == 'trunk' ] && svn_bran=${TRUS_BRAN} 
     68svn_bran=branches/2015/${TRUST_SVN_BRANCH} 
     69[ ${TRUST_SVN_BRANCH} == 'trunk' ] && svn_bran=${TRUST_SVN_BRANCH} 
    7070 
    71 for elmt in ${TRUS_CKOT}; do 
     71for elmt in ${TRUST_SVN_CO}; do 
    7272    [ $elmt == '\' ] && continue 
    7373    printf "%s " $elmt 
    7474 
    7575    if [ $elmt == 'TOOLS/maketools' ]; then 
    76    svn co -q ${TRUS_SVNR}/${svn_bran}/NEMOGCM/TOOLS --depth empty 
     76   svn co -q ${TRUST_SVN_REPO}/${svn_bran}/NEMOGCM/TOOLS --depth empty 
    7777   svn up -q $elmt 
    7878    else 
    79    svn co -q ${TRUS_SVNR}/${svn_bran}/NEMOGCM/$elmt $elmt 
     79   svn co -q ${TRUST_SVN_REPO}/${svn_bran}/NEMOGCM/$elmt $elmt 
    8080    fi 
    8181 
     
    8787## Compile rebuild_nemo.exe in anticipation 
    8888##--------------------------------------------------- 
    89 if [ $( find ARCH -name arch-${TRUS_HPCC}.fcm ) ]; then 
     89if [ $( find ARCH -name arch-${TRUST_MAIN_HPCC}.fcm ) ]; then 
    9090    echo 'Compile NEMO rebuild tool' 
    91     cd TOOLS && ./maketools -n REBUILD_NEMO -m ${TRUS_HPCC} -j ${TRUS_NPRO} >& /dev/null 
     91    cd TOOLS && ./maketools -n REBUILD_NEMO -m ${TRUST_MAIN_HPCC} -j ${TRUST_COMPILE_NPROC} >& /dev/null 
    9292    [ -e REBUILD_NEMO/rebuild_nemo.exe ] && printf "\033[0;32mOK\033[0m" || printf "\033[0;31mKO\033[0m" 
    9393    printf "\n\n" 
Note: See TracChangeset for help on using the changeset viewer.