Index: trunk/LMDZ.MARS/changelog.txt
===================================================================
--- trunk/LMDZ.MARS/changelog.txt	(revision 3576)
+++ trunk/LMDZ.MARS/changelog.txt	(revision 3580)
@@ -4749,2 +4749,5 @@
 Fixing bug in soilwater: the specific surface area was missing in the
 expression of the adsorption rate when choice_ads = 2.
+
+== 15/01/2025 == JBC
+Improvement of Bash scripts for the 1D in the deftank with an automatic error detection which ends the script with a message.
Index: trunk/LMDZ.MARS/deftank/launch_1Dchained.sh
===================================================================
--- trunk/LMDZ.MARS/deftank/launch_1Dchained.sh	(revision 3576)
+++ trunk/LMDZ.MARS/deftank/launch_1Dchained.sh	(revision 3580)
@@ -3,4 +3,7 @@
 ### Launching script for a chained simulation of 1D PCM runs ###
 ################################################################
+set -e
+trap 'echo -e "\033[31mError: an issue occurred in the script on line $LINENO! Please review the command and try again.\033[0m"' ERR
+
 
 echo "The launching script is starting!"
@@ -13,25 +16,23 @@
 fi
 
-# A few parameters that might need be changed depending on your setup:
-# Path to the arch.env to source:
-source ../trunk/LMDZ.COMMON/arch.env
-
 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator
 OLD_LC_NUMERIC=$LC_NUMERIC
 LC_NUMERIC=en_US.UTF-8
 
+################################################################
+# Modify here the parameters for the simulation
+###############################################
+# Path to the arch.env to source:
+source ../trunk/LMDZ.COMMON/arch.env
 
-################################################################
-#---------- Modify here the number of years to be simulated ------------
-## set the number of Martian years:
+# Set the number of Martian years to be simulated:
 n_myears=1000
 
-#------------------ Modify here the name of PCM exe --------------------
-## fill in the name of executable for PCM:
+# Name of executable for the PCM:
 exePCM="testphys1d_29_phymars_seq.e"
 ################################################################
 
 
-#------ Check if files/directories necessary for the script exist ------
+# Check if files/directories necessary for the script exist
 dir=`pwd`
 machine=`hostname`
@@ -51,5 +52,5 @@
 fi
 
-#---------------------------- Initialization ---------------------------
+# Initialization
 dir=`pwd`
 machine=`hostname`
@@ -68,5 +69,5 @@
 fi
 
-#---------------- Main loop to to run PCM year by year -----------------
+# Main loop to to run PCM year by year
 while [ $i_myear -lt $n_myears ]; do
     # Run the PCM
Index: trunk/LMDZ.MARS/deftank/launch_orb_1Dchained.sh
===================================================================
--- trunk/LMDZ.MARS/deftank/launch_orb_1Dchained.sh	(revision 3576)
+++ trunk/LMDZ.MARS/deftank/launch_orb_1Dchained.sh	(revision 3580)
@@ -4,4 +4,6 @@
 ###                following orbital changes                 ###
 ################################################################
+set -e
+trap 'echo -e "\033[31mError: an issue occurred in the script on line $LINENO! Please review the command and try again.\033[0m"' ERR
 
 echo "The launching script is starting!"
@@ -14,33 +16,29 @@
 fi
 
-# A few parameters that might need be changed depending on your setup:
-# Path to the arch.env to source:
-source ../trunk/LMDZ.COMMON/arch.env
-
 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator
 OLD_LC_NUMERIC=$LC_NUMERIC
 LC_NUMERIC=en_US.UTF-8
 
+################################################################
+# Modify here the parameters for the simulation
+###############################################
+# Path to the arch.env to source:
+source ../trunk/LMDZ.COMMON/arch.env
 
-################################################################
-#--------- Modify here the number of years for initialization ----------
-## set the number of Earth years before present to start:
+# Set the number of Earth years before present to start:
 eyears_bp_ini=-1000
 
-#---------- Modify here the number of years to be simulated ------------
-## set the number of Martian years:
+# Set the number of Martian years to be simulated:
 n_myears=500
 
-#------------------ Modify here the name of PCM exe --------------------
-## fill in the name of executable for PCM:
+# Name of executable for the PCM:
 exePCM="testphys1d_29_phymars_para.e"
 
-#----------- Modify here the name of the orbital data file -------------
-## fill in the name of executable for PCM:
+# Name of the orbital data file:
 orb_data="obl_ecc_lsp.asc"
 ################################################################
 
 
-#------ Check if files/directories necessary for the script exist ------
+# Check if files/directories necessary for the script exist
 dir=`pwd`
 machine=`hostname`
@@ -68,5 +66,5 @@
 fi
 
-#---------------------------- Initialization ---------------------------
+# Initialization
 dir=`pwd`
 machine=`hostname`
@@ -85,5 +83,5 @@
 fi
 
-#---------------- Main loop to to run PCM year by year -----------------
+# Main loop to to run PCM year by year
 while [ $i_myear -lt $n_myears ]; do
     # Get the new values for the orbital parameters
