Index: /LMDZ6/trunk/libf/phylmdiso/phys_local_var_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/phys_local_var_mod.F90	(revision 4888)
+++ /LMDZ6/trunk/libf/phylmdiso/phys_local_var_mod.F90	(revision 4889)
@@ -28,4 +28,6 @@
       REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
       !$OMP THREADPRIVATE(tr_seri)
+      REAL, SAVE, ALLOCATABLE :: rhcl(:,:)
+      !$OMP THREADPRIVATE(rhcl)
       REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
       !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
@@ -164,4 +166,7 @@
       !$OMP THREADPRIVATE(d_ts, d_tr)
 
+! aerosols
+      REAL, SAVE, ALLOCATABLE :: m_allaer (:,:,:)
+      !$OMP THREADPRIVATE(m_allaer)
 ! diagnostique pour le rayonnement
       REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
@@ -347,6 +352,6 @@
       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
 !$OMP THREADPRIVATE(JrNt)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw
-!$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw)
+      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget
+!$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget)
       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
 !$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
Index: /LMDZ6/trunk/libf/phylmdiso/phys_output_ctrlout_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/phys_output_ctrlout_mod.F90	(revision 4888)
+++ /LMDZ6/trunk/libf/phylmdiso/phys_output_ctrlout_mod.F90	(revision 4889)
@@ -389,5 +389,5 @@
     'rhosnow_lic', 'snow density lic', 'kg/m3', (/ ('', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsalt_lic = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'qsalt_lic', 'qb in saltation layer lic', 'kg/kg', (/ ('', i=1, 10) /)) 
+    'qsalt_lic', 'qb in saltation layer lic', 'kg/kg', (/ ('', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sens_prec_liq_oce = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
     'sens_rain_oce', 'Sensible heat flux of liquid prec. over ocean', 'W/m2', (/ ('', i=1, 10) /))
@@ -539,4 +539,83 @@
     'tauy', 'Meridional wind stress', 'Pa', (/ ('', i=1, 10) /))
 
+!AI Ecrad 3Deffect
+#ifdef CPP_ECRAD
+  TYPE(ctrl_out), SAVE :: o_cloud_cover_sw = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'cloud_cover_sw', 'Ecrad SW cloud cover', '-', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_cloud_cover_sw_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'cloud_cover_sw_s2', 'Ecrad SW cloud cover 2 call', '-', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_sols_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'sols_s2', 'Solar rad. at surf.', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_sols0_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'sols0_s2', 'Solar rad. at surf.', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_soll_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'soll_s2', 'IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_soll0_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'soll0_s2', 'IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_tops_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'tops_s2', 'Solar rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_tops0_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'tops0_s2', 'CS Solar rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_topl_s2 = ctrl_out((/ 11, 11, 10, 11, 10, 10, 11, 11, 11, 11/), &
+    'topl_s2', 'IR rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_topl0_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'topl0_s2', 'IR rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWupTOA_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'SWupTOA_s2', 'SWup at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWupTOAclr_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'SWupTOAclr_s2', 'SWup clear sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWupTOAcleanclr_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'SWupTOAcleanclr_s2', 'SWup clear sky clean (no aerosol) at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWdnTOA_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'SWdnTOA_s2', 'SWdn at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWdnTOAclr_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'SWdnTOAclr_s2', 'SWdn clear sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_nettop_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'nettop_s2', 'Net dn radiatif flux at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_LWdnSFC_s2 = ctrl_out((/ 11, 11, 10, 10, 11, 10, 11, 11, 11, 11/), &
+    'LWdnSFC_s2', 'Down. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_LWdnSFCclr_s2 = ctrl_out((/ 11, 11, 10, 10, 11, 10, 11, 11, 11, 11/), &
+    'LWdnSFCclr_s2', 'Down. CS IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWupSFC_s2 = ctrl_out((/ 11, 11, 10, 10, 11, 10, 11, 11, 11, 11/), &
+    'SWupSFC_s2', 'SWup at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWupSFCclr_s2 = ctrl_out((/ 11, 11, 10, 10, 11, 10, 11, 11, 11, 11/), &
+    'SWupSFCclr_s2', 'SWup clear sky at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWupSFCcleanclr_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'SWupSFCcleanclr_s2', 'SWup clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_fdiffSWdnSFC_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'fdiffSWdnSFC_s2', 'Fraction of diffuse SWdn at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWdnSFC_s2 = ctrl_out((/ 11, 11, 11, 10, 11, 10, 11, 11, 11, 11/), &
+    'SWdnSFC_s2', 'SWdn at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWdnSFCclr_s2 = ctrl_out((/ 11, 11, 10, 10, 11, 10, 11, 11, 11, 11/), &
+    'SWdnSFCclr_s2', 'SWdn clear sky at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_SWdnSFCcleanclr_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'SWdnSFCcleanclr_s2', 'SWdn clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_LWupSFC_s2 = ctrl_out((/ 11, 11, 10, 10, 11, 10, 11, 11, 11, 11/), &
+    'LWupSFC_s2', 'Upwd. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_LWupSFCclr_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'LWupSFCclr_s2', 'CS Upwd. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_LWupTOAcleanclr_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'LWupTOAcleanclr_s2', 'Upward CS clean (no aerosol) IR rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_LWdnSFCcleanclr_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'LWdnSFCcleanclr_s2', 'Downward CS clean (no aerosol) IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rsu_s2 = ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'rsu_s2', 'SW upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rsd_s2 = ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'rsd_s2', 'SW downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rlu_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'rlu_s2', 'LW upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rld_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'rld_s2', 'LW downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rsucs_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'rsucs_s2', 'SW CS upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rsdcs_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'rsdcs_s2', 'SW CS downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rlucs_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'rlucs_s2', 'LW CS upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_rldcs_s2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+    'rldcs_s2', 'LW CS downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+#endif
+
+
   TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_taux_srf = (/           &
       ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'taux_ter',             &
@@ -754,4 +833,6 @@
   TYPE(ctrl_out), SAVE :: o_prbsw = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     'prbsw', 'Precipitable blowing snow', 'kg/m2', (/ ('', i=1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_water_budget = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
+    'water_budget', 'Water budget', 'kg/m2', (/ ('', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_s_pblh = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     's_pblh', 'Boundary Layer Height', 'm', (/ ('', i=1, 10) /))
@@ -1487,5 +1568,5 @@
     'qrainlsc', 'LS specific rain content', 'kg/kg', (/ ('', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsnowlsc = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'qsnowlsc', 'LS specific snow content', 'kg/kg', (/ ('', i=1, 10) /)) 
+    'qsnowlsc', 'LS specific snow content', 'kg/kg', (/ ('', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqreva = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
     'dqreva', 'LS rain tendency due to evaporation', 'kg/kg/s', (/ ('', i=1, 10) /))
@@ -2122,5 +2203,5 @@
 
 #ifdef CPP_Dust
-#include "Dust/spla_output_dat.h"
+      INCLUDE 'spla_output_dat.h'
 #endif
 
