Index: trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90	(revision 3025)
+++ trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90	(revision 3026)
@@ -78,13 +78,9 @@
 
           open(73,file='ob_ex_lsp.asc')
-          do ilask=1,nlask
-            read(73,*) yearlask(ilask),oblask(ilask),      &
-             exlask(ilask),lsplask(ilask)
-            yearlask(ilask)=yearlask(ilask)*1000
-
-            if(yearlask(ilask).GT.Year) then
-		last_ilask=ilask+1
-            endif
-          end do
+          do ilask = 1,nlask
+            read(73,*) yearlask(ilask), oblask(ilask), exlask(ilask), lsplask(ilask)
+            yearlask(ilask) = yearlask(ilask)*1000.
+            if (yearlask(ilask) > Year) last_ilask = ilask + 1
+          enddo
           close(73)
 
Index: trunk/LMDZ.MARS/changelog.txt
===================================================================
--- trunk/LMDZ.MARS/changelog.txt	(revision 3025)
+++ trunk/LMDZ.MARS/changelog.txt	(revision 3026)
@@ -4166,2 +4166,5 @@
 Fixed a bug in newstart call to lect_start_archive; missing perenial_co2ice
 argument. Turned lect_start_archive into a module so this cant't happen again.
+
+== 09/08/2023 == JBC
+Small fixes to be able to run the Mars PCM 1D without "water" + Improvements/addition of scripts in deftank/pem to run the PEM 1D model according to Laskar orbital parameters.
Index: trunk/LMDZ.MARS/deftank/field_def_physics_mars.xml
===================================================================
--- trunk/LMDZ.MARS/deftank/field_def_physics_mars.xml	(revision 3025)
+++ trunk/LMDZ.MARS/deftank/field_def_physics_mars.xml	(revision 3026)
@@ -334,4 +334,7 @@
                    unit="W.m-2" />
             <field id="tauTES"
+                   long_name="Water ice cloud opacity at TES abs 825 cm-1"
+                   unit="" />
+            <field id="tauTESap"
                    long_name="Water ice cloud opacity at TES abs 825 cm-1"
                    unit="" />
@@ -653,5 +656,15 @@
                    long_name="count_micro after microphysics" 
                    unit="integer" />
-            
+
+            <field id="zdqcloud_ice" 
+                   long_name="cloud ice" 
+                   unit="kg.m-2.s-1" />
+            <field id="zdqcloud_vap"
+                   long_name="cloud vap"
+                   unit="kg.m-2.s-1" />
+            <field id="zdqcloud"
+                   long_name="cloud"
+                   unit="kg.m-2.s-1" />
+
             <!-- CO2 condensation parametrization -->
             <field id="co2condens_pdtc" 
Index: trunk/LMDZ.MARS/deftank/file_def_physics_mars.xml
===================================================================
--- trunk/LMDZ.MARS/deftank/file_def_physics_mars.xml	(revision 3025)
+++ trunk/LMDZ.MARS/deftank/file_def_physics_mars.xml	(revision 3026)
@@ -12,5 +12,5 @@
               time_units="days"
               type="one_file"
-              enabled=".true.">
+              enabled=".false.">
                     
             <!-- VARS 0D -->
@@ -37,4 +37,8 @@
                 <field field_ref="u" />
                 <field field_ref="v" />
+		<field field_ref="dustq" />
+		<field field_ref="dustN" />
+		<field field_ref="h2o_vap" />
+		<field field_ref="h2o_ice" />
             </field_group>
 
@@ -83,5 +87,5 @@
               type="one_file"
               time_units="days"
-              enabled=".false.">
+              enabled=".true.">
                     
             <!-- VARS 0D -->
@@ -112,4 +116,6 @@
                 <field field_ref="h2o_layer1" />
                 <field field_ref="co2_layer1" />
+                <field field_ref="fluxsurf_dn_sw" name="ISR" />
+                <field field_ref="fluxtop_lw" name="OLR" />
             </field_group>
 
Index: trunk/LMDZ.MARS/deftank/pem/modify_startfi.sh
===================================================================
--- trunk/LMDZ.MARS/deftank/pem/modify_startfi.sh	(revision 3025)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#!/bin/bash
-
-# Bash script to modify the orbital parameters of a file "startfi.nc"
-name_file="startfi.nc"
-
-new_obl=30.
-new_exc=0.
-new_Lsp=250.
-
-year_day=669.
-halfaxe=227.94
-
-
-# Calculate modified values
-pi=$(echo "4*a(1)" | bc -l)
-arg=$(echo "0.5*2.*$pi*$new_Lsp/360." | bc -l)
-zx0=$(echo "-2.*-2.0*a(s($arg)/c($arg)*sqrt((1. - $new_exc)/(1. + $new_exc)))" | bc -l)
-if [ $(echo "$zx0 < 0" | bc -l) -eq 1 ]; then
-  zx0=$(echo "$zx0 + 2.*$pi" | bc -l)
-fi
-solp=$(echo "$year_day*(1.-($zx0 - $new_exc*s($zx0))/(2*$pi))" | bc -l)
-
-# 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) = peri_day ! date of perihelion (sols since N. spring)
-# controle(18) = obliquit ! Obliquity of the planet (deg)  ̃23.98
-ncap2 -O -s "controle(17)=$new_obl" \
-      -s "controle(14)=$halfaxe*(1-$new_exc)" \
-      -s "controle(15)=$halfaxe*(1+$new_exc)" \
-      -s "controle(16)=$solp" \
-      $name_file $name_file.temp
-
-# Rename the temporary file back to the original filename
-mv $name_file.temp $name_file
Index: trunk/LMDZ.MARS/deftank/pem/modify_startfi_Ls.sh
===================================================================
--- trunk/LMDZ.MARS/deftank/pem/modify_startfi_Ls.sh	(revision 3026)
+++ trunk/LMDZ.MARS/deftank/pem/modify_startfi_Ls.sh	(revision 3026)
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+# Bash script to modify the orbital parameters of a file "startfi.nc"
+name_file="startfi.nc"
+
+new_Ls=90.
+Lsp=347.443947402
+
+
+# Extract the 'controle' variable into a temporary file
+ncks -v controle $name_file > tmp_controle.txt
+
+# Extract the 'data' block containing the controle values
+data_block=$(awk '/data:/ {flag=1} flag; /\}/ {flag=0}' tmp_controle.txt | sed '1d;$d')
+
+# Remove unnecessary characters
+data_block=$(echo "$data_block" | sed -e 's/^[ \t]*//')
+data_block=$(echo "$data_block" | sed 's/controle =//')
+data_block=$(echo "$data_block" | sed 's/;$//')
+
+# Convert the data block into an array
+IFS=', ' read -ra controle_values <<< "$data_block"
+#for value in "${controle_values[@]}"; do
+#    echo "$value"
+#done
+
+# Remove the temporary file
+rm tmp_controle.txt
+
+# Calculate modified values
+halfaxe=227.94
+#year_day=668.6
+year_day=${controle_values[13]}
+peri_day=${controle_values[16]}
+pi=$(echo "4*a(1)" | bc -l)
+degrad=$(echo "360./(2.*$pi)" | bc -l)
+timeperi=$(echo "(1. - $Lsp)/$degrad" | bc -l)
+e_elips=$(echo "1.-${controle_values[14]}/$halfaxe" | bc -l)
+abs_new_Ls=$(echo "if($new_Ls < 0) -($new_Ls) else $new_Ls" | bc -l)
+
+if [ $(echo "$abs_new_Ls < 0.00001" | bc -l) -eq 1 ]; then
+  if [ $(echo "$new_Ls >= 0." | bc -l) -eq 1 ]; then
+    new_sol=0.
+  else
+    new_sol=$year_day
+  fi
+else 
+  zteta=$(echo "$new_Ls/$degrad + $timeperi" | bc -l)
+  tan=$(echo "s(0.5*$zteta)/c(0.5*$zteta)" | bc -l)
+  zx0=$(echo "2.*a($tan/sqrt((1.+$e_elips)/(1.-$e_elips)))" | bc -l)
+  xref=$(echo "$zx0-$e_elips*s($zx0)" | bc -l)
+  zz=$(echo "$xref/(2.*$pi)" | bc -l)
+  new_sol=$(echo "$zz*$year_day + $peri_day" | bc -l)
+  if [ $(echo "$new_sol < 0." | bc -l) -eq 1 ]; then
+      new_sol=$(echo "$new_sol + $year_day" | bc -l)
+  fi
+  if [ $(echo "$new_sol >= $year_day" | bc -l) -eq 1 ]; then
+      new_sol=$(echo "$new_sol - $year_day" | bc -l)
+  fi
+fi
+
+# Update the netCDF file
+# tab_cntrl(3) = day_ini + int(time) ! initial day
+ncap2 -O -s "controle(2)=$new_sol" \
+      $name_file $name_file.temp
+
+# Rename the temporary file back to the original filename
+mv $name_file.temp $name_file
+
+echo New initial sol = $new_sol
Index: trunk/LMDZ.MARS/deftank/pem/modify_startfi_orbit.sh
===================================================================
--- trunk/LMDZ.MARS/deftank/pem/modify_startfi_orbit.sh	(revision 3026)
+++ trunk/LMDZ.MARS/deftank/pem/modify_startfi_orbit.sh	(revision 3026)
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Bash script to modify the orbital parameters of a file "startfi.nc"
+name_file="startfi.nc"
+
+new_obl=30.0286
+new_exc=0.08212066
+new_Lsp=347.443947402
+
+
+# Calculate modified values
+year_day=669.
+halfaxe=227.94
+pi=$(echo "4*a(1)" | bc -l)
+degrad=$(echo "360./(2.*$pi)" | bc -l)
+tan=$(echo "s(0.5*$new_Lsp/$degrad)/c(0.5*$new_Lsp/$degrad)" | bc -l)
+zx0=$(echo "-2.*a($tan*sqrt((1.-$new_exc)/(1.+$new_exc)))" | bc -l)
+if [ $(echo "$zx0 <= 0" | bc -l) -eq 1 ]; then
+  zx0=$(echo "$zx0 + 2.*$pi" | bc -l)
+fi
+solp=$(echo "$year_day*(1.-($zx0 - $new_exc*s($zx0))/(2*$pi))" | bc -l)
+
+# 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(17) = peri_day ! date of perihelion (sols since N. spring)
+# controle(18) = obliquit ! Obliquity of the planet (deg)  ̃23.98
+ncap2 -O -s "controle(17)=$new_obl" \
+      -s "controle(14)=$halfaxe*(1-$new_exc)" \
+      -s "controle(15)=$halfaxe*(1+$new_exc)" \
+      -s "controle(16)=$solp" \
+      $name_file $name_file.temp
+
+# Rename the temporary file back to the original filename
+mv $name_file.temp $name_file
+
+echo New obliquit = $new_obl
+echo New periheli = $(echo "$halfaxe*(1-$new_exc)" | bc -l)
+echo New aphelie = $(echo "$halfaxe*(1+$new_exc)" | bc -l)
+echo New peri_day = $solp
Index: trunk/LMDZ.MARS/deftank/pem/run_PEM1D.sh
===================================================================
--- trunk/LMDZ.MARS/deftank/pem/run_PEM1D.sh	(revision 3026)
+++ trunk/LMDZ.MARS/deftank/pem/run_PEM1D.sh	(revision 3026)
@@ -0,0 +1,168 @@
+#!/bin/bash
+# Partition to run on:
+#MSUB -q rome
+# project to run on 
+#MSUB -A  gen10391
+# disks to use
+#MSUB -m  scratch,work,store
+# Job name
+#MSUB -r run_PEM
+# Job standard output:
+#MSUB -o run_PEM.%I
+# Job standard error:
+#MSUB -e run_PEM.%I
+# number of OpenMP threads c
+#MSUB -c 1
+# number of MPI tasks n
+#MSUB -n 1
+# number of nodes to use N
+#MSUB -N 1
+# max job run time T (in seconds)
+#MSUB -T 860
+#MSUB -Q test
+# request exclusive use of the node (128 cores)
+##MSUB -x
+
+# 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
+
+#------------------ Modify here the name of PEM exe --------------------
+## fill in the name of executable for PEM:
+exePEM=pem_29_phymars_seq.e
+
+#------------------ Modify here the name of GCM exe --------------------
+## fill in the name of executable for GCM:
+exeGCM=testphys1d_29_phymars_para.e
+
+#-------------- Modify here the name of reshape XIOS exe ---------------
+## fill in the name of executable for reshape XIOS:
+exeReshape=reshape_XIOS_output_64x48x29_phymars_seq.e
+
+#---------------- Modify here the number of PEM calls ------------------
+## set the number of PEM calls:
+nPEM=1000
+
+#---------------- Modify here the number of GCM calls ------------------
+## set the number of GCM calls between each PEM call:
+nGCM=2
+
+
+
+#--------- Check if files/directories exist to be able to run ----------
+echo Starting script to call PEM with GCM!
+if [ ! -d "profiles" ]; then
+    mkdir profiles
+else
+    rm profiles/*
+fi
+if [ ! -d "diagfis" ]; then
+    mkdir diagfis
+else
+    rm diagfis/*
+fi
+if [ ! -d "startfis" ]; then
+    mkdir startfis
+else
+    rm startfis/*
+fi
+if [ ! -r "context_lmdz_physics.xml" ]; then
+    echo File context_lmdz_physics.xml does not exist!
+    exit 0
+fi
+if [ ! -r "field_def_physics_mars.xml" ]; then
+    echo File field_def_physics_mars.xml does not exist!
+    exit 0
+fi
+if [ ! -r "file_def_physics_mars.xml" ]; then
+    echo File file_def_physics_mars.xml does not exist!
+    exit 0
+fi
+if [ ! -r "iodef.xml" ]; then
+    echo File iodef.xml does not exist!
+    exit 0
+fi
+if [ ! -r "run_PEM.def" ]; then
+    echo File diagfi_PEM.def does not exist!
+    exit 0
+fi
+if [ ! -r "run_GCM.def" ]; then
+    echo File diagfi_GCM.def does not exist!
+    exit 0
+fi
+if [ ! -r "run_PEM.def" ]; then
+    echo File diagfi_PEM.def does not exist!
+    exit 0
+fi
+if [ ! -r "run_GCM.def" ]; then
+    echo File diagfi_GCM.def does not exist!
+    exit 0
+fi
+
+#---------------------------- Initialization ---------------------------
+iPEM=1
+((iGCM = ($iPEM - 1)*$nGCM + 1))
+cp startfi.nc startfis/
+cp startfi_PEM.nc startfis/
+for file in profile_*; do
+    cp $file profiles/${file}_0
+done
+
+#---------------------- Main loop to call PEM/GCM ----------------------
+while [ $iPEM -le $nPEM ]; do
+    #--- Loop to run GCM year by year
+    cp run_GCM.def run.def
+    cp diagfi_GCM.def diagfi.def
+    for ((i = 1; i <= $nGCM; i++)); do
+        echo Run GCM $iGCM: call $i out of $nGCM...
+        ./$exeGCM > lrun${iGCM} 2>&1
+        mv diagfi.nc diagfis/diagfi${iGCM}.nc
+	cp Xdiurnalave.nc diagfis/Xdiurnalave${iGCM}.nc
+        mv Xdiurnalave.nc data2reshape${i}.nc
+        cp restartfi.nc startfis/startfi${iGCM}.nc
+        mv restartfi.nc startfi.nc
+        for file in profile_out_*; do
+            cp $file profiles/${file/_out/}_${iGCM}
+            mv $file ${file/_out/}
+        done
+        ((iGCM++))
+        echo Done!
+    done
+    #--- Reshaping GCM data with XIOS
+    echo Reshaping GCM data with XIOS...
+    for i in $(ls datareshaped*); do
+        rm $i
+    done
+    ./$exeReshape
+    for file in datareshaped*; do
+        mv $file ${file/reshaped/_GCM_Y}
+    done
+    echo Done!
+     #--- Running PEM
+    echo Run PEM $iPEM...
+    cp run_PEM.def run.def
+    cp diagfi_PEM.def diagfi.def
+    mv startfi.nc startfi_evol.nc
+    ./$exePEM > mrun${iPEM} 2>&1
+    mv diagfi.nc diagfis/diagfi_PEM${iPEM}.nc
+    cp restartfi_evol.nc startfis/startfi_postPEM${iPEM}.nc
+    mv restartfi_evol.nc startfi.nc
+    cp restartfi_PEM.nc startfis/startfi_PEM${iPEM}.nc
+    mv restartfi_PEM.nc startfi_PEM.nc
+    for file in profile_out_*; do
+        cp $file profiles/${file/_out/}PEM_${iPEM}
+        mv $file ${file/_out/}
+    done
+    mv info_run_PEM.txt info_run_PEM${iPEM}.txt
+    ((iPEM++))
+    echo Done!
+done
+
+#---------------------- Preparation for relaunch  ----------------------
+echo Reinitializing starting files...
+cp startfis/startfi.nc .
+for file in profiles/*_0; do
+    cp $file ${file/_0/}
+done
+
+echo Script finished.
Index: trunk/LMDZ.MARS/deftank/pem/run_pem1d_1
===================================================================
--- trunk/LMDZ.MARS/deftank/pem/run_pem1d_1	(revision 3025)
+++ 	(revision )
@@ -1,168 +1,0 @@
-#!/bin/bash
-# Partition to run on:
-#MSUB -q rome
-# project to run on 
-#MSUB -A  gen10391
-# disks to use
-#MSUB -m  scratch,work,store
-# Job name
-#MSUB -r run_PEM
-# Job standard output:
-#MSUB -o run_PEM.%I
-# Job standard error:
-#MSUB -e run_PEM.%I
-# number of OpenMP threads c
-#MSUB -c 1
-# number of MPI tasks n
-#MSUB -n 1
-# number of nodes to use N
-#MSUB -N 1
-# max job run time T (in seconds)
-#MSUB -T 860
-#MSUB -Q test
-# request exclusive use of the node (128 cores)
-##MSUB -x
-
-# 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
-
-#------------------ Modify here the name of PEM exe --------------------
-## fill in the name of executable for PEM:
-exePEM=pem_29_phymars_seq.e
-
-#------------------ Modify here the name of GCM exe --------------------
-## fill in the name of executable for GCM:
-exeGCM=testphys1d_29_phymars_para.e
-
-#-------------- Modify here the name of reshape XIOS exe ---------------
-## fill in the name of executable for reshape XIOS:
-exeReshape=reshape_XIOS_output_64x48x29_phymars_seq.e
-
-#---------------- Modify here the number of PEM calls ------------------
-## set the number of PEM calls:
-nPEM=1000
-
-#---------------- Modify here the number of GCM calls ------------------
-## set the number of GCM calls between each PEM call:
-nGCM=2
-
-
-
-#--------- Check if files/directories exist to be able to run ----------
-echo Starting script to call PEM with GCM!
-if [ ! -d "profiles" ]; then
-    mkdir profiles
-else
-    rm profiles/*
-fi
-if [ ! -d "diagfis" ]; then
-    mkdir diagfis
-else
-    rm diagfis/*
-fi
-if [ ! -d "startfis" ]; then
-    mkdir startfis
-else
-    rm startfis/*
-fi
-if [ ! -r "context_lmdz_physics.xml" ]; then
-    echo File context_lmdz_physics.xml does not exist!
-    exit 0
-fi
-if [ ! -r "field_def_physics_mars.xml" ]; then
-    echo File field_def_physics_mars.xml does not exist!
-    exit 0
-fi
-if [ ! -r "file_def_physics_mars.xml" ]; then
-    echo File file_def_physics_mars.xml does not exist!
-    exit 0
-fi
-if [ ! -r "iodef.xml" ]; then
-    echo File iodef.xml does not exist!
-    exit 0
-fi
-if [ ! -r "run_PEM.def" ]; then
-    echo File diagfi_PEM.def does not exist!
-    exit 0
-fi
-if [ ! -r "run_GCM.def" ]; then
-    echo File diagfi_GCM.def does not exist!
-    exit 0
-fi
-if [ ! -r "run_PEM.def" ]; then
-    echo File diagfi_PEM.def does not exist!
-    exit 0
-fi
-if [ ! -r "run_GCM.def" ]; then
-    echo File diagfi_GCM.def does not exist!
-    exit 0
-fi
-
-#---------------------------- Initialization ---------------------------
-iPEM=1
-((iGCM = ($iPEM - 1)*$nGCM + 1))
-cp startfi.nc startfis/
-cp startfi_PEM.nc startfis/
-for file in profile_*; do
-    cp $file profiles/${file}_0
-done
-
-#---------------------- Main loop to call PEM/GCM ----------------------
-while [ $iPEM -le $nPEM ]; do
-    #--- Loop to run GCM year by year
-    cp run_GCM.def run.def
-    cp diagfi_GCM.def diagfi.def
-    for ((i = 1; i <= $nGCM; i++)); do
-        echo Run GCM $iGCM: call $i out of $nGCM...
-        ./$exeGCM > lrun${iGCM} 2>&1
-        mv diagfi.nc diagfis/diagfi${iGCM}.nc
-	cp Xdiurnalave.nc diagfis/Xdiurnalave${iGCM}.nc
-        mv Xdiurnalave.nc data2reshape${i}.nc
-        cp restartfi.nc startfis/startfi${iGCM}.nc
-        mv restartfi.nc startfi.nc
-        for file in profile_out_*; do
-            cp $file profiles/${file/_out/}_${iGCM}
-            mv $file ${file/_out/}
-        done
-        ((iGCM++))
-        echo Done!
-    done
-    #--- Reshaping GCM data with XIOS
-    echo Reshaping GCM data with XIOS...
-    for i in $(ls datareshaped*); do
-        rm $i
-    done
-    ./$exeReshape
-    for file in datareshaped*; do
-        mv $file ${file/reshaped/_GCM_Y}
-    done
-    echo Done!
-     #--- Running PEM
-    echo Run PEM $iPEM...
-    cp run_PEM.def run.def
-    cp diagfi_PEM.def diagfi.def
-    mv startfi.nc startfi_evol.nc
-    ./$exePEM > mrun${iPEM} 2>&1
-    mv diagfi.nc diagfis/diagfi_PEM${iPEM}.nc
-    cp restartfi_evol.nc startfis/startfi_postPEM${iPEM}.nc
-    mv restartfi_evol.nc startfi.nc
-    cp restartfi_PEM.nc startfis/startfi_PEM${iPEM}.nc
-    mv restartfi_PEM.nc startfi_PEM.nc
-    for file in profile_out_*; do
-        cp $file profiles/${file/_out/}PEM_${iPEM}
-        mv $file ${file/_out/}
-    done
-    mv info_run_PEM.txt info_run_PEM${iPEM}.txt
-    ((iPEM++))
-    echo Done!
-done
-
-#---------------------- Preparation for relaunch  ----------------------
-echo Reinitializing starting files...
-cp startfis/startfi.nc .
-for file in profiles/*_0; do
-    cp $file ${file/_0/}
-done
-
-echo Script finished.
Index: trunk/LMDZ.MARS/libf/phymars/dyn1d/read_profile_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dyn1d/read_profile_mod.F90	(revision 3025)
+++ trunk/LMDZ.MARS/libf/phymars/dyn1d/read_profile_mod.F90	(revision 3026)
@@ -61,11 +61,11 @@
 !--------
   integer :: &
-     iq,             & ! loop over nb_tracer
-     ilayer,         & ! loop over nb_layer
-     ierr,           & ! open file iostat
-     indice_h2o_vap, & ! indice of h2o_vap tracer 
-     indice_h2o_ice, & ! indice of h2o_ice tracer
-     indice_hdo_vap, & ! indice of hdo_vap tracer
-     indice_hdo_ice    ! indice of hdo_ice tracer
+     iq,                 & ! loop over nb_tracer
+     ilayer,             & ! loop over nb_layer
+     ierr,               & ! open file iostat
+     indice_h2o_vap = 0, & ! indice of h2o_vap tracer 
+     indice_h2o_ice = 0, & ! indice of h2o_ice tracer
+     indice_hdo_vap = 0, & ! indice of hdo_vap tracer
+     indice_hdo_ice = 0    ! indice of hdo_ice tracer
 
   character(len=80), dimension(nb_tracer) :: &
@@ -148,5 +148,5 @@
 !    the main isotopologue profile is already read before minors isotopologues
 !---------------------------------------------------------------------------------------------------------------------!
-  if (hdo_vap.eqv..true. .and. indice_h2o_vap.ne.0) then
+  if (hdo_vap .and. indice_h2o_vap /= 0) then
     do ilayer = 1, nb_layer
       q(ilayer, indice_hdo_vap) = q(ilayer, indice_h2o_vap)*2*155.76e-6*5
@@ -154,5 +154,5 @@
   end if
 
-  if (hdo_ice.eqv..true. .and. indice_h2o_ice.ne.0) then
+  if (hdo_ice .and. indice_h2o_ice /= 0) then
     qsurf(indice_hdo_ice) = qsurf(indice_h2o_ice) * 2*155.76e-6*5
     do ilayer = 1, nb_layer
Index: trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F	(revision 3025)
+++ trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F	(revision 3026)
@@ -815,4 +815,5 @@
       ! Adding an option to force atmospheric water values JN
       atm_wat_profile = -1. ! Default: free atm wat profile
+      if (water) then
       print *,'Force atmospheric water vapor profile?'
       call getin("atm_wat_profile",atm_wat_profile)
@@ -830,4 +831,5 @@
         stop
       endif
+      endif
 
 ! Check if the atmospheric water profile relaxation is specified
@@ -835,4 +837,5 @@
       ! Adding an option to relax atmospheric water values JBC
       atm_wat_tau = -1. ! Default: no time relaxation
+      if (water) then
       print*, 'Relax atmospheric water vapor profile?'
       call getin("atm_wat_tau",atm_wat_tau)
@@ -850,4 +853,5 @@
        stop
         endif
+      endif
       endif
 
@@ -908,4 +912,5 @@
 !       Added "atm_wat_profile" flag (JN + JBC)
 !       ---------------------------------------
+      if (water) then
         call watersat(nlayer,temp,play,zqsat)
         if (0. <= atm_wat_profile .and. atm_wat_profile <= 1.) then
@@ -922,4 +927,5 @@
           endif
         endif
+      endif
 
 !      write(*,*) "testphys1d avant q", q(1,:)
Index: trunk/LMDZ.MARS/libf/phymars/initracer.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/initracer.F	(revision 3025)
+++ trunk/LMDZ.MARS/libf/phymars/initracer.F	(revision 3026)
@@ -463,7 +463,4 @@
         write(*,*) "initracer: found only ",count," tracers"
         write(*,*) "               expected ",nq
-        do iq=1,count
-          write(*,*)'      ',iq,' ',trim(noms(iq))
-        enddo
         call abort_physic("initracer","tracer mismatch",1)
       else
Index: trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/physiq_mod.F	(revision 3025)
+++ trunk/LMDZ.MARS/libf/phymars/physiq_mod.F	(revision 3026)
@@ -2633,9 +2633,9 @@
 c        -------------------------------------------------------------------
 
-
+       if (water) then
          do ig=1,ngrid
-	   if(mu0(ig).le.0.01) then 
+	   if(mu0(ig).le.0.01) then
 	    fluxsurf_dir_dn_sw(ig) = 0.
-	   else 
+	   else
             fluxsurf_dir_dn_sw(ig) = flux_1AU/dist_sol/dist_sol*mu0(ig)*
      &                    exp(-(tau(ig,iaer_dust_doubleq)+
@@ -2643,4 +2643,5 @@
            endif
          enddo
+       endif
 
            ! Density-scaled opacities
