Index: trunk/lauching_area/Master-files/euras_TEMPS-NETCDF-degla.dat
===================================================================
--- trunk/lauching_area/Master-files/euras_TEMPS-NETCDF-degla.dat	(revision 300)
+++ trunk/lauching_area/Master-files/euras_TEMPS-NETCDF-degla.dat	(revision 300)
@@ -0,0 +1,26 @@
+TEMPS-HZ.dat
+
+Permet de définir les temps auxquels ont lieu les sorties hz :
+Deux méthodes complémentaires: 
+
+1) sortie régulière. dtsortie_hz(ndtsortie) est un tableau qui contient 
+les pas de temps de sortie. Pour chaque variable on choisi celui qu'on
+veut par indice dans dt_out_hz
+
+2) predef_tsort(npredeft)  est un tableaux de temps prédéfinis pour les sorties
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fin des commentaires~~~~~~~~~~~~~
+2			nbr de classes a sortir	dans ce run	    	
+1  2	class   (voir les classes et variables dans LISTE_VAR_NCDF.dat)
+-------------------------------------------------------------------------------------------
+1	ndtsortie      lecture de dtsortie_hz
+500.
+-------------------------------------------------------------------------------------------
+6	npredeft        lecture de predef_tsort
+-126000
+-21000
+10
+100
+200
+500
+-------------------------------------------------------------------------------------------
Index: trunk/lauching_area/Master-files/grisli.run.openmp_euras20
===================================================================
--- trunk/lauching_area/Master-files/grisli.run.openmp_euras20	(revision 300)
+++ trunk/lauching_area/Master-files/grisli.run.openmp_euras20	(revision 300)
@@ -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 "Euras-20"
+
+cd $EXEDIR
+LID=`date +%y%m%d-%H%M%S`
+echo "`date` -- GRISLI EXECUTION BEGINS HERE"
+./Euras-20 >& Euras-20.log.$LID
+
+wait
+echo "`date` -- GRISLI EXECUTION HAS FINISHED"
+
+# Clean the sources?
+#rm -rf $MODEL
Index: trunk/lauching_area/Master-files/grisli.run_euras20
===================================================================
--- trunk/lauching_area/Master-files/grisli.run_euras20	(revision 300)
+++ trunk/lauching_area/Master-files/grisli.run_euras20	(revision 300)
@@ -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 "Euras-20"
+
+cd $EXEDIR
+LID=`date +%y%m%d-%H%M%S`
+echo "`date` -- GRISLI EXECUTION BEGINS HERE"
+./Euras-20 >& Euras-20.log.$LID
+
+wait
+echo "`date` -- GRISLI EXECUTION HAS FINISHED"
+
+# Clean the sources?
+#rm -rf $MODEL
Index: trunk/lauching_area/degla_PMIP_euras20_param_list.dat
===================================================================
--- trunk/lauching_area/degla_PMIP_euras20_param_list.dat	(revision 300)
+++ trunk/lauching_area/degla_PMIP_euras20_param_list.dat	(revision 300)
@@ -0,0 +1,384 @@
+!  Parametres du run : geoplace GI2S_5T Groenland Ice2sea 5 km cut Tamsin
+
+!___________________________________________________________
+&runpar                       ! nom du bloc parametres du run
+ runname      =  "RUNNAME"   ! 8 caracteres 
+ icompteur    =    0
+ iout         =    2  
+ reprcptr     =  "../../../Fichier-CPTR/LOV21aT0+k50.nc"
+ itracebug    = 0
+ num_tracebug = 166	
+ comment_run  = "Eurasie Degla IPSL clim_forcage"
+/
+! runname    : nom de l experience (8 caracteres)
+! icompteur  : reprise dans un fichier  0 -> non, 1 -> oui, 2 -> T et Hwat
+!              3-> T seulement
+! iout       : 1-> sortie cptr pour reprise,2 -> sortie nc pour reprise 
+! reprcptr   : nom du fichier
+!___________________________________________________________
+&grdline                 ! bloc grounding line
+
+ igrdline     =            0
+ Schoof       =            1
+ ibmelt_inv   =            0
+ /
+! igrdline :  1 ligne d echouage fixée, 3 recul forcé, 0 sans traitement specifique, 2 paleo gr line
+! Schoof   :  0 pas de Schoof, 1 flux de Schoof
+
+!___________________________________________________________
+&timesteps                ! bloc timestep
+
+ tend      =   RUNTEND
+ tbegin    =   RUNTBEGIN
+ dtmin     =   0.5e-3      ! 2.e-3 40km
+ dtmax     =   0.25        ! 1.    40km 
+ dtt	     =   0.5         ! 1.    40km
+ testdiag  =   0.008       !0.025  40km      !0.016     
+ /
+! tous les temps en annees. tbegin et tend : debut et fin du run 
+! pour equation masse, pas de temps mini -> dtmin, maxi -> dtmax
+! dtt : pas de temps long
+! testdiag, pour gerer le pas de temps dynamique dt
+! ordres de grandeur (a moduler selon dx) : 
+! 40 km dtmin=2.e-3, dtmax=1., dtt=5., tesdiag=0.02
+
+!___________________________________________________________
+&topo_file
+ topo_ref        = "SHB_etopo1_euras20.nc"
+ topo_dep        = "SHB_etopo1_euras20.nc"
+ grid_topo       = "coord-euras20.dat"
+ ghf_fich        = "ghf_euras20.nc"
+/
+! topo_ref= topo ref isostasie
+! topo_dep= topo de depart
+! grid_topo : fichier i,j,x,y,lon,lat
+! ghf_fich  : fichier flux geothermique
+!___________________________________________________________
+&mass_conserv            ! conservation de la masse
+adv_frac        =  2.    ! 2-> advection seule
+V_limit         = 5000.  ! maximum velocity for mass conservation : depend de la calotte
+/
+! Conservation de la masse avec equation advection-diffusion '
+! la repartition depend de adv_frac'
+! >1  -> advection seule'
+! 0   -> diffusion seule'
+! 0<*<1   -> fraction de l advection'
+! -1 -> zones diffusion + zones advecttion'
+! V_limit depend de la calotte : typiquement 3000 en Antarctique, 10000 au Groenland
+
+!--------------------------------------------------------------------
+&eaubasale1              ! nom du premier bloc eau basale 
+ 
+ ecoulement_eau =  T
+ hwatermax      =    5000.000    
+ infiltr        =   1.e-3   !1.0000001E-03
+ /
+! ecoulement eau : .false. -> modele bucket, sinon equ. diffusion
+! hwatermax :  hauteur d eau basale maximum dans le sediment (m)
+! infiltr est la quantite d eau qui peut s infiltrer dans le sol (m/an)
+
+!___________________________________________________________
+&param_hydr             ! nom du  bloc parametres hydrauliques 
+ 
+ hmax_till      =    20.00000    
+ poro_till      =   0.5000000    
+ kond0          =   0.000193342957286257   !10.000000E-05
+/
+! hmax_till (m) : epaisseur max du sediment 
+! poro_till : porosite du sediment 
+! conductivite du sediment :  kond0 (m/s)
+
+!____________________________________________________________
+&calving                        !   nom du bloc calving méthode Vincent
+
+Hcoup_plateau   =      250. !50     !   tres petit quand shelves fixes sinon 250
+Hcoup_abysses   =       250. !400     !   tres petit quand shelves fixes sinon 250
+prof_plateau   =       50. !100     !   tres petit quand shelves fixes sinon 250
+prof_abysses   =       1000. !800     !   tres petit quand shelves fixes sinon 250
+ifrange         =       4
+meth_Hcoup      =       0
+/
+
+! Hcoup epaisseurs de coupure pour les zones peu prodondes et profondes
+! Hcoup_plateau<Hcoup_abysses && prof_plateau<prof_abysse
+! prof profondeur delimitant les zones peu prodondes et profondes
+! ifrange=0 -> pas de traitement particulier sur les bords
+! ifrange=1 -> traitement de Vincent avec ice shelves frangeants
+! ifrange=2 -> ice shelves frangeant seulement si bm-bmelt positif
+! meth_hcoup pour faire eventuellement varier Hcoup avec le climat
+!____________________________________________________________
+! loi de deformation 1          module deformation_mod_2lois
+&loidef_1
+
+exposant_1       = 3.
+temp_trans_1     = -6.5
+enhanc_fact_1    = 1.82595387172575          ! Grice2sea 3.         
+coef_cold_1      = 1.660E-16
+Q_cold_1         = 7.820E+04
+coef_warm_1      = 2.000E-16
+Q_warm_1         = 9.545E+04
+/
+! exposant (glen), temperature de transition (ttrans)
+! enhancement factor (sf)
+! pour les temperatures inf. a Temp_trans :
+!            coef_cold (Bat1) et Q_cold (Q1)
+! pour les temperatures sup. a Temp_trans :
+!            coef_warm (Bat2) et Q_warm (Q2)
+!________________________________________________________ 
+! loi de deformation 2          module deformation_mod_2lois
+&loidef_2
+
+exposant_2       = 1.
+temp_trans_2     = -10.
+enhanc_fact_2    = 1.            ! Grice2sea 3.         
+coef_cold_2      = 8.313E-08
+Q_cold_2         = 4.000E+04
+coef_warm_2      = 8.313E-08
+Q_warm_2         = 6.000E+04
+/
+! exposant (glen), temperature de transition (ttrans)
+! enhancement factor (sf)
+! pour les temperatures inf. a Temp_trans :
+!            coef_cold (Bat1) et Q_cold (Q1)
+! pour les temperatures sup. a Temp_trans :
+!            coef_warm (Bat2) et Q_warm (Q2)
+!___________________________________________________________ 
+ 
+&diagno_rheol              ! nom du bloc  diagno_rheol
+
+sf01           = 	0.125   ! 0.125
+sf03           = 	0.125   ! 0.125
+pvimin         =        1.5e3   ! 1.e3
+/  
+! coefficients par rapport a la loi glace posee                        
+! sf01 : coefficient viscosite loi lineaire 
+! sf03 : coefficient viscosite loi n=3 
+! pvimin : valeur de pvi pour les noeuds fictifs ~ 1.e3
+! tres petit par rapport aux valeurs standards ~ 1.e10
+!___________________________________________________________ 
+
+! furst_schoof
+&furst_schoof
+
+frot_coef = 0.6   !0.035
+gr_select = 1
+/
+! frot_coef  = ',frot_coef
+! gr_select  = ',gr_select
+! gr_select = 1 : Tsai , 2 : Schoof'
+!___________________________________________________________
+&lapse_month                                  !  module climat_forcage_mois_mod'
+
+lect_lapse      = 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0  ! 12 mois
+/
+! laspe rates janvier -> decembre en deg/km
+!___________________________________________________________
+&clim_coupl_atm                                ! nom du bloc
+
+mincoefbmelt  =  0.
+maxcoefbmelt  =  2.
+filforc       = "forcage-429k-quiquet-et-al_CP2013_glacial-index_Waelbroeck_AMOC.dat" !"signal-cycle-hemin.dat" !""40k.dat" !"778k.dat"
+snow          =       .true.
+! mincoefbmelt : borne mini de coefbmshelf
+! maxcoefbmelt : borne maxi de coefbmshelf
+! filforc : fichier de forcage nivx des mers
+! snow   : .true. si neige, .false. si precip
+/
+!___________________________________________________________ 
+&ablation                                     !  module ablation_mod'
+
+pdd_type        = RUNPDDTYPE 
+annual          = .false.
+Cice            = 0.008
+Csnow           = 0.003
+csi             = 0.6
+sigma_ice       = 5.5
+/
+! pdd_type : 0 reeh, 1 Fausto, 2 Tarasov
+! annual : T = annuel, F = mensuel
+! Cice and Csnow, melting factors for ice and snow 
+! sigma variabilite Tday
+! csi proportion of melted water that can refreeze
+
+!___________________________________________________________ 
+&clim_pert                                    ! nom du bloc
+
+coefT           =       1.
+rappact		=	0.07                    ! 0.05->0.75  0.07 -> 0.5
+retroac		=	1
+rapbmshelf      =       5.  
+mincoefbmelt 	= 	0.
+maxcoefbmelt	= 	2.
+filforc         =     'forcage-900k-2007-Parrenin-Bassinot.dat' !'LGM_permanent.dat'
+/
+!___________________________________________________________ 
+&clim_pert_massb                                   ! nom du bloc
+
+coefT           =     0. ! 1.
+filforc         =   'forcage-429k-2007-Jouzel-Waelbroeck_AMOC.dat' ! 'quiquet-et-al_CP2013_forcage.dat' !'forcage-900k-2007-Parrenin-Bassinot.dat' !'LGM_permanent.dat'
+pertsmb		=     0  !1  !1
+rapsmb		=     0. !0.07 !7
+pertbmb		=     1
+coefbmb   =     10.
+/
+! pertsmb = 1, smb pert via tpert / pertsmb = 0, smb = cst
+!----------------------------------------------------------
+&meca_SIA_L1                        ! bloc resol_meca 
+
+i_resolmeca 	=	 2
+/
+! i_resolmeca type d association entre SIA et L1'
+! i_resolmeca=0  chacun dans sa zone'
+! i_resolmeca=1  dans les zones stream, addition si uxdef > uxL1 (MIS11 Cairns)
+! i_resolmeca=2  addition systematique dans les zones stream 
+
+!----------------------------------------------------------
+! pour le module tracer (suivi d'isotopes)
+&tracer
+file_tr_dat	= "../INPUT/tracer.dat"
+file_tr_out	= "../RESULTATS/tracer.out"
+file_tr_dep	= "../RESULTATS/deparchive.out"
+lambdab         = 0.0001
+agemax          = 1000000
+coefT_tra       = 1.
+rappact_tra	= 0.07
+filforc         = "quiquet-et-al_CP2013_forcage.dat" !"forcage-900k-2007-Parrenin-Bassinot.dat"
+pert_type	= 0
+/
+!----------------------------------------------------------
+!  module lect_climref_Ice2sea    
+&clim_smb_T_gen
+smb_file         = 'smb_MARv3.5.2-25km_1958_1989mean_hemin40.nc' !'smb_ERAI_MAR_highres_1989-2008mean_hemin40.nc'   ! smb (en kg/m2/an
+coef_smb_unit    = 1.0893e-3    ! 1.0989e-3          ! 1.0989e-3  pour1/910  1.0893e-3 pour 1/918 (valeur habituelle)
+temp_annual_file ='Tann-cism-hemin40.nc'                            ! annual surface temperature
+/
+!----------------------------------------------------------
+! module climat_Grice2sea_mod
+&lapse_rates
+T_lapse_rate     =  0. !-6.309e-3    ! celui pour la T annuelle de Fausto
+/
+!----------------------------------------------------------
+! module climat_forcage
+&clim_forcage
+clim_ref_file = 'climato_monthly_t2m_era_int_precip_GPCP_1979-1999_hemin40.nc'
+ttr = -21000, 0.
+forcage_file1 = 'IPSL-CM5A-LR-lgm-hemin40.nc' !'MIROC-ESM-lgm-hemin40.nc' !'MRI-CGCM3-lgm-hemin40.nc' !'MPI-ESM-P-lgm-hemin40.nc' !'FGOALS-g2-lgm-hemin40.nc' !'IPSL-CM5A-LR-lgm-hemin40.nc'
+forcage_file2 = 'IPSL-CM5A-LR-piControl-hemin40.nc' !'MIROC-ESM-piControl-hemin40.nc' !'MRI-CGCM3-piControl-hemin40.nc' !'MPI-ESM-P-piControl-hemin40.nc' !'FGOALS-g2-piControl-hemin40.nc' !'IPSL-CM5A-LR-piControl-hemin40.nc'
+typerun = 0
+lapserate = 0.007
+rappact = 0.11
+filforc = 'forcage-429k-quiquet-et-al_CP2013_glacial-index_Waelbroeck_AMOC.dat' !'forcage-429k-2007-Jouzel-Waelbroeck_AMOC.dat'
+pertbmb = 1
+coefT   = 1.
+coefbmb = 10.
+r_atmvar = RUNRATMVAR
+/
+!----------------------------------------------------------
+&clim_snap
+nb_snap           = 200
+time_depart_snaps = 2000000
+ecart_snap        = 1.
+file_smb_snap     = 'smb_ECHAM5_A1B_MAR_highres_all_time.nc'
+massb_time        = 0     ! 0=fixe, 1:interpolation snapshots
+/
+!----------------------------------------------------------
+&grad_smb                        !routine init_grad_smb 
+file_grad_smb     = 'GRISLI_gradients_MAR_00.txt'
+/
+!---------------------------------------------------------
+&imposed_regions_rsl               ! module  imposed_regions_rsl
+nb_reg           = 1
+filreg           = Hemin40_Hudson.grd
+filforc          = rsl_hudson_forc.txt
+/
+!
+!___________________________________________________________
+&bmelt_seuil                     ! module  bmelt_seuil_prof
+bm_grz           = 0.3      !3
+bmshelf_plateau  = 0.2        !0.4
+bmshelf_abysses  = 10.
+depth_talus      = -1000.
+/
+! Pour l actuel : bm_grz a la grounding line
+!                 bmshelf_plateau sur le plateau continental
+!                 bmshelf_abysses pour les grandes profondeurs
+!       depth_talus, negative, separation entre les 2 domaines
+!___________________________________________________________ 
+&beta_prescr                                   ! dragging_prescr_beta'
+beta_c_file = 'beta-GISCAM23_20ans.grd'        ! 'beta_Fab_10avril12_bord.grd'    ! 'beta_fab_comb_alpha_v4.grd'
+beta_limgz  = .5e6                             ! -1.e12 pour plastic ?    ! .5e6 en visqueux   
+beta_min    = 1 !10.                           ! for grounded ice (Pa)
+beta_mult   = 1.                               ! coefficient multiplicateur    
+/
+! read beta on centered grid
+! beta_file : nom des fichiers qui contiennent les betamx et betamy
+! beta-estime-run07.dat calcul direct beta sans modif 
+! beta-staggered-15km-opt1.dat premier test en utilisant beta calcule  avec iterations
+! above beta_limgz, gzmx is false if negative : no sliding
+! betamx_file = not read anymore
+! betamy_file = not read anymore
+!___________________________________________________________
+&beta_iter_vitbil                              ! beta_iter_vitbil
+
+time_iter      = 5                             ! temps de demarrage des iterations
+nb_iter_vitbil = 2                             ! nombre d'iterations par pas de temps (dtt)
+coef_iter_vitbil = 1.                          ! coefficient pour rapport des vitesses <=1
+Umag_bil_file  = 'ebauche_vitbil_GrIce2sea.grd'  ! fichier des vitesses de bilan centrees
+time_reiter    = 200.                          ! temps entre 2 iterations
+/
+!
+!___________________________________________________________
+&drag_param_beta                              ! drag_beta_param_mod
+
+beta_slope     = 0.001584297807517     !1.e-3
+beta_expo      = 1.      !1.0
+betamax    = 5.e5     ! maximum value of beta
+betamin    = 100. !10.   ! minimum value of beta
+coef_ile   = 1.
+/
+!
+!___________________________________________________________
+&drag_param_beta_sedim                       ! drag_beta_param_sedim_mod
+
+beta_slope    = 0.001584297807517    !1.e-3
+beta_expo     = 1.     !1.0
+betamax    = 5.e5     ! maximum value of beta
+betamin    = 100. !10.   ! minimum value of beta
+coef_ile   = 1
+file_sedim  = 'sediment_ij_hemin40.grd'
+seuil_sedim = 200.
+coef_sedim  = 1.e-1
+/
+!
+!___________________________________________________________
+&spinup                                ! warning : 2 different modules
+ispinup = 0
+/
+! with module no_spinup
+! ispinup = 0     run standard ou calcul du beta
+! ispinup = 1     temperature equilibrium with grisli velocities'
+!
+! with module spinup_vitbil
+! ispinup = 2     conservation de la masse avec vitesses bilan '
+! ispinup = 3     equilibre temperature avec vitesses bilan'
+!
+!___________________________________________________________
+&vitbil_upwind             ! nom du bloc vitbil calcule sur le mailles staggered
+balance_Ux_file = 'Uy_moy_stag_5km.nc'
+balance_Uy_file = 'Ux_moy_stag_5km.nc'
+/
+!balance_Ux_file = 'Ux_moy_stag_5km.nc'
+!balance_Uy_file = 'Uy_moy_stag_5km.nc'
+!balance_vel_file = 'Umoy-for-calc-beta_LBq15-06_ZBL_15km.dat'
+! balance_vel_file = 'Uslid-for-calc-beta_LBq15-06_ZBL_15km.dat'
+! balance_vel_file = 'Umoy-for-calc-beta_LBq15-06_ZBL_15km.dat'
+! balance_vel_file = 'Vitbil-stag-pour-spinup_merge_runs_Lbq_ZBL_15km.dat'
+! balance velocities on staggered grid Ux, Uy 
+!___________________________________________________________
+&output_regions
+nbregions       = 7
+region_file     = 'Basins_Greenland_aurel.grd'
+/
+! nbregions   = nombre de regions
+! region_file = carte des regions
+!_______________________________________________________________________________
Index: trunk/lauching_area/go_euras20_PMIP.sh
===================================================================
--- trunk/lauching_area/go_euras20_PMIP.sh	(revision 300)
+++ trunk/lauching_area/go_euras20_PMIP.sh	(revision 300)
@@ -0,0 +1,202 @@
+#!/bin/bash
+# script pour lancer une deglaciation Euras-20
+
+# name of the run:
+#IPSL
+namerun="DGL-EURAS-IPSL"
+#namerun="DGL-IPSL-atm1-pdd2"  #Tsai
+#namerun="DGL-IPSL-atm1-pdd2-Schoof" # Schoof
+#namerun="DGL-IPSL-atm1-pdd2-rap0.07-lap7"  #rappact 0.07
+#namerun="DGL-IPSL-atm1-pdd2-rap0.07-lap7-50k"  # restart -50k 
+#namerun="DGL-IPSL-atm0-pdd2-rap0.11-lap7-psolid-sigma5.5" #  psolid=0 et sigma=5.5
+#namerun="DGL-IPSL-atm0.75-pdd2-rap0.11-lap7-psolid-sigma5.5-calv0"
+#namerun="DGL-IPSL-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake50" # -lake-1000 50 
+#namerun="DGL-IPSL-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-lake-1000" # sediment + rapides
+#namerun="DGL-IPSL-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5"
+#FGOALS
+#namerun="DGL-FGOA-atm0-pdd2"  #Tsai
+#namerun="DGL-FGOA-atm1-pdd2-Schoof" # Schoof
+#namerun="DGL-FGOA-atm1-pdd2-rap0.07"  #rappact 0.07
+#namerun="DGL-FGOA-atm1-pdd2-rap0.07-lap7-50k"  # restart -50k 
+#namerun="DGL-FGOA-atm0-pdd2-rap0.11-lap7-psolid-sigma5.5" #  psolid=0
+#namerun="DGL-FGOA-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake-1000" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200
+#namerun="DGL-FGOA-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" # sediment + rapides
+#namerun="DGL-FGOA-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5"
+#MPI
+#namerun="DGL-MPI--atm1-pdd2"  #Tsai
+#namerun="DGL-MPI--atm0-pdd2-Schoof" # Schoof
+#namerun="DGL-MPI--atm1-pdd2-rap0.07-lap7"   #rappact 0.07
+#namerun="DGL-MPI--atm1-pdd2-rap0.07-lap7-50k"  # restart -50k
+#namerun="DGL-MPI--atm0-pdd2-rap0.11-lap7-psolid-sigma5.5"  #psolid=0 sigma=5.5
+#namerun="DGL-MPI--atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake50" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200
+#namerun="DGL-MPI--atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-lake-1000" # sediment + rapides
+#namerun="DGL-MPI--atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5"
+#namerun="DGL-MPI--atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-calv0"
+#MRI
+#namerun="DGL-MRI--atm0-pdd1"  #Tsai
+#namerun="DGL-MRI--atm0-pdd1-Schoof" # Schoof
+#MIROC
+#namerun="DGL-MIROC-atm0-pdd2"  #Tsai
+#namerun="DGL-MIROC-atm1-pdd2-Schoof" # Schoof
+#namerun="DGL-MIROC-atm1-pdd2-rap0.07-lap7"   #rappact 0.07
+#namerun="DGL-MIROC-atm1-pdd2-rap0.07-lap7-50k"   #restart -50k
+#namerun="DGL-MIROC-atm0-pdd2-rap0.11-lap7-psolid-sigma5.5"   # psolid=0 sigma=5.5
+#namerun="DGL-MIROC-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake-1000" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200
+#namerun="DGL-MIROC-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" # sediment + rapides
+#namerun="DGL-MIROC-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5"
+#GISS
+#namerun="DGL-GISS-atm1-pdd2-rap0.11-lap7-psolid-sigma5.5"   # psolid=0 sigma=5.5
+#namerun="DGL-GISS-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake50" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200
+#namerun="DGL-GISS-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-lake-1000-out" # sediment + rapides
+#namerun="DGL-GISS-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5"
+
+
+tmodelend="0."
+tmodelbegin="-26000."
+#tmodelbegin="-50000."
+tmodellength="26000."
+#tmodellength="50000."
+runatmvar="0.25"
+runpdd="2"
+
+parallel="yes" # "yes or no?"
+
+#Revision number :
+rev=`svn info | grep "RÃ©visionÂ : " | awk '{print $2}'`
+echo "Code revision svn "$rev
+
+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:
+#--------------------------------------------------
+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/euras_TEMPS-NETCDF-degla.dat" $MODEL"/Fichiers-parametres/euras20_TEMPS-NETCDF.dat"
+cp "degla_PMIP_euras20_param_list.dat" $RUNDIR"/bin/euras20_param_list.dat"
+
+if [ $parallel = "yes" ]; then
+  cp "Master-files/grisli.run.openmp_euras20" $RUNDIR"/bin/grisli.run"
+else
+  cp "Master-files/grisli.run_euras20" $RUNDIR"/bin/grisli.run"
+fi
+
+cd $RUNDIR"/INPUT"
+ln -sf ${GRISLI_DIR}"/INPUT/EURASIE20" .
+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/euras20_param_list.dat"
+sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/euras20_param_list.dat"
+sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/euras20_param_list.dat"
+sed -i "s/RUNRATMVAR/$runatmvar/" $RUNDIR"/bin/euras20_param_list.dat"
+sed -i "s/RUNPDDTYPE/$runpdd/" $RUNDIR"/bin/euras20_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"
+
+# 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 "-------------------------------------"
