Index: /trunk/LMDZ.COMMON/libf/evolution/changelog.txt
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/changelog.txt	(revision 3209)
+++ /trunk/LMDZ.COMMON/libf/evolution/changelog.txt	(revision 3210)
@@ -232,2 +232,6 @@
 == 08/02/2024 == JBC
 Cleanings of unused variables/arguments and bad type conversions.
+
+== 09/02/2024 == JBC
+- Addition in the deftank of a bash script "modify_startfi_var.sh" to modify the value of a variable in a "startfi.nc".
+- Small corrections due to r3206.
Index: /trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90	(revision 3209)
+++ /trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90	(revision 3210)
@@ -63,5 +63,5 @@
 year_bp_ini = 0.
 call getin('year_earth_bp_ini',year_earth_bp_ini)
-year_bp_ini = integer(year_earth_bp_ini/convert_years)
+year_bp_ini = int(year_earth_bp_ini/convert_years)
 
 var_obl = .true.
Index: /trunk/LMDZ.COMMON/libf/evolution/deftank/concat_diagpem.sh
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/deftank/concat_diagpem.sh	(revision 3209)
+++ /trunk/LMDZ.COMMON/libf/evolution/deftank/concat_diagpem.sh	(revision 3210)
@@ -18,4 +18,6 @@
 output_file=($directory/$output_file)
 
+
+################################################################
 # Checking if everything is ok
 if [ ! -d "$directory" ]; then
Index: /trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh	(revision 3209)
+++ /trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh	(revision 3210)
@@ -11,4 +11,6 @@
 orb_data="obl_ecc_lsp.asc"
 
+
+######################################################################
 # Check if files necessary for the script exist
 if [ ! -f "$orb_data" ]; then
Index: /trunk/LMDZ.COMMON/libf/evolution/deftank/launch_pem.sh
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/deftank/launch_pem.sh	(revision 3209)
+++ /trunk/LMDZ.COMMON/libf/evolution/deftank/launch_pem.sh	(revision 3210)
@@ -21,4 +21,6 @@
 LC_NUMERIC=en_US.UTF-8
 
+
+#####################################################################
 #---------- Modify here the number of years to be simulated ------------
 ## set the number of years, either Martian or Earth years:
@@ -37,4 +39,6 @@
 ## fill in the name of executable for reshape XIOS:
 exeReshape="reshape_XIOS_output_64x48x29_phymars_seq.e"
+#####################################################################
+
 
 #------ Check if files/directories necessary for the script exist ------
Index: /trunk/LMDZ.COMMON/libf/evolution/deftank/modify_startfi_orbit.sh
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/deftank/modify_startfi_orbit.sh	(revision 3209)
+++ /trunk/LMDZ.COMMON/libf/evolution/deftank/modify_startfi_orbit.sh	(revision 3210)
@@ -4,5 +4,5 @@
 ######################################################################
 
-# Name of the file to be modified
+# Name of the file
 name_file="startfi.nc"
 
@@ -14,4 +14,5 @@
 
 
+######################################################################
 # Calculate modified values
 if [ ! -f "$name_file" ]; then
@@ -48,5 +49,5 @@
 # Update the netCDF file
 # controle(15) = periheli ! min. Sun-Mars distance (Mkm)  ̃206.66
-# controle(16) = aphelie  ! max. SUn-Mars distance (Mkm)  ̃249.22
+# controle(16) = aphelie  ! max. Sun-Mars distance (Mkm)  ̃249.22
 # controle(17) = peri_day ! date of perihelion (sols since N. spring)
 # controle(18) = obliquit ! Obliquity of the planet (deg)  ̃23.98
Index: /trunk/LMDZ.COMMON/libf/evolution/deftank/modify_startfi_var.sh
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/deftank/modify_startfi_var.sh	(revision 3210)
+++ /trunk/LMDZ.COMMON/libf/evolution/deftank/modify_startfi_var.sh	(revision 3210)
@@ -0,0 +1,23 @@
+#!/bin/bash
+#######################################################################
+### Script to modify the value of a variable in a file "startfi.nc" ###
+#######################################################################
+
+# Name of the file
+name_file="startfi.nc"
+
+# Name of the variable to be modified
+var_name="co2"
+
+# New value for the variable
+new_var=8.
+
+
+#######################################################################
+# Update the netCDF file
+ncap2 -O -s "$var_name=$new_var" \
+         $name_file $name_file
+
+echo "In \"$name_file\":"
+echo "New $var_name = $new_var"
+echo "Done!"
Index: /trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90	(revision 3209)
+++ /trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90	(revision 3210)
@@ -55,5 +55,5 @@
 !=======================================================================
 ! Local Variables
-integer                         :: i, j, t                                                       ! loop variables
+integer                         :: i, j, l, t                                                    ! loop variables
 real                            :: A, B, mmean                                                   ! Molar Mass of co2 and no co2, A;B intermediate variables to compute the mean molar mass of the layer
 integer                         :: islope                                                        ! loop for variables
