Index: trunk/mesoscale/LMD_MM_MARS/SIMU/runmeso
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SIMU/runmeso	(revision 117)
+++ trunk/mesoscale/LMD_MM_MARS/SIMU/runmeso	(revision 118)
@@ -25,4 +25,7 @@
 #changeregis=1 ## 1 if changed registry 
 i_want_to_compile=1
+
+scenario=""
+scenario="storm"
 
 if [[ "${LMDMOD}" = "" ]]
@@ -62,4 +65,9 @@
          echo '**********************************************'
          newphys=1
+	 if [[ ! ("${scenario}" == "") ]]
+	 then	  
+	    echo '** Scenario              >>>' ${scenario}
+	    echo '**********************************************'
+         fi
        fi
 
@@ -251,7 +259,11 @@
  ./makemeso -d < tmp > /dev/null
  else
- ./makemeso -d -p < tmp > /dev/null
+   if [[ "${scenario}" == "" ]]
+   then
+   ./makemeso -d -p < tmp > /dev/null
+   else
+   ./makemeso -d -p -s ${scenario} < tmp > /dev/null
+   fi
  fi
-
  \rm tmp 2> /dev/null
  work_folder=${meso_folder}'/'$(more what_folder)
@@ -366,5 +378,10 @@
        ./makemeso -r < ${simu_folder}/makemeso_input
      else
-       ./makemeso -r -p < ${simu_folder}/makemeso_input
+         if [[ "${scenario}" == "" ]]
+         then
+          ./makemeso -r -p < ${simu_folder}/makemeso_input
+         else
+          ./makemeso -r -p -s ${scenario} < ${simu_folder}/makemeso_input
+         fi
      fi
      ##******
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/Registry.EM
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/Registry.EM	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/Registry.EM	(revision 118)
@@ -0,0 +1,1552 @@
+## WARNING: this file is autogenerated from Registry/Registry.EM. Changes may be lost
+# Registry file, EM
+#                                               
+# At the present time this file is managed manually and edited by hand.                                         
+#                                               
+################################################################################
+# Dimension specifications
+#
+# This section of the Registry file is used to specify the dimensions
+# that will be used to define arrays. Dim is the one-letter name of the
+# dimension.  How defined can either be "standard_domain", which means
+# that the dimension (1) is one of the three spatial dimensions and (2)
+# it will be set using the standard namelist mechanism and domain data
+# structure dimension fields (e.g. sd31,ed31,sd32...).
+#
+# Order refers to which of the three sets of just-mentioned internal
+# dimension variables the dimension is referred to by in the driver.
+# That is, is it the first, second, or third dimension.  The registry
+# infers the mapping of its internal dimensions according to the
+# combination of Order and Coord-axis that are specified in this table.
+# Note that it is all right to more than one dimension name for, say, the
+# x dimension.  However, the Order and Coord-axis relationship must be
+# consistent throughout.
+# 
+# Note: these entries do not enforce storage order on a particular field.
+# That is determined by the dimension strings for each field. But it does
+# relate the dimspec to the internal data structures that the driver uses
+# to maintain the three physical domain dimensions.
+# 
+# "How defined" can also specify the name of a namelist variable from which
+# the definition for the dimension will come; this is specified as
+# "namelist=<variable name>".  The namelist variable must have been
+# defined as an integer and with only one entry in the rconfig table. Or
+# a constant can be specified.  The coordinate axis for the dimension is
+# either X, Y, Z, or C (for "not a spatial dimension").  The Dimname is
+# the descriptive name of the dimension that will be included in the
+# metadata in data sets.  Note that the b, f, and t modifiers that appear
+# as the last characters of dimension strings used # in state and # i1
+# registry definitions are not dimensions and do not need to be declared
+# here.
+#
+
+# Available characters for dimspec: 0123456789@%+=|?.!&[{}]
+
+#<Table>  <Dim>  <Order> <How defined>         <Coord-axis>  <Dimname in Datasets>
+dimspec    i      1     standard_domain              x          west_east
+dimspec    j      3     standard_domain              y          south_north
+dimspec    k      2     standard_domain              z          bottom_top
+dimspec    l      2     namelist=num_soil_layers     z          soil_layers
+dimspec    u      2     namelist=num_land_cat        z          land_cat
+dimspec    s      2     namelist=num_soil_cat        z          soil_cat
+dimspec    p      -     constant=7501                c          microphysics_rstrt_state
+dimspec    w      -     namelist=spec_bdy_width      c          spec_bdy_width
+dimspec    e      3     namelist=ensdim              z          ensemble dimension
+dimspec    z      -     namelist=max_obs          c          max_obs
+dimspec    h      -     namelist=nobs_err_flds    c          nobs_err_flds
+dimspec    r      -     namelist=nobs_ndg_vars    c          nobs_ndg_vars
+dimspec    g      2     namelist=num_metgrid_levels  z          num_metgrid_levels
+dimspec    m      2     constant=12                  z          months_per_year
+dimspec    a      -     namelist=cam_abs_dim1     c          cam_abs_dim1
+dimspec    c      -     namelist=cam_abs_dim2     z          cam_abs_dim2
+dimspec    q      2     namelist=levsiz           z          levsiz
+dimspec    d      2     namelist=paerlev          z          paerlev
+dimspec    v      -     constant=1                z          one
+
+
+################################################################################
+################################################################################
+################################################################################
+
+
+####MARS MARS MARS MARS MARS
+####MARS MARS MARS MARS MARS
+#### 
+#### 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
+####
+############ name in WRF !!!!! ############# name in NETCDF !!!! ############################################## name in meso_physiq !!!!!
+state  real  TSURF     ij   misc  1  -  rhd  "TSURF"     "SURF TEMPERATURE"                "K"       #SAVEMARS2 tsurf
+state  real  CO2ICE    ij   misc  1  -  rd  "CO2ICE"    "CO2 GROUND ICE"                  "kg m-2"  #SAVEMARS2 co2ice
+state  real  EMISSIV   ij   misc  1  -  rd   "EMISSIV"   "EMISSIVITY"                      ""        #SAVEMARS2 emis
+state  real  THETA     ij   misc  1  -  rd   "THETA"     "SLOPE INCLINATION"               "deg"     #SAVEMARS2 theta_sl
+state  real  PSI       ij   misc  1  -  rd   "PSI"       "SLOPE ORIENTATION"               "deg"     #SAVEMARS2 psi_sl
+state  real  TAU_DUST  ij   misc  1  -  rd  "TAU_DUST"  "REFERENCE VISIBLE DUST OPACITY"  ""        #SAVEMARS2 tauref
+state  real  SWDOWNZ   ij   misc  1  -  rd  "SWDOWNZ"   "DOWNWARD SW FLUX AT SURFACE"     "W m-2"   #SAVEMARS2 fluxsurf_sw_tot      
+state  real  LWDOWNZ   ij   misc  1  -  rd  "LWDOWNZ"   "DOWNWARD LW FLUX AT SURFACE"     "W m-2"   #SAVEMARS2 fluxsurf_lw
+state  real  SWUP      ij   misc  1  -  rd   "SWUP"      "UPWARD SW FLUX AT TOP"           "W m-2"   #SAVEMARS2 fluxtop_sw_tot    
+state  real  LWUP      ij   misc  1  -  rd   "LWUP"      "UPWARD LW FLUX AT TOP"           "W m-2"   #SAVEMARS2 fluxtop_lw
+state  real  MTOT      ij   misc  1  -  rd  "MTOT"      "TOTAL MASS WATER VAPOR in pmic"  "pmic"    #SAVEMARS2 mtot
+state  real  ICETOT    ij   misc  1  -  rd  "ICETOT"    "TOTAL MASS WATER ICE"            "kg m-2"  #SAVEMARS2 icetot
+state  real  RAVE      ij   misc  1  -  rd   "RAVE"      "MEAN ICE RADIUS"                 "m"       #SAVEMARS2 rave
+state  real  RICE      ikj  misc  1  -  rd  "RICE"      "ICE RADIUS"                      "m"       #SAVEMARS3 rice
+state  real  HR_SW     ikj  misc  1  -  rhd   "HR_SW"     "HEATING RATE SW"                 "K/s"     #SAVEMARS3 zdtsw
+state  real  HR_LW     ikj  misc  1  -  rhd   "HR_LW"     "HEATING RATE LW"                 "K/s"     #SAVEMARS3 zdtlw
+state  real  HR_SH     ikj  misc  1  -  rd   "HR_SH"     "HEATING RATE sens. heat"         "K/s"     #SAVEMARS3 zdtdif
+state  real  QSURFICE  ij   misc  1  -  rd  "QSURFICE"  "WATER ICE AT SURFACE"            "kg m-2"  #SAVEMARS2 qsurfice
+state  real  RDUST     ikj  misc  1  -  rhd  "RDUST"     "DUST RADIUS"                     "m"       #SAVEMARS3 rdust
+state  real  HR_NIR    ikj  misc  1  -  rd   "HR_NIR"    "HEATING RATE nirco2"             "K/s"     #SAVEMARS3 zdtnirco2
+state  real  HR_NLTE   ikj  misc  1  -  rd   "HR_NLTE"   "HEATING RATE nlte"               "K/s"     #SAVEMARS3 zdtnlte
+state  real  ALBBARE   ij   misc  1  -  rd   "ALBBARE"   "SOIL ALBEDO"                     ""        #SAVEMARS2 albedodat
+state  real  VMR_ICE   ikj  misc  1  -  rd  "VMR_ICE"   "VOL. MIXING RATIO ICE"           "ppm"     #SAVEMARS3 vmr
+state  real  TAU_ICE   ij   misc  1  -  rd  "TAU_ICE"   "CLOUD OD at 825 cm-1 TES"        ""        #SAVEMARS2 tauTES
+state  real  TAU       ij   misc  1  -  rhd  "TAU"      "Tau effectif"                    ""        #SAVEMARS2 TAU_lay 
+state  real  dustot    ij   misc  1  -  rhd  "dustot"    "masse poussiere surfacique"     "kg m-2"  #SAVEMARS2 dustot   
+state  real  QS_dust   ij   misc  1  -  rhd  "QS_dust"   "Dust quantity at surfice"       "kg m-2"  #SAVEMARS2 qsurfice_dust
+state  real  sed       ij   misc  1  -  rhd   "sed"       "tendency of sedim"              "kg"      #SAVEMARS2 zdqssed_diag
+state  real  dif       ij   misc  1  -  rhd   "dif"       "tendency of lift"               "kg"      #SAVEMARS2 zdqsdif_diag
+state  real  zdq       ij   misc  1  -  rhd   "zdq"       "tendency general"               "kg"      #SAVEMARS2 pdq_diag
+state  real  dsodust   ikj  misc  1  -  rhd   "dsodust"   "aerosol corrige"                ""        #SAVEMARS3 dsodust
+####
+####
+####MARS MARS MARS MARS MARS
+####MARS MARS MARS MARS MARS
+
+####MARS MARS MARS MARS MARS
+####MARS MARS MARS MARS MARS
+####
+####
+#### TRACEURS: l'ordre dans SCALAR est defini plus bas dans les options mars)
+#### - effacer le h si l'on veut eviter les sorties
+####
+state  real  -         ikjftb  scalar  1  -  -                         -
+state  real  qh2o      ikjftb  scalar  1  -  i01rusdf=(bdy_interp:dt)  "QH2O"          "Water vapor mixing ratio"   "kg kg-1"
+state  real  qh2o_ice  ikjftb  scalar  1  -  i01rusdf=(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  qdustn    ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt)  "QDUSTN"        "Dust_number mixing ratio"   "kg kg-1"
+state  real  qco2      ikjftb  scalar  1  -  i01rusdf=(bdy_interp:dt)  "QCO2"          "CO2 mixing ratio"           "kg kg-1"
+####
+####
+####MARS MARS MARS MARS MARS
+####MARS MARS MARS MARS MARS
+
+
+
+################################################################################
+################################################################################
+################################################################################
+
+
+
+# Lines that start with the word 'state' form a table that is                                           
+# used by the script use_registry to generate module_state_descript.F                                           
+# and other files.  Also see documentation in use_registry.                                             
+#                                               
+# table entries are of the form                                         
+#<Table> <Type> <Sym>         <Dims>   <Use>   <NumTLev> <Stagger> <IO>     <DNAME>             <DESCRIP>     <UNITS>   
+#
+
+# It is required that LU_INDEX appears before any variable that is
+# interpolated with a mask, as lu_index supplies that mask.
+# this next 1 is for the HFSoLE/PET demo; writing these to auxhist1 output over MCEL for coupling
+# with wave model, only if compiled with -DMCELIO, JM 2003/05/29
+state    real  LU_INDEX         ij      misc        1         -     ir01d=(interp_fcnm)u=(copy_fcnm)   "LU_INDEX"              "LAND USE CATEGORY"         ""
+state    real  LU_MASK          ij      misc        1         -     i3h1     "LU_MASK"              "0 land 1 water"         ""
+
+#
+# Variables from WPS
+#
+state    real   u_gc           igj      dyn_em      1        XZ    i1  "UU"     "x-wind component"    "m s-1"
+state    real   v_gc           igj      dyn_em      1        YZ    i1  "VV"     "y-wind component"    "m s-1"
+state    real   t_gc           igj      dyn_em      1        Z     i1  "TT"     "temperature"         "K"
+state    real   rh_gc          igj      dyn_em      1        Z     i1  "RH"    "relative humidity"   "%"
+state    real   ght_gc         igj      dyn_em      1        Z     i1  "GHT"   "geopotential height" "m"
+state    real   p_gc           igj      dyn_em      1        Z     i1  "PRES"   "pressure"            "Pa"
+state    real   xlat_gc        ij       dyn_em      1        -     i1  "XLAT_M" "latitude, positive north" "degrees"
+state    real   xlong_gc       ij       dyn_em      1        -     i1  "XLONG_M" "longitude, positive east" "degrees"
+state    real   ht_gc          ij       dyn_em      1        -     i1  "HGT_M" "topography elevation" "m"
+state    real   tsk_gc         ij       dyn_em      1        -     i1  "SKINTEMP"  "skin temperature"  "K"
+state    real   tavgsfc        ij       dyn_em      1        -     i1  "TAVGSFC"  "daily mean of surface air temperature"  "K"
+state    real   tmn_gc         ij       dyn_em      1        -     i1  "SOILTEMP"  "annual mean deep soil temperature"  "K"
+state    real   pslv_gc        ij       dyn_em      1        -     i1  "PMSL"  "sea level pressure"  "Pa"
+state    real   greenfrac      imj      dyn_em      1        Z     i1  "GREENFRAC" "monthly greenness fraction" "0 - 1 fraction"
+state    real   albedo12m      imj      dyn_em      1        Z     i1  "ALBEDO12M" "background albedo" "0 - 1 fraction"
+state    real   pd_gc          igj      dyn_em      1        Z     -   "PD"    "dry pressure"        "Pa"
+state    real   psfc_gc        ij       dyn_em      1        -      -  "PSFC_GC"     "surface pressure"            "Pa"
+state    real   intq_gc        ij       dyn_em      1        -     -   "INTQ"  "integrated mixing ratio" "Pa"
+state    real   pdhs           ij       dyn_em      1        -     -   "PDHS"  "hydrostatic dry surface pressure" "Pa"
+state    real   qv_gc          igj      dyn_em      1        Z     i1  "QV"     "mixing ratio"        "kg kg-1"
+#state    real   qr_gc          igj      dyn_em      1        Z     i1  "QR"    "rain water mixing ratio"   "kg kg-1"
+#state    real   qc_gc          igj      dyn_em      1        Z     i1  "QC"    "cloud water mixing ratio"   "kg kg-1"
+#state    real   qs_gc          igj      dyn_em      1        Z     i1  "QS"    "snow mixing ratio"   "kg kg-1"
+#state    real   qi_gc          igj      dyn_em      1        Z     i1  "QI"    "cloud ice mixing ratio"   "kg kg-1"
+#state    real   qg_gc          igj      dyn_em      1        Z     i1  "QG"    "graupel mixing ratio"   "kg kg-1"
+
+####MARS MARS MARS MARS MARS
+####MARS MARS MARS MARS MARS     
+####
+#### INITIALISATION
+####
+#### variables dans real
+####
+state  real   albedo_gcm_gc   ij   dyn_em  1  -  i1  "ALBEDO_GCM"       "albedo of naked ground"  "0 - 1 fraction"
+state  real   therm_inert_gc  ij   dyn_em  1  -  i1  "THERMAL_INERTIA"  "thermal inertia"         "J/m2/K/s0.5"
+state  real   slpx_gc         ij   dyn_em  1  -  i1  "SLPX"             "slope x direction"       "rad"
+state  real   slpy_gc         ij   dyn_em  1  -  i1  "SLPY"             "slope y direction"       "rad"
+state  real   hv_gc          igj   dyn_em  1  Z  i1  "HV"               "water vapor"             "kg/kg" 
+state  real   hi_gc          igj   dyn_em  1  Z  i1  "HI"               "water ice"               "kg/kg"
+state  real   tsoil_gc       igj   dyn_em  1  Z  i1  "TSOIL"            "soil temperatures"       "K"
+state  real   isoil_gc       igj   dyn_em  1  Z  i1  "ISOIL"            "soil thermal inertia"    "tiu"
+state  real   dsoil_gc       igj   dyn_em  1  Z  i1  "DSOIL"            "soil depths"             "m"
+state  real   dustq_gc       igj   dyn_em  1  Z  i1  "DUSTQ"            "dust mixing ratio"       "kg/kg"
+state  real   dustn_gc       igj   dyn_em  1  Z  i1  "DUSTN"            "dust number density"     "kg/kg"
+####
+#### variables dans wrf
+####
+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   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_tsoil     ilj   misc  1  -  i012rd  "MARS_TSOIL"  "soil temperatures"       "K"
+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"                 " "
+####
+####
+####MARS MARS MARS MARS MARS
+####MARS MARS MARS MARS MARS
+
+
+
+#-----------------------------------------------------------------------------------------------------------------------------------------------------------------
+#                                               
+# Variables for Eulerian mass coordinate dynamics                                            
+#                                               
+
+# Velocities
+#
+# U Vel
+state    real   u              ikjb     dyn_em      2         X     \
+     i01rhusdf=(bdy_interp:dt)       "U"                      "x-wind component"   "m s-1"
+state    real   ru             ikj     dyn_em      1         X      -        "MU_U"        "mu-coupled u"   "Pa m s-1"
+state    real   ru_m           ikj     dyn_em      1         X      -        "ru_m"        ""   ""
+state    real   ru_tend        ikj     dyn_em      1         X      -        "ru_tend"        ""   ""                                   
+i1       real   ru_tendf       ikj     dyn_em      1         X                                          
+state    real   u_save         ikj     dyn_em      1         X      -        "u_save"
+#                                               
+# V Vel
+state    real   v              ikjb     dyn_em      2         Y     \
+     i01rhusdf=(bdy_interp:dt)        "V"                     "y-wind component"   "m s-1"
+state    real   rv             ikj     dyn_em      1         Y      -        "MU_V"        "mu-coupled v"   "Pa m s-1"
+state    real   rv_m           ikj     dyn_em      1         Y      -        "rv_m"
+state    real   rv_tend        ikj     dyn_em      1         Y      -        "rv_tend"
+i1       real   rv_tendf       ikj     dyn_em      1         Y                                          
+state    real   v_save         ikj     dyn_em      1         Y      -        "v_save"                   
+#                                               
+# Vertical Vel                                          
+state    real   w              ikjb     dyn_em      2         Z     \
+        irhusdf=(bdy_interp:dt)  "w"                          "z-wind component"   "m s-1"
+state    real   ww             ikj     dyn_em      1         Z      r         "ww"   "mu-coupled eta-dot"    "Pa s-1"
+state    real   rw             ikj     dyn_em      1         Z      -         "rw"   "mu-coupled w"          "Pa m s-1"
+i1       real   ww1            ikj     dyn_em      1         Z                                          
+state    real   ww_m           ikj     dyn_em      1         Z      r         "ww_m"   "time-avg mu-coupled eta-dot"    "Pa s-1"
+i1       real   wwp            ikj     dyn_em      1         Z                                          
+i1       real   rw_tend        ikj     dyn_em      1         Z                                          
+i1       real   rw_tendf       ikj     dyn_em      1         Z                                          
+i1       real   w_save         ikj     dyn_em      1         Z                                          
+
+# Geopotential
+state    real   ph             ikjb     dyn_em      2         Z     \
+       irusdf=(bdy_interp:dt)   "ph"   "perturbation geopotential"  "m2 s-2"
+state    real   phb            ikj     dyn_em      1         Z     irdus  "phb"  "base-state geopotential"  "m2 s-2"
+state    real   phb_fine       ikj     dyn_em      1         Z      -     "phb_fine"  "for nesting, temp holding interpolated coarse grid phb"  "m2 s-2"
+state    real   ph0            ikj     dyn_em      1         Z      r     "ph0"  "initial geopotential"     "m2 s-2"
+state    real   php            ikj     dyn_em      1         Z      r     "php"  "geopotential"             "m2 s-2"
+i1       real   ph_tend        ikj     dyn_em      1         Z 
+i1       real   ph_tendf       ikj     dyn_em      1         Z 
+i1       real   ph_save        ikj     dyn_em      1         Z 
+##
+## MARS: TO GET LIGHTER HISTORY FILES
+##
+state    real   phtot          ikj     dyn_em      1         Z     irh       "PHTOT"        "total geopotential"      "m2 s-2"
+
+# Potential Temperature
+state    real   t              ikjb     dyn_em      2         -     \
+       i01rhusdf=(bdy_interp:dt)   "t"      "perturbation potential temperature (theta-t0)" "K"
+
+state    real   t_init         ikj     dyn_em      1         -      ir       "t_init" "initial potential temperature" "K"
+i1       real   t_tend         ikj     dyn_em      1         -  
+i1       real   t_tendf        ikj     dyn_em      1         -  
+state    real   tp             ikj     dyn_em      2         -  
+i1       real   t_2save        ikj     dyn_em      1         -   
+state    real   t_save         ikj     dyn_em      1         -               "t_save"
+#                                               
+
+
+# Mass
+state    real   mu              ijb     dyn_em      2         -     \
+     irusdf=(bdy_interp:dt)   "mu"  "perturbation dry air mass in column" "Pa"
+state    real   mub             ij     dyn_em      1         -     irdus        "mub" "base state dry air mass in column" "Pa"
+state    real   mub_fine        ij     dyn_em      1         -      -           "mub_fine" "nest temp, holds interpolated coarse grid mub" "Pa"
+state    real   mu0             ij     dyn_em      1         -     i01rdu       "mu0" "initial dry mass in column" "Pa"
+state    real   mudf            ij     dyn_em      1         -      -           "mudf" "" ""
+state    real   muu             ij     dyn_em      1          -                 "muu"
+i1       real   muus            ij     dyn_em      1          -     
+state    real   muv             ij     dyn_em      1          -                 "muv"
+i1       real   muvs            ij     dyn_em      1          -     
+state    real   mut             ij     dyn_em      1          -                 "mut"
+state    real   muts            ij     dyn_em      1          -                 "muts"
+i1       real   muave           ij     dyn_em      1          -     
+i1       real   mu_save         ij     dyn_em      1          -     
+i1       real   mu_tend         ij     dyn_em      1          -     
+i1       real   mu_tendf        ij     dyn_em      1          -     
+
+#diagnostic for looking at nest position in output. A mungy version of terrain height.
+state    real   nest_pos        ij     misc        1   -   rhu=(mark_domain)  "NEST_POS"
+state    real   nest_mask       ij     misc        1   -   ru=(mark_domain)   "NEST_MASK"     "LOCATION OF NEST IF ANY"
+state    real   ht_coarse       ij     misc        1   -     r                -              "STORAGE FOR LOW-RES TERRAIN"
+
+
+# TKE
+state    real   tke            ikj     dyn_em      2         -       r        "tke"          "TURBULENCE KINETIC ENERGY"     "m2 s-2"
+i1       real   tke_tend       ikj     dyn_em      1         -      
+
+# Pressure and Density
+state    real   p              ikj     dyn_em      1         -      r         "p"           "perturbation pressure"         "Pa"
+state    real   al             ikj     dyn_em      1         -      r         "al"          "inverse perturbation density"  "m3 kg-1"
+state    real   alt            ikj     dyn_em      1         -      r         "alt"         "inverse density"               "m3 kg-1"
+state    real   alb            ikj     dyn_em      1         -      rdus      "alb"         "inverse base density"          "m3 kg-1"
+state    real   zx             ikj     dyn_em      1         X      -         " "  " "  " "    
+state    real   zy             ikj     dyn_em      1         Y      -         " "  " "  " "   
+state    real   rdz            ikj     dyn_em      1         Z      -         " "  " "  " "   
+state    real   rdzw           ikj     dyn_em      1         Z       -        " "  " "  " "   
+state    real   pb             ikj     dyn_em      1         -      rdus      "pb"          "BASE STATE PRESSURE "          "Pa"
+##
+## MARS: TO GET LIGHTER HISTORY FILES
+##
+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...
+
+#                                               
+# Other dyn                                             
+#                                               
+i1       real   advect_tend    ikj     dyn_em      1         -                                          
+i1       real   alpha          ikj     dyn_em      1         -                                                  
+i1       real   a              ikj     dyn_em      1         -                                                  
+i1       real   gamma          ikj     dyn_em      1         -                                                  
+i1       real   c2a            ikj     dyn_em      1         -     -
+i1       real   rho            ikj     dyn_em      1         -     -
+i1       real   phm            ikj     dyn_em      1         -     -
+i1       real   cqu            ikj     dyn_em      1         -     -
+i1       real   cqv            ikj     dyn_em      1         -     -
+i1       real   cqw            ikj     dyn_em      1         -     -
+i1       real   pm1            ikj     dyn_em      1         -     -
+#
+# sortie desactivée
+# 
+state    real   sr             ij      dyn_em      1         -      ir         "sr" "fraction of frozen precipitation"
+state    real   potevp         ij      dyn_em      1         -                 "potevp" "whatever"
+state    real   snopcx         ij      dyn_em      1         -                 "snopcx" "whatever"
+state    real   soiltb         ij      dyn_em      1         -      ir         "soiltb" "whatever"
+state    real    fnm            k       dyn_em      1         -     irh       "fnm"  "upper weight for vertical stretching"  ""
+state    real    fnp            k       dyn_em      1         -     irh       "fnp"  "lower weight for vertical stretching"  ""
+state    real    rdnw           k       dyn_em      1         -     irh       "rdnw"  "inverse d(eta) values between full (w) levels"   ""
+state    real    rdn            k       dyn_em      1         -     irh       "rdn"  "inverse d(eta) values between half (mass) levels"   ""
+state    real    dnw            k       dyn_em      1         -     irh       "dnw" "d(eta) values between full (w) levels"   ""
+state    real    dn             k       dyn_em      1         -     irh       "dn " "d(eta) values between half (mass) levels"   ""
+state    real    znu            k       dyn_em      1         -     irh       "znu"  "eta values on half (mass) levels"  ""
+state    real    znw            k       dyn_em      1         Z     i01rh     "znw"  "eta values on full (w) levels"  ""
+state    real    t_base         k       dyn_em      1         -     ir        "t_base"               "BASE STATET T IN IDEALIZED CASES"         "K"      
+state    real    z              ikj     dyn_em      1         -     -         " " " " " "
+i1       real    mu_3d          ikj     dyn_em      1         -                                          
+i1       real    z_at_w         ikj     dyn_em      1         Z 
+state    real    cfn            -       misc      -         -     irh       "cfn"    "extrapolation constant"  ""
+state    real    cfn1           -       misc      -         -     irh       "cfn1"   "extrapolation constant"  ""
+state    integer step_number    -       misc      -         -     ir        "step_number"  ""
+
+#
+# UN BON EXEMPLE: irhd et i01rh
+#
+# 2m and 10m output diagnostics
+state    real   Q2               ij     misc        1         -     ird      "Q2"                   "QV at 2 M"         "kg kg-1"
+state    real   T2               ij     misc        1         -     ird      "T2"                   "TEMP at 2 M"       "K"
+state    real   TH2              ij     misc        1         -     ird      "TH2"                  "POT TEMP at 2 M"   "K"
+state    real   PSFC             ij     misc        1         -     i01rh     "PSFC"                 "SFC PRESSURE"      "Pa"
+
+#
+# ICI irh01d
+#
+# these next 2 are for the HFSoLE/PET demo; writing these to auxhist1 output over MCEL for coupling
+# with wave model, only if compiled with -DMCELIO, JM 2003/05/29
+state    real   U10              ij     misc        1         -     ir01d      "U10"                "U at 10 M"         "m s-1"
+state    real   V10              ij     misc        1         -     ir01d      "V10"                "V at 10 M"         "m s-1"
+
+# these next 4 are for observational nudging
+state    real   uratx           ij      misc        1         -     ir          "URATX"            "Ratio of U over U10 on mass points "         "dimensionless"
+state    real   vratx           ij      misc        1         -     ir          "VRATX"            "Ratio of V over V10 on mass points "         "dimensionless"   
+state    real   tratx           ij      misc        1         -     ir          "TRATX"            "Ratio of T over TH2 on mass points "         "dimensionless"   
+state    real   obs_savwt      hikj     dyn_em      1         X      -       "OBS_SAVWT"
+
+# Other
+state   real    rdx            -        misc      -         -     irh       "rdx"                   "INVERSE X GRID LENGTH"         ""      
+state   real    rdy            -        misc      -         -     irh       "rdy"                   "INVERSE Y GRID LENGTH"         ""      
+state   real    dts            -        misc      -         -     ir        "dts"                   "SMALL TIMESTEP"         ""      
+state   real    dtseps         -        misc      -         -     ir        "dtseps"                "TIME WEIGHT CONSTANT FOR SMALL STEPS"         ""      
+state   real    resm           -        misc      -         -     irh       "resm"                  "TIME WEIGHT CONSTANT FOR SMALL STEPS"         ""      
+state   real    zetatop        -        misc      -         -     irh       "zetatop"               "ZETA AT MODEL TOP"         ""      
+state   real    cf1            -        misc      -         -     irh       "cf1"                   "2nd order extrapolation constant"         ""      
+state   real    cf2            -        misc      -         -     irh       "cf2"                   "2nd order extrapolation constant"         ""      
+state   real    cf3            -        misc      -         -     irh       "cf3"                   "2nd order extrapolation constant"         ""      
+state   integer number_at_same_level    -        -          -         -     -        "number_at_same_level"  ""         ""      
+
+# State for derived time quantities.  
+state   integer itimestep      -        -          -         -     rh         "itimestep"             ""         ""      
+state   real    xtime          -        -          -         -     rh         "xtime"                 "minutes since simulation start"         ""      
+state   real    julian         -        -          -         -     -          "julian"                "day of year, 0.0 at 0Z on 1 Jan."         "days"      
+
+
+# input file descriptor for lbcs on parent domain                                               
+state   integer lbc_fid        -        -          -         -     -         "lbc_fid"               ""         ""      
+# indicates if tiling has been computed                                         
+state   logical tiled          -        -          -         -     -         "tiled"                 ""         ""      
+# indicates if patches have been computed                                               
+state   logical patched        -        -          -         -     -         "patched"               ""         ""      
+# indicates whether to read input from file or generate                                         
+#state   logical input_from_file        -        -          -         -     -         "input_from_file"         ""         ""    
+
+# Mask for moving nest interpolations
+state    integer imask_nostag         ij      misc     1     -
+state    integer imask_xstag          ij      misc     1     X
+state    integer imask_ystag          ij      misc     1     Y
+state    integer imask_xystag         ij      misc     1     XY 
+# vortex center indices; need for restarts of moving nests
+state    real    xi                   -       misc     -     -    r
+state    real    xj                   -       misc     -     -    r
+state    real    vc_i                 -       misc     -     -    r
+state    real    vc_j                 -       misc     -     -    r
+
+#-----------------------------------------------------------------------------------------------------------------------------------------------------------------
+# Scalar (4D) arrays
+
+# Moist Scalars
+#                                               
+# The first line ensures that there will be identifiers named moist and                                         
+# moist_tend even if there are not any moist scalars (so the essentially                                                
+# dry code will will still link properly)                                               
+#      
+#-----------------------------
+# afin d eviter les mic macs terrestres, ceux là ne sont pas a utiliser
+# reglés a zero 
+#-----------------------------                                         
+state   real    -              ikjftb   moist       1         -     -    -
+state   real    qv             ikjftb   moist       1         -     \
+   i01rusdf=(bdy_interp:dt)  "QVAPOR"           "Water vapor mixing ratio"      "kg kg-1"
+state   real    qc             ikjftb   moist       1         -     \
+   i01rusdf=(bdy_interp:dt)  "QCLOUD"           "Cloud water mixing ratio"      "kg kg-1"
+state   real    qr             ikjftb   moist       1         -     \
+   i01rusdf=(bdy_interp:dt)  "QRAIN"            "Rain water mixing ratio"       "kg kg-1"
+state   real    qi             ikjftb   moist       1         -     \
+   i01rusdf=(bdy_interp:dt)  "QICE"             "Ice mixing ratio"              "kg kg-1"
+state   real    qs             ikjftb   moist       1         -     \
+   i01rusdf=(bdy_interp:dt)  "QSNOW"            "Snow mixing ratio"             "kg kg-1"
+state   real    qg             ikjftb   moist       1         -     \
+   i01rusdf=(bdy_interp:dt)  "QGRAUP"           "Graupel mixing ratio"          "kg kg-1"
+
+# Chem Scalars
+state   real    -              ikjftb   chem        1         -     -    -                                       
+
+# Other Scalars: see also above
+state   real    qni             ikjftb  scalar      1         -     \
+   i01rusdf=(bdy_interp:dt)    "QNICE"         "Ice Number concentration" "# kg(-1)"
+state   real    qt             ikjftb  scalar      1         -     \
+   i01rusdf=(bdy_interp:dt)    "CWM"           "Total condensate mixing ratio"      "kg kg-1"
+
+#-----------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+# Arrays for Specified LBCs  (lbc arrays REMOVED; Boundary arrays are now specified with the state array; see above, 20050413 JM )
+
+state    real   fcx            w         misc     -         -      ir       "fcx"                  "RELAXATION TERM FOR BOUNDARY ZONE"         ""
+state    real   gcx            w         misc     -         -      ir       "gcx"                  "2ND RELAXATION TERM FOR BOUNDARY ZONE"         ""
+state    real   dtbc            -        misc     -         -      ir       "dtbc"                 "TIME SINCE BOUNDARY READ"         ""
+
+#-------------------------------------------------------------------------------------------------------------------------------------------
+#-------------------------------------------------------------------------------------------------------------------------------------------
+# Physics Related State Varibles
+
+#-------------------------------------------------------------------------------------------------------------------------------------------
+# SI - start variables from netCDF format from Standard Initialization, most eventually for use in LSM schemes
+#-------------------------------------------------------------------------------------------------------------------------------------------
+
+state   real   sm000007            ij    misc          1     -     i1      "SM000007"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sm007028            ij    misc          1     -     i1      "SM007028"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sm028100            ij    misc          1     -     i1      "SM028100"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sm100255            ij    misc          1     -     i1      "SM100255"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   st000007            ij    misc          1     -     i1      "ST000007"      "LAYER SOIL TEMPERATURE" "K"
+state   real   st007028            ij    misc          1     -     i1      "ST007028"      "LAYER SOIL TEMPERATURE" "K"
+state   real   st028100            ij    misc          1     -     i1      "ST028100"      "LAYER SOIL TEMPERATURE" "K"
+state   real   st100255            ij    misc          1     -     i1      "ST100255"      "LAYER SOIL TEMPERATURE" "K"
+state   real   sm000010            ij    misc          1     -     i1      "SM000010"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sm010040            ij    misc          1     -     i1      "SM010040 "     "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sm040100            ij    misc          1     -     i1      "SM040100 "     "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sm100200            ij    misc          1     -     i1      "SM100200 "     "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sm010200            ij    misc          1     -     i1      "SM010200"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   soilm000            ij    misc          1     -     i1      "SOILM000"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   soilm005            ij    misc          1     -     i1      "SOILM005"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   soilm020            ij    misc          1     -     i1      "SOILM020"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   soilm040            ij    misc          1     -     i1      "SOILM040"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   soilm160            ij    misc          1     -     i1      "SOILM160"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   soilm300            ij    misc          1     -     i1      "SOILM300"      "LAYER SOIL MOISTURE" "m3 m-3"
+state   real   sw000010            ij    misc          1     -     i1      "SW000010"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   sw010040            ij    misc          1     -     i1      "SW010040"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   sw040100            ij    misc          1     -     i1      "SW040100"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   sw100200            ij    misc          1     -     i1      "SW100200"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   sw010200            ij    misc          1     -     i1      "SW010200"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   soilw000            ij    misc          1     -     i1      "SOILW000"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   soilw005            ij    misc          1     -     i1      "SOILW005"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   soilw020            ij    misc          1     -     i1      "SOILW020"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   soilw040            ij    misc          1     -     i1      "SOILW040"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   soilw160            ij    misc          1     -     i1      "SOILW160"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   soilw300            ij    misc          1     -     i1      "SOILW300"      "LAYER SOIL LIQUID" "m3 m-3"
+state   real   st000010            ij    misc          1     -     i1      "ST000010"      "LAYER SOIL TEMPERATURE" "K"
+state   real   st010040            ij    misc          1     -     i1      "ST010040"      "LAYER SOIL TEMPERATURE" "K"
+state   real   st040100            ij    misc          1     -     i1      "ST040100"      "LAYER SOIL TEMPERATURE" "K"
+state   real   st100200            ij    misc          1     -     i1      "ST100200"      "LAYER SOIL TEMPERATURE" "K"
+state   real   st010200            ij    misc          1     -     i1      "ST010200"      "LAYER SOIL TEMPERATURE" "K"
+state   real   soilt000            ij    misc          1     -     i1      "SOILT000"      "LAYER SOIL TEMPERATURE" "K"
+state   real   soilt005            ij    misc          1     -     i1      "SOILT005"      "LAYER SOIL TEMPERATURE" "K"
+state   real   soilt020            ij    misc          1     -     i1      "SOILT020"      "LAYER SOIL TEMPERATURE" "K"
+state   real   soilt040            ij    misc          1     -     i1      "SOILT040"      "LAYER SOIL TEMPERATURE" "K"
+state   real   soilt160            ij    misc          1     -     i1      "SOILT160"      "LAYER SOIL TEMPERATURE" "K"
+state   real   soilt300            ij    misc          1     -     i1      "SOILT300"      "LAYER SOIL TEMPERATURE" "K"
+state   real   landmask            ij    misc          1     -     i012rd=(interp_fcnm)u=(copy_fcnm)   "LANDMASK"      "LAND MASK (1 FOR LAND, 0 FOR WATER)"  ""
+state   real   topostdv            ij    misc          1     -     i12     "TOPOSTDV"      "ELEVATION STD DEV"  "m"
+state   real   toposlpx            ij    misc          1     -     i12     "TOPOSLPX"      "ELEVATION X SLOPE"  ""
+state   real   toposlpy            ij    misc          1     -     i12     "TOPOSLPY"      "ELEVATION Y SLOPE"  ""
+state   real   shdmax              ij    misc          1     -     i012r   "SHDMAX"        "ANNUAL MAX VEG FRACTION" ""
+state   real   shdmin              ij    misc          1     -     i012r   "SHDMIN"        "ANNUAL MIN VEG FRACTION" ""
+state   real   snoalb              ij    misc          1     -     i012r   "SNOALB"        "ANNUAL MAX SNOW ALBEDO IN FRACTION" ""
+state   real   slopecat            ij    misc          1     -     i12     "SLOPECAT"      "SLOPE CATEGORY"  ""
+state   real   toposoil            ij    misc          1     -     i12     "SOILHGT"       "ELEVATION OF LSM DATA"  "m"
+state   real   landusef            iuj   misc          1     Z     i12     "LANDUSEF"      "LANDUSE FRACTION BY CATEGORY"  ""
+state   real   soilctop            isj   misc          1     Z     i12     "SOILCTOP"      "SOIL CAT FRACTION (TOP)"  ""
+state   real   soilcbot            isj   misc          1     Z     i1      "SOILCBOT"      "SOIL CAT FRACTION (BOTTOM)"  ""
+state   real   soilcat             ij    misc          1     -     i12     "SOILCAT"       "SOIL CAT DOMINANT TYPE" ""
+state   real   vegcat              ij    misc          1     -     i12     "VEGCAT"        "VEGETATION CAT DOMINANT TYPE" ""
+
+#---------------------------------------------------------------------------------------------------------------------------------------
+# SI - end variables from netCDF format from Standard Initialization
+#---------------------------------------------------------------------------------------------------------------------------------------
+
+# soil model variables  (Note that they are marked as staggered in the vertical dimension
+# because they are "fully dimensioned" -- they use every element in that dim
+state    real   TSLB           ilj       misc      1         Z     i02rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)           "TSLB"     "SOIL TEMPERATURE"   "K"
+state    real   ZS              l        misc      -         Z     irh       "ZS"                    "DEPTHS OF CENTERS OF SOIL LAYERS"         "m"
+state    real   DZS             l        misc      -         Z     irh       "DZS"                   "THICKNESSES OF SOIL LAYERS"               "m"
+
+# urban model variables
+state    real   DZR             l        em      -            Z     r        "DZR"            "THICKNESSES OF ROOF LAYERS"                      "m"
+state    real   DZB             l        em      -            Z     r        "DZB"            "THICKNESSES OF WALL LAYERS"                      "m"
+state    real   DZG             l        em      -            Z     r        "DZG"            "THICKNESSES OF ROAD LAYERS"                      "m"
+
+# lsm State Variables
+
+#
+# sortie desactivé, mais peut servir pour le modèle de sol
+#
+state    real   SMOIS            ilj     -          1         Z     i02rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)    "SMOIS"            "SOIL MOISTURE"     "m3 m-3"
+state    real   SH2O             ilj     -          1         Z     i02rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)    "SH2O"             "SOIL LIQUID WATER" "m3 m-3"
+state    real   XICE             ij     misc        1         -     i012rd=(interp_mask_water_field:lu_index)u=(copy_fcnm)  "XICE"             "SEA ICE FLAG"  ""
+state    real   SMSTAV           ij     misc        1         -      rd=(interp_mask_land_field:lu_index)       "SMSTAV"           "MOISTURE AVAILABILITY" ""
+state    real   SMSTOT           ij     misc        1         -      r                                          "SMSTOT"           "TOTAL SOIL MOISTURE" "m3 m-3"
+
+state    real   SFCRUNOFF        ij     misc        1         -      rd=(interp_mask_land_field:lu_index)      "SFROFF"           "SURFACE RUNOFF"     "mm"
+state    real   UDRUNOFF         ij     misc        1         -      rd=(interp_mask_land_field:lu_index)      "UDROFF"           "UNDERGROUND RUNOFF" "mm"
+state  integer  IVGTYP           ij     misc        1         -     i02rd=(interp_fcni)u=(copy_fcni)            "IVGTYP"           "DOMINANT VEGETATION CATEGORY" ""
+state  integer  ISLTYP           ij     misc        1         -     i02rd=(interp_fcni)u=(copy_fcni)            "ISLTYP"           "DOMINANT SOIL CATEGORY"       ""
+state    real   VEGFRA           ij     misc        1         -     i0125rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)   "VEGFRA"           "VEGETATION FRACTION" ""
+state    real   SFCEVP           ij     misc        1         -      r                                          "SFCEVP"           "SURFACE EVAPORATION" "kg m-2"
+state    real   GRDFLX           ij     misc        1         -      r                                         "GRDFLX"           "GROUND HEAT FLUX" "W m-2"
+state    real   SFCEXC           ij     misc        1         -      r                                          "SFCEXC "          "SURFACE EXCHANGE COEFFICIENT"   "m s-1"
+
+state    real   ACSNOW           ij     misc        1         -      rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)       "ACSNOW"           "ACCUMULATED SNOW"         "kg m-2"
+state    real   ACSNOM           ij     misc        1         -      rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)       "ACSNOM"           "ACCUMULATED MELTED SNOW"  "kg m-2"
+#
+# ici sortie désactivée
+#
+state    real   SNOW             ij     misc        1         -     i01rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)    "SNOW"             "SNOW WATER EQUIVALENT"    "kg m-2"
+state    real   SNOWH            ij     misc        1         -     i01rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)    "SNOWH"            "PHYSICAL SNOW DEPTH"      "m"
+state    real   RHOSN            ij     misc        1         -     i01rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)    "RHOSN"            " SNOW DENSITY"      "kg m-3" 
+state    real   CANWAT           ij     misc        1         -     i01rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)    "CANWAT"           "CANOPY WATER"             "kg m-2"
+state    real   SST              ij     misc        1         -     i0125rd=(interp_mask_water_field:lu_index)   "SST"              "SEA SURFACE TEMPERATURE" "K"
+state  integer  IFNDSNOWH        -      misc        1         -     i         "FNDSNOWH" "SNOWH_LOGICAL"
+state  integer  IFNDSOILW        -      misc        1         -     i         "FNDSOILW" "SOILW_LOGICAL"
+
+# urban state variables
+state    real   TR_URB2D         ij     misc        1         -     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)     "TR_URB"              "URBAN ROOF SKIN TEMPERATURE"        "K"
+state    real   TB_URB2D         ij     misc        1         -     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)     "TB_URB"              "URBAN WALL SKIN TEMPERATURE"        "K" 
+state    real   TG_URB2D         ij     misc        1         -     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)     "TG_URB"              "URBAN ROAD SKIN TEMPERATURE"        "K" 
+state    real   TC_URB2D         ij     misc        1         -     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)     "TC_URB"              "URBAN CANOPY TEMPERATURE"           "K"
+state    real   QC_URB2D         ij     misc        1         -     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)     "QC_URB"              "URBAN CANOPY HUMIDITY"          "kg kg{-1}"
+state    real   UC_URB2D         ij     misc        1         -     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)     "UC_URB"              "URBAN CANOPY WIND"          "m s{-1}"
+state    real   XXXR_URB2D       ij     misc        1         -     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)      "XXXR_URB" "M-O LENGTH ABOVE URBAN ROOF"   "dimensionless"
+state    real   XXXB_URB2D       ij    misc        1         -      rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)      "XXXB_URB" "M-O LENGTH ABOVE URBAN WALL"   "dimensionless"
+state    real   XXXG_URB2D       ij    misc        1         -      rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)       "XXXG_URB" "M-O LENGTH ABOVE URBAN ROAD"   "dimensionless"
+state    real   XXXC_URB2D       ij    misc        1         -      rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)       "XXXC_URB" "M-O LENGTH ABOVE URBAN CANOPY" "dimensionless"
+state    real   TRL_URB3D        ilj    misc        1         Z     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)      "TRL_URB" "ROOF LAYER TEMPERATURE"          "K"
+state    real   TBL_URB3D        ilj    misc        1         Z     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)      "TBL_URB" "WALL LAYER TEMPERATURE"          "K"
+state    real   TGL_URB3D        ilj    misc        1         Z     rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)      "TGL_URB" "ROAD LAYER TEMPERATURE"          "K"
+state    real   SH_URB2D        ij    misc        1         -     r       "SH_URB"  "SENSIBLE HEAT FLUX FROM URBAN SFC"  "W m{-2}"
+state    real   LH_URB2D        ij    misc        1         -     r       "LH_URB"  "LATENT HEAT FLUX FROM URBAN SFC"    "W m{-2}"
+state    real   G_URB2D         ij    misc        1         -     r        "G_URB"  "GROUND HEAT FLUX INTO URBAN"        "W m{-2}"
+state    real   RN_URB2D        ij    misc        1         -     r       "RN_URB"  "NET RADIATION ON URBAN SFC"         "W m{-2}"
+state    real   TS_URB2D        ij    misc        1         -     r       "TS_URB"  "SKIN TEMPERATURE"          "K"
+state    real   FRC_URB2D       ij    misc        1         -     rd=(interp_fcnm)u=(copy_fcnm)       "FRC_URB"  "URBAN FRACTION"         "dimensionless"
+state    integer   UTYPE_URB2D  ij    misc        1         -     rd=(interp_fcnm)u=(copy_fcnm)       "UTYPE_URB"  "URBAN TYPE"         "dimensionless"
+
+
+# urban variables from radiation model
+state    real   COSZ_URB2D       ij     misc        1         -      r       "COSZ_URB"  "COS of SOLAR ZENITH ANGLE"         "dimensionless"
+state    real   OMG_URB2D        ij     misc        1         -      r       "OMG_URB"   "SOLAR HOUR ANGLE"         "dimensionless"
+state    real   DECLIN_URB       -     misc        1         -       r       "DECLIN_URB"  "SOLAR DECLINATION"         "dimensionless"
+
+
+# RUC LSM
+state    real   SMFR3D           ilj    misc        1         Z      r        "SMFR3D"               "SOIL ICE" ""
+state    real   KEEPFR3DFLAG     ilj    misc        1         Z      r        "KEEPFR3DFLAG"          "FLAG - 1. FROZEN SOIL YES, 0 - NO"             ""
+
+# MRF PBL variables
+i1      real   PSIM           ij     misc        1         -     -         "PSIM"                "SIMILARITY FUNCTION FOR MOMENTUM"     ""
+i1      real   PSIH           ij     misc        1         -     -         "PSIH"                "SIMILARITY FUNCTION FOR HEAT"         ""
+i1      real   WSPD           ij     misc        1         -     -         "WSPD"                "Wind speed"                           "m s-1"
+i1      real   GZ1OZ0         ij     misc        1         -     -         "GZ1OZ0"              "LOG OF Z1 over Z0"                     ""
+i1      real   BR             ij     misc        1         -     -         "BR"                  "Bulk Richardson"                       ""
+
+# MYJ PBL variables
+state    real   tke_myj        ikj     misc        1         -      r        "tke_myj"               "TKE FROM MELLOR-YAMADA-JANJIC"      "m2 s-2"
+state    real   EL_MYJ          ikj     misc        1         -     -        "el_myj"                "MIXING LENGTH FROM MELLOR-YAMADA-JANJIC"     "m"
+state    real   EXCH_H          ikj     misc        1         -     r          "EXCH_H"               "EXCHANGE COEFFICIENTS "
+state    real  CT              ij      misc        1         -      r        "CT"                    "COUNTERGRADIENT TERM"    "K"
+state   real   THZ0             ij     misc        1         -      r        "THZ0"                  "POTENTIAL TEMPERATURE AT ZNT"                 "K"
+state    real  Z0               ij     misc        1         -      r        "Z0"                    "Background ROUGHNESS LENGTH"                  "m"
+state   real   QZ0              ij     misc        1         -      r        "QZ0"                   "SPECIFIC HUMIDITY AT ZNT"                     "kg kg-1"
+state   real   UZ0              ij     misc        1         -      r        "UZ0"                   "U WIND COMPONENT AT ZNT"                      "m s-1"
+state   real   VZ0              ij     misc        1         -      r        "VZ0"                   "V WIND COMPONENT AT ZNT"                      "m s-1"
+state   real   QSFC             ij     misc        1         -      r        "QSFC"                  "SPECIFIC HUMIDITY AT LOWER BOUNDARY"          "kg kg-1"
+state   real   AKHS             ij     misc        1         -      r        "AKHS"                  "SFC EXCH COEFF FOR HEAT"                      "m s-1"    
+state   real   AKMS             ij     misc        1         -      r        "AKMS"                  "SFC EXCH COEFF FOR MOMENTUM"                  "m s-1"    
+state   integer KPBL            ij     misc        1         -     r         "KPBL"                  "LEVEL OF PBL TOP"                             ""
+i1      real   TSHLTR           ij     misc        1         -     -         "TSHLTR"                "SHELTER THETA FROM MYJ"                       "K"         
+i1      real   QSHLTR           ij     misc        1         -     -         "QSHLTR"                "SHELTER SPECIFIC HUMIDITY FROM MYJ"           "kg kg-1"
+i1      real   PSHLTR           ij     misc        1         -     -         "PSHLTR"                "SHELTER PRESSURE FROM MYJ"           "Pa"
+i1      real   TH10             ij     misc        1         -     -         "TH10"                  "10-M THETA FROM MYJ"                          "K"        
+i1      real   Q10              ij     misc        1         -     -         "Q10"                   "10-M SPECIFIC HUMIDITY FROM MYJ"              "kg kg-1"
+i1      real   CHKLOWQ          ij     misc        1         -     -         "CHKLOWQ"               "SURFACE SATURATION FLAG"        ""
+
+# gfdl (eta) radiation State Variables
+state    real    HTOP            ij     misc        1         -      r        "HTOP"                 "TOP OF CONVECTION LEVEL"         ""
+state    real    HBOT            ij     misc        1         -      r        "HBOT"                 "BOT OF CONVECTION LEVEL"         ""
+state    real    HTOPR           ij     misc        1         -      r        "HTOPR"                "TOP OF CONVECTION LEVEL FOR RADIATION"    ""
+state    real    HBOTR           ij     misc        1         -      r        "HBOTR"                "BOT OF CONVECTION LEVEL FOR RADIATION"    ""
+state    real    CUTOP           ij     misc        1         -      r        "CUTOP"                "TOP OF CONVECTION LEVEL FROM CUMULUS PAR"    ""
+state    real    CUBOT           ij     misc        1         -      r        "CUBOT"                "BOT OF CONVECTION LEVEL FROM CUMULUS PAR"    ""
+state    REAL      CUPPT         ij     misc        1         -      r        "CUPPT"                "ACCUMULATED CONVECTIVE RAIN SINC LAST CALL TO THE RADIATION"         ""
+state  real   rswtoa    ij    misc        1    -    i
+state  real   rlwtoa    ij    misc        1    -    i
+state  real   czmean    ij    misc      1    -     i
+state  real   cfracl    ij    misc      1    -     i
+state  real   cfracm    ij    misc      1    -     i
+state  real   cfrach    ij    misc      1    -     i
+state  real   acfrst    ij    misc        1    -    i
+state integer ncfrst    ij    misc        1    -    i
+state  real   acfrcv    ij    misc        1    -    i
+state integer ncfrcv    ij    misc        1    -    i
+
+# cam radiation variables
+state  real    -       iqjf ozmixm      1    -   -     -
+state  real   mth01    iqjf ozmixm      1    -   -     -
+state  real   mth02    iqjf ozmixm      1    -   -     -
+state  real   mth03    iqjf ozmixm      1    -   -     -
+state  real   mth04    iqjf ozmixm      1    -   -     -
+state  real   mth05    iqjf ozmixm      1    -   -     -
+state  real   mth06    iqjf ozmixm      1    -   -     -
+state  real   mth07    iqjf ozmixm      1    -   -     -
+state  real   mth08    iqjf ozmixm      1    -   -     -
+state  real   mth09    iqjf ozmixm      1    -   -     -
+state  real   mth10    iqjf ozmixm      1    -   -     -
+state  real   mth11    iqjf ozmixm      1    -   -     -
+state  real   mth12    iqjf ozmixm      1    -   -     -
+state  real   pin       q     misc      1    -   -      "PIN"             "PRESSURE LEVEL OF OZONE MIXING RATIO"  "millibar"
+state  real   m_ps       ij   misc      2    -   -      "m_ps"            "PS from MATCH on WRF grids"
+state  real    -       idjf aerosolc    2    -   -       -
+state  real   SUL      idjf aerosolc    2    -   -     "SUL"        "SUL aerosol concentration"
+state  real   SSLT     idjf aerosolc    2    -   -     "SSLT"        "SSLT aerosol concentration"
+state  real   DUST1    idjf aerosolc    2    -   -     "DUST1"        "DUST1 aerosol concentration"
+state  real   DUST2    idjf aerosolc    2    -   -     "DUST2"        "DUST2 aerosol concentration"
+state  real   DUST3    idjf aerosolc    2    -   -     "DUST3"        "DUST3 aerosol concentration"
+state  real   DUST4    idjf aerosolc    2    -   -     "DUST4"        "DUST4 aerosol concentration"
+state  real   OCPHO    idjf aerosolc    2    -   -     "OCPHO"        "OCPHO aerosol concentration"
+state  real   BCPHO    idjf aerosolc    2    -   -     "BCPHO"        "BCPHO aerosol concentration"
+state  real   OCPHI    idjf aerosolc    2    -   -     "OCPHI"        "OCPHI aerosol concentration"
+state  real   BCPHI    idjf aerosolc    2    -   -     "BCPHI"        "BCPHI aerosol concentration"
+state  real   BG       idjf aerosolc    2    -   -     "BG"        "BG aerosol concentration"
+state  real   VOLC     idjf aerosolc    2    -   -     "VOLC"        "VOLC aerosol concentration"
+state  real   m_hybi    d     misc      1    -   -     "m_hybi"         "MATCH hybi"
+
+# new eta microphpysics State Variables
+state    real    F_ICE_PHY       ikj    misc        1         -      rdu      "F_ICE_PHY"            "FRACTION OF ICE"         ""
+state    real    F_RAIN_PHY      ikj    misc        1         -      rdu      "F_RAIN_PHY"           "FRACTION OF RAIN "         ""
+state    real    F_RIMEF_PHY     ikj    misc        1         -      rdu      "F_RIMEF_PHY"          "MASS RATIO OF RIMED ICE "         ""
+# Other Misc State Variables
+
+                                            
+state   real    ht             ij      misc         1         -     i012rhdus  "HGT"              "Terrain Height"   "m"
+state   real    ht_fine        ij      misc         1         -     -          "HGT_FINE"         "Fine Terrain Height"   "m"
+state   real    ht_int         ij      misc         1         -     -          "HGT_INT"          "Terrain Height Horizontally Interpolated"   "m"
+state   real    ht_input       ij      misc         1         -     -          "HGT_INPUT"        "Terrain Height from FG Input File"   "m"
+
+#
+# h is removed from TSK, parce que la temperature de surface dans TSK n'est pas modifiee 
+#
+state   real    TSK            ij      misc         1         -     i012rdu=(copy_fcnm)    "TSK"                   "SURFACE SKIN TEMPERATURE"                  "K"
+state   real    TSK_SAVE       ij      misc         1         -     -         "TSK_SAVE" "SURFACE SKIN TEMPERATURE, EXTRA COPY FOR SEA ICE TESTS in REAL"       "K"
+
+state   real    h_diabatic     ikj     misc         1         -      r        "h_diabatic"            "PREVIOUS TIMESTEP CONDENSATIONAL HEATING"         ""      
+state   real    msft           ij      misc         1         -     i012rhdu=(copy_fcnm)    "MAPFAC_M"         "Map scale factor on mass grid" ""
+state   real    msfu           ij      misc         1         X     i012rhdu=(copy_fcnm)    "MAPFAC_U"         "Map scale factor on u-grid" ""
+state   real    msfv           ij      misc         1         Y     i012rhdu=(copy_fcnm)    "MAPFAC_V"         "Map scale factor on v-grid" ""
+state   real    f              ij      misc         1         -     i012rhdu=(copy_fcnm)    "f"                "Coriolis sine latitude term"  "s-1"
+state   real    e              ij      misc         1         -     i012rhdu=(copy_fcnm)    "e"                "Coriolis cosine latitude term"  "s-1"
+state   real    sina           ij      misc         1         -     i012rhdu=(copy_fcnm)    "SINALPHA"         "Local sine of map rotation"   ""
+state   real    cosa           ij      misc         1         -     i012rhdu=(copy_fcnm)    "COSALPHA"         "Local cosine of map rotation"  ""
+
+state   real    u_base         k       misc         1         -     ir        "u_base"                "BASE STATE X WIND IN IDEALIZED CASES"         ""      
+state   real    v_base         k       misc         1         -     ir        "v_base"                "BASE STATE Y WIND IN IDEALIZED CASES"         ""      
+state   real    qv_base        k       misc         1         -     ir        "qv_base"               "BASE STATE QV IN IDEALIZED CASES"         ""      
+state   real    z_base         k       misc         1         -     ir        "z_base"                "BASE STATE HEIGHT IN IDEALIZED CASES"         ""      
+state   real    u_frame        -       misc         1         -     ir        "u_frame"               "FRAME X WIND"         "m s-1"      
+state   real    v_frame        -       misc         1         -     ir        "v_frame"               "FRAME Y WIND"         "m s-1"      
+# p_top appears as metadata between SI and real but as a state variable in real and WRF
+# since it is a scalar and a constant, it makes sense to have it as metadata -- there
+# are, however, probably post-processing programs that expect to see it as an I/O record
+# another problem: share/input_wrf tries to read this as metadata (fine for real reading
+# SI, but with model reading real output, it generates a warning when debug is > 0 in
+# namelist and causes repeated questions from users.  A third problem is the potential
+# collision between a metadata name and a field record in the I/O data
+# resolve this how?  Have the real program throw a switch to tell the code to get it
+# from the metadata?  Otherwise it's a field?
+state   real    p_top          -       misc         -         -     irh       "p_top"                 "PRESSURE TOP OF THE MODEL"  "Pa"
+state   real    lat_ll_t       -       dyn_em       -         -     irh       "lat_ll_t"              "latitude lower left, temp point" "degrees"
+state   real    lat_ul_t       -       dyn_em       -         -     irh       "lat_ul_t"              "latitude up left, temp point" "degrees"
+state   real    lat_ur_t       -       dyn_em       -         -     irh       "lat_ur_t"              "latitude up right, temp point" "degrees"
+state   real    lat_lr_t       -       dyn_em       -         -     irh       "lat_lr_t"              "latitude lower right, temp point" "degrees"
+state   real    lat_ll_u       -       dyn_em       -         -     irh       "lat_ll_u"              "latitude lower left, u point" "degrees"
+state   real    lat_ul_u       -       dyn_em       -         -     irh       "lat_ul_u"              "latitude up left, u point" "degrees"
+state   real    lat_ur_u       -       dyn_em       -         -     irh       "lat_ur_u"              "latitude up right, u point" "degrees"
+state   real    lat_lr_u       -       dyn_em       -         -     irh       "lat_lr_u"              "latitude lower right, u point" "degrees"
+state   real    lat_ll_v       -       dyn_em       -         -     irh       "lat_ll_v"              "latitude lower left, v point" "degrees"
+state   real    lat_ul_v       -       dyn_em       -         -     irh       "lat_ul_v"              "latitude up left, v point" "degrees"
+state   real    lat_ur_v       -       dyn_em       -         -     irh       "lat_ur_v"              "latitude up right, v point" "degrees"
+state   real    lat_lr_v       -       dyn_em       -         -     irh       "lat_lr_v"              "latitude lower right, v point" "degrees"
+state   real    lat_ll_d       -       dyn_em       -         -     irh       "lat_ll_d"              "latitude lower left, massless point" "degrees"
+state   real    lat_ul_d       -       dyn_em       -         -     irh       "lat_ul_d"              "latitude up left, massless point" "degrees"
+state   real    lat_ur_d       -       dyn_em       -         -     irh       "lat_ur_d"              "latitude up right, massless point" "degrees"
+state   real    lat_lr_d       -       dyn_em       -         -     irh       "lat_lr_d"              "latitude lower right, massless point" "degrees"
+state   real    lon_ll_t       -       dyn_em       -         -     irh       "lon_ll_t"              "longitude lower left, temp point" "degrees"
+state   real    lon_ul_t       -       dyn_em       -         -     irh       "lon_ul_t"              "longitude up left, temp point" "degrees"
+state   real    lon_ur_t       -       dyn_em       -         -     irh       "lon_ur_t"              "longitude up right, temp point" "degrees"
+state   real    lon_lr_t       -       dyn_em       -         -     irh       "lon_lr_t"              "longitude lower right, temp point" "degrees"
+state   real    lon_ll_u       -       dyn_em       -         -     irh       "lon_ll_u"              "longitude lower left, u point" "degrees"
+state   real    lon_ul_u       -       dyn_em       -         -     irh       "lon_ul_u"              "longitude up left, u point" "degrees"
+state   real    lon_ur_u       -       dyn_em       -         -     irh       "lon_ur_u"              "longitude up right, u point" "degrees"
+state   real    lon_lr_u       -       dyn_em       -         -     irh       "lon_lr_u"              "longitude lower right, u point" "degrees"
+state   real    lon_ll_v       -       dyn_em       -         -     irh       "lon_ll_v"              "longitude lower left, v point" "degrees"
+state   real    lon_ul_v       -       dyn_em       -         -     irh       "lon_ul_v"              "longitude up left, v point" "degrees"
+state   real    lon_ur_v       -       dyn_em       -         -     irh       "lon_ur_v"              "longitude up right, v point" "degrees"
+state   real    lon_lr_v       -       dyn_em       -         -     irh       "lon_lr_v"              "longitude lower right, v point" "degrees"
+state   real    lon_ll_d       -       dyn_em       -         -     irh       "lon_ll_d"              "longitude lower left, massless point" "degrees"
+state   real    lon_ul_d       -       dyn_em       -         -     irh       "lon_ul_d"              "longitude up left, massless point" "degrees"
+state   real    lon_ur_d       -       dyn_em       -         -     irh       "lon_ur_d"              "longitude up right, massless point" "degrees"
+state   real    lon_lr_d       -       dyn_em       -         -     irh       "lon_lr_d"              "longitude lower right, massless point" "degrees"
+                                                
+# Other physics variables
+                                                
+state    real  RTHCUTEN        ikj      misc        1         -      r        "RTHCUTEN"              "COUPLED THETA TENDENCY DUE TO CUMULUS SCHEME"     "Pa K s-1"
+state    real  RQVCUTEN        ikj      misc        1         -      r        "RQVCUTEN"              "COUPLED Q_V TENDENCY DUE TO CUMULUS SCHEME"       "Pa kg kg-1 s-1"
+state    real  RQRCUTEN        ikj      misc        1         -      r        "RQRCUTEN"              "COUPLED Q_R TENDENCY DUE TO CUMULUS SCHEME"       "Pa kg kg-1 s-1"
+state    real  RQCCUTEN        ikj      misc        1         -      r        "RQCCUTEN"              "COUPLED Q_C TENDENCY DUE TO CUMULUS SCHEME"       "Pa kg kg-1 s-1"
+state    real  RQSCUTEN        ikj      misc        1         -      r        "RQSCUTEN"              "COUPLED Q_S TENDENCY DUE TO CUMULUS SCHEME"       "Pa kg kg-1 s-1"
+state    real  RQICUTEN        ikj      misc        1         -      r        "RQICUTEN"              "COUPLED Q_I TENDENCY DUE TO CUMULUS SCHEME"       "Pa kg kg-1 s-1"
+state    real  W0AVG           ikj      misc        1         -      r        "W0AVG"                 "AVERAGE VERTICAL VELOCITY FOR KF CUMULUS SCHEME"         "m s-1"
+                                                
+#
+# Variables 2D ne servent pas - peuvent servir pour la microphysique Mars
+# rajouter 'h' si l'on veut des sorties
+#
+state    real  RAINC            ij      misc        1         -      rdu     "RAINC"                 "ACCUMULATED TOTAL CUMULUS PRECIPITATION"                 "mm"      
+state    real  RAINNC           ij      misc        1         -      rdu     "RAINNC"                "ACCUMULATED TOTAL GRID SCALE PRECIPITATION"              "mm"      
+state    real  RAINCV           ij      misc        1         -      r        "RAINCV"                "TIME-STEP CUMULUS PRECIPITATION"                         "mm"      
+state    real  RAINNCV          ij      misc        1         -      r        "RAINNCV"               "TIME-STEP NONCONVECTIVE PRECIPITATION"                   "mm"
+state    real  RAINBL           ij      misc        1         -      r        "RAINBL"                "PBL TIME-STEP TOTAL PRECIPITATION"                       "mm"      
+state    real  SNOWNC           ij      misc        1         -      rdu     "SNOWNC"                "ACCUMULATED TOTAL GRID SCALE SNOW AND ICE"               "mm"
+state    real  GRAUPELNC        ij      misc        1         -      rdu     "GRAUPELNC"             "ACCUMULATED TOTAL GRID SCALE GRAUPEL"                    "mm"
+state    real  SNOWNCV          ij      misc        1         -      r        "SNOWNCV"               "TIME-STEP NONCONVECTIVE SNOW AND ICE"                    "mm"
+state    real  GRAUPELNCV       ij      misc        1         -      r        "GRAUPELNCV"            "TIME-STEP NONCONVECTIVE GRAUPEL"                      "mm"
+state    real  NCA              ij      misc        1         -      r        "NCA"                   "COUNTER OF THE CLOUD RELAXATION TIME IN KF CUMULUS SCHEME"    ""      
+state    integer  LOWLYR        ij      misc        1         -     -         "LOWLYR"                "INDEX OF LOWEST MODEL LAYER ABOVE THE GROUND IN BMJ SCHEME"   ""      
+state    real  MASS_FLUX        ij      misc        1         -      r        "MASS_FLUX"             "DOWNDRAFT MASS FLUX FOR IN GRELL CUMULUS SCHEME"  "mb hour-1"
+state    real  apr_gr           ij      misc         1         -      r       "APR_GR"                "PRECIP FROM CLOSURE OLD_GRELL"   "mm hour-1"
+state    real  apr_w            ij      misc         1         -      r       "APR_W"                 "PRECIP FROM CLOSURE W"           "mm hour-1"
+state    real  apr_mc           ij      misc         1         -      r       "APR_MC"                "PRECIP FROM CLOSURE KRISH MV"    "mm hour-1"
+state    real  apr_st           ij      misc         1         -      r       "APR_ST"                "PRECIP FROM CLOSURE STABILITY"   "mm hour-1"
+state    real  apr_as           ij      misc         1         -      r       "APR_AS"                "PRECIP FROM CLOSURE AS-TYPE"     "mm hour-1"
+state    real  apr_capma        ij      misc         1         -      r       "APR_CAPMA"             "PRECIP FROM MAX CAP"             "mm hour-1"
+state    real  apr_capme        ij      misc         1         -      r       "APR_CAPME"             "PRECIP FROM MEAN CAP"            "mm hour-1"
+state    real  apr_capmi        ij      misc         1         -      r       "APR_CAPMI"             "PRECIP FROM MIN CAP"             "mm hour-1"
+state    real  xf_ens           ije     misc        1         Z      r        "XF_ENS"                "MASS FLUX PDF IN GRELL CUMULUS SCHEME"    "mb hour-1"  
+state    real  pr_ens           ije     misc        1         Z      r        "PR_ENS"                "PRECIP RATE PDF IN GRELL CUMULUS SCHEME"  "mb hour-1" 
+state    real  RTHFTEN          ikj     misc        1         -      r        "RTHFTEN"               "TEMPERATURE TENDENCY USED IN GRELL CUMULUS SCHEME"  "K s-1"      
+state    real  RQVFTEN          ikj     misc        1         -      r        "RQVFTEN"               "MOISTURE TENDENCY USED IN GRELL CUMULUS SCHEME"     "kg s-1"
+
+state integer  STEPCU          -        misc        1         -      r        "STEPCU"                "NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN CONVECTION CALLS"  ""
+                                                
+state    real  RTHRATEN        ikj      misc        1         -      rd       "RTHRATEN"              "COUPLED THETA TENDENCY DUE TO RADIATION"              "Pa K s-1"
+state    real  RTHRATENLW      ikj      misc        1         -      r        "RTHRATLW"              "COUPLED THETA TENDENCY DUE TO LONG WAVE RADIATION"    "Pa K s-1"
+state    real  RTHRATENSW      ikj      misc        1         -      r        "RTHRATSW"              "COUPLED THETA TENDENCY DUE TO SHORT WAVE RADIATION"   "Pa K s-1"
+state    real  CLDFRA          ikj      misc        1         -      r        "CLDFRA"                "CLOUD FRACTION"                                       ""
+state    real  GLW              ij      misc        1         -      rd       "GLW"                   "DOWNWARD LONG  WAVE FLUX AT GROUND SURFACE"           "W m-2"      
+state    real  SWDOWN           ij      misc        1         -      rd      "SWDOWN"                "DOWNWARD SHORT WAVE FLUX AT GROUND SURFACE"           "W m-2"
+state    real  SWDOWNC          ij      misc        1         -      -       "SWDOWNC"               "DOWNWARD CLEAR-SKY SHORT WAVE FLUX AT GROUND SURFACE"           "W m-2"      
+state    real  GSW              ij      misc        1         -      rd       "GSW"                   "NET SHORT WAVE FLUX AT GROUND SURFACE"           "W m-2"      
+
+
+# upward and downward clearsky and total diagnostic fluxes for CAM radiation
+#state    real  ACSWUPT          ij      misc        1         -      rhdu     "ACSWUPT"               "ACCUMULATED UPWELLING SHORTWAVE FLUX AT TOP"          "J m-2"
+#state    real  ACSWUPTC         ij      misc        1         -      rhdu     "ACSWUPTC"              "ACCUMULATED UPWELLING CLEAR SKY SHORTWAVE FLUX AT TOP" "J m-2"
+#state    real  ACSWDNT          ij      misc        1         -      rhdu     "ACSWDNT"               "ACCUMULATED DOWNWELLING SHORTWAVE FLUX AT TOP"          "J m-2"
+#state    real  ACSWDNTC         ij      misc        1         -      rhdu     "ACSWDNTC"              "ACCUMULATED DOWNWELLING CLEAR SKY SHORTWAVE FLUX AT TOP" "J m-2"
+#state    real  ACSWUPB          ij      misc        1         -      rhdu     "ACSWUPB"               "ACCUMULATED UPWELLING SHORTWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  ACSWUPBC         ij      misc        1         -      rhdu     "ACSWUPBC"              "ACCUMULATED UPWELLING CLEAR SKY SHORTWAVE FLUX AT BOTTOM" "J m-2"
+#state    real  ACSWDNB          ij      misc        1         -      rhdu     "ACSWDNB"               "ACCUMULATED DOWNWELLING SHORTWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  ACSWDNBC         ij      misc        1         -      rhdu     "ACSWDNBC"              "ACCUMULATED DOWNWELLING CLEAR SKY SHORTWAVE FLUX AT BOTTOM" "J m-2"
+#state    real  ACLWUPT          ij      misc        1         -      rhdu     "ACLWUPT"               "ACCUMULATED UPWELLING LONGWAVE FLUX AT TOP"          "J m-2"
+#state    real  ACLWUPTC         ij      misc        1         -      rhdu     "ACLWUPTC"              "ACCUMULATED UPWELLING CLEAR SKY LONGWAVE FLUX AT TOP" "J m-2"
+#state    real  ACLWDNT          ij      misc        1         -      rhdu     "ACLWDNT"               "ACCUMULATED DOWNWELLING LONGWAVE FLUX AT TOP"          "J m-2"
+#state    real  ACLWDNTC         ij      misc        1         -      rhdu     "ACLWDNTC"              "ACCUMULATED DOWNWELLING CLEAR SKY LONGWAVE FLUX AT TOP" "J m-2"
+#state    real  ACLWUPB          ij      misc        1         -      rhdu     "ACLWUPB"               "ACCUMULATED UPWELLING LONGWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  ACLWUPBC         ij      misc        1         -      rhdu     "ACLWUPBC"              "ACCUMULATED UPWELLING CLEAR SKY LONGWAVE FLUX AT BOTTOM" "J m-2"
+#state    real  ACLWDNB          ij      misc        1         -      rhdu     "ACLWDNB"               "ACCUMULATED DOWNWELLING LONGWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  ACLWDNBC         ij      misc        1         -      rhdu     "ACLWDNBC"              "ACCUMULATED DOWNWELLING CLEAR SKY LONGWAVE FLUX AT BOTTOM" "J m-2"
+#state    real  SWUPT            ij      misc        1         -      rhdu     "SWUPT"                 "INSTANTANEOUS UPWELLING SHORTWAVE FLUX AT TOP"          "J m-2"
+#state    real  SWUPTC           ij      misc        1         -      rhdu     "SWUPTC"                "INSTANTANEOUS UPWELLING CLEAR SKY SHORTWAVE FLUX AT TOP" "J m-2"
+#state    real  SWDNT            ij      misc        1         -      rhdu     "SWDNT"                 "INSTANTANEOUS DOWNWELLING SHORTWAVE FLUX AT TOP"          "J m-2"
+#state    real  SWDNTC           ij      misc        1         -      rhdu     "SWDNTC"                "INSTANTANEOUS DOWNWELLING CLEAR SKY SHORTWAVE FLUX AT TOP" "J m-2"
+#state    real  SWUPB            ij      misc        1         -      rhdu     "SWUPB"                 "INSTANTANEOUS UPWELLING SHORTWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  SWUPBC           ij      misc        1         -      rhdu     "SWUPBC"                "INSTANTANEOUS UPWELLING CLEAR SKY SHORTWAVE FLUX AT BOTTOM" "J m-2"
+#state    real  SWDNB            ij      misc        1         -      rhdu     "SWDNB"                 "INSTANTANEOUS DOWNWELLING SHORTWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  SWDNBC           ij      misc        1         -      rhdu     "SWDNBC"                "INSTANTANEOUS DOWNWELLING CLEAR SKY SHORTWAVE FLUX AT BOTTOM" "J m-2"
+#state    real  LWUPT            ij      misc        1         -      rhdu     "LWUPT"                 "INSTANTANEOUS UPWELLING LONGWAVE FLUX AT TOP"          "J m-2"
+#state    real  LWUPTC           ij      misc        1         -      rhdu     "LWUPTC"                "INSTANTANEOUS UPWELLING CLEAR SKY LONGWAVE FLUX AT TOP" "J m-2"
+#state    real  LWDNT            ij      misc        1         -      rhdu     "LWDNT"                 "INSTANTANEOUS DOWNWELLING LONGWAVE FLUX AT TOP"          "J m-2"
+#state    real  LWDNTC           ij      misc        1         -      rhdu     "LWDNTC"                "INSTANTANEOUS DOWNWELLING CLEAR SKY LONGWAVE FLUX AT TOP" "J m-2"
+#state    real  LWUPB            ij      misc        1         -      rhdu     "LWUPB"                 "INSTANTANEOUS UPWELLING LONGWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  LWUPBC           ij      misc        1         -      rhdu     "LWUPBC"                "INSTANTANEOUS UPWELLING CLEAR SKY LONGWAVE FLUX AT BOTTOM" "J m-2"
+#state    real  LWDNB            ij      misc        1         -      rhdu     "LWDNB"                 "INSTANTANEOUS DOWNWELLING LONGWAVE FLUX AT BOTTOM"          "J m-2"
+#state    real  LWDNBC           ij      misc        1         -      rhdu     "LWDNBC"                "INSTANTANEOUS DOWNWELLING CLEAR SKY LONGWAVE FLUX AT BOTTOM" "J m-2"
+
+state    real  SWCF             ij      misc        1         -      r         "SWCF"                  "SHORT WAVE CLOUD FORCING AT TOA"                     "W m-2"
+state    real  LWCF             ij      misc        1         -      r         "LWCF"                  "LONG WAVE CLOUD FORCING AT TOA"                      "W m-2"
+state    real  OLR              ij      misc        1         -      r         "OLR"                   "TOA OUTGOING LONG WAVE"                              "W m-2"
+
+# these next 2 are for the HFSoLE/PET demo; writing these to auxhist1 output over MCEL for coupling
+# with wave model, only if compiled with -DMCELIO, JM 2003/05/29
+state    real  XLAT             ij      misc        1         -     i0123rh01du=(copy_fcnm)      "XLAT"                "LATITUDE, SOUTH IS NEGATIVE"                                          "degree_north"
+state    real  XLONG            ij      misc        1         -     i0123rh01du=(copy_fcnm)      "XLONG"               "LONGITUDE, WEST IS NEGATIVE"                                          "degree_east"
+state    real  XLAT_U           ij      dyn_em      1         X     i012rh01du=(copy_fcnm)       "XLAT_U"              "LATITUDE, SOUTH IS NEGATIVE"                                          "degree_north"
+state    real  XLONG_U          ij      dyn_em      1         X     i012rh01du=(copy_fcnm)       "XLONG_U"             "LONGITUDE, WEST IS NEGATIVE"                                          "degree_east"
+state    real  XLAT_V           ij      dyn_em      1         Y     i012rh01du=(copy_fcnm)       "XLAT_V"              "LATITUDE, SOUTH IS NEGATIVE"                                          "degree_north"
+state    real  XLONG_V          ij      dyn_em      1         Y     i012rh01du=(copy_fcnm)       "XLONG_V"             "LONGITUDE, WEST IS NEGATIVE"                                          "degree_east"
+state    real  ALBEDO           ij      misc        1         -      r           "ALBEDO"                   "ALBEDO"
+state    real  ALBBCK           ij      misc        1         -     i012r        "ALBBCK"                   "BACKGROUND ALBEDO"        ""
+state    real  EMISS            ij      misc        1         -      r        "EMISS"                 "SURFACE EMISSIVITY"         "" 
+
+state    real  CLDEFI           ij      misc        1         -      r        "CLDEFI"                "precipitation efficiency in BMJ SCHEME"    ""      
+state integer  STEPRA          -        misc        1         -      r        "STEPRA"                "NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN RADIATION CALLS"        ""
+                                                
+state    real  RUBLTEN         ikj      misc        1         -      r        "RUBLTEN"               "COUPLED X WIND TENDENCY DUE TO PBL PARAMETERIZATION"  "Pa m s-2"
+state    real  RVBLTEN         ikj      misc        1         -      r        "RVBLTEN"               "COUPLED Y WIND TENDENCY DUE TO PBL PARAMETERIZATION"  "Pa m s-2"
+state    real  RTHBLTEN        ikj      misc        1         -      r        "RTHBLTEN"              "COUPLED THETA TENDENCY DUE TO PBL PARAMETERIZATION"   "Pa K s-1"
+state    real  RQVBLTEN        ikj      misc        1         -      r        "RQVBLTEN"              "COUPLED Q_V TENDENCY DUE TO PBL PARAMETERIZATION"     "Pa kg kg-1 s-1"
+state    real  RQCBLTEN        ikj      misc        1         -      r        "RQCBLTEN"              "COUPLED Q_C TENDENCY DUE TO PBL PARAMETERIZATION"     "Pa kg kg-1 s-1"
+state    real  RQIBLTEN        ikj      misc        1         -      r        "RQIBLTEN"              "COUPLED Q_I TENDENCY DUE TO PBL PARAMETERIZATION"     "Pa kg kg-1 s-1"      
+
+# State vector for etampnew microphysics. Must be declared state because it is not read-once and is needed for restarting.
+state    real  mp_restart_state   p      misc        1         -      r       "MP_RESTART_STATE"       "STATE VECTOR FOR MICROPHYSICS RESTARTS"
+state    real  tbpvs_state        p      misc        1         -      r        "TBPVS_STATE"           "STATE FOR ETAMPNEW MICROPHYSICS"
+state    real  tbpvs0_state       p      misc        1         -      r        "TBPVS0_STATE"          "STATE FOR ETAMPNEW MICROPHYSICS"
+
+# State variables for landuse_init, Must be declared state because they are read in and needed for restarts. Had been SAVE vars in
+# landuse_init (phys/module_physics_init.F)
+state    integer  landuse_isice   -      misc       -          -     r
+state    integer  landuse_lucats  -      misc       -          -     r
+state    integer  landuse_luseas  -      misc       -          -     r
+state    integer  landuse_isn     -      misc       -          -     r
+state    real     lu_state        p      misc       -          -     r
+
+i1       real  th_phy          ikj      misc        1         -                                          
+i1       real  pi_phy          ikj      misc        1         -                                          
+i1       real  p_phy           ikj      misc        1         -                                          
+i1       real  t_phy           ikj      misc        1         -                                          
+i1       real  u_phy           ikj      misc        1         -                                          
+i1       real  v_phy           ikj      misc        1         -                                          
+i1       real  w_phy           ikj      misc        1         -
+i1       real  dz8w            ikj      misc        1         Z                                          
+i1       real  p8w             ikj      misc        1         Z                                          
+i1       real  t8w             ikj      misc        1         Z                                          
+i1       real  rho_phy         ikj      misc        1         -                                          
+i1    logical  CU_ACT_FLAG     ij       misc        1         -
+
+                                                
+state    real  TMN              ij      misc        1         -     i012rd=(interp_mask_land_field:lu_index)u=(copy_fcnm)     "TMN"                   "SOIL TEMPERATURE AT LOWER BOUNDARY"           "K"
+state    real  XLAND            ij      misc        1         -     i02rd=(interp_fcnm)u=(copy_fcnm)       "XLAND"                 "LAND MASK (1 FOR LAND, 2 FOR WATER)"          ""      
+state    real  ZNT              ij      misc        1         -      i3r      "ZNT"                   "TIME-VARYING ROUGHNESS LENGTH"                "m"      
+##### LES mettre h pour les deux variables ci-dessous
+state    real  UST              ij      misc        1         -      r        "UST"                   "U* IN SIMILARITY THEORY"                      "m s-1"      
+state    real  USTM             ij      misc        1         -      rh       "USTM"                  "U* IN SIMILARITY THEORY - LES MODE"           "m s-1"     #SAVEMARS2 ust 
+i1       real  HOL              ij      misc        1         -      -        "HOL"                   "PBL HEIGHT OVER MONIN-OBUKHOV LENGTH"         ""
+state    real  RMOL             ij      misc        1         -      r        "RMOL"                   "1./Monin Ob. Length"                      ""
+state    real  MOL              ij      misc        1         -      r        "MOL"                   "T* IN SIMILARITY THEORY"                      "K"      
+state    real  PBLH             ij      misc        1         -      r        "PBLH"                  "PBL HEIGHT"         "m"      
+state    real  CAPG             ij      misc        1         -      r        "CAPG"                  "HEAT CAPACITY FOR SOIL"                       "J K-1 m-3"      
+state    real  THC              ij      misc        1         -      r        "THC"                   "THERMAL INERTIA"                              "Cal cm-1 K-1 s-0.5"      
+state    real  HFX              ij      misc        1         -      rh       "HFX"                   "UPWARD HEAT FLUX AT THE SURFACE"              "W m-2"     #SAVEMARS2 hfx
+state    real  QFX              ij      misc        1         -      r        "QFX"                   "UPWARD MOISTURE FLUX AT THE SURFACE"          "kg m-2 s-1"      
+state    real  LH               ij      misc        1         -      r        "LH"                    "LATENT HEAT FLUX AT THE SURFACE"              "W m-2"
+state    real  FLHC             ij      misc        1         -      r        "FLHC"                  "SURFACE EXCHANGE COEFFICIENT FOR HEAT"       ""
+state    real  FLQC             ij      misc        1         -      r        "FLQC"                  "SURFACE EXCHANGE COEFFICIENT FOR MOISTURE"   ""
+state    real  QSG              ij      misc        1         -      r        "QSG"                   "SURFACE SATURATION WATER VAPOR MIXING RATIO"   "kg kg-1"
+state    real  QVG              ij      misc        1         -      r        "QVG"                   "WATER VAPOR MIXING RATIO AT THE SURFACE"      "kg kg-1"
+state    real  QCG              ij      misc        1         -      r        "QCG"                   "CLOUD WATER MIXING RATIO AT THE SURFACE"      "kg kg-1"
+state    real  SOILT1           ij      misc        1         -      r        "SOILT1"                "TEMPERATURE INSIDE SNOW "    "K"
+state    real  TSNAV            ij      misc        1         -      r        "TSNAV"                 "AVERAGE SNOW TEMPERATURE "                    "C"
+i1       real  REGIME           ij      misc        1         -                                          
+state    real  SNOWC            ij      misc        1         -     ird=(interp_mask_land_field:lu_index)u=(copy_fcnm)      "SNOWC"                 "FLAG INDICATING SNOW COVERAGE (1 FOR SNOW COVER)"         ""
+state    real  MAVAIL           ij      misc        1         -      r        "MAVAIL"                "SURFACE MOISTURE AVAILABILITY"                ""
+                                                
+state   real   tkesfcf          ij      misc        1         -      r        "tkesfcf"               "TKE AT THE SURFACE"                           "m2 s-2"      
+                                                
+state integer  STEPBL          -        misc        1         -      r        "STEPBL"                "NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN PBL CALLS" ""      
+state    real  taucldi         ikj      misc        1         -      r        "TAUCLDI"               "CLOUD OPTICAL THICKNESS FOR ICE"              ""
+state    real  taucldc         ikj      misc        1         -      r        "TAUCLDC"               "CLOUD OPTICAL THICKNESS FOR WATER"            ""
+                                                
+state   real  defor11          ikj      misc        1         -     r         "defor11"               "DEFORMATION 11"              "s-1"      
+state   real  defor22          ikj      misc        1         -     r         "defor22"               "DEFORMATION 22"              "s-1"      
+state   real  defor12          ikj      misc        1         -     r         "defor12"               "DEFORMATION 12"              "s-1"      
+state   real  defor33          ikj      misc        1         z     r         "defor33"               "DEFORMATION 33"              "s-1"      
+state   real  defor13          ikj      misc        1         z     r         "defor13"               "DEFORMATION 13"              "s-1"      
+state   real  defor23          ikj      misc        1         z     r         "defor23"               "DEFORMATION 23"              "s-1"      
+state   real   xkmv            ikj      misc        1         -     r         "xkmv"                  "VERTICAL EDDY VISCOSITY"     "m2 s-1"      
+state   real   xkmh            ikj      misc        1         -     r         "xkmh"                  "HORIZONTAL EDDY VISCOSITY"   "m2 s-1"      
+state   real   xkmhd           ikj      misc        1         -     r         "xkmhd"                 "HORIZONTAL EDDY DIFFUSIVITY" "m2 s-1"      
+state   real   xkhv            ikj      misc        1         -     r         "xkhv"                  "VERTICAL EDDY DIFFUSIVITY OF HEAT"                               "m2 s-1"      
+state   real   xkhh            ikj      misc        1         -     r         "xkhh"                  "HORIZONTAL EDDY DIFFUSIVITY OF HEAT"                             "m2 s-1"      
+state   real    div            ikj      misc        1         -     r         "div"                   "DIVERGENCE"                                                      "s-1"
+state   real    BN2            ikj      misc        1         -     r         "BN2"                   "BRUNT-VAISALA FREQUENCY"                                         "s-2"
+state  logical warm_rain        -       misc        1         -     -         "warm_rain"              "WARM_RAIN_LOGICAL"
+state  logical adv_moist_cond   -       misc        1         -     -         "adv_moist_cond"         "ADVECT MOIST CONDENSATES LOGICAL"
+
+## FDDA variables
+
+state integer  STEPFG            -        misc        1         -      r        "STEPFG"                "NUMBER OF FUNDAMENTAL TIMESTEPS BETWEEN FDDA GRID CALLS" ""
+state    real  RUNDGDTEN         ikj      misc        1         X      r        "RUNDGDTEN"               "COUPLED X WIND TENDENCY DUE TO FDDA GRID NUDGING"  "Pa m s-2"
+state    real  RVNDGDTEN         ikj      misc        1         Y      r        "RVNDGDTEN"               "COUPLED Y WIND TENDENCY DUE TO FDDA GRID NUDGING"  "Pa m s-2"
+state    real  RTHNDGDTEN        ikj      misc        1         -      r        "RTHNDGDTEN"              "COUPLED THETA TENDENCY DUE TO FDDA GRID NUDGING"   "Pa K s-1"
+state    real  RQVNDGDTEN        ikj      misc        1         -      r        "RQVNDGDTEN"              "COUPLED Q_V TENDENCY DUE TO FDDA GRID NUDGING"     "Pa kg kg-1 s-1"
+state    real  RMUNDGDTEN        ij       misc        1         -      r        "RMUNDGDTEN"              "MU TENDENCY DUE TO FDDA GRID NUDGING"     "Pa s-1"
+state    real    -               ikjf     fdda3d      1         -     -    -
+state    real  U_NDG_NEW         ikjf     fdda3d      1         X      igr      "U_NDG_NEW"               "NEW X WIND FOR FDDA GRID NUDGING"  "m s-1"
+state    real  V_NDG_NEW         ikjf     fdda3d      1         Y      igr      "V_NDG_NEW"               "NEW Y WIND FOR FDDA GRID NUDGING"  "m s-1"
+state    real  T_NDG_NEW         ikjf     fdda3d      1         -      igr      "T_NDG_NEW"               "NEW PERT POT TEMP FOR FDDA GRID NUDGING"  "K"
+state    real  Q_NDG_NEW         ikjf     fdda3d      1         -      igr      "Q_NDG_NEW"               "NEW WATER VAPOR MIX RATIO FOR FDDA GRID NUDGING"  "kg/kg"
+state    real  PH_NDG_NEW        ikjf     fdda3d      1         Z      igr      "PH_NDG_NEW"              "NEW PERT GEOPOTENTIAL FOR FDDA GRID NUDGING"  "kg/kg"
+state    real  U_NDG_OLD         ikjf     fdda3d      1         X      igr      "U_NDG_OLD"               "OLD X WIND FOR FDDA GRID NUDGING"  "m s-1"
+state    real  V_NDG_OLD         ikjf     fdda3d      1         Y      igr      "V_NDG_OLD"               "OLD Y WIND FOR FDDA GRID NUDGING"  "m s-1"
+state    real  T_NDG_OLD         ikjf     fdda3d      1         -      igr      "T_NDG_OLD"               "OLD PERT POT TEMP FOR FDDA GRID NUDGING"  "K"
+state    real  Q_NDG_OLD         ikjf     fdda3d      1         -      igr      "Q_NDG_OLD"               "OLD WATER VAPOR MIX RATIO FOR FDDA GRID NUDGING"  "kg/kg"
+state    real  PH_NDG_OLD        ikjf     fdda3d      1         Z      igr      "PH_NDG_OLD"              "OLD PERT GEOPOTENTIAL FOR FDDA GRID NUDGING"  "kg/kg"
+state    real    -               ivjf     fdda2d      1         Z     -    -
+state    real  MU_NDG_NEW        ivjf     fdda2d      1         Z      igr      "MU_NDG_NEW"              "NEW PERT COLUMN DRY MASS FOR FDDA GRID NUDGING"  "Pa"
+state    real  MU_NDG_OLD        ivjf     fdda2d      1         Z      igr      "MU_NDG_OLD"              "OLD PERT COLUMN DRY MASS FOR FDDA GRID NUDGING"  "Pa"
+
+
+# flag for nest movement
+state  logical moved            -       misc        1         -     -          
+
+# special cam radiation restart arrays
+state  real   abstot   ikcj   misc      1    Z   -     ""   ""  " "
+state  real   absnxt   ikaj   misc      1    -   -     ""   ""  " "
+state  real   emstot   ikj    misc      1    Z   -     ""   ""  " "
+
+# model diagnostics
+state   real  dpsdt            ij       misc        1         -     -         "dpsdt"           "surface pressure tendency"                         "Pa/sec"
+state   real  dmudt            ij       misc        1         -     -         "dmudt"           "mu tendency"                                       "Pa/sec"
+state   real  pk1m             ij       misc        1         -     -         "pk1m"            "surface pressure at previous step"                 "Pa"
+state   real  mu_2m            ij       misc        1         -     -         "mu_2m"           "mu_2 at previous step"                             "Pa"
+
+#
+#---------------------------------------------------------------------------------------------------------------------------------------
+#                                               
+
+######                                          
+#                                               
+# Variables that are set at run-time to control configuration  (namelist-settable)                                              
+#                                               
+#<Table>  <Type>  <Sym>                   <How set>          <Nentries>   <Default>                                             
+
+
+# Time Control
+rconfig   integer run_days                namelist,time_control		1             0       irh   "run_days"              "NUMBER OF DAYS TO RUN"
+rconfig   integer run_hours               namelist,time_control		1             0       irh   "run_hours"             "NUMBER OF HOURS TO RUN"
+rconfig   integer run_minutes             namelist,time_control		1             0       irh   "run_minutes"           "NUMBER OF MINUTES TO RUN"
+rconfig   integer run_seconds             namelist,time_control		1             0       irh   "run_seconds"           "NUMBER OF SECONDS TO RUN"
+rconfig   integer start_year              namelist,time_control 	max_domains    1999    irh   "start_year"            "4 DIGIT YEAR OF START OF MODEL" "YEARS"
+rconfig   integer start_month             namelist,time_control		max_domains      09    irh   "start_month"           "2 DIGIT MONTH OF THE YEAR OF START OF MODEL, 1-12" "MONTHS"
+rconfig   integer start_day               namelist,time_control		max_domains      09    irh   "start_day"             "2 DIGIT DAY OF THE MONTH OF START OF MODEL, 1-31" "DAYS"
+rconfig   integer start_hour              namelist,time_control		max_domains      09    irh   "start_hour"            "2 DIGIT HOUR OF THE DAY OF START OF MODEL, 0-23" "HOURS"
+rconfig   integer start_minute            namelist,time_control		max_domains      00    irh   "start_minute"          "2 DIGIT MINUTE OF THE HOUR OF START OF MODEL, 0-59" "MINUTES"
+rconfig   integer start_second            namelist,time_control		max_domains      00    irh   "start_second"          "2 DIGIT SECOND OF THE MINUTE OF START OF MODEL, 0-59" "SECONDS"
+rconfig   integer end_year                namelist,time_control		max_domains    1999    irh   "end_year"              "4 DIGIT YEAR OF END OF MODEL" "YEARS"
+rconfig   integer end_month               namelist,time_control		max_domains      09    irh   "end_month"             "2 DIGIT MONTH OF THE YEAR OF END OF MODEL, 1-12" "MONTHS"
+rconfig   integer end_day                 namelist,time_control		max_domains      09    irh   "end_day"               "2 DIGIT DAY OF THE MONTH OF END OF MODEL, 1-31" "DAYS"
+rconfig   integer end_hour                namelist,time_control		max_domains      19    irh   "end_hour"              "2 DIGIT HOUR OF THE DAY OF END OF MODEL, 0-23" "HOURS"
+rconfig   integer end_minute              namelist,time_control		max_domains      00    irh   "end_minute"            "2 DIGIT MINUTE OF THE HOUR OF END OF MODEL, 0-59" "MINUTES"
+rconfig   integer end_second              namelist,time_control		max_domains      00    irh   "end_second"            "2 DIGIT SECOND OF THE MINUTE OF END OF MODEL, 0-59" "SECONDS"
+rconfig   integer interval_seconds        namelist,time_control		1              3700    irh   "interval_seconds"      "SECONDS BETWEEN ANALYSIS AND BOUNDARY PERIODS" "SECONDS"
+rconfig   logical input_from_file         namelist,time_control		max_domains    .true.  irh    "input_from_file"      "T/F INPUT FOR THIS DOMAIN FROM A SEPARATE INPUT FILE"  ""
+rconfig   integer fine_input_stream       namelist,time_control		max_domains    0       irh    "fine_input_stream"      "0 THROUGH 5, WHAT INPUT STREAM IS FINE GRID IC FROM"  ""
+rconfig   logical input_from_hires        namelist,time_control		max_domains    .false. irh    "input_from_hires"     "T/F INPUT FOR THIS DOMAIN FROM USGS HI RES TERRAIN"  ""
+rconfig   character rsmas_data_path       namelist,time_control		1              "."     -    "rsmas_data_path"      ""  ""
+
+include registry.io_boilerplate
+
+rconfig   integer JULYR                   namelist,time_control		max_domains    0       h    "JULYR"                 ""      ""
+rconfig   integer JULDAY                  namelist,time_control		max_domains    1       h    "JULDAY"                ""      ""
+rconfig   real    GMT                     namelist,time_control		max_domains    0.      h    "GMT"           ""      ""
+rconfig   character  input_inname      namelist,time_control		1  "wrfinput_d<domain>"          -     "name of input   infile"   ""      ""
+rconfig   character  input_outname     namelist,time_control		1  "wrfinput_d<domain>"          -     "name of input   outfile"  ""      ""
+rconfig   character  bdy_inname        namelist,time_control		1  "wrfbdy_d<domain>"            -     "name of boundary infile"  ""      ""
+rconfig   character  bdy_outname       namelist,time_control		1  "wrfbdy_d<domain>"            -     "name of boundary outfile" ""      ""
+rconfig   character  rst_inname        namelist,time_control		1  "wrfrst_d<domain>_<date>"     -     "name of restrt infile"    ""      ""
+rconfig   character  rst_outname       namelist,time_control		1  "wrfrst_d<domain>_<date>"     -     "name of restrt outfile"   ""      ""
+rconfig   logical write_input             namelist,time_control		1             .false. -    "write input data for 3dvar etc."              ""      ""
+rconfig   logical write_restart_at_0h     namelist,time_control		1             .false. h    "write_restart_at_0h"              ""      ""
+rconfig   logical adjust_output_times     namelist,time_control         1             .false. -    "adjust_output_times"
+rconfig   logical adjust_input_times      namelist,time_control         1             .false. -    "adjust_input_times"
+
+rconfig   integer diag_print              namelist,time_control         1              0      -    "print out time series of model diagnostics"
+rconfig   logical nocolons                namelist,time_control         1             .false. -    "nocolons"
+
+# Domains
+rconfig   integer time_step               namelist,domains	1             -       ih   "time_step"     
+rconfig   integer time_step_fract_num     namelist,domains	1             0       ih   "time_step_fract_num"     
+rconfig   integer time_step_fract_den     namelist,domains	1             1       ih   "time_step_fract_den"     
+rconfig   integer max_dom                 namelist,domains	1             1       irh  "max_dom"               ""      ""
+rconfig   integer s_we                    namelist,domains	max_domains    1       irh    "s_we"          ""      ""
+rconfig   integer e_we                    namelist,domains	max_domains    101     irh    "e_we"          ""      ""
+rconfig   integer s_sn                    namelist,domains	max_domains    1       irh    "s_sn"          ""      ""
+rconfig   integer e_sn                    namelist,domains	max_domains    101     irh    "e_sn"          ""      ""
+rconfig   integer s_vert                  namelist,domains	max_domains    1       irh    "s_vert"                ""      ""
+rconfig   integer e_vert                  namelist,domains	max_domains    51      irh    "e_vert"                ""      ""
+rconfig   integer num_metgrid_levels      namelist,domains	1              26      irh    "num_metgrid_levels"                ""      ""
+rconfig   real    p_top_requested         namelist,domains      1              2       irh    "p_top_requested" "Pa"      ""
+rconfig   integer interp_type             namelist,domains	1              2       irh    "interp_type"  "1=interp in pressure, 2=interp in LOG pressure"      ""
+rconfig   logical lowest_lev_from_sfc     namelist,domains	1             .false.  irh    "lowest_lev_from_sfc"                ""      ""
+rconfig   integer lagrange_order          namelist,domains	1              1       irh    "lagrange_order"   "1=linear, 2=quadratic vertical interpolation"      ""
+rconfig   integer force_sfc_in_vinterp    namelist,domains	1              8       irh    "force_sfc_in_vinterp"   "number of eta levels forced to use sfc in vert interp"      ""
+rconfig   real    zap_close_levels        namelist,domains	1              0       irh    "zap_close_levels"   "delta p where level is removed in vert interp"      "Pa"
+rconfig   logical sfcp_to_sfcp            namelist,domains	1              .true.  irh    "sfcp_to_sfcp"   "T/F use incoming sfc pres to compute new sfc pres"      "flag"
+rconfig   logical adjust_heights          namelist,domains	1              .false. irh    "adjust_heights"   "T/F adjust pressure level input to match 500 mb height"      "flag"
+rconfig   real    dx                      namelist,domains      max_domains   5000     h     "dx"        "X HORIZONTAL RESOLUTION"   "METERS"
+rconfig   real    dy                      namelist,domains   	max_domains   5000     h     "dy"        "Y HORIZONTAL RESOLUTION"   "METERS"
+rconfig   integer grid_id                 namelist,domains	max_domains    1       irh    "id"            ""      ""
+rconfig   integer parent_id               namelist,domains	max_domains    0       h     "parent_id"             ""      ""
+rconfig   integer i_parent_start          namelist,domains	max_domains    0       rh    "i_parent_start"                ""      ""
+rconfig   integer j_parent_start          namelist,domains	max_domains    0       rh    "j_parent_start"                ""      ""
+rconfig   integer parent_grid_ratio       namelist,domains	max_domains    1       h     "parent_grid_ratio"             ""      ""
+rconfig   integer parent_time_step_ratio  namelist,domains	max_domains    1       h     "parent_time_step_ratio"                ""      ""
+rconfig   integer feedback                namelist,domains	1    0       h     "feedback"          ""      ""
+rconfig   integer smooth_option           namelist,domains	1    0       h     "smooth_option"          ""      ""
+rconfig   integer blend_width             namelist,domains	1    5       h     "blend_width"  "width of cg fg terrain blended zone"      ""
+rconfig   real    ztop                    namelist,domains	max_domains    35000.  h    "ztop"          ""      ""
+rconfig   integer moad_grid_ratio         namelist,domains	max_domains    1       h     "moad_grid_ratio"               ""      ""
+rconfig   integer moad_time_step_ratio    namelist,domains	max_domains    1       h     "moad_time_step_ratio"          ""      ""
+rconfig   integer shw                     namelist,domains	max_domains    2       h     "stencil_half_width"   "HORIZONTAL INTERPOLATION STENCIL HALF-WIDTH"  "GRID POINTS"
+rconfig   integer tile_sz_x               namelist,domains	1             0       -      "tile_sz_x"             ""      ""
+rconfig   integer tile_sz_y               namelist,domains	1             0       -      "tile_sz_y"             ""      ""
+rconfig   integer numtiles                namelist,domains	1             1       -      "numtiles"              ""      ""
+rconfig   integer nproc_x                 namelist,domains	1             -1       -      "nproc_x"              "-1 means not set"      ""
+rconfig   integer nproc_y		  namelist,domains	1             -1       -      "nproc_y"              "-1 means not set"      ""
+rconfig   integer irand                   namelist,domains	1             0       -      "irand"           ""      ""
+rconfig   real    dt                      derived              max_domains    2.      h     "dt"        "TEMPORAL RESOLUTION"      "SECONDS"
+rconfig   integer   num_moves       namelist,domains    1                0
+rconfig   integer   vortex_interval  namelist,domains   max_domains      15  -  "" "" "minutes"
+rconfig   integer   max_vortex_speed namelist,domains   max_domains      40  -  "" "" "meters per second"
+rconfig   integer   corral_dist     namelist,domains    max_domains      8
+rconfig   integer   move_id         namelist,domains    max_moves        0
+rconfig   integer   move_interval   namelist,domains    max_moves        999999999
+rconfig   integer   move_cd_x       namelist,domains    max_moves        0
+rconfig   integer   move_cd_y       namelist,domains    max_moves        0
+rconfig   logical   swap_x          namelist,domains    max_domains    .false. rh    "swap_x"            ""      ""
+rconfig   logical   swap_y          namelist,domains    max_domains    .false. rh    "swap_y"            ""      ""
+rconfig   logical   cycle_x         namelist,domains    max_domains    .false. rh    "cycle_x"            ""      ""
+rconfig   logical   cycle_y         namelist,domains    max_domains    .false. rh    "cycle_y"            ""      ""
+rconfig   logical   reorder_mesh    namelist,domains    1              .false. rh    "reorder_mesh"       ""      ""
+rconfig   logical   perturb_input   namelist,domains    1              .false. h     "" "" ""
+rconfig   real      eta_levels      namelist,domains    max_eta        -1.
+rconfig   real      max_dz          namelist,domains    1               1500.
+
+# Physics
+#######
+####### MARS SPECIFIC NAMELIST ENTRIES
+#######
+rconfig  integer  mars      namelist,physics  max_domains  0        rh   "mars"      "model mode"              ""
+rconfig  real     init_TI   namelist,physics  max_domains  0        irh  "init_TI"   "thermal inertia"         ""
+rconfig  real     init_AL   namelist,physics  max_domains  0        irh  "init_AL"   "albedo"                  ""
+rconfig  real     init_U    namelist,physics  max_domains  0        irh  "init_U"    "zonal wind"              ""
+rconfig  real     init_V    namelist,physics  max_domains  0        irh  "init_V"    "meridional wind"         ""
+rconfig  integer  init_WX   namelist,physics  max_domains  0        irh  "init_WX"   "x coord"                 ""
+rconfig  integer  init_WY   namelist,physics  max_domains  0        irh  "init_WY"   "y coord"                 ""
+rconfig  real     init_MU   namelist,physics  max_domains  0        irh  "init_MU"   "zonal wind mult."        ""
+rconfig  real     init_MV   namelist,physics  max_domains  0        irh  "init_MV"   "meridional wind mult."   ""
+rconfig  logical  init_LES  namelist,physics  max_domains  .false.  irh  "init_LES"  "LES mode"                ""
+rconfig  logical  modif_wrf namelist,physics  max_domains  .true.   ir   "modif_wrf" "true if tweaked WRF"     ""
+#######
+####### MARS SPECIFIC NAMELIST ENTRIES
+#######
+rconfig   integer     mp_physics          namelist,physics	max_domains    0       rh       "mp_physics"            ""      ""
+rconfig   integer     ra_lw_physics       namelist,physics	max_domains    0       rh       "ra_lw_physics"         ""      ""
+rconfig   integer     ra_sw_physics       namelist,physics	max_domains    0       rh       "ra_sw_physics"         ""      ""
+rconfig   real    radt                    namelist,physics	max_domains    1       h    "RADT"          ""      ""
+rconfig   integer     sf_sfclay_physics   namelist,physics	max_domains    0       rh       "sf_sfclay_physics"             ""      ""
+rconfig   integer     sf_surface_physics  namelist,physics	max_domains    0       rh       "sf_surface_physics"            ""      ""
+rconfig   integer     bl_pbl_physics      namelist,physics	max_domains    0       rh       "bl_pbl_physics"                ""      ""
+rconfig   real    BLDT                    namelist,physics	max_domains    0       h    "BLDT"          ""      ""
+rconfig   integer     cu_physics          namelist,physics	max_domains    0       rh       "cu_physics"            ""      ""
+rconfig   real    CUDT                    namelist,physics	max_domains    100000   h    "CUDT"          ""      ""
+rconfig   real    GSMDT                   namelist,physics	max_domains    0       h    "GSMDT"          ""      ""
+rconfig   integer ISFFLX                  namelist,physics 	1             1       irh    "ISFFLX"                        ""      ""
+rconfig   integer IFSNOW                  namelist,physics	1             0       irh    "IFSNOW"                        ""      ""
+rconfig   integer ICLOUD                  namelist,physics	1             1       irh    "ICLOUD"                        ""      ""
+rconfig   real    swrad_scat              namelist,physics	1             1       irh    "SWRAD_SCAT" "SCATTERING FACTOR IN SWRAD"      ""
+rconfig   integer surface_input_source    namelist,physics	1             1       irh    "surface_input_source"          "1=static (fractional), 2=time dependent (dominant), 3=hybrid (not yet implemented)"      ""
+rconfig   integer num_soil_layers         namelist,physics	1            10       irh    "num_soil_layers"               ""      ""
+rconfig   integer num_months              namelist,physics      1            12       irh    "num_months"               ""      ""
+rconfig   integer maxiens                 namelist,physics	1             1       irh    "maxiens"                    ""      ""
+rconfig   integer maxens                  namelist,physics	1             3       irh    "maxens"                    ""      ""
+rconfig   integer maxens2                 namelist,physics	1             3       irh    "maxens2"                    ""      ""
+rconfig   integer maxens3                 namelist,physics	1            16       irh    "maxens3"                    ""      ""
+rconfig   integer ensdim                  namelist,physics	1            144      irh    "ensdim"                    ""      ""
+rconfig   integer     chem_opt            namelist,physics	max_domains    0       rh       "chem_opt"              ""      ""
+rconfig   integer num_land_cat            namelist,physics	1            24       -      "num_land_cat"                  ""      ""
+rconfig   integer num_soil_cat            namelist,physics	1            16       -      "num_soil_cat"                  ""      ""
+rconfig   integer mp_zero_out             namelist,physics	1             0       -      "mp_zero_out"  "microphysics fields set to zero  0=no action taken, 1=all fields but Qv, 2=all fields including Qv"      "flag"
+rconfig   real mp_zero_out_thresh         namelist,physics	1          1.e-8      -      "mp_zero_out_thresh"  "minimum threshold for non-Qv moist fields, below are set to zero"  "kg/kg"
+rconfig   real    seaice_threshold        namelist,physics	1            271       h    "seaice_threshold"  "tsk below which which water points are set to sea ice for slab scheme"   "K"
+rconfig   integer sst_update              namelist,physics	1            0         h    "sst_update"  "update sst from wrflowinp file  0=no, 1=yes"   ""
+rconfig   integer ucmcall                 namelist,physics      1            0         h    "ucmcall"     "activate urban model  0=no, 1=yes"   ""
+rconfig   integer co2tf                   namelist,physics	1            0         -    "co2tf" "GFDL radiation co2 flag" ""
+rconfig   integer ra_call_offset          namelist,physics	1            0         -    "ra_call_offset" "radiation call offset in timesteps (-1=old, 0=new offset)" ""
+rconfig   real    cam_abs_freq_s          namelist,physics      1         21600.      -      "cam_abs_freq_s" "CAM radiation frequency for clear-sky longwave calculations" "s"
+rconfig   integer levsiz                  namelist,physics      1             1       -      "levsiz" "Number of ozone data levels for CAM radiation (59)"  ""
+rconfig   integer paerlev                 namelist,physics      1             1       -      "paerlev" "Number of aerosol data levels for CAM radiation (29)"  ""
+rconfig   integer cam_abs_dim1            namelist,physics      1             1       -      "cam_abs_dim1" "dimension for absnxt in CAM radiation"  ""
+rconfig   integer cam_abs_dim2            namelist,physics      1             1       -      "cam_abs_dim2" "dimension for abstot in CAM radiation"  ""
+rconfig   logical cu_rad_feedback             namelist.physics      max_domains   .false.  -     "feedback cumulus to radiation"
+
+#FDDA namelist parameters
+rconfig   real    FGDT                    namelist,fdda         max_domains    0       h        "FGDT"          ""      ""
+rconfig   integer  grid_fdda              namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer  if_no_pbl_nudging_uv   namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer  if_no_pbl_nudging_t    namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer  if_no_pbl_nudging_q    namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer  if_zfac_uv             namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer   k_zfac_uv             namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer  if_zfac_t              namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer   k_zfac_t              namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer  if_zfac_q              namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   integer   k_zfac_q              namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   real        guv                 namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   real        gt                  namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   real        gq                  namelist,fdda         max_domains    0       rh       "grid_fdda"            ""      ""
+rconfig   real    dtramp_min              namelist,fdda         1              0       h        "grid_fdda"            ""      ""
+rconfig   integer if_ramping              namelist,fdda         1              0       h        "grid_fdda"            ""      ""
+
+#Observational Nudging
+rconfig   integer     obs_nudge_opt       namelist,fdda            max_domains    0       rh       "obs_nudge_opt"     "Obs-nudging flag for domain"          ""
+rconfig   integer     max_obs             namelist,fdda            1              0       h        "max_obs"           "Maximum number of observations"       ""
+rconfig   integer     nobs_ndg_vars       namelist,fdda            1              0       h        "num_ndg_vars"      "Number of nudging variables"          ""
+rconfig   integer     nobs_err_flds       namelist,fdda            1              0       h        "num_err_flds"      "Number of error fields"               ""
+rconfig   real        fdda_start          namelist,fdda            max_domains    0       rh       "fdda_start"        "Nudging start time for domain"        "min"
+rconfig   real        fdda_end            namelist,fdda            max_domains    0       rh       "fdda_end"          "Nudging end time for domain"          "min"
+rconfig   integer     obs_nudge_wind      namelist,fdda            max_domains    0       rh       "obs_nudge_wind"    "Wind-nudging flag for domain"         ""
+rconfig   real        obs_coef_wind       namelist,fdda            max_domains    0       rh       "obs_coef_wind"     "Wind-nudging coeficient for domain"   "s-1"
+rconfig   integer     obs_nudge_temp      namelist,fdda            max_domains    0       rh       "obs_nudge_temp"    "Temperature-nudging flag for domain"  ""
+rconfig   real        obs_coef_temp       namelist,fdda            max_domains    0       rh       "obs_coef_temp"     "Temperature-nudging coef for domain"  "s-1"
+rconfig   integer     obs_nudge_mois      namelist,fdda            max_domains    0       rh       "obs_nudge_mois"    "Moisture-nudging flag for domain"     ""
+rconfig   real        obs_coef_mois       namelist,fdda            max_domains    0       rh       "obs_coef_mois"     "Moisture-nudging coef for domain"     "s-1"
+rconfig   integer     obs_nudge_pstr      namelist,fdda            max_domains    0       rh       "obs_nudge_pstr"    "Not used"                             ""
+rconfig   real        obs_coef_pstr       namelist,fdda            max_domains    0       rh       "obs_coef_pstr"     "Not used"                             ""
+rconfig   real        obs_rinxy           namelist,fdda            max_domains    0       rh       "obs_rinxy"         "Horizontal radius of influence"       "km"
+rconfig   real        obs_rinsig          namelist,fdda            1              0       h        "obs_rinsig"        "Vertical radius of influence"         "sigma"
+rconfig   real        obs_twindo          namelist,fdda            1              0       h        "obs_twindo"        "Half-period time window for nudging"  "min"
+rconfig   integer     obs_npfi            namelist,fdda            1              0       h        "obs_npfi"          "Freq in cg timesteps for diag print"  ""
+rconfig   integer     obs_ionf            namelist,fdda            1              0       h        "obs_ionf"          "Freq in cg timesteps for obs input and error calc"   ""
+rconfig   integer     obs_idynin          namelist,fdda            1              0       h        "obs_idynin"        "Flag for dynamic initialization"      ""
+rconfig   real        obs_dtramp          namelist,fdda            1              0       h        "obs_dtramp"        "Time period for ramping (idynin)"     "min"
+rconfig   logical     obs_ipf_in4dob      namelist,fdda            1              .false. h        "obs_ipf_in4dob"    "Print obs input diagnostics"   "min"
+rconfig   logical     obs_ipf_errob       namelist,fdda            1              .false. h        "obs_ipf_errob"     "Print obs error diagnostics"   "min"
+rconfig   logical     obs_ipf_nudob       namelist,fdda            1              .false. h        "obs_ipf_nudob"     "Print obs nudge diagnostics"   "min"
+
+# Dynamics
+# dynamics option (see package definitions, below)
+rconfig   integer dyn_opt                 namelist,dynamics	1             2       irh   "dyn_opt"               ""      ""
+rconfig   integer rk_ord                  namelist,dynamics	1             3       irh   "rk_order"               ""      ""
+rconfig   integer w_damping               namelist,dynamics	1             0       irh   "w_damping"             ""      ""
+# diff_opt 1=old diffusion, 2=new
+rconfig   integer diff_opt                namelist,dynamics	1             1       irh   "diff_opt"              ""      ""
+# km_opt   1=old coefs, 2=tke, 3=Smagorinksy
+rconfig   integer km_opt                  namelist,dynamics	1             4       irh   "km_opt"                ""      ""
+rconfig   integer damp_opt                namelist,dynamics	1             0       irh   "damp_opt"              ""      ""
+rconfig   real    zdamp                   namelist,dynamics	max_domains    5000.   h    "zdamp"         ""      ""
+rconfig   real    dampcoef                namelist,dynamics     max_domains    0.05    h    "dampcoef"              ""      ""
+rconfig   real    khdif                   namelist,dynamics	max_domains    0       h    "khdif"         ""      ""
+rconfig   real    kvdif                   namelist,dynamics	max_domains    0       h    "kvdif"         ""      ""
+rconfig   real    diff_6th_factor         namelist,dynamics     max_domains    0.2     h    "diff_6th_factor" "factor that controls rate of 6th-order numerical diffusion"
+rconfig   integer diff_6th_opt            namelist,dynamics     max_domains    2      irh   "diff_6th_opt" "switch for 6th-order numerical diffusion"
+rconfig   real    smdiv                   namelist,dynamics	max_domains    0.1     h    "smdiv"         ""      ""
+rconfig   real    emdiv                   namelist,dynamics	max_domains    0.01    h    "emdiv"         ""      ""
+rconfig   real    epssm                   namelist,dynamics	max_domains    0.1     h    "epssm"         ""      ""
+rconfig   logical non_hydrostatic         namelist,dynamics	max_domains  .true.   irh   "non_hydrostatic"    ""   ""
+rconfig   integer time_step_sound         namelist,dynamics	max_domains    6       h    "time_step_sound"               ""      ""
+rconfig   integer     h_mom_adv_order     namelist,dynamics	max_domains    5       rh       "h_mom_adv_order"               ""      ""
+rconfig   integer     v_mom_adv_order     namelist,dynamics	max_domains    3       rh       "v_mom_adv_order"               ""      ""
+rconfig   integer     h_sca_adv_order     namelist,dynamics	max_domains    5       rh       "h_sca_adv_order"               ""      ""
+rconfig   integer     v_sca_adv_order     namelist,dynamics	max_domains    3       rh       "v_sca_adv_order"               ""      ""
+rconfig   logical     pd_moist            namelist,dynamics	max_domains    .false.  rh    "pd_moist"         "positive-definite RK3 transport switch"      ""
+rconfig   logical     pd_chem             namelist,dynamics	max_domains    .false. rh    "pd_chem"          "positive-definite RK3 transport switch"      ""
+rconfig   logical     pd_scalar           namelist,dynamics	max_domains    .true.  rh    "pd_scalar"        "positive-definite RK3 transport switch"      ""
+#rconfig   logical     pd_scalar           namelist,dynamics     max_domains    .false. rh    "pd_scalar"        "positive-definite RK3 transport switch"      ""
+rconfig   logical     pd_tke              namelist,dynamics	max_domains    .false. rh    "pd_tke"           "positive-definite RK3 transport switch"      ""
+rconfig   logical top_radiation           namelist,dynamics	max_domains    .false. rh    "top_radiation"         ""      ""
+rconfig   real    mix_cr_len              namelist,dynamics	max_domains    200.    h    "mix_cr_len"            ""      ""
+rconfig   real    tke_upper_bound         namelist,dynamics	max_domains    1000.   h    "tke_upper_bound"            ""      ""
+rconfig   real    kh_tke_upper_bound      namelist,dynamics	max_domains    1000.   h    "kh_tke_upper_bound"         ""      ""
+rconfig   real    kv_tke_upper_bound      namelist,dynamics	max_domains    1000.   h    "kv_tke_upper_bound"         ""      ""
+rconfig   real    tke_drag_coefficient    namelist,dynamics	max_domains    0.      h    "tke_drag_coefficient"       ""      "dimensionless"
+rconfig   real    tke_heat_flux           namelist,dynamics	max_domains    0.      h    "tke_heat_flux"              ""      "K m s-1"
+rconfig   logical pert_coriolis           namelist,dynamics	max_domains  .false.  irh  "pert_coriolis"    ""   ""
+rconfig   logical mix_full_fields         namelist,dynamics     max_domains  .false.  irh  "mix_full_field"   ""   ""
+rconfig   real    base_pres               namelist,dynamics	1             610.     h    "base_pres"  "Mars Base state pressure, real only"      "Pa"
+rconfig   real    base_temp               namelist,dynamics	1             220.     h    "base_temp"  "Mars Base state sea level temperature, real only"      "K"
+rconfig   real    base_lapse              namelist,dynamics	1              30.     h    "base_lapse" "Mars Base state temperature difference between base pres and 1/e of atm depth - do not change, real only"      "K"
+rconfig   real    tiso                    namelist,dynamics     1             140.     h    "tiso"    "Mars isothermal value for high alt, real only"  "K"
+
+# Bdy_control
+rconfig   integer spec_bdy_width          namelist,bdy_control		1             5       irh    "spec_bdy_width"                ""      ""
+rconfig   integer spec_zone               namelist,bdy_control		1             1       irh    "spec_zone"                     ""      ""
+rconfig   integer relax_zone              namelist,bdy_control		1             4       irh    "relax_zone"                    ""      ""
+rconfig   logical specified               namelist,bdy_control	max_domains    .true.  rh    "specified"             ""      ""
+rconfig   logical periodic_x              namelist,bdy_control	max_domains    .false. rh    "periodic_x"            ""      ""
+rconfig   logical symmetric_xs            namelist,bdy_control	max_domains    .false. rh    "symmetric_xs"          ""      ""
+rconfig   logical symmetric_xe            namelist,bdy_control	max_domains    .false. rh    "symmetric_xe"          ""      ""
+rconfig   logical open_xs                 namelist,bdy_control	max_domains    .false. rh    "open_xs"               ""      ""
+rconfig   logical open_xe                 namelist,bdy_control	max_domains    .false. rh    "open_xe"               ""      ""
+rconfig   logical periodic_y              namelist,bdy_control	max_domains    .false. rh    "periodic_y"            ""      ""
+rconfig   logical symmetric_ys            namelist,bdy_control	max_domains    .false. rh    "symmetric_ys"          ""      ""
+rconfig   logical symmetric_ye            namelist,bdy_control	max_domains    .false. rh    "symmetric_ye"          ""      ""
+rconfig   logical open_ys                 namelist,bdy_control	max_domains    .false. rh    "open_ys"               ""      ""
+rconfig   logical open_ye                 namelist,bdy_control	max_domains    .false. rh    "open_ye"               ""      ""
+rconfig   logical nested                  namelist,bdy_control	max_domains    .false. rh    "nested"                ""      ""
+rconfig   integer real_data_init_type     namelist,bdy_control		1                 1    irh   "real_data_init_type"   "REAL DATA INITIALIZATION OPTIONS: 1=SI, 2=MM5, 3=GENERIC" "PRE-PROCESSOR TYPES"
+
+rconfig   integer background_proc_id      namelist,grib2 	        1     255    rh    "background_proc_id"    "Background processing id for grib2"  ""
+rconfig   integer forecast_proc_id        namelist,grib2 	        1     255    rh    "forecast_proc_id"      "Analysis and forecast processing id for grib2"  ""
+rconfig   integer production_status       namelist,grib2 	        1     255    rh    "production_status"     "Background processing id for grib2"  ""
+rconfig   integer compression             namelist,grib2 	        1      40    rh    "compression"           "grib2 compression, 40 for JPEG2000 or 41 for PNG"  ""
+
+# NAMELIST DERIVED
+rconfig   real    cen_lat                 derived                  max_domains    0       -        "cen_lat"              "center latitude"      "degrees, negative is south"
+rconfig   real    cen_lon                 derived                  max_domains    0       -        "cen_lon"              "central longitude"      "degrees, negative is west"
+rconfig   real    truelat1                derived                  max_domains    0       -        "true_lat1"             "first standard parallel"      "degrees, negative is south"
+rconfig   real    truelat2                derived                  max_domains    0       -        "true_lat2"             "second standard parallel"      "degrees, negative is south"
+rconfig   real    moad_cen_lat            derived                  max_domains    0       -        "moad_cen_lat"             "center latitude of the most coarse grid"      "degrees, negative is south"
+rconfig   real    stand_lon               derived                  max_domains    0       -        "stand_lon"             "standard longitude, parallel to j-direction, perpendicular to i-direction "      "degrees, negative is west"
+rconfig   real    bdyfrq                  derived                  max_domains    0       -        "bdyfrq"               "lateral boundary input frequency"      "seconds"
+rconfig   integer iswater                 derived                  max_domains    0       -        "iswater"              "land use index of water"      "index category"
+rconfig   integer isice                   derived                  max_domains    0       -        "isice"                "land use index of ice"        "index category"
+rconfig   integer isurban                 derived                  max_domains    0       -        "isurban"              "land use index for 'urban and built-up"     "index category"
+rconfig   integer isoilwater              derived                  max_domains    0       -        "isoilwater"           "land use index of water for soil"        "index category"
+rconfig   integer map_proj                derived                  max_domains    0       -        "map_proj"             "domain map projection"      "0=none, 1=Lambert, 2=polar, 3=Mercator"
+rconfig   integer simulation_start_year   derived                  1              0       -        "simulation_start_year" "start of simulation through restarts" "4-digit year"
+rconfig   integer simulation_start_month  derived                  1              0       -        "simulation_start_month" "start of simulation through restarts" "2-digit month"
+rconfig   integer simulation_start_day    derived                  1              0       -        "simulation_start_day" "start of simulation through restarts" "2-digit day"
+rconfig   integer simulation_start_hour   derived                  1              0       -        "simulation_start_hour" "start of simulation through restarts" "2-digit hour"
+rconfig   integer simulation_start_minute derived                  1              0       -        "simulation_start_minute" "start of simulation through restarts" "2-digit minute"
+rconfig   integer simulation_start_second derived                  1              0       -        "simulation_start_second" "start of simulation through restarts" "2-digit second"
+
+#
+# Single dummy declaration to define a nodyn dyn option
+state integer nodyn_dummy - dyn_nodyn -  -  -  "" "" ""      
+
+#
+#---------------------------------------------------------------------------------------------------------------------------------------
+# Package Declarations
+#                                               
+
+#key      package       associated                package          associated 4d scalars
+#         name          namelist choice           state vars
+
+package   dyn_nodyn    dyn_opt==0                   -             -
+package   dyn_em       dyn_opt==2                   -             -
+#package   passivec1     chem_opt==0                  -             
+
+
+##### MARS OPTIONS
+##### MARS OPTIONS
+##### MARS OPTIONS
+##
+## CHANGING THE OPTION CHANGES TRACER REFERENCES WITHOUT ANY NEED TO RECOMPILE ENTIRELY LMD_MM 
+## --> EVEN IF FIELDS ARE SCHEDULED FOR OUTPUTS ABOVE [WITH h], THESE ARE NOT IN wrfout* FILES
+##       UNLESS THE CORRESPONDING mars OPTION IS SELECTED 
+## --> HOWEVER, YOU STILL NEED TO RECOMPILE THE PHYSICS BEFORE CHANGING THE OPTION
+##       AND PROBABLY YOU'LL ALSO HAVE TO CHANGE callphys.def
+## --> IF mars IS CHANGED IN THE NAMELIST, YOU HAVE TO RE-RUN real.exe
+##
+## IF YOU ADD A mars REFERENCE BELOW, YOU HAVE TO RECOMPILE ENTIRELY THE MODEL
+##
+## THE ORDER of TRACERS IN EACH OPTION IS VERY IMPORTANT
+##
+package   default      mars==0                      -              -
+package   water        mars==1                      -              scalar:qh2o,qh2o_ice
+package   dust1        mars==2                      -              scalar:qdust
+package   dust2eq      mars==3                      -              scalar:qdust,qdustn
+package   newwater     mars==11                     -              scalar:qh2o,qh2o_ice,qdust,qdustn
+##### MARS OPTIONS
+##### MARS OPTIONS
+##### MARS OPTIONS
+
+
+package   kesslerscheme mp_physics==1                -             moist:qv,qc,qr
+package   linscheme     mp_physics==2                -             moist:qv,qc,qr,qi,qs,qg
+package   wsm3scheme    mp_physics==3                -             moist:qv,qc,qr
+package   wsm5scheme    mp_physics==4                -             moist:qv,qc,qr,qi,qs
+package   etampnew      mp_physics==5                -             moist:qv,qc,qr,qi,qs,qg;scalar:qt
+package   wsm6scheme    mp_physics==6                -             moist:qv,qc,qr,qi,qs,qg
+package   ncepcloud3    mp_physics==98               -             moist:qv,qc,qr
+package   ncepcloud5    mp_physics==99               -             moist:qv,qc,qr,qi,qs
+package   thompson      mp_physics==8                -             moist:qv,qc,qr,qi,qs,qg;scalar:qni
+
+package   rrtmscheme    ra_lw_physics==1             -             -
+package   camlwscheme   ra_lw_physics==3             -             ozmixm:mth01,mth02,mth03,mth04,mth05,mth06,mth07,mth08,mth09,mth10,mth11,mth12;aerosolc:sul,sslt,dust1,dust2,dust3,dust4,ocpho,bcpho,ocphi,bcphi,bg,volc
+package   gfdllwscheme  ra_lw_physics==99            -             -
+
+package   swradscheme   ra_sw_physics==1             -             -
+package   gsfcswscheme  ra_sw_physics==2             -             -
+package   camswscheme   ra_sw_physics==3             -             ozmixm:mth01,mth02,mth03,mth04,mth05,mth06,mth07,mth08,mth09,mth10,mth11,mth12;aerosolc:sul,sslt,dust1,dust2,dust3,dust4,ocpho,bcpho,ocphi,bcphi,bg,volc
+package   gfdlswscheme  ra_sw_physics==99            -             -
+
+package   sfclayscheme   sf_sfclay_physics==1        -             -
+package   myjsfcscheme   sf_sfclay_physics==2        -             -
+package   gfssfcscheme   sf_sfclay_physics==3        -             -
+package   slabscheme     sf_surface_physics==1       -             -
+package   lsmscheme      sf_surface_physics==2       -             -
+package   ruclsmscheme   sf_surface_physics==3       -             -
+package   ysuscheme      bl_pbl_physics==1           -             -
+package   myjpblscheme   bl_pbl_physics==2           -             -
+package   gfsscheme      bl_pbl_physics==3           -             -
+package   mrfscheme      bl_pbl_physics==99          -             -
+
+package   kfetascheme    cu_physics==1               -             -
+package   bmjscheme      cu_physics==2               -             -
+package   gdscheme       cu_physics==3               -             -
+package   sasscheme      cu_physics==4               -             -
+package   kfscheme       cu_physics==99              -             -
+
+package   psufddagd      grid_fdda==1                -             fdda3d:u_ndg_old,v_ndg_old,t_ndg_old,q_ndg_old,ph_ndg_old,u_ndg_new,v_ndg_new,t_ndg_new,q_ndg_new,ph_ndg_new;fdda2d:mu_ndg_old,mu_ndg_new
+
+# only need to specify these once; not for every io_form* variable
+package   io_intio    io_form_restart==1                     -             -
+package   io_netcdf   io_form_restart==2                     -             -
+# Placeholders for additional packages (we can go beyond zzz
+# but that will entail modifying frame/module_io.F and frame/md_calls.m4)
+# Please note these are placeholders; HDF has not been implemented yet.
+package   io_hdf      io_form_restart==3                     -             -
+package   io_phdf5    io_form_restart==4                     -             -
+package   io_grib1    io_form_restart==5                     -             -
+package   io_mcel     io_form_restart==6                     -             -
+package   io_esmf     io_form_restart==7                     -             -
+package   io_yyy      io_form_restart==8                     -             -
+package   io_zzz      io_form_restart==9                     -             -
+package   io_grib2    io_form_restart==10                    -             -
+package   io_pnetcdf  io_form_restart==11                     -             -
+                                                
+#---------------------------------------------------------------------------------------------------------------------------------------
+## communications                                               
+
+### 8. Edit the Registry file and create a halo-exchange for x_1.
+
+# Halo Update Communications
+
+halo      HALO_EM_INIT_1 dyn_em 48:u_1,u_2,v_1,v_2,w_1,w_2,ph_1,ph_2
+halo      HALO_EM_INIT_2 dyn_em 48:t_1,t_2,mu_1,mu_2,tke_1,tke_2,ww,phb
+halo      HALO_EM_INIT_3 dyn_em 48:ph0,php,t_init,mub,mu0,p,al,alt,alb
+halo      HALO_EM_INIT_4 dyn_em 48:pb,h_diabatic,msft,msfu,msfv,f,e,sina,cosa,ht,potevp,snopcx,soiltb
+halo      HALO_EM_INIT_5 dyn_em 48:moist,chem,scalar
+halo      HALO_EM_VINTERP_UV_1 dyn_em 8:pd_gc,pb
+halo      HALO_EM_A dyn_em  8:ru,rv,rw,ww,php,alt,al,p,muu,muv,mut
+halo      HALO_EM_PHYS_A  dyn_em 4:u_2,v_2
+halo      HALO_EM_PHYS_PBL dyn_em        4:rublten,rvblten
+halo      HALO_EM_FDDA dyn_em            4:rundgdten,rvndgdten
+halo      HALO_EM_PHYS_DIFFUSION dyn_em  4:defor11,defor22,defor12,defor13,defor23,div,xkmv,xkmh,xkmhd,xkhv,xkhh,tke_1,tke_2
+halo      HALO_EM_TKE_ADVECT_3 dyn_em 24:tke_2
+halo      HALO_EM_TKE_ADVECT_5 dyn_em 48:tke_2
+halo      HALO_EM_TKE_A dyn_em 4:ph_2,phb
+halo      HALO_EM_TKE_B dyn_em 4:z,rdz,rdzw,zx,zy
+halo      HALO_EM_TKE_C dyn_em 8:u_2,v_2,z,zx,zy,rdz,rdzw
+halo      HALO_EM_TKE_D dyn_em 8:defor11,defor22,defor33,defor12,defor13,defor23,div
+halo      HALO_EM_TKE_E dyn_em 8:xkmv,xkmh,xkmhd,xkhv,xkhh,BN2,moist
+halo      HALO_EM_TKE_3 dyn_em   24:tke_1,tke_2
+halo      HALO_EM_TKE_5 dyn_em   48:tke_1,tke_2
+halo      HALO_EM_TKE_7 dyn_em   80:tke_1,tke_2
+halo      HALO_EM_TKE_F dyn_em   48:tke_1,tke_2
+halo      HALO_EM_TKE_OLD_E_5 dyn_em   48:tke_1
+halo      HALO_EM_TKE_OLD_E_7 dyn_em   80:tke_1
+halo      HALO_EM_B dyn_em 4:ph_2,al,p,t_1,t_save,u_save,v_save,mu_1,mu_2,mudf,php,alt,pb
+halo      HALO_EM_B2 dyn_em 4:ru_tend,rv_tend
+halo      HALO_EM_C dyn_em    4:u_2,v_2
+halo      HALO_EM_C2 dyn_em    4:ph_2,al,p,mu_2,muts,mudf
+halo      HALO_EM_D dyn_em    24:ru_m,rv_m,ww_m,mut
+halo      HALO_EM_D2_3 dyn_em 24:u_2,v_2,w_2,t_2,ph_2;24:moist,chem,scalar;4:mu_2,al
+halo      HALO_EM_D2_5 dyn_em 48:u_2,v_2,w_2,t_2,ph_2;24:moist,chem,scalar;4:mu_2,al
+halo      HALO_EM_D3_3 dyn_em 24:u_1,u_2,v_1,v_2,w_1,w_2,t_1,t_2,ph_1,ph_2,tke_1,tke_2,moist,chem,scalar;4:mu_1,mu_2
+halo      HALO_EM_D3_5 dyn_em 48:u_1,u_2,v_1,v_2,w_1,w_2,t_1,t_2,ph_1,ph_2,tke_1,tke_2,moist,chem,scalar;4:mu_1,mu_2
+halo      HALO_EM_E_3 dyn_em 24:u_1,u_2,v_1,v_2,w_1,w_2,t_1,t_2,ph_1,ph_2,tke_1,tke_2,;4:mu_1,mu_2
+halo      HALO_EM_E_5 dyn_em 48:u_1,u_2,v_1,v_2,w_1,w_2,t_1,t_2,ph_1,ph_2,tke_1,tke_2,;4:mu_1,mu_2
+halo      HALO_EM_MOIST_E_3 dyn_em 24:moist
+halo      HALO_EM_MOIST_E_5 dyn_em 48:moist
+halo      HALO_EM_MOIST_E_7 dyn_em 80:moist
+halo      HALO_EM_CHEM_E_3 dyn_em 24:chem
+halo      HALO_EM_CHEM_E_5 dyn_em 48:chem
+halo      HALO_EM_CHEM_E_7 dyn_em 80:chem
+halo      HALO_EM_SCALAR_E_3 dyn_em 24:scalar
+halo      HALO_EM_SCALAR_E_5 dyn_em 48:scalar
+halo      HALO_EM_SCALAR_E_7 dyn_em 80:scalar
+
+halo      HALO_EM_MOIST_OLD_E_3 dyn_em 24:moist_old
+halo      HALO_EM_MOIST_OLD_E_5 dyn_em 48:moist_old
+halo      HALO_EM_MOIST_OLD_E_7 dyn_em 80:moist_old
+halo      HALO_EM_CHEM_OLD_E_3 dyn_em 24:chem_old
+halo      HALO_EM_CHEM_OLD_E_5 dyn_em 48:chem_old
+halo      HALO_EM_CHEM_OLD_E_7 dyn_em 80:chem_old
+halo      HALO_EM_SCALAR_OLD_E_3 dyn_em 24:scalar_old
+halo      HALO_EM_SCALAR_OLD_E_5 dyn_em 48:scalar_old
+halo      HALO_EM_SCALAR_OLD_E_7 dyn_em 80:scalar_old
+
+halo      HALO_EM_FEEDBACK   dyn_em 48:ht
+
+halo      HALO_EM_COUPLE_A   dyn_em 24:mub,mu_1,mu_2
+period    PERIOD_EM_COUPLE_A dyn_em 2:mub,mu_1,mu_2
+halo      HALO_EM_COUPLE_B   dyn_em 48:ph_1,ph_2,w_1,w_2,t_1,t_2,u_1,u_2,v_1,v_2,\
+                                       moist,chem,scalar
+period    PERIOD_EM_COUPLE_B dyn_em 3:ph_1,ph_2,w_1,w_2,t_1,t_2,u_1,u_2,v_1,v_2,\
+                                       moist,chem,scalar
+
+# For moving nests
+halo      em_shift_halo_y  dyn_em 48:imask_nostag,imask_xstag,imask_ystag,imask_xystag,u_2,v_2,t_2
+halo      em_shift_halo_x  dyn_em 48:imask_nostag,imask_xstag,imask_ystag,imask_xystag,u_2,v_2,t_2
+
+# For observational nudging
+halo      HALO_OBS_NUDGE dyn_em 24:pb,p,uratx,vratx,tratx
+
+# Periodic Boundary Communications
+
+period    PERIOD_BDY_EM_INIT dyn_em 3:u_1,u_2,v_1,v_2,w_1,w_2,t_1,t_2,ph_1,ph_2,t_init,phb,ph0,php,pb,al,alt,alb,mu_1,mu_2,mub,mu0,ht,msft,msfu,msfv,sina,cosa,e,f
+period    PERIOD_BDY_EM_MOIST dyn_em 3:moist
+period    PERIOD_BDY_EM_CHEM dyn_em 3:chem
+period    PERIOD_BDY_EM_SCALAR dyn_em 3:scalar
+period    PERIOD_BDY_EM_MOIST2 dyn_em 3:moist
+period    PERIOD_BDY_EM_CHEM2 dyn_em 3:chem
+period    PERIOD_BDY_EM_SCALAR2 dyn_em 3:scalar
+period    PERIOD_BDY_EM_A dyn_em 2:ru,rv,rw,ww,php,alt,p,muu,muv,mut,ph_2,al
+period    PERIOD_BDY_EM_A1  dyn_em 3:rdzw,rdz,z,zx,zy
+period    PERIOD_BDY_EM_PHY_BC dyn_em 2:rublten,rvblten,xkmh,xkmhd,xkmv,xkhh,xkhv,div,defor11,defor22,defor12,defor13,defor23,defor33,tke_2
+period    PERIOD_BDY_EM_FDDA_BC dyn_em 2:rundgdten,rvndgdten
+period    PERIOD_BDY_EM_B dyn_em 2:ru_tend,rv_tend,ph_2,al,p,t_1,t_save,u_save,v_save,mu_1,mu_2,mudf,php,alt,pb
+period    PERIOD_BDY_EM_B3 dyn_em 2:ph_2,al,p,mu_2,muts,mudf
+period    PERIOD_BDY_EM_B2 dyn_em 2:ru_tend,rv_tend
+period    PERIOD_BDY_EM_C dyn_em 2:u_2,u_save,v_2,v_save,t_2,t_save,muv,msfv,muu,msfu
+period    PERIOD_BDY_EM_D dyn_em 3:u_2,v_2,w_2,t_2,ph_2,mu_2,tke_2
+period    PERIOD_BDY_EM_D3 dyn_em 3:u_1,u_2,v_1,v_2,w_1,w_2,t_1,t_2,ph_1,ph_2,tke_1,tke_2,mu_1,mu_2
+
+#
+#swap SWAP_ETAMP_NEW  dyn_em 1:dz8w,p_phy,pi_phy,rho,th_phy,moist,F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY,RAINNC,RAINNCV,SR,LOWLYR
+#swap SWAP_WSM3       dyn_em 1:th_phy,moist,w_2,rho,pi_phy,p_phy,dz8w,rainnc,rainncv
+#cycle CYCLE_TEST       dyn_em 1:xlong
+
+##
+
+# FDDA (Observational-nudging) Variables
+typedef fdob_type integer domain_tot   # total number of domains to apply obs-nudging
+typedef fdob_type integer domain_init  # domain initialization flag
+typedef fdob_type integer IEODI        # end of obs data flag for current model step
+typedef fdob_type integer IWTSIG       # flag for nudging on pressure surfaces
+typedef fdob_type integer NSTAT        # number of obs stations used to nudge current model step
+typedef fdob_type integer KTAUR        # restart model step
+typedef fdob_type integer SN_MAXCG     # coarse domain grid dimension in south-north coordinate
+typedef fdob_type integer WE_MAXCG     # coarse domain grid dimension in west-east coordinate
+typedef fdob_type integer SN_END       # ending north-south grid index
+typedef fdob_type integer LEVIDN(max_domains)   # level of nest
+typedef fdob_type real    DS_CG        # coarse domain grid size 
+typedef fdob_type real    WINDOW       # time window half-period for nudging (in minutes) 
+typedef fdob_type real    RTLAST       # time in hours of last obs used in current model step
+typedef fdob_type real    DATEND       # time in minutes after which data are asuumed to have ended
+typedef fdob_type real    RINFMN       # minimum radius of influence
+typedef fdob_type real    RINFMX       # maximum radius of influence
+typedef fdob_type real    PFREE        # pressure level (cb) where terrain effect becomes small
+typedef fdob_type real    DCON         # 1/DPSMX
+typedef fdob_type real    DPSMX        # max pres change (cb) allowed within infl range of surf obs 
+typedef fdob_type real    TFACI        # scale factor used for ramp-down in dynamic initialization
+typedef fdob_type real    XN           # cone factor for Lambert projection
+
+# table entries are of the form
+#      <Table>  <Type>  <Sym>                <Dims>   <Use>   <NumTLev> <Stagger> <IO>     <DNAME>             <DESCRIP>     <UNITS>
+#Grid variables
+typedef fdob_type real    varobs               rz       -         1        -       -       "varobs"          "observational values in each variable"
+typedef fdob_type real    errf                 hz       -         1        -       -       "errf"            "errors between model and obs values"
+typedef fdob_type real    timeob               z        -         1        -       -       "timeob"          "model times for each observation"          "hours"
+typedef fdob_type real    nlevs_ob             z        -         1        -       -       "nlevs_ob"        "numbers of levels in sounding obs"
+typedef fdob_type real    lev_in_ob            z        -         1        -       -       "lev_in_ob"       "level in sounding-type obs"
+typedef fdob_type real    plfo                 z        -         1        -       -       "plfo"            "index for type of obs-platform"
+typedef fdob_type real    elevob               z        -         1        -       -       "elevob"          "elevation of observation"                  "meters"
+typedef fdob_type real    rio                  z        -         1        -       -       "rio"             "west-east grid coordinate"
+typedef fdob_type real    rjo                  z        -         1        -       -       "rjo"             "south-north grid coordinate"
+typedef fdob_type real    rko                  z        -         1        -       -       "rko"             "vertical grid coordinate"
+
+state fdob_type fdob - -
+##
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/create_make_gcm
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/create_make_gcm	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/create_make_gcm	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/create_make_gcm
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/deftank
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/deftank	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/deftank	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/deftank
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/aeronomars
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/aeronomars	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/aeronomars	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/aeronomars
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/bibio
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/bibio	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/bibio	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/bibio
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate1
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate1	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate1	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/duplicate1
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate2
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate2	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate2	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/duplicate2
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate3
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate3	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate3	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/duplicate3
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate4
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate4	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/duplicate4	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/duplicate4
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/dyn3d
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/dyn3d	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/dyn3d	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/dyn3d
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/filtrez
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/filtrez	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/filtrez	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/filtrez
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate2
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate2	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate2	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/generate2
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate3
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate3	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate3	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/generate3
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate4
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate4	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/generate4	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/generate4
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/grid
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/grid	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/grid	(revision 118)
@@ -0,0 +1,1 @@
+link ../../mars_lmd_new/libf/grid
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aerave.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aerave.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aerave.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/aerave.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aerkind.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aerkind.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aerkind.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/aerkind.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aeropacity.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aeropacity.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aeropacity.F	(revision 118)
@@ -0,0 +1,642 @@
+      SUBROUTINE aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls,
+     &    pq,ccn,tauref,tau,aerosol,reffrad,nueffrad,
+     &    QREFvis3d,QREFir3d,omegaREFvis3d,omegaREFir3d,zdqnorm,dsodust)
+                                                   
+! to use  'getin'
+      USE ioipsl_getincom 
+       IMPLICIT NONE
+c=======================================================================
+c   subject:
+c   --------
+c   Computing aerosol optical depth in each gridbox.
+c
+c   author: F.Forget 
+c   ------
+c   update F. Montmessin (water ice scheme) 
+c      and S. Lebonnois (12/06/2003) compatibility dust/ice/chemistry
+c   update J.-B. Madeleine 2008-2009:
+c       - added 3D scattering by aerosols;
+c       - dustopacity transferred from physiq.F to callradite.F,
+c           and renamed into aeropacity.F;
+c   
+c   input:
+c   ----- 
+c   ngrid             Number of gridpoint of horizontal grid
+c   nlayer            Number of layer
+c   nq                Number of tracer
+c   zday                  Date (time since Ls=0, in martian days)
+c   ls                Solar longitude (Ls) , radian
+c   pplay,pplev       pressure (Pa) in the middle and boundary of each layer
+c   pq                Dust mixing ratio (used if tracer =T and active=T).
+c   reffrad(ngrid,nlayer,naerkind)  Aerosol effective radius
+c   QREFvis3d(ngridmx,nlayermx,naerkind) \ 3d extinction coefficients
+c   QREFir3d(ngridmx,nlayermx,naerkind)  / at reference wavelengths;
+c   omegaREFvis3d(ngridmx,nlayermx,naerkind) \ 3d single scat. albedo
+c   omegaREFir3d(ngridmx,nlayermx,naerkind)  / at reference wavelengths;
+c
+c   output:
+c   -------
+c   tauref       Prescribed mean column optical depth at 700 Pa 
+c   tau          Column total visible dust optical depth at each point
+c   aerosol      aerosol(ig,l,1) is the dust optical
+c                depth in layer l, grid point ig
+
+c
+c=======================================================================
+#include "dimensions.h"
+#include "dimphys.h"
+#include "callkeys.h"
+#include "comcstfi.h"
+#include "comgeomfi.h"
+#include "dimradmars.h"
+#include "yomaer.h"
+#include "tracer.h"
+#include "planete.h"
+#include "aerkind.h"
+
+c-----------------------------------------------------------------------
+c
+c    Declarations :
+c    --------------
+c
+c    Input/Output
+c    ------------
+      INTEGER ngrid,nlayer,nq
+
+      REAL ls,zday,expfactor    
+      REAL pplev(ngrid,nlayer+1),pplay(ngrid,nlayer)
+      REAL pq(ngrid,nlayer,nq)
+      REAL tauref(ngrid), tau(ngrid,naerkind)
+      REAL aerosol(ngrid,nlayer,naerkind)
+      REAL dsodust(ngridmx,nlayermx)
+      REAL reffrad(ngrid,nlayer,naerkind)
+      REAL nueffrad(ngrid,nlayer,naerkind)
+      REAL QREFvis3d(ngridmx,nlayermx,naerkind)
+      REAL QREFir3d(ngridmx,nlayermx,naerkind)
+      REAL omegaREFvis3d(ngridmx,nlayermx,naerkind)
+      REAL omegaREFir3d(ngridmx,nlayermx,naerkind)
+      REAL zdqnorm(ngridmx,nlayermx,2)
+
+c
+c   Variables for renormalisation
+c
+
+         logical localstorm
+         real taulocref,ztoploc,radloc,lonloc,latloc
+         REAL ray(ngridmx)
+         REAL tauuser(ngridmx)
+         REAL more_dust(ngridmx,nlayermx,2)
+         REAL int_factor(ngridmx)
+         real l_top
+         REAL zalt(ngridmx, nlayer)
+
+
+c
+c    Local variables :
+c    -----------------
+      INTEGER l,ig,iq,i,j
+      INTEGER iaer           ! Aerosol index
+      real topdust(ngridmx)
+      real zlsconst, zp
+      real taueq,tauS,tauN
+c     Mean Qext(vis)/Qext(ir) profile
+      real msolsir(nlayermx,naerkind)
+c     Mean Qext(ir)/Qabs(ir) profile
+      real mqextsqabs(nlayermx,naerkind)
+c     Variables used when multiple particle sizes are used
+c       for dust or water ice particles in the radiative transfer
+c       (see callradite.F for more information).
+      REAL taudusttmp(ngridmx)! Temporary dust opacity
+                               !   used before scaling
+      REAL taudustvis(ngridmx) ! Dust opacity after scaling
+      REAL taudusttes(ngridmx) ! Dust opacity at IR ref. wav. as
+                               !   "seen" by the GCM.
+      REAL taucloudvis(ngridmx)! Cloud opacity at visible
+                               !   reference wavelength
+      REAL taucloudtes(ngridmx)! Cloud opacity at infrared
+                               !   reference wavelength using
+                               !   Qabs instead of Qext
+                               !   (direct comparison with TES)
+      REAL qdust(ngridmx,nlayermx) ! True dust mass mixing ratio
+      REAL ccn(ngridmx,nlayermx)   ! Cloud condensation nuclei
+                                   !   (particules kg-1)
+      REAL qtot(ngridmx)           ! Dust column (kg m-2)
+
+c     CCN reduction factor
+      REAL, PARAMETER :: ccn_factor = 4.5  !! comme TESTS_JB // 1. avant
+
+c
+c   local saved variables
+c   ---------------------
+
+      REAL topdust0(ngridmx) 
+      SAVE topdust0
+c     Level under which the dust mixing ratio is held constant
+c       when computing the dust opacity in each layer
+c       (this applies when doubleq and active are true)
+      INTEGER, PARAMETER :: cstdustlevel = 7
+
+      LOGICAL firstcall
+      DATA firstcall/.true./
+      SAVE firstcall
+
+
+! indexes of water ice and dust tracers:
+      INTEGER,SAVE :: nqdust(nqmx) ! to store the indexes of dust tracers
+      INTEGER,SAVE :: i_ice=0  ! water ice
+      CHARACTER(LEN=20) :: txt ! to temporarly store text
+      CHARACTER(LEN=1) :: txt2 ! to temporarly store text
+! indexes of dust scatterers:
+      INTEGER,SAVE :: iaerdust(naerkind)
+      INTEGER,SAVE :: naerdust ! number of dust scatterers
+
+      tau(1:ngrid,1:naerkind)=0
+
+! identify tracers
+
+      IF (firstcall) THEN
+        ! identify scatterers that are dust
+        naerdust=0
+        DO iaer=1,naerkind
+          txt=name_iaer(iaer)
+          IF (txt(1:4).eq."dust") THEN
+            naerdust=naerdust+1
+            iaerdust(naerdust)=iaer
+          ENDIF
+        ENDDO
+        ! identify tracers which are dust
+        i=0
+        DO iq=1,nq
+          txt=noms(iq)
+          IF (txt(1:4).eq."dust") THEN
+          i=i+1
+          nqdust(i)=iq
+          ENDIF
+        ENDDO
+
+        IF (water.AND.activice) THEN
+          i_ice=igcm_h2o_ice
+          write(*,*) "aeropacity: i_ice=",i_ice
+        ENDIF
+
+c       altitude of the top of the aerosol layer (km) at Ls=2.76rad:
+c       in the Viking year scenario
+        DO ig=1,ngrid
+            topdust0(ig)=60. -22.*SIN(lati(ig))**2
+        END DO
+
+c       typical profile of solsir and (1-w)^(-1):
+        msolsir(1:nlayer,1:naerkind)=0
+        mqextsqabs(1:nlayer,1:naerkind)=0
+        WRITE(*,*) "Typical profiles of solsir and Qext/Qabs(IR):"
+        DO iaer = 1, naerkind ! Loop on aerosol kind
+          WRITE(*,*) "Aerosol # ",iaer
+          DO l=1,nlayer
+            DO ig=1,ngridmx
+              msolsir(l,iaer)=msolsir(l,iaer)+
+     &              QREFvis3d(ig,l,iaer)/
+     &              QREFir3d(ig,l,iaer)
+              mqextsqabs(l,iaer)=mqextsqabs(l,iaer)+
+     &              (1.E0-omegaREFir3d(ig,l,iaer))**(-1)
+            ENDDO
+            msolsir(l,iaer)=msolsir(l,iaer)/REAL(ngridmx)
+            mqextsqabs(l,iaer)=mqextsqabs(l,iaer)/REAL(ngridmx)
+          ENDDO
+          WRITE(*,*) "solsir: ",msolsir(:,iaer)
+          WRITE(*,*) "Qext/Qabs(IR): ",mqextsqabs(:,iaer)
+        ENDDO
+
+!       load value of tauvis from callphys.def (if given there,
+!       otherwise default value read from starfi.nc file will be used)
+        call getin("tauvis",tauvis)
+
+c        firstcall=.false.
+
+      END IF
+
+c     Vertical column optical depth at 700.Pa 
+c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      IF(iaervar.eq.1) THEN 
+         do ig=1, ngridmx
+          tauref(ig)=max(tauvis,1.e-9) ! tauvis=cste (set in callphys.def
+                                       ! or read in starfi
+        end do
+      ELSE IF (iaervar.eq.2) THEN   ! << "Viking" Scenario>>
+
+        tauref(1) = 0.7+.3*cos(ls+80.*pi/180.) ! like seen by VL1
+        do ig=2,ngrid
+          tauref(ig) = tauref(1)
+        end do
+
+      ELSE IF (iaervar.eq.3) THEN  ! << "MGS" scenario >>
+
+        taueq= 0.2 +(0.5-0.2) *(cos(0.5*(ls-4.363)))**14
+        tauS= 0.1 +(0.5-0.1)  *(cos(0.5*(ls-4.363)))**14
+        tauN = 0.1
+c	   if (peri_day.eq.150) then
+c	     tauS=0.1
+c	     tauN=0.1 +(0.5-0.1)  *(cos(0.5*(ls+pi-4.363)))**14
+c	     taueq= 0.2 +(0.5-0.2) *(cos(0.5*(ls+pi-4.363)))**14
+c           endif
+        do ig=1,ngrid/2  ! Northern hemisphere
+          tauref(ig)= tauN +
+     &    (taueq-tauN)*0.5*(1+tanh((45-lati(ig)*180./pi)*6/60))
+        end do
+        do ig=ngrid/2+1, ngridmx  ! Southern hemisphere
+          tauref(ig)= tauS +
+     &    (taueq-tauS)*0.5*(1+tanh((45+lati(ig)*180./pi)*6/60))
+        end do
+      ELSE IF ((iaervar.eq.4).or.
+     &        ((iaervar.ge.24).and.(iaervar.le.26)))
+     &     THEN  ! << "TES assimilated dust scenarios >>
+        call readtesassim(ngrid,nlayer,zday,pplev,tauref)
+
+      ELSE IF (iaervar.eq.5) THEN   ! << Escalier Scenario>>
+c         tauref(1) = 0.2
+c         if ((ls.ge.210.*pi/180.).and.(ls.le.330.*pi/180.))
+c    &                              tauref(1) = 2.5
+        tauref(1) = 2.5
+        if ((ls.ge.30.*pi/180.).and.(ls.le.150.*pi/180.))
+     &                              tauref(1) = .2
+
+        do ig=2,ngrid
+          tauref(ig) = tauref(1)
+        end do
+      ELSE
+        stop 'problem with iaervar in aeropacity.F'
+      ENDIF
+
+
+
+c -----------------------------------------------------------------
+c Computing the opacity in each layer
+c -----------------------------------------------------------------
+
+      DO iaer = 1, naerkind ! Loop on aerosol kind
+c     --------------------------------------------
+        aerkind: SELECT CASE (name_iaer(iaer))
+c==================================================================
+        CASE("dust_conrath") aerkind      ! Typical dust profile
+c==================================================================
+
+c       Altitude of the top of the dust layer
+c       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+        zlsconst=SIN(ls-2.76)
+        if (iddist.eq.1) then
+          do ig=1,ngrid
+             topdust(ig)=topdustref         ! constant dust layer top
+          end do
+
+        else if (iddist.eq.2) then          ! "Viking" scenario
+          do ig=1,ngrid
+            topdust(ig)=topdust0(ig)+18.*zlsconst
+          end do
+
+        else if(iddist.eq.3) then         !"MGS" scenario
+          do ig=1,ngrid
+            topdust(ig)=60.+18.*zlsconst
+     &                -(32+18*zlsconst)*sin(lati(ig))**4
+     &                 - 8*zlsconst*(sin(lati(ig)))**5
+          end do
+        endif
+
+c       Optical depth in each layer :
+c       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+        if(iddist.ge.1) then
+
+          expfactor=0.
+          DO l=1,nlayer
+            DO ig=1,ngrid
+c             Typical mixing ratio profile 
+              if(pplay(ig,l).gt.700.
+     $                        /(988.**(topdust(ig)/70.))) then
+                zp=(700./pplay(ig,l))**(70./topdust(ig))
+                 expfactor=max(exp(0.007*(1.-max(zp,1.))),1.e-3)
+              else    
+                expfactor=1.e-3
+              endif
+c             Vertical scaling function
+              aerosol(ig,l,iaer)= (pplev(ig,l)-pplev(ig,l+1)) *
+     &          expfactor *
+     &          QREFvis3d(ig,l,iaer) / QREFvis3d(ig,1,iaer)
+            ENDDO
+          ENDDO
+
+        else if(iddist.eq.0) then   
+c         old dust vertical distribution function (pollack90)
+          DO l=1,nlayer
+             DO ig=1,ngrid
+                zp=700./pplay(ig,l)
+                aerosol(ig,l,1)= tauref(ig)/700. *
+     s           (pplev(ig,l)-pplev(ig,l+1))
+     s           *max( exp(.03*(1.-max(zp,1.))) , 1.E-3 )
+             ENDDO
+          ENDDO
+        end if
+
+c==================================================================
+        CASE("dust_doubleq") aerkind! Two-moment scheme for dust
+c        (transport of mass and number mixing ratio)
+c==================================================================
+             
+          DO l=1,nlayer
+            IF (l.LE.cstdustlevel) THEN
+c           Opacity in the first levels is held constant to 
+c             avoid unrealistic values due to constant lifting:
+              DO ig=1,ngrid
+                aerosol(ig,l,iaer) = 
+     &          (  0.75 * QREFvis3d(ig,cstdustlevel,iaer) /
+     &          ( rho_dust * reffrad(ig,cstdustlevel,iaer) )  ) *
+     &          pq(ig,cstdustlevel,igcm_dust_mass) *
+     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
+              ENDDO
+            ELSE
+              DO ig=1,ngrid
+                aerosol(ig,l,iaer) =
+     &          (  0.75 * QREFvis3d(ig,l,iaer) /
+     &          ( rho_dust * reffrad(ig,l,iaer) )  ) *
+     &          pq(ig,l,igcm_dust_mass) *
+     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
+              ENDDO
+            ENDIF
+          ENDDO
+
+c==================================================================
+        CASE("dust_submicron") aerkind   ! Small dust population
+c==================================================================
+
+          DO l=1,nlayer
+            IF (l.LE.cstdustlevel) THEN
+c           Opacity in the first levels is held constant to 
+c             avoid unrealistic values due to constant lifting:
+              DO ig=1,ngrid
+                aerosol(ig,l,iaer) = 
+     &          (  0.75 * QREFvis3d(ig,cstdustlevel,iaer) /
+     &          ( rho_dust * reffrad(ig,cstdustlevel,iaer) )  ) *
+     &          pq(ig,cstdustlevel,igcm_dust_submicron) *
+     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
+              ENDDO
+            ELSE
+              DO ig=1,ngrid
+                aerosol(ig,l,iaer) = 
+     &          (  0.75 * QREFvis3d(ig,l,iaer) /
+     &          ( rho_dust * reffrad(ig,l,iaer) )  ) *
+     &          pq(ig,l,igcm_dust_submicron) *
+     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
+              ENDDO
+            ENDIF
+          ENDDO
+
+c==================================================================
+        CASE("h2o_ice") aerkind             ! Water ice crystals
+c==================================================================
+
+c       1. Initialization
+        aerosol(1:ngrid,1:nlayer,iaer) = 0.
+        taucloudvis(1:ngrid) = 0.
+        taucloudtes(1:ngrid) = 0.
+c       2. Opacity calculation
+        DO ig=1, ngrid
+          DO l=1,nlayer
+            aerosol(ig,l,iaer) = max(1E-20,
+     &        (  0.75 * QREFvis3d(ig,l,iaer) /
+     &        ( rho_ice * reffrad(ig,l,iaer) )  ) *
+     &        pq(ig,l,i_ice) *
+     &        ( pplev(ig,l) - pplev(ig,l+1) ) / g
+     &                              )
+            taucloudvis(ig) = taucloudvis(ig) + aerosol(ig,l,iaer)
+            taucloudtes(ig) = taucloudtes(ig) + aerosol(ig,l,iaer)*
+     &        QREFir3d(ig,l,iaer) / QREFvis3d(ig,l,iaer) *
+     &        ( 1.E0 - omegaREFir3d(ig,l,iaer) )
+          ENDDO
+        ENDDO
+c       3. Outputs
+        IF (ngrid.NE.1) THEN
+          CALL WRITEDIAGFI(ngridmx,'tauVIS','tauext VIS refwvl',
+     &      ' ',2,taucloudvis)
+          CALL WRITEDIAGFI(ngridmx,'tauTES','tauabs IR refwvl',
+     &      ' ',2,taucloudtes)
+          IF (callstats) THEN
+            CALL wstats(ngridmx,'tauVIS','tauext VIS refwvl',
+     &        ' ',2,taucloudvis)
+            CALL wstats(ngridmx,'tauTES','tauabs IR refwvl',
+     &        ' ',2,taucloudtes)
+          ENDIF
+        ELSE
+c         CALL writeg1d(ngrid,1,taucloudtes,'tautes','NU')
+        ENDIF
+c==================================================================
+        END SELECT aerkind
+c     -----------------------------------
+      ENDDO ! iaer (loop on aerosol kind)
+
+
+
+      IF (firstcall) THEN
+      WRITE(*,*) " RENORMALISATION !!! "
+
+
+!!
+!!
+!!
+
+c -----------------------------------------------------------------
+c Rescaling each layer to reproduce the choosen (or assimilated)
+c   dust extinction opacity at visible reference wavelength, which
+c   is originally scaled to an equivalent 700Pa pressure surface.
+c -----------------------------------------------------------------
+
+      iaer=1  !!!! PROVISOIRE !!!!
+      taulocref = 4.25 !10  ! ref optical depth of the local dust storm
+      ztoploc = 10      ! target pseudo-altitude of local storm (km)
+      radloc = 0.5       ! radius of dust storm (degree)
+      lonloc = 25       ! center longitude of storm (deg)
+      latloc = -3.      ! center latitude of storm (deg)
+
+      DO ig=1,ngrid
+
+        !!!! distance to the center
+        ray(ig)=SQRT((lati(ig)*180./pi-latloc)**2 +
+     &          (long(ig)*180./pi -lonloc)**2)
+        !!!!! Tau's new map
+        tauuser(ig)=max(tauref(ig) * pplev(ig,1) / 700.E0 , taulocref
+     &          * (TANH(2.+(radloc-ray(ig))*2)+1.)/2.)
+
+        DO l=1,nlayer
+        !!!!  CALCULER l top de la tache
+        zalt(ig,l) = LOG( pplev(ig,1)/pplev(ig,l) )
+     &                      / g / 44.01
+     &                    * 8.31 * 210.
+        IF (     (ztoploc .lt. zalt(ig,l)  )
+     &     .and. (ztoploc .gt. zalt(ig,l-1)) ) l_top=l-1
+
+        ENDDO
+       ENDDO
+        PRINT*, l_top
+
+        !!!! CALCULER le facteur intégral
+        DO ig=1,ngrid
+          int_factor(ig)=0.
+          DO l=1,nlayer
+             IF (l .lt. l_top+1) THEN
+                      int_factor(ig) =
+     &                int_factor(ig) +
+     &          (  0.75 * QREFvis3d(ig,l,iaer) /
+     &          ( rho_dust * reffrad(ig,l,iaer) )  ) *
+     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
+             ENDIF
+          ENDDO
+          DO l=1, nlayer
+         !!!! CALCULER b, la tache !!
+          more_dust(ig,l,1)=
+     &                     (tauuser(ig)-(tauref(ig)
+     &                      * pplev(ig,1) / 700.E0)) /
+     &                      int_factor(ig)
+          more_dust(ig,l,2)=
+     &                     (tauuser(ig)-(tauref(ig) *
+     &                     pplev(ig,1) / 700.E0))
+     &                      / int_factor(ig) *
+     &                     ((ref_r0/reffrad(ig,l,iaer))**3)
+     &                      * r3n_q 
+           ENDDO
+          ENDDO
+
+c--------------------------------------------------------------------------------------
+c   tache de poussière à ajouter au premier pas de temps
+c--------------------------------------------------------------------------------------
+          DO l=1, l_top
+         zdqnorm(:,l,1) = more_dust(:,l,1)
+         zdqnorm(:,l,2) = more_dust(:,l,2)
+          ENDDO
+
+!        DO ig=1, ngrid
+!            DO l=1, l_top
+!                aerosol(ig,l,iaer) =
+!     &          (  0.75 * QREFvis3d(ig,l,iaer) /
+!     &          ( rho_dust * reffrad(ig,l,iaer) )  ) *
+!     &          more_dust(ig,l,1) *
+!     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
+!             ENDDO
+!        ENDDO
+
+
+      firstcall = .false.
+      ENDIF  !!! firstcall
+
+c -----------------------------------------------------------------
+c Computing the number of condensation nuclei
+c -----------------------------------------------------------------
+      DO iaer = 1, naerkind ! Loop on aerosol kind
+c     --------------------------------------------
+        aerkind2: SELECT CASE (name_iaer(iaer))
+c==================================================================
+        CASE("dust_conrath") aerkind2     ! Typical dust profile
+c==================================================================
+          DO l=1,nlayer
+            DO ig=1,ngrid
+              ccn(ig,l) = max(aerosol(ig,l,iaer) /
+     &                  pi / QREFvis3d(ig,l,iaer) *
+     &                  (1.+nueffrad(ig,l,iaer))**3. /
+     &                  reffrad(ig,l,iaer)**2. * g /
+     &                  (pplev(ig,l)-pplev(ig,l+1)),1e-30)
+            ENDDO
+          ENDDO
+c==================================================================
+        CASE("dust_doubleq") aerkind2!Two-moment scheme for dust
+c        (transport of mass and number mixing ratio)
+c==================================================================
+          qtot(1:ngridmx) = 0.
+          DO l=1,nlayer
+            DO ig=1,ngrid
+
+c       if (localstorm. NE. .true.) then
+c              qdust(ig,l) = pq(ig,l,igcm_dust_mass) * tauref(ig) *
+c     &                      pplev(ig,1) / 700.E0 / taudusttmp(ig)
+c       else
+c              qdust(ig,l) = pq(ig,l,igcm_dust_mass) * taureftache(ig) *
+c     &                      pplev(ig,1) / 700.E0 / taudusttmp(ig)
+c       endif
+c              qtot(ig) = qtot(ig) + qdust(ig,l) *
+c     &                   (pplev(ig,l)-pplev(ig,l+1)) / g
+              ccn(ig,l) = max( ( ref_r0 /
+     &                    reffrad(ig,l,iaer) )**3. *
+     &                    r3n_q * pq(ig,l,igcm_dust_mass) ,1e-30)
+            ENDDO
+          ENDDO
+c==================================================================
+        END SELECT aerkind2
+c     -----------------------------------
+      ENDDO ! iaer (loop on aerosol kind)
+
+
+c -----------------------------------------------------------------
+c -----------------------------------------------------------------
+c  Reduce number of nuclei
+!         TEMPORAIRE : rï¿½duction du nombre de nuclei FF 04/200
+!         reduction facteur 3
+!         ccn(ig,l) = ccn(ig,l) / 27.
+!         reduction facteur 2
+!         ccn(ig,l) = ccn(ig,l) / 8.
+c -----------------------------------------------------------------
+       write(*,*) "water_param CCN reduc. fac. ", ccn_factor
+       DO l=1,nlayer
+         DO ig=1,ngrid
+            ccn(ig,l) = ccn(ig,l) / ccn_factor
+         ENDDO
+       ENDDO
+c -----------------------------------------------------------------
+c -----------------------------------------------------------------
+
+
+c -----------------------------------------------------------------
+c Column integrated visible optical depth in each point
+c -----------------------------------------------------------------
+      DO iaer=1,naerkind
+        do l=1,nlayer
+           do ig=1,ngrid
+             tau(ig,iaer) = tau(ig,iaer) + aerosol(ig,l,iaer)
+           end do
+        end do
+      ENDDO
+
+c -----------------------------------------------------------------
+c Density scaled opacity and column opacity output
+c -----------------------------------------------------------------
+      dsodust(1:ngrid,1:nlayer) = 0.
+      DO iaer=1,naerdust
+        DO l=1,nlayer
+          DO ig=1,ngrid
+            dsodust(ig,l) = dsodust(ig,l) +
+     &                      aerosol(ig,l,iaerdust(iaer)) * g /
+     &                      (pplev(ig,l) - pplev(ig,l+1))
+          ENDDO
+        ENDDO
+        IF (ngrid.NE.1) THEN
+          write(txt2,'(i1.1)') iaer
+          call WRITEDIAGFI(ngridmx,'taudust'//txt2,
+     &                    'Dust col opacity',
+     &                    ' ',2,tau(1,iaerdust(iaer)))
+          IF (callstats) THEN
+            CALL wstats(ngridmx,'taudust'//txt2,
+     &                 'Dust col opacity',
+     &                 ' ',2,tau(1,iaerdust(iaer)))
+          ENDIF
+        ENDIF
+      ENDDO
+
+      IF (ngrid.NE.1) THEN
+c       CALL WRITEDIAGFI(ngridmx,'dsodust','tau*g/dp',
+c    &                    'm2.kg-1',3,dsodust)
+        IF (callstats) THEN
+          CALL wstats(ngridmx,'dsodust',
+     &               'tau*g/dp',
+     &               'm2.kg-1',3,dsodust)
+        ENDIF
+c       CALL WRITEDIAGFI(ngridmx,'ccn','Cond. nuclei',
+c    &                    'part kg-1',3,ccn)
+      ELSE
+        CALL writeg1d(ngrid,nlayer,dsodust,'dsodust','m2.kg-1')
+      ENDIF
+c -----------------------------------------------------------------
+      return
+      end 
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aeroptproperties.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aeroptproperties.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/aeroptproperties.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/aeroptproperties.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/albedocaps.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/albedocaps.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/albedocaps.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/albedocaps.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/blackl.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/blackl.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/blackl.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/blackl.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/blendrad.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/blendrad.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/blendrad.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/blendrad.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/calldrag_noro.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/calldrag_noro.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/calldrag_noro.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/calldrag_noro.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callkeys.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callkeys.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callkeys.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/callkeys.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callradite.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callradite.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callradite.F	(revision 118)
@@ -0,0 +1,563 @@
+      SUBROUTINE callradite(icount,ngrid,nlayer,nq,zday,ls,pq,albedo,
+     $     emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout,
+     $     dtlw,dtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxtop_sw,
+     &     tauref,tau,aerosol,ccn,rdust,rice,nuice,zdqnorm,dsodust)
+
+       IMPLICIT NONE
+c=======================================================================
+c   subject:
+c   --------
+c   Subroutine designed to call the main canonic
+c   radiative transfer subroutine "lwmain" et "swmain"
+c   to compute radiative heating and cooling rate and
+c   radiative fluxes to the surface.
+c
+c   These calculations are only valid on the part of the atmosphere
+c   where Local Thermal Equilibrium (NLTE) is verified. In practice
+c   The calculations are only performed for the first "nlaylte"
+c   parameters (nlaylte is calculated by subroutine "nlthermeq"
+c   and stored in common "yomlw.h").
+c
+c   The purpose of this subroutine is to:
+c      1) Make some initial calculation at first call
+c      2) Split the calculation in several sub-grid
+c        ("sub-domain") to save memory and
+c        be able run on a workstation at high resolution
+c        The sub-grid size is defined in dimradmars.h
+c      3) Compute the 3D scattering parameters depending on the
+c        size distribution of the different tracers (added by JBM)
+c      4) call "lwmain" and "swmain"
+c
+c
+c   authors:   
+c   ------
+c   Francois Forget / Christophe Hourdin / J.-B. Madeleine (2009)
+c
+c
+c   3D scattering scheme user's guide (J.-B. Madeleine)
+c   ---------------------------------
+c
+c   This routine has been modified to take into account 3D, time
+c   dependent scattering properties of the aerosols.
+c---- The look-up tables that contain the scattering parameters
+c   of a given tracer, for different sizes, are read by SUAER.F90.
+c   The names of the corresponding ASCII files have to be set in
+c   this subroutine (file_id variable), and files must be in the
+c   directory specified in datafile.h. Please make sure that the
+c   ASCII files are correctly written, and that the range
+c   of particle sizes is consistent with what you would expect.
+c---- SUAER.F90 is in charge of reading the ASCII files and averaging
+c   the scattering parameters in each GCM channel, using the three last
+c   equations of Forget et al. 1998 (GRL 25, No.7, p.1105-1108).
+c---- These look-up tables, loaded during the firstcall, are then
+c   constantly used by the subroutine "aeroptproperties.F" to compute,
+c   online, the 3D scattering parameters, based on the size distribution
+c   (reffrad and nueffrad) of the different tracers, in each grid box.
+c   These 3D size distributions are loaded by the "updatereffrad.F"
+c   subroutine. A log-normal distribution is then assumed in
+c   "aeroptproperties.F", along with a Gauss-Legendre integration.
+c---- The optical depth at the visible reference wavelength (set in
+c   SUAER.F90, after the file_id variable) is then computed by
+c   the subroutine "aeropacity.F", by using the size and spatial
+c   distribution of the corresponding tracer. This connection has to
+c   be implemented in "aeropacity.F" when adding a new tracer. To do so,
+c   one can use equation 2 of Forget et al. 1998 (Icarus 131, p.302-316).
+c---- The resulting variables "aerosol", "QVISsQREF3d", "omegaVIS3d" and
+c   "gVIS3d" (same in the infrared) are finally used by lwmain.F and 
+c   swmain.F to solve the radiative transfer equation.
+c
+c   changes:
+c   -------
+c
+c   > SRL 7/2000
+c   
+c   This version has been modified to only calculate radiative tendencies
+c   over layers 1..NFLEV (set in dimradmars.h).  Returns zero for higher
+c   layers, if any.
+c   In other routines, nlayermx -> nflev.
+c   Routines affected: lwflux, lwi, lwmain, lwxb, lwxd, lwxn.
+c
+c   > J.-B. Madeleine 10W12
+c   This version uses the variable's splitting, which can be usefull
+c     when performing very high resolution simulation like LES.
+c
+c   ----------
+c   Here, solar band#1 is spectral interval between "long1vis" and "long2vis"
+c   set in dimradmars.h 
+c   Here, solar band#2 is spectral interval between "long2vis" and "long3vis"
+c   set in dimradmars.h 
+c
+c   input:
+c   ----- 
+c   icount                counter of call to subroutine physic by gcm
+c   ngrid                 number of gridpoint of horizontal grid
+c   nlayer                Number of layer
+c   nq                    Number of tracer
+c   ls                    Solar longitude (Ls) , radian
+c   zday                  Date (time since Ls=0, in martian days)
+c   pq(ngrid,nlayer,nq)   Advected fields
+c
+c   albedo (ngrid,2)      hemispheric surface albedo
+c                         albedo (i,1) : mean albedo for solar band#1 
+c                                        (see below)
+c                         albedo (i,2) : mean albedo for solar band#2
+c                                        (see below)
+c   emis                  Thermal IR surface emissivity (no unit)
+c   mu0(ngridmx)           cos of solar zenith angle
+c                           (=1 when sun at zenith)
+c   pplay(ngrid,nlayer)    pressure (Pa) in the middle of each layer
+c   pplev(ngrid,nlayer+1)  pressure (Pa) at boundaries of each layer
+c   pt(ngrid,nlayer)       atmospheric temperature in each layer (K)
+c   tsurf(ngrid)           surface temperature (K)
+c   fract(ngridmx)         day fraction of the time interval 
+c                          =1 during the full day ; =0 during the night
+c   declin                 latitude of subsolar point
+c   dist_sol               sun-Mars distance (AU)
+c   igout                  coordinate of analysed point for debugging
+c   reffrad(ngrid,nlayer,naerkind)  Aerosol effective radius
+c   nueffrad(ngrid,nlayer,naerkind) Aerosol effective variance
+
+c
+c  output:
+c  -------
+c dtlw (ngrid,nlayer)       longwave (IR) heating rate (K/s)
+c dtsw(ngrid,nlayer)        shortwave (Solar) heating rate (K/s)
+c fluxsurf_lw(ngrid)        surface downward flux tota LW (thermal IR) (W.m-2)
+c fluxsurf_sw(ngrid,1)      surface downward flux SW for solar band#1 (W.m-2)
+c fluxsurf_sw(ngrid,2)      surface downward flux SW for solar band#2 (W.m-2)
+c
+c fluxtop_lw(ngrid)         outgoing upward flux tota LW (thermal IR) (W.m-2)
+c fluxtop_sw(ngrid,1)       outgoing upward flux SW for solar band#1 (W.m-2)
+c fluxtop_sw(ngrid,2)       outgoing upward flux SW for solar band#2 (W.m-2)
+
+c   tauref       Prescribed mean column optical depth at 700 Pa 
+c   tau          Column total visible dust optical depth at each point
+c   aerosol(ngrid,nlayer,naerkind)    aerosol extinction optical depth
+c                         at reference wavelength "longrefvis" set
+c                         in dimradmars.h , in each layer, for one of
+c                         the "naerkind" kind of aerosol optical
+c                         properties.
+
+c=======================================================================
+c
+c    Declarations :
+c    -------------
+c
+#include "dimensions.h"
+#include "dimphys.h"
+#include "dimradmars.h"
+#include "comcstfi.h"
+#include "callkeys.h"
+#include "yomlw.h"
+#include "aerkind.h"
+
+c-----------------------------------------------------------------------
+c    Input/Output
+c    ------------
+      INTEGER icount        
+      INTEGER ngrid,nlayer,nq 
+      INTEGER igout
+
+      REAL pq(ngrid,nlayer,nq)
+      REAL ccn(ngridmx,nlayermx)   ! Cloud condensation nuclei
+                                   !   (particules kg-1)
+      REAL albedo(ngrid,2),emis(ngrid)
+      REAL ls,zday
+
+      REAL pplev(ngrid,nlayer+1),pplay(ngrid,nlayer)
+      REAL pt(ngrid,nlayer)
+      REAL tsurf(ngrid)
+      REAL dist_sol,mu0(ngrid),fract(ngrid)
+      REAL dtlw(ngridmx,nlayermx),dtsw(ngridmx,nlayermx)
+      REAL fluxsurf_lw(ngridmx), fluxtop_lw(ngridmx)
+      REAL fluxsurf_sw(ngridmx,2), fluxtop_sw(ngridmx,2)
+
+      REAL tauref(ngrid), tau(ngrid,naerkind)
+      REAL aerosol(ngrid,nlayer,naerkind)
+      REAL rdust(ngridmx,nlayermx)  ! Dust geometric mean radius (m)
+      REAL rice(ngridmx,nlayermx)   ! Ice geometric mean radius (m)
+      REAL nuice(ngridmx,nlayermx)  ! Estimated effective variance
+      REAL zdqnorm(ngridmx,nlayermx,2)
+      REAL dsodust(ngridmx,nlayermx)
+c
+c    Local variables :
+c    -----------------
+
+      INTEGER j,l,ig,n,ich
+      INTEGER aer_count,iaer
+      INTEGER jd,ig0,nd
+
+      real  cste_mars ! solar constant on Mars (Wm-2)
+      REAL ptlev(ngridmx,nlayermx+1)
+
+      INTEGER ndomain
+      parameter (ndomain = (ngridmx-1) / ndomainsz + 1)
+
+c     Thermal IR net radiative budget (W m-2)
+
+      real znetrad(ndomainsz,nflev)
+
+      real zfluxd_sw(ndomainsz,nflev+1,2)
+      real zfluxu_sw(ndomainsz,nflev+1,2)
+
+      REAL zplev(ndomainsz,nflev+1)
+      REAL zztlev(ndomainsz,nflev+1)
+      REAL zplay(ndomainsz,nflev)
+      REAL zt(ndomainsz,nflev)
+      REAL zaerosol(ndomainsz,nflev,naerkind)
+      REAL zalbedo(ndomainsz,2)
+      REAL zdp(ndomainsz,nflev)
+      REAL zdt0(ndomainsz)
+
+      REAL zzdtlw(ndomainsz,nflev)
+      REAL zzdtsw(ndomainsz,nflev)
+      REAL zzflux(ndomainsz,6)
+      real zrmuz
+
+      REAL :: zQVISsQREF3d(ndomainsz,nflev,nsun,naerkind)
+      REAL :: zomegaVIS3d(ndomainsz,nflev,nsun,naerkind)
+      REAL :: zgVIS3d(ndomainsz,nflev,nsun,naerkind)
+
+      REAL :: zQIRsQREF3d(ndomainsz,nflev,nir,naerkind)
+      REAL :: zomegaIR3d(ndomainsz,nflev,nir,naerkind)
+      REAL :: zgIR3d(ndomainsz,nflev,nir,naerkind)
+
+c     Aerosol size distribution
+      REAL :: reffrad(ngrid,nlayer,naerkind)
+      REAL :: nueffrad(ngrid,nlayer,naerkind)
+c     Aerosol optical properties
+      REAL :: QVISsQREF3d(ngridmx,nlayermx,nsun,naerkind)
+      REAL :: omegaVIS3d(ngridmx,nlayermx,nsun,naerkind)
+      REAL :: gVIS3d(ngridmx,nlayermx,nsun,naerkind)
+
+      REAL :: QIRsQREF3d(ngridmx,nlayermx,nir,naerkind)
+      REAL :: omegaIR3d(ngridmx,nlayermx,nir,naerkind)
+      REAL :: gIR3d(ngridmx,nlayermx,nir,naerkind)
+
+      REAL :: QREFvis3d(ngridmx,nlayermx,naerkind)
+      REAL :: QREFir3d(ngridmx,nlayermx,naerkind)
+
+      REAL :: omegaREFvis3d(ngridmx,nlayermx,naerkind)
+      REAL :: omegaREFir3d(ngridmx,nlayermx,naerkind)
+
+c   local saved variables
+c   ---------------------
+
+      real pview(ngridmx)
+      save pview
+      
+      real zco2   ! volume fraction of CO2 in Mars atmosphere
+      DATA zco2/0.95/
+      SAVE zco2
+
+      LOGICAL firstcall
+      DATA firstcall/.true./
+      SAVE firstcall
+
+c----------------------------------------------------------------------
+
+c     Initialisation
+c     --------------
+
+      IF (firstcall) THEN
+
+c        Please name the different scatterers here ----------------
+c        PLEASE MAKE SURE that you set up the right number of
+c          scatterers in dimradmars.h (naerkind);
+c          name_iaer(1) = "dust_conrath"   !! poussiere classique
+          name_iaer(1) = "dust_doubleq"
+cc        name_iaer(2) = "dust_submicron" !! JB: experimental
+c          name_iaer(2) = "h2o_ice"
+c        ----------------------------------------------------------
+
+c        Assign a number to the different scatterers
+c        -------------------------------------------
+
+         iaer_dust_conrath=0
+         iaer_dust_doubleq=0
+         iaer_dust_submicron=0
+         iaer_h2o_ice=0
+
+         aer_count=0
+         if (.NOT.active) then
+           do iaer=1,naerkind
+             if (name_iaer(iaer).eq."dust_conrath") then
+               iaer_dust_conrath = iaer
+               aer_count = aer_count + 1
+             endif
+           enddo
+         endif
+         if (doubleq.AND.active) then
+           do iaer=1,naerkind
+             if (name_iaer(iaer).eq."dust_doubleq") then
+               iaer_dust_doubleq = iaer
+               aer_count = aer_count + 1
+             endif
+           enddo
+         endif
+         if (submicron.AND.active) then
+           do iaer=1,naerkind
+             if (name_iaer(iaer).eq."dust_submicron") then
+               iaer_dust_submicron = iaer
+               aer_count = aer_count + 1
+             endif
+           enddo
+         endif
+         if (water.AND.activice) then
+           do iaer=1,naerkind
+             if (name_iaer(iaer).eq."h2o_ice") then
+               iaer_h2o_ice = iaer
+               aer_count = aer_count + 1
+             endif
+           enddo
+         endif
+
+c        Check that we identified all tracers:
+         if (aer_count.ne.naerkind) then
+           write(*,*) "callradite: found only ",aer_count," scatterers"
+           write(*,*) "               expected ",naerkind
+           write(*,*) "please make sure that the number of"
+           write(*,*) "scatterers in dimradmars.h, the names"
+           write(*,*) "in callradite.F, and the flags in"
+           write(*,*) "callphys.def are all consistent!"
+           do iaer=1,naerkind
+             write(*,*)'      ',iaer,' ',trim(name_iaer(iaer))
+           enddo
+           stop
+         else
+           write(*,*) "callradite: found all scatterers, namely:"
+           do iaer=1,naerkind
+             write(*,*)'      ',iaer,' ',trim(name_iaer(iaer))
+           enddo
+         endif
+c        -------------------------------------------
+
+         DO ig=1,ngrid
+            pview(ig)=1.66     ! cosecant of viewing angle
+         ENDDO
+         gcp = g/cpp
+
+c        Logical tests for radiatively active water-ice clouds:
+         IF ( (activice.AND.(.NOT.water)).OR.
+     &        (activice.AND.(naerkind.LT.2)) ) THEN
+           WRITE(*,*) 'If activice is TRUE, water has to be set'
+           WRITE(*,*) 'to TRUE, and "naerkind" must be at least'
+           WRITE(*,*) 'equal to 2 in dimradmars.h.'
+           CALL ABORT
+         ELSE IF ( (.NOT.activice).AND.(naerkind.GT.1) ) THEN
+           WRITE(*,*) 'naerkind is greater than unity, but'
+           WRITE(*,*) 'activice has not been set to .true.'
+           WRITE(*,*) 'in callphys.def; this is not logical!'
+           CALL ABORT
+         ENDIF
+
+c        Loading the optical properties in external look-up tables:
+         CALL SUAER
+         CALL SULW
+
+         write(*,*) 'Splitting radiative calculations: ',
+     $              ' ngridmx,ngrid,ndomainsz,ndomain',
+     $                ngridmx,ngrid,ndomainsz,ndomain
+         if (ngridmx .EQ. 1) then
+           if (ndomainsz .NE. 1) then
+             print*
+             print*,'ATTENTION !!!'
+             print*,'pour tourner en 1D, '
+             print*,'fixer ndomainsz=1 dans phymars/dimradmars.h'
+             print*
+             call exit(1)
+           endif
+         endif
+         firstcall=.false.
+      END IF
+
+c     Computing aerosol optical properties and opacity
+c     ------------------------------------------------
+
+c     Updating aerosol size distributions:
+      CALL updatereffrad(ngrid,nlayer,
+     &                rdust,rice,nuice,
+     &                reffrad,nueffrad,
+     &                pq)
+
+c     Computing 3D scattering parameters:
+      CALL aeroptproperties(ngrid,nlayer,reffrad,nueffrad,
+     &                      QVISsQREF3d,omegaVIS3d,gVIS3d,
+     &                      QIRsQREF3d,omegaIR3d,gIR3d,
+     &                      QREFvis3d,QREFir3d,
+     &                      omegaREFvis3d,omegaREFir3d)
+
+c     Computing aerosol optical depth in each layer:
+      CALL aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls,
+     &      pq,ccn,tauref,tau,aerosol,reffrad,nueffrad,
+     &      QREFvis3d,QREFir3d,omegaREFvis3d,omegaREFir3d,
+     &      zdqnorm,dsodust)
+
+c     Starting loop on sub-domain
+c     ----------------------------
+
+      DO jd=1,ndomain
+        ig0=(jd-1)*ndomainsz
+        if (jd.eq.ndomain) then
+         nd=ngridmx-ig0
+        else
+         nd=ndomainsz
+        endif
+
+c       Spliting input variable in sub-domain input variables
+c       ---------------------------------------------------
+
+        do l=1,nlaylte
+         do ig = 1,nd
+           do iaer = 1, naerkind
+             do ich = 1, nsun
+               zQVISsQREF3d(ig,l,ich,iaer) = 
+     &                           QVISsQREF3d(ig0+ig,l,ich,iaer)
+               zomegaVIS3d(ig,l,ich,iaer) = 
+     &                           omegaVIS3d(ig0+ig,l,ich,iaer)
+               zgVIS3d(ig,l,ich,iaer) = 
+     &                           gVIS3d(ig0+ig,l,ich,iaer)
+             enddo
+             do ich = 1, nir
+               zQIRsQREF3d(ig,l,ich,iaer) = 
+     &                           QIRsQREF3d(ig0+ig,l,ich,iaer)
+               zomegaIR3d(ig,l,ich,iaer) = 
+     &                           omegaIR3d(ig0+ig,l,ich,iaer)
+               zgIR3d(ig,l,ich,iaer) = 
+     &                           gIR3d(ig0+ig,l,ich,iaer)
+             enddo
+           enddo
+         enddo
+        enddo
+
+        do l=1,nlaylte+1
+         do ig = 1,nd
+          zplev(ig,l) = pplev(ig0+ig,l)
+         enddo
+        enddo
+
+        do l=1,nlaylte
+         do ig = 1,nd
+          zplay(ig,l) = pplay(ig0+ig,l)
+          zt(ig,l) = pt(ig0+ig,l)
+c         Thickness of each layer (Pa) :
+          zdp(ig,l)= pplev(ig0+ig,l) - pplev(ig0+ig,l+1)
+         enddo
+        enddo
+
+        do n=1,naerkind
+          do l=1,nlaylte
+            do ig=1,nd
+              zaerosol(ig,l,n) = aerosol(ig0+ig,l,n)
+            enddo
+          enddo
+        enddo
+
+        do j=1,2
+          do ig = 1,nd
+           zalbedo(ig,j) = albedo(ig0+ig,j)
+          enddo
+        enddo
+
+c       Intermediate  levels: (computing tlev)
+c       ---------------------------------------
+c       Extrapolation for the air temperature above the surface
+        DO ig=1,nd
+              zztlev(ig,1)=zt(ig,1)+
+     s        (zplev(ig,1)-zplay(ig,1))*
+     s        (zt(ig,1)-zt(ig,2))/(zplay(ig,1)-zplay(ig,2))
+
+              zdt0(ig) = tsurf(ig0+ig) - zztlev(ig,1)
+        ENDDO
+
+        DO l=2,nlaylte
+         DO ig=1, nd
+               zztlev(ig,l)=0.5*(zt(ig,l-1)+zt(ig,l)) 
+         ENDDO
+        ENDDO
+
+        DO ig=1, nd
+           zztlev(ig,nlaylte+1)=zt(ig,nlaylte)
+        ENDDO
+
+
+c       Longwave ("lw") radiative transfer (= thermal infrared)
+c       -------------------------------------------------------
+        call lwmain (ig0,icount,nd,nflev
+     .        ,zdp,zdt0,emis(ig0+1),zplev,zztlev,zt
+     .        ,zaerosol,zzdtlw
+     .        ,fluxsurf_lw(ig0+1),fluxtop_lw(ig0+1)
+     .        ,znetrad
+     &        ,zQIRsQREF3d,zomegaIR3d,zgIR3d)
+
+c       Shortwave ("sw") radiative transfer (= solar radiation)
+c       -------------------------------------------------------
+c          Mars solar constant (W m-2)
+c          1370 W.m-2 is the solar constant at 1 AU.
+           cste_mars=1370./(dist_sol*dist_sol)
+
+           call swmain ( nd, nflev,
+     S     cste_mars, zalbedo,
+     S     mu0(ig0+1), zdp, zplev, zaerosol, fract(ig0+1),
+     S     zzdtsw, zfluxd_sw, zfluxu_sw,
+     &     zQVISsQREF3d,zomegaVIS3d,zgVIS3d)
+
+c       ------------------------------------------------------------
+c       Un-spliting output variable from sub-domain input variables
+c       ------------------------------------------------------------
+
+        do l=1,nlaylte
+         do ig = 1,nd
+          dtlw(ig0+ig,l) = zzdtlw(ig,l)
+          dtsw(ig0+ig,l) = zzdtsw(ig,l)
+         enddo
+        enddo
+
+        do l=1,nlaylte+1
+         do ig = 1,nd
+          ptlev(ig0+ig,l) = zztlev(ig,l)
+         enddo
+        enddo
+
+        do ig = 1,nd
+          fluxsurf_sw(ig0+ig,1) = zfluxd_sw(ig,1,1)
+          fluxsurf_sw(ig0+ig,2) = zfluxd_sw(ig,1,2)
+          fluxtop_sw(ig0+ig,1) = zfluxu_sw(ig,nlaylte+1,1)
+          fluxtop_sw(ig0+ig,2) = zfluxu_sw(ig,nlaylte+1,2)
+        enddo
+
+      ENDDO         !   (boucle jd=1, ndomain)
+
+c     Zero tendencies for any remaining layers between nlaylte and nlayer
+      if (nlayer.gt.nlaylte) then
+         do l = nlaylte+1, nlayer
+            do ig = 1, ngrid
+               dtlw(ig, l) = 0.
+               dtsw(ig, l) = 0.
+            enddo
+         enddo
+      endif
+
+c     Output for debugging if lwrite=T
+c     --------------------------------
+c     Write all nlayer layers, even though only nlaylte layers may have
+c     non-zero tendencies.
+
+         IF(lwrite) THEN
+            PRINT*,'Diagnotique for the radiation'
+            PRINT*,'albedo, emissiv, mu0,fract,fluxsurf_lw,fluxsurf_sw'
+            PRINT*,albedo(igout,1),emis(igout),mu0(igout),
+     s           fract(igout), fluxsurf_lw(igout),
+     $     fluxsurf_sw(igout,1)+fluxsurf_sw(igout,2)
+            PRINT*,'Tlay Tlev Play Plev dT/dt SW dT/dt LW (K/s)'
+            PRINT*,'daysec',daysec
+            DO l=1,nlayer
+               PRINT*,pt(igout,l),ptlev(igout,l),
+     s         pplay(igout,l),pplev(igout,l),
+     s         dtsw(igout,l),dtlw(igout,l)
+            ENDDO
+         ENDIF
+
+
+      return
+      end 
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callsedim.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callsedim.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/callsedim.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/callsedim.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/co2snow.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/co2snow.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/co2snow.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/co2snow.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comcstfi.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comcstfi.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comcstfi.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/comcstfi.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comdiurn.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comdiurn.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comdiurn.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/comdiurn.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comg1d.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comg1d.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comg1d.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/comg1d.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comgeomfi.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comgeomfi.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comgeomfi.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/comgeomfi.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comorbit.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comorbit.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comorbit.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/comorbit.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comsaison.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comsaison.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comsaison.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/comsaison.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comsoil.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comsoil.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/comsoil.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/comsoil.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/convadj.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/convadj.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/convadj.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/convadj.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/cvmgp.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/cvmgp.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/cvmgp.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/cvmgp.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/cvmgt.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/cvmgt.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/cvmgt.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/cvmgt.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/datafile.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/datafile.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/datafile.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/datafile.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/datareadnc.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/datareadnc.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/datareadnc.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/datareadnc.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/def_var.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/def_var.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/def_var.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/def_var.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dimphys.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dimphys.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dimphys.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/dimphys.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dimradmars.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dimradmars.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dimradmars.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/dimradmars.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/drag_noro.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/drag_noro.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/drag_noro.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/drag_noro.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dustdevil.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dustdevil.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dustdevil.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/dustdevil.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dustlift.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dustlift.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/dustlift.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/dustlift.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/eofdump.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/eofdump.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/eofdump.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/eofdump.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/eofdump.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/eofdump.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/eofdump.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/eofdump.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/flusv.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/flusv.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/flusv.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/flusv.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/growthrate.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/growthrate.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/growthrate.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/growthrate.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/gwprofil.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/gwprofil.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/gwprofil.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/gwprofil.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/gwstress.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/gwstress.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/gwstress.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/gwstress.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ineofdump.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ineofdump.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ineofdump.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/ineofdump.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/inifis.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/inifis.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/inifis.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/inifis.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniorbit.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniorbit.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniorbit.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/iniorbit.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/inistats.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/inistats.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/inistats.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/inistats.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/initracer.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/initracer.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/initracer.F	(revision 118)
@@ -0,0 +1,720 @@
+      SUBROUTINE initracer(qsurf,co2ice)
+
+       IMPLICIT NONE
+c=======================================================================
+c   subject:
+c   --------
+c   Initialization related to tracer 
+c   (transported dust, water, chemical species, ice...)
+c
+c   Name of the tracer
+c
+c   Test of dimension :
+c   Initialize COMMON tracer in tracer.h, using tracer names provided
+c   by the dynamics in "advtrac.h"
+c
+c   Old conventions: (not used any more)
+c
+c   If water=T : q(iq=nqmx) is the water mass mixing ratio
+c     and q(iq=nqmx-1) is the ice mass mixing ratio
+
+c   If there is transported dust, it uses iq=1 to iq=dustbin
+c   If there is no transported dust : dustbin=0
+c   If doubleq=T : q(iq=1) is the dust mass mixing ratio
+c                  q(iq=2) is the dust number mixing ratio 
+
+c   If (photochem.or.thermochem) there is "ncomp" chemical species (ncomp
+c   is set in aeronomars/chimiedata.h) using the ncomp iq values starting at
+c      iq=nqchem_min = dustbin+1   (nqchem_min is defined in inifis.F)
+c   
+c
+c   author: F.Forget
+c   ------
+c    Modifs: Franck Montmessin, Sebastien Lebonnois (june 2003)
+c            Ehouarn Millour (oct. 2008) identify tracers by their names
+c=======================================================================
+
+
+#include "dimensions.h"
+#include "dimphys.h"
+#include "comcstfi.h"
+#include "callkeys.h"
+#include "tracer.h"
+#include "advtrac.h"
+#include "comgeomfi.h"
+#include "watercap.h"
+#include "chimiedata.h"
+
+#include "surfdat.h"
+
+      real qsurf(ngridmx,nqmx)       ! tracer on surface (e.g.  kg.m-2)
+      real co2ice(ngridmx)           ! co2 ice mass on surface (e.g.  kg.m-2)
+      integer iq,ig,count, yeyey
+      real r0_lift , reff_lift, nueff_lift
+c     Ratio of small over large dust particles (used when both 
+c       doubleq and the submicron mode are active); In Montmessin
+c       et al. (2002), a value of 25 has been deduced;
+      real, parameter :: popratio = 25.
+      logical :: oldnames ! =.true. if old tracer naming convention (q01,...)
+      character(len=20) :: txt ! to store some text
+
+c-----------------------------------------------------------------------
+c  radius(nqmx)      ! aerosol particle radius (m)
+c  rho_q(nqmx)       ! tracer densities (kg.m-3)
+c  alpha_lift(nqmx)  ! saltation vertical flux/horiz flux ratio (m-1)
+c  alpha_devil(nqmx) ! lifting coeeficient by dust devil
+c  rho_dust          ! Mars dust density
+c  rho_ice           ! Water ice density
+c  nuice_ref         ! Effective variance nueff of the
+c                    !   water-ice size distributions
+c  doubleq           ! if method with mass (iq=1) and number(iq=2) mixing ratio
+c  varian            ! Characteristic variance of log-normal distribution
+c-----------------------------------------------------------------------
+
+      integer :: nqchem_start
+
+! Initialization: get tracer names from the dynamics and check if we are
+!                 using 'old' tracer convention ('q01',q02',...)
+!                 or new convention (full tracer names)
+      ! check if tracers have 'old' names
+      oldnames=.false.
+      count=0
+      do iq=1,nqmx
+        txt=" "
+        write(txt,'(a1,i2.2)') 'q',iq
+        if (txt.eq.tnom(iq)) then
+          count=count+1
+        endif
+      enddo ! of do iq=1,nqmx
+      
+      if (count.eq.nqmx) then
+        write(*,*) "initracer: tracers seem to follow old naming ",
+     &             "convention (q01,q02,...)"
+        write(*,*) "   => will work for now ... "
+        write(*,*) "      but you should run newstart to rename them"
+        oldnames=.true.
+      endif
+
+      ! copy/set tracer names
+      if (oldnames) then ! old names (derived from iq & option values)
+        ! 1. dust:
+        if (dustbin.ne.0) then ! transported dust
+          do iq=1,dustbin
+            txt=" "
+            write(txt,'(a4,i2.2)') 'dust',iq
+            noms(iq)=txt
+            mmol(iq)=100.
+          enddo
+          ! special case if doubleq
+          if (doubleq) then
+            if (dustbin.ne.2) then
+              write(*,*) 'initracer: error expected dustbin=2'
+            else
+              noms(1)='dust_mass'   ! dust mass mixing ratio
+              noms(2)='dust_number' ! dust number mixing ratio
+            endif
+          endif
+        endif
+        ! 2. water & ice
+        if (water) then
+          noms(nqmx)='h2o_vap'
+          mmol(nqmx)=18.
+          noms(nqmx-1)='h2o_ice'
+          mmol(nqmx-1)=18.
+        endif
+        ! 3. Chemistry
+        if (photochem .or. callthermos) then
+          if (doubleq) then
+            nqchem_start=3
+          else
+            nqchem_start=dustbin+1
+          end if
+          do iq=nqchem_start,nqchem_start+ncomp-1
+            noms(iq)=nomchem(iq-nqchem_start+1)
+            mmol(iq)=mmolchem(iq-nqchem_start+1)
+          enddo
+        endif ! of if (photochem .or. callthermos)
+        ! 4. Other tracers ????
+        if ((dustbin.eq.0).and.(.not.water)) then
+          noms(1)='co2'
+          mmol(1)=44
+          if (nqmx.eq.2) then
+            noms(nqmx)='Ar_N2'
+            mmol(nqmx)=30
+          endif
+        endif
+      else
+        ! copy tracer names from dynamics
+        do iq=1,nqmx
+          noms(iq)=tnom(iq)
+        enddo
+        ! mmol(:) array is initialized later (see below)
+      endif ! of if (oldnames)
+
+      ! special modification when using 'old' tracers:
+      ! qsurf(nqmx) was h2o ice whereas q(nqmx) was water vapour
+      ! and (if iceparty) q(nqmx-1) was null whereas q(nqmx-1) was water ice
+      if (oldnames.and.water) then
+        write(*,*)'initracer: moving surface water ice to index ',nqmx-1
+        qsurf(1:ngridmx,nqmx-1)=qsurf(1:ngridmx,nqmx)
+        qsurf(1:ngridmx,nqmx)=0
+      endif 
+      
+c------------------------------------------------------------
+c     Test Dimensions tracers
+c------------------------------------------------------------
+
+! Ehouarn: testing number of tracers is obsolete...
+!      if(photochem.or.thermochem) then
+!          if (water) then
+!              if ((dustbin+ncomp+2).ne.nqmx) then
+!                 print*,'initracer: tracer dimension problem:'
+!                 print*,"(dustbin+ncomp+2).ne.nqmx"
+!                 print*,"ncomp: ",ncomp
+!                 print*,"dustbin: ",dustbin
+!                 print*,"nqmx: ",nqmx
+!                 print*,'Change ncomp in chimiedata.h'
+!               endif
+!          else
+!              if ((dustbin+ncomp+1).ne.nqmx) then
+!                 print*,'initracer: tracer dimension problem:'
+!                 print*,"(dustbin+ncomp+1).ne.nqmx"
+!                 print*,"ncomp: ",ncomp
+!                 print*,"dustbin: ",dustbin
+!                 print*,"nqmx: ",nqmx
+!                 print*,'Change ncomp in chimiedata.h'
+!                 STOP
+!               endif
+!            endif
+!      endif
+
+c------------------------------------------------------------
+c         NAME and molar mass of the tracer 
+c------------------------------------------------------------
+
+   
+! Identify tracers by their names: (and set corresponding values of mmol)
+      ! 0. initialize tracer indexes to zero:
+      do iq=1,nqmx
+        igcm_dustbin(iq)=0
+      enddo
+      igcm_dust_mass=0
+      igcm_dust_number=0
+      igcm_dust_submicron=0
+      igcm_h2o_vap=0
+      igcm_h2o_ice=0
+      igcm_co2=0
+      igcm_co=0
+      igcm_o=0
+      igcm_o1d=0
+      igcm_o2=0
+      igcm_o3=0
+      igcm_h=0
+      igcm_h2=0
+      igcm_oh=0
+      igcm_ho2=0
+      igcm_h2o2=0
+      igcm_n2=0
+      igcm_ar=0
+      igcm_ar_n2=0
+
+      ! 1. find dust tracers
+      count=0
+      if (dustbin.gt.0) then
+        do iq=1,nqmx
+          txt=" "
+          write(txt,'(a4,i2.2)')'dust',count+1
+          if (noms(iq).eq.txt) then
+            count=count+1
+            igcm_dustbin(count)=iq
+            mmol(iq)=100.
+          endif
+        enddo !do iq=1,nqmx
+      endif ! of if (dustbin.gt.0)
+      if (doubleq) then
+        do iq=1,nqmx
+          if (noms(iq).eq."dust_mass") then
+            igcm_dust_mass=iq
+            count=count+1
+          endif
+          if (noms(iq).eq."dust_number") then
+            igcm_dust_number=iq
+            count=count+1
+          endif
+        enddo
+      endif ! of if (doubleq)
+      if (submicron) then
+        do iq=1,nqmx
+          if (noms(iq).eq."dust_submicron") then
+            igcm_dust_submicron=iq
+            mmol(iq)=100.
+            count=count+1
+          endif
+        enddo
+      endif ! of if (submicron)
+      ! 2. find chemistry and water tracers
+      do iq=1,nqmx
+        if (noms(iq).eq."co2") then
+          igcm_co2=iq
+          mmol(igcm_co2)=44.
+          count=count+1
+        endif
+        if (noms(iq).eq."co") then
+          igcm_co=iq
+          mmol(igcm_co)=28.
+          count=count+1
+        endif
+        if (noms(iq).eq."o") then
+          igcm_o=iq
+          mmol(igcm_o)=16.
+          count=count+1
+        endif
+        if (noms(iq).eq."o1d") then
+          igcm_o1d=iq
+          mmol(igcm_o1d)=16.
+          count=count+1
+        endif
+        if (noms(iq).eq."o2") then
+          igcm_o2=iq
+          mmol(igcm_o2)=32.
+          count=count+1
+        endif
+        if (noms(iq).eq."o3") then
+          igcm_o3=iq
+          mmol(igcm_o3)=48.
+          count=count+1
+        endif
+        if (noms(iq).eq."h") then
+          igcm_h=iq
+          mmol(igcm_h)=1.
+          count=count+1
+        endif
+        if (noms(iq).eq."h2") then
+          igcm_h2=iq
+          mmol(igcm_h2)=2.
+          count=count+1
+        endif
+        if (noms(iq).eq."oh") then
+          igcm_oh=iq
+          mmol(igcm_oh)=17.
+          count=count+1
+        endif
+        if (noms(iq).eq."ho2") then
+          igcm_ho2=iq
+          mmol(igcm_ho2)=33.
+          count=count+1
+        endif
+        if (noms(iq).eq."h2o2") then
+          igcm_h2o2=iq
+          mmol(igcm_h2o2)=34.
+          count=count+1
+        endif
+        if (noms(iq).eq."n2") then
+          igcm_n2=iq
+          mmol(igcm_n2)=28.
+          count=count+1
+        endif
+        if (noms(iq).eq."ar") then
+          igcm_ar=iq
+          mmol(igcm_ar)=40.
+          count=count+1
+        endif
+        if (noms(iq).eq."h2o_vap") then
+          igcm_h2o_vap=iq
+          mmol(igcm_h2o_vap)=18.
+          count=count+1
+        endif
+        if (noms(iq).eq."h2o_ice") then
+          igcm_h2o_ice=iq
+          mmol(igcm_h2o_ice)=18.
+          count=count+1
+        endif
+        ! Other stuff: e.g. for simulations using co2 + neutral gaz
+        if (noms(iq).eq."Ar_N2") then
+          igcm_ar_n2=iq
+          mmol(igcm_ar_n2)=30.
+          count=count+1
+        endif
+      enddo ! of do iq=1,nqmx
+!      count=count+nbqchem
+      
+      ! check that we identified all tracers:
+      if (count.ne.nqmx) then
+        write(*,*) "initracer: found only ",count," tracers"
+        write(*,*) "               expected ",nqmx
+        do iq=1,count
+          write(*,*)'      ',iq,' ',trim(noms(iq))
+        enddo
+        stop
+      else
+        write(*,*) "initracer: found all expected tracers, namely:"
+        do iq=1,nqmx
+          write(*,*)'      ',iq,' ',trim(noms(iq))
+        enddo
+      endif
+
+      ! if water cycle but iceparty=.false., there will nevertheless be
+      ! water ice at the surface (iceparty is not used anymore, but this
+      ! part is still relevant, as we want to stay compatible with the
+      ! older versions).
+      if (water.and.(igcm_h2o_ice.eq.0)) then
+        igcm_h2o_ice=igcm_h2o_vap ! so that qsurf(i_h2o_ice) is identified
+                                  ! even though there is no q(i_h2o_ice)
+      else
+       ! surface ice qsurf(i_h2o_ice) was loaded twice by phyetat0,
+       ! as qsurf(i_h2o_vap) & as qsurf(i_h2o_ice), so to be clean:
+       if (igcm_h2o_vap.ne.0) then
+         qsurf(1:ngridmx,igcm_h2o_vap)=0
+       endif
+      endif
+
+c------------------------------------------------------------
+c     Initialisation tracers ....
+c------------------------------------------------------------
+      call zerophys(nqmx,rho_q)
+
+      rho_dust=2500.  ! Mars dust density (kg.m-3)
+      rho_ice=920.    ! Water ice density (kg.m-3)
+      nuice_ref=0.1   ! Effective variance nueff of the
+                      ! water-ice size distributions
+
+      if (doubleq) then
+c       "doubleq" technique 
+c       -------------------
+c      (transport of mass and number mixing ratio)
+c       iq=1: Q mass mixing ratio, iq=2: N number mixing ratio
+
+        if( (nqmx.lt.2).or.(water.and.(nqmx.lt.4)) ) then
+          write(*,*)'initracer: nqmx is too low : nqmx=', nqmx
+          write(*,*)'water= ',water,' doubleq= ',doubleq   
+        end if
+
+        nueff_lift = 0.5
+        varian=sqrt(log(1.+nueff_lift))
+
+        rho_q(igcm_dust_mass)=rho_dust
+        rho_q(igcm_dust_number)=rho_dust
+
+c       Intermediate calcul for computing geometric mean radius r0
+c       as a function of mass and number mixing ratio Q and N
+c       (r0 = (r3n_q * Q/ N)^(1/3))
+        r3n_q = exp(-4.5*varian**2)*(3./4.)/(pi*rho_dust)
+
+c       Intermediate calcul for computing effective radius reff
+c       from geometric mean radius r0
+c       (reff = ref_r0 * r0)
+        ref_r0 = exp(2.5*varian**2)
+        
+c       lifted dust :
+c       '''''''''''
+        reff_lift = 3.0e-6 !3.e-6 !Effective radius of lifted dust (m)
+        alpha_devil(igcm_dust_mass)=9.e-9   !  dust devil lift mass coeff
+c       alpha_lift(igcm_dust_mass)=3.0e-15  !  Lifted mass coeff
+        alpha_lift(igcm_dust_mass)=3.3e-10 !1.e-6 !Lifted mass coeff
+
+        r0_lift = reff_lift/ref_r0
+        alpha_devil(igcm_dust_number)=r3n_q*
+     &                        alpha_devil(igcm_dust_mass)/r0_lift**3
+        alpha_lift(igcm_dust_number)=r3n_q*
+     &                        alpha_lift(igcm_dust_mass)/r0_lift**3
+
+        radius(igcm_dust_mass) = reff_lift
+        radius(igcm_dust_number) = reff_lift
+
+        write(*,*) "initracer: doubleq_param reff_lift:", reff_lift
+        write(*,*) "initracer: doubleq_param nueff_lift:", nueff_lift
+        write(*,*) "initracer: doubleq_param alpha_lift:",
+     &    alpha_lift(igcm_dust_mass)
+
+      else
+
+       if (dustbin.gt.1) then
+        print*,'initracer: STOP!',
+     $   ' properties of dust need to be set in initracer !!!'
+        stop
+
+       else if (dustbin.eq.1) then
+
+c       This will be used for 1 dust particle size:
+c       ------------------------------------------
+        radius(igcm_dustbin(1))=3.e-6
+        alpha_lift(igcm_dustbin(1))=0.0e-6
+        alpha_devil(igcm_dustbin(1))=7.65e-9
+        rho_q(igcm_dustbin(1))=rho_dust
+
+       endif
+      end if    ! (doubleq)
+
+c     Submicron dust mode:
+c     --------------------
+
+      if (submicron) then
+        radius(igcm_dust_submicron)=0.1e-6
+        rho_q(igcm_dust_submicron)=rho_dust
+        if (doubleq) then
+c         If doubleq is also active, we use the population ratio:
+          alpha_lift(igcm_dust_submicron) = 
+     &      alpha_lift(igcm_dust_number)*popratio*
+     &      rho_q(igcm_dust_submicron)*4./3.*pi*
+     &      radius(igcm_dust_submicron)**3.
+          alpha_devil(igcm_dust_submicron)=1.e-30
+        else
+          alpha_lift(igcm_dust_submicron)=1e-6
+          alpha_devil(igcm_dust_submicron)=1.e-30
+        endif ! (doubleq)
+      end if  ! (submicron)
+
+c     Initialization for photochemistry:
+c     ---------------------------------
+      if (photochem) then
+      ! initialize chemistry+water (water will be correctly initialized below)
+      ! by initializing everything which is not dust ...
+        do iq=1,nqmx
+          txt=noms(iq)
+          if (txt(1:4).ne."dust") then
+            radius(iq)=0.
+            alpha_lift(iq) =0.
+            alpha_devil(iq)=0.
+          endif
+        enddo ! do iq=1,nqmx
+      endif
+
+c     Initialization for water vapor
+c     ------------------------------
+      if(water) then
+         radius(igcm_h2o_vap)=0.
+         alpha_lift(igcm_h2o_vap) =0.
+         alpha_devil(igcm_h2o_vap)=0.
+
+c       "Dryness coefficient" controlling the evaporation and
+c        sublimation from the ground water ice (close to 1)
+c        HERE, the goal is to correct for the fact
+c        that the simulated permanent water ice polar caps
+c        is larger than the actual cap and the atmospheric
+c        opacity not always realistic.
+
+         do ig=1,ngridmx
+           if (ngridmx.ne.1) watercaptag(ig)=.false.
+           dryness(ig) = 1.
+         enddo
+
+         IF (caps) THEN
+c Perennial H20 north cap defined by watercaptag=true (allows surface to be
+c hollowed by sublimation in vdifc).
+         yeyey = 0
+         do ig=1,ngridmx
+!          !!! TESTS TESTS outliers
+!          !!! TESTS TESTS outliers
+!          if ( ( lati(ig)*180./pi      .ge.  75 ) .and.
+!     .         ( lati(ig)*180./pi      .le.  77 ) .and.
+!     .         ( ( ( long(ig)*180./pi .ge. 000. ) .and.
+!     .              ( long(ig)*180./pi .le. 120. ) ) 
+!     .             .or.
+!     .             ( ( long(ig)*180./pi .ge. -130. ) .and.
+!     .             ( long(ig)*180./pi .le. -115. ) ) ) ) then
+!             if (yeyey .eq. 0) then  !!! 1/2 en 64x48 sinon trop large en lat
+!              write(*,*) "outliers ", lati(ig)*180./pi, long(ig)*180./pi
+!              if (ngridmx.ne.1) watercaptag(ig)=.true.
+!              dryness(ig) = 1.
+!              albedodat(ig) = 0.45 !! comme alb_surfice
+!              yeyey = 1
+!             else
+!              yeyey = 0
+!             endif
+!          endif
+!          !!! TESTS TESTS outliers
+!          !!! TESTS TESTS outliers
+!
+!          !!! TESTS TESTS addcap
+!          !!! TESTS TESTS addcap     
+!          if ( ( lati(ig)*180./pi      .ge.  82 ) .and.
+!     .         ( lati(ig)*180./pi      .le.  84 ) .and.
+!     .         ( ( long(ig)*180./pi .gt. -030. ) .and.
+!     .              ( long(ig)*180./pi .lt. 090. ) ) ) then
+!              write(*,*) "capadd ", lati(ig)*180./pi, long(ig)*180./pi
+!              if (ngridmx.ne.1) watercaptag(ig)=.true.
+!              albedodat(ig) = 0.45 !! comme alb_surfice
+!              dryness(ig) = 1.
+!          endif
+!          !!! TESTS TESTS addcap
+!          !!! TESTS TESTS addcap 
+    
+           if (lati(ig)*180./pi.gt.84) then
+             if (ngridmx.ne.1) watercaptag(ig)=.true.
+             dryness(ig) = 1.
+c Use the following cap definition for high spatial resolution (latitudinal bin <= 5 deg)
+c	      if (lati(ig)*180./pi.lt.85.and.long(ig).ge.0) then
+c	        if (ngridmx.ne.1) watercaptag(ig)=.true.
+c               dryness(ig) = 1.
+c	      endif
+c             if (lati(ig)*180./pi.ge.85) then
+c               if (ngridmx.ne.1) watercaptag(ig)=.true.
+c               dryness(ig) = 1.
+c	      endif
+           endif  ! (lati>80 deg)
+         end do ! (ngridmx)
+        ENDIF ! (caps)
+
+         if(water.and.(nqmx.ge.2)) then
+           radius(igcm_h2o_ice)=3.e-6
+           rho_q(igcm_h2o_ice)=rho_ice
+           alpha_lift(igcm_h2o_ice) =0.
+           alpha_devil(igcm_h2o_ice)=0.
+         elseif(water.and.(nqmx.lt.2)) then
+            write(*,*) 'nqmx is too low : nqmx=', nqmx
+            write(*,*) 'water= ',water
+         endif
+
+      end if  ! (water)
+
+c     Output for records:
+c     ~~~~~~~~~~~~~~~~~~
+      write(*,*)
+      Write(*,*) '******** initracer : dust transport parameters :'
+      write(*,*) 'alpha_lift = ', alpha_lift
+      write(*,*) 'alpha_devil = ', alpha_devil
+      write(*,*) 'radius  = ', radius
+      if(doubleq) then
+        write(*,*) 'reff_lift (um) =  ', reff_lift
+        write(*,*) 'size distribution variance  = ', varian
+        write(*,*) 'r3n_q , ref_r0 : ', r3n_q , ref_r0
+      end if
+
+!
+!     some extra (possibly redundant) sanity checks for tracers: 
+!     ---------------------------------------------------------
+
+       if (doubleq) then 
+       ! verify that we indeed have dust_mass and dust_number tracers 
+         if (igcm_dust_mass.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use doubleq option without ",
+     &                "a dust_mass tracer !"
+           stop
+         endif
+         if (igcm_dust_number.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use doubleq option without ",
+     &                "a dust_number tracer !"
+           stop
+         endif
+       endif
+
+       if ((.not.doubleq).and.(dustbin.gt.0)) then
+       ! verify that we indeed have 'dustbin' dust tracers
+         count=0
+         do iq=1,dustbin
+           if (igcm_dustbin(iq).ne.0) then
+             count=count+1
+           endif
+         enddo
+         if (count.ne.dustbin) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  dusbin is set to ",dustbin,
+     &                " but we only have the following dust tracers:"
+           do iq=1,count
+             write(*,*)"   ",trim(noms(igcm_dustbin(iq)))
+           enddo
+           stop
+         endif
+       endif
+
+       if (water) then
+       ! verify that we indeed have h2o_vap and h2o_ice tracers
+         if (igcm_h2o_vap.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use water option without ",
+     &                "an h2o_vap tracer !"
+           stop
+         endif
+         if (igcm_h2o_ice.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use water option without ",
+     &                "an h2o_ice tracer !"
+           stop
+         endif
+       endif
+
+       if (photochem .or. callthermos) then
+       ! verify that we indeed have the chemistry tracers
+         if (igcm_co2.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a co2 tracer !"
+         stop
+         endif
+         if (igcm_co.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a co tracer !"
+         stop
+         endif
+         if (igcm_o.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a o tracer !"
+         stop
+         endif
+         if (igcm_o1d.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a o1d tracer !"
+         stop
+         endif
+         if (igcm_o2.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "an o2 tracer !"
+         stop
+         endif
+         if (igcm_o3.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "an o3 tracer !"
+         stop
+         endif
+         if (igcm_h.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a h tracer !"
+         stop
+         endif
+         if (igcm_h2.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a h2 tracer !"
+         stop
+         endif
+         if (igcm_oh.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "an oh tracer !"
+         stop
+         endif
+         if (igcm_ho2.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a ho2 tracer !"
+         stop
+         endif
+         if (igcm_h2o2.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a h2o2 tracer !"
+         stop
+         endif
+         if (igcm_n2.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "a n2 tracer !"
+         stop
+         endif
+         if (igcm_ar.eq.0) then
+           write(*,*) "initracer: error !!"
+           write(*,*) "  cannot use chemistry option without ",
+     &                "an ar tracer !"
+         stop
+         endif
+       endif ! of if (photochem .or. callthermos)
+
+      end
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniwrite.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniwrite.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniwrite.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/iniwrite.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniwritesoil.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniwritesoil.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/iniwritesoil.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/iniwritesoil.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/interp_line.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/interp_line.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/interp_line.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/interp_line.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ismax.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ismax.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ismax.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/ismax.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ismin.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ismin.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/ismin.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/ismin.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwb.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwb.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwb.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwb.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwdiff.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwdiff.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwdiff.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwdiff.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwflux.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwflux.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwflux.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwflux.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwi.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwi.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwi.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwi.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwmain.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwmain.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwmain.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwmain.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwtt.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwtt.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwtt.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwtt.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwu.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwu.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwu.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwu.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxb.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxb.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxb.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwxb.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxd.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxd.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxd.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwxd.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxn.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxn.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/lwxn.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/lwxn.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_callkeys.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_callkeys.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_callkeys.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/meso_callkeys.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_dimphys.h_ref
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_dimphys.h_ref	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_dimphys.h_ref	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/meso_dimphys.h_ref
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_inifis.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_inifis.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_inifis.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/meso_inifis.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_param_slope.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_param_slope.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_param_slope.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/meso_param_slope.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_physiq.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_physiq.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_physiq.F	(revision 118)
@@ -0,0 +1,1969 @@
+      SUBROUTINE meso_physiq(ngrid,nlayer,nq,
+     $            firstcall,lastcall,
+     $            wday_ini,
+     $            pday,ptime,ptimestep,
+     $            pplev,pplay,pphi,
+     $            pu,pv,pt,pq,pw,
+     $            wtnom,
+     $            pdu,pdv,pdt,pdq,pdpsrf,tracerdyn,
+     $            wtsurf,wtsoil,wemis,wq2,wqsurf,wco2ice,
+     $            wisoil,wdsoil,
+     $            wecritphys,
+#ifdef MESOSCALE
+     $            output_tab2d, output_tab3d,
+#endif
+     $            flag_LES)
+
+
+
+      IMPLICIT NONE
+c=======================================================================
+c
+c       CAREFUL: THIS IS A VERSION TO BE USED WITH WRF !!!
+c
+c       ... CHECK THE ****WRF lines
+c
+c=======================================================================
+c
+c   subject:
+c   --------
+c
+c   Organisation of the physical parametrisations of the LMD 
+c   martian atmospheric general circulation model.
+c
+c   The GCM can be run without or with tracer transport
+c   depending on the value of Logical "tracer" in file  "callphys.def"
+c   Tracers may be water vapor, ice OR chemical species OR dust particles
+c
+c   SEE comments in initracer.F about numbering of tracer species...
+c
+c   It includes:
+c
+c      1. Initialization:
+c      1.1 First call initializations
+c      1.2 Initialization for every call to physiq
+c      1.2.5 Compute mean mass and cp, R and thermal conduction coeff.
+c      2. Compute radiative transfer tendencies
+c         (longwave and shortwave) for CO2 and aerosols.
+c      3. Gravity wave and subgrid scale topography drag :
+c      4. Vertical diffusion (turbulent mixing):
+c      5. Convective adjustment
+c      6. Condensation and sublimation of carbon dioxide.
+
+c      7.  TRACERS :
+c       7a. water and water ice
+c       7b. call for photochemistry when tracers are chemical species
+c       7c. other scheme for tracer (dust) transport (lifting, sedimentation)
+c       7d. updates (CO2 pressure variations, surface budget)
+c      8. Contribution to tendencies due to thermosphere
+c      9. Surface and sub-surface temperature calculations
+c     10. dust bomb propagative perturbation
+c     11. Write outputs :
+c           - "startfi", "histfi" (if it's time)
+c           - Saving statistics (if "callstats = .true.")
+c           - Dumping eof (if "calleofdump = .true.")
+c           - Output any needed variables in "diagfi" 
+c     12. Diagnostic: mass conservation of tracers
+c 
+c   author: 
+c   ------- 
+c           Frederic Hourdin	15/10/93
+c           Francois Forget		1994
+c           Christophe Hourdin	02/1997 
+c           Subroutine completly rewritten by F.Forget (01/2000)
+c           Introduction of the photochemical module: S. Lebonnois (11/2002)
+c           Introduction of the thermosphere module: M. Angelats i Coll (2002)
+c           Water ice clouds: Franck Montmessin (update 06/2003)
+c           Radiatively active tracers: J.-B. Madeleine (10/2008-06/2009)
+c             Nb: See callradite.F for more information.
+c           new WRF version: Aymeric Spiga (01/2009)
+c           
+c
+c   arguments:
+c   ----------
+c
+c   input:
+c   ------
+c    ecri                  period (in dynamical timestep) to write output
+c    ngrid                 Size of the horizontal grid.
+c                          All internal loops are performed on that grid.
+c    nlayer                Number of vertical layers.
+c    nq                    Number of advected fields
+c    firstcall             True at the first call
+c    lastcall              True at the last call
+c    pday                  Number of days counted from the North. Spring
+c                          equinoxe.
+c    ptime                 Universal time (0<ptime<1): ptime=0.5 at 12:00 UT
+c    ptimestep             timestep (s)
+c    pplay(ngrid,nlayer)   Pressure at the middle of the layers (Pa)
+c    pplev(ngrid,nlayer+1) intermediate pressure levels (pa)
+c    pphi(ngrid,nlayer)    Geopotential at the middle of the layers (m2s-2)
+c    pu(ngrid,nlayer)      u component of the wind (ms-1)
+c    pv(ngrid,nlayer)      v component of the wind (ms-1)
+c    pt(ngrid,nlayer)      Temperature (K)
+c    pq(ngrid,nlayer,nq)   Advected fields
+c    pudyn(ngrid,nlayer)    \ 
+c    pvdyn(ngrid,nlayer)     \ Dynamical temporal derivative for the
+c    ptdyn(ngrid,nlayer)     / corresponding variables
+c    pqdyn(ngrid,nlayer,nq) /
+c    pw(ngrid,?)           vertical velocity
+c
+c
+c    ****WRF 
+c       day_ini,tsurf,tsoil,emis,q2,qsurf,co2ice are inputs
+c               and locally saved variables
+c                       (no need to call phyetat0)
+c
+c
+c   output:
+c   -------
+c
+c    pdu(ngrid,nlayermx)        \
+c    pdv(ngrid,nlayermx)         \  Temporal derivative of the corresponding
+c    pdt(ngrid,nlayermx)         /  variables due to physical processes.
+c    pdq(ngrid,nlayermx,nqmx)   /
+c    pdpsrf(ngrid)             /
+c    tracerdyn                 call tracer in dynamical part of GCM ?
+
+c
+c=======================================================================
+c
+c    0.  Declarations :
+c    ------------------
+
+#include "dimensions.h"
+#include "dimphys.h"
+#include "comgeomfi.h"
+#include "surfdat.h"
+#include "comsoil.h"     !!! new soil common 
+#include "comdiurn.h"
+#include "callkeys.h"
+#include "comcstfi.h"
+#include "planete.h"
+#include "comsaison.h"
+#include "control.h"
+#include "dimradmars.h"
+#include "comg1d.h"
+#include "tracer.h"
+#include "nlteparams.h"
+
+#include "chimiedata.h"
+#include "watercap.h"
+#include "param.h"
+#include "param_v3.h"
+#include "conc.h"
+
+#include "netcdf.inc"
+
+!!!!**** SPECIFIC TO MESOSCALE
+#ifdef MESOSCALE
+#include "meso_slope.h"
+#include "wrf_output_2d.h"
+#include "wrf_output_3d.h"
+#endif
+
+#include "advtrac.h"   !!! this is necessary for tracers (in dyn3d)
+
+c Arguments :
+c -----------
+
+c   inputs:
+c   -------
+      INTEGER ngrid,nlayer,nq
+      REAL ptimestep
+      REAL pplev(ngridmx,nlayer+1),pplay(ngridmx,nlayer)
+      REAL pphi(ngridmx,nlayer)
+      REAL pu(ngridmx,nlayer),pv(ngridmx,nlayer)
+      REAL pt(ngridmx,nlayer),pq(ngridmx,nlayer,nq)
+      REAL pw(ngridmx,nlayer) !Mars pvervel transmit par dyn3d
+      REAL zh(ngridmx,nlayermx)      ! potential temperature (K)
+      LOGICAL firstcall,lastcall
+!!! ****WRF WRF specific to mesoscale
+      INTEGER wday_ini
+      REAL wtsurf(ngridmx)  ! input only ay firstcall - output
+      REAL wtsoil(ngridmx,nsoilmx)
+      REAL wisoil(ngridmx,nsoilmx)  !! new soil scheme
+      REAL wdsoil(ngridmx,nsoilmx)   !! new soil scheme
+      REAL wco2ice(ngridmx)
+      REAL wemis(ngridmx)
+      REAL wqsurf(ngridmx,nqmx)
+      REAL wq2(ngridmx,nlayermx+1)
+      REAL wecritphys
+#ifdef MESOSCALE
+      REAL output_tab2d(ngridmx,n2d)
+      REAL output_tab3d(ngridmx,nlayer,n3d)
+#endif
+      REAL sl_ls, sl_lct, sl_lat, sl_tau, sl_alb, sl_the, sl_psi
+      REAL sl_fl0, sl_flu
+      REAL sl_ra, sl_di0
+      REAL sky
+      REAL hfx(ngridmx)    !! pour LES avec isfflx!=0
+      REAL ust(ngridmx)    !! pour LES avec isfflx!=0
+      LOGICAL flag_LES     !! pour LES avec isfflx!=0
+      REAL qsurfice(ngridmx) !! pour diagnostics
+      REAL qsurfice_dust(ngridmx) !! pour diagnostics de poussière
+      real alpha,lay1 ! coefficients for building layers
+      integer iloop
+      INTEGER tracerset    !!! this corresponds to config%mars
+!!! ****WRF WRF specific to mesoscale
+      REAL pday
+      REAL ptime 
+      logical tracerdyn
+      CHARACTER (len=20) :: wtnom(nqmx) ! tracer name
+
+c   outputs:
+c   --------
+c     physical tendencies
+      REAL pdu(ngridmx,nlayer),pdv(ngridmx,nlayer)
+      REAL pdt(ngridmx,nlayer),pdq(ngridmx,nlayer,nq)
+      REAL pdpsrf(ngridmx) ! surface pressure tendency
+
+
+c Local saved variables:
+c ----------------------
+c     aerosol (dust or ice) extinction optical depth  at reference wavelength 
+c     "longrefvis" set in dimradmars.h , for one of the "naerkind"  kind of
+c      aerosol optical properties  :
+      REAL aerosol(ngridmx,nlayermx,naerkind)
+      REAL TAU_lay(ngridmx)
+      REAL dsodust(ngridmx,nlayermx)
+
+      INTEGER day_ini  ! Initial date of the run (sol since Ls=0) 
+      INTEGER icount     ! counter of calls to physiq during the run.
+      REAL tsurf(ngridmx)            ! Surface temperature (K)
+      REAL tsoil(ngridmx,nsoilmx)    ! sub-surface temperatures (K)
+      REAL co2ice(ngridmx)           ! co2 ice surface layer (kg.m-2)  
+      REAL albedo(ngridmx,2)         ! Surface albedo in each solar band
+      REAL emis(ngridmx)             ! Thermal IR surface emissivity
+      REAL dtrad(ngridmx,nlayermx)   ! Net atm. radiative heating rate (K.s-1)
+      REAL fluxrad_sky(ngridmx)      ! rad. flux from sky absorbed by surface (W.m-2)
+      REAL fluxrad(ngridmx)          ! Net radiative surface flux (W.m-2)
+      REAL capcal(ngridmx)           ! surface heat capacity (J m-2 K-1)
+      REAL fluxgrd(ngridmx)          ! surface conduction flux (W.m-2)
+      REAL qsurf(ngridmx,nqmx)       ! tracer on surface (e.g. kg.m-2)
+      REAL q2(ngridmx,nlayermx+1)    ! Turbulent Kinetic Energy 
+      INTEGER ig_vl1                 ! Grid Point near VL1   (for diagnostic) 
+
+c     Variables used by the water ice microphysical scheme:
+      REAL rice(ngridmx,nlayermx)    ! Water ice geometric mean radius (m)
+      REAL nuice(ngridmx,nlayermx)   ! Estimated effective variance
+                                     !   of the size distribution
+c     Albedo of deposited surface ice
+      !!REAL, PARAMETER :: alb_surfice = 0.4 ! 0.45
+      REAL, PARAMETER :: alb_surfice = 0.45 !!TESTS_JB
+
+      SAVE day_ini, icount
+      SAVE aerosol, tsurf,tsoil
+      SAVE co2ice,albedo,emis, q2
+      SAVE capcal,fluxgrd,dtrad,fluxrad,fluxrad_sky,qsurf
+      SAVE ig_vl1
+
+      REAL stephan   
+      DATA stephan/5.67e-08/  ! Stephan Boltzman constant
+      SAVE stephan
+
+c Local variables :
+c -----------------
+
+      REAL CBRT
+      EXTERNAL CBRT
+
+      CHARACTER*80 fichier 
+      INTEGER l,ig,ierr,igout,iq,i, tapphys
+
+      REAL fluxsurf_lw(ngridmx)      !incident LW (IR) surface flux (W.m-2)
+      REAL fluxsurf_sw(ngridmx,2)    !incident SW (solar) surface flux (W.m-2)
+      REAL fluxtop_lw(ngridmx)       !Outgoing LW (IR) flux to space (W.m-2)
+      REAL fluxtop_sw(ngridmx,2)     !Outgoing SW (solar) flux to space (W.m-2)
+      REAL tauref(ngridmx)           ! Reference column optical depth at 700 Pa
+                                     ! (used if active=F) 
+      REAL tau(ngridmx,naerkind)     ! Column dust optical depth at each point
+      REAL zls                       !  solar longitude (rad)
+      REAL zday                      ! date (time since Ls=0, in martian days)
+      REAL zzlay(ngridmx,nlayermx)   ! altitude at the middle of the layers
+      REAL zzlev(ngridmx,nlayermx+1) ! altitude at layer boundaries
+      REAL latvl1,lonvl1             ! Viking Lander 1 point (for diagnostic)
+
+c     Tendancies due to various processes:
+      REAL dqsurf(ngridmx,nqmx)
+      REAL zdtlw(ngridmx,nlayermx)     ! (K/s)
+      REAL zdtsw(ngridmx,nlayermx)     ! (K/s)
+      REAL cldtlw(ngridmx,nlayermx)     ! (K/s) LW heating rate for clear area
+      REAL cldtsw(ngridmx,nlayermx)     ! (K/s) SW heating rate for clear area
+      REAL zdtnirco2(ngridmx,nlayermx) ! (K/s)
+      REAL zdtnlte(ngridmx,nlayermx)   ! (K/s)
+      REAL zdtsurf(ngridmx)            ! (K/s)
+      REAL zdtcloud(ngridmx,nlayermx)
+      REAL zdvdif(ngridmx,nlayermx),zdudif(ngridmx,nlayermx)  ! (m.s-2)
+      REAL zdhdif(ngridmx,nlayermx), zdtsdif(ngridmx)         ! (K/s)
+      REAL zdvadj(ngridmx,nlayermx),zduadj(ngridmx,nlayermx)  ! (m.s-2)
+      REAL zdhadj(ngridmx,nlayermx)                           ! (K/s)
+      REAL zdtgw(ngridmx,nlayermx)                            ! (K/s)
+      REAL zdugw(ngridmx,nlayermx),zdvgw(ngridmx,nlayermx)    ! (m.s-2)
+      REAL zdtc(ngridmx,nlayermx),zdtsurfc(ngridmx)
+      REAL zdvc(ngridmx,nlayermx),zduc(ngridmx,nlayermx)
+
+      REAL zdqdif(ngridmx,nlayermx,nqmx), zdqsdif(ngridmx,nqmx)
+cc      variables de diagnostiques detendences
+      REAL zdqsdif_diag(ngridmx)
+      REAL zdqssed_diag(ngridmx)
+      REAL pdq_diag(ngridmx)
+cccccc!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      REAL zdqsed(ngridmx,nlayermx,nqmx), zdqssed(ngridmx,nqmx)
+      REAL zdqdev(ngridmx,nlayermx,nqmx), zdqsdev(ngridmx,nqmx)
+      REAL zdqadj(ngridmx,nlayermx,nqmx)
+      REAL zdqc(ngridmx,nlayermx,nqmx)
+      REAL zdqcloud(ngridmx,nlayermx,nqmx)
+      REAL zdqscloud(ngridmx,nqmx)
+      REAL zdqchim(ngridmx,nlayermx,nqmx)
+      REAL zdqschim(ngridmx,nqmx)
+      REAL zdqnorm(ngridmx,nlayermx,2)
+
+      REAL zdteuv(ngridmx,nlayermx)    ! (K/s)
+      REAL zdtconduc(ngridmx,nlayermx) ! (K/s)
+      REAL zdumolvis(ngridmx,nlayermx)
+      REAL zdvmolvis(ngridmx,nlayermx)
+      real zdqmoldiff(ngridmx,nlayermx,nqmx)
+
+c     Local variable for local intermediate calcul:
+      REAL zflubid(ngridmx)
+      REAL zplanck(ngridmx),zpopsk(ngridmx,nlayermx)
+      REAL zdum1(ngridmx,nlayermx)
+      REAL zdum2(ngridmx,nlayermx)
+      REAL ztim1,ztim2,ztim3, z1,z2
+      REAL ztime_fin
+      REAL zdh(ngridmx,nlayermx)
+      INTEGER length
+      PARAMETER (length=100)
+
+c local variables only used for diagnostic (output in file "diagfi" or "stats")
+c -----------------------------------------------------------------------------
+      REAL ps(ngridmx), zt(ngridmx,nlayermx)
+      REAL zu(ngridmx,nlayermx),zv(ngridmx,nlayermx)
+      REAL zq(ngridmx,nlayermx,nqmx)
+      REAL fluxtop_sw_tot(ngridmx), fluxsurf_sw_tot(ngridmx)
+      character*2 str2
+      character*5 str5
+      real zdtdif(ngridmx,nlayermx), zdtadj(ngridmx,nlayermx)
+      REAL ccn(ngridmx,nlayermx)   ! Cloud condensation nuclei
+                                   !   (particules kg-1)
+      SAVE ccn  !! in case iradia != 1 
+      real rdust(ngridmx,nlayermx) ! dust geometric mean radius (m)
+      real qtot1,qtot2 ! total aerosol mass
+      integer igmin, lmin
+      logical tdiag
+
+      real co2col(ngridmx)        ! CO2 column
+      REAL zplev(ngrid,nlayermx+1),zplay(ngrid,nlayermx)
+      REAL zstress(ngrid), cd
+      real hco2(nqmx),tmean, zlocal(nlayermx)
+      real rho(ngridmx,nlayermx)  ! density
+      real vmr(ngridmx,nlayermx)  ! volume mixing ratio
+      REAL mtot(ngridmx)          ! Total mass of water vapor (kg/m2)
+      REAL dustot(ngridmx)        ! Total mass of dust (kg/m2)
+      REAL icetot(ngridmx)        ! Total mass of water ice (kg/m2)
+      REAL rave(ngridmx)          ! Mean water ice effective radius (m)
+      REAL opTES(ngridmx,nlayermx)! abs optical depth at 825 cm-1
+      REAL tauTES(ngridmx)        ! column optical depth at 825 cm-1
+      REAL Qabsice                ! Water ice absorption coefficient
+
+
+      REAL time_phys
+
+c=======================================================================
+#ifdef MESOSCALE
+
+c 1. Initialisation:
+c -----------------
+
+c  1.1   Initialisation only at first call
+c  ---------------------------------------
+      IF (firstcall) THEN
+
+c        variables set to 0
+c        ~~~~~~~~~~~~~~~~~~
+         call zerophys(ngrid*nlayer*naerkind,aerosol)
+         call zerophys(ngrid*nlayer,dtrad)
+         call zerophys(ngrid,fluxrad)
+
+c        read startfi 
+c        ~~~~~~~~~~~~
+ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+c ****WRF
+c 
+c       No need to use startfi.nc
+c               > part of the job of phyetat0 is done in inifis
+c               > remaining initializations are passed here from the WRF variables
+c               > beware, some operations were done by phyetat0 (ex: tracers)
+c                       > if any problems, look in phyetat0
+c
+      tsurf(:)=wtsurf(:)
+      PRINT*,'check: tsurf ',tsurf(1),tsurf(ngridmx)
+      tsoil(:,:)=wtsoil(:,:)
+      PRINT*,'check: tsoil ',tsoil(1,1),tsoil(ngridmx,nsoilmx)
+     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+     !!!new physics
+      inertiedat(:,:)=wisoil(:,:)
+      PRINT*,'check: inert ',inertiedat(1,1),inertiedat(ngridmx,nsoilmx)
+      mlayer(0:nsoilmx-1)=wdsoil(1,:)
+      PRINT*,'check: layer ', mlayer
+            !!!!!!!!!!!!!!!!! DONE in soil_setting.F 
+            ! 1.5 Build layer(); following the same law as mlayer()
+            ! Assuming layer distribution follows mid-layer law:
+            ! layer(k)=lay1*alpha**(k-1)
+            lay1=sqrt(mlayer(0)*mlayer(1))
+            alpha=mlayer(1)/mlayer(0)
+            do iloop=1,nsoilmx
+              layer(iloop)=lay1*(alpha**(iloop-1))
+            enddo
+            !!!!!!!!!!!!!!!!! DONE in soil_setting.F
+      tnom(:)=wtnom(:)   !! est rempli dans advtrac.h
+      PRINT*,'check: tracernames ', tnom
+     !!!new physics
+     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      emis(:)=wemis(:)
+      PRINT*,'check: emis ',emis(1),emis(ngridmx)
+      q2(:,:)=wq2(:,:)
+      PRINT*,'check: q2 ',q2(1,1),q2(ngridmx,nlayermx+1)
+      qsurf(:,:)=wqsurf(:,:)
+      PRINT*,'check: qsurf ',qsurf(1,1),qsurf(ngridmx,nqmx)
+      co2ice(:)=wco2ice(:)
+      PRINT*,'check: co2 ',co2ice(1),co2ice(ngridmx)
+      day_ini=wday_ini
+
+c       artificially filling dyn3d/control.h is also required
+c       > iphysiq is put in WRF to be set easily (cf ptimestep)
+c       > day_step is simply deduced:
+c
+      day_step=daysec/ptimestep
+      PRINT*,'Call to LMD physics:',day_step,' per Martian day'
+c
+      iphysiq=ptimestep
+c
+      ecritphy=wecritphys
+      PRINT*,'Write LMD physics each:',ecritphy,' seconds'
+              !!PRINT*,ecri_phys
+              !!PRINT*,float(ecri_phys) ...
+              !!renvoient tous deux des nombres absurdes
+              !!pourtant callkeys.h est inclus ...
+              !!
+              !!donc ecritphys est passe en argument ...
+      PRINT*,'Write LMD physics each:',ecritphy,' seconds'
+c
+      !DO iq=1, nq 
+      !  PRINT*, tnom(iq), pq(:,:,iq)
+      !ENDDO
+
+c
+c ****WRF
+ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+
+
+
+!! Read netcdf initial physical parameters.
+!         CALL phyetat0 ("startfi.nc",0,0,
+!     &         nsoilmx,nq,
+!     &         day_ini,time_phys,
+!     &         tsurf,tsoil,emis,q2,qsurf,co2ice)
+
+         if (pday.ne.day_ini) then
+           write(*,*) "PHYSIQ: ERROR: bad synchronization between ",
+     &                "physics and dynamics"
+           write(*,*) "dynamics day: ",pday
+           write(*,*) "physics day:  ",day_ini
+           stop
+         endif
+
+         write (*,*) 'In physiq day_ini =', day_ini
+
+c        Initialize albedo and orbital calculation
+c        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         CALL surfini(ngrid,co2ice,qsurf,albedo)
+         CALL iniorbit(aphelie,periheli,year_day,peri_day,obliquit)
+
+c        initialize soil 
+c        ~~~~~~~~~~~~~~~
+         IF (callsoil) THEN
+            CALL soil(ngrid,nsoilmx,firstcall,inertiedat,
+     s          ptimestep,tsurf,tsoil,capcal,fluxgrd)
+         ELSE
+            PRINT*,
+     &     'PHYSIQ WARNING! Thermal conduction in the soil turned off'
+            DO ig=1,ngrid
+               capcal(ig)=1.e5
+               fluxgrd(ig)=0.
+            ENDDO
+         ENDIF
+         icount=1
+
+
+c        initialize tracers
+c        ~~~~~~~~~~~~~~~~~~
+         tracerdyn=tracer
+         IF (tracer) THEN
+            CALL initracer(qsurf,co2ice)
+         ENDIF  ! end tracer
+
+      !!!!!! WRF WRF WRF MARS MARS 
+      !!!!!! TEST TEST TEST TEST  AS+JBM 28/02/11
+      !!!!!! TEST TEST TEST TEST  AS+JBM 28/02/11
+      !!!!!! TEST TEST TEST TEST  AS+JBM 28/02/11
+      !!!! 
+      !!!! principe: une option 'caps=T' specifique au mesoscale
+      !!!! ... en vue d'un meso_initracer ????
+      !!!! 
+      !!!! depots permanents => albedo TES du PDS
+      !!!! depots saisonniers => alb_surfice (~0.4, cf plus bas)
+      !!!!     [!!!! y compris pour les depots saisonniers sur les depots permanents]
+      !!!!
+      !!!! --> todo: il faut garder les depots saisonniers qui viennent
+      !!!!           du GCM lorsqu'ils sont consequents
+      !!!! 
+      IF ( caps .and. (igcm_h2o_ice .ne. 0) ) THEN
+          PRINT *, 'OVERWRITING watercaptag DEFINITION in INITRACER'
+          PRINT *, 'lat>70 et alb>0.26 => watercaptag=T' 
+          !! Perennial H20 north cap defined by watercaptag=true (allows surface to be
+          !! hollowed by sublimation in vdifc).
+          do ig=1,ngridmx
+            qsurf(ig,igcm_h2o_ice)=0.  !! on jette les inputs GCM
+            if ( (lati(ig)*180./pi.gt.70.) .and.
+     .           (albedodat(ig).ge.0.26) )  then
+                    watercaptag(ig)=.true.
+                    dryness(ig) = 1.
+            else
+                    watercaptag(ig)=.false.
+                    dryness(ig) = 1.
+            endif  ! (lati, albedodat)
+          end do ! (ngridmx)
+      ELSE  ! (caps)
+          print *,'Blork !!!'
+          print *,'caps=T avec water=F ????'
+      ENDIF ! (caps)
+      !!!!!! TEST TEST TEST TEST  AS+JBM 28/02/11
+      !!!!!! TEST TEST TEST TEST  AS+JBM 28/02/11
+      !!!!!! TEST TEST TEST TEST  AS+JBM 28/02/11
+
+
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+c ****WRF
+c
+c nosense in mesoscale modeling
+c
+cc        Determining gridpoint near Viking Lander 1 (used for diagnostic only)
+cc        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+c
+c         if(ngrid.ne.1) then
+c           latvl1= 22.27 
+c           lonvl1= -47.94 
+c           ig_vl1= 1+ int( (1.5-(latvl1-90.)*jjm/180.)  -2 )*iim +
+c     &              int(1.5+(lonvl1+180)*iim/360.)
+c           write(*,*) 'Viking Lander 1 GCM point: lat,lon',
+c     &              lati(ig_vl1)*180/pi, long(ig_vl1)*180/pi
+c         end if 
+c ****WRF
+ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+!!!
+!!! WRF WRF WRF commented for smaller executables
+!!!
+!c        Initialize thermospheric parameters
+!c        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!
+!         if (callthermos) call param_read
+
+
+c        Initialize R and Cp as constant
+
+         if (.not.callthermos .and. .not.photochem) then
+                 do l=1,nlayermx
+                  do ig=1,ngridmx
+                   rnew(ig,l)=r
+                   cpnew(ig,l)=cpp
+                   mmean(ig,l)=mugaz
+                   enddo
+                  enddo  
+         endif         
+
+        IF (tracer.AND.water.AND.(ngridmx.NE.1)) THEN
+          write(*,*)"physiq: water_param Surface ice alb:",alb_surfice
+        ENDIF
+                   
+      ENDIF        !  (end of "if firstcall")
+
+
+c ---------------------------------------------------
+c 1.2   Initializations done at every physical timestep:
+c ---------------------------------------------------
+c
+      IF (ngrid.NE.ngridmx) THEN
+         PRINT*,'STOP in PHYSIQ'
+         PRINT*,'Probleme de dimensions :'
+         PRINT*,'ngrid     = ',ngrid
+         PRINT*,'ngridmx   = ',ngridmx
+         STOP
+      ENDIF
+
+c     Initialize various variables
+c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      call zerophys(ngrid*nlayer, pdv)
+      call zerophys(ngrid*nlayer, pdu)
+      call zerophys(ngrid*nlayer, pdt)
+      call zerophys(ngrid*nlayer*nq, pdq)
+      call zerophys(ngrid, pdpsrf)
+      call zerophys(ngrid, zflubid)
+      call zerophys(ngrid, zdtsurf)
+      call zerophys(ngrid*nq, dqsurf)
+      igout=ngrid/2+1 
+
+
+      zday=pday+ptime ! compute time, in sols (and fraction thereof)
+
+c     Compute Solar Longitude (Ls) :
+c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      if (season) then
+         call solarlong(zday,zls)
+      else
+         call solarlong(float(day_ini),zls)
+      end if
+
+c     Compute geopotential at interlayers
+c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+c     ponderation des altitudes au niveau des couches en dp/p
+
+      DO l=1,nlayer
+         DO ig=1,ngrid
+            zzlay(ig,l)=pphi(ig,l)/g
+         ENDDO
+      ENDDO
+      DO ig=1,ngrid
+         zzlev(ig,1)=0.
+         zzlev(ig,nlayer+1)=1.e7    ! dummy top of last layer above 10000 km...
+      ENDDO
+      DO l=2,nlayer
+         DO ig=1,ngrid
+            z1=(pplay(ig,l-1)+pplev(ig,l))/(pplay(ig,l-1)-pplev(ig,l))
+            z2=(pplev(ig,l)+pplay(ig,l))/(pplev(ig,l)-pplay(ig,l))
+            zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2)
+         ENDDO
+      ENDDO
+
+
+!     Potential temperature calculation not the same in physiq and dynamic
+
+c     Compute potential temperature
+c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      DO l=1,nlayer
+         DO ig=1,ngrid 
+            zpopsk(ig,l)=(pplay(ig,l)/pplev(ig,1))**rcp
+            zh(ig,l)=pt(ig,l)/zpopsk(ig,l)
+         ENDDO
+      ENDDO
+
+!!!
+!!! WRF WRF WRF commented for smaller executables
+!!!
+!c-----------------------------------------------------------------------
+!c    1.2.5 Compute mean mass, cp, and R
+!c    --------------------------------
+!
+!      if(photochem.or.callthermos) then
+!         call concentrations(pplay,pt,pdt,pq,pdq,ptimestep)
+!      endif
+
+c-----------------------------------------------------------------------
+c    2. Compute radiative tendencies :
+c------------------------------------
+
+
+      IF (callrad) THEN 
+         zdqnorm(:,:,:) = 0.          
+         IF( MOD(icount-1,iradia).EQ.0) THEN
+
+           write (*,*) 'call radiative transfer'
+
+c          Local Solar zenith angle
+c          ~~~~~~~~~~~~~~~~~~~~~~~~
+           CALL orbite(zls,dist_sol,declin)
+
+           IF(diurnal) THEN
+               ztim1=SIN(declin)
+               ztim2=COS(declin)*COS(2.*pi*(zday-.5))
+               ztim3=-COS(declin)*SIN(2.*pi*(zday-.5))
+
+               CALL solang(ngrid,sinlon,coslon,sinlat,coslat,
+     s         ztim1,ztim2,ztim3, mu0,fract)
+
+           ELSE
+               CALL mucorr(ngrid,declin, lati, mu0, fract,10000.,rad)
+           ENDIF
+
+c          NLTE cooling from CO2 emission
+c          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+           IF(callnlte) CALL nltecool(ngrid,nlayer,pplay,pt,zdtnlte)
+
+c          Find number of layers for LTE radiation calculations
+           IF(MOD(iphysiq*(icount-1),day_step).EQ.0)
+     &          CALL nlthermeq(ngrid,nlayer,pplev,pplay)
+
+c          Note: Dustopacity.F has been transferred to callradite.F
+         
+c          Call main radiative transfer scheme
+c          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+c          Transfer through CO2 (except NIR CO2 absorption)
+c            and aerosols (dust and water ice)
+
+c          Radiative transfer
+c          ------------------
+cc
+cc **WRF: desormais dust_opacity est dans callradite -- modifications
+cc nveaux arguments: tauref,tau,aerosol,rice,nuice
+cc
+           CALL callradite(icount,ngrid,nlayer,nq,zday,zls,pq,albedo,
+     $     emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout,
+     $     zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxtop_sw,
+     &     tauref,tau,aerosol,ccn,rdust,rice,nuice,zdqnorm,dsodust)
+
+
+
+c        write(*,*) icount,ngrid,nlayer,nq,zday,zls,pq,albedo,
+c     $     emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout,
+c     $     zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxtop_sw,
+c     &     tauref,tau,aerosol,rice,nuice
+c        write(*,*) fluxsurf_lw
+
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+ccccc
+ccccc PARAM SLOPE : Insolation (direct + scattered)
+ccccc
+      DO ig=1,ngrid  
+        sl_the = theta_sl(ig)
+        IF (sl_the .ne. 0.) THEN
+         ztim1=fluxsurf_sw(ig,1)+fluxsurf_sw(ig,2)
+          DO l=1,2
+           sl_lct = ptime*24. + 180.*long(ig)/pi/15.
+           sl_ra  = pi*(1.0-sl_lct/12.)
+           sl_lat = 180.*lati(ig)/pi
+           sl_tau = tau(ig,1)
+           sl_alb = albedo(ig,l)
+           sl_psi = psi_sl(ig)
+           sl_fl0 = fluxsurf_sw(ig,l)
+           sl_di0 = 0.
+           if (mu0(ig) .gt. 0.) then
+            sl_di0 = mu0(ig)*(exp(-sl_tau/mu0(ig)))
+            sl_di0 = sl_di0*1370./dist_sol/dist_sol
+            sl_di0 = sl_di0/ztim1
+            sl_di0 = fluxsurf_sw(ig,l)*sl_di0
+           endif
+           ! sait-on jamais (a cause des arrondis)
+           if (sl_fl0 .lt. sl_di0) sl_di0=sl_fl0
+     !!!!!!!!!!!!!!!!!!!!!!!!!!
+        CALL meso_param_slope( mu0(ig), declin, sl_ra, sl_lat, 
+     &            sl_tau, sl_alb, 
+     &            sl_the, sl_psi, sl_di0, sl_fl0, sl_flu)
+     !!!!!!!!!!!!!!!!!!!!!!!!!!
+           fluxsurf_sw(ig,l) = sl_flu
+                !!      sl_ls = 180.*zls/pi
+                !!      sl_lct = ptime*24. + 180.*long(ig)/pi/15.
+                !!      sl_lat = 180.*lati(ig)/pi
+                !!      sl_tau = tau(ig,1)
+                !!      sl_alb = albedo(ig,l)
+                !!      sl_the = theta_sl(ig)
+                !!      sl_psi = psi_sl(ig)
+                !!      sl_fl0 = fluxsurf_sw(ig,l)
+                !!      CALL param_slope_full(sl_ls, sl_lct, sl_lat, 
+                !!     &                   sl_tau, sl_alb, 
+                !!     &                   sl_the, sl_psi, sl_fl0, sl_flu)
+          ENDDO
+          !!! compute correction on IR flux as well
+          sky= (1.+cos(pi*theta_sl(ig)/180.))/2.
+          fluxsurf_lw(ig)= fluxsurf_lw(ig)*sky
+        ENDIF    
+      ENDDO
+ccccc
+ccccc PARAM SLOPE
+ccccc
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+
+c          CO2 near infrared absorption
+c          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+           call zerophys(ngrid*nlayer,zdtnirco2)
+           if (callnirco2) then
+              call nirco2abs (ngrid,nlayer,pplay,dist_sol,
+     .                       mu0,fract,declin, zdtnirco2)
+           endif
+
+c          Radiative flux from the sky absorbed by the surface (W.m-2)
+c          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+           DO ig=1,ngrid
+               fluxrad_sky(ig)=emis(ig)*fluxsurf_lw(ig)
+     $         +fluxsurf_sw(ig,1)*(1.-albedo(ig,1))
+     $         +fluxsurf_sw(ig,2)*(1.-albedo(ig,2))
+
+            !print*,'RAD ', fluxrad_sky(ig)
+            !print*,'LW ', emis(ig)*fluxsurf_lw(ig)
+            !print*,'SW ', fluxsurf_sw(ig,2)*(1.-albedo(ig,2))
+
+           ENDDO
+
+
+c          Net atmospheric radiative heating rate (K.s-1)
+c          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+           IF(callnlte) THEN
+              CALL blendrad(ngrid, nlayer, pplay,
+     &             zdtsw, zdtlw, zdtnirco2, zdtnlte, dtrad)
+           ELSE
+              DO l=1,nlayer
+                 DO ig=1,ngrid
+                    dtrad(ig,l)=zdtsw(ig,l)+zdtlw(ig,l)
+     &                          +zdtnirco2(ig,l)
+                  ENDDO
+              ENDDO
+           ENDIF
+
+
+
+        ENDIF ! of if(mod(icount-1,iradia).eq.0)
+
+c    Transformation of the radiative tendencies:
+c    -------------------------------------------
+
+c          Net radiative surface flux (W.m-2)
+c          ~~~~~~~~~~~~~~~~~~~~~~~~~~
+c
+           DO ig=1,ngrid
+               zplanck(ig)=tsurf(ig)*tsurf(ig)
+               zplanck(ig)=emis(ig)*
+     $         stephan*zplanck(ig)*zplanck(ig)
+               fluxrad(ig)=fluxrad_sky(ig)-zplanck(ig)
+cccc
+cccc param slope
+cccc
+               sky= (1.+cos(pi*theta_sl(ig)/180.))/2.
+               fluxrad(ig)=fluxrad(ig)+(1.-sky)*zplanck(ig)
+cccc
+cccc
+cccc
+           ENDDO
+
+
+         DO l=1,nlayer
+            DO ig=1,ngrid
+               pdt(ig,l)=pdt(ig,l)+dtrad(ig,l)
+            ENDDO
+         ENDDO
+
+      ENDIF ! of IF (callrad)
+
+!!!
+!!! WRF WRF WRF commented for smaller executables
+!!!
+!c-----------------------------------------------------------------------
+!c    3. Gravity wave and subgrid scale topography drag :
+!c    -------------------------------------------------
+!
+!
+!      IF(calllott)THEN
+!
+!        CALL calldrag_noro(ngrid,nlayer,ptimestep,
+!     &                 pplay,pplev,pt,pu,pv,zdtgw,zdugw,zdvgw)
+! 
+!        DO l=1,nlayer
+!          DO ig=1,ngrid
+!            pdv(ig,l)=pdv(ig,l)+zdvgw(ig,l)
+!            pdu(ig,l)=pdu(ig,l)+zdugw(ig,l)
+!            pdt(ig,l)=pdt(ig,l)+zdtgw(ig,l)
+!          ENDDO
+!        ENDDO
+!      ENDIF
+
+c-----------------------------------------------------------------------
+c    4. Vertical diffusion (turbulent mixing):
+c    -----------------------------------------
+c
+      IF (calldifv) THEN
+
+
+         DO ig=1,ngrid
+            zflubid(ig)=fluxrad(ig)+fluxgrd(ig)
+            !write (*,*), fluxrad(ig), fluxgrd(ig), zflubid(ig) 
+         ENDDO
+
+         CALL zerophys(ngrid*nlayer,zdum1)
+         CALL zerophys(ngrid*nlayer,zdum2)
+         do l=1,nlayer
+            do ig=1,ngrid
+               zdh(ig,l)=pdt(ig,l)/zpopsk(ig,l)
+            enddo
+         enddo
+         
+c        Calling vdif (Martian version WITH CO2 condensation)
+         CALL vdifc(ngrid,nlayer,nq,co2ice,zpopsk,
+     $        ptimestep,capcal,lwrite,
+     $        pplay,pplev,zzlay,zzlev,z0,
+     $        pu,pv,zh,pq,tsurf,emis,qsurf,
+     $        zdum1,zdum2,zdh,pdq,zflubid,
+     $        zdudif,zdvdif,zdhdif,zdtsdif,q2,
+     &        zdqdif,zdqsdif)
+
+         DO ig=1,ngrid
+          !! sensible heat flux in W/m2
+          hfx(ig) = zflubid(ig)-capcal(ig)*zdtsdif(ig)
+          !! u star in similarity theory in m/s
+          ust(ig) = 0.4
+     .               * sqrt( pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) )
+     .               / log( 1.E+0 + zzlay(ig,1)/z0 )
+         ENDDO   
+
+!         write (*,*) 'PHYS HFX cp zdts', hfx(100), zflubid(100), 
+!     .       capcal(100), 
+!     .       zdtsdif(100)
+!         write (*,*) 'PHYS UST', ust(100) 
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!! LES LES 
+       IF (flag_LES) THEN        
+
+         write (*,*) '************************************************' 
+         write (*,*) '** LES mode: the difv part is only used to'
+         write (*,*) '**  provide HFX and UST to the dynamics'
+         write (*,*) '** NB: - dudif, dvdif, dhdif, dqdif are set to 0'
+         write (*,*) '**     - tsurf is updated'     
+         write (*,*) '************************************************'
+
+!!!
+!!! WRF WRF LES LES : en fait le subgrid scale n'etait pas mis a zero !!
+!!!         
+         DO ig=1,ngrid
+!          !! sensible heat flux in W/m2
+!          hfx(ig) = zflubid(ig)-capcal(ig)*zdtsdif(ig)
+!          !! u star in similarity theory in m/s
+!          ust(ig) = 0.4
+!     .               * sqrt( pu(ig,1)*pu(ig,1) + pv(ig,1)*pv(ig,1) )
+!     .               / log( 1.E+0 + zzlay(ig,1)/z0 )
+!
+          DO l=1,nlayer
+            zdvdif(ig,l) = 0.
+            zdudif(ig,l) = 0.
+            zdhdif(ig,l) = 0.
+            DO iq=1, nq
+              zdqdif(ig,l,iq) = 0.
+              zdqsdif(ig,iq) = 0. !! sortir de la boucle
+            ENDDO 
+          ENDDO
+!
+         ENDDO
+         !write (*,*) 'RAD ',fluxrad(igout)
+         !write (*,*) 'GRD ',fluxgrd(igout)
+         !write (*,*) 'dTs/dt ',capcal(igout)*zdtsurf(igout)
+         !write (*,*) 'HFX ', hfx(igout)
+         !write (*,*) 'UST ', ust(igout)
+      ENDIF
+!!! LES LES        
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+         DO l=1,nlayer
+            DO ig=1,ngrid
+               pdv(ig,l)=pdv(ig,l)+zdvdif(ig,l)
+               pdu(ig,l)=pdu(ig,l)+zdudif(ig,l)
+               pdt(ig,l)=pdt(ig,l)+zdhdif(ig,l)*zpopsk(ig,l)
+
+               zdtdif(ig,l)=zdhdif(ig,l)*zpopsk(ig,l) ! for diagnostic only
+
+            ENDDO
+         ENDDO
+
+         DO ig=1,ngrid
+            zdtsurf(ig)=zdtsurf(ig)+zdtsdif(ig)
+         ENDDO
+
+         if (tracer) then 
+           DO iq=1, nq
+            DO l=1,nlayer
+              DO ig=1,ngrid
+                 pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqdif(ig,l,iq)
+             ENDDO
+            ENDDO
+           ENDDO
+
+           DO iq=1, nq
+              DO ig=1,ngrid
+                 dqsurf(ig,iq)=dqsurf(ig,iq) + zdqsdif(ig,iq)
+              ENDDO
+           ENDDO
+!truc ajouté pour vérifier la conservation.
+              DO ig=1,ngrid
+                 zdqsdif_diag(ig)=zdqsdif(ig,igcm_dust_mass)*3.6e9
+              ENDDO
+         end if ! of if (tracer)
+
+      ELSE    
+         DO ig=1,ngrid
+            zdtsurf(ig)=zdtsurf(ig)+
+     &      (fluxrad(ig)+fluxgrd(ig))/capcal(ig)
+         ENDDO
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+         IF (flag_LES) THEN
+            write(*,*) 'LES mode !' 
+            write(*,*) 'Please set calldifv to T in callphys.def'
+            STOP
+         ENDIF
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ENDIF ! of IF (calldifv)
+
+
+c-----------------------------------------------------------------------
+c   5. Dry convective adjustment:
+c   -----------------------------
+
+      IF(calladj) THEN
+
+         DO l=1,nlayer
+            DO ig=1,ngrid
+               zdh(ig,l)=pdt(ig,l)/zpopsk(ig,l)
+            ENDDO
+         ENDDO
+         CALL zerophys(ngrid*nlayer,zduadj)
+         CALL zerophys(ngrid*nlayer,zdvadj)
+         CALL zerophys(ngrid*nlayer,zdhadj)
+
+         CALL convadj(ngrid,nlayer,nq,ptimestep,
+     $                pplay,pplev,zpopsk,
+     $                pu,pv,zh,pq,
+     $                pdu,pdv,zdh,pdq,
+     $                zduadj,zdvadj,zdhadj,
+     $                zdqadj)
+
+         DO l=1,nlayer
+            DO ig=1,ngrid
+               pdu(ig,l)=pdu(ig,l)+zduadj(ig,l)
+               pdv(ig,l)=pdv(ig,l)+zdvadj(ig,l)
+               pdt(ig,l)=pdt(ig,l)+zdhadj(ig,l)*zpopsk(ig,l)
+
+               zdtadj(ig,l)=zdhadj(ig,l)*zpopsk(ig,l) ! for diagnostic only
+            ENDDO
+         ENDDO
+
+         if(tracer) then 
+           DO iq=1, nq
+            DO l=1,nlayer
+              DO ig=1,ngrid
+                 pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqadj(ig,l,iq) 
+              ENDDO
+            ENDDO
+           ENDDO
+         end if
+      ENDIF ! of IF(calladj)
+
+c-----------------------------------------------------------------------
+c   6. Carbon dioxide condensation-sublimation:
+c   -------------------------------------------
+
+      IF (callcond) THEN
+         CALL newcondens(ngrid,nlayer,nq,ptimestep,
+     $              capcal,pplay,pplev,tsurf,pt,
+     $              pphi,pdt,pdu,pdv,zdtsurf,pu,pv,pq,pdq,
+     $              co2ice,albedo,emis,
+     $              zdtc,zdtsurfc,pdpsrf,zduc,zdvc,zdqc,
+     $	            fluxsurf_sw,zls) 
+
+         DO l=1,nlayer
+           DO ig=1,ngrid
+             pdt(ig,l)=pdt(ig,l)+zdtc(ig,l)
+             pdv(ig,l)=pdv(ig,l)+zdvc(ig,l)
+             pdu(ig,l)=pdu(ig,l)+zduc(ig,l)
+           ENDDO
+         ENDDO
+         DO ig=1,ngrid
+            zdtsurf(ig) = zdtsurf(ig) + zdtsurfc(ig)
+!!!**WRF: newphys: ici la pression n'est plus mise a jour ds le GCM
+!!!**WRF: mais il faut retablir ca dans le cas du mesoscale ?
+!!!**WRF: ...non probablement OK
+!            ps(ig)=pplev(ig,1) + pdpsrf(ig)*ptimestep
+         ENDDO
+
+         IF (tracer) THEN
+           DO iq=1, nq
+            DO l=1,nlayer
+              DO ig=1,ngrid
+                pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqc(ig,l,iq) 
+              ENDDO
+            ENDDO
+           ENDDO
+         ENDIF ! of IF (tracer)
+
+      ENDIF  ! of IF (callcond)
+
+c-----------------------------------------------------------------------
+c   7. Specific parameterizations for tracers 
+c:   -----------------------------------------
+
+      if (tracer) then 
+
+c   7a. Water and ice
+c     ---------------
+
+c        ---------------------------------------
+c        Water ice condensation in the atmosphere
+c        ----------------------------------------
+         IF (water) THEN
+
+c **WRF: new arguments here rnuclei,rice,nuice
+c  plus no more iqmin +igcm_h2o_vap replaces iq, what are the consequences?
+c  checks needed when tracers simulations
+
+           call watercloud(ngrid,nlayer,ptimestep,
+     &                pplev,pplay,pdpsrf,zzlev,zzlay, pt,pdt,
+     &                pq,pdq,zdqcloud,zdqscloud,zdtcloud,
+     &                nq,naerkind,tau,
+     &                ccn,rdust,rice,nuice)
+           if (activice) then
+c Temperature variation due to latent heat release
+           DO l=1,nlayer
+             DO ig=1,ngrid
+               pdt(ig,l)=pdt(ig,l)+zdtcloud(ig,l)
+             ENDDO
+           ENDDO
+           endif
+
+! increment water vapour and ice atmospheric tracers tendencies
+           IF (water) THEN
+             DO l=1,nlayer
+               DO ig=1,ngrid
+                 pdq(ig,l,igcm_h2o_vap)=pdq(ig,l,igcm_h2o_vap)+
+     &                                   zdqcloud(ig,l,igcm_h2o_vap)
+                 pdq(ig,l,igcm_h2o_ice)=pdq(ig,l,igcm_h2o_ice)+
+     &                                   zdqcloud(ig,l,igcm_h2o_ice)
+               ENDDO
+             ENDDO
+           ENDIF ! of IF (water) THEN
+! Increment water ice surface tracer tendency
+         DO ig=1,ngrid
+           dqsurf(ig,igcm_h2o_ice)=dqsurf(ig,igcm_h2o_ice)+
+     &                               zdqscloud(ig,igcm_h2o_ice)
+         ENDDO
+         
+         END IF  ! of IF (water)
+
+c   7b. Chemical species
+c     ------------------
+
+!!!
+!!! WRF WRF WRF commented for smaller executables
+!!!
+!c        --------------
+!c        photochemistry :
+!c        --------------
+!         IF (photochem .or. thermochem) then
+!          call calchim(ptimestep,pplay,pplev,pt,pdt,dist_sol,mu0,
+!     &      zzlay,zday,pq,pdq,rice,
+!     &      zdqchim,zdqschim,zdqcloud,zdqscloud)
+!!NB: Photochemistry includes condensation of H2O2
+!
+!           ! increment values of tracers:
+!           DO iq=1,nq ! loop on all tracers; tendencies for non-chemistry
+!                      ! tracers is zero anyways
+!             DO l=1,nlayer
+!               DO ig=1,ngrid
+!                 pdq(ig,l,iq)=pdq(ig,l,iq)+zdqchim(ig,l,iq)
+!               ENDDO
+!             ENDDO
+!           ENDDO ! of DO iq=1,nq
+!           ! add condensation tendency for H2O2
+!           if (igcm_h2o2.ne.0) then
+!             DO l=1,nlayer
+!               DO ig=1,ngrid
+!                 pdq(ig,l,igcm_h2o2)=pdq(ig,l,igcm_h2o2)
+!     &                                +zdqcloud(ig,l,igcm_h2o2)
+!               ENDDO
+!             ENDDO
+!           endif
+!
+!           ! increment surface values of tracers:
+!           DO iq=1,nq ! loop on all tracers; tendencies for non-chemistry
+!                      ! tracers is zero anyways
+!             DO ig=1,ngrid
+!               dqsurf(ig,iq)=dqsurf(ig,iq)+zdqschim(ig,iq)
+!             ENDDO
+!           ENDDO ! of DO iq=1,nq
+!           ! add condensation tendency for H2O2
+!           if (igcm_h2o2.ne.0) then
+!             DO ig=1,ngrid
+!               dqsurf(ig,igcm_h2o2)=dqsurf(ig,igcm_h2o2)
+!     &                                +zdqscloud(ig,igcm_h2o2)
+!             ENDDO
+!           endif
+!
+!         END IF  ! of IF (photochem.or.thermochem)
+
+c   7c. Aerosol particles
+c     -------------------
+
+c        ----------
+c        Dust devil :
+c        ----------
+         IF(callddevil) then 
+           call dustdevil(ngrid,nlayer,nq, pplev,pu,pv,pt, tsurf,q2,
+     &                zdqdev,zdqsdev)
+ 
+           if (dustbin.ge.1) then
+              do iq=1,nq
+                 DO l=1,nlayer
+                    DO ig=1,ngrid
+                       pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqdev(ig,l,iq)
+                    ENDDO
+                 ENDDO
+              enddo
+              do iq=1,nq
+                 DO ig=1,ngrid
+                    dqsurf(ig,iq)= dqsurf(ig,iq) + zdqsdev(ig,iq)
+                 ENDDO
+              enddo
+           endif  ! of if (dustbin.ge.1)
+
+         END IF ! of IF (callddevil)
+
+c        ------------- 
+c        Sedimentation :   acts also on water ice
+c        ------------- 
+         IF (sedimentation) THEN 
+           !call zerophys(ngrid*nlayer*nq, zdqsed)
+           zdqsed(1:ngrid,1:nlayer,1:nq)=0
+           !call zerophys(ngrid*nq, zdqssed)
+           zdqssed(1:ngrid,1:nq)=0
+
+c
+c **WRF: new arguments rnuclei, rice, need checks
+c
+           call callsedim(ngrid,nlayer, ptimestep,
+     &                pplev,zzlev, pt, rdust, rice,
+     &                pq, pdq, zdqsed, zdqssed,nq)
+           DO iq=1, nq
+             DO l=1,nlayer
+               DO ig=1,ngrid
+                    pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqsed(ig,l,iq)
+               ENDDO
+             ENDDO
+           ENDDO
+           DO iq=1, nq
+             DO ig=1,ngrid
+                dqsurf(ig,iq)= dqsurf(ig,iq) + zdqssed(ig,iq)
+             ENDDO
+           ENDDO
+             DO ig=1,ngrid
+              zdqssed_diag(ig)= zdqssed(ig,igcm_dust_mass)*3.6e9
+             ENDDO
+         END IF   ! of IF (sedimentation)
+
+
+c   7d. Updates
+c     ---------
+
+        DO iq=1, nq
+          DO ig=1,ngrid
+
+c       ---------------------------------
+c       Updating tracer budget on surface
+c       ---------------------------------
+            qsurf(ig,iq)=qsurf(ig,iq)+ptimestep*dqsurf(ig,iq)
+
+          ENDDO  ! (ig)
+        ENDDO    ! (iq)
+
+      endif !  of if (tracer) 
+
+!!!
+!!! WRF WRF WRF commented for smaller executables
+!!!
+!c-----------------------------------------------------------------------
+!c   8. THERMOSPHERE CALCULATION
+!c-----------------------------------------------------------------------
+!
+!      if (callthermos) then
+!        call thermosphere(pplev,pplay,dist_sol,
+!     $     mu0,ptimestep,ptime,zday,tsurf,zzlev,zzlay,
+!     &     pt,pq,pu,pv,pdt,pdq,
+!     $     zdteuv,zdtconduc,zdumolvis,zdvmolvis,zdqmoldiff)
+!
+!        DO l=1,nlayer
+!          DO ig=1,ngrid
+!            dtrad(ig,l)=dtrad(ig,l)+zdteuv(ig,l)
+!            pdt(ig,l)=pdt(ig,l)+zdtconduc(ig,l)
+!     &                         +zdteuv(ig,l)
+!            pdv(ig,l)=pdv(ig,l)+zdvmolvis(ig,l)
+!            pdu(ig,l)=pdu(ig,l)+zdumolvis(ig,l)
+!            DO iq=1, nq
+!              pdq(ig,l,iq)=pdq(ig,l,iq)+zdqmoldiff(ig,l,iq)
+!            ENDDO
+!          ENDDO
+!        ENDDO
+!
+!      endif ! of if (callthermos)
+
+c-----------------------------------------------------------------------
+c   9. Surface  and sub-surface soil temperature
+c-----------------------------------------------------------------------
+c
+c
+c   9.1 Increment Surface temperature:
+c   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+      DO ig=1,ngrid
+         tsurf(ig)=tsurf(ig)+ptimestep*zdtsurf(ig) 
+      ENDDO
+
+ccc
+ccc  **WRF very specific to GCM
+ccc
+c  Prescribe a cold trap at south pole (except at high obliquity !!)
+c  Temperature at the surface is set there to be the temperature
+c  corresponding to equilibrium temperature between phases of CO2
+
+      IF (tracer.AND.water.AND.(ngridmx.NE.1)) THEN
+!         if (caps.and.(obliquit.lt.27.)) then
+!           ! NB: Updated surface pressure, at grid point 'ngrid', is
+!           !     ps(ngrid)=pplev(ngrid,1)+pdpsrf(ngrid)*ptimestep
+!           tsurf(ngrid)=1./(1./136.27-r/5.9e+5*alog(0.0095*
+!     &                     (pplev(ngrid,1)+pdpsrf(ngrid)*ptimestep)))
+!         endif
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!! note WRF MESOSCALE AYMERIC -- mot cle "caps"
+!!!!! watercaptag n'est plus utilise que dans vdifc
+!!!!! ... pour que la sublimation ne soit pas stoppee 
+!!!!! ... dans la calotte permanente nord si qsurf=0
+!!!!! on desire garder cet effet regle par caps=T
+!!!!! on a donc commente "if (caps.and.(obliquit.lt.27.))" ci-dessus
+!!!!! --- remplacer ces lignes par qqch de plus approprie
+!!!!!      si on s attaque a la calotte polaire sud
+!!!!! pas d'autre occurrence majeure du mot-cle "caps"
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+c       -------------------------------------------------------------
+c       Change of surface albedo (set to 0.4) in case of ground frost
+c       everywhere except on the north permanent cap and in regions
+c       covered by dry ice. 
+c              ALWAYS PLACE these lines after newcondens !!!
+c       -------------------------------------------------------------
+c
+c **WRF : OK avec le mesoscale, pas d'indices bizarres au pole
+c
+         do ig=1,ngrid
+           if ((co2ice(ig).eq.0).and.
+     &        (qsurf(ig,igcm_h2o_ice).gt.0.005)) then
+              albedo(ig,1) = alb_surfice
+              albedo(ig,2) = alb_surfice
+           endif
+         enddo  ! of do ig=1,ngrid
+      ENDIF  ! of IF (tracer.AND.water.AND.(ngridmx.NE.1))
+
+c
+c   9.2 Compute soil temperatures and subsurface heat flux:
+c   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      IF (callsoil) THEN
+         CALL soil(ngrid,nsoilmx,.false.,inertiedat,
+     &          ptimestep,tsurf,tsoil,capcal,fluxgrd)
+      ENDIF
+c-----------------------------------------------------------
+c   10. Ajout tache de poussière ou 'dust bomb propagative perturbation'
+c------------------------------------------------------------
+            DO l=1,nlayer
+              DO ig=1,ngrid
+
+
+                     pdq(ig,l,igcm_dust_mass)=pdq(ig,l,igcm_dust_mass)+
+     &                                         zdqnorm(ig,l,1)
+                     pdq(ig,l,igcm_dust_number)=
+     &                                       pdq(ig,l,igcm_dust_number) 
+     &                                        +zdqnorm(ig,l,2)
+              ENDDO
+            ENDDO
+
+
+!truc ajouté pour vérifier la conservation.
+           DO l=1,nlayer
+              DO ig=1,ngrid
+                  pdq_diag(ig)=0.
+                  pdq_diag(ig)=pdq_diag(ig) +
+     &                         pdq(ig,l,igcm_dust_mass)*3.6e9
+     &                      *  (pplev(ig,l) - pplev(ig,l+1)) / g
+              ENDDO
+           ENDDO
+
+
+
+c-----------------------------------------------------------------------
+c  11. Write output files
+c  ----------------------
+
+c    -------------------------------
+c    Dynamical fields incrementation
+c    -------------------------------
+c (FOR OUTPUT ONLY : the actual model integration is performed in the dynamics)
+      ! temperature, zonal and meridional wind
+      DO l=1,nlayer
+        DO ig=1,ngrid
+          zt(ig,l)=pt(ig,l)  + pdt(ig,l)*ptimestep
+          zu(ig,l)=pu(ig,l)  + pdu(ig,l)*ptimestep
+          zv(ig,l)=pv(ig,l)  + pdv(ig,l)*ptimestep
+        ENDDO
+      ENDDO
+
+      ! tracers
+      DO iq=1, nq
+        DO l=1,nlayer
+          DO ig=1,ngrid
+            zq(ig,l,iq)=pq(ig,l,iq) +pdq(ig,l,iq)*ptimestep
+          ENDDO
+        ENDDO
+      ENDDO
+
+      ! surface pressure
+      DO ig=1,ngrid
+          ps(ig)=pplev(ig,1) + pdpsrf(ig)*ptimestep
+      ENDDO
+
+      ! pressure
+      DO l=1,nlayer
+        DO ig=1,ngrid
+             zplev(ig,l)=pplev(ig,l)/pplev(ig,1)*ps(ig)
+             zplay(ig,l)=pplay(ig,l)/pplev(ig,1)*ps(ig)
+        ENDDO
+      ENDDO
+
+      ! Density 
+      DO l=1,nlayer
+         DO ig=1,ngrid
+            rho(ig,l) = zplay(ig,l)/(rnew(ig,l)*zt(ig,l))
+         ENDDO
+      ENDDO
+
+c    Compute surface stress : (NB: z0 is a common in planete.h)
+c     DO ig=1,ngrid
+c        cd = (0.4/log(zzlay(ig,1)/z0))**2
+c        zstress(ig) = rho(ig,1)*cd*(zu(ig,1)**2 + zv(ig,1)**2)
+c     ENDDO
+
+c     Sum of fluxes in solar spectral bands (for output only)
+      DO ig=1,ngrid
+	     fluxtop_sw_tot(ig)=fluxtop_sw(ig,1) + fluxtop_sw(ig,2)
+	     fluxsurf_sw_tot(ig)=fluxsurf_sw(ig,1) + fluxsurf_sw(ig,2)
+      ENDDO
+c ******* TEST ******************************************************
+      ztim1 = 999
+      DO l=1,nlayer
+        DO ig=1,ngrid
+           if (pt(ig,l).lt.ztim1) then
+               ztim1 = pt(ig,l)
+               igmin = ig
+               lmin = l 
+           end if
+        ENDDO
+      ENDDO
+      if(min(pt(igmin,lmin),zt(igmin,lmin)).lt.70.) then	
+        write(*,*) 'PHYSIQ: stability WARNING :'
+        write(*,*) 'pt, zt Tmin = ', pt(igmin,lmin), zt(igmin,lmin),
+     &              'ig l =', igmin, lmin
+      end if
+c *******************************************************************
+
+c     ---------------------
+c     Outputs to the screen 
+c     ---------------------
+
+      IF (lwrite) THEN
+         PRINT*,'Global diagnostics for the physics'
+         PRINT*,'Variables and their increments x and dx/dt * dt'
+         WRITE(*,'(a6,a10,2a15)') 'Ts','dTs','ps','dps'
+         WRITE(*,'(2f10.5,2f15.5)')
+     s   tsurf(igout),zdtsurf(igout)*ptimestep,
+     s   pplev(igout,1),pdpsrf(igout)*ptimestep
+         WRITE(*,'(a4,a6,5a10)') 'l','u','du','v','dv','T','dT'
+         WRITE(*,'(i4,6f10.5)') (l,
+     s   pu(igout,l),pdu(igout,l)*ptimestep,
+     s   pv(igout,l),pdv(igout,l)*ptimestep,
+     s   pt(igout,l),pdt(igout,l)*ptimestep,
+     s   l=1,nlayer)
+      ENDIF ! of IF (lwrite)
+
+      IF (ngrid.NE.1) THEN
+         print*,'Ls =',zls*180./pi,
+     &   ' tauref(700 Pa,lat=0) =',tauref(ngrid/2)!,
+!     &   ' tau(Viking1) =',tau(ig_vl1,1)
+
+
+c        -------------------------------------------------------------------
+c        Writing NetCDF file  "RESTARTFI" at the end of the run
+c        -------------------------------------------------------------------
+c        Note: 'restartfi' is stored just before dynamics are stored
+c              in 'restart'. Between now and the writting of 'restart',
+c              there will have been the itau=itau+1 instruction and
+c              a reset of 'time' (lastacll = .true. when itau+1= itaufin)
+c              thus we store for time=time+dtvr
+
+
+!!!
+!!! WRF WRF WRF WRF
+!!!
+!         IF(lastcall) THEN
+!            ztime_fin = ptime + ptimestep/(float(iphysiq)*daysec) 
+!            write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin
+!            call physdem1("restartfi.nc",long,lati,nsoilmx,nq,
+!     .              ptimestep,pday,
+!     .              ztime_fin,tsurf,tsoil,co2ice,emis,q2,qsurf,
+!     .              area,albedodat,inertiedat,zmea,zstd,zsig,
+!     .              zgam,zthe)
+!         ENDIF
+
+
+
+c        -------------------------------------------------------------------
+c        Calculation of diagnostic variables written in both stats and
+c          diagfi files
+c        -------------------------------------------------------------------
+             call zerophys(ngrid,dustot)
+
+             do ig=1,ngrid
+               do l=1,nlayermx
+
+                 dustot(ig) = dustot(ig) +
+     &                        zq(ig,l,igcm_dust_mass)
+     &                      *  (pplev(ig,l) - pplev(ig,l+1)) / g
+               enddo
+             enddo
+
+         if (tracer) then
+           if (water) then
+
+!!
+!!***WRF: ok, des nouveaux trucs cools de la nouvelle physique
+!!
+             call zerophys(ngrid,mtot)
+             call zerophys(ngrid,icetot)
+             call zerophys(ngrid,rave)
+             call zerophys(ngrid,tauTES)
+             do ig=1,ngrid 
+               do l=1,nlayermx
+                 mtot(ig) = mtot(ig) + 
+     &                      zq(ig,l,igcm_h2o_vap) * 
+     &                      (pplev(ig,l) - pplev(ig,l+1)) / g
+                 icetot(ig) = icetot(ig) + 
+     &                        zq(ig,l,igcm_h2o_ice) * 
+     &                        (pplev(ig,l) - pplev(ig,l+1)) / g
+                 rave(ig) = rave(ig) + 
+     &                      zq(ig,l,igcm_h2o_ice) *
+     &                      (pplev(ig,l) - pplev(ig,l+1)) / g * 
+     &                      rice(ig,l) * (1.+nuice_ref)
+c                Computing abs optical depth at 825 cm-1 in each
+c                  layer to simulate NEW TES retrieval
+                 Qabsice = min(
+     &             max(0.4e6*rice(ig,l)*(1.+nuice_ref)-0.05 ,0.),1.2
+     &                        )
+                 opTES(ig,l)= 0.75 * Qabsice * 
+     &             zq(ig,l,igcm_h2o_ice) *
+     &             (pplev(ig,l) - pplev(ig,l+1)) / g
+     &             / (rho_ice * rice(ig,l) * (1.+nuice_ref))
+                 tauTES(ig)=tauTES(ig)+ opTES(ig,l) 
+               enddo
+               rave(ig)=rave(ig)/max(icetot(ig),1.e-30)
+               if (icetot(ig)*1e3.lt.0.01) rave(ig)=0.
+             enddo
+
+           endif ! of if (water)
+         endif ! of if (tracer)
+
+c        -----------------------------------------------------------------
+c        WSTATS: Saving statistics
+c        -----------------------------------------------------------------
+c        ("stats" stores and accumulates 8 key variables in file "stats.nc"
+c        which can later be used to make the statistic files of the run:
+c        "stats")          only possible in 3D runs !
+
+         
+         IF (callstats) THEN
+
+           write(*,*) 'callstats' 
+
+!           call wstats(ngrid,"ps","Surface pressure","Pa",2,ps)
+!           call wstats(ngrid,"tsurf","Surface temperature","K",2,tsurf)
+!           call wstats(ngrid,"co2ice","CO2 ice cover",
+!     &                "kg.m-2",2,co2ice)
+!           call wstats(ngrid,"fluxsurf_lw",
+!     &                "Thermal IR radiative flux to surface","W.m-2",2,
+!     &                fluxsurf_lw)
+!           call wstats(ngrid,"fluxsurf_sw",
+!     &                "Solar radiative flux to surface","W.m-2",2,
+!     &                fluxsurf_sw_tot)
+!           call wstats(ngrid,"fluxtop_lw",
+!     &                "Thermal IR radiative flux to space","W.m-2",2,
+!     &                fluxtop_lw)
+!           call wstats(ngrid,"fluxtop_sw",
+!     &                "Solar radiative flux to space","W.m-2",2,
+!     &                fluxtop_sw_tot)
+!           call wstats(ngrid,"taudustvis",
+!     &                    "Dust optical depth"," ",2,tau(1,1))
+!           call wstats(ngrid,"temp","Atmospheric temperature","K",3,zt)
+!           call wstats(ngrid,"u","Zonal (East-West) wind","m.s-1",3,zu)
+!           call wstats(ngrid,"v","Meridional (North-South) wind",
+!     &                "m.s-1",3,zv)
+!c          call wstats(ngrid,"w","Vertical (down-up) wind",
+!c    &                "m.s-1",3,pw)
+!           call wstats(ngrid,"rho","Atmospheric density","none",3,rho)
+!c          call wstats(ngrid,"pressure","Pressure","Pa",3,pplay)
+!c          call wstats(ngrid,"q2",
+!c    &                "Boundary layer eddy kinetic energy",
+!c    &                "m2.s-2",3,q2)
+!c          call wstats(ngrid,"emis","Surface emissivity","w.m-1",2,
+!c    &                emis)
+!c          call wstats(ngrid,"ssurf","Surface stress","N.m-2",
+!c    &                2,zstress)
+!
+!           if (tracer) then
+!             if (water) then
+!               vmr=zq(1:ngridmx,1:nlayermx,igcm_h2o_vap)
+!     &                  *mugaz/mmol(igcm_h2o_vap)
+!               call wstats(ngrid,"vmr_h2ovapor",
+!     &                    "H2O vapor volume mixing ratio","mol/mol",
+!     &                    3,vmr)
+!               vmr=zq(1:ngridmx,1:nlayermx,igcm_h2o_ice)
+!     &                  *mugaz/mmol(igcm_h2o_ice)
+!               call wstats(ngrid,"vmr_h2oice",
+!     &                    "H2O ice volume mixing ratio","mol/mol",
+!     &                    3,vmr)
+!
+!               call wstats(ngrid,"mtot",
+!     &                    "total mass of water vapor","kg/m2",
+!     &                    2,mtot)
+!               call wstats(ngrid,"icetot",
+!     &                    "total mass of water ice","kg/m2",
+!     &                    2,icetot)
+!c              If activice is true, tauTES is computed in aeropacity.F;
+!               if (.not.activice) then
+!                 call wstats(ngrid,"tauTES",
+!     &                    "tau abs 825 cm-1","",
+!     &                    2,tauTES)
+!               endif ! of if (activice)
+!
+!             endif ! of if (water)
+!
+!             if (thermochem.or.photochem) then
+!                do iq=1,nq
+!                   if ((noms(iq).eq."o").or.(noms(iq).eq."co2").or.
+!     .                (noms(iq).eq."co").or.(noms(iq).eq."n2").or.
+!     .                (noms(iq).eq."h2").or.
+!     .                (noms(iq).eq."o3")) then
+!                        do l=1,nlayer
+!                          do ig=1,ngrid
+!                            vmr(ig,l)=zq(ig,l,iq)*mmean(ig,l)/mmol(iq)
+!                          end do
+!                        end do
+!                        call wstats(ngrid,"vmr_"//trim(noms(iq)),
+!     .                     "Volume mixing ratio","mol/mol",3,vmr)
+!                   endif
+!                enddo
+!             endif ! of if (thermochem.or.photochem)
+!
+!           endif ! of if (tracer)
+!
+!           IF(lastcall) THEN
+!             write (*,*) "Writing stats..."
+!             call mkstats(ierr)
+!           ENDIF
+
+         ENDIF !if callstats
+
+c        (Store EOF for Mars Climate database software)
+         IF (calleofdump) THEN
+            CALL eofdump(ngrid, nlayer, zu, zv, zt, rho, ps)
+         ENDIF
+
+ccc**************** WRF OUTPUT **************************
+ccc**************** WRF OUTPUT **************************
+ccc**************** WRF OUTPUT **************************
+      !do ig=1,ngrid
+      !   wtsurf(ig) = tsurf(ig)    !! surface temperature
+      !   wco2ice(ig) = co2ice(ig)  !! co2 ice 
+      !
+      !   !!! specific to WRF WRF WRF
+      !   !!! just to output water ice on surface
+      !   !!! uncomment the Registry entry
+      !   IF (igcm_h2o_ice .ne. 0) qsurfice(ig) = qsurf(ig,igcm_h2o_ice)
+      !
+      !   !!! "VMR_ICE"   "VOL. MIXING RATIO ICE"           "ppm"
+      !   IF (igcm_h2o_ice .ne. 0) THEN
+      !     vmr=zq(1:ngridmx,1:nlayermx,igcm_h2o_ice)*mugaz/mmol(igcm_h2o_ice)
+      !   ENDIF
+      !
+      !enddo
+      TAU_lay(:)=tau(:,1)!!c'est le tau qui évolue
+       wtsurf(1:ngrid) = tsurf(1:ngrid)    !! surface temperature
+      wco2ice(1:ngrid) = co2ice(1:ngrid)  !! co2 ice
+      mtot(1:ngrid) = mtot(1:ngrid) * 1.e6 / rho_ice
+c**********pour avoir qte poussière en surface****************
+      IF (igcm_dust_mass .ne. 0) THEN
+        qsurfice_dust(1:ngrid) = qsurf(1:ngrid,igcm_dust_mass)
+      ENDIF
+c******************************************************************
+      IF (igcm_h2o_ice .ne. 0) THEN      
+        qsurfice(1:ngrid) = qsurf(1:ngrid,igcm_h2o_ice)
+        vmr=1.e6 * zq(1:ngrid,1:nlayer,igcm_h2o_ice)
+     .           * mugaz / mmol(igcm_h2o_ice)
+      ENDIF
+
+c
+c THIS INCLUDE IS AUTOMATICALLY GENERATED FROM REGISTRY
+c
+#include "fill_save.inc"
+c
+ccc**************** WRF OUTPUT **************************
+ccc**************** WRF OUTPUT **************************
+ccc**************** WRF OUTPUT **************************
+
+
+cc-----------------------------------
+cc you can still use meso_WRITEDIAGFI (e.g. for debugging purpose), 
+cc though this is not the default strategy now
+cc-----------------------------------
+cc please use cudt in namelist.input to set frequency of outputs
+cc----------------------------------- 
+cc BEWARE: if at least one call to meso_WRITEDIAGFI is performed,
+cc cudt cannot be 0 - otherwise you'll get a "Floating exception"
+cc-----------------------------------         
+!      call meso_WRITEDIAGFI(ngrid,"tauref",
+!     .  "tauref","W.m-2",2,
+!     .       tauref)
+!      call meso_WRITEDIAGFI(ngrid,"dtrad",
+!     .  "dtrad","W.m-2",2,
+!     .       dtrad)
+c      call meso_WRITEDIAGFI(ngrid,"tsurf",
+c     .  "tsurf","K",2,
+c     .       tsurf)
+c
+!      call meso_WRITEDIAGFI(ngrid,"zt",
+!     .  "zt","W.m-2",3,
+!     .       zt)
+!      call meso_WRITEDIAGFI(ngrid,"zdtlw",
+!     .  "zdtlw","W.m-2",2,
+!     .       zdtlw)
+!      call meso_WRITEDIAGFI(ngrid,"zdtsw",
+!     .  "zdtsw","W.m-2",2,
+!     .       zdtsw)
+
+
+!!
+!! ***WRF: everything below is kept for reference
+!!
+!
+!c        ==========================================================
+!c        WRITEDIAGFI: Outputs in netcdf file "DIAGFI", containing
+!c          any variable for diagnostic (output with period
+!c          "ecritphy", set in "run.def")
+!c        ==========================================================
+!c        WRITEDIAGFI can ALSO be called from any other subroutines
+!c        for any variables !!
+!         call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2,
+!     &                  emis)
+!         call WRITEDIAGFI(ngrid,"tsurf","Surface temperature","K",2,
+!     &                  tsurf)
+!         call WRITEDIAGFI(ngrid,"ps","surface pressure","Pa",2,ps)
+!         call WRITEDIAGFI(ngrid,"co2ice","co2 ice thickness","kg.m-2",2,
+!     &                  co2ice)
+!c         call WRITEDIAGFI(ngrid,"temp7","temperature in layer 7",
+!c     &                  "K",2,zt(1,7))
+!         call WRITEDIAGFI(ngrid,"fluxsurf_lw","fluxsurf_lw","W.m-2",2,
+!     &                  fluxsurf_lw)
+!         call WRITEDIAGFI(ngrid,"fluxsurf_sw","fluxsurf_sw","W.m-2",2,
+!     &                  fluxsurf_sw_tot)
+!         call WRITEDIAGFI(ngrid,"fluxtop_lw","fluxtop_lw","W.m-2",2,
+!     &                  fluxtop_lw)
+!         call WRITEDIAGFI(ngrid,"fluxtop_sw","fluxtop_sw","W.m-2",2,
+!     &                  fluxtop_sw_tot)
+!         call WRITEDIAGFI(ngrid,"temp","temperature","K",3,zt)
+!c        call WRITEDIAGFI(ngrid,"u","Zonal wind","m.s-1",3,zu)
+!c        call WRITEDIAGFI(ngrid,"v","Meridional wind","m.s-1",3,zv)
+!c        call WRITEDIAGFI(ngrid,"w","Vertical wind","m.s-1",3,pw)
+!         call WRITEDIAGFI(ngrid,"rho","density","none",3,rho)
+!c        call WRITEDIAGFI(ngrid,"q2","q2","kg.m-3",3,q2)
+!c        call WRITEDIAGFI(ngrid,'Teta','T potentielle','K',3,zh)
+!c        call WRITEDIAGFI(ngrid,"pressure","Pressure","Pa",3,pplay)
+!c        call WRITEDIAGFI(ngrid,"ssurf","Surface stress","N.m-2",2,
+!c    &                  zstress)
+!
+!c        ----------------------------------------------------------
+!c        Outputs of the CO2 cycle
+!c        ----------------------------------------------------------
+!
+!         if (tracer.and.(igcm_co2.ne.0)) then
+!!          call WRITEDIAGFI(ngrid,"co2_l1","co2 mix. ratio in 1st layer",
+!!    &                     "kg/kg",2,zq(1,1,igcm_co2))
+!!          call WRITEDIAGFI(ngrid,"co2","co2 mass mixing ratio",
+!!    &                     "kg/kg",3,zq(1,1,igcm_co2))
+!        
+!         ! Compute co2 column
+!         call zerophys(ngrid,co2col)
+!         do l=1,nlayermx
+!           do ig=1,ngrid
+!             co2col(ig)=co2col(ig)+
+!     &                  zq(ig,l,igcm_co2)*(pplev(ig,l)-pplev(ig,l+1))/g
+!           enddo
+!         enddo
+!         call WRITEDIAGFI(ngrid,"co2col","CO2 column","kg.m-2",2,
+!     &                  co2col)
+!         endif ! of if (tracer.and.(igcm_co2.ne.0))
+!
+!c        ----------------------------------------------------------
+!c        Outputs of the water cycle
+!c        ----------------------------------------------------------
+!         if (tracer) then
+!           if (water) then
+!
+!             CALL WRITEDIAGFI(ngridmx,'mtot',
+!     &                       'total mass of water vapor',
+!     &                       'kg/m2',2,mtot)
+!             CALL WRITEDIAGFI(ngridmx,'icetot',
+!     &                       'total mass of water ice',
+!     &                       'kg/m2',2,icetot)
+!c            If activice is true, tauTES is computed in aeropacity.F;
+!             if (.not.activice) then
+!               CALL WRITEDIAGFI(ngridmx,'tauTES',
+!     &                       'tau abs 825 cm-1',
+!     &                       '',2,tauTES)
+!             endif
+!
+!             call WRITEDIAGFI(ngridmx,'h2o_ice_s',
+!     &                       'surface h2o_ice',
+!     &                       'kg.m-2',2,qsurf(1,igcm_h2o_ice))
+!
+!             if (activice) then
+!c            call WRITEDIAGFI(ngridmx,'sw_htrt','sw heat. rate',
+!c    &                       'w.m-2',3,zdtsw)
+!c            call WRITEDIAGFI(ngridmx,'lw_htrt','lw heat. rate',
+!c    &                       'w.m-2',3,zdtlw)
+!             endif  !(activice)
+!           endif !(water)
+!
+!
+!           if (water.and..not.photochem) then
+!             iq=nq
+!c            write(str2(1:2),'(i2.2)') iq
+!c            call WRITEDIAGFI(ngridmx,'dqs'//str2,'dqscloud',
+!c    &                       'kg.m-2',2,zdqscloud(1,iq))
+!c            call WRITEDIAGFI(ngridmx,'dqch'//str2,'var chim',
+!c    &                       'kg/kg',3,zdqchim(1,1,iq))
+!c            call WRITEDIAGFI(ngridmx,'dqd'//str2,'var dif',
+!c    &                       'kg/kg',3,zdqdif(1,1,iq))
+!c            call WRITEDIAGFI(ngridmx,'dqa'//str2,'var adj',
+!c    &                       'kg/kg',3,zdqadj(1,1,iq))
+!c            call WRITEDIAGFI(ngridmx,'dqc'//str2,'var c',
+!c    &                       'kg/kg',3,zdqc(1,1,iq))
+!           endif  !(water.and..not.photochem)
+!         endif
+!
+!c        ----------------------------------------------------------
+!c        Outputs of the dust cycle
+!c        ----------------------------------------------------------
+!
+!         call WRITEDIAGFI(ngridmx,'taudustvis',
+!     &                    'Dust optical depth',' ',2,tau(1,1))
+!
+!         if (tracer.and.(dustbin.ne.0)) then
+!           call WRITEDIAGFI(ngridmx,'tau','taudust','SI',2,tau(1,1))
+!           if (doubleq) then
+!             call WRITEDIAGFI(ngridmx,'qsurf','qsurf',
+!     &                       'kg.m-2',2,qsurf(1,1))
+!             call WRITEDIAGFI(ngridmx,'Nsurf','N particles',
+!     &                       'N.m-2',2,qsurf(1,2))
+!             call WRITEDIAGFI(ngridmx,'dqsdev','ddevil lift',
+!     &                       'kg.m-2.s-1',2,zdqsdev(1,1))
+!             call WRITEDIAGFI(ngridmx,'dqssed','sedimentation',
+!     &                       'kg.m-2.s-1',2,zdqssed(1,1))
+!             do l=1,nlayer
+!               do ig=1, ngrid
+!                 reff(ig,l)= ref_r0 *
+!     &           (r3n_q*pq(ig,l,1)/max(pq(ig,l,2),0.01))**(1./3.)
+!                 reff(ig,l)=min(max(reff(ig,l),1.e-10),500.e-6)
+!               end do
+!             end do
+!             call WRITEDIAGFI(ngridmx,'reff','reff','m',3,reff)
+!           else
+!             do iq=1,dustbin
+!               write(str2(1:2),'(i2.2)') iq
+!               call WRITEDIAGFI(ngridmx,'q'//str2,'mix. ratio',
+!     &                         'kg/kg',3,zq(1,1,iq))
+!               call WRITEDIAGFI(ngridmx,'qsurf'//str2,'qsurf',
+!     &                         'kg.m-2',2,qsurf(1,iq))
+!             end do
+!           endif ! (doubleq)
+!         end if  ! (tracer.and.(dustbin.ne.0))
+!
+!c        ----------------------------------------------------------
+!c        Output in netcdf file "diagsoil.nc" for subterranean
+!c          variables (output every "ecritphy", as for writediagfi)
+!c        ----------------------------------------------------------
+!
+!         ! Write soil temperature
+!!        call writediagsoil(ngrid,"soiltemp","Soil temperature","K",
+!!    &                     3,tsoil)
+!         ! Write surface temperature
+!!        call writediagsoil(ngrid,"tsurf","Surface temperature","K",
+!!    &                     2,tsurf)
+!
+!c        ==========================================================
+!c        END OF WRITEDIAGFI
+!c        ==========================================================
+
+      ELSE     ! if(ngrid.eq.1)
+
+         print*,'Ls =',zls*180./pi,
+     &  '  tauref(700 Pa) =',tauref
+c      ----------------------------------------------------------------------
+c      Output in grads file "g1d" (ONLY when using testphys1d)
+c      (output at every X physical timestep)
+c      ----------------------------------------------------------------------
+c
+c        CALL writeg1d(ngrid,1,fluxsurf_lw,'Fs_ir','W.m-2')
+c         CALL writeg1d(ngrid,1,tsurf,'tsurf','K')
+c         CALL writeg1d(ngrid,1,ps,'ps','Pa')
+         
+c         CALL writeg1d(ngrid,nlayer,zt,'T','K')
+c        CALL writeg1d(ngrid,nlayer,pu,'u','m.s-1')
+c        CALL writeg1d(ngrid,nlayer,pv,'v','m.s-1')
+c        CALL writeg1d(ngrid,nlayer,pw,'w','m.s-1')
+
+!! or output in diagfi.nc (for testphys1d)
+!         call WRITEDIAGFI(ngridmx,'ps','Surface pressure','Pa',0,ps)
+!         call WRITEDIAGFI(ngridmx,'temp','Temperature',
+!     &                       'K',1,zt)
+!
+!         if(tracer) then
+!c           CALL writeg1d(ngrid,1,tau,'tau','SI')
+!            do iq=1,nq
+!c              CALL writeg1d(ngrid,nlayer,zq(1,1,iq),noms(iq),'kg/kg') 
+!               call WRITEDIAGFI(ngridmx,trim(noms(iq)),
+!     &              trim(noms(iq)),'kg/kg',1,zq(1,1,iq))
+!            end do
+!         end if
+!
+!         zlocal(1)=-log(pplay(1,1)/pplev(1,1))* Rnew(1,1)*zt(1,1)/g
+!
+!         do l=2,nlayer-1
+!            tmean=zt(1,l)
+!            if(zt(1,l).ne.zt(1,l-1))
+!     &        tmean=(zt(1,l)-zt(1,l-1))/log(zt(1,l)/zt(1,l-1))
+!              zlocal(l)= zlocal(l-1)
+!     &        -log(pplay(1,l)/pplay(1,l-1))*rnew(1,l)*tmean/g
+!         enddo
+!         zlocal(nlayer)= zlocal(nlayer-1)-
+!     &                   log(pplay(1,nlayer)/pplay(1,nlayer-1))*
+!     &                   rnew(1,nlayer)*tmean/g
+
+      END IF       ! if(ngrid.ne.1)
+
+      icount=icount+1
+      write(*,*) 'now, back to the dynamical core...'
+#endif
+      RETURN
+      END
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_physiq_julien.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_physiq_julien.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_physiq_julien.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/meso_physiq_julien.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_readtesassim.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_readtesassim.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_readtesassim.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/meso_readtesassim.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_slope.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_slope.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/meso_slope.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/meso_slope.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mkstat.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mkstat.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mkstat.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/mkstat.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mucorr.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mucorr.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mucorr.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/mucorr.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mufract.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mufract.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/mufract.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/mufract.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/multipl.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/multipl.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/multipl.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/multipl.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/newcondens.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/newcondens.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/newcondens.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/newcondens.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/newsedim.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/newsedim.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/newsedim.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/newsedim.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nirco2abs.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nirco2abs.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nirco2abs.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/nirco2abs.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nltecool.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nltecool.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nltecool.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/nltecool.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nltedata.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nltedata.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nltedata.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/nltedata.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nlteparams.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nlteparams.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nlteparams.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/nlteparams.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nlthermeq.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nlthermeq.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/nlthermeq.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/nlthermeq.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orbite.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orbite.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orbite.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/orbite.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orodrag.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orodrag.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orodrag.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/orodrag.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orosetup.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orosetup.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/orosetup.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/orosetup.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/phyetat0.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/phyetat0.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/phyetat0.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/phyetat0.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/physdem1.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/physdem1.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/physdem1.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/physdem1.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/physiq.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/physiq.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/physiq.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/physiq.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/planete.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/planete.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/planete.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/planete.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/profile.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/profile.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/profile.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/profile.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/readtesassim.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/readtesassim.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/readtesassim.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/readtesassim.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/scatter.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/scatter.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/scatter.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/scatter.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/scopyi.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/scopyi.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/scopyi.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/scopyi.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/soil.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/soil.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/soil.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/soil.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/soil_settings.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/soil_settings.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/soil_settings.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/soil_settings.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/solang.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/solang.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/solang.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/solang.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/solarlong.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/solarlong.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/solarlong.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/solarlong.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/statto.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/statto.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/statto.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/statto.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/suaer.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/suaer.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/suaer.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/suaer.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/sugwd.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/sugwd.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/sugwd.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/sugwd.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/sulw.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/sulw.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/sulw.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/sulw.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/surfdat.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/surfdat.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/surfdat.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/surfdat.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/surfini.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/surfini.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/surfini.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/surfini.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swmain.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swmain.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swmain.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/swmain.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swr_fouquart.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swr_fouquart.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swr_fouquart.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/swr_fouquart.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swr_toon.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swr_toon.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swr_toon.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/swr_toon.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swrayleigh.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swrayleigh.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/swrayleigh.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/swrayleigh.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/tabfi.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/tabfi.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/tabfi.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/tabfi.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/testphys1d.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/testphys1d.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/testphys1d.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/testphys1d.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/tracer.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/tracer.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/tracer.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/tracer.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/updatereffrad.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/updatereffrad.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/updatereffrad.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/updatereffrad.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdif_cd.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdif_cd.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdif_cd.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/vdif_cd.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdif_kc.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdif_kc.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdif_kc.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/vdif_kc.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdifc.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdifc.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vdifc.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/vdifc.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vlz_fi.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vlz_fi.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/vlz_fi.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/vlz_fi.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watercap.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watercap.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watercap.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/watercap.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watercloud.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watercloud.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watercloud.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/watercloud.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watersat.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watersat.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/watersat.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/watersat.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writediagfi.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writediagfi.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writediagfi.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/writediagfi.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writediagsoil.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writediagsoil.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writediagsoil.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/writediagsoil.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writeg1d.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writeg1d.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/writeg1d.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/writeg1d.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/wstats.F90
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/wstats.F90	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/wstats.F90	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/wstats.F90
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yoegwd.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yoegwd.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yoegwd.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/yoegwd.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yomaer.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yomaer.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yomaer.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/yomaer.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yomlw.h
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yomlw.h	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/yomlw.h	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/yomlw.h
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/zerophys.F
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/zerophys.F	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/libf/phymars/zerophys.F	(revision 118)
@@ -0,0 +1,1 @@
+link ../../../mars_lmd_new/libf/phymars/zerophys.F
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm.last
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm.last	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm.last	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm.last
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_g95
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_g95	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_g95	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm_g95
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_g95.last
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_g95.last	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_g95.last	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm_g95.last
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_ifort
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_ifort	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_ifort	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm_ifort
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_mpi
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_mpi	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_mpi	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm_mpi
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_mpifort
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_mpifort	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_mpifort	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm_mpifort
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_pgf
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_pgf	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/makegcm_pgf	(revision 118)
@@ -0,0 +1,1 @@
+link ../mars_lmd_new/makegcm_pgf
Index: trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/storm.inc
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/storm.inc	(revision 118)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new_storm/storm.inc	(revision 118)
@@ -0,0 +1,8 @@
+!!!!!!
+!!!!!! SPECIAL POUR AJOUTER UNE TACHE DE POUSSIERE (sparadrap)
+!!!!!! ps: induit une erreur benigne sur la partie de pdq qui n'est pas zdqnorm
+!!!!!! ps: la raison est que dt n'est pas passe dans meso_physiq
+!!!!!!
+IF (firstcall .EQV. .true.) THEN
+  pdq(:,:,:) = pdq(:,:,:) / dt
+ENDIF
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 117)
+++ trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F	(revision 118)
@@ -1116,12 +1116,11 @@
 
 
-!!!!!!!
-!!!!!!! SPECIAL POUR AJOUTER UNE TACHE DE POUSSIERE (sparadrap)
-!!!!!!! ps: induit une erreur benigne sur la partie de pdq qui n'est pas zdqnorm
-!!!!!!! ps: la raison est que dt n'est pas passe dans meso_physiq
-!!!!!!!
-!IF (firstcall .EQV. .true.) THEN
-!  pdq(:,:,:) = pdq(:,:,:) / dt
-!ENDIF
+!!!!!! PATCH SPECIAL STORM
+#ifdef NEWPHYS
+#ifdef storm
+#include "../mars_lmd/storm.inc"
+#endif
+#endif
+!!!!!! PATCH SPECIAL STORM
 
 
Index: trunk/mesoscale/LMD_MM_MARS/makemeso
===================================================================
--- trunk/mesoscale/LMD_MM_MARS/makemeso	(revision 117)
+++ trunk/mesoscale/LMD_MM_MARS/makemeso	(revision 118)
@@ -34,14 +34,16 @@
 fresh_start=0
 phys=""
-while getopts "drc:njhgpf" options; do
+scenario=""
+while getopts "drc:njhgpfs:" options; do
   case $options in
-   d ) donotcompile=1;;     ## just to check the compile folder
-   r ) donotallow=1;;       ## allow only known config (useful with 'makemeso < last')
-   c ) config="${OPTARG}";; ## idealized cases
-   n ) donotcompilephys=1;; ## do not recompile physics
-   j ) justphys=1;;         ## just compile LMD physics
-   g ) debug=1;;            ## debug mode
-   p ) phys="newphys_";;    ## with new physics
-   f ) fresh_start=1;;      ## a fresh start
+   d ) donotcompile=1;;       ## just to check the compile folder
+   r ) donotallow=1;;         ## allow only known config (useful with 'makemeso < last')
+   c ) config="${OPTARG}";;   ## idealized cases
+   n ) donotcompilephys=1;;   ## do not recompile physics
+   j ) justphys=1;;           ## just compile LMD physics
+   g ) debug=1;;              ## debug mode
+   p ) phys="newphys_";;      ## with new physics
+   f ) fresh_start=1;;        ## a fresh start
+   s ) scenario="${OPTARG}";; ## a specific scenario, you need a corresponding "mars_lmd_..."
    h ) echo "
 # Use:    
@@ -69,4 +71,6 @@
 #
 # makemeso -f                ## fresh start [clean -a]
+#
+# makemeso -s storm          ## a specific scenario, you need a corresponding mars_lmd_... (only for newphys)
 " ; exit ;;
   esac
@@ -143,5 +147,5 @@
 ####
 
-    conf_wrf="${phys}${compilo}_${machine}${single}${testflag}"
+    conf_wrf="${scenario}${phys}${compilo}_${machine}${single}${testflag}"
     \rm what_folder 2> /dev/null
     echo ${conf_wrf} > what_folder
@@ -172,5 +176,11 @@
     then
      \rm copy_model_tmp > /dev/null
-     sed s+"mars_lmd"+"mars_lmd_new"+g copy_model > copy_model_tmp
+        if [[ "${scenario}" == "" ]]
+        then
+          sed s+"mars_lmd"+"mars_lmd_new"+g             copy_model > copy_model_tmp
+        else
+          echo SCENARIO ${scenario} DID YOU INCLUDE THE RIGHT copy_model ? ; read dummy 
+          sed s+"mars_lmd"+"mars_lmd_new_${scenario}"+g copy_model > copy_model_tmp
+        fi
      chmod 755 copy_model_tmp
      ./copy_model_tmp
@@ -178,5 +188,13 @@
      mv WRFV2 ${conf_wrf}/
      cd ${conf_wrf}/WRFV2
-     ln -sf mars_lmd_new mars_lmd
+        if [[ "${scenario}" == "" ]]
+        then
+          ln -sf mars_lmd_new             mars_lmd 
+        else
+          ln -sf mars_lmd_new_${scenario} mars_lmd 
+          cp ../../SRC/WRFV2/mars_lmd_new_${scenario}/Registry.EM mars_lmd_new_${scenario}/
+          cp ../../SRC/WRFV2/mars_lmd_new_${scenario}/*.inc mars_lmd_new_${scenario}/
+          cd Registry ; ln -sf ../mars_lmd_new_${scenario}/Registry.EM . ; cd ..
+        fi 
      ln -sf meso_callkeys_newphys.h meso_callkeys.h
      cd Registry ; Registry.bash ; cd ..
@@ -356,4 +374,10 @@
   fi
 
+        if [[ ! ("${scenario}" == "") ]]
+        then
+          sed s+"ARCHFLAGS       =       "+"ARCHFLAGS       =       -D${scenario} "+g configure.wrf > yeah
+          mv -f yeah configure.wrf
+        fi
+
   if [ ${debug} -ne 0 ]   # not working for xlf!
   then
