Index: trunk/lauching_area/Master-files/grisli.run.openmp_ant16
===================================================================
--- trunk/lauching_area/Master-files/grisli.run.openmp_ant16	(revision 292)
+++ trunk/lauching_area/Master-files/grisli.run.openmp_ant16	(revision 292)
@@ -0,0 +1,73 @@
+#!/bin/bash
+# Script pour lancer grisli en batch au LSCE
+# Works for the 
+#PBS -N _RUNNAME_
+# Specify batch queue
+#PBS -q mediump
+#PBS -v BATCH_NUM_PROC_TOT=8
+#PBS -l nodes=1:ppn=8
+# Specify execution shell
+##PBS -S /bin/bash
+# Request that stdin and stdout are merged in the same output file
+#PBS -j eo
+# Send a mail when the job terminates
+#PBS -m e -M christophe.dumas@lsce.ipsl.fr
+
+export MKL_NUM_THREADS=8
+export OMP_NUM_THREADS=8
+export KMP_STACKSIZE=2048000000 #2048000000 # KMP_STACKSIZE remplace OMP_STACKSIZE avec ifort
+
+module load netcdf/4
+
+MODEL="SOURCESREP"
+EXEDIR="EXEREP"
+namerun="_RUNNAME_"
+tmodelbegin="_RUNTBEGIN_"
+tmodelend="_RUNTEND_"
+iteration="_ITERATION_"
+
+
+echo "Grisli is being compiled..."
+echo "RUNNAME : " ${namerun}1
+cd $MODEL
+make clean && make "Ant-16"
+
+cd $EXEDIR
+LID=`date +%y%m%d-%H%M%S`
+echo "`date` -- GRISLI EXECUTION BEGINS HERE"
+./Ant-16 >& Ant-16.log.$LID
+wait
+echo "`date` -- GRISLI EXECUTION HAS FINISHED"
+namerun_prev=${namerun}1
+
+if [ $iteration -ge 2 ] ; then
+  cp $EXEDIR"/ant16km_param_list.dat" $EXEDIR"/ant16km_param_list.dat.01"
+  for i in `seq 2 $iteration`
+    do NOMSIMUlist=${namerun}$i
+    echo "simulation : "${NOMSIMUlist}
+    echo "use speed & drag simulation : "${namerun_prev}
+    module unload netcdf/4
+    ../recup_vitbil_job.sh ant16km ${namerun_prev}
+    NOMBETAClist=beta-run-${namerun_prev}".grd"
+    NOMVITBILlist=vitbil-run-${namerun_prev}".grd"
+    cp ${EXEDIR}"/ant16km_param_list.dat.iterbeta" ${EXEDIR}"/ant16km_param_list.dat"
+    echo ${EXEDIR}"/ant16km_param_list.dat"
+    echo $NOMSIMUlist $tmodelbegin $tmodelend $NOMBETAClist $NOMVITBILlist
+    sed -i "s|RUNNAME|$NOMSIMUlist|" "ant16km_param_list.dat"
+    sed -i "s|RUNTBEGIN|$tmodelbegin|" ${EXEDIR}"/ant16km_param_list.dat"
+    sed -i "s|RUNTEND|$tmodelend|" ${EXEDIR}"/ant16km_param_list.dat"
+    sed -i "s|NOMBETAC|$NOMBETAClist|" ${EXEDIR}"/ant16km_param_list.dat"
+    sed -i "s|NOMVITBIL|$NOMVITBILlist|" ${EXEDIR}"/ant16km_param_list.dat"
+    echo "submitting the job"
+    module load netcdf/4
+    ./Ant-16 >& Ant-16.log.$LID
+# sauvegarde du fichier param
+    cp ${EXEDIR}"/ant16km_param_list.dat" ${EXEDIR}"/ant16km_param_list.dat.0"$i
+    namerun_prev=${NOMSIMUlist}
+    echo "-------------------------------------"
+  done
+fi
+
+
+# Clean the sources?
+#rm -rf $MODEL
Index: trunk/lauching_area/Master-files/grisli.run_ant16
===================================================================
--- trunk/lauching_area/Master-files/grisli.run_ant16	(revision 292)
+++ trunk/lauching_area/Master-files/grisli.run_ant16	(revision 292)
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Script pour lancer grisli en batch au LSCE
+# Works for the 
+#PBS -N RUNNAME
+# Specify batch queue
+#PBS -q medium
+# Specify execution shell
+##PBS -S /bin/bash
+# Request that stdin and stdout are merged in the same output file
+#PBS -j eo
+# Send a mail when the job terminates
+#PBS -m e -M christophe.dumas@lsce.ipsl.fr
+
+module load netcdf/4
+
+
+MODEL="SOURCESREP"
+EXEDIR="EXEREP"
+
+
+echo "Grisli is being compiled..."
+cd $MODEL
+make clean && make "Ant-16"
+
+cd $EXEDIR
+LID=`date +%y%m%d-%H%M%S`
+echo "`date` -- GRISLI EXECUTION BEGINS HERE"
+./Ant-16 >& Ant-16.log.$LID
+
+wait
+echo "`date` -- GRISLI EXECUTION HAS FINISHED"
+
+# Clean the sources?
+#rm -rf $MODEL
Index: trunk/lauching_area/go_ant16.sh
===================================================================
--- trunk/lauching_area/go_ant16.sh	(revision 292)
+++ trunk/lauching_area/go_ant16.sh	(revision 292)
@@ -0,0 +1,170 @@
+#!/bin/bash
+# script pour lancer un cycle antarctique 
+
+# name of the run (7 char + iteration number):
+namerun="noresm1-m_rcp8.5_medium_ISMIP6_Ant16_relax_inv5"   #"noresm1-m_rcp8.5_medium_ISMIP6_Ant16_relax_inv5"
+
+tmodelend="106."         # 105.  305
+tmodelbegin="20."        # 20.   20
+tmodellength="86."       # 85    285
+betacfile="beta-run-12S-inv5.grd"  #"beta-run-12S-inv4.grd" #"beta-run-9-S-inv4.grd" #
+Umagbilfile="vitbil-run-MIP-SBT5.grd"
+parallel="yes" # "yes or no?"
+iteration="1"
+
+
+echo "-------------------------------------"
+echo "    Now launching run: "   $namerun
+echo "      -------------------------      "
+
+#--------------------------------------------------
+# Check if times are ok:
+#--------------------------------------------------
+
+tcheck=`echo "$tmodelbegin + $tmodellength" | bc -l`
+tcheckbis=`echo "$tmodelend + 0" | bc -l`
+if [ $tcheck != $tcheckbis ]; then
+    echo "The times provided are wrong!"
+    echo $tcheck $tcheckbis
+    echo "Tbegin:" $tmodelbegin ", Tend:" $tmodelend ", length:" $tmodellength
+    exit 0
+else
+    echo "The times provided are correct."
+fi
+
+#--------------------------------------------------
+# The different directories:
+#--------------------------------------------------
+#RUNDIR="/home/climold/aquiquet/GRISLI/GRISLI_trunk/RUNS/"$namerun
+#MODELMASTER="/home/climold/aquiquet/GRISLI/GRISLI_trunk/SOURCES"
+#MODEL=$RUNDIR"/SOURCES"
+LAUCHING_DIR=`pwd`
+GRISLI_DIR=${LAUCHING_DIR%%/lauching_area}
+RUNDIR=${GRISLI_DIR}"/RUNS/"${namerun}
+MODELMASTER=${GRISLI_DIR}"/SOURCES"
+MODEL=${RUNDIR}"/SOURCES"
+
+if [ -d $RUNDIR ]; then
+    echo "This run exists, do you really want to overwrite?"
+    echo "You have 7 sec. to do a ctr+c..."
+    sleep 7
+    echo "Ok, your choice."
+else
+    mkdir $RUNDIR
+    echo "      Run will be in:"
+    echo "  " $RUNDIR
+fi
+
+if [ -d $MODEL ]; then
+    echo "model dir already created, cleaning up before copying files"
+    rm -rf $MODEL"/"*
+else
+    mkdir $MODEL
+fi
+ 
+cp -R $MODELMASTER"/"* $MODEL"/."
+svn status $MODELMASTER > $MODEL"/svn.status.txt"
+svn diff $MODELMASTER > $MODEL"/svn.diff.txt"
+
+if [ -d $RUNDIR"/bin" ]; then
+    echo "exe in bin/"
+else
+    mkdir $RUNDIR"/bin"
+fi
+
+if [ -d $RUNDIR"/RESULTATS" ]; then
+    echo "exe in RESULTATS/"
+else
+    mkdir $RUNDIR"/RESULTATS"
+fi
+
+if [ -d $RUNDIR"/INPUT" ]; then
+    echo "inputs are linked to model master"
+else
+    echo "inputs will be linked to model master"
+    mkdir $RUNDIR"/INPUT"
+fi
+
+
+    
+echo "Now copying master files to the working directory:"
+echo $RUNDIR
+echo "And to the model directory:"
+echo $MODEL
+
+#cp "../Master-files/Makefile" $MODEL"/Makefile"
+#cp "../Master-files/anteis1_param_list.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+#cp "Master-files/anteis1_TEMPS-NETCDF-cycle.dat" $MODEL"/Fichiers-parametres/anteis1_TEMPS-NETCDF.dat"
+#cp "Master-files/module_choix-antar40-0.4-cycles.f90" $MODEL"/Ant40_files/module_choix-antar40-0.4.f90"
+
+cp "../Param/ant16km_param_list.dat" $RUNDIR"/bin/ant16km_param_list.dat"
+# selection du module choix inversion beta :
+#cp $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90-iterbeta" $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90"
+
+# script gmt de calcul des vitbil et beta_c :
+#cp "Master-files/recup_vitbil_job.sh" $RUNDIR"/recup_vitbil_job.sh"
+
+#cp "../Param/ant16km_param_list.dat.long" $RUNDIR"/bin/ant16km_param_list.dat"
+# selection du module choix run std :
+#cp $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90-std" $RUNDIR"/SOURCES/Ant16_files/module_choix-ant16km.f90"
+
+
+if [ $parallel = "yes" ]; then
+  cp "Master-files/grisli.run.openmp_ant16" $RUNDIR"/bin/grisli.run"
+else
+  cp "Master-files/grisli.run_ant16" $RUNDIR"/bin/grisli.run"
+fi
+
+cd $RUNDIR"/INPUT"
+ln -sf ${GRISLI_DIR}"/INPUT/ANT16km" .
+ln -sf ${GRISLI_DIR}"/INPUT/Forcage" .
+ln -sf ${GRISLI_DIR}"/INPUT/tracer.dat" .
+
+#--------------------------------------------------
+# Replacing key words:
+#--------------------------------------------------
+
+# run spec.:
+sed -i "s/RUNNAME/${namerun}1/" $RUNDIR"/bin/ant16km_param_list.dat"
+sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/ant16km_param_list.dat"
+sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/ant16km_param_list.dat"
+
+# submission script:
+sed -i "s|SOURCESREP|$MODEL|" $RUNDIR"/bin/grisli.run"
+sed -i "s|EXEREP|$RUNDIR\/bin|" $RUNDIR"/bin/grisli.run"
+sed -i "s|_RUNNAME_|$namerun|" $RUNDIR"/bin/grisli.run"
+sed -i "s|_RUNTBEGIN_|$tmodelbegin|" $RUNDIR"/bin/grisli.run"
+sed -i "s|_RUNTEND_|$tmodelend|" $RUNDIR"/bin/grisli.run"
+sed -i "s|_ITERATION_|$iteration|" $RUNDIR"/bin/grisli.run"
+
+# Makefile:
+if [ $parallel = "yes" ]; then
+    sed -i "s/Makefile.tof-lsce3130.inc/Makefile.tof-asterix-parallel.inc/" $RUNDIR"/SOURCES/Makefile"
+else
+    sed -i "s/Makefile.tof-lsce3130.inc/Makefile.tof-asterix-sequential.inc/" $RUNDIR"/SOURCES/Makefile"
+fi
+
+# param values:
+#sed -i "s/PARAMENHFACT/$enh_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMCF/$cf_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMSEUILNEFF/$seuilneff_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMINFILTR/$infiltr_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMKOND0/$kond0_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/BETAMAX/$betamax_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/TOSTICK/$tostick_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/EXPOSLOPE/$exposlope_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMBSLOPE/$bslope_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMBEXPO/$bexpo_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMBMELTCOEF/$bmelt_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+#sed -i "s/PARAMSF/$sf_fact/" $RUNDIR"/bin/anteis1_param_list.dat"
+sed -i "s/NOMBETAC/$betacfile/" $RUNDIR"/bin/ant16km_param_list.dat"
+sed -i "s/NOMVITBIL/$Umagbilfile/" $RUNDIR"/bin/ant16km_param_list.dat"
+
+#--------------------------------------------------
+# Submitting the job:
+#--------------------------------------------------
+
+echo "submitting the job"
+qsub $RUNDIR"/bin/grisli.run"
+echo "-------------------------------------"
+
