#!/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}
    [ "$elmt" == 'TRUST' ] && svn_bran='branches/2015/dev_r5092_CNRS_SETTE'
    svn co http://forge.ipsl.jussieu.fr/nemo/svn/${svn_bran}/NEMOGCM/$elmt ${}/NEMOGCM/$elmt

done

cd NEMOGCM/TOOLS

for elmt in $( ls * ); do
    [ ! $( echo $elmt | grep "COMPILE\|maketools\|REBUILD_NEMO" ) ] && rm -rf $elmt
done

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

