Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/callphys.def
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/callphys.def	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/callphys.def	(revision 1552)
@@ -30,5 +30,5 @@
 #  =24 Mars Year 24  ; =25 Mars Year 25 (year with a global dust storm) ; ...
 #  =30 Mars Year 30 
-iaervar = 29
+iaervar = 8
 # Dust opacity at 610 Pa (when constant, i.e. for the iaervar=1 case)
 tauvis=0.1
Index: unk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/code
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/code	(revision 1551)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../SRC
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_gcm
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_gcm	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_gcm	(revision 1552)
@@ -1,1 +1,1 @@
-link /home/spiga/data/2015_GCM_MARS/STARTBASE_MY29/tmpsave
+link gcm/newstart/startbase_clim_mini
Index: unk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_static
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_static	(revision 1551)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link code/MESOSCALE/LMD_MM_MARS/WPS_GEOG
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_static.lk
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_static.lk	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/data_static.lk	(revision 1552)
@@ -0,0 +1,1 @@
+link code/MESOSCALE/LMD_MM_MARS/WPS_GEOG
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/gcm.e
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/gcm.e	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/gcm.e	(revision 1552)
@@ -1,1 +1,1 @@
-link ../code/LMDZ.COMMON/bin/gcm_64x48x35_phymars_para.e
+link ../code/LMDZ.COMMON/bin/gcm_64x48x29_phymars_para.e
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/callphys.def
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/callphys.def	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/callphys.def	(revision 1552)
@@ -0,0 +1,1 @@
+link ../callphys.def
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/data_physics
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/data_physics	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/data_physics	(revision 1552)
@@ -0,0 +1,1 @@
+link ../data_physics
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/gcm.e
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/gcm.e	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/gcm.e	(revision 1552)
@@ -0,0 +1,1 @@
+link ../gcm.e
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/launch.ciclad.startbase
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/launch.ciclad.startbase	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/launch.ciclad.startbase	(revision 1552)
@@ -0,0 +1,10 @@
+#PBS -S  /bin/bash
+#PBS -j  oe
+#PBS -q  week
+#PBS -N  startbase
+#PBS -l  nodes=1:ppn=16
+#PBS -l  mem=64gb
+#PBS -l  vmem=64gb
+cd $PBS_O_WORKDIR
+ulimit -s unlimited
+./run_mcd_3days > log_run_mcd_3days
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run.def
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run.def	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run.def	(revision 1552)
@@ -0,0 +1,1 @@
+link ../run.def
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run0
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run0	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run0	(revision 1552)
@@ -0,0 +1,102 @@
+#!/bin/bash
+###########################################################################
+# Script to perform several chained LMD Mars GCM simulations
+# SET HERE the maximum total number of simulations
+
+nummax=1
+
+###########################################################################
+
+
+echo "---------------------------------------------------------"
+echo "starting run0"
+
+dir=`pwd`
+machine=`hostname`
+address=`whoami`
+
+# Look for file "num_run" which should contain 
+# the value of the previously computed season
+# (defaults to 0 if file "num_run" does not exist)
+if [[ -r num_run ]] ; then
+  echo "found file num_run"
+  numold=`cat num_run`
+else
+  numold=0
+fi
+echo "numold is set to" ${numold}
+
+
+# Set value of current season 
+(( numnew = ${numold} + 1 ))
+echo "numnew is set to" ${numnew}
+
+# Look for initialization data files (exit if none found)
+if [[ ( -r start${numold}.nc  &&  -r startfi${numold}.nc ) ]] ; then
+   \cp -f start${numold}.nc start.nc
+   \cp -f startfi${numold}.nc startfi.nc
+else
+   if (( ${numold} == 99999 )) ; then
+    echo "No run because previous run crashed ! (99999 in num_run)"
+    exit
+   else
+   echo "Where is file start"${numold}".nc??"
+   exit
+   fi
+fi
+
+
+# Run GCM
+$WHERE_MPI/mpirun gcm.e > lrun${numnew} 
+
+
+# Check if run ended normaly and copy datafiles
+if [[ ( -r restartfi.nc  &&  -r restart.nc ) ]] ; then
+  echo "Run seems to have ended normaly"
+  \mv -f restartfi.nc startfi${numnew}.nc
+  \mv -f restart.nc start${numnew}.nc
+else
+  if [[ -r num_run ]] ; then
+    \mv -f num_run num_run.crash
+  else
+    echo "No file num_run to build num_run.crash from !!"
+    # Impose a default value of 0 for num_run
+    echo 0 > num_run.crash
+  fi
+ echo 99999 > num_run
+############## To receive an Email message if the run crashes ########
+mail -s "crash run GCM" $address <<ENDMAIL
+The run on $machine in $dir has just crashed.
+ENDMAIL
+############################################"" 
+ exit
+fi
+
+# Copy other datafiles that may have been generated
+if [[ -r diagfi.nc ]] ; then
+  \mv -f diagfi.nc diagfi${numnew}.nc
+fi
+if [[ -r diagsoil.nc ]] ; then
+  \mv -f diagsoil.nc diagsoil${numnew}.nc
+fi
+if [[ -r stats.nc ]] ; then
+  \mv -f stats.nc stats${numnew}.nc
+fi
+if [[ -f profiles.dat ]] ; then
+  \mv -f profiles.dat profiles${numnew}.dat
+  \mv -f profiles.hdr profiles${numnew}.hdr
+fi
+
+# Prepare things for upcoming runs by writing
+# value of computed season in file num_run
+echo ${numnew} > num_run
+
+# If we are over nummax : stop
+if (( $numnew + 1 > $nummax )) ; then
+   exit
+else
+   \cp -f run0 exe_mars
+   ./exe_mars
+fi 
+
+
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run0.ref
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run0.ref	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run0.ref	(revision 1552)
@@ -0,0 +1,1 @@
+link ../../code/LMDZ.MARS/deftank/run0
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run_mcd_3days
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run_mcd_3days	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/run_mcd_3days	(revision 1552)
@@ -0,0 +1,60 @@
+#! /bin/bash
+
+#
+# - please link or copy start0.nc and startfi.nc (or start_archive.nc)
+# - please set 3 in the first parameter of run.def
+# - please set 0 in the first line of num_run 
+# - please set daylim below (669 for the whole year)
+#
+
+##########
+daylim=669
+##########
+
+rm -rf tmpsave
+mkdir tmpsave
+
+runnum=0 ## 0 whatever, this is just the way one counts successive runs
+runnum_obsolete=0
+daynum=0 #61 #0 
+
+while [ ${daynum} -lt ${daylim} ]  
+do
+	# run GCM during three days
+	echo run starting at day ${daynum}
+	echo '****'
+	time run0 
+
+	# save generated starting files 
+	echo saving files
+	echo '****'
+	runnum=$(expr ${runnum} + 1)
+        save=$(expr ${daynum} + 2)
+	cp start${runnum}.nc tmpsave/start${save}.nc
+        cp startfi${runnum}.nc tmpsave/startfi${save}.nc
+	mv lrun${runnum} tmpsave/lrun_for_start${save}
+
+	# increment day to day+3 for while loop assessement
+	daynum=$(expr ${daynum} + 3)
+
+        # get rid of what was generated two steps before
+	echo cleaning
+	echo '****'
+	if [ ${runnum} -gt 1 ]	#because we want to keep start0.nc and startfi0.nc
+	then
+	runnum_obsolete=$(expr ${runnum} - 1)
+	rm -rf start${runnum_obsolete}.nc
+	rm -rf startfi${runnum_obsolete}.nc
+	rm -rf diagfi${runnum_obsolete}.nc
+	fi
+done
+
+# clean the last files
+rm -rf start${runnum}.nc
+rm -rf startfi${runnum}.nc
+rm -rf diagfi${runnum}.nc
+
+# end
+echo -- end --
+echo please check results in file tmpsave
+echo if you want to keep the results, rename this folder
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/start0.nc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/start0.nc	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/start0.nc	(revision 1552)
@@ -0,0 +1,1 @@
+link ../newstart/startbase_clim_mini/start0.nc
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/startfi0.nc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/startfi0.nc	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/startfi0.nc	(revision 1552)
@@ -0,0 +1,1 @@
+link ../newstart/startbase_clim_mini/startfi0.nc
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/traceur.def
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/traceur.def	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/traceur.def	(revision 1552)
@@ -0,0 +1,1 @@
+link ../traceur.def
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/z2sig.def
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/z2sig.def	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/make_startbase/z2sig.def	(revision 1552)
@@ -0,0 +1,1 @@
+link ../z2sig.def
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/get_starts.sh
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/get_starts.sh	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/get_starts.sh	(revision 1552)
@@ -0,0 +1,12 @@
+#! /bin/bash
+
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY24.nc
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY25.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY26.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY27.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY28.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY29.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY30.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY31.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_clim.nc 
+wget http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/README
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/mini_startbase.sh
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/mini_startbase.sh	(revision 1552)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/mini_startbase.sh	(revision 1552)
@@ -0,0 +1,36 @@
+#! /bin/bash
+
+########################
+# make a minimum startbase 
+# with what is 
+# in start_archive.nc file for clim scenario
+# downloaded from the server (reference MCD 5.2)
+########################
+
+scen="clim" # the one set in callphys.def
+
+namefolder="startbase_"$scen"_mini"
+
+\rm -rf startbase_clim_mini
+mkdir startbase_clim_mini
+
+\rm start_archive_64x48x49_$scen.nc
+wget -q http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_$scen.nc
+ln -sf start_archive_64x48x49_$scen.nc start_archive.nc
+
+echo -e "0\n \n0\n \n" | newstart.e > $namefolder/log0 2> $namefolder/log0
+mv restart.nc $namefolder/start0.nc
+mv restartfi.nc $namefolder/startfi0.nc
+
+echo -e "0\n \n193\n \n" | newstart.e > $namefolder/log193 2> $namefolder/log193
+mv restart.nc $namefolder/start193.nc
+mv restartfi.nc $namefolder/startfi193.nc
+
+echo -e "0\n \n372\n \n" | newstart.e > $namefolder/log372 2> $namefolder/log372
+mv restart.nc $namefolder/start372.nc
+mv restartfi.nc $namefolder/startfi372.nc
+
+echo -e "0\n \n515\n \n" | newstart.e > $namefolder/log515 2> $namefolder/log515
+mv restart.nc $namefolder/start515.nc
+mv restartfi.nc $namefolder/startfi515.nc
+
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/start_archive.nc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/start_archive.nc	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/start_archive.nc	(revision 1552)
@@ -1,1 +1,1 @@
-link start_archive_64x48x49_MY29.nc
+link start_archive_64x48x49_clim.nc
Index: unk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/www_for_starts
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/newstart/www_for_starts	(revision 1551)
+++ 	(revision )
@@ -1,1 +1,0 @@
-http://www.lmd.jussieu.fr/~lmdz/planets/mars/starts/start_archive_64x48x49_MY29.nc
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/run.def
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/run.def	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/run.def	(revision 1552)
@@ -8,5 +8,5 @@
    
 # Nombre de jours d'integration                                         
-     nday=1
+     nday=3
 
 # nombre de pas par jour (multiple de iperiod) ( ici pour  dt = 1 min )      
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/start.nc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/start.nc	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/start.nc	(revision 1552)
@@ -1,1 +1,1 @@
-link ./startbase//start257.nc
+link startbase/start193.nc
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/startfi.nc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/startfi.nc	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/startfi.nc	(revision 1552)
@@ -1,1 +1,1 @@
-link ./startbase//startfi257.nc
+link startbase/startfi193.nc
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/launch
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/launch	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/launch	(revision 1552)
@@ -27,5 +27,5 @@
   echo ${daygcm} | ./launch_gcm
   #
-  mpirun gcm.e > log_gcm
+  $WHERE_MPI/mpirun gcm.e > log_gcm
   #
   cd $PBS_O_WORKDIR/prep
@@ -66,4 +66,4 @@
   cd $PBS_O_WORKDIR/$PBS_JOBNAME/
   ln -sf $PBS_O_WORKDIR/data_physics ./
-  mpirun wrf.exe
+  $WHERE_MPI/mpirun wrf.exe
 fi
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/namelist.input
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/namelist.input	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/namelist.input	(revision 1552)
@@ -1,9 +1,9 @@
  &time_control
  start_year       = 2024,    !! (p1) Start Martian Year (20XX for MY XX)
- start_month      = 05,      !! (p1) Start Martian Month
+ start_month      = 04,      !! (p1) Start Martian Month
  start_day        = 01,      !! (p1) Start Martian Day
  start_hour       = 06,      !! (p1) Start Martian Hour (at longitude 0)
  end_year         = 2024,    !! (p1) End Martian Year (20XX for MY XX)
- end_month        = 05,      !! (p1) End Martian Month
+ end_month        = 04,      !! (p1) End Martian Month
  end_day          = 01,      !! (p1) End Martian Day
  end_hour         = 12,      !! (p1) End Martian Hour (at longitude 0)
Index: /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/namelist.wps
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/namelist.wps	(revision 1551)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/namelist.wps	(revision 1552)
@@ -2,6 +2,6 @@
  wrf_core = 'ARW',                    !!   [do not modify: choice of dynamical core]
  max_dom = 1 !! (r)(n)(p2) Total number of domains
- start_date = '2024-05-01_06:00:00' !! YYYY-MM-DD_HH:mm:ss start date
- end_date   = '2024-05-01_12:00:00' !! YYYY-MM-DD_HH:mm:ss end date
+ start_date = '2024-04-01_06:00:00' !! YYYY-MM-DD_HH:mm:ss start date
+ end_date   = '2024-04-01_12:00:00' !! YYYY-MM-DD_HH:mm:ss end date
  interval_seconds = 3700 !! (p2) Frequency of large-scale fields update (s)
  io_form_geogrid = 2,                 !!   [do not modify: choice of NETCDF outputs]	
