Index: trunk/mesoscale/LMD_LES_MARS/modif_mars/Registry.EM
===================================================================
--- trunk/mesoscale/LMD_LES_MARS/modif_mars/Registry.EM	(revision 115)
+++ trunk/mesoscale/LMD_LES_MARS/modif_mars/Registry.EM	(revision 126)
@@ -118,4 +118,5 @@
 state  real  QH2O_ICE  ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "QH2O_ICE"   "Water ice mixing ratio"     "kg kg-1"
 state  real  QDUST     ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "QDUST"      "Dust mixing ratio"          "kg kg-1"
+state  real  qtrac1    ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "qtrac1"     "Decaying tracer 1"          "kg kg-1"
 ####
 ####
@@ -1488,4 +1489,5 @@
 package   water        mars==1                      -              moist:qv;scalar:qh2o,qh2o_ice
 package   dust         mars==2                      -              moist:qv;scalar:qdust
+package   radioac      mars==20                     -              scalar:qtrac1
 ##### MARS OPTIONS
 ##### MARS OPTIONS
Index: trunk/mesoscale/LMD_LES_MARS/modif_mars/makeles_gnome
===================================================================
--- trunk/mesoscale/LMD_LES_MARS/modif_mars/makeles_gnome	(revision 126)
+++ trunk/mesoscale/LMD_LES_MARS/modif_mars/makeles_gnome	(revision 126)
@@ -0,0 +1,176 @@
+#! /bin/bash
+
+#------------------------------
+# makeles
+#------------------------------
+#     MMM must be defined
+#------------------------------
+# A. Spiga 01/2009
+#------------------------------
+
+
+echo "Use -n if you don't want to recompile physics"
+echo "Use -p if you want the new LMD physics"
+
+#
+# SPECIAL CICLAD
+#
+
+donotcompilephys=0
+phys=""
+while getopts "np" options; do
+  case $options in
+   n ) donotcompilephys=1;; ## do not recompile physics
+   p ) phys="newphys_";;    ## with new physics
+  esac
+done
+
+#
+# LOCATIONS
+#
+here=$PWD
+whereliblmd=$here
+
+
+##############################################################
+##############################################################
+if [ ${donotcompilephys} -eq 0 ]
+then
+
+#
+# COMPILE PHYSICS
+#
+cd $MMM
+  if [[ "${phys}" == "newphys_" ]]
+  then
+    makemeso -j -p
+  else
+    makemeso -j
+  fi 
+#
+#makemeso -rd < last > /dev/null
+folder=$PWD'/'$(more what_folder)'/WRFV2/'
+libphys_folder=$folder'mars_lmd/libo/'
+phymars_folder=$folder'mars_lmd/libf/phymars/'
+\rm what_folder 2> /dev/null
+
+#
+# GET liblmd GENERATED LIBRARY and INCLUDEs
+#
+echo $libphys_folder
+cp -rf ${libphys_folder}/liblmd.a ${whereliblmd}/
+#cp -rf ${phymars_folder}/dimphys.h ${here}/modif_mars/
+cp -rf ${phymars_folder}/dimphys.h ${here}/mars_lmd/libf/phymars/
+#cp -rf ${folder}/call_meso_inifis.inc ${here}/modif_mars/
+#cp -rf ${folder}/call_meso_physiq.inc ${here}/modif_mars/
+cp -rf ${folder}/call_meso_inifis.inc ${here}/
+cp -rf ${folder}/call_meso_physiq.inc ${here}/
+#cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/modif_mars/
+cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/inc/
+#cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/modif_mars/
+#cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/modif_mars/
+cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/mars_lmd/libf/phymars/
+cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/mars_lmd/libf/phymars/
+fi
+##############################################################
+##############################################################
+
+
+cd $here
+
+###------------------------------
+###------------------------------
+###
+### MPI (dm) 64 bits 
+###
+###TODO: le rendre adapte aux reponses du user a makemeso
+#touch conf
+#echo 3 >> conf 
+###echo 4 >> conf  #openMP n'arrange pas beaucoup de le tps de calcul
+#echo 1 >> conf
+###------------------------------
+###------------------------------
+
+
+
+### SINGLE PROC 32 bits g95
+#touch conf
+#echo 5 >> conf
+#echo 0 >> conf
+
+## SINGLE PROC 64 bits
+#touch conf
+#echo 1 >> conf
+#echo 0 >> conf
+
+### MPI (dm) 64 bits IFORT
+echo IFORT IFORT IFORT IFORT
+touch conf
+echo 7 >> conf
+echo 1 >> conf
+
+
+#
+# CONFIGURE
+#
+echo "configure..."
+#touch configure.wrf
+\rm configure.wrf
+./configure < conf > /dev/null 2> /dev/null
+#./configure 
+#sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+'mpif90 -f90=$(SFC)'+'/usr/lib64/openmpi/1.2.8-pgf/bin/mpif90'+g | sed s+'mpicc -cc=$(SCC)'+'/usr/lib64/openmpi/1.2.8-gcc/bin/mpicc -DMPI2_SUPPORT'+g > yeah
+## WHERE_MPI must be defined
+sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"mpif90"+"$WHERE_MPI/mpif90"+g | sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g > yeah
+#sed s+"# -g"+"-fno-second-underscore # -g"+g configure.wrf | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g > yeah
+#sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"#-g"+"-g"+g > yeah
+#sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf > yeah
+mv yeah configure.wrf
+
+	####
+	#### provoque des seg faults....
+	####
+	#sed s+"-fastsse"+"-fastsse -mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah
+	#### TEST TEST
+	#mv yeah configure.wrf
+
+sed s+"-fastsse"+" "+g configure.wrf > yeah
+#sed s+"-fastsse"+"-mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah ##marche pas
+#
+# sometimes fastsse is problematic
+#
+
+##sed s+"-fastsse"+"-fastsse -mcmodel=medium"+g configure.wrf > yeah
+mv yeah configure.wrf
+
+#sed s+"-Mvect=noaltcode"+"#-Mvect=noaltcode"+g configure.wrf > yeah ; mv yeah configure.wrf
+
+#sed s+"-mp -Minfo=mp"+"-mp -Minfo=mp -mp=nonuma"+g configure.wrf > yeah
+#mv yeah configure.wrf
+
+#### OBLIGATOIRE POUR IFORT, OK AVEC LES AUTRES ??? a priori oui
+sed s+"-llmd"+"-llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah
+mv yeah configure.wrf
+
+#############################################################
+  if [[ "${phys}" == "newphys_" ]]
+  then
+     sed s+"ARCH_LOCAL      =       "+"ARCH_LOCAL      =       -DNEWPHYS "+g configure.wrf > yeah
+     mv -f yeah configure.wrf
+  fi
+#############################################################
+
+
+\rm conf
+
+#
+# COMPILE LES TEST CASE w/ LMD PHYSICS
+#
+touch modif_mars/module_lmd_driver.F
+\rm log_compile
+\rm log_error
+echo "compile LES WRF with LMD Mars physics... look log_compile and log_error"
+compile em_les > log_compile 2> log_error
+
+echo '***********************************'
+tail -n 20 log_error
+
Index: trunk/mesoscale/LMD_LES_MARS/modif_mars/module_initialize_les.F
===================================================================
--- trunk/mesoscale/LMD_LES_MARS/modif_mars/module_initialize_les.F	(revision 115)
+++ trunk/mesoscale/LMD_LES_MARS/modif_mars/module_initialize_les.F	(revision 126)
@@ -798,4 +798,8 @@
       real h_input(n), th_input(n), qv_input(n), u_input(n), v_input(n)
 
+! input therm data (element 0 is the ground so it's n+1 but n is 1000 anyway so...)
+
+     real r_therm(n),cp_therm(n),p_therm(n),rho_therm(n),t_therm(n)
+
 ! diagnostics
 
@@ -816,4 +820,17 @@
       call read_sounding( p_surf, th_surf, qv_surf, &
                           h_input, th_input, qv_input, u_input, v_input,n, nl, debug )
+
+! and the therm :
+
+      call read_therm(r_therm,cp_therm,p_therm,rho_therm,t_therm,n)
+
+! To use r/cp as defined above, one has to recompute teta from T (default MCD computes
+! teta for a variable r/cp)
+
+      do k=1,nl
+        th_input(k) = t_therm(k)*(p1000mb/p_therm(k))**(r/cp)
+      enddo
+      th_surf = t_therm(1)*(p1000mb/p_therm(1))**(r/cp)
+! -----
 
       if(dry) then
@@ -957,3 +974,31 @@
       end subroutine read_sounding
 
+      subroutine read_therm(r,cp,p,rho,t,n)
+      implicit none
+      integer n
+      real r(n),cp(n),p(n),rho(n),t(n)
+      logical end_of_file
+
+      integer k
+
+! first element is the surface
+
+      open(unit=11,file='input_therm',form='formatted',status='old')
+      rewind(11)
+      end_of_file = .false.
+      k = 0
+      do while (.not. end_of_file)
+
+        read(11,*,end=101) r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1)
+        write(*,*) k, r(k+1), cp(k+1), p(k+1), rho(k+1), t(k+1)
+        k = k+1
+        go to 112
+ 101    end_of_file = .true.
+ 112    continue
+      enddo
+
+      close(unit=11,status = 'keep')
+
+      end subroutine read_therm
+
 END MODULE module_initialize_ideal
