Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM	(revision 1234)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM	(revision 1236)
@@ -209,4 +209,5 @@
 ####
 #### variables dans real
+#### -- si on change le nom on doit le changer jusque readmeteo !
 ####
 ############# in module_initialize ################# in geo_em.d**.nc ############################################
@@ -229,27 +230,29 @@
 #### variables dans wrf
 ####
-############# in module_initialize ################## in solve_em and lmd_driver ############################### 
-state  real   albedo_gcm      ij   misc  1  -  i012rd  "MARS_ALB"     "albedo of naked ground"   "0 - 1 fraction"
-state  real   therm_inert     ij   misc  1  -  i012rd  "MARS_TI"      "thermal inertia"          "J/m2/K/s0.5"
-state  real   mars_z0         ij   misc  1  -  i012rd  "MARS_Z0"      "surface roughness"        "m"
-state  real   slpx            ij   misc  1  -  i012rd  "SLOPEX"       "slope x direction"        "rad"
-state  real   slpy            ij   misc  1  -  i012rd  "SLOPEY"       "slope y direction"        "rad"
-state  real   mars_emiss      ij   misc  1  -  i012rd  "MARS_EMISS"   "emissivity"               "0 - 1 fraction"
-state  real   mars_cice       ij   misc  1  -  i012rd  "MARS_CICE"    "co2 ice"                  "kg/m2"
-state  real   mars_wice       ij   misc  1  -  i012rd  "MARS_WICE"    "h2o ice"                  "kg/m2"
-state  real   mars_fluxrad    ij   misc  1  -  i012rd  "MARS_FLUXRAD" "net rad flux at surf"     "W.m-2"
-state  real   mars_wstar      ij   misc  1  -  i012rd  "MARS_WSTAR"   "free convection velocity" "m.s-1"
-state  real   mars_tsurf      ij   misc  1  -  i012rd  "MARS_TSURF"   "surface temperature" "K"
-state  real   mars_tsoil     ilj   misc  1  -  i012rd  "MARS_TSOIL"   "soil temperatures"        "K"
-state  real   mars_q2        ikj   misc  1  Z  i012rd  "MARS_Q2"      "turbulent kinetic energy" "kg.m-3"
-state  real   mars_isoil     ilj   misc  1  -  i012rd  "MARS_ISOIL"   "soil thermal inertia"     "tiu"
-state  real   mars_dsoil     ilj   misc  1  -  i012rd  "MARS_DSOIL"   "soil depths"              "m"
-state  real   mars_gw        ilj   misc  1  -  i012rd  "MARS_GW"      "gwparam"                  " "
+#### 'm_' prefix is to avoid redundancies with possible existing terrestrial variables
+####
+####          vvvv nom pour module_initialize, solve_em, lmd_driver (interne fortran)
+####                                                vvvv nom fichier netCDF (important initialisation
+################################################################################################################
+state  real   m_albedo     ij   misc  1  -  i012rd  "MARS_ALB"     "albedo of naked ground"   "0 - 1 fraction"
+state  real   m_ti         ij   misc  1  -  i012rd  "MARS_TI"      "thermal inertia"          "J/m2/K/s0.5"
+state  real   m_z0         ij   misc  1  -  i012rd  "MARS_Z0"      "surface roughness"        "m"
+state  real   slpx         ij   misc  1  -  i012rd  "SLOPEX"       "slope x direction"        "rad"
+state  real   slpy         ij   misc  1  -  i012rd  "SLOPEY"       "slope y direction"        "rad"
+state  real   m_emiss      ij   misc  1  -  i012rd  "MARS_EMISS"   "emissivity"               "0 - 1 fraction"
+state  real   m_co2ice     ij   misc  1  -  i012rd  "MARS_CICE"    "co2 ground ice"           "kg/m2"
+state  real   m_h2oice     ij   misc  1  -  i012rd  "MARS_WICE"    "h2o ground ice"           "kg/m2"
+state  real   m_fluxrad    ij   misc  1  -  i012rd  "MARS_FLUXRAD" "net rad flux at surf"     "W.m-2"
+state  real   m_wstar      ij   misc  1  -  i012rd  "MARS_WSTAR"   "free convection velocity" "m.s-1"
+state  real   m_tsurf      ij   misc  1  -  i012rd  "MARS_TSURF"   "surface temperature"      "K"
+state  real   m_tsoil     ilj   misc  1  -  i012rd  "MARS_TSOIL"   "soil temperatures"        "K"
+state  real   m_q2        ikj   misc  1  Z  i012rd  "MARS_Q2"      "parameterized TKE"        "kg.m-3"
+state  real   m_isoil     ilj   misc  1  -  i012rd  "MARS_ISOIL"   "soil thermal inertia"     "tiu"
+state  real   m_dsoil     ilj   misc  1  -  i012rd  "MARS_DSOIL"   "soil depths"              "m"
+state  real   m_gw        ilj   misc  1  -  i012rd  "MARS_GW"      "gwparam"                  " "
 ####
 ####
 ####MARS MARS MARS MARS MARS
 ####MARS MARS MARS MARS MARS
-
-
 
 #-----------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -360,15 +363,4 @@
 ##
 state    real   ptot           ikj     dyn_em      1         -      irh       "PTOT"        "total pressure"      "Pa"
-####### if you choose h here, you will probably want not to output u,v,w,t,etc...
-state    real   uave           ikj     dyn_em      1         -      ir       "UAVE"        "average zonal wind"  "m/s"
-state    real   ustd           ikj     dyn_em      1         -      ir       "USTD"        "std dev zonal wind"  "m/s"
-state    real   vave           ikj     dyn_em      1         -      ir       "VAVE"        "average meridional wind"  "m/s"
-state    real   vstd           ikj     dyn_em      1         -      ir       "VSTD"        "std dev meridional wind"  "m/s"
-state    real   wave           ikj     dyn_em      1         -      ir       "WAVE"        "average vertical wind"  "m/s"
-state    real   wstd           ikj     dyn_em      1         -      ir       "WSTD"        "std dev vertical wind"  "m/s"
-state    real   tave           ikj     dyn_em      1         -      ir       "TAVE"        "average pert. potential temperature"  "K"
-state    real   tstd           ikj     dyn_em      1         -      ir       "TSTD"        "std dev pert. potential temperature"  "K"
-#######
-## ajouter tk, ptot, phtot ??? les deux derniers sont assez smooth...
 
 #                                               
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM.newphys
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM.newphys	(revision 1234)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/Registry/Registry.EM.newphys	(revision 1236)
@@ -75,42 +75,23 @@
 #### variables physiques ecrites dans les fichiers WRF
 #### - h indique l'ecriture
-#### - en commentaire, les variables physiques dans physiq.F
-#### - utiliser le script automatique Registry.bash
-####
-#### YOU CAN OUTPUT ANY 2D OR 3D VARIABLE THAT IS AVAILABLE IN MESO_PHYSIQ.F
-#### --- please indicate #SAVEMARS2 for 2D fields and #SAVEMARS3 for 3D fields
-####
-############ name in WRF !!!!! ############# name in NETCDF !!!! ############################################## name in meso_physiq !!!!!
-state  real  wTSURF     ij   misc  1  -  rhd  "TSURF"     "SURF TEMPERATURE"                "K"       #SAVEMARS2 tsurf
-state  real  wCO2ICE    ij   misc  1  -  rd   "CO2ICE"    "CO2 GROUND ICE"                  "kg m-2"  #SAVEMARS2 co2ice
-state  real  wEMISSIV   ij   misc  1  -  rd   "EMISSIV"   "EMISSIVITY"                      ""        #SAVEMARS2 emis
-state  real  wTHETA     ij   misc  1  -  rd   "THETA"     "SLOPE INCLINATION"               "deg"     #SAVEMARS2 theta_sl
-state  real  wPSI       ij   misc  1  -  rd   "PSI"       "SLOPE ORIENTATION"               "deg"     #SAVEMARS2 psi_sl
-state  real  wTAU_DUST  ij   misc  1  -  rhd   "TAU_DUST"  "REFERENCE VISIBLE DUST OPACITY"  ""        #SAVEMARS2 tauref
-state  real  wSWDOWNZ   ij   misc  1  -  rhd   "SWDOWNZ"   "DOWNWARD SW FLUX AT SURFACE"     "W m-2"   #SAVEMARS2 fluxsurf_sw_tot      
-state  real  wLWDOWNZ   ij   misc  1  -  rhd   "LWDOWNZ"   "DOWNWARD LW FLUX AT SURFACE"     "W m-2"   #SAVEMARS2 fluxsurf_lw
-state  real  wSWUP      ij   misc  1  -  rd   "SWUP"      "UPWARD SW FLUX AT TOP"           "W m-2"   #SAVEMARS2 fluxtop_sw_tot    
-state  real  wLWUP      ij   misc  1  -  rd   "LWUP"      "UPWARD LW FLUX AT TOP"           "W m-2"   #SAVEMARS2 fluxtop_lw
-state  real  wMTOT      ij   misc  1  -  rhd   "MTOT"      "TOTAL MASS WATER VAPOR in pmic"  "pmic"    #SAVEMARS2 mtot
-state  real  wICETOT    ij   misc  1  -  rhd   "ICETOT"    "TOTAL MASS WATER ICE"            "kg m-2"  #SAVEMARS2 icetot
-state  real  wRAVE      ij   misc  1  -  rhd   "RAVE"      "MEAN ICE RADIUS"                 "m"       #SAVEMARS2 rave
-state  real  wRICE      ikj  misc  1  -  rd   "RICE"      "ICE RADIUS"                      "m"       #SAVEMARS3 rice
-state  real  wHR_SW     ikj  misc  1  -  rd   "HR_SW"     "HEATING RATE SW"                 "K/s"     #SAVEMARS3 zdtsw
-state  real  wHR_LW     ikj  misc  1  -  rd   "HR_LW"     "HEATING RATE LW"                 "K/s"     #SAVEMARS3 zdtlw
-state  real  wHR_SH     ikj  misc  1  -  rd   "HR_SH"     "HEATING RATE sens. heat"         "K/s"     #SAVEMARS3 zdtdif
-state  real  wQSURFICE  ij   misc  1  -  rhd   "QSURFICE"  "WATER ICE AT SURFACE"            "kg m-2"  #SAVEMARS2 qsurfice
-state  real  wQSURFDUST ij   misc  1  -  rd   "QSURFDUST" "DUST MASS AT SURFACE"            "kg m-2"  #SAVEMARS2 qsurfdust
-state  real  wRDUST     ikj  misc  1  -  rd   "RDUST"     "DUST RADIUS"                     "m"       #SAVEMARS3 rdust
-state  real  wHR_NIR    ikj  misc  1  -  rd   "HR_NIR"    "HEATING RATE nirco2"             "K/s"     #SAVEMARS3 zdtnirco2
-state  real  wHR_NLTE   ikj  misc  1  -  rd   "HR_NLTE"   "HEATING RATE nlte"               "K/s"     #SAVEMARS3 zdtnlte
-state  real  wALBBARE   ij   misc  1  -  rhd   "ALBBARE"   "SOIL ALBEDO"                     ""        #SAVEMARS2 albedodat
-state  real  wVMR_ICE   ikj  misc  1  -  rhd   "VMR_ICE"   "VOL. MIXING RATIO ICE"           "ppm"     #SAVEMARS3 vmr
-state  real  wTAU_ICE   ij   misc  1  -  rhd   "TAU_ICE"   "CLOUD OD at 825 cm-1 TES"        ""        #SAVEMARS2 tauTES
-state  real  wPDTZ      ikj  misc  1  -  rd   "PDT"       "TEMP TENDENCY"                   "K s-1"   #SAVEMARS3 pdt
-state  real  wZMAX_TH   ij   misc  1  -  rhd   "ZMAX_TH"   "MAXIMUM LEVEL REACHED IN TH"     "m"       #SAVEMARS2 zmax_th
-state  real  wHFMAX_TH  ij   misc  1  -  rhd   "HFMAX_TH"  "MAXIMUM TH HEAT FLUX"            "m.K/s"   #SAVEMARS2 hfmax_th
-state  real  wWSTAR     ij   misc  1  -  rhd   "WSTAR"     "FREE CONVECTION VELOCITY FROM TH" "m/s"    #SAVEMARS2 wstar
-state  real  wZ0SET     ij   misc  1  -  rd   "Z0SET"     "SET SURFACE ROUGHNESS"           "m"       #SAVEMARS2 z0
-
+####
+####
+#### RADIATIVE TRANSFER
+state  real  HR_SW     ikj   misc  1  -  h  "HR_SW"     "HEATING RATE SW"                 "K/s"
+state  real  HR_LW     ikj   misc  1  -  h  "HR_LW"     "HEATING RATE LW"                 "K/s"
+state  real  SWDOWNZ    ij   misc  1  -  h  "SWDOWNZ"   "DOWNWARD SW FLUX AT SURFACE"     "W m-2"
+#### DUST CYCLE
+state  real  TAU_DUST   ij   misc  1  -  h  "TAU_DUST"  "REFERENCE VISIBLE DUST OPACITY"  ""
+state  real  RDUST     ikj   misc  1  -  h  "RDUST"     "DUST RADIUS"                     "m"
+state  real  QSURFDUST  ij   misc  1  -  h  "QSURFDUST" "DUST MASS AT SURFACE"            "kg m-2"
+#### CLOUDS
+state  real  MTOT       ij   misc  1  -  h  "MTOT"      "TOTAL MASS WATER VAPOR in pmic"  "pmic"
+state  real  ICETOT     ij   misc  1  -  h  "ICETOT"    "TOTAL MASS WATER ICE"            "kg m-2"
+state  real  VMR_ICE   ikj   misc  1  -  h  "VMR_ICE"   "VOL. MIXING RATIO ICE"           "ppm"
+state  real  TAU_ICE    ij   misc  1  -  h  "TAU_ICE"   "CLOUD OD at 825 cm-1 TES"        ""
+state  real  RICE      ikj   misc  1  -  h  "RICE"      "ICE RADIUS"                      "m"
+#### THERMALS
+state  real  ZMAX       ij   misc  1  -  h  "ZMAX"      "MAXIMUM LEVEL THERMALS"          "m"    
+state  real  HFMAX      ij   misc  1  -  h  "HFMAX"     "MAXIMUM PBL HEAT FLUX"           "m.K/s"
 ####
 ####
@@ -209,4 +190,5 @@
 ####
 #### variables dans real
+#### -- si on change le nom on doit le changer jusque readmeteo !
 ####
 ############# in module_initialize ################# in geo_em.d**.nc ############################################
@@ -229,27 +211,29 @@
 #### variables dans wrf
 ####
-############# in module_initialize ################## in solve_em and lmd_driver ############################### 
-state  real   albedo_gcm      ij   misc  1  -  i012rd  "MARS_ALB"     "albedo of naked ground"   "0 - 1 fraction"
-state  real   therm_inert     ij   misc  1  -  i012rd  "MARS_TI"      "thermal inertia"          "J/m2/K/s0.5"
-state  real   mars_z0         ij   misc  1  -  i012rd  "MARS_Z0"      "surface roughness"        "m"
-state  real   slpx            ij   misc  1  -  i012rd  "SLOPEX"       "slope x direction"        "rad"
-state  real   slpy            ij   misc  1  -  i012rd  "SLOPEY"       "slope y direction"        "rad"
-state  real   mars_emiss      ij   misc  1  -  i012rd  "MARS_EMISS"   "emissivity"               "0 - 1 fraction"
-state  real   mars_cice       ij   misc  1  -  i012rd  "MARS_CICE"    "co2 ice"                  "kg/m2"
-state  real   mars_wice       ij   misc  1  -  i012rd  "MARS_WICE"    "h2o ice"                  "kg/m2"
-state  real   mars_fluxrad    ij   misc  1  -  i012rd  "MARS_FLUXRAD" "net rad flux at surf"     "W.m-2"
-state  real   mars_wstar      ij   misc  1  -  i012rd  "MARS_WSTAR"   "free convection velocity" "m.s-1"
-state  real   mars_tsurf      ij   misc  1  -  i012rd  "MARS_TSURF"   "surface temperature" "K"
-state  real   mars_tsoil     ilj   misc  1  -  i012rd  "MARS_TSOIL"   "soil temperatures"        "K"
-state  real   mars_q2        ikj   misc  1  Z  i012rd  "MARS_Q2"      "turbulent kinetic energy" "kg.m-3"
-state  real   mars_isoil     ilj   misc  1  -  i012rd  "MARS_ISOIL"   "soil thermal inertia"     "tiu"
-state  real   mars_dsoil     ilj   misc  1  -  i012rd  "MARS_DSOIL"   "soil depths"              "m"
-state  real   mars_gw        ilj   misc  1  -  i012rd  "MARS_GW"      "gwparam"                  " "
+#### 'm_' prefix is to avoid redundancies with possible existing terrestrial variables
+####
+####          vvvv nom pour module_initialize, solve_em, lmd_driver (interne fortran)
+####                                                vvvv nom fichier netCDF (important initialisation
+################################################################################################################
+state  real   m_albedo     ij   misc  1  -  i012rd  "MARS_ALB"     "albedo of naked ground"   "0 - 1 fraction"
+state  real   m_ti         ij   misc  1  -  i012rd  "MARS_TI"      "thermal inertia"          "J/m2/K/s0.5"
+state  real   m_z0         ij   misc  1  -  i012rd  "MARS_Z0"      "surface roughness"        "m"
+state  real   slpx         ij   misc  1  -  i012rd  "SLOPEX"       "slope x direction"        "rad"
+state  real   slpy         ij   misc  1  -  i012rd  "SLOPEY"       "slope y direction"        "rad"
+state  real   m_emiss      ij   misc  1  -  i012rd  "MARS_EMISS"   "emissivity"               "0 - 1 fraction"
+state  real   m_co2ice     ij   misc  1  -  i012rhd "MARS_CICE"    "CO2 GROUND ICE"           "kg/m2"
+state  real   m_h2oice     ij   misc  1  -  i012rhd "MARS_WICE"    "H2O GROUND ICE"           "kg/m2"
+state  real   m_fluxrad    ij   misc  1  -  i012rhd "MARS_FLUXRAD" "net rad flux at surf"     "W.m-2"
+state  real   m_wstar      ij   misc  1  -  i012rhd "MARS_WSTAR"   "FREE CONVECTION VELOCITY" "m.s-1"
+state  real   m_tsurf      ij   misc  1  -  i012rhd "MARS_TSURF"   "SURFACE TEMPERATURE"      "K"
+state  real   m_tsoil     ilj   misc  1  -  i012rhd "MARS_TSOIL"   "SOIL TEMPERATURES"        "K"
+state  real   m_q2        ikj   misc  1  Z  i012rhd "MARS_Q2"      "parameterized TKE"        "kg.m-3"
+state  real   m_isoil     ilj   misc  1  -  i012rd  "MARS_ISOIL"   "soil thermal inertia"     "tiu"
+state  real   m_dsoil     ilj   misc  1  -  i012rd  "MARS_DSOIL"   "soil depths"              "m"
+state  real   m_gw        ilj   misc  1  -  i012rd  "MARS_GW"      "gwparam"                  " "
 ####
 ####
 ####MARS MARS MARS MARS MARS
 ####MARS MARS MARS MARS MARS
-
-
 
 #-----------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -360,15 +344,4 @@
 ##
 state    real   ptot           ikj     dyn_em      1         -      irh       "PTOT"        "total pressure"      "Pa"
-####### if you choose h here, you will probably want not to output u,v,w,t,etc...
-state    real   uave           ikj     dyn_em      1         -      ir       "UAVE"        "average zonal wind"  "m/s"
-state    real   ustd           ikj     dyn_em      1         -      ir       "USTD"        "std dev zonal wind"  "m/s"
-state    real   vave           ikj     dyn_em      1         -      ir       "VAVE"        "average meridional wind"  "m/s"
-state    real   vstd           ikj     dyn_em      1         -      ir       "VSTD"        "std dev meridional wind"  "m/s"
-state    real   wave           ikj     dyn_em      1         -      ir       "WAVE"        "average vertical wind"  "m/s"
-state    real   wstd           ikj     dyn_em      1         -      ir       "WSTD"        "std dev vertical wind"  "m/s"
-state    real   tave           ikj     dyn_em      1         -      ir       "TAVE"        "average pert. potential temperature"  "K"
-state    real   tstd           ikj     dyn_em      1         -      ir       "TSTD"        "std dev pert. potential temperature"  "K"
-#######
-## ajouter tk, ptot, phtot ??? les deux derniers sont assez smooth...
 
 #                                               
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_quarter_ss.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_quarter_ss.F	(revision 1234)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_quarter_ss.F	(revision 1236)
@@ -455,19 +455,22 @@
 ENDIF
     grid%tsk(i,j) = tsurf_input
+    grid%m_tsurf(i,j) = tsurf_input
 !!MARS
     grid%xlat(i,j) = lat_input
     grid%xlong(i,j) = lon_input!+float(i)*config_flags%dx/59000.
-    grid%mars_emiss(i,j)=0.95
-    grid%mars_cice(i,j)=0.
-    grid%mars_wice(i,j)=0.
+    grid%m_emiss(i,j)=0.95
+    grid%m_co2ice(i,j)=0.
+    grid%m_h2oice(i,j)=0.
 !! >> Used for restarts only:
-    grid%mars_q2(i,:,j)=0.
-    grid%mars_fluxrad(i,j)=0.
-    grid%mars_wstar(i,j)=0.
-    grid%mars_tsurf(i,j)=0.
+    grid%m_q2(i,:,j)=0.
+    grid%m_fluxrad(i,j)=0.
+    grid%m_wstar(i,j)=0.
 !! <<
     write(6,*) 'NOTE TO SELF. slpx and slpy set to 0 which means no slope insolation.'
     grid%slpx(i,j) = 0.
     grid%slpy(i,j) = 0.
+   DO k=1,config_flags%num_soil_layers
+    grid%m_tsoil(i,k,j) = 0.
+   ENDDO
     !!! COMMENT THE LINES BELOW IF YOU DON'T WANT CORIOLIS TERMS
     !!! cf. doc WRF2008 page 11 for e and f expressions
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F	(revision 1234)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F	(revision 1236)
@@ -266,6 +266,4 @@
          DO j = jts, MIN(jte,jde-1)
            DO i = its, MIN(ite,ide-1)
-!!****MARS: tsk is surface temperature           
-              grid%tsk(i,j) = grid%em_tsk_gc(i,j)
               grid%tmn(i,j) = grid%em_tmn_gc(i,j)
               grid%xlat(i,j) = grid%em_xlat_gc(i,j)
@@ -273,21 +271,19 @@
               grid%ht(i,j) = grid%em_ht_gc(i,j)
 !!****MARS
-              grid%albedo_gcm(i,j) = grid%em_albedo_gcm_gc(i,j)
-              grid%therm_inert(i,j) = grid%em_therm_inert_gc(i,j)
+              grid%m_tsurf(i,j) = grid%em_tsk_gc(i,j)
+              grid%m_albedo(i,j) = grid%em_albedo_gcm_gc(i,j)
+              grid%m_ti(i,j) = grid%em_therm_inert_gc(i,j)
               grid%slpx(i,j) = grid%em_slpx_gc(i,j)
               grid%slpy(i,j) = grid%em_slpy_gc(i,j)
-              grid%mars_emiss(i,j)=grid%st000010(i,j)
-              grid%mars_cice(i,j)=grid%st010040(i,j)
-              grid%mars_wice(i,j)=grid%sm100200(i,j)
-!! >> Used for restarts only:
-              grid%mars_q2(i,:,j)=0.
-              grid%mars_tsurf(i,j)=0. 
-!! <<
+              grid%m_emiss(i,j) = grid%st000010(i,j)
+              grid%m_co2ice(i,j) = grid%st010040(i,j)
+              grid%m_h2oice(i,j) = grid%sm100200(i,j)
+              grid%m_q2(i,:,j) = 0.
                   !! one more security ... co2ice cannot be negative
-                  IF (grid%mars_cice(i,j) .lt. 0.) grid%mars_cice(i,j)=0.
-                  IF (grid%mars_wice(i,j) .lt. 0.) grid%mars_wice(i,j)=0.
+                  IF (grid%m_co2ice(i,j) .lt. 0.) grid%m_co2ice(i,j)=0.
+                  IF (grid%m_h2oice(i,j) .lt. 0.) grid%m_h2oice(i,j)=0.
 
               DO k = 1, config_flags%num_soil_layers  
-                grid%mars_tsoil(i,k,j)=grid%em_tsoil_gc(i,k+1,j) !!ici k+1, because em_tsoil_gc dim is num_metgrid_levels !!
+                grid%m_tsoil(i,k,j)=grid%em_tsoil_gc(i,k+1,j) !!ici k+1, because em_tsoil_gc dim is num_metgrid_levels !!
               ENDDO  
 
@@ -296,9 +292,9 @@
 #ifdef NEWPHYS
 
-              grid%mars_wstar(i,j)=0.  !! used for restarts
-              grid%mars_fluxrad(i,j)=0.  !! used for restarts
-
-              grid%mars_z0(i,j) = 0.
-              grid%mars_z0(i,j) = grid%em_z0_gc(i,j)*0.01  !! in cm in surface.nc but in m in physiq.F
+              grid%m_wstar(i,j)=0. 
+              grid%m_fluxrad(i,j)=0.
+
+              grid%m_z0(i,j) = 0.
+              grid%m_z0(i,j) = grid%em_z0_gc(i,j)*0.01  !! in cm in surface.nc but in m in physiq.F
               !IF (config_flags%init_Z0 .ne. 0.) THEN 
               !   grid%z0 = grid%z0*0. + config_flags%init_Z0
@@ -307,48 +303,48 @@
               ! here, that bit is necessary for new soil model !          
               IF (config_flags%init_TI .ne. 0.) THEN
-                  grid%therm_inert = grid%therm_inert*0. + config_flags%init_TI
+                  grid%m_ti = grid%m_ti*0. + config_flags%init_TI
                   print *, 'constant thermal inertia ', config_flags%init_TI
               ENDIF
 
               DO k = 1, config_flags%num_soil_layers  
-                grid%mars_isoil(i,k,j)=grid%em_isoil_gc(i,k+1,j)
-                grid%mars_dsoil(i,k,j)=grid%em_dsoil_gc(i,k+1,j)
+                grid%m_isoil(i,k,j)=grid%em_isoil_gc(i,k+1,j)
+                grid%m_dsoil(i,k,j)=grid%em_dsoil_gc(i,k+1,j)
               ENDDO
 
               DO k = 1, config_flags%num_soil_layers
                 !!!!!!!!!!!!!!!!! DONE in soil_setting.F
-                IF (grid%mars_dsoil(i,k,j) == -999.) THEN  !! old soil depths (or) no info in files
-                   grid%mars_dsoil(i,k,j) = sqrt(887.75/3.14)*((2.**(k-0.5))-1.) * grid%therm_inert(i,j) / wvolcapa 
+                IF (grid%m_dsoil(i,k,j) == -999.) THEN  !! old soil depths (or) no info in files
+                   grid%m_dsoil(i,k,j) = sqrt(887.75/3.14)*((2.**(k-0.5))-1.) * grid%m_ti(i,j) / wvolcapa 
                        !!! ATTENTION il faut interpoler si le nombre de niveaux change
                        !!! voir soil_setting.F (olddepthdef=.true. ; interpol=.true.)
                        !!! mais: en meso-echelle on a juste a prendre le mm nombre de niveaux que le GCM   
                 ENDIF
-                IF (grid%mars_isoil(i,k,j) == -999.) THEN  !! old soil model (or) no 3D thermal inertia   
-                   grid%mars_isoil(i,k,j) = grid%therm_inert(i,j)
+                IF (grid%m_isoil(i,k,j) == -999.) THEN  !! old soil model (or) no 3D thermal inertia   
+                   grid%m_isoil(i,k,j) = grid%m_ti(i,j)
                 ELSE             
-                   IF (grid%mars_dsoil(i,k,j) .le. sqrt(88775./3.14) * grid%therm_inert(i,j) / wvolcapa) THEN
-                           grid%mars_isoil(i,k,j) = grid%therm_inert(i,j)  !! if depth < skin depth, we use hi-res TI
+                   IF (grid%m_dsoil(i,k,j) .le. sqrt(88775./3.14) * grid%m_ti(i,j) / wvolcapa) THEN
+                           grid%m_isoil(i,k,j) = grid%m_ti(i,j)  !! if depth < skin depth, we use hi-res TI
                    ELSE  !! if depth > skin depth, we use low-res (GCM) TI
                          !! except for a transition layer
                          !!   EM: and, well, it would be wrong to sum up TI values
                          !!   EM: (cf. last page of soil model technical document)
-                           IF (grid%mars_dsoil(i,k-1,j) .le. sqrt(88775./3.14) * grid%therm_inert(i,j) / wvolcapa) THEN
-                                   grid%mars_isoil(i,k,j) = &
+                           IF (grid%m_dsoil(i,k-1,j) .le. sqrt(88775./3.14) * grid%m_ti(i,j) / wvolcapa) THEN
+                                   grid%m_isoil(i,k,j) = &
                                    sqrt( &
-                                         ( grid%mars_dsoil(i,k+1,j) - grid%mars_dsoil(i,k-1,j) ) &
+                                         ( grid%m_dsoil(i,k+1,j) - grid%m_dsoil(i,k-1,j) ) &
                                          / &
-                                         ( ( (grid%mars_dsoil(i,k,j) - grid%mars_dsoil(i,k-1,j)) &
-                                              / (grid%mars_isoil(i,k-1,j)*grid%mars_isoil(i,k-1,j)) ) &
+                                         ( ( (grid%m_dsoil(i,k,j) - grid%m_dsoil(i,k-1,j)) &
+                                              / (grid%m_isoil(i,k-1,j)*grid%m_isoil(i,k-1,j)) ) &
                                            + &
-                                           ( (grid%mars_dsoil(i,k+1,j) - grid%mars_dsoil(i,k,j)) &
-                                              / (grid%mars_isoil(i,k+1,j)*grid%mars_isoil(i,k+1,j)) ) &
+                                           ( (grid%m_dsoil(i,k+1,j) - grid%m_dsoil(i,k,j)) &
+                                              / (grid%m_isoil(i,k+1,j)*grid%m_isoil(i,k+1,j)) ) &
                                          ) &
                                        ) 
-                           ENDIF       !! grid%mars_isoil(i,k-1,j) was changed at previous step to value grid%therm_inert(i,j)
-                                       !! grid%mars_isoil(i,k+1,j) is defined to large-scale value grid%em_isoil_gc   
+                           ENDIF       !! grid%m_isoil(i,k-1,j) was changed at previous step to value grid%m_ti(i,j)
+                                       !! grid%m_isoil(i,k+1,j) is defined to large-scale value grid%em_isoil_gc   
                    ENDIF        
                 ENDIF
-                IF (grid%mars_tsoil(i,k,j) .lt. 20.) THEN  !!! une securite pour les anciens diagfi qui n'ont que 10 niveaux
-                   IF (k .ne. 1) grid%mars_tsoil(i,k,j) = grid%mars_tsoil(i,k-1,j)
+                IF (grid%m_tsoil(i,k,j) .lt. 20.) THEN  !!! une securite pour les anciens diagfi qui n'ont que 10 niveaux
+                   IF (k .ne. 1) grid%m_tsoil(i,k,j) = grid%m_tsoil(i,k-1,j)
                 ENDIF
                 !!!!!!!!!!!!!!!!! DONE in soil_setting.F
@@ -358,9 +354,9 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-grid%mars_gw(i,1,j)=grid%st040100(i,j)  !!ZMEA
-grid%mars_gw(i,2,j)=grid%st100200(i,j)  !!ZSTD
-grid%mars_gw(i,3,j)=grid%sm000010(i,j)  !!ZSIG
-grid%mars_gw(i,4,j)=grid%sm010040(i,j)  !!ZGAM
-grid%mars_gw(i,5,j)=grid%sm040100(i,j)  !!ZTHE
+grid%m_gw(i,1,j)=grid%st040100(i,j)  !!ZMEA
+grid%m_gw(i,2,j)=grid%st100200(i,j)  !!ZSTD
+grid%m_gw(i,3,j)=grid%sm000010(i,j)  !!ZSIG
+grid%m_gw(i,4,j)=grid%sm010040(i,j)  !!ZGAM
+grid%m_gw(i,5,j)=grid%sm040100(i,j)  !!ZTHE
 
            END DO
@@ -385,8 +381,8 @@
     !DO j = jts, MIN(jte,jde-1)
     !DO i = its, MIN(ite,ide-1)
-    !	grid%therm_inert(i,j) = config_flags%init_TI 
+    !	grid%m_ti(i,j) = config_flags%init_TI 
     !ENDDO
     !ENDDO
-  grid%therm_inert = grid%therm_inert*0. + config_flags%init_TI 
+  grid%m_ti = grid%m_ti*0. + config_flags%init_TI 
   print *, 'constant thermal inertia ', config_flags%init_TI
 
@@ -411,5 +407,5 @@
 !DO j = jts, MIN(jte,jde-1)
 !DO i = its, MIN(ite,ide-1)
-!yeah = grid%mars_tsoil(i,k,j) + yeah
+!yeah = grid%m_tsoil(i,k,j) + yeah
 !yeahc = yeahc + 1.
 !ENDDO
@@ -418,5 +414,5 @@
 !DO j = jts, MIN(jte,jde-1)
 !DO i = its, MIN(ite,ide-1)
-!grid%mars_tsoil(i,k,j) = yeah / yeahc
+!grid%m_tsoil(i,k,j) = yeah / yeahc
 !ENDDO
 !ENDDO
@@ -427,5 +423,5 @@
 IF (config_flags%init_AL .ne. 0.) THEN
 
-  grid%albedo_gcm = grid%albedo_gcm*0. + config_flags%init_AL
+  grid%m_albedo = grid%m_albedo*0. + config_flags%init_AL
   print *, 'constant albedo ', config_flags%init_AL
 
@@ -477,9 +473,9 @@
         print *, 'p', grid%em_rh_gc(its+1,:,jts+1)
         print *, 'geop', grid%em_ght_gc(its+1,:,jts+1)
-        print *, 'albedo', grid%albedo_gcm(its+1,jts+1)
-        print *, 'thermal inertia', grid%therm_inert(its+1,jts+1)
+        print *, 'albedo', grid%m_albedo(its+1,jts+1)
+        print *, 'thermal inertia', grid%m_ti(its+1,jts+1)
         print *, 'topography', grid%ht(its+1,jts+1)
         print *, 'toposoil', grid%toposoil(its+1,jts+1)
-        print *, 'surface temperature', grid%tsk(its+1,jts+1)
+        print *, 'surface temperature', grid%m_tsurf(its+1,jts+1)
         print *, 'surface pressure', grid%psfc(its+1,jts+1), grid%em_psfc_gc(its+1,jts+1)
 
@@ -491,21 +487,21 @@
                 grid%em_rh_gc(i,:,j)=grid%em_rh_gc(its+1,:,jts+1)
                 grid%em_ght_gc(i,:,j) = grid%em_ght_gc(its+1,:,jts+1)
-grid%albedo_gcm(i,j) = grid%albedo_gcm(its+1,jts+1)
-grid%therm_inert(i,j) = grid%therm_inert(its+1,jts+1)
+grid%m_albedo(i,j) = grid%m_albedo(its+1,jts+1)
+grid%m_ti(i,j) = grid%m_ti(its+1,jts+1)
                 grid%ht(i,j) = grid%ht(its+1,jts+1)
                 grid%toposoil(i,j) = grid%toposoil(its+1,jts+1)
-                grid%tsk(i,j) = grid%tsk(its+1,jts+1)
+                grid%m_tsurf(i,j) = grid%m_tsurf(its+1,jts+1)
                 grid%psfc(i,j) = grid%psfc(its+1,jts+1)
                 grid%em_psfc_gc(i,j) = grid%em_psfc_gc(its+1,jts+1)
 grid%slpx(i,j) = 0.
 grid%slpy(i,j) = 0.
-grid%mars_emiss(i,j) = 0.95
-grid%mars_cice(i,j) = 0.
-grid%mars_wice(i,j) = 0.
-grid%mars_tsoil(i,:,j)=grid%mars_tsoil(its+1,:,jts+1)
+grid%m_emiss(i,j) = 0.95
+grid%m_co2ice(i,j) = 0.
+grid%m_h2oice(i,j) = 0.
+grid%m_tsoil(i,:,j)=grid%m_tsoil(its+1,:,jts+1)
 
 !!! 
-grid%mars_isoil(i,:,j)=grid%mars_isoil(its+1,:,jts+1)
-grid%mars_dsoil(i,:,j)=grid%mars_dsoil(its+1,:,jts+1)
+grid%m_isoil(i,:,j)=grid%m_isoil(its+1,:,jts+1)
+grid%m_dsoil(i,:,j)=grid%m_dsoil(its+1,:,jts+1)
 
 !! T.Michaels trick to break symmetry
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F	(revision 1234)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F	(revision 1236)
@@ -859,19 +859,19 @@
      &        ,MARS_MODE=config_flags%mars   &
            ! added variables
-     &        ,MARS_ALB=grid%albedo_gcm,MARS_TI=grid%therm_inert  &
-     &        ,MARS_CICE=grid%mars_cice,MARS_EMISS=grid%mars_emiss   &  
-     &        ,MARS_WICE=grid%mars_wice         &
-     &        ,MARS_TSOIL=grid%mars_tsoil       &
-     &        ,MARS_Q2=grid%mars_q2             &
-     &        ,MARS_TSURF=grid%mars_tsurf       &
+     &        ,M_ALBEDO=grid%m_albedo,M_TI=grid%m_ti  &
+     &        ,M_CO2ICE=grid%m_co2ice,M_EMISS=grid%m_emiss   &  
+     &        ,M_H2OICE=grid%m_h2oice     &
+     &        ,M_TSOIL=grid%m_tsoil       &
+     &        ,M_Q2=grid%m_q2             &
+     &        ,M_TSURF=grid%m_tsurf       &
 #ifdef NEWPHYS
-     &        ,MARS_FLUXRAD=grid%mars_fluxrad   &
-     &        ,MARS_WSTAR=grid%mars_wstar       &
-     &        ,MARS_ISOIL=grid%mars_isoil       &
-     &        ,MARS_DSOIL=grid%mars_dsoil       &
-     &        ,MARS_Z0=grid%mars_z0             &
+     &        ,M_FLUXRAD=grid%m_fluxrad   &
+     &        ,M_WSTAR=grid%m_wstar       &
+     &        ,M_ISOIL=grid%m_isoil       &
+     &        ,M_DSOIL=grid%m_dsoil       &
+     &        ,M_Z0=grid%m_z0             &
      &        ,CST_Z0=config_flags%init_Z0      &
 #endif
-     &        ,MARS_GW=grid%mars_gw  &  
+     &        ,M_GW=grid%m_gw  &  
      &        ,NUM_SOIL_LAYERS=config_flags%num_soil_layers    &
            ! cst fields
@@ -881,9 +881,4 @@
      &        ,DIFF_OPT=config_flags%diff_opt     &
      &        ,KM_OPT=config_flags%km_opt         &
-           ! additional diagnostics
-     &        ,UAVE=grid%em_uave, USTD=grid%em_ustd &
-     &        ,VAVE=grid%em_vave, VSTD=grid%em_vstd &
-     &        ,WAVE=grid%em_wave, WSTD=grid%em_wstd &
-     &        ,TAVE=grid%em_tave, TSTD=grid%em_tstd &
      &        ,HISTORY_INTERVAL=model_config_rec%history_interval(1)  &
 #ifndef NOPHYS
@@ -891,5 +886,23 @@
           ! OUTPUT VARIABLES !
           !------------------!
+#ifdef NEWPHYS
+     &       ,HR_SW=grid%HR_SW   &
+     &       ,HR_LW=grid%HR_LW   &
+     &       ,SWDOWNZ=grid%SWDOWNZ   &
+     &       ,TAU_DUST=grid%TAU_DUST   &
+     &       ,RDUST=grid%RDUST   &
+     &       ,QSURFDUST=grid%QSURFDUST   &
+     &       ,MTOT=grid%MTOT   &
+     &       ,ICETOT=grid%ICETOT   &
+     &       ,VMR_ICE=grid%VMR_ICE   &
+     &       ,TAU_ICE=grid%TAU_ICE   &
+     &       ,RICE=grid%RICE   &
+     &       ,ZMAX=grid%ZMAX   &
+     &       ,HFMAX=grid%HFMAX &
+     &       ,USTM=grid%USTM   &
+     &       ,HFX=grid%HFX &
+#else 
 #include "module_lmd_driver_output4.inc"
+#endif
 #endif
      &        ,SLPX=grid%slpx,SLPY=grid%slpy,RESTART=config_flags%restart)
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F	(revision 1234)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F	(revision 1236)
@@ -29,18 +29,18 @@
         num_3d_s,SCALAR, &
         MARS_MODE, &
-        MARS_ALB,MARS_TI,MARS_CICE,MARS_EMISS, &
-        MARS_WICE, &
-        MARS_TSOIL, &
-        MARS_Q2, &
-        MARS_TSURF, &
-#ifdef NEWPHYS
-        MARS_FLUXRAD, &
-        MARS_WSTAR, &
-        MARS_ISOIL, &
-        MARS_DSOIL, &
-        MARS_Z0, &
+        M_ALBEDO,M_TI,M_CO2ICE,M_EMISS, &
+        M_H2OICE, &
+        M_TSOIL, &
+        M_Q2, &
+        M_TSURF, &
+#ifdef NEWPHYS
+        M_FLUXRAD, &
+        M_WSTAR, &
+        M_ISOIL, &
+        M_DSOIL, &
+        M_Z0, &
         CST_Z0, &
 #endif
-        MARS_GW, &
+        M_GW, &
         NUM_SOIL_LAYERS, &
         CST_AL, &
@@ -49,8 +49,4 @@
         diff_opt, &
         km_opt, &
-        UAVE, USTD, &
-        VAVE, VSTD, &
-        WAVE, WSTD, &
-        TAVE, TSTD, &
         HISTORY_INTERVAL, &
 #ifndef NOPHYS
@@ -119,32 +115,30 @@
      MSFT,MSFU,MSFV, &
      XLAT,XLONG,HT,  &
-     MARS_ALB,MARS_TI,MARS_EMISS, &
+     M_ALBEDO,M_TI,M_EMISS, &
      SLPX,SLPY
 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
-     MARS_CICE,MARS_WICE, &
-     MARS_TSURF
+     M_CO2ICE,M_H2OICE, &
+     M_TSURF
 ! 3D arrays 
 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: &
      dz8w,p8w,p,exner,t,t8w,rho,u,v,w,z,th
 REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT ) :: &
-     MARS_Q2
+     M_Q2
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: &
-     UAVE, USTD, VAVE, VSTD, WAVE, WSTD, TAVE, TSTD
 INTEGER, INTENT(IN   ) :: HISTORY_INTERVAL
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 REAL, DIMENSION( ims:ime, NUM_SOIL_LAYERS, jms:jme ), INTENT(INOUT )  :: &
-     MARS_TSOIL 
+     M_TSOIL 
 #ifdef NEWPHYS
 REAL, INTENT(IN  ) :: CST_Z0
 REAL, DIMENSION( ims:ime, NUM_SOIL_LAYERS, jms:jme ), INTENT(IN   )  :: &
-     MARS_ISOIL, MARS_DSOIL         
+     M_ISOIL, M_DSOIL         
 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN   )  :: &
-     MARS_Z0
+     M_Z0
 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
-     MARS_FLUXRAD,MARS_WSTAR
+     M_FLUXRAD,M_WSTAR
 #endif
 REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN   )  :: &
-     MARS_GW
+     M_GW
 ! 4D arrays
 INTEGER, INTENT(IN ) :: num_3d_s
@@ -924,9 +918,9 @@
 !-----------------------------------------!
 IF (JULYR .ne. 9999) THEN
- zmea_val=MARS_GW(i,1,j)
- zstd_val=MARS_GW(i,2,j)
- zsig_val=MARS_GW(i,3,j)
- zgam_val=MARS_GW(i,4,j)
- zthe_val=MARS_GW(i,5,j)
+ zmea_val=M_GW(i,1,j)
+ zstd_val=M_GW(i,2,j)
+ zsig_val=M_GW(i,3,j)
+ zgam_val=M_GW(i,4,j)
+ zthe_val=M_GW(i,5,j)
 ELSE
  IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION GWdrag OFF'
@@ -943,5 +937,5 @@
 IF (JULYR .ne. 9999) THEN
  IF (CST_AL == 0) THEN 
- albedodat_val=MARS_ALB(i,j) 
+ albedodat_val=M_ALBEDO(i,j) 
  ELSE 
  albedodat_val=CST_AL
@@ -949,5 +943,5 @@
  ENDIF
  IF (CST_TI == 0) THEN 
- inertiedat_val=MARS_TI(i,j) 
+ inertiedat_val=M_TI(i,j) 
  ELSE 
  inertiedat_val=CST_TI
@@ -967,5 +961,5 @@
 IF (JULYR .ne. 9999) THEN
  IF (CST_Z0 == 0) THEN 
-   z0_val = MARS_Z0(i,j) 
+   z0_val = M_Z0(i,j) 
  ELSE 
    z0_val = CST_Z0
@@ -999,12 +993,11 @@
 ! Ground temperature, emissivity, CO2 ice cover !
 !-----------------------------------------------!
-IF (.not. restart) THEN
-   tsurf_val=tsk(i,j) ! because tsk is not updated in lmd_driver, the stored value in restart is at t, not t+dt
-                      ! note to aslmd: i dont know why we dont update tsk, so I use MARS_TSURF to be conservative
-ELSE
-   tsurf_val=MARS_TSURF(i,j)
-ENDIF
-emis_val=MARS_EMISS(i,j)
-co2ice_val=MARS_CICE(i,j)
+IF (M_TSURF(i,j) .gt. 0.) THEN
+  tsurf_val=M_TSURF(i,j)
+ELSE
+  tsurf_val=TSK(i,j) ! retro-compatibility
+ENDIF
+emis_val=M_EMISS(i,j)
+co2ice_val=M_CO2ICE(i,j)
 
 !------------------------!
@@ -1012,12 +1005,12 @@
 !------------------------!
 IF (JULYR .ne. 9999) THEN
-  IF (MARS_TSOIL(i,1,j) .gt. 0.) THEN
-   tsoil_val(:)=MARS_TSOIL(i,:,j)
+  IF (M_TSOIL(i,1,j) .gt. 0.) THEN
+   tsoil_val(:)=M_TSOIL(i,:,j)
   ELSE
    tsoil_val = tsoil_val*0. + tsurf_val
   ENDIF
 #ifdef NEWPHYS
-  isoil_val(:)=MARS_ISOIL(i,:,j)
-  dsoil_val(:)=MARS_DSOIL(i,:,j)
+  isoil_val(:)=M_ISOIL(i,:,j)
+  dsoil_val(:)=M_DSOIL(i,:,j)
 #endif
 ELSE
@@ -1028,7 +1021,7 @@
    ELSE
      !this is a restart run. We must not set tsoil to tsurf in the init.
-     !tsoil was saved in physiq.F under the name MARS_TSOIL in the restart file
+     !tsoil was saved in physiq.F under the name M_TSOIL in the restart file
      !(see Registry)
-     tsoil_val(k)=MARS_TSOIL(i,k,j)
+     tsoil_val(k)=M_TSOIL(i,k,j)
    ENDIF
 
@@ -1055,5 +1048,5 @@
     CASE(1) 
     qsurf_val(1)=0. 
-    qsurf_val(2)=MARS_WICE(i,j)    !! logique avec wtnom(2) = 'h2o_ice' defini ci-dessus
+    qsurf_val(2)=M_H2OICE(i,j)    !! logique avec wtnom(2) = 'h2o_ice' defini ci-dessus
                                    !! ----- retrocompatible ancienne physique
                                    !! ----- [H2O ice is last tracer in qsurf in LMD physics]
@@ -1066,10 +1059,10 @@
     CASE(11) 
     qsurf_val(1)=0.
-    qsurf_val(2)=MARS_WICE(i,j)    !! logique avec wtnom(2) = 'h2o_ice' defini ci-dessus
+    qsurf_val(2)=M_H2OICE(i,j)    !! logique avec wtnom(2) = 'h2o_ice' defini ci-dessus
     qsurf_val(3)=0.                !! not coupled with lifting for the moment [non remobilise]
     qsurf_val(4)=0.
     CASE(12)    
     qsurf_val(1)=0.
-    qsurf_val(2)=MARS_WICE(i,j)    !! logique avec wtnom(2) = 'h2o_ice' defini ci-dessus
+    qsurf_val(2)=M_H2OICE(i,j)    !! logique avec wtnom(2) = 'h2o_ice' defini ci-dessus
     qsurf_val(3)=0.                !! not coupled with lifting for the moment [non remobilise]
     qsurf_val(4)=0.
@@ -1156,8 +1149,8 @@
 #endif
 ELSE
-   q2_val(:)=MARS_Q2(i,:,j)
-#ifdef NEWPHYS
-   fluxrad_val=MARS_FLUXRAD(i,j)
-   wstar_val=MARS_WSTAR(i,j)
+   q2_val(:)=M_Q2(i,:,j)
+#ifdef NEWPHYS
+   fluxrad_val=M_FLUXRAD(i,j)
+   wstar_val=M_WSTAR(i,j)
 #endif
 ENDIF
@@ -1524,28 +1517,28 @@
 #ifndef NORESTART
 #ifdef SPECIAL_NEST_SAVE
-MARS_TSOIL(i,:,j)=save_tsoil_restart(subs,:,id)
-MARS_CICE(i,j)=save_co2ice_restart(subs,id)
-MARS_Q2(i,kps:kpe+1,j)=save_q2_restart(subs,:,id)
+M_TSOIL(i,:,j)=save_tsoil_restart(subs,:,id)
+M_CO2ICE(i,j)=save_co2ice_restart(subs,id)
+M_Q2(i,kps:kpe+1,j)=save_q2_restart(subs,:,id)
 SELECT CASE (MARS_MODE)
    CASE (1,11,12)
-     MARS_WICE(i,j)=save_qsurf_restart(subs,2,id)  !! see above Tracer at surface
+     M_H2OICE(i,j)=save_qsurf_restart(subs,2,id)  !! see above Tracer at surface
 END SELECT
-MARS_TSURF(i,j)=save_tsurf_restart(subs,id)
-#ifdef NEWPHYS
-MARS_WSTAR(i,j)=save_wstar_restart(subs,id)
-MARS_FLUXRAD(i,j)=save_fluxrad_restart(subs,id)
+M_TSURF(i,j)=save_tsurf_restart(subs,id)
+#ifdef NEWPHYS
+M_WSTAR(i,j)=save_wstar_restart(subs,id)
+M_FLUXRAD(i,j)=save_fluxrad_restart(subs,id)
 #endif
 #else
-MARS_TSOIL(i,:,j)=save_tsoil_restart(subs,:)
-MARS_CICE(i,j)=save_co2ice_restart(subs)
-MARS_Q2(i,kps:kpe+1,j)=save_q2_restart(subs,:)
+M_TSOIL(i,:,j)=save_tsoil_restart(subs,:)
+M_CO2ICE(i,j)=save_co2ice_restart(subs)
+M_Q2(i,kps:kpe+1,j)=save_q2_restart(subs,:)
 SELECT CASE (MARS_MODE)
    CASE (1,11,12)
-     MARS_WICE(i,j)=save_qsurf_restart(subs,2)  !! see above Tracer at surface
+     M_H2OICE(i,j)=save_qsurf_restart(subs,2)  !! see above Tracer at surface
 END SELECT
-MARS_TSURF(i,j)=save_tsurf_restart(subs)
-#ifdef NEWPHYS
-MARS_WSTAR(i,j)=save_wstar_restart(subs)
-MARS_FLUXRAD(i,j)=save_fluxrad_restart(subs)
+M_TSURF(i,j)=save_tsurf_restart(subs)
+#ifdef NEWPHYS
+M_WSTAR(i,j)=save_wstar_restart(subs)
+M_FLUXRAD(i,j)=save_fluxrad_restart(subs)
 #endif
 #endif
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F.new
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F.new	(revision 1234)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F.new	(revision 1236)
@@ -30,29 +30,19 @@
         num_3d_s,SCALAR, &
         MARS_MODE, &
-        MARS_ALB,MARS_TI,MARS_CICE,MARS_EMISS, &
-        MARS_WICE, &
-        MARS_TSOIL, &
-        MARS_Q2, &
-        MARS_TSURF, &
-        MARS_FLUXRAD, &
-        MARS_WSTAR, &
-        MARS_ISOIL, &
-        MARS_DSOIL, &
-        MARS_Z0, &
-        CST_Z0, &
-        MARS_GW, &
+        M_ALBEDO,M_TI,M_CO2ICE,M_EMISS, &
+        M_H2OICE,M_TSOIL,M_Q2,M_TSURF, &
+        M_FLUXRAD,M_WSTAR,M_ISOIL,M_DSOIL,&
+        M_Z0, CST_Z0, M_GW, &
         NUM_SOIL_LAYERS, &
-        CST_AL, &
-        CST_TI, &
-        isfflx, &
-        diff_opt, &
-        km_opt, &
-        UAVE, USTD, &
-        VAVE, VSTD, &
-        WAVE, WSTD, &
-        TAVE, TSTD, &
+        CST_AL, CST_TI, &
+        isfflx, diff_opt, km_opt, &
         HISTORY_INTERVAL, &
+! sert a rien ce NOPHYS. il le faudrait sur tout.
 #ifndef NOPHYS
-#include "module_lmd_driver_output1.inc"
+        HR_SW,HR_LW,SWDOWNZ,&
+        TAU_DUST,RDUST,QSURFDUST,&
+        MTOT,ICETOT,VMR_ICE,TAU_ICE,RICE,&
+        HFMAX,ZMAX,&
+        USTM,HFX,&
 #endif
         SLPX,SLPY,RESTART)
@@ -83,9 +73,11 @@
                         peri_day,obliquit,emin_turb, &
                         lmixmin
-   use turb_mod, only: q2,wstar,hfmax_th
+   use turb_mod, only: q2,wstar,ustar,sensibFlux,&
+                       hfmax_th,zmax_th,turb_resolved
    use dimradmars_mod, only: fluxrad
    use tracer_mod, only: noms
    use comcstfi_h, only: omeg,mugaz
    use comgeomfi_h, only: ini_fillgeom
+   USE comm_wrf
 #endif
 
@@ -93,16 +85,4 @@
   IMPLICIT NONE
 !==================================================================
-
-!==================================================================
-! COMMON
-!==================================================================
-
-#ifndef NOPHYS
-!
-! INCLUDE AUTOMATIQUEMENT GENERE A PARTIR DU REGISTRY
-!
-include "../mars_lmd/libf/phymars/wrf_output_2d.h"
-include "../mars_lmd/libf/phymars/wrf_output_3d.h"
-#endif
 
 !==================================================================
@@ -124,34 +104,34 @@
 REAL, INTENT(IN  ) :: CST_AL, CST_TI 
 REAL, INTENT(IN  ) :: PTOP
+INTEGER, INTENT(IN   ) :: HISTORY_INTERVAL
 ! 2D arrays          
-REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN   )  :: &
+REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: &
      MSFT,MSFU,MSFV, &
      XLAT,XLONG,HT,  &
-     MARS_ALB,MARS_TI,MARS_EMISS, &
-     SLPX,SLPY
-REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
-     MARS_CICE,MARS_WICE, &
-     MARS_TSURF
+     M_ALBEDO,M_TI,M_EMISS, &
+     SLPX,SLPY, &
+     M_CO2ICE,M_H2OICE, &
+     M_TSURF, M_Z0, &
+     M_FLUXRAD,M_WSTAR, &
+     PSFC,TSK
+REAL, DIMENSION( ims:ime, jms:jme ), INTENT(OUT) :: &
+     SWDOWNZ,&
+     TAU_DUST,QSURFDUST,&
+     MTOT,ICETOT,TAU_ICE,&
+     HFMAX,ZMAX,&
+     USTM,HFX
 ! 3D arrays 
 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: &
      dz8w,p8w,p,exner,t,t8w,rho,u,v,w,z,th
+REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(OUT ) :: &
+     RTHBLTEN,RUBLTEN,RVBLTEN, &
+     HR_SW,HR_LW,RDUST,VMR_ICE,RICE
 REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT ) :: &
-     MARS_Q2
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: &
-     UAVE, USTD, VAVE, VSTD, WAVE, WSTD, TAVE, TSTD
-INTEGER, INTENT(IN   ) :: HISTORY_INTERVAL
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+     M_Q2
 REAL, DIMENSION( ims:ime, NUM_SOIL_LAYERS, jms:jme ), INTENT(INOUT )  :: &
-     MARS_TSOIL 
+     M_TSOIL,M_ISOIL, M_DSOIL 
 REAL, INTENT(IN  ) :: CST_Z0
-REAL, DIMENSION( ims:ime, NUM_SOIL_LAYERS, jms:jme ), INTENT(IN   )  :: &
-     MARS_ISOIL, MARS_DSOIL         
-REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN   )  :: &
-     MARS_Z0
-REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
-     MARS_FLUXRAD,MARS_WSTAR
 REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN   )  :: &
-     MARS_GW
+     M_GW
 ! 4D arrays
 INTEGER, INTENT(IN ) :: num_3d_s
@@ -160,26 +140,4 @@
 ! Logical
 LOGICAL, INTENT(IN ) :: restart
-
-!-------------------------------------------
-! OUTPUT VARIABLES
-!-------------------------------------------
-!
-! Generated from Registry
-!
-! default definitions :
-! 2D : TSK, PSFC
-! 3D : RTHBLTEN,RUBLTEN,RVBLTEN
-#ifndef NOPHYS
-#include "module_lmd_driver_output2.inc"
-   REAL, DIMENSION(:,:), ALLOCATABLE :: output_tab2d
-   REAL, DIMENSION(:,:,:), ALLOCATABLE :: output_tab3d
-#else
-   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: PSFC,TSK
-   REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(OUT)  :: RTHBLTEN,RUBLTEN,RVBLTEN
-#endif
-!-------------------------------------------
-! OUTPUT VARIABLES
-!-------------------------------------------
-
 
 !-------------------------------------------   
@@ -201,5 +159,4 @@
    REAL :: aire_val,lat_val,lon_val
    REAL :: phisfi_val,albedodat_val,inertiedat_val
-   REAL :: tsurf_val,co2ice_val,emis_val
    REAL :: zmea_val,zstd_val,zsig_val,zgam_val,zthe_val
    REAL :: theta_val, psi_val
@@ -230,5 +187,4 @@
    INTEGER :: test
    REAL :: wappel_phys
-   LOGICAL :: flag_LES
    LOGICAL, SAVE :: flag_first_restart
 !**************************************************
@@ -270,5 +226,5 @@
 
 IF (JULYR .ne. 9999) THEN
-    flag_LES = .false.  ! "True" LES is not available in this version
+    turb_resolved = .false.  ! "True" LES is not available in this version
     PRINT *, '*** REAL-CASE SIMULATION ***'
 ELSE
@@ -278,5 +234,5 @@
           PRINT *, '*** diff_opt = 2 *** km_opt = 2'
           PRINT *, '*** forcing is isfflx = ',isfflx 
-          flag_LES = .true.
+          turb_resolved = .true.
           !! SPECIAL LES
      ELSE
@@ -284,5 +240,5 @@
           PRINT *, '*** diff_opt = ',diff_opt
           PRINT *, '*** km_opt = ',km_opt
-          flag_LES = .false.
+          turb_resolved = .false.
           !! IDEALIZED, no LES
           !! cependant, ne veut-on pas pouvoir
@@ -302,5 +258,5 @@
 jte = j_end(num_tiles)
 !!
-IF (flag_LES .eqv. .false.) THEN
+IF (turb_resolved .eqv. .false.) THEN
  relax=0
  sponge_top=0               ! another value than 0 triggers instabilities  
@@ -311,5 +267,5 @@
 jps=jts
 jpe=jte
-IF (flag_LES .eqv. .false.) THEN
+IF (turb_resolved .eqv. .false.) THEN
  IF (ips .eq. ids)   ips=its+relax !! IF tests necesary for parallel runs
  IF (ipe .eq. ide-1) ipe=ite-relax
@@ -318,5 +274,5 @@
 ENDIF
 kps=kts         !! start at surface 
-IF (flag_LES .eqv. .false.) THEN
+IF (turb_resolved .eqv. .false.) THEN
  kpe=kte-sponge_top
 ELSE
@@ -492,6 +448,5 @@
 ! inputs ...
 #ifndef NOPHYS
-ALLOCATE(output_tab2d(ngrid,n2d))
-ALLOCATE(output_tab3d(ngrid,nlayer,n3d))
+CALL allocate_comm_wrf(ngrid,nlayer)
 #endif
 ALLOCATE(q2_val(nlayer+1))
@@ -841,5 +796,5 @@
 IF (JULYR .ne. 9999) THEN 
  IF (CST_AL == 0) THEN
- albedodat_val=MARS_ALB(i,j)
+ albedodat_val=M_ALBEDO(i,j)
  ELSE 
  albedodat_val=CST_AL
@@ -855,9 +810,9 @@
 !-----------------------------------------!
 IF (JULYR .ne. 9999) THEN
- zmea_val=MARS_GW(i,1,j)
- zstd_val=MARS_GW(i,2,j)
- zsig_val=MARS_GW(i,3,j)
- zgam_val=MARS_GW(i,4,j)
- zthe_val=MARS_GW(i,5,j)
+ zmea_val=M_GW(i,1,j)
+ zstd_val=M_GW(i,2,j)
+ zsig_val=M_GW(i,3,j)
+ zgam_val=M_GW(i,4,j)
+ zthe_val=M_GW(i,5,j)
 ELSE
  IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION GWdrag OFF'
@@ -880,5 +835,5 @@
 IF (JULYR .ne. 9999) THEN
  IF (CST_Z0 == 0) THEN
-   z0_val = MARS_Z0(i,j)
+   z0_val = M_Z0(i,j)
  ELSE
    z0_val = CST_Z0
@@ -905,13 +860,7 @@
 ! Ground temperature, emissivity, CO2 ice cover !
 !-----------------------------------------------!
-IF (.not. restart) THEN
-   tsurf_val=tsk(i,j) ! because tsk is not updated in lmd_driver, the stored value in restart is at t, not t+dt
-                      ! note to aslmd: i dont know why we dont update tsk, so I use MARS_TSURF to be conservative
-ELSE
-   tsurf_val=MARS_TSURF(i,j)
-ENDIF
-tsurf(subs) = tsurf_val
-emis(subs) = MARS_EMISS(i,j)
-co2ice(subs) = MARS_CICE(i,j)
+tsurf(subs) = M_TSURF(i,j)
+emis(subs) = M_EMISS(i,j)
+co2ice(subs) = M_CO2ICE(i,j)
 !-------------------!
 ! Tracer at surface !
@@ -920,5 +869,5 @@
 SELECT CASE (MARS_MODE)
     CASE(1)
-    qsurf_val(2)=MARS_WICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
+    qsurf_val(2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
                                    !! ----- retrocompatible ancienne physique
                                    !! ----- [H2O ice is last tracer in qsurf in LMD physics]
@@ -929,8 +878,8 @@
     qsurf_val(2)=q_prof(1,2)     
     CASE(11)
-    qsurf_val(2)=MARS_WICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
+    qsurf_val(2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
     qsurf_val(3)=0.                !! not coupled with lifting for the moment [non remobilise]
     CASE(12)
-    qsurf_val(2)=MARS_WICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
+    qsurf_val(2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
     qsurf_val(3)=0.                !! not coupled with lifting for the moment [non remobilise]
 END SELECT
@@ -945,5 +894,5 @@
 IF (JULYR .ne. 9999) THEN
  IF (CST_TI == 0) THEN
- inertiedat_val=MARS_TI(i,j)
+ inertiedat_val=M_TI(i,j)
  ELSE
  inertiedat_val=CST_TI
@@ -957,6 +906,6 @@
 !--pb de dimensions???!!???
 IF (JULYR .ne. 9999) THEN
-  isoil_val(:)=MARS_ISOIL(i,:,j)
-  dsoil_val(:)=MARS_DSOIL(i,:,j)
+  isoil_val(:)=M_ISOIL(i,:,j)
+  dsoil_val(:)=M_DSOIL(i,:,j)
 ELSE
    IF ( nsoil .lt. 18 ) THEN
@@ -986,21 +935,10 @@
 ! Deep soil temperatures ! 
 !------------------------!
-IF (JULYR .ne. 9999) THEN
-  IF (MARS_TSOIL(i,1,j) .gt. 0.) THEN
-   tsoil_val(:)=MARS_TSOIL(i,:,j)
-  ELSE
-   tsoil_val = tsoil_val*0. + tsurf_val
-  ENDIF
-ELSE
-  IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION tsoil is set to tsurf'
+IF (M_TSOIL(i,1,j) .gt. 0. .and. JULYR .ne. 9999) THEN
+  tsoil_val(:)=M_TSOIL(i,:,j)
+ELSE
+  IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** no tsoil. set it to tsurf.'
   do k=1,nsoil
-   IF (.not.restart) THEN
-     tsoil_val(k) = tsurf_val
-   ELSE
-     !this is a restart run. We must not set tsoil to tsurf in the init.
-     !tsoil was saved in physiq.F under the name MARS_TSOIL in the restart file
-     !(see Registry)
-     tsoil_val(k)=MARS_TSOIL(i,k,j)
-   ENDIF
+   tsoil_val(k) = M_TSURF(i,j)
   enddo
 ENDIF
@@ -1014,6 +952,6 @@
    wstar_val=0.
 ELSE
-   q2_val(:)=MARS_Q2(i,:,j)
-   wstar_val=MARS_WSTAR(i,j)
+   q2_val(:)=M_Q2(i,:,j)
+   wstar_val=M_WSTAR(i,j)
 ENDIF
 q2(subs,:) = q2_val(:)
@@ -1026,5 +964,5 @@
    fluxrad_val=0.
 ELSE
-   fluxrad_val=MARS_FLUXRAD(i,j)
+   fluxrad_val=M_FLUXRAD(i,j)
 ENDIF
 fluxrad(subs) = fluxrad_val
@@ -1107,7 +1045,7 @@
              firstcall,lastcall,pday,ptime,ptimestep, &
              pplev,pplay,pphi,pu,pv,pt,pq,pw,         &
-             pdu,pdv,pdt,pdq,pdpsrf,tracerdyn,        &
-             output_tab2d,output_tab3d,flag_LES)
+             pdu,pdv,pdt,pdq,pdpsrf,tracerdyn)
 #endif
+print *, '** Mars ** CALL TO LMD PHYSICS DONE'
 DEALLOCATE(pplev)
 DEALLOCATE(pplay)
@@ -1118,19 +1056,4 @@
 DEALLOCATE(pw)
 DEALLOCATE(pq)
-
-!-------------------------------!
-! PHYSIQ OUTPUT IN THE WRF FILE !
-!-------------------------------!
-#ifndef NOPHYS
-DO j = jps,jpe
-DO i = ips,ipe
-subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
-#include "module_lmd_driver_output3.inc"  
-       !  ^-- generated from Registry
-ENDDO
-ENDDO
-DEALLOCATE(output_tab2d)
-DEALLOCATE(output_tab3d)
-#endif
 
 !---------------------------------------------------------------------------------!
@@ -1150,4 +1073,49 @@
 dq_save(:,:,:)=pdq(:,:,:)
 #endif
+
+!! OUTPUT OUTPUT OUTPUT
+DO j = jps,jpe
+DO i = ips,ipe
+
+  subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+  !-------------------------------------------------------!
+  ! Save key variables for restart and output and nesting !  
+  !-------------------------------------------------------!
+  M_TSOIL(i,:,j) = tsoil(subs,:)
+  M_CO2ICE(i,j) = co2ice(subs)
+  M_Q2(i,kps:kpe+1,j) = q2(subs,:)
+  M_TSURF(i,j) = tsurf(subs)
+  M_WSTAR(i,j) = wstar(subs)
+  M_FLUXRAD(i,j) = fluxrad(subs)
+  SELECT CASE (MARS_MODE)
+   CASE (1,11,12)
+     M_H2OICE(i,j) = qsurf(subs,2)  !! see above Tracer at surface
+  END SELECT
+
+  !! output only (arrays already in phys modules)
+  HFMAX(i,j) = HFMAX_TH(subs)
+  ZMAX(i,j) = ZMAX_TH(subs)
+  USTM(i,j) = ustar(subs)
+  HFX(i,j) = sensibFlux(subs)
+
+  !! output only (cf comm_wrf)
+  SWDOWNZ(i,j) = comm_SWDOWNZ(subs)
+  TAU_DUST(i,j) = comm_TAU_DUST(subs)
+  QSURFDUST(i,j) = comm_QSURFDUST(subs)
+  MTOT(i,j) = comm_MTOT(subs)
+  ICETOT(i,j) = comm_ICETOT(subs)
+  TAU_ICE(i,j) = comm_TAU_ICE(subs)
+  HR_SW(i,kps:kpe,j) = comm_HR_SW(subs,kps:kpe)
+  HR_LW(i,kps:kpe,j) = comm_HR_LW(subs,kps:kpe)
+  RDUST(i,kps:kpe,j) = comm_RDUST(subs,kps:kpe)
+  VMR_ICE(i,kps:kpe,j) = comm_VMR_ICE(subs,kps:kpe)
+  RICE(i,kps:kpe,j) = comm_RICE(subs,kps:kpe)
+
+ENDDO
+ENDDO
+
+CALL deallocate_comm_wrf
+
 ENDIF call_physics
 
@@ -1206,18 +1174,4 @@
   END SELECT
     
-  !------------------------------------!
-  ! Save key variables for restart !  
-  !------------------------------------!
-  MARS_TSOIL(i,:,j) = tsoil(subs,:)
-  MARS_CICE(i,j) = co2ice(subs)
-  MARS_Q2(i,kps:kpe+1,j) = q2(subs,:)
-  MARS_TSURF(i,j) = tsurf(subs)
-  MARS_WSTAR(i,j) = wstar(subs)
-  MARS_FLUXRAD(i,j) = fluxrad(subs)
-  SELECT CASE (MARS_MODE)
-   CASE (1,11,12)
-     MARS_WICE(i,j) = qsurf(subs,2)  !! see above Tracer at surface
-  END SELECT
-
 ENDDO
 ENDDO
