Index: trunk/LMDZ.COMMON/libf/evolution/deftank/README
===================================================================
--- trunk/LMDZ.COMMON/libf/evolution/deftank/README	(revision 3349)
+++ trunk/LMDZ.COMMON/libf/evolution/deftank/README	(revision 3351)
@@ -41,4 +41,7 @@
   Bash script file to concatenate along the variable 'Time' all the "diagpem.nc" files of the PEM into one NetCDF file. 'Time' is re-indexed with the numbering of Martian years simulated by the PEM run.
 
+# clean.sh:
+  Bash script file to clean the folder after a PEM simulation.
+
 # output_layering.py:
   Python script file to output the stratification data from the "startpem.nc" files.
Index: trunk/LMDZ.COMMON/libf/evolution/deftank/clean.sh
===================================================================
--- trunk/LMDZ.COMMON/libf/evolution/deftank/clean.sh	(revision 3351)
+++ trunk/LMDZ.COMMON/libf/evolution/deftank/clean.sh	(revision 3351)
@@ -0,0 +1,35 @@
+#!/bin/bash
+#########################################################
+### Script to clean the folder after a PEM simulation ###
+#########################################################
+
+echo "Cleaning..."
+rm Bands*.dat
+rm data2reshape*
+rm data_PCM_Y*
+rm info_PEM.txt
+find . -type f -name "jobPCM*.slurm" ! -name "jobPCM.slurm" -delete
+rm *.out
+rm kill_launchPEM.sh
+rm log_launchPEM.txt
+rm out_run*
+rm run.def
+rm start*.nc
+rm used_*
+rm Xdiurnalave.nc
+rm xios_client_*
+rm diag*.nc
+rm restart*.nc
+rm restart1D*.txt
+rm start1D*.txt
+cp starts/startfi.nc .
+if [ -f "starts/start.nc" ]; then
+    cp starts/start.nc .
+elif [ -f "starts/start1D.txt" ]; then
+    cp starts/start1D.txt .
+fi
+rm diags/*
+rm starts/*
+rm out_PCM/*
+rm out_PEM/*
+echo "Done!"
Index: trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh
===================================================================
--- trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh	(revision 3349)
+++ trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh	(revision 3351)
@@ -32,5 +32,5 @@
 
 # Get the new values for the orbital parameters
-yearlask=$(echo "$eyears_bp_ini" | bc -l)
+yearlask=$(echo "$eyears_bp_ini/1000." | bc -l)
 found=false
 read -r y1 obl1 ecc1 lsp1 < "$orb_data"
Index: trunk/LMDZ.COMMON/libf/evolution/deftank/jobPCM.slurm
===================================================================
--- trunk/LMDZ.COMMON/libf/evolution/deftank/jobPCM.slurm	(revision 3349)
+++ trunk/LMDZ.COMMON/libf/evolution/deftank/jobPCM.slurm	(revision 3351)
@@ -6,13 +6,13 @@
 ### Number of Nodes to use
 #SBATCH --nodes=1
-#SBATCH --ntasks-per-node=12
+#SBATCH --ntasks-per-node=24
 #SBATCH --cpus-per-task=4
 #SBATCH --threads-per-core=1 # --hint=nomultithread
 ###SBATCH --exclusive
 #SBATCH --output=jobPCM_%A.out
-#SBATCH --time=10:00:00
+#SBATCH --time=12:00:00
 
-# A few parameters that might need be changed depending on your setup:
-# Path to the arch.env to source
+# A few parameters that might need to be changed depending on your setup
+# Path to the arch.env to source:
 source ../trunk/LMDZ.COMMON/arch.env
 
@@ -21,13 +21,15 @@
 export OMP_STACKSIZE=400M
 
+# Name of executable for the PCM:
+exePCM="gcm_64x48x32_phymars_para.e"
+########################################################################
+
+
+echo "Run PCM $iPCM is starting."
 read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
 cp run_PCM.def run.def
+srun --cpu-bind=threads --label -c${OMP_NUM_THREADS:=1} $exePCM > out_runPCM${iPCM} 2>&1
 
-echo "Run PCM $iPCM is starting."
-########################################################################
-srun --cpu-bind=threads --label -c${OMP_NUM_THREADS:=1} gcm_32x24x26_phymars_para.e > out_runPCM${iPCM} 2>&1
-########################################################################
-
-if [ ! -f "restartfi.nc" ] || [ ! tail -n 1 out_runPCM${iPCM} | grep -iq "everything is cool" ]; then # Check if it ended abnormally
+if [ ! -f "restartfi.nc" ] || [ ! tail -n 1 out_runPCM${iPCM} | grep -iq "everything is cool!" ]; then # Check if it ended abnormally
     echo "Error: the run PCM $iPCM crashed!"
     echo "Be careful: there may be dependent jobs remaining in the SLURM queue with status 'DependencyNeverSatisfied'! You can cancel them by executing the script \"kill_launchPEM.sh\"."
Index: trunk/LMDZ.COMMON/libf/evolution/deftank/jobPEM.slurm
===================================================================
--- trunk/LMDZ.COMMON/libf/evolution/deftank/jobPEM.slurm	(revision 3349)
+++ trunk/LMDZ.COMMON/libf/evolution/deftank/jobPEM.slurm	(revision 3351)
@@ -1,4 +1,4 @@
 #!/bin/bash
-#SBATCH --job-name=jobPEM2
+#SBATCH --job-name=jobPEM1
 #SBATCH --account=cin0391
 ### GENOA nodes accommodate 96 cores
@@ -11,28 +11,30 @@
 ###SBATCH --exclusive
 #SBATCH --output=jobPEM_%A.out
-#SBATCH --time=1:00:00
+#SBATCH --time=24:00:00
 
-# A few parameters that might need be changed depending on your setup:
-# Path to the arch.env to source
+# A few parameters that might need to be changed depending on your setup
+# Path to the arch.env to source:
 source ../trunk/LMDZ.COMMON/arch.env
 
-read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
-cp run_PEM.def run.def
+# Name of executable for the PEM:
+exePEM="pem_64x48x32_phymars_seq.e"
+
+# Name of executable for reshaping PCM data with XIOS:
+exeReshape="reshape_XIOS_output_64x48x32_phymars_seq.e"
+########################################################################
+
 
 echo "Reshaping PCM data with XIOS is starting."
-########################################################################
-./reshape_XIOS_output_32x24x26_phymars_seq.e
-########################################################################
-
+./$exeReshape
 if [ ! -f "data_PCM_Y1.nc" ] || [ ! -f "data_PCM_Y2.nc" ]; then # Check if it ended abnormally
     echo "Error: the reshaping executable crashed!"
     exit 1
 fi
+
 echo "Run PEM $iPEM is starting."
-########################################################################
-./pem_32x24x26_phymars_seq.e > out_runPEM${iPEM} 2>&1
-########################################################################
-
-if [ ! -f "restartfi.nc" ] || [ ! tail -n 1 out_runPEM${iPEM} | grep -iq "so far, so good" ]; then # Check if it ended abnormally
+read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
+cp run_PEM.def run.def
+./$exePEM > out_runPEM${iPEM} 2>&1
+if [ ! -f "restartfi.nc" ] || [ ! tail -n 1 out_runPEM${iPEM} | grep -iq "so far, so good!" ]; then # Check if it ended abnormally
     echo "Error: the run PEM $iPEM crashed!"
     exit 1
