Index: trunk/LMDZ.TITAN/deftank/callphys.def.allmuparams
===================================================================
--- trunk/LMDZ.TITAN/deftank/callphys.def.allmuparams	(revision 3657)
+++ trunk/LMDZ.TITAN/deftank/callphys.def.allmuparams	(revision 3657)
@@ -0,0 +1,219 @@
+### Orbit / General options
+### ~~~~~~~~~~~~~~~~~~~~~~~
+# Run with or without tracer transport ?
+tracer    = .true.
+# Diurnal cycle ?  If diurnal = .false., diurnally averaged solar heating
+diurnal   = .true.
+# Seasonal cycle ? If season = .false., Ls stays constant, to value set in "start"
+season    = .true. 
+# Tidally resonant orbit ? Must have diurnal = .false., correct rotation rate in newstart
+tlocked   = .false.
+# Tidal resonance ratio ? Ratio T_orbit to T_rotation
+nres      = 1
+# Write some more output on the screen ?
+lwrite    = .false.
+# Save statistics in file "stats.nc" ?
+callstats = .false.
+# Test energy conservation of model physics ?
+enertest  = .true.
+# Check if cpp matches gases.def (should be false in 1d)
+check_cpp_match = .false.
+# Force cpp and mugaz values from gases.def (should be false in 1d)
+force_cpp = .false.
+# Compute effective variations of gravity field with altitude in physics ?
+# Better be true if you run with chemistry
+eff_gz     = .false.
+
+### Directory where external input files are
+### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+datadir   = /data/emoisan/datagcm
+
+
+### Radiative transfer options
+### ~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Call radiative transfer?
+callrad    = .true.
+# The rad. transfer is computed every "iradia" physical timestep
+iradia     = 4
+# Use blackbody for stellar spectrum ?
+stelbbody  = .false.
+# Stellar blackbody temperature ?
+stelTbb    = 2000.000
+# Call multilayer correlated-k radiative transfer ?
+corrk      = .true.
+# Folder in which correlated-k data is stored ?
+corrkdir   = recombin
+# Use corr-k recombination instead of pre-mixed ?
+corrk_recombin = .true.
+# Call visible gaseous absorption in radiative transfer ?
+callgasvis = .true.
+# Call continuum in radiative transfer ?
+Continuum  = .true.
+# Allow temperatures above kmatrix tmax
+strictboundcorrk = .false.
+# Include Rayleigh scattering in the visible ?
+rayleigh   = .true.
+# Uniform absorption coefficient in radiative transfer?
+graybody   = .false.
+# Constant absorption coefficient in visible 
+#      (in m^2/kg; only if graybody=true):
+#      tau_surf= kappa*P/g
+kappa_VI   = 0.
+# Constant absorption coefficient in IR
+#      (in m^2/kg; only if graybody=true):
+kappa_IR   = 0.
+# Use Newtonian cooling in place of radiative transfer ?
+newtonian  = .false.
+# Radiative timescale for Newtonian cooling ? [only if newtonian = T]
+tau_relax  = 30.00000
+# Test physics timescale in 1D ?
+testradtimes = .false.
+# Characteristic planetary equilibrium (black body) temperature
+# This is used only in the aerosol radiative transfer setup. (see aerave.F)
+tplanet    = 94.
+# Output spectral OLR in 1D/3D?
+specOLR    = .false.
+# Output global radiative balance in file 'rad_bal.out' - slow for 1D!!
+meanOLR    = .false.
+# Remove lower boundary (e.g. for gas giant sims)
+noradsurf  = .false. 
+# Output optical diagnostics (in otpcv & optci) ?
+diagdtau   = .false.
+
+
+### Chemistry
+### ~~~~~~~~~
+# Call chemistry ? (must have tracer = .true.)
+callchim   = .false.
+# Activate zonal mean ? 
+moyzon_ch  = .true.
+# Chemistry is computed every "ichim" phys. timestep
+ichim      = 20
+# Infinite tank of CH4 ? (.false. == lakes at the poles)
+resCH4_inf = .false.
+
+
+### Microphysics
+### ~~~~~~~~~~~~
+# Call microphysics ? (must have tracer = .true.)
+callmufi   = .true.
+# Activate zonal mean ? (must be .true. if callmufi by now ?)
+moyzon_mu  = .false.
+# If yes, compute clouds ?
+callclouds = .true.
+# If yes, number of ices ? (must be compatible with traceur.def AND microphysical model)
+nices      = 1
+# Use new optics for clouds ?
+opt4clouds = .true.
+# Cloudy fraction in the Clear / Dark column method ?
+Fcloudy    = 0.2
+# Adjustment of ssca albedo for cloudy dropplet ?
+Fssa       = 0.90
+# Adjustment of aerosol properties in the VIS ?
+FHVIS      = 1.0
+# Adjustment of aerosol properties in the IR ?
+FHIR       = 1.0
+# Desactivate radiative coupling of microphysics (i.e. use mean opacity profile)
+uncoupl_optic_haze = .false.
+# Use haze seasonal model ? (if you run without coupled microphysics)
+seashaze   = .false.
+
+# ~~~~~ Parameters for microphysics ~~~~~
+# Microphys. config file ?
+config_mufi = config.ne15.cfg
+# Pressure level of aer. production (Pa) ?
+p_prod     = 1.0
+# Aer. production rate (kg.m-2.s-1) ?
+tx_prod    = 3.5e-13
+# Equivalent radius production (m) ?
+rc_prod    = 1.0e-8
+# Radius of air (nitrogen) molecule (m) ?
+air_rad    = 1.75e-10
+# Monomer radius (m)
+rm                     = 50e-9
+# Fractal dimension
+df                     = 2.0
+# Aerosol density (kg.m-3)
+rho_aer                = 600.
+# Enable/disable Haze production process 
+haze_production        = T
+# Enable/disable Haze coagulation process 
+haze_coagulation       = T
+# Coagulation interactions, a combination of:
+#    0 - no interactions (same as haze_coagulation == F)
+#    1 - SS interactions
+#    2 - SF interactions
+#    4 - FF interactions.
+# (for example : 5 = 4+1 --> SS and FF coagulation only)
+haze_coag_interactions = 7
+# Enable/disable Haze sedimentation process 
+haze_sedimentation     = T
+# Disable Fiadero correction for sedimentation process
+no_fiadero             = T
+# Fiadero correction minimum ratio threshold
+fiadero_min_ratio      = 0.1
+# Fiadero correction maximum ratio threshold
+fiadero_max_ratio      = 10.
+# Force settling velocity to M0
+wsed_m0                = T
+# Force settling velocity to M3
+wsed_m3                = F
+# Enable/disable clouds sedimentation process
+# (automatically set to F if clouds microphysics is not enabled)
+clouds_sedimentation   = T
+# Enable/disable clouds nucleation and condensation processes
+# (automatically set to F if clouds microphysics is not enabled)
+clouds_nuc_cond        = T
+# Condensible species configuration file
+# (not needed if clouds microphysics is not enabled)
+specie_cfg             = mp2m_species.cfg
+# Enable/disable spherical mode transfert probability
+transfert_probability = T
+# Spherical mode transfert probability look-up tables file
+# (optional if 'transfert_probability' is False) 
+ps2s_file             = mmp_ps2s_rm50_ne15.nc
+# Electric charging coagulation correction
+# If set to .false. then no correction is assumed
+electric_charging     = T 
+# File for the electric charging correction factor.
+# (optional if 'electric_charging' is False) 
+mq_file               = mmp_qmean_rm50_ne15.nc
+### Thresholds related parameters
+# Aerosol spherical mode total number min. threshold
+m0as_min = 1e-10
+# Aerosol spherical mode min. caracteristic radius threshold
+rcs_min  = 1e-9
+# Aerosol fractal mode total number min. threshold
+m0af_min = 1e-10
+# Aerosol fractal mode min. caracteristic radius threshold (updated to monomer radius at runtime if needed)
+rcf_min  = 1e-9
+# cloud drop total number min. threshold
+m0n_min = 1e-10
+
+
+### Star type
+### ~~~~~~~~~
+startype = 1
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# The choices are:
+#
+#   startype = 1  	Sol        (G2V-class main sequence)
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Stellar flux at 1 AU. Examples:
+# 1366.0 W m-2		Sol today
+# 1024.5 W m-2		Sol today x 0.75 = weak early Sun
+Fat1AU = 1366.0
+
+
+### Other physics options
+### ~~~~~~~~~~~~~~~~~~~~~
+# Call turbulent vertical diffusion ?
+calldifv    = .true.
+# Use turbdiff instead of vdifc ?
+UseTurbDiff = .true.
+# Call convective adjustment ?
+calladj     = .true.
+# Call thermal conduction in the soil ?
+callsoil    = .true.
+# Call nudging of zonal wind ?
+nudging_u   = .false.
Index: trunk/LMDZ.TITAN/libf/muphytitan/mm_globals.f90
===================================================================
--- trunk/LMDZ.TITAN/libf/muphytitan/mm_globals.f90	(revision 3656)
+++ trunk/LMDZ.TITAN/libf/muphytitan/mm_globals.f90	(revision 3657)
@@ -724,5 +724,10 @@
       ENDIF
       ! Reads species properties configuration file
-      err = cfg_read_config(cp,TRIM(spcfile)) ; IF (err /= 0) RETURN
+      !err = cfg_read_config(cp,TRIM(spcfile)) ; IF (err /= 0) RETURN
+      err = cfg_read_config(cp,TRIM(spcfile))
+      IF (err /= 0) THEN
+        write(*,*) err !return error message (EMoi24)
+        RETURN
+      ENDIF
       err = cfg_get_value(cp,"used_species",species)
       IF (err /= 0) THEN
@@ -836,9 +841,4 @@
     ENDIF
 
-    ! compute m3 thresholds from user-defined thresholds.
-    mm_m3as_min  =  mm_m0as_min*mm_alpha_s(3._mm_wp) * mm_rcs_min**3._mm_wp
-    mm_m3af_min  =  mm_m0af_min*mm_alpha_f(3._mm_wp) * mm_rcf_min**3._mm_wp
-    mm_m3cld_min =  mm_m0n_min * (4._mm_wp * mm_pi / 3._mm_wp) * mm_drad_min**3._mm_wp
-
     ! clouds control flags
     IF (mm_w_clouds) THEN
@@ -875,4 +875,12 @@
     END SUBROUTINE printw
   END FUNCTION mm_global_init_0
+
+  SUBROUTINE mm_global_init_calc
+    ! compute m3 thresholds from user-defined thresholds.
+    ! -- we operate here on global variables
+    mm_m3as_min  =  mm_m0as_min*mm_alpha_s(3._mm_wp) * mm_rcs_min**3._mm_wp
+    mm_m3af_min  =  mm_m0af_min*mm_alpha_f(3._mm_wp) * mm_rcf_min**3._mm_wp
+    mm_m3cld_min =  mm_m0n_min * (4._mm_wp * mm_pi / 3._mm_wp) * mm_drad_min**3._mm_wp
+  END SUBROUTINE mm_global_init_calc
 
   FUNCTION mm_global_init_1(cfg) RESULT(err)
@@ -980,5 +988,5 @@
     err = mm_check_opt(cfg_get_value(cfg,"haze_coagulation",mm_w_haze_coag),mm_w_haze_coag,zwhc,wlog=mm_log)
     err = mm_check_opt(cfg_get_value(cfg,"clouds_sedimentation",mm_w_cloud_sed),mm_w_cloud_sed,zwcs,wlog=mm_log)
-    err = mm_check_opt(cfg_get_value(cfg,"clouds_nucl_cond",mm_w_cloud_nucond),mm_w_cloud_nucond,zwcn,wlog=mm_log)
+    err = mm_check_opt(cfg_get_value(cfg,"clouds_nuc_cond",mm_w_cloud_nucond),mm_w_cloud_nucond,zwcn,wlog=mm_log)
     err = mm_check_opt(cfg_get_value(cfg,"wsed_m0",mm_wsed_m0),mm_wsed_m0,zwstom0,wlog=mm_log)
     err = mm_check_opt(cfg_get_value(cfg,"wsed_m3",mm_wsed_m3),mm_wsed_m3,zwstom3,wlog=mm_log)
Index: trunk/LMDZ.TITAN/libf/muphytitan/mmp_gcm.f90
===================================================================
--- trunk/LMDZ.TITAN/libf/muphytitan/mmp_gcm.f90	(revision 3656)
+++ trunk/LMDZ.TITAN/libf/muphytitan/mmp_gcm.f90	(revision 3657)
@@ -43,4 +43,5 @@
   USE CFGPARSE
   USE DATASETS
+  USE CALLKEYS_MOD
   IMPLICIT NONE
 
@@ -87,16 +88,20 @@
       !! Internal microphysic configuration file.
 
+    TYPE(error)                                       :: err
+    INTEGER                                           :: i
+    TYPE(cfgparser)                                   :: cparser
+    CHARACTER(len=st_slen)                            :: opt_file
+    CHARACTER(len=st_slen), DIMENSION(:), ALLOCATABLE :: species
+    REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE       :: tmp
+    LOGICAL                                           :: wdebug
+
+! for mesoscale, initialized in inifis_mod (EMoi)
+#ifndef MESOSCALE
     INTEGER                                           :: coag_choice
     REAL(kind=mm_wp)                                  :: fiad_max,fiad_min,df,rm,rho_aer
     LOGICAL                                           :: w_h_prod,w_h_sed,w_h_coag,w_c_sed,w_c_nucond, &
                                                          no_fiadero,fwsed_m0,fwsed_m3
-    TYPE(error)                                       :: err
-    INTEGER                                           :: i
-    TYPE(cfgparser)                                   :: cparser
-    CHARACTER(len=st_slen)                            :: spcpath,pssfile,mqfile,opt_file
-    CHARACTER(len=st_slen), DIMENSION(:), ALLOCATABLE :: species
-    REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE       :: tmp
+    CHARACTER(len=st_slen)                            :: spcpath,pssfile,mqfile
     REAL(kind=mm_wp)                                  :: m0as_min,rcs_min,m0af_min,rcf_min,m0n_min
-    LOGICAL                                           :: wdebug
 
     w_h_prod    = .true.
@@ -117,4 +122,5 @@
     rcf_min     = 1e-9_mm_wp
     m0n_min     = 1e-10_mm_wp
+#endif
 
     WRITE(*,'(a)') "##### MMP_GCM SPEAKING #####"
@@ -129,4 +135,6 @@
     ENDIF
 
+! for mesoscale, the initialization of these parameters has been transfered to inifis (EMoi)
+#ifndef MESOSCALE
     ! YAMMS internal parameters:
     err = mm_check_opt(cfg_get_value(cparser,"rm",rm),rm,50e-9_mm_wp,mm_log)
@@ -139,5 +147,5 @@
     err = mm_check_opt(cfg_get_value(cparser,"haze_coagulation",w_h_coag)         ,w_h_coag   ,.true.     ,mm_log)
     err = mm_check_opt(cfg_get_value(cparser,"clouds_sedimentation",w_c_sed)      ,w_c_sed    ,clouds     ,mm_log)
-    err = mm_check_opt(cfg_get_value(cparser,"clouds_nucl_cond",w_c_nucond)       ,w_c_nucond ,clouds     ,mm_log)
+    err = mm_check_opt(cfg_get_value(cparser,"clouds_nuc_cond",w_c_nucond)       ,w_c_nucond ,clouds     ,mm_log)
     err = mm_check_opt(cfg_get_value(cparser,"wsed_m0",fwsed_m0)                  ,fwsed_m0   ,.true.     ,mm_log)
     err = mm_check_opt(cfg_get_value(cparser,"wsed_m3",fwsed_m3)                  ,fwsed_m3   ,.false.    ,mm_log)
@@ -159,4 +167,18 @@
       IF (err/=0) call abort_program(err)
     ENDIF
+#endif
+
+! for mesoscale, the initialization of these parameters has been transfered to inifis (EMoi)
+#ifndef MESOSCALE
+    ! YAMMS initialization.
+    ! NB: in MESOSCALE this is done in inifis EMoi
+    err = mm_global_init_0(dt,df,rm,rho_aer,p_prod,tx_prod,rc_prod,rplanet,g0, &
+                           air_rad,air_mmol,coag_choice,clouds,spcpath,  &
+                           w_h_prod,w_h_sed,w_h_coag,w_c_nucond,  &
+                           w_c_sed,fwsed_m0,fwsed_m3, &
+                           no_fiadero,fiad_min,fiad_max, &
+                           m0as_min,rcs_min,m0af_min,rcf_min,m0n_min,wdebug)
+    IF (err /= 0) call abort_program(err)
+#endif
 
     ! Setup alpha function: THEY ARE REQUIRED IN YAMMS global initialization !
@@ -170,13 +192,9 @@
     IF (err /= 0) call abort_program(error("alpha_s: "//TRIM(err%msg),-1))
 
-    ! YAMMS initialization.
-    err = mm_global_init_0(dt,df,rm,rho_aer,p_prod,tx_prod,rc_prod,rplanet,g0, &
-                           air_rad,air_mmol,coag_choice,clouds,spcpath,  &
-                           w_h_prod,w_h_sed,w_h_coag,w_c_nucond,  &
-                           w_c_sed,fwsed_m0,fwsed_m3, &
-                           no_fiadero,fiad_min,fiad_max, &
-                           m0as_min,rcs_min,m0af_min,rcf_min,m0n_min,wdebug)
-    IF (err /= 0) call abort_program(err)
-
+    ! perform threshold computations once global variables + settings collected
+    CALL mm_global_init_calc
+
+! for mesoscale, the initialization of these parameters has been transfered to inifis (EMoi)
+#ifndef MESOSCALE
     ! Extra initialization (needed for YAMMS method interfaces)
     err = mm_check_opt(cfg_get_value(cparser, "transfert_probability", mmp_w_ps2s), mmp_w_ps2s, wlog=mm_log)
@@ -184,9 +202,13 @@
     err = mm_check_opt(cfg_get_value(cparser, "electric_charging"    , mmp_w_qe  ), mmp_w_qe, wlog=mm_log)
     IF (err/=0) call abort_program(err)
+#endif
 
     ! initialize transfert probabilities look-up tables
     IF (mm_w_haze_coag .AND. mmp_w_ps2s) THEN
+! for mesoscale, the initialization of these parameters has been transfered to inifis (EMoi)
+#ifndef MESOSCALE
       err = mm_check_opt(cfg_get_value(cparser, "ps2s_file", pssfile), pssfile)
       IF (err /= 0) call abort_program(err)
+#endif
 
       IF (.NOT.read_dset(pssfile,'p_m0_co',mmp_pco0p)) THEN
@@ -203,8 +225,12 @@
       ENDIF
     ENDIF
+
     ! initialize mean electric correction look-up tables
     IF (mm_w_haze_coag .AND. mmp_w_qe) THEN
+! for mesoscale, the initialization of these parameters has been transfered to inifis (EMoi)
+#ifndef MESOSCALE
       err = mm_check_opt(cfg_get_value(cparser, "mq_file", mqfile), mqfile)
       IF (err /= 0) call abort_program(err)
+#endif
 
       IF (.NOT.read_dset(mqfile,'qbsf0',mmp_qbsf0)) THEN
@@ -245,6 +271,6 @@
     ! dump parameters ...
     WRITE(*,'(a)')        "========= MUPHYS PARAMETERS ==========="
-    WRITE(*,'(a,L2)')     "transfert_probability: ", mmp_w_ps2s
-    WRITE(*,'(a,L2)')     "electric_charging    : ", mmp_w_qe
+    !WRITE(*,'(a,L2)')     "transfert_probability: ", mmp_w_ps2s
+    !WRITE(*,'(a,L2)')     "electric_charging    : ", mmp_w_qe
     call mm_dump_parameters()
     IF (clouds) THEN
Index: trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90
===================================================================
--- trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90	(revision 3656)
+++ trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90	(revision 3657)
@@ -107,3 +107,36 @@
 !$OMP THREADPRIVATE(startphy_file)
 
+! for mesoscale, the following variables are defined in callphys.def
+! before, it was in the microphysics config file in datagcm (EMoi)
+#ifdef MESOSCALE
+      real,save :: rm
+      real,save :: df
+      real,save :: rho_aer
+      real,save :: fiad_min
+      real,save :: fiad_max
+      real,save :: m0as_min
+      real,save :: rcs_min
+      real,save :: m0af_min
+      real,save :: rcf_min
+      real,save :: m0n_min
+!$OMP THREADPRIVATE(rm,df,rho_aer,fiad_min,fiad_max,m0as_min,rcs_min,m0af_min,rcf_min,m0n_min)
+      logical,save :: w_h_prod
+      logical,save :: w_h_coag
+      logical,save :: w_h_sed
+      logical,save :: no_fiadero
+      logical,save :: fwsed_m0
+      logical,save :: fwsed_m3
+      logical,save :: w_c_sed
+      logical,save :: w_c_nucond
+!$OMP THREADPRIVATE(w_h_prod,w_h_coag,w_h_sed,no_fiadero,fwsed_m0,fwsed_m3,w_c_sed,w_c_nucond,mmp_w_ps2s,mmp_w_qe)
+      integer,save :: coag_choice
+!$OMP THREADPRIVATE(coag_choice)
+      character(len=100),save :: spcpath
+      character(len=100),save :: pssfile
+      character(len=100),save :: mqfile
+!$OMP THREADPRIVATE(spcpath,pssfile,mqfile)
+      logical,save :: wdebug
+!$OMP THREADPRIVATE(wdebug)
+#endif
+
 END MODULE callkeys_mod
Index: trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90
===================================================================
--- trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90	(revision 3656)
+++ trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90	(revision 3657)
@@ -20,6 +20,9 @@
   use planete_mod, only: nres
   use planetwide_mod, only: planetwide_sumval
+  use mm_globals, only: mm_global_init_0 
+  use mmp_globals, only: mmp_w_ps2s, mmp_w_qe
   use callkeys_mod
   use mod_phys_lmdz_para, only : is_parallel
+  use errors, only: error
 
 !=======================================================================
@@ -73,9 +76,10 @@
   integer,intent(in) :: day_ini
   INTEGER ig,ierr
+  TYPE(error) :: err
  
   EXTERNAL iniorbit,orbite
   EXTERNAL SSUM
   REAL SSUM
- 
+
   ! Initialize flags lunout, prt_level, debug (in print_control_mod)
   CALL init_print_control
@@ -93,7 +97,7 @@
 
   ! Initialize some "temporal and calendar" related variables
-#ifndef MESOSCALE
+  ! -- MESOSCALE : we do it for the right print (and avoid crash in debug)
+  ! -- MESOSCALE : and sporadic use in physiq, e.g. daysec used in soil
   CALL init_time(day_ini,pdaysec,nday,ptimestep)
-#endif
 
   ! read in some parameters from "run.def" for physics,
@@ -503,5 +507,5 @@
 
      write(*,*) "Equivalent radius production (m) ?"
-     rc_prod=2.0e-8 ! default value
+     rc_prod=1.0e-8 ! default value
      call getin_p("rc_prod",rc_prod)
      write(*,*)" rhc_prod = ",rc_prod
@@ -513,7 +517,148 @@
 
      write(*,*) "Path to microphys. config file ?"
-     config_mufi='datagcm/microphysics/config.cfg' ! default value
+     ! default path is set in datadir
+     write(*,*) "microphysics config file data base folder:",trim(datadir),"/microphysics"
+     config_mufi=trim(datadir)//'/microphysics/config.ne15.cfg' ! default value
      call getin_p("config_mufi",config_mufi)
+     config_mufi = trim(datadir)//'/microphysics/'//config_mufi
      write(*,*)" config_mufi = ",config_mufi
+
+! in mesoscale the following variables are defined in callphys.def
+! before they were defined in the config file, in datagcm (EMoi)
+#ifdef MESOSCALE
+     write(*,*) "Monomer radius (m)"
+     rm=50e-9 ! default value
+     call getin_p("rm",rm)
+     write(*,*)" rm = ",rm
+ 
+     write(*,*) "Fractal dimension"
+     df=2.0 ! default value
+     call getin_p("df",df)
+     write(*,*)" df = ",df
+ 
+     write(*,*) "Aerosol density (kg.m-3)"
+     rho_aer=600. ! default value
+     call getin_p("rho_aer",rho_aer)
+     write(*,*)" rho_aer = ",rho_aer
+ 
+     write(*,*) "Enable/disable Haze production process"
+     w_h_prod=.true. ! default value
+     call getin_p("haze_production",w_h_prod)
+     write(*,*)" haze_production = ",w_h_prod
+ 
+     write(*,*) "Enable/disable Haze coagulation process"
+     w_h_coag=.true. ! default value
+     call getin_p("haze_coagulation",w_h_coag)
+     write(*,*)" haze_coagulation = ",w_h_coag
+ 
+     write(*,*) "Coagulation interactions"
+     coag_choice=7 ! default value
+     call getin_p("haze_coag_interactions",coag_choice)
+     write(*,*)" haze_coag_interactions = ",coag_choice
+ 
+     write(*,*) "Enable/disable Haze sedimentation process"
+     w_h_sed=.true. ! default value
+     call getin_p("haze_sedimentation",w_h_sed)
+     write(*,*)" haze_sedimentation = ",w_h_sed
+ 
+     write(*,*) "Disable Fiadero correction for sedimentation process"
+     no_fiadero=.true. ! default value
+     call getin_p("no_fiadero",no_fiadero)
+     write(*,*)" no_fiadero = ",no_fiadero
+ 
+     write(*,*) "Fiadero correction minimum ratio threshold"
+     fiad_min=0.1 ! default value
+     call getin_p("fiadero_min_ratio",fiad_min)
+     write(*,*)" fiadero_min_ratio = ",fiad_min
+ 
+     write(*,*) "Fiadero correction maximum ratio threshold"
+     fiad_max=10. ! default value
+     call getin_p("fiadero_max_ratio",fiad_max)
+     write(*,*)" fiadero_max_ratio = ",fiad_max
+ 
+     write(*,*) "Force settling velocity to M0"
+     fwsed_m0=.true. ! default value
+     call getin_p("wsed_m0",fwsed_m0)
+     write(*,*)" wsed_m0 = ",fwsed_m0
+ 
+     write(*,*) "Force settling velocity to M3"
+     fwsed_m3=.false. ! default value
+     call getin_p("wsed_m3",fwsed_m3)
+     write(*,*)" wsed_m3 = ",fwsed_m3
+ 
+     write(*,*) "Enable/disable clouds sedimentation process"
+     w_c_sed=.true. ! default value
+     call getin_p("clouds_sedimentation",w_c_sed)
+     write(*,*)" clouds_sedimentation = ",w_c_sed
+ 
+     write(*,*) "Enable/disable clouds nucleation and condensation processes"
+     w_c_nucond=.true. ! default value
+     call getin_p("clouds_nuc_cond",w_c_nucond)
+     write(*,*)" clouds_nuc_cond = ",w_c_nucond
+ 
+     write(*,*) "Path to condensible species configuration file"
+     ! default path is set in datadir
+     write(*,*) "condensible species config file data base folder:",trim(datadir),"/microphysics"
+     spcpath=trim(datadir)//"/microphysics/mp2m_species.cfg" ! default value
+     call getin_p("specie_cfg",spcpath)
+     spcpath = trim(datadir)//'/microphysics/'//spcpath
+     write(*,*)" specie_cfg = ",spcpath
+ 
+     write(*,*) "Enable/disable spherical mode transfert probability"
+     mmp_w_ps2s=.true. ! default value
+     call getin_p("transfert_probability",mmp_w_ps2s)
+     write(*,*)" transfert_probability = ",mmp_w_ps2s
+ 
+     write(*,*) "Path to spherical mode transfert probability look-up tables file"
+     ! default path is set in datadir
+     write(*,*) "spherical mode transfert probability look-up tables file data base folder:",trim(datadir),"/microphysics"
+     pssfile=trim(datadir)//"/microphysics/mmp_ps2s_rm50_ne15.nc" ! default value
+     call getin_p("ps2s_file",pssfile)
+     pssfile = trim(datadir)//'/microphysics/'//pssfile
+     write(*,*)" ps2s_file = ",pssfile
+ 
+     write(*,*) "Electric charging coagulation correction"
+     mmp_w_qe=.true. ! default value
+     call getin_p("electric_charging",mmp_w_qe)
+     write(*,*)" electric_charging = ",mmp_w_qe
+ 
+     write(*,*) "Electric charging correction factor file"
+     ! default path is set in datadir
+     write(*,*) "Electric charging correction factor file data base folder:",trim(datadir),"/microphysics"
+     mqfile=trim(datadir)//"/microphysics/mmp_qmean_rm50_ne15.nc" ! default value
+     call getin_p("mq_file",mqfile)
+     mqfile = trim(datadir)//'/microphysics/'//mqfile
+     write(*,*)" mq_file = ",mqfile
+ 
+     write(*,*) "Aerosol spherical mode total number min. threshold"
+     m0as_min=1e-10 ! default value
+     call getin_p("m0as_min",m0as_min)
+     write(*,*)" m0as_min = ",m0as_min
+ 
+     write(*,*) "Aerosol spherical mode min. caracteristic radius threshold"
+     rcs_min=1e-9 ! default value
+     call getin_p("rcs_min",rcs_min)
+     write(*,*)" rcs_min = ",rcs_min
+ 
+     write(*,*) "Aerosol fractal mode total number min. threshold"
+     m0af_min=1e-10 ! default value
+     call getin_p("m0af_min",m0af_min)
+     write(*,*)" m0af_min = ",m0af_min
+ 
+     write(*,*) "Aerosol fractal mode min. caracteristic radius threshold (updated to monomer radius at runtime if needed)"
+     rcf_min=1e-9 ! default value
+     call getin_p("rcf_min",rcf_min)
+     write(*,*)" rcf_min = ",rcf_min
+ 
+     write(*,*) "cloud drop total number min. threshold"
+     m0n_min=1e-10 ! default value
+     call getin_p("m0n_min",m0n_min)
+     write(*,*)" m0n_min = ",m0n_min
+
+     write(*,*) "microphysics debug flag"
+     wdebug=.false. ! default value
+     call getin_p("wdebug",wdebug)
+     write(*,*)" wdebug = ",wdebug
+#endif
 
 ! Soil model
@@ -669,5 +814,19 @@
   ! allocate "comsoil_h" arrays
   call ini_comsoil_h(ngrid)
-    
+
+#ifdef MESOSCALE
+  ! YAMMS initialization.
+  err = mm_global_init_0(ptimestep,df,rm,rho_aer,p_prod,tx_prod,rc_prod,rad,g, &
+                         air_rad,mugaz,coag_choice,callclouds,spcpath,  &
+                         w_h_prod,w_h_sed,w_h_coag,w_c_nucond,  &
+                         w_c_sed,fwsed_m0,fwsed_m3, &
+                         no_fiadero,fiad_min,fiad_max, &
+                         m0as_min,rcs_min,m0af_min,rcf_min,m0n_min,wdebug)
+  IF (ierr /= 0) THEN
+       PRINT *, "PROBLEM WITH YAMMS INITIATILIZATION"
+  ENDIF
+#endif
+
+
   END SUBROUTINE inifis
 
