#!/bin/bash

#settings
/ccc/work/cont003/gen7451/martin/NEMO/
NEMO_BRAN=branches/2015/nemo_v3_6_STABLE

X64_CURIE_cron

cd /ccc/work/cont003/gen7451/martin/NEMO
mkdir -p ${}/NEMOGCM

for elmt in 'ARCH' 'CONFIG' 'NEMO' 'EXTERNAL/IOIPSL' 'EXTERNAL/fcm' 'TOOLS' 'TRUST'; do
    svn_bran=${NEMO_BRAN}; rev=''
    [ "$elmt" == 'TRUST' ] && svn_bran='branches/2015/dev_r5092_CNRS_SETTE' && rev='-r 5671'
    svn co $rev http://forge.ipsl.jussieu.fr/nemo/svn/${svn_bran}/NEMOGCM/$elmt ${}/NEMOGCM/$elmt

done

cd NEMOGCM/TOOLS

for elmt in $( ls * ); do
    if [ ! $( echo $elmt | grep "COMPILE\|maketools\|REBUILD_NEMO" ) ]; then
	echo $elmt && rm -rf $elmt > /dev/null
    fi
done

if [ find ../ARCH -name  ]
./maketools -m ${} -n REBUILD_NEMO > /dev/null

