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.
install_new_branch.sh in branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST – NEMO

source: branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh @ 5788

Last change on this file since 5788 was 5788, checked in by nicolasmartin, 9 years ago

dev_r5092_CNRS18_TRUST Several enhancements (global variables rename, notification mail object, add job performances, templates description, script to install new minimal branch to test) to improve accessibility for NEMO users & bugfixes (tar creation, modulefiles)

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/bin/bash
2
3
4HELP=0; NEMO_BRAN='trunk'; NPROC=1
5SVN_URL='https://forge.ipsl.jussieu.fr/nemo/svn'
6
7while [ $# -ne 0 ]; do
8    case $1 in
9   '-b'|'--branch') NEMO_BRAN=$2; shift 2;; '-d'|'--directory') INSTALL_DIR=$2; shift 2;;
10   '-j'|'--job'   ) NPROC=$2    ; shift 2;; '-m'|'--machine'  ) NEMO_HPCC=$2  ; shift 2;;
11   '-h'|'--help'  ) HELP=1      ; shift  ;; '-u'|'--username' ) SVN_USER=$2   ; shift 2;;
12   "*"            ) HELP=1      ; shift  ;;
13    esac
14done
15
16if [[ -z "${INSTALL_DIR}" || -z "${NEMO_HPCC}" || $HELP == 1 ]]; then
17    echo 'Error'
18    exit 1
19fi
20
21if   [ ${NEMO_BRAN} == 'trunk' ]; then
22    svn_bran=${NEMO_BRAN}
23elif [ $( svn ls ${SVN_URL}/branches/2015 | grep -oe "\<${NEMO_BRAN}\>") ]; then
24    svn_bran=branches/2015/${NEMO_BRAN}
25else
26    printf "\nNEMO branch name \033[0;31m%s\033[0m given is not recognized\n\n" ${NEMO_BRAN}
27    echo 'List of existing branches on repository in branches/2015:'
28    svn ls ${SVN_URL}/branches/2015 | tr -d / | xargs -n 3 printf "%-35s\t%-35s\t%-35s\n"
29    echo
30    exit 1
31fi
32
33printf "\nInstallation of NEMO trusting monitoring in %s on %s branch for %s\n\n" \
34    ${INSTALL_DIR} ${NEMO_BRAN} ${NEMO_HPCC}
35
36echo 'Initial checkout of '${NEMO_BRAN}' branch'
37mkdir -p ${INSTALL_DIR}/${NEMO_BRAN}/NEMOGCM && cd ${INSTALL_DIR}/${NEMO_BRAN}/NEMOGCM
38
39for elmt in 'ARCH' 'CONFIG' 'NEMO' 'EXTERNAL' 'TOOLS' 'TRUST'; do
40    rev=''
41    printf "%s " $elmt
42    [ $elmt == 'TRUST' ] && svn_bran='branches/2015/dev_r5092_CNRS18_TRUST' && rev='-r 5697'
43    svn co -q $rev ${SVN_URL}/${svn_bran}/NEMOGCM/$elmt
44done
45
46printf "\n\nCleaning EXTERNAL directory\n"
47cd EXTERNAL
48printf 'Remove '
49
50for elmt in $( find -maxdepth 1 -type d -name '[^.]*' ); do
51    if [ ! $( echo $elmt | grep "AGRIF\|IOIPSL\|fcm" ) ]; then
52   printf "%s " $elmt && rm -rf $elmt > /dev/null
53    fi
54done
55printf "\n"
56
57
58printf "\nCleaning TOOLS directory\n"
59cd ../TOOLS
60printf 'Remove '
61
62for elmt in $( find -maxdepth 1 -type d -name '[^.]*' ); do
63    if [ ! $( echo $elmt | grep "COMPILE\|maketools\|REBUILD_NEMO" ) ]; then
64   printf "%s " $elmt && rm -rf $elmt > /dev/null
65    fi
66done
67printf "\n\n"
68
69if [ $( find ../ARCH -name arch-${NEMO_HPCC}.fcm ) ]; then
70    echo 'Compile NEMO rebuild tool'
71    ./maketools -n REBUILD_NEMO -m ${NEMO_HPCC} -j $NPROC >& /dev/null
72    [ $? -eq 0 ] && printf "\033[0;32mOK\033[0m" || printf "\033[0;31mKO\033[0m"
73    printf "\n\n"
74else
75    printf "\033[0;31mNo arch file found to compile NEMO rebuild tool\033[0m\n\n"
76fi
Note: See TracBrowser for help on using the repository browser.