Index: /trunk/lauching_area/Master-files/grisli.run.openmp_ant40
===================================================================
--- /trunk/lauching_area/Master-files/grisli.run.openmp_ant40	(revision 229)
+++ /trunk/lauching_area/Master-files/grisli.run.openmp_ant40	(revision 229)
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Script pour lancer grisli en batch au LSCE
+# Works for the 
+#PBS -N RUNNAME
+# Specify batch queue
+#PBS -q longp
+#PBS -v BATCH_NUM_PROC_TOT=4
+#PBS -l nodes=1:ppn=4
+# 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=4
+export OMP_NUM_THREADS=4
+export KMP_STACKSIZE=16000000 #2048000000 # KMP_STACKSIZE remplace OMP_STACKSIZE avec ifort
+
+module load netcdf/4
+
+MODEL="SOURCESREP"
+EXEDIR="EXEREP"
+
+
+echo "Grisli is being compiled..."
+cd $MODEL
+make clean && make "Ant-40"
+
+cd $EXEDIR
+LID=`date +%y%m%d-%H%M%S`
+echo "`date` -- GRISLI EXECUTION BEGINS HERE"
+./Ant-40 >& Ant-40.log.$LID
+
+wait
+echo "`date` -- GRISLI EXECUTION HAS FINISHED"
+
+# Clean the sources?
+#rm -rf $MODEL
Index: /trunk/lauching_area/Master-files/grisli.run_ant40
===================================================================
--- /trunk/lauching_area/Master-files/grisli.run_ant40	(revision 229)
+++ /trunk/lauching_area/Master-files/grisli.run_ant40	(revision 229)
@@ -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-40"
+
+cd $EXEDIR
+LID=`date +%y%m%d-%H%M%S`
+echo "`date` -- GRISLI EXECUTION BEGINS HERE"
+./Ant-40 >& Ant-40.log.$LID
+
+wait
+echo "`date` -- GRISLI EXECUTION HAS FINISHED"
+
+# Clean the sources?
+#rm -rf $MODEL
Index: /trunk/lauching_area/Master-files/module_choix-antar40-0.4-cycles.f90
===================================================================
--- /trunk/lauching_area/Master-files/module_choix-antar40-0.4-cycles.f90	(revision 229)
+++ /trunk/lauching_area/Master-files/module_choix-antar40-0.4-cycles.f90	(revision 229)
@@ -0,0 +1,141 @@
+!> \file module_choix-antar40-0.4.f90
+!! Ce module permet de choisir quels package on veut utiliser
+!! 
+!<
+
+!> \namespace MODULE_CHOIX
+!! Ce module permet de choisir quels package on veut utiliser
+!! \author CatRitz
+!! \date ...
+!! @note Used modules
+!! @note   - use lect_topo_anteis    
+!! @note   - use lect_clim_act_anteis
+!! @note   - use climat_perturb_mod
+!! @note   - use no_lakes
+!! @note   - use isostasie_mod  
+!! @note   - use deformation_mod_2lois  
+!! @note   - use  prop_thermiques_ice
+!! @note   - use eau_basale
+!! @note   - use sliding_Bindschadler
+!! @note   - use dragging_hwat_contmaj
+!! @note   - use eq_ellip_sgbsv_mod 
+!! @note   - use calving_frange
+!! @note   - use equat_adv_diff_2D_vect     
+!! @note   - use bmelt_ant_regions 
+!! @note   - use fake_ant
+!! @note   - use out_profile  
+!! @note   - use out_cptr     
+!! @note   - use out_hz     
+!! @note   - use output_antarcti_mod
+!! @note   - use printtable
+!<
+
+MODULE MODULE_CHOIX
+
+!--------------Lecture topo ------------------------
+! use lect_topo_heino      ! pour Heino
+use lect_topo_anteis    ! pour l'antarctique 40 km
+!use lect_topo_nord40    ! pour l'hemisphere nord 40 km
+!use lect_topo_eurasie   ! pour l'eurasie  (toute resolutions)
+
+!--------------Lecture climat ref ------------------
+! Le climat de ref si necessaire est maintenant lu par le module de climat directement
+!use lect_clim_act_anteis
+
+
+!--------------Lecture climat forcage---------------
+!use climat_forcage_mois_mod ! forcage mensuel GCM 1 Snapshot Fev 2015
+!use climat_perturb_mod   ! climat perturbe a reverifier Dec 2015
+!use climat_Grice2sea_years_mod  ! climat force par fichier SMB directement (grice2sea)
+use climat_Grice2sea_years_perturb_mod ! climat force par fichier SMB directement (grice2sea) + index temperature carotte de glace
+
+
+!use climat_forcage_mod
+!use climat_synthes_mod
+!use climat_profil_mod
+!use climat_regions_delta
+
+!use ablation_mod ! calcul de l'ablation (PDD ou autre methode)
+use no_ablation  ! pas de calcul de l'ablation => lecture fichier SMB (necessaire avec climat_Grice2sea_years_mod)
+
+! pas de lacs proglaciaires
+use no_lakes
+
+! suivi des traceurs ou pas ?
+!use tracer_mod  ! probablement pas compatible avec Hemin-40 actuellement
+use notracer_mod
+
+!--------------Choix isostasie----------------------
+ use isostasie_mod  ! module permettant de calculer la deflexion isostasique
+! use noisostasie_mod ! module pour ne pas avoir d'isostasie
+
+
+!--------------Module Physique---------------------
+!use deformation_mod  ! module concernant les lois de deformation
+use deformation_mod_2lois   ! module concernant les lois de deformation
+
+! eau basale
+use eau_basale
+
+! sliding- dragging
+! use module sliding_vitbal
+! use sliding_Bindschadler
+use no_sliding
+! use sliding_dragging_heino    ! loi de glissement heino : mis dans diffusiv : 
+
+
+!use dragging_vitbil
+!use dragging_hwatstream
+!use dragging_hwat_cont
+
+!use dragging_hwat_contmaj ! frottement basal catherine grisliv8 ice stream peu actifs
+!use dragging_neff_slope ! dragging Aurelien et Christophe
+use dragging_param_beta
+!use dragging_param_beta_sedim
+!use dragging_param_beta_nolin
+! use dragging_hwat_sedim version sediment HN
+
+!------------ spinup -----------------------------------
+use no_spinup           ! spinup=0
+!use spinup_vitbil         ! plusieurs variantes de spinup : inclue le dragging
+                          ! enlever le use dragging dans ce cas là
+
+use furst_schoof_mod  ! module pour calcul flux gr line
+
+! use eq_elliptique_mod ! ancienne version (remplimat-5)
+use eq_ellip_sgbsv_mod ! nouvelle version juillet 2008
+
+! calving
+use calving_frange
+
+! choix resolution de la conservation de la masse
+!-----------------------------------------------
+!use equat_adv_diff_2D          ! conservation masse avec advection-diffusion
+use equat_adv_diff_2D_vect      ! le vecteur est maintenant dans l'appel
+
+!--------------Fusion basale------------------------
+!use bmelt_ant_regions ! pour l'Antarctique avec régions
+use bmelt_ant_regions_initmip
+!use bmelt_ant_regions_oce ! pour Ant region et temp ocean
+!use bmelt_nor_regions ! pour le nord avec régions
+!use bmelt_nor_depth   ! pour le nord avec profondeur d'eau
+
+
+! fake -------fausses routines pour compatibilités
+! use fake_heino
+use fake_ant
+
+! use fake_nord
+!-------------- Outputs-----------------------------
+!
+use out_profile  !profils
+
+!-----Suivi temporel
+! use output_heminord_mod
+ use output_antarcti_mod
+! use output_heino
+!-----debugage...
+use printtable
+
+
+end module MODULE_CHOIX
Index: /trunk/lauching_area/go_ant40.sh
===================================================================
--- /trunk/lauching_area/go_ant40.sh	(revision 229)
+++ /trunk/lauching_area/go_ant40.sh	(revision 229)
@@ -0,0 +1,168 @@
+#!/bin/bash
+# script pour lancer un cycle antarctique 
+
+# name of the run:
+namerun="Ant40-02"
+
+tmodelend="10000."
+tmodelbegin="-126000."
+tmodellength="136000."
+
+parallel="yes" # "yes or no?"
+
+
+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 3 sec. to do a ctr+c..."
+    sleep 3
+    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/TEMPS-NETCDF.dat" $MODEL"/Fichiers-parametres/anteis1_TEMPS-NETCDF.dat"
+#cp "../Master-files/Makefile" $MODEL"/Makefile"
+#cp "../Master-files/anteis1_param_list.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+#cp "../Master-files/paradim-ant40_mod.f90" $MODEL"/Ant40_files/."
+# Schoof :
+#cp "../Param/anteis1_param_list_Cyc-Scho.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+# Tsai
+cp "../Param/anteis1_param_list_Cyc-Tsai.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+
+if [ $parallel = "yes" ]; then
+  cp "Master-files/grisli.run.openmp_ant40" $RUNDIR"/bin/grisli.run"
+else
+  cp "Master-files/grisli.run_ant40" $RUNDIR"/bin/grisli.run"
+fi
+
+cd $RUNDIR"/INPUT"
+ln -sf ${GRISLI_DIR}"/INPUT/ANTEIS1" .
+ln -sf ${GRISLI_DIR}"/INPUT/Forcage" .
+ln -sf ${GRISLI_DIR}"/INPUT/tracer.dat" .
+
+#--------------------------------------------------
+# Replacing key words:
+#--------------------------------------------------
+
+# run spec.:
+sed -i "s/RUNNAME/$namerun/" $RUNDIR"/bin/anteis1_param_list.dat"
+sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/anteis1_param_list.dat"
+sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/anteis1_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"
+if [ $parallel = "yes" ]; then
+    sed -i '/EXEDIR/s/$/\nmodule load netcdf\/4p\n/' $RUNDIR"/bin/grisli.run"
+else
+    sed -i '/EXEDIR/s/$/\nmodule load netcdf\/4\n/' $RUNDIR"/bin/grisli.run"
+fi
+
+# 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"
+
+
+#--------------------------------------------------
+# Submitting the job:
+#--------------------------------------------------
+
+echo "submitting the job"
+qsub $RUNDIR"/bin/grisli.run"
+echo "-------------------------------------"
+
+
+
+
+
+
+
+
Index: /trunk/lauching_area/go_ant40_cyc-Scho.sh
===================================================================
--- /trunk/lauching_area/go_ant40_cyc-Scho.sh	(revision 229)
+++ /trunk/lauching_area/go_ant40_cyc-Scho.sh	(revision 229)
@@ -0,0 +1,165 @@
+#!/bin/bash
+# script pour lancer un cycle antarctique 
+
+# name of the run:
+namerun="Cyc-Scho"
+
+tmodelend="10000."
+tmodelbegin="-126000." #"-150000."
+tmodellength="136000."
+
+parallel="yes" # "yes or no?"
+
+
+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 3 sec. to do a ctr+c..."
+    sleep 3
+    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/TEMPS-NETCDF.dat" $MODEL"/Fichiers-parametres/anteis1_TEMPS-NETCDF.dat"
+#cp "../Master-files/Makefile" $MODEL"/Makefile"
+#cp "../Master-files/anteis1_param_list.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+cp "Master-files/module_choix-antar40-0.4-cycles.f90" $MODEL"/Ant40_files/module_choix-antar40-0.4.f90"
+cp "../Param/anteis1_param_list_Cyc-Scho.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+
+if [ $parallel = "yes" ]; then
+  cp "Master-files/grisli.run.openmp_ant40" $RUNDIR"/bin/grisli.run"
+else
+  cp "Master-files/grisli.run_ant40" $RUNDIR"/bin/grisli.run"
+fi
+
+cd $RUNDIR"/INPUT"
+ln -sf ${GRISLI_DIR}"/INPUT/ANTEIS1" .
+ln -sf ${GRISLI_DIR}"/INPUT/Forcage" .
+ln -sf ${GRISLI_DIR}"/INPUT/tracer.dat" .
+
+#--------------------------------------------------
+# Replacing key words:
+#--------------------------------------------------
+
+# run spec.:
+sed -i "s/RUNNAME/$namerun/" $RUNDIR"/bin/anteis1_param_list.dat"
+sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/anteis1_param_list.dat"
+sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/anteis1_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"
+if [ $parallel = "yes" ]; then
+    sed -i '/EXEDIR/s/$/\nmodule load netcdf\/4p\n/' $RUNDIR"/bin/grisli.run"
+else
+    sed -i '/EXEDIR/s/$/\nmodule load netcdf\/4\n/' $RUNDIR"/bin/grisli.run"
+fi
+
+# 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"
+
+
+#--------------------------------------------------
+# Submitting the job:
+#--------------------------------------------------
+
+echo "submitting the job"
+#qsub $RUNDIR"/bin/grisli.run"
+echo "-------------------------------------"
+
+
+
+
+
+
+
+
Index: /trunk/lauching_area/go_ant40_cyc-Tsai.sh
===================================================================
--- /trunk/lauching_area/go_ant40_cyc-Tsai.sh	(revision 229)
+++ /trunk/lauching_area/go_ant40_cyc-Tsai.sh	(revision 229)
@@ -0,0 +1,165 @@
+#!/bin/bash
+# script pour lancer un cycle antarctique 
+
+# name of the run:
+namerun="Cyc-Tsai"
+
+tmodelend="10000."
+tmodelbegin="-126000." #"-150000."
+tmodellength="136000."
+
+parallel="yes" # "yes or no?"
+
+
+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 3 sec. to do a ctr+c..."
+    sleep 3
+    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/TEMPS-NETCDF.dat" $MODEL"/Fichiers-parametres/anteis1_TEMPS-NETCDF.dat"
+#cp "../Master-files/Makefile" $MODEL"/Makefile"
+#cp "../Master-files/anteis1_param_list.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+#cp "../Master-files/paradim-ant40_mod.f90" $MODEL"/Ant40_files/."
+cp "../Param/anteis1_param_list_Cyc-Tsai.dat" $RUNDIR"/bin/anteis1_param_list.dat"
+
+if [ $parallel = "yes" ]; then
+  cp "Master-files/grisli.run.openmp_ant40" $RUNDIR"/bin/grisli.run"
+else
+  cp "Master-files/grisli.run_ant40" $RUNDIR"/bin/grisli.run"
+fi
+
+cd $RUNDIR"/INPUT"
+ln -sf ${GRISLI_DIR}"/INPUT/ANTEIS1" .
+ln -sf ${GRISLI_DIR}"/INPUT/Forcage" .
+ln -sf ${GRISLI_DIR}"/INPUT/tracer.dat" .
+
+#--------------------------------------------------
+# Replacing key words:
+#--------------------------------------------------
+
+# run spec.:
+sed -i "s/RUNNAME/$namerun/" $RUNDIR"/bin/anteis1_param_list.dat"
+sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/anteis1_param_list.dat"
+sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/anteis1_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"
+if [ $parallel = "yes" ]; then
+    sed -i '/EXEDIR/s/$/\nmodule load netcdf\/4p\n/' $RUNDIR"/bin/grisli.run"
+else
+    sed -i '/EXEDIR/s/$/\nmodule load netcdf\/4\n/' $RUNDIR"/bin/grisli.run"
+fi
+
+# 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"
+
+
+#--------------------------------------------------
+# Submitting the job:
+#--------------------------------------------------
+
+echo "submitting the job"
+#qsub $RUNDIR"/bin/grisli.run"
+echo "-------------------------------------"
+
+
+
+
+
+
+
+
