Index: /LMDZ5/trunk/libf/phylmd/aero_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/aero_mod.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/aero_mod.F90	(revision 2146)
@@ -6,20 +6,24 @@
 ! 1/ Total number of aerosols for which an aerosol optical depth is provided
 !--strat aerosols are only prescribed naero_tot = 10 ==> 11 
+!--adding nitrate naero_tot = 14 OB
 
-  INTEGER, PARAMETER :: naero_tot = 11
+  INTEGER, PARAMETER :: naero_tot = 14
 
 ! Identification number used in aeropt_2bands and aeropt_5wv
 ! corresponding to naero_tot
-  INTEGER, PARAMETER :: id_ASBCM    = 1
-  INTEGER, PARAMETER :: id_ASPOMM   = 2
-  INTEGER, PARAMETER :: id_ASSO4M   = 3
-  INTEGER, PARAMETER :: id_CSSO4M   = 4
-  INTEGER, PARAMETER :: id_SSSSM    = 5
-  INTEGER, PARAMETER :: id_CSSSM    = 6
-  INTEGER, PARAMETER :: id_ASSSM    = 7
-  INTEGER, PARAMETER :: id_CIDUSTM  = 8
-  INTEGER, PARAMETER :: id_AIBCM    = 9
-  INTEGER, PARAMETER :: id_AIPOMM   = 10
-  INTEGER, PARAMETER :: id_STRAT   = 11
+  INTEGER, PARAMETER :: id_ASBCM_phy    = 1
+  INTEGER, PARAMETER :: id_ASPOMM_phy   = 2
+  INTEGER, PARAMETER :: id_ASSO4M_phy   = 3
+  INTEGER, PARAMETER :: id_CSSO4M_phy   = 4
+  INTEGER, PARAMETER :: id_SSSSM_phy    = 5
+  INTEGER, PARAMETER :: id_CSSSM_phy    = 6
+  INTEGER, PARAMETER :: id_ASSSM_phy    = 7
+  INTEGER, PARAMETER :: id_CIDUSTM_phy  = 8
+  INTEGER, PARAMETER :: id_AIBCM_phy    = 9
+  INTEGER, PARAMETER :: id_AIPOMM_phy   = 10
+  INTEGER, PARAMETER :: id_ASNO3M_phy   = 11
+  INTEGER, PARAMETER :: id_CSNO3M_phy   = 12
+  INTEGER, PARAMETER :: id_CINO3M_phy   = 13
+  INTEGER, PARAMETER :: id_STRAT_phy    = 14
 
 ! Corresponding names for the aerosols
@@ -35,4 +39,7 @@
        "AIBCM  ", &
        "AIPOMM ", &
+       "ASNO3M ", & 
+       "CSNO3M ", &
+       "CINO3M ", &
        "STRAT  " /)
 
@@ -66,10 +73,12 @@
   ! 9 = NO3    
 
-! Number of  wavelengths
+! Number of diagnostics wavelengths (5 SW + 1 LW @ 10 um)
   INTEGER, PARAMETER :: nwave = 5
+  INTEGER, PARAMETER :: nwave_lw = 1
 
 ! Number of modes spectral bands
   INTEGER, parameter :: nbands = 2
-  INTEGER, parameter :: nbands_rrtm = 6
+  INTEGER, parameter :: nbands_sw_rrtm = 6
+  INTEGER, parameter :: nbands_lw_rrtm = 16
 
 END MODULE aero_mod
Index: /LMDZ5/trunk/libf/phylmd/aeropt_2bands.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/aeropt_2bands.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/aeropt_2bands.F90	(revision 2146)
@@ -29,7 +29,7 @@
   REAL, DIMENSION(klon,klev),     INTENT(in)  :: pdel
   REAL,                           INTENT(in)  :: delt
-  REAL, DIMENSION(klon,klev,naero_spc),   INTENT(in)  :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_tot),   INTENT(in)  :: m_allaer
 !RAF
-  REAL, DIMENSION(klon,klev,naero_spc),   INTENT(in)  :: m_allaer_pi
+  REAL, DIMENSION(klon,klev,naero_tot),   INTENT(in)  :: m_allaer_pi
   REAL, DIMENSION(klon,klev),     INTENT(in)  :: RHcl       ! humidite relative ciel clair
 !RAF  REAL, DIMENSION(klon,naero_tot),INTENT(in)  :: fractnat_allaer
@@ -136,7 +136,7 @@
   INTEGER, ALLOCATABLE, DIMENSION(:)   :: aerosol_name
   INTEGER :: nb_aer
-  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp
+  REAL, DIMENSION(klon,klev,naero_tot) :: mass_temp
 !RAF
-  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp_pi
+  REAL, DIMENSION(klon,klev,naero_tot) :: mass_temp_pi
 
   !
@@ -607,39 +607,39 @@
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M
-     aerosol_name(2) = id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy
+     aerosol_name(2) = id_CSSO4M_phy
   ELSEIF (flag_aerosol .EQ. 2) THEN
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASBCM
-     aerosol_name(2) = id_AIBCM
+     aerosol_name(1) = id_ASBCM_phy
+     aerosol_name(2) = id_AIBCM_phy
   ELSEIF (flag_aerosol .EQ. 3) THEN 
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASPOMM
-     aerosol_name(2) = id_AIPOMM
+     aerosol_name(1) = id_ASPOMM_phy
+     aerosol_name(2) = id_AIPOMM_phy
   ELSEIF (flag_aerosol .EQ. 4) THEN 
      nb_aer = 3
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CSSSM
-     aerosol_name(2) = id_SSSSM
-     aerosol_name(3) = id_ASSSM
+     aerosol_name(1) = id_CSSSM_phy
+     aerosol_name(2) = id_SSSSM_phy
+     aerosol_name(3) = id_ASSSM_phy
   ELSEIF (flag_aerosol .EQ. 5) THEN 
      nb_aer = 1
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CIDUSTM
+     aerosol_name(1) = id_CIDUSTM_phy
   ELSEIF (flag_aerosol .EQ. 6) THEN 
      nb_aer = 10
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M      
-     aerosol_name(2) = id_ASBCM
-     aerosol_name(3) = id_AIBCM
-     aerosol_name(4) = id_ASPOMM
-     aerosol_name(5) = id_AIPOMM
-     aerosol_name(6) = id_CSSSM
-     aerosol_name(7) = id_SSSSM
-     aerosol_name(8) = id_ASSSM
-     aerosol_name(9) = id_CIDUSTM
-     aerosol_name(10)= id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy
+     aerosol_name(2) = id_ASBCM_phy
+     aerosol_name(3) = id_AIBCM_phy
+     aerosol_name(4) = id_ASPOMM_phy
+     aerosol_name(5) = id_AIPOMM_phy
+     aerosol_name(6) = id_CSSSM_phy
+     aerosol_name(7) = id_SSSSM_phy
+     aerosol_name(8) = id_ASSSM_phy
+     aerosol_name(9) = id_CIDUSTM_phy
+     aerosol_name(10)= id_CSSO4M_phy
   ENDIF
 
@@ -678,43 +678,43 @@
   DO m=1,nb_aer   ! tau is only computed for each mass
     fac=1.0
-     IF (aerosol_name(m).EQ.id_ASBCM) THEN
+     IF (aerosol_name(m).EQ.id_ASBCM_phy) THEN
          soluble=.TRUE.
          spsol=1
          spss=0
-     ELSEIF (aerosol_name(m).EQ.id_ASPOMM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_ASPOMM_phy) THEN 
         soluble=.TRUE.
         spsol=2 
         spss=0
-     ELSEIF (aerosol_name(m).EQ.id_ASSO4M) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_ASSO4M_phy) THEN 
         soluble=.TRUE.
         spsol=3
         spss=0
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-     ELSEIF  (aerosol_name(m).EQ.id_CSSO4M) THEN
+     ELSEIF  (aerosol_name(m).EQ.id_CSSO4M_phy) THEN
         soluble=.TRUE.
         spsol=4
         spss=0
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-     ELSEIF (aerosol_name(m).EQ.id_SSSSM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_SSSSM_phy) THEN 
          soluble=.TRUE.
          spsol=5
          spss=3
-     ELSEIF (aerosol_name(m).EQ.id_CSSSM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_CSSSM_phy) THEN 
          soluble=.TRUE.
          spsol=6
          spss=2
-     ELSEIF (aerosol_name(m).EQ.id_ASSSM) THEN
+     ELSEIF (aerosol_name(m).EQ.id_ASSSM_phy) THEN
          soluble=.TRUE.
          spsol=7
          spss=1
-     ELSEIF (aerosol_name(m).EQ.id_CIDUSTM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_CIDUSTM_phy) THEN 
          soluble=.FALSE.
          spinsol=1
          spss=0
-     ELSEIF  (aerosol_name(m).EQ.id_AIBCM) THEN 
+     ELSEIF  (aerosol_name(m).EQ.id_AIBCM_phy) THEN 
          soluble=.FALSE.
          spinsol=2
          spss=0
-     ELSEIF (aerosol_name(m).EQ.id_AIPOMM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_AIPOMM_phy) THEN 
          soluble=.FALSE.
          spinsol=3
@@ -944,34 +944,34 @@
         DO k=1, KLEV
           DO i=1, KLON
-            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASSO4M,inu)+tau_ae(i,k,id_CSSO4M,inu)+ &
-                                           tau_ae(i,k,id_ASBCM,inu)+tau_ae(i,k,id_AIBCM,inu)+   &						     
-                                           tau_ae(i,k,id_ASPOMM,inu)+tau_ae(i,k,id_AIPOMM,inu)+ &	
-                                           tau_ae(i,k,id_ASSSM,inu)+tau_ae(i,k,id_CSSSM,inu)+   &
-                                           tau_ae(i,k,id_SSSSM,inu)+ tau_ae(i,k,id_CIDUSTM,inu)
+            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASSO4M_phy,inu)+tau_ae(i,k,id_CSSO4M_phy,inu)+ &
+                                           tau_ae(i,k,id_ASBCM_phy,inu)+tau_ae(i,k,id_AIBCM_phy,inu)+   &						     
+                                           tau_ae(i,k,id_ASPOMM_phy,inu)+tau_ae(i,k,id_AIPOMM_phy,inu)+ &	
+                                           tau_ae(i,k,id_ASSSM_phy,inu)+tau_ae(i,k,id_CSSSM_phy,inu)+   &
+                                           tau_ae(i,k,id_SSSSM_phy,inu)+ tau_ae(i,k,id_CIDUSTM_phy,inu)
 	     tau_allaer(i,k,mrfspecies,inu)=MAX(tau_allaer(i,k,mrfspecies,inu),1e-5)
                  
-             piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)+ &
-                                             tau_ae(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)+ &
-                                             tau_ae(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)+ &
-                                             tau_ae(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)+ &
-                                             tau_ae(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)+ &
-                                             tau_ae(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)+ &	
-                                             tau_ae(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)+ &
-                                             tau_ae(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)+ &
-                                             tau_ae(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)+ &
-                                             tau_ae(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)) &
+             piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)+ &
+                                             tau_ae(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)+ &
+                                             tau_ae(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)+ &
+                                             tau_ae(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)+ &
+                                             tau_ae(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)+ &
+                                             tau_ae(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)+ &	
+                                             tau_ae(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)+ &
+                                             tau_ae(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)+ &
+                                             tau_ae(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)+ &
+                                             tau_ae(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)) &
                                             /tau_allaer(i,k,mrfspecies,inu)
 	     piz_allaer(i,k,mrfspecies,inu)=MAX(piz_allaer(i,k,mrfspecies,inu),0.1)
 
-             cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)*cg_ae(i,k,id_ASSO4M,inu)+ &
-                      tau_ae(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)*cg_ae(i,k,id_CSSO4M,inu)+ &
-                      tau_ae(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)*cg_ae(i,k,id_ASBCM,inu)+ &
-                      tau_ae(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)*cg_ae(i,k,id_AIBCM,inu)+ &
-                      tau_ae(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)*cg_ae(i,k,id_ASPOMM,inu)+ &
-                      tau_ae(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)*cg_ae(i,k,id_AIPOMM,inu)+ &	
-                      tau_ae(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)*cg_ae(i,k,id_ASSSM,inu)+ &
-                      tau_ae(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)*cg_ae(i,k,id_CSSSM,inu)+ &
-                      tau_ae(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)*cg_ae(i,k,id_SSSSM,inu)+ &
-                      tau_ae(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)*cg_ae(i,k,id_CIDUSTM,inu))/ &
+             cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)*cg_ae(i,k,id_ASSO4M_phy,inu)+ &
+                      tau_ae(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)*cg_ae(i,k,id_CSSO4M_phy,inu)+ &
+                      tau_ae(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)*cg_ae(i,k,id_ASBCM_phy,inu)+ &
+                      tau_ae(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)*cg_ae(i,k,id_AIBCM_phy,inu)+ &
+                      tau_ae(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)*cg_ae(i,k,id_ASPOMM_phy,inu)+ &
+                      tau_ae(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)*cg_ae(i,k,id_AIPOMM_phy,inu)+ &	
+                      tau_ae(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)*cg_ae(i,k,id_ASSSM_phy,inu)+ &
+                      tau_ae(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)*cg_ae(i,k,id_CSSSM_phy,inu)+ &
+                      tau_ae(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)*cg_ae(i,k,id_SSSSM_phy,inu)+ &
+                      tau_ae(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)*cg_ae(i,k,id_CIDUSTM_phy,inu))/ &
                       (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,inu))
           ENDDO    
@@ -983,41 +983,41 @@
           DO i=1, KLON
 !RAF
-	 	 tau_allaer(i,k,mrfspecies,inu)=tau_ae_pi(i,k,id_ASSO4M,inu)+ &
-                      tau_ae_pi(i,k,id_CSSO4M,inu)+ &
-                      tau_ae_pi(i,k,id_ASBCM,inu)+ &
-                      tau_ae_pi(i,k,id_AIBCM,inu)+ &
-                      tau_ae_pi(i,k,id_ASPOMM,inu)+ &
-                      tau_ae_pi(i,k,id_AIPOMM,inu)+ &	
-                      tau_ae_pi(i,k,id_ASSSM,inu)+ &
-                      tau_ae_pi(i,k,id_CSSSM,inu)+ &
-                      tau_ae_pi(i,k,id_SSSSM,inu)+ &
-                      tau_ae_pi(i,k,id_CIDUSTM,inu)
+	 	 tau_allaer(i,k,mrfspecies,inu)=tau_ae_pi(i,k,id_ASSO4M_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CSSO4M_phy,inu)+ &
+                      tau_ae_pi(i,k,id_ASBCM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_AIBCM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_ASPOMM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_AIPOMM_phy,inu)+ &	
+                      tau_ae_pi(i,k,id_ASSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CSSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_SSSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CIDUSTM_phy,inu)
 	         tau_allaer(i,k,mrfspecies,inu)=MAX(tau_allaer(i,k,mrfspecies,inu),1e-5)
 
-	 	 piz_allaer(i,k,mrfspecies,inu)=(tau_ae_pi(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)+ &
-                      tau_ae_pi(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)+ &
-                      tau_ae_pi(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)+ &
-                      tau_ae_pi(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)+ &
-                      tau_ae_pi(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)+ &
-                      tau_ae_pi(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)+ &	
-                      tau_ae_pi(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)+ &
-                      tau_ae_pi(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)+ &
-                      tau_ae_pi(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)+ &
-                      tau_ae_pi(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)) &
+	 	 piz_allaer(i,k,mrfspecies,inu)=(tau_ae_pi(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)+ &
+                      tau_ae_pi(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)+ &	
+                      tau_ae_pi(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)) &
                       /tau_allaer(i,k,mrfspecies,inu)
 	         piz_allaer(i,k,mrfspecies,inu)=MAX(piz_allaer(i,k,mrfspecies,inu),0.1)
 
 	 	 cg_allaer(i,k,mrfspecies,inu)=(&
-                      tau_ae_pi(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)*cg_ae(i,k,id_ASSO4M,inu)+ &
-                      tau_ae_pi(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)*cg_ae(i,k,id_CSSO4M,inu)+ &
-                      tau_ae_pi(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)*cg_ae(i,k,id_ASBCM,inu)+ &
-                      tau_ae_pi(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)*cg_ae(i,k,id_AIBCM,inu)+ &
-                      tau_ae_pi(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)*cg_ae(i,k,id_ASPOMM,inu)+ &
-                      tau_ae_pi(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)*cg_ae(i,k,id_AIPOMM,inu)+ &
-                      tau_ae_pi(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)*cg_ae(i,k,id_ASSSM,inu)+ &
-                      tau_ae_pi(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)*cg_ae(i,k,id_CSSSM,inu)+ &
-                      tau_ae_pi(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)*cg_ae(i,k,id_SSSSM,inu)+ &
-                      tau_ae_pi(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)*&
-                      cg_ae(i,k,id_CIDUSTM,inu))/ &
+                      tau_ae_pi(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)*cg_ae(i,k,id_ASSO4M_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)*cg_ae(i,k,id_CSSO4M_phy,inu)+ &
+                      tau_ae_pi(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)*cg_ae(i,k,id_ASBCM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)*cg_ae(i,k,id_AIBCM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)*cg_ae(i,k,id_ASPOMM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)*cg_ae(i,k,id_AIPOMM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)*cg_ae(i,k,id_ASSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)*cg_ae(i,k,id_CSSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)*cg_ae(i,k,id_SSSSM_phy,inu)+ &
+                      tau_ae_pi(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)*&
+                      cg_ae(i,k,id_CIDUSTM_phy,inu))/ &
                       (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,inu))
           ENDDO
@@ -1027,12 +1027,12 @@
         DO k=1, KLEV
           DO i=1, KLON
-	    tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASBCM,inu)+tau_ae(i,k,id_AIBCM,inu)
+	    tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASBCM_phy,inu)+tau_ae(i,k,id_AIBCM_phy,inu)
 	    tau_allaer(i,k,mrfspecies,inu)=MAX(tau_allaer(i,k,mrfspecies,inu),1e-5)
-	    piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu) &
-                      +tau_ae(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu))/ &
+	    piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu) &
+                      +tau_ae(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu))/ &
                       tau_allaer(i,k,mrfspecies,inu)
 	    piz_allaer(i,k,mrfspecies,inu)=MAX(piz_allaer(i,k,mrfspecies,inu),0.1)
-            cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu) *cg_ae(i,k,id_ASBCM,inu)&
-                      +tau_ae(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)*cg_ae(i,k,id_AIBCM,inu))/ &
+            cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu) *cg_ae(i,k,id_ASBCM_phy,inu)&
+                      +tau_ae(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)*cg_ae(i,k,id_AIBCM_phy,inu))/ &
                       (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,inu))
           ENDDO
@@ -1043,12 +1043,12 @@
         DO k=1, KLEV
           DO i=1, KLON
-            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASSO4M,inu)+tau_ae(i,k,id_CSSO4M,inu)
+            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASSO4M_phy,inu)+tau_ae(i,k,id_CSSO4M_phy,inu)
 	    tau_allaer(i,k,mrfspecies,inu)=MAX(tau_allaer(i,k,mrfspecies,inu),1e-5)
-            piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu) &
-                      +tau_ae(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu))/ &
+            piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu) &
+                      +tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu))/ &
                       tau_allaer(i,k,mrfspecies,inu)
 	    piz_allaer(i,k,mrfspecies,inu)=MAX(piz_allaer(i,k,mrfspecies,inu),0.1)
-            cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu) *cg_ae(i,k,id_CSSO4M,inu)&
-                      +tau_ae(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)*cg_ae(i,k,id_ASSO4M,inu))/ &
+            cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu) *cg_ae(i,k,id_CSSO4M_phy,inu)&
+                      +tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)*cg_ae(i,k,id_ASSO4M_phy,inu))/ &
                       (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,inu))
           ENDDO
@@ -1059,12 +1059,12 @@
         DO k=1, KLEV
           DO i=1, KLON
-            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASPOMM,inu)+tau_ae(i,k,id_AIPOMM,inu)
+            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASPOMM_phy,inu)+tau_ae(i,k,id_AIPOMM_phy,inu)
             tau_allaer(i,k,mrfspecies,inu)=MAX(tau_allaer(i,k,mrfspecies,inu),1e-5)
-	    piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu) &
-                      +tau_ae(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu))/ &
+	    piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu) &
+                      +tau_ae(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu))/ &
                       tau_allaer(i,k,mrfspecies,inu)
 	    piz_allaer(i,k,mrfspecies,inu)=MAX(piz_allaer(i,k,mrfspecies,inu),0.1)
-	    cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu) *cg_ae(i,k,id_ASPOMM,inu)&
-                      +tau_ae(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)*cg_ae(i,k,id_AIPOMM,inu))/ &
+	    cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu) *cg_ae(i,k,id_ASPOMM_phy,inu)&
+                      +tau_ae(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)*cg_ae(i,k,id_AIPOMM_phy,inu))/ &
                       (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,inu))
           ENDDO
@@ -1075,8 +1075,8 @@
         DO k=1, KLEV
           DO i=1, KLON
-            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_CIDUSTM,inu)
+            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_CIDUSTM_phy,inu)
 	    tau_allaer(i,k,mrfspecies,inu)=MAX(tau_allaer(i,k,mrfspecies,inu),1e-5)
-            piz_allaer(i,k,mrfspecies,inu)=piz_ae(i,k,id_CIDUSTM,inu)
-	    cg_allaer(i,k,mrfspecies,inu)=cg_ae(i,k,id_CIDUSTM,inu)
+            piz_allaer(i,k,mrfspecies,inu)=piz_ae(i,k,id_CIDUSTM_phy,inu)
+	    cg_allaer(i,k,mrfspecies,inu)=cg_ae(i,k,id_CIDUSTM_phy,inu)
           ENDDO
         ENDDO
@@ -1086,14 +1086,14 @@
         DO k=1, KLEV
           DO i=1, KLON
-            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASSSM,inu)+tau_ae(i,k,id_CSSSM,inu)+tau_ae(i,k,id_SSSSM,inu)
+            tau_allaer(i,k,mrfspecies,inu)=tau_ae(i,k,id_ASSSM_phy,inu)+tau_ae(i,k,id_CSSSM_phy,inu)+tau_ae(i,k,id_SSSSM_phy,inu)
             tau_allaer(i,k,mrfspecies,inu)=MAX(tau_allaer(i,k,mrfspecies,inu),1e-5)
-            piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu) &
-                    +tau_ae(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu) &
-                    +tau_ae(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu))/ &
+            piz_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu) &
+                    +tau_ae(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu) &
+                    +tau_ae(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu))/ &
                     tau_allaer(i,k,mrfspecies,inu)
             piz_allaer(i,k,mrfspecies,inu)=MAX(piz_allaer(i,k,mrfspecies,inu),0.1)
-            cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu) *cg_ae(i,k,id_ASSSM,inu)&
-                    +tau_ae(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)*cg_ae(i,k,id_CSSSM,inu) &
-                    +tau_ae(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)*cg_ae(i,k,id_SSSSM,inu))/ &
+            cg_allaer(i,k,mrfspecies,inu)=(tau_ae(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu) *cg_ae(i,k,id_ASSSM_phy,inu)&
+                    +tau_ae(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)*cg_ae(i,k,id_CSSSM_phy,inu) &
+                    +tau_ae(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)*cg_ae(i,k,id_SSSSM_phy,inu))/ &
                     (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,inu))
           ENDDO
Index: /LMDZ5/trunk/libf/phylmd/aeropt_5wv.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/aeropt_5wv.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/aeropt_5wv.F90	(revision 2146)
@@ -57,5 +57,5 @@
   REAL, DIMENSION(klon,klev), INTENT(in)   :: pdel
   REAL, INTENT(in)                         :: delt
-  REAL, DIMENSION(klon,klev,naero_spc), INTENT(in) :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_tot), INTENT(in) :: m_allaer
   REAL, DIMENSION(klon,klev), INTENT(in)   :: RHcl     ! humidite relative ciel clair
   INTEGER,INTENT(in)                       :: flag_aerosol
@@ -67,6 +67,8 @@
   !
   REAL, DIMENSION(klon), INTENT(out)          :: ai      ! POLDER aerosol index 
-  REAL, DIMENSION(klon,nwave,naero_spc), INTENT(out)      :: tausum
-  REAL, DIMENSION(klon,klev,nwave,naero_spc), INTENT(out) :: tau
+!  REAL, DIMENSION(klon,nwave,naero_spc), INTENT(out)      :: tausum
+!  REAL, DIMENSION(klon,klev,nwave,naero_spc), INTENT(out) :: tau
+  REAL, DIMENSION(klon,nwave,naero_tot), INTENT(out)      :: tausum
+  REAL, DIMENSION(klon,klev,nwave,naero_tot), INTENT(out) :: tau
 
 
@@ -77,5 +79,5 @@
   LOGICAL :: soluble
   
-  INTEGER :: i, k, ierr, m
+  INTEGER :: i, k, ierr, m, aerindex
   INTEGER :: spsol, spinsol, spss, la
   INTEGER :: RH_num(klon,klev)
@@ -156,5 +158,5 @@
   REAL :: piz_aeri_5wv(las,naero_insoluble)           ! Insoluble comp. 1- Dust: 2- BC; 3- POM
 
-  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp
+  REAL, DIMENSION(klon,klev,naero_tot) :: mass_temp
   
   !
@@ -639,39 +641,39 @@
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M
-     aerosol_name(2) = id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy
+     aerosol_name(2) = id_CSSO4M_phy
   ELSEIF (flag_aerosol .EQ. 2) THEN
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASBCM
-     aerosol_name(2) = id_AIBCM
+     aerosol_name(1) = id_ASBCM_phy
+     aerosol_name(2) = id_AIBCM_phy
   ELSEIF (flag_aerosol .EQ. 3) THEN 
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASPOMM
-     aerosol_name(2) = id_AIPOMM
+     aerosol_name(1) = id_ASPOMM_phy
+     aerosol_name(2) = id_AIPOMM_phy
   ELSEIF (flag_aerosol .EQ. 4) THEN 
      nb_aer = 3
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CSSSM
-     aerosol_name(2) = id_SSSSM
-     aerosol_name(3) = id_ASSSM
+     aerosol_name(1) = id_CSSSM_phy
+     aerosol_name(2) = id_SSSSM_phy
+     aerosol_name(3) = id_ASSSM_phy
   ELSEIF (flag_aerosol .EQ. 5) THEN 
      nb_aer = 1
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CIDUSTM
+     aerosol_name(1) = id_CIDUSTM_phy
   ELSEIF (flag_aerosol .EQ. 6) THEN 
      nb_aer = 10
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M      
-     aerosol_name(2) = id_ASBCM
-     aerosol_name(3) = id_AIBCM
-     aerosol_name(4) = id_ASPOMM
-     aerosol_name(5) = id_AIPOMM
-     aerosol_name(6) = id_CSSSM
-     aerosol_name(7) = id_SSSSM
-     aerosol_name(8) = id_ASSSM
-     aerosol_name(9) = id_CIDUSTM
-     aerosol_name(10) = id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy
+     aerosol_name(2) = id_ASBCM_phy
+     aerosol_name(3) = id_AIBCM_phy
+     aerosol_name(4) = id_ASPOMM_phy
+     aerosol_name(5) = id_AIPOMM_phy
+     aerosol_name(6) = id_CSSSM_phy
+     aerosol_name(7) = id_SSSSM_phy
+     aerosol_name(8) = id_ASSSM_phy
+     aerosol_name(9) = id_CIDUSTM_phy
+     aerosol_name(10) = id_CSSO4M_phy
   ENDIF
 
@@ -712,43 +714,43 @@
   DO m=1,nb_aer   ! tau is only computed for each mass    
     fac=1.0
-    IF (aerosol_name(m).EQ.id_ASBCM) THEN
+    IF (aerosol_name(m).EQ.id_ASBCM_phy) THEN
         soluble=.TRUE.
         spsol=1
         spss=0
-    ELSEIF (aerosol_name(m).EQ.id_ASPOMM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_ASPOMM_phy) THEN 
         soluble=.TRUE.
         spsol=2 
         spss=0
-    ELSEIF (aerosol_name(m).EQ.id_ASSO4M) THEN
+    ELSEIF (aerosol_name(m).EQ.id_ASSO4M_phy) THEN
         soluble=.TRUE.
         spsol=3
         spss=0
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-    ELSEIF (aerosol_name(m).EQ.id_CSSO4M) THEN
+    ELSEIF (aerosol_name(m).EQ.id_CSSO4M_phy) THEN
         soluble=.TRUE.
         spsol=4
         spss=0
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-    ELSEIF (aerosol_name(m).EQ.id_SSSSM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_SSSSM_phy) THEN 
         soluble=.TRUE.
         spsol=5
         spss=3
-    ELSEIF (aerosol_name(m).EQ.id_CSSSM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_CSSSM_phy) THEN 
         soluble=.TRUE.
         spsol=6
         spss=2
-    ELSEIF (aerosol_name(m).EQ.id_ASSSM) THEN
+    ELSEIF (aerosol_name(m).EQ.id_ASSSM_phy) THEN
         soluble=.TRUE.
         spsol=7
         spss=1
-    ELSEIF (aerosol_name(m).EQ.id_CIDUSTM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_CIDUSTM_phy) THEN 
         soluble=.FALSE.
         spinsol=1
         spss=0
-    ELSEIF  (aerosol_name(m).EQ.id_AIBCM) THEN 
+    ELSEIF  (aerosol_name(m).EQ.id_AIBCM_phy) THEN 
         soluble=.FALSE.
         spinsol=2
         spss=0
-    ELSEIF (aerosol_name(m).EQ.id_AIPOMM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_AIPOMM_phy) THEN 
         soluble=.FALSE.
         spinsol=3
@@ -765,4 +767,6 @@
       used_tau(naero_soluble+spinsol)=.TRUE.
     ENDIF
+
+    aerindex=aerosol_name(m)
 
     DO la=1,las
@@ -779,7 +783,7 @@
                 H=rh(i,k)/100
                 tau_ae5wv_int=A1_ASSSM(k)+A2_ASSSM(k)*H+A3_ASSSM(k)/(H-1.05)
-                tau(i,k,la,spsol) = mass_temp(i,k,spsol)*1000.*zdp1(i,k)   &
+                tau(i,k,la,aerindex) = mass_temp(i,k,aerindex)*1000.*zdp1(i,k)   &
                                    *tau_ae5wv_int*delt*fac
-                tausum(i,la,spsol)=tausum(i,la,spsol)+tau(i,k,la,spsol)
+                tausum(i,la,aerindex)=tausum(i,la,aerindex)+tau(i,k,la,aerindex)
               ENDDO
             ENDDO
@@ -794,7 +798,7 @@
                 H=rh(i,k)/100
                 tau_ae5wv_int=A1_CSSSM(k)+A2_CSSSM(k)*H+A3_CSSSM(k)/(H-1.05)
-                tau(i,k,la,spsol) = mass_temp(i,k,spsol)*1000.*zdp1(i,k)  &
+                tau(i,k,la,aerindex) = mass_temp(i,k,aerindex)*1000.*zdp1(i,k)  &
                                    *tau_ae5wv_int*delt*fac
-                tausum(i,la,spsol) = tausum(i,la,spsol)+tau(i,k,la,spsol)
+                tausum(i,la,aerindex) = tausum(i,la,aerindex)+tau(i,k,la,aerindex)
               ENDDO
             ENDDO
@@ -809,7 +813,7 @@
                 H=rh(i,k)/100
                 tau_ae5wv_int=A1_SSSSM(k)+A2_SSSSM(k)*H+A3_SSSSM(k)/(H-1.05)
-                tau(i,k,la,spsol) = mass_temp(i,k,spsol)*1000.*zdp1(i,k)  &
+                tau(i,k,la,aerindex) = mass_temp(i,k,aerindex)*1000.*zdp1(i,k)  &
                                    *tau_ae5wv_int*delt*fac
-                tausum(i,la,spsol)=tausum(i,la,spsol)+tau(i,k,la,spsol)
+                tausum(i,la,aerindex)=tausum(i,la,aerindex)+tau(i,k,la,aerindex)
               ENDDO
             ENDDO
@@ -824,7 +828,7 @@
                               alpha_aers_5wv(RH_num(i,k),la,spsol))
 
-              tau(i,k,la,spsol) = mass_temp(i,k,spsol)*1000.*zdp1(i,k)   &
+              tau(i,k,la,aerindex) = mass_temp(i,k,aerindex)*1000.*zdp1(i,k)   &
                                  *tau_ae5wv_int*delt*fac
-              tausum(i,la,spsol)=tausum(i,la,spsol)+tau(i,k,la,spsol)
+              tausum(i,la,aerindex)=tausum(i,la,aerindex)+tau(i,k,la,aerindex)
             ENDDO
           ENDDO
@@ -836,8 +840,7 @@
           DO i=1, KLON
             tau_ae5wv_int = alpha_aeri_5wv(la,spinsol)
-            tau(i,k,la,naero_soluble+spinsol) = mass_temp(i,k,naero_soluble+spinsol)*1000.*zdp1(i,k)* &
+            tau(i,k,la,aerindex) = mass_temp(i,k,aerindex)*1000.*zdp1(i,k)* &
                                                 tau_ae5wv_int*delt*fac
-            tausum(i,la,naero_soluble+spinsol)= tausum(i,la,naero_soluble+spinsol)  &
-                                               +tau(i,k,la,naero_soluble+spinsol)
+            tausum(i,la,aerindex)= tausum(i,la,aerindex)+tau(i,k,la,aerindex)
           ENDDO
         ENDDO
@@ -880,7 +883,7 @@
   END DO
   
-   od550lt1aer(:)=tausum(:,2,id_ASSO4M)+tausum(:,2,id_ASBCM)+tausum(:,2,id_AIBCM)+ &
-	tausum(:,2,id_ASPOMM)+tausum(:,2,id_AIPOMM)+tausum(:,2,id_ASSSM)+ &
-	0.03*tausum(:,2,id_CSSSM)+0.4*tausum(:,2,id_CIDUSTM)
+   od550lt1aer(:)=tausum(:,2,id_ASSO4M_phy)+tausum(:,2,id_ASBCM_phy)+tausum(:,2,id_AIBCM_phy)+ &
+	tausum(:,2,id_ASPOMM_phy)+tausum(:,2,id_AIPOMM_phy)+tausum(:,2,id_ASSSM_phy)+ &
+	0.03*tausum(:,2,id_CSSSM_phy)+0.4*tausum(:,2,id_CIDUSTM_phy)
 
 
Index: /LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 2146)
@@ -96,4 +96,11 @@
       REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
       !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
+! LW radiation diagnostics CK
+      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
+      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
+      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
+      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
+      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
+      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
 ! Special RRTM
       REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
@@ -140,4 +147,6 @@
       REAL, SAVE, ALLOCATABLE :: sconcso4(:) 
       !$OMP THREADPRIVATE(sconcso4) 
+      REAL, SAVE, ALLOCATABLE :: sconcno3(:) 
+      !$OMP THREADPRIVATE(sconcno3) 
       REAL, SAVE, ALLOCATABLE :: sconcoa(:) 
       !$OMP THREADPRIVATE(sconcoa) 
@@ -150,4 +159,6 @@
       REAL, SAVE, ALLOCATABLE :: concso4(:,:) 
       !$OMP THREADPRIVATE(concso4) 
+      REAL, SAVE, ALLOCATABLE :: concno3(:,:) 
+      !$OMP THREADPRIVATE(concno3) 
       REAL, SAVE, ALLOCATABLE :: concoa(:,:) 
       !$OMP THREADPRIVATE(concoa) 
@@ -197,4 +208,11 @@
 !$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
 
+! additional LW variables CK
+      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
+!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
+      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
+!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
+      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
+!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
 
 !Ajout de celles nécessaires au phys_output_write_mod
@@ -337,4 +355,9 @@
       allocate(topswai_aero(klon), solswai_aero(klon))
       allocate(topswad0_aero(klon), solswad0_aero(klon))
+     ! LW diagnostics CK
+      allocate(toplwad_aero(klon), sollwad_aero(klon))
+      allocate(toplwai_aero(klon), sollwai_aero(klon))
+      allocate(toplwad0_aero(klon), sollwad0_aero(klon))
+      ! end
       allocate(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
       allocate(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
@@ -363,4 +386,5 @@
       allocate(od550lt1aer(klon))	 	 
       allocate(sconcso4(klon))
+      allocate(sconcno3(klon))
       allocate(sconcoa(klon))
       allocate(sconcbc(klon))
@@ -368,4 +392,5 @@
       allocate(sconcdust(klon))
       allocate(concso4(klon,klev))
+      allocate(concno3(klon,klev))
       allocate(concoa(klon,klev))
       allocate(concbc(klon,klev))
@@ -392,4 +417,9 @@
       ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
       ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
+
+! additional LW variables CK
+      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
+      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
+      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
 
 ! FH Ajout de celles nécessaires au phys_output_write_mod
@@ -496,4 +526,9 @@
       deallocate(topswai_aero,solswai_aero)
       deallocate(topswad0_aero,solswad0_aero)
+      ! LW additional CK
+      deallocate(toplwad_aero,sollwad_aero)
+      deallocate(toplwai_aero,sollwai_aero)
+      deallocate(toplwad0_aero,sollwad0_aero)
+      ! end
       deallocate(topsw_aero,solsw_aero)
       deallocate(topsw0_aero,solsw0_aero)
@@ -517,4 +552,5 @@
       deallocate(od550lt1aer)
       deallocate(sconcso4) 
+      deallocate(sconcno3) 
       deallocate(sconcoa) 
       deallocate(sconcbc) 
@@ -522,4 +558,5 @@
       deallocate(sconcdust) 
       deallocate(concso4) 
+      deallocate(concno3) 
       deallocate(concoa) 
       deallocate(concbc) 
@@ -549,4 +586,8 @@
       deallocate(topswcf_aerop, solswcf_aerop)
 
+!CK LW diagnostics
+      deallocate(toplwad_aerop, sollwad_aerop)
+      deallocate(toplwai_aerop, sollwai_aerop)
+      deallocate(toplwad0_aerop, sollwad0_aerop)
 
 ! FH Ajout de celles nécessaires au phys_output_write_mod
Index: /LMDZ5/trunk/libf/phylmd/phys_output_ctrlout_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 2146)
@@ -3,5 +3,5 @@
   USE phys_output_var_mod
   USE indice_sol_mod
-  USE aero_mod, only : naero_tot,name_aero_tau
+  USE aero_mod
 
 
@@ -736,28 +736,51 @@
   TYPE(ctrl_out), SAVE :: o_solswai = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), &
     'solswai', 'AIE at SFR', 'W/m2', (/ ('', i=1, 9) /))
-
-  type(ctrl_out),save,dimension(naero_tot) :: o_tausumaero  =                           & 
-    (/ ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_ASBCM',                        &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(1),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_ASPOMM',                       &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_ASSO4M',                       &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(3),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_CSSO4M',                       &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(4),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_SSSSM',                        &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(5),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_ASSSM',                        &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(6),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_CSSSM',                        &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(7),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_CIDUSTM',                      &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(8),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_AIBCM',                        &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(9),"1", (/ ('', i=1, 9) /)), &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_AIPOMM',                       &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(10),"1", (/ ('', i=1, 9) /)),&
-       ctrl_out((/ 2, 2, 10, 10, 10, 10, 11, 11, 11 /),'OD550_STRAT',                        &
-      "Aerosol Optical depth at 550 nm "//name_aero_tau(11),"1", (/ ('', i=1, 9) /)) /)
+  TYPE(ctrl_out), SAVE :: o_toplwad = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), &
+    'toplwad', 'LW-ADE at TOA', 'W/m2', (/ ('', i=1, 9) /))
+  TYPE(ctrl_out), SAVE :: o_toplwad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), &
+    'toplwad0', 'LW-ADE clear-sky at TOA', 'W/m2', (/ ('', i=1, 9) /))
+  TYPE(ctrl_out), SAVE :: o_toplwai = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), &
+    'toplwai', 'LW-AIE at TOA', 'W/m2', (/ ('', i=1, 9) /))
+  TYPE(ctrl_out), SAVE :: o_sollwad = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), &
+    'sollwad', 'LW-ADE at SRF', 'W/m2', (/ ('', i=1, 9) /))
+  TYPE(ctrl_out), SAVE :: o_sollwad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), &
+    'sollwad0', 'LW-ADE clear-sky at SRF', 'W/m2', (/ ('', i=1, 9) /))
+  TYPE(ctrl_out), SAVE :: o_sollwai = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), &
+    'sollwai', 'LW-AIE at SFR', 'W/m2', (/ ('', i=1, 9) /))
+
+  type(ctrl_out),save,dimension(naero_tot) :: o_tausumaero =                           &
+    (/ ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(1),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(1),"1", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(2),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"2", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(3),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"3", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(4),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"4", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(5),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"5", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(6),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"6", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(7),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"7", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(8),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"8", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(9),      &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"9", (/ ('', i=1, 9) /)),    &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(10),     &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"10", (/ ('', i=1, 9) /)),   &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(11),     &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"11", (/ ('', i=1, 9) /)),   &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(12),     &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"12", (/ ('', i=1, 9) /)),   &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(13),     &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"13", (/ ('', i=1, 9) /)),   &
+       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /),'OD550_'//name_aero_tau(14),     &
+      "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"14", (/ ('', i=1, 9) /))   /)
+
+
+!
+  TYPE(ctrl_out), SAVE :: o_tausumaero_lw = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
+    'OD_10um_STRAT', 'Stratospheric Aerosol Optical depth at 10 um ', '1', (/ ('', i=1, 9) /))
 !
   TYPE(ctrl_out), SAVE :: o_od550aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
@@ -771,4 +794,6 @@
   TYPE(ctrl_out), SAVE :: o_sconcso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
     'sconcso4', 'Surface Concentration of Sulfate ', 'kg/m3', (/ ('', i=1, 9) /))
+  TYPE(ctrl_out), SAVE :: o_sconcno3 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
+    'sconcno3', 'Surface Concentration of Nitrate ', 'kg/m3', (/ ('', i=1, 9) /))
   TYPE(ctrl_out), SAVE :: o_sconcoa = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
     'sconcoa', 'Surface Concentration of Organic Aerosol ', 'kg/m3', (/ ('', i=1, 9) /))
@@ -781,4 +806,6 @@
   TYPE(ctrl_out), SAVE :: o_concso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
     'concso4', 'Concentration of Sulfate ', 'kg/m3', (/ ('', i=1, 9) /))
+  TYPE(ctrl_out), SAVE :: o_concno3 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
+    'concno3', 'Concentration of Nitrate ', 'kg/m3', (/ ('', i=1, 9) /))
   TYPE(ctrl_out), SAVE :: o_concoa = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11 /), &
     'concoa', 'Concentration of Organic Aerosol ', 'kg/m3', (/ ('', i=1, 9) /))
Index: /LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 2146)
@@ -89,10 +89,11 @@
          o_dtsvdfg, o_dtsvdfi, o_rugs, o_od550aer, &
          o_od865aer, o_absvisaer, o_od550lt1aer, &
-         o_sconcso4, o_sconcoa, o_sconcbc, &
-         o_sconcss, o_sconcdust, o_concso4, &
+         o_sconcso4, o_sconcno3, o_sconcoa, o_sconcbc, &
+         o_sconcss, o_sconcdust, o_concso4, o_concno3, &
          o_concoa, o_concbc, o_concss, o_concdust, &
          o_loadso4, o_loadoa, o_loadbc, o_loadss, &
-         o_loaddust, o_tausumaero, o_topswad, &
-         o_topswad0, o_solswad, o_solswad0, &
+         o_loaddust, o_tausumaero, o_tausumaero_lw, &
+         o_topswad, o_topswad0, o_solswad, o_solswad0, &
+         o_toplwad, o_toplwad0, o_sollwad, o_sollwad0, &
          o_swtoaas_nat, o_swsrfas_nat, &
          o_swtoacs_nat, o_swtoaas_ant, &
@@ -195,6 +196,6 @@
          pmflxr, pmflxs, prfl, psfl, re, fl, rh2m, &
          qsat2m, tpote, tpot, d_ts, zxrugs, od550aer, &
-         od865aer, absvisaer, od550lt1aer, sconcso4, &
-         sconcoa, sconcbc, sconcss, sconcdust, concso4, &
+         od865aer, absvisaer, od550lt1aer, sconcso4, sconcno3, &
+         sconcoa, sconcbc, sconcss, sconcdust, concso4, concno3, &
          concoa, concbc, concss, concdust, loadso4, &
          loadoa, loadbc, loadss, loaddust, tausum_aero, &
@@ -203,4 +204,6 @@
          topsw0_aero, solsw0_aero, topswcf_aero, &
          solswcf_aero, topswai_aero, solswai_aero, &
+         toplwad_aero, toplwad0_aero, sollwad_aero, &
+         sollwad0_aero, toplwai_aero, sollwai_aero, &
          scdnc, cldncl, reffclws, reffclwc, cldnvi, &
          lcc, lcc3d, lcc3dcon, lcc3dstra, reffclwtop, &
@@ -228,5 +231,5 @@
     USE surface_data, only: type_ocean, ok_veget, ok_snow
 !    USE aero_mod, only: naero_spc
-    USE aero_mod, only: naero_tot
+    USE aero_mod, only: naero_tot, id_STRAT_phy
     USE ioipsl, only: histend, histsync
     USE iophy, only: set_itau_iophy, histwrite_phy
@@ -331,8 +334,6 @@
        CALL histwrite_phy(o_t2m_min, zt2m)
        CALL histwrite_phy(o_t2m_max, zt2m)
-       if (.not. ok_all_xml) then
-         CALL histwrite_phy(o_t2m_max_mon, t2m_max_mon)
-         CALL histwrite_phy(o_t2m_min_mon, t2m_min_mon)
-       endif
+       CALL histwrite_phy(o_t2m_max_mon, t2m_max_mon)
+       CALL histwrite_phy(o_t2m_min_mon, t2m_min_mon)
 
        IF (vars_defined) THEN
@@ -795,5 +796,8 @@
        CALL histwrite_phy(o_rugs, zxrugs)
        ! OD550 per species
-       IF (new_aod .and. (.not. aerosol_couple)) THEN
+!--OLIVIER
+!This is warranted by treating INCA aerosols as offline aerosols
+!       IF (new_aod .and. (.not. aerosol_couple)) THEN
+       IF (new_aod) THEN
           IF (flag_aerosol.GT.0) THEN
              CALL histwrite_phy(o_od550aer, od550aer)
@@ -802,4 +806,5 @@
              CALL histwrite_phy(o_od550lt1aer, od550lt1aer)
              CALL histwrite_phy(o_sconcso4, sconcso4)
+             CALL histwrite_phy(o_sconcno3, sconcno3)
              CALL histwrite_phy(o_sconcoa, sconcoa)
              CALL histwrite_phy(o_sconcbc, sconcbc)
@@ -807,4 +812,5 @@
              CALL histwrite_phy(o_sconcdust, sconcdust)
              CALL histwrite_phy(o_concso4, concso4)
+             CALL histwrite_phy(o_concno3, concno3)
              CALL histwrite_phy(o_concoa, concoa)
              CALL histwrite_phy(o_concbc, concbc)
@@ -826,4 +832,8 @@
              END DO
           ENDIF
+          IF (flag_aerosol_strat) THEN
+             CALL histwrite_phy(o_tausumaero_lw, &
+                  tausum_aero(:,6,id_STRAT_phy) )
+          ENDIF
        ENDIF
        IF (ok_ade) THEN
@@ -832,4 +842,8 @@
           CALL histwrite_phy(o_solswad, solswad_aero)
           CALL histwrite_phy(o_solswad0, solswad0_aero)
+          CALL histwrite_phy(o_toplwad, toplwad_aero)
+          CALL histwrite_phy(o_toplwad0, toplwad0_aero)
+          CALL histwrite_phy(o_sollwad, sollwad_aero)
+          CALL histwrite_phy(o_sollwad0, sollwad0_aero)
           !====MS forcing diagnostics
           if (new_aod) then
Index: /LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90	(revision 2146)
@@ -349,6 +349,8 @@
       REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
 !$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
-      REAL,SAVE,ALLOCATABLE :: tau_aero_rrtm(:,:,:,:), piz_aero_rrtm(:,:,:,:), cg_aero_rrtm(:,:,:,:)
-!$OMP THREADPRIVATE(tau_aero_rrtm, piz_aero_rrtm, cg_aero_rrtm)
+      REAL,SAVE,ALLOCATABLE :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
+!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
+      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
+!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
       REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
 !$OMP THREADPRIVATE(ccm)
@@ -519,6 +521,8 @@
       ALLOCATE(topswai(klon), solswai(klon))
       ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
-      ALLOCATE(tau_aero_rrtm(klon,klev,2,nbands_rrtm),piz_aero_rrtm(klon,klev,2,nbands_rrtm))
-      ALLOCATE(cg_aero_rrtm(klon,klev,2,nbands_rrtm))
+      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
+      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
+      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
+      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
       ALLOCATE(ccm(klon,klev,nbands))
 
@@ -635,5 +639,6 @@
       deallocate(topswai, solswai)
       deallocate(tau_aero,piz_aero,cg_aero)
-      deallocate(tau_aero_rrtm,piz_aero_rrtm,cg_aero_rrtm)
+      deallocate(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
+      deallocate(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
       deallocate(ccm)
       if (ok_gwd_rando) deallocate(du_gwd_rando, dv_gwd_rando)
Index: /LMDZ5/trunk/libf/phylmd/physiq.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/physiq.F90	(revision 2146)
@@ -2761,6 +2761,6 @@
      !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr)
      IF (flag_aerosol .gt. 0) THEN
-        IF (.NOT. aerosol_couple) THEN
-           IF (iflag_rrtm .EQ. 0) THEN !--old radiation
+        IF (iflag_rrtm .EQ. 0) THEN !--old radiation
+           IF (.NOT. aerosol_couple) THEN
               !
               CALL readaerosol_optic( &
@@ -2770,18 +2770,21 @@
                    tau_aero, piz_aero, cg_aero,  &
                    tausum_aero, tau3d_aero)
-              !
-           ELSE                       ! RRTM radiation
-              !
+           ENDIF
+         ELSE                       ! RRTM radiation
+           IF (aerosol_couple .AND. config_inca == 'aero' ) THEN
+            abort_message='config_inca=aero et rrtm=1 impossible'
+            call abort_gcm(modname,abort_message,1)
+           ELSE
+!
 #ifdef CPP_RRTM
-              CALL readaerosol_optic_rrtm( &
-                   debut, new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
-                   pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                   mass_solu_aero, mass_solu_aero_pi,  &
-                   tau_aero_rrtm, piz_aero_rrtm, cg_aero_rrtm,  &
-                   tausum_aero, tau3d_aero)
+             CALL readaerosol_optic_rrtm( debut, aerosol_couple, &
+             new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
+             pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
+             tr_seri, mass_solu_aero, mass_solu_aero_pi,  &
+             tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
+             tausum_aero, tau3d_aero)
 #else
 
-              abort_message = 'You should compile with -rrtm if running ' &
-                   // 'with iflag_rrtm=1'
+              abort_message='You should compile with -rrtm if running with iflag_rrtm=1'
               call abort_gcm(modname,abort_message,1)
 #endif
@@ -2796,7 +2799,7 @@
            cg_aero(:,:,:,:)  = 0.
         ELSE
-           tau_aero_rrtm(:,:,:,:)=0.0
-           piz_aero_rrtm(:,:,:,:)=0.0
-           cg_aero_rrtm(:,:,:,:)=0.0
+           tau_aero_sw_rrtm(:,:,:,:)=0.0
+           piz_aero_sw_rrtm(:,:,:,:)=0.0
+           cg_aero_sw_rrtm(:,:,:,:)=0.0
         ENDIF
      ENDIF
@@ -2980,5 +2983,5 @@
 
      call chemtime(itap+itau_phy-1, date0, dtime)
-     IF (config_inca == 'aero') THEN
+     IF (config_inca == 'aero' .OR. config_inca == 'aeNP') THEN
         CALL AEROSOL_METEO_CALC( &
              calday,pdtphys,pplay,paprs,t,pmflxr,pmflxs, &
@@ -3192,5 +3195,6 @@
              flag_aerosol_strat, &
              tau_aero, piz_aero, cg_aero, &
-             tau_aero_rrtm, piz_aero_rrtm, cg_aero_rrtm,&     ! Rajoute par OB pour RRTM
+             tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,&     ! Rajoute par OB pour RRTM
+             tau_aero_lw_rrtm, & 
              cldtaupirad,new_aod, &
              zqsat, flwc, fiwc, &
@@ -3208,4 +3212,9 @@
              solsw_aero, solsw0_aero, &
              topswcf_aero, solswcf_aero, &
+             !-C. Kleinschmitt for LW diagnostics
+             toplwad_aero, sollwad_aero,&
+             toplwai_aero, sollwai_aero, &
+             toplwad0_aero, sollwad0_aero,&
+             !-end
              ZLWFT0_i, ZFLDN0, ZFLUP0, &
              ZSWFT0_i, ZFSDN0, ZFSUP0)
@@ -3239,5 +3248,6 @@
                    flag_aerosol_strat, &
                    tau_aero, piz_aero, cg_aero, &
-                   tau_aero_rrtm, piz_aero_rrtm, cg_aero_rrtm,&     ! Rajoute par OB pour RRTM
+                   tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,&     ! Rajoute par OB pour RRTM
+                   tau_aero_lw_rrtm, &
                    cldtaupi,new_aod, &
                    zqsat, flwc, fiwc, &
@@ -3255,4 +3265,9 @@
                    solsw_aerop, solsw0_aerop, &
                    topswcf_aerop, solswcf_aerop, &
+                   !-C. Kleinschmitt for LW diagnostics
+                   toplwad_aerop, sollwad_aerop,&
+                   toplwai_aerop, sollwai_aerop, &
+                   toplwad0_aerop, sollwad0_aerop,&
+                   !-end
                    ZLWFT0_i, ZFLDN0, ZFLUP0, &
                    ZSWFT0_i, ZFSDN0, ZFSUP0)
Index: /LMDZ5/trunk/libf/phylmd/phytrac_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phytrac_mod.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/phytrac_mod.F90	(revision 2146)
@@ -54,709 +54,835 @@
 CONTAINS
 
-SUBROUTINE phytrac(                                 &
-     nstep,     julien,   gmtime,   debutphy,       &
-     lafin,     pdtphys,  u, v,     t_seri,         &
-     paprs,     pplay,    pmfu,     pmfd,           &
-     pen_u,     pde_u,    pen_d,    pde_d,          &
-     cdragh,    coefh,    fm_therm, entr_therm,     &
-     yu1,       yv1,      ftsol,    pctsrf,         &
-     ustar,     u10m,      v10m,                    &
-     wstar,     ale_bl,      ale_wake,              &
-     xlat,      xlon,                               &
-     frac_impa,frac_nucl,beta_fisrt,beta_v1,        &
-     presnivs,  pphis,    pphi,     albsol,         &
-     sh,        rh,       cldfra,   rneb,           &
-     diafra,    cldliq,   itop_con, ibas_con,       &
-     pmflxr,    pmflxs,   prfl,     psfl,           &
-     da,        phi,      mp,       upwd,           &
-     phi2,      d1a,      dam,      sij, wght_cvfd, &   ! RomP +RL
-     wdtrainA,  wdtrainM, sigd,     clw, elij,      &   ! RomP 
-     evap,      ep,       epmlmMm,  eplaMm,         &   ! RomP
-     dnwd,      aerosol_couple,     flxmass_w,      &
-     tau_aero,  piz_aero,  cg_aero, ccm,            &
-     rfname,                                        &
-     d_tr_dyn,                                      &   ! RomP
-     tr_seri)         
-!
-!======================================================================
-! Auteur(s) FH
-! Objet: Moniteur general des tendances traceurs
-! Modification R. Pilon 01 janvier 2012 transport+scavenging KE scheme : cvltr
-! Modification R. Pilon 10 octobre 2012 large scale scavenging incloud_scav + bc_scav
-!======================================================================
-
-  USE ioipsl
-  USE phys_cal_mod, only : hour
-  USE dimphy
-  USE infotrac
-  USE mod_grid_phy_lmdz
-  USE mod_phys_lmdz_para
-  USE comgeomphy
-  USE iophy
-  USE traclmdz_mod
-  USE tracinca_mod
-  USE tracreprobus_mod
-  USE control_mod
-  USE indice_sol_mod
-
-  IMPLICIT NONE
-
-  INCLUDE "YOMCST.h"
-  INCLUDE "dimensions.h"
-  INCLUDE "clesphys.h"
-  INCLUDE "temps.h"
-  INCLUDE "paramet.h"
-  INCLUDE "thermcell.h"
-  INCLUDE "iniprint.h"
-!==========================================================================
-!                   -- ARGUMENT DESCRIPTION --
-!==========================================================================
-
-! Input arguments
-!----------------
-!Configuration grille,temps:
-  INTEGER,INTENT(IN) :: nstep      ! Appel physique
-  INTEGER,INTENT(IN) :: julien     ! Jour julien
-  REAL,INTENT(IN)    :: gmtime     ! Heure courante
-  REAL,INTENT(IN)    :: pdtphys    ! Pas d'integration pour la physique (seconde)
-  LOGICAL,INTENT(IN) :: debutphy   ! le flag de l'initialisation de la physique
-  LOGICAL,INTENT(IN) :: lafin      ! le flag de la fin de la physique
-  
-  REAL,DIMENSION(klon),INTENT(IN) :: xlat    ! latitudes pour chaque point 
-  REAL,DIMENSION(klon),INTENT(IN) :: xlon    ! longitudes pour chaque point 
-!
-!Physique: 
-!--------
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: t_seri  ! Temperature
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: u       ! variable not used 
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: v       ! variable not used 
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: sh      ! humidite specifique
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: rh      ! humidite relative
-  REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs   ! pression pour chaque inter-couche (en Pa)
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay   ! pression pour le mileu de chaque couche (en Pa)
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: pphi    ! geopotentiel
-  REAL,DIMENSION(klon),INTENT(IN)        :: pphis
-  REAL,DIMENSION(klev),INTENT(IN)        :: presnivs 
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: cldliq  ! eau liquide nuageuse
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: cldfra  ! fraction nuageuse (tous les nuages)
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: diafra  ! fraction nuageuse (convection ou stratus artificiels)
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb    ! fraction nuageuse (grande echelle)
-!
-  REAL                                   :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: beta_fisrt ! taux de conversion de l'eau cond (de fisrtilp)
-  REAL,DIMENSION(klon,klev),INTENT(out)  :: beta_v1    ! -- (originale version)
-
-!
-  INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
-  INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
-  REAL,DIMENSION(klon),INTENT(IN)        :: albsol  ! albedo surface
-!
-!Dynamique
-!--------
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(IN)    :: d_tr_dyn
-!
-!Convection:
-!----------
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfu  ! flux de masse dans le panache montant
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfd  ! flux de masse dans le panache descendant
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: pen_u ! flux entraine dans le panache montant
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: pde_u ! flux detraine dans le panache montant
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: pen_d ! flux entraine dans le panache descendant
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: pde_d ! flux detraine dans le panache descendant
-
-!...Tiedke     
-  REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: pmflxr, pmflxs ! Flux precipitant de pluie, neige aux interfaces [convection]
-  REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: prfl, psfl ! Flux precipitant de pluie, neige aux interfaces [large-scale]
-
-  LOGICAL,INTENT(IN)                       :: aerosol_couple
-  REAL,DIMENSION(klon,klev),INTENT(IN)     :: flxmass_w
-  REAL,DIMENSION(klon,klev,9,2),INTENT(IN) :: tau_aero
-  REAL,DIMENSION(klon,klev,9,2),INTENT(IN) :: piz_aero
-  REAL,DIMENSION(klon,klev,9,2),INTENT(IN) :: cg_aero
-  CHARACTER(len=4),DIMENSION(9),INTENT(IN) :: rfname 
-  REAL,DIMENSION(klon,klev,2),INTENT(IN)   :: ccm 
-!... K.Emanuel
-  REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
-  REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
-! RomP >>>
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
-  REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
-!
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
-  REAL,DIMENSION(klon),INTENT(IN)           :: sigd
-! ---- RomP flux entraine, detraine et precipitant kerry Emanuel
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: evap
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
-  REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: wght_cvfd          !RL
-  REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: elij
-  REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: epmlmMm
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: eplaMm
-  REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
-! RomP <<<
-
-!
-  REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
-  REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated updraft mass flux
-  REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated downdraft mass flux
-!
-!Thermiques:
-!----------
-  REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-  REAL,DIMENSION(klon,klev),INTENT(IN)     :: entr_therm
-!
-!Couche limite:
-!--------------
-!
-!
-  REAL,DIMENSION(:),INTENT(IN)   :: cdragh          ! (klon) coeff drag pour T et Q
-  REAL,DIMENSION(:,:),INTENT(IN) :: coefh           ! (klon,klev) coeff melange CL (m**2/s)
-  REAL,DIMENSION(:),INTENT(IN)   :: ustar,u10m,v10m ! (klon) u* & vent a 10m (m/s)
-  REAL,DIMENSION(:),INTENT(IN)   :: wstar,ale_bl,ale_wake ! (klon) w* and Avail. Lifting Ener.
-  REAL,DIMENSION(:),INTENT(IN)   :: yu1             ! (klon) vents au premier niveau
-  REAL,DIMENSION(:),INTENT(IN)   :: yv1             ! (klon) vents au premier niveau
-
-!
-!Lessivage:
-!----------
-!
-! pour le ON-LINE
-!
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: frac_impa ! fraction d'aerosols non impactes
-  REAL,DIMENSION(klon,klev),INTENT(IN) :: frac_nucl ! fraction d'aerosols non nuclees
-
-! Arguments necessaires pour les sources et puits de traceur:
-  REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: ftsol  ! Temperature du sol (surf)(Kelvin)
-  REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf ! Pourcentage de sol (nature du sol)
-
-
-! Output argument
-!----------------
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA]
-  REAL,DIMENSION(klon,klev)                    :: sourceBE 
-!=======================================================================================
-!                        -- LOCAL VARIABLES --
-!=======================================================================================
-
-  INTEGER :: i, k, it
-  INTEGER :: nsplit
-
-!Sources et Reservoirs de traceurs (ex:Radon):
-!--------------------------------------------
-!
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: source  ! a voir lorsque le flux de surface est prescrit
+  SUBROUTINE phytrac(                                 &
+       nstep,     julien,   gmtime,   debutphy,       &
+       lafin,     pdtphys,  u, v,     t_seri,         &
+       paprs,     pplay,    pmfu,     pmfd,           &
+       pen_u,     pde_u,    pen_d,    pde_d,          &
+       cdragh,    coefh,    fm_therm, entr_therm,     &
+       yu1,       yv1,      ftsol,    pctsrf,         &
+       ustar,     u10m,      v10m,                    &
+       wstar,     ale_bl,      ale_wake,              &
+       xlat,      xlon,                               &
+       frac_impa,frac_nucl,beta_fisrt,beta_v1,        &
+       presnivs,  pphis,    pphi,     albsol,         &
+       sh,        rh,       cldfra,   rneb,           &
+       diafra,    cldliq,   itop_con, ibas_con,       &
+       pmflxr,    pmflxs,   prfl,     psfl,           &
+       da,        phi,      mp,       upwd,           &
+       phi2,      d1a,      dam,      sij, wght_cvfd, &   ! RomP +RL
+       wdtrainA,  wdtrainM, sigd,     clw, elij,      &   ! RomP 
+       evap,      ep,       epmlmMm,  eplaMm,         &   ! RomP
+       dnwd,      aerosol_couple,     flxmass_w,      &
+       tau_aero,  piz_aero,  cg_aero, ccm,            &
+       rfname,                                        &
+       d_tr_dyn,                                      &   ! RomP
+       tr_seri)         
+    !
+    !======================================================================
+    ! Auteur(s) FH
+    ! Objet: Moniteur general des tendances traceurs
+    ! Modification R. Pilon 01 janvier 2012 transport+scavenging KE scheme : cvltr
+    ! Modification R. Pilon 10 octobre 2012 large scale scavenging incloud_scav + bc_scav
+    !======================================================================
+
+    USE ioipsl
+    USE phys_cal_mod, only : hour
+    USE dimphy
+    USE infotrac
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+    USE comgeomphy
+    USE iophy
+    USE traclmdz_mod
+    USE tracinca_mod
+    USE tracreprobus_mod
+    USE control_mod
+    USE indice_sol_mod
+
+    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
+
+    IMPLICIT NONE
+
+    INCLUDE "YOMCST.h"
+    INCLUDE "dimensions.h"
+    INCLUDE "clesphys.h"
+    INCLUDE "temps.h"
+    INCLUDE "paramet.h"
+    INCLUDE "thermcell.h"
+    INCLUDE "iniprint.h"
+    !==========================================================================
+    !                   -- ARGUMENT DESCRIPTION --
+    !==========================================================================
+
+    ! Input arguments
+    !----------------
+    !Configuration grille,temps:
+    INTEGER,INTENT(IN) :: nstep      ! Appel physique
+    INTEGER,INTENT(IN) :: julien     ! Jour julien
+    REAL,INTENT(IN)    :: gmtime     ! Heure courante
+    REAL,INTENT(IN)    :: pdtphys    ! Pas d'integration pour la physique (seconde)
+    LOGICAL,INTENT(IN) :: debutphy   ! le flag de l'initialisation de la physique
+    LOGICAL,INTENT(IN) :: lafin      ! le flag de la fin de la physique
+
+    REAL,DIMENSION(klon),INTENT(IN) :: xlat    ! latitudes pour chaque point 
+    REAL,DIMENSION(klon),INTENT(IN) :: xlon    ! longitudes pour chaque point 
+    !
+    !Physique: 
+    !--------
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: t_seri  ! Temperature
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: u       ! variable not used 
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: v       ! variable not used 
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: sh      ! humidite specifique
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: rh      ! humidite relative
+    REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs   ! pression pour chaque inter-couche (en Pa)
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay   ! pression pour le mileu de chaque couche (en Pa)
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: pphi    ! geopotentiel
+    REAL,DIMENSION(klon),INTENT(IN)        :: pphis
+    REAL,DIMENSION(klev),INTENT(IN)        :: presnivs 
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: cldliq  ! eau liquide nuageuse
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: cldfra  ! fraction nuageuse (tous les nuages)
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: diafra  ! fraction nuageuse (convection ou stratus artificiels)
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb    ! fraction nuageuse (grande echelle)
+    !
+    REAL                                   :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
+    REAL,DIMENSION(klon,klev),INTENT(IN)   :: beta_fisrt ! taux de conversion de l'eau cond (de fisrtilp)
+    REAL,DIMENSION(klon,klev),INTENT(out)  :: beta_v1    ! -- (originale version)
+
+    !
+    INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
+    INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
+    REAL,DIMENSION(klon),INTENT(IN)        :: albsol  ! albedo surface
+    !
+    !Dynamique
+    !--------
+    REAL,DIMENSION(klon,klev,nbtr),INTENT(IN)    :: d_tr_dyn
+    !
+    !Convection:
+    !----------
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfu  ! flux de masse dans le panache montant
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfd  ! flux de masse dans le panache descendant
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: pen_u ! flux entraine dans le panache montant
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: pde_u ! flux detraine dans le panache montant
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: pen_d ! flux entraine dans le panache descendant
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: pde_d ! flux detraine dans le panache descendant
+
+    !...Tiedke     
+    REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: pmflxr, pmflxs ! Flux precipitant de pluie, neige aux interfaces [convection]
+    REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: prfl, psfl ! Flux precipitant de pluie, neige aux interfaces [large-scale]
+
+    LOGICAL,INTENT(IN)                       :: aerosol_couple
+    REAL,DIMENSION(klon,klev),INTENT(IN)     :: flxmass_w
+    REAL,DIMENSION(klon,klev,9,2),INTENT(IN) :: tau_aero
+    REAL,DIMENSION(klon,klev,9,2),INTENT(IN) :: piz_aero
+    REAL,DIMENSION(klon,klev,9,2),INTENT(IN) :: cg_aero
+    CHARACTER(len=4),DIMENSION(9),INTENT(IN) :: rfname 
+    REAL,DIMENSION(klon,klev,2),INTENT(IN)   :: ccm 
+    !... K.Emanuel
+    REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
+    REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
+    ! RomP >>>
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
+    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
+    !
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
+    REAL,DIMENSION(klon),INTENT(IN)           :: sigd
+    ! ---- RomP flux entraine, detraine et precipitant kerry Emanuel
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: evap
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
+    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: wght_cvfd          !RL
+    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: elij
+    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: epmlmMm
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: eplaMm
+    REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
+    ! RomP <<<
+
+    !
+    REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
+    REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated updraft mass flux
+    REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated downdraft mass flux
+    !
+    !Thermiques:
+    !----------
+    REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
+    REAL,DIMENSION(klon,klev),INTENT(IN)     :: entr_therm
+    !
+    !Couche limite:
+    !--------------
+    !
+    !
+    REAL,DIMENSION(:),INTENT(IN)   :: cdragh          ! (klon) coeff drag pour T et Q
+    REAL,DIMENSION(:,:),INTENT(IN) :: coefh           ! (klon,klev) coeff melange CL (m**2/s)
+    REAL,DIMENSION(:),INTENT(IN)   :: ustar,u10m,v10m ! (klon) u* & vent a 10m (m/s)
+    REAL,DIMENSION(:),INTENT(IN)   :: wstar,ale_bl,ale_wake ! (klon) w* and Avail. Lifting Ener.
+    REAL,DIMENSION(:),INTENT(IN)   :: yu1             ! (klon) vents au premier niveau
+    REAL,DIMENSION(:),INTENT(IN)   :: yv1             ! (klon) vents au premier niveau
+
+    !
+    !Lessivage:
+    !----------
+    !
+    REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ccntrAA
+    REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ccntrENV
+    REAL, DIMENSION(:), ALLOCATABLE, SAVE :: coefcoli
+    LOGICAL, DIMENSION(:), ALLOCATABLE, SAVE :: flag_cvltr
+!$OMP THREADPRIVATE(ccntrAA,ccntrENV,coefcoli,flag_cvltr)
+    REAL, DIMENSION(klon,klev) :: ccntrAA_3d
+    REAL, DIMENSION(klon,klev) :: ccntrENV_3d
+    REAL, DIMENSION(klon,klev) :: coefcoli_3d
+    !
+    ! pour le ON-LINE
+    !
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: frac_impa ! fraction d'aerosols non impactes
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: frac_nucl ! fraction d'aerosols non nuclees
+
+    ! Arguments necessaires pour les sources et puits de traceur:
+    REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: ftsol  ! Temperature du sol (surf)(Kelvin)
+    REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf ! Pourcentage de sol (nature du sol)
+
+
+    ! Output argument
+    !----------------
+    REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA]
+    REAL,DIMENSION(klon,klev)                    :: sourceBE 
+    !=======================================================================================
+    !                        -- LOCAL VARIABLES --
+    !=======================================================================================
+
+    INTEGER :: i, k, it
+    INTEGER :: nsplit
+
+    !Sources et Reservoirs de traceurs (ex:Radon):
+    !--------------------------------------------
+    !
+    REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: source  ! a voir lorsque le flux de surface est prescrit
 !$OMP THREADPRIVATE(source)
 
-!
-!Entrees/Sorties: (cf ini_histrac.h et write_histrac.h)  
-!---------------
-  INTEGER                   :: iiq, ierr
-  INTEGER                   :: nhori, nvert
-  REAL                      :: zsto, zout, zjulian
-  INTEGER,SAVE              :: nid_tra     ! pointe vers le fichier histrac.nc         
+    !
+    !Entrees/Sorties: (cf ini_histrac.h et write_histrac.h)  
+    !---------------
+    INTEGER                   :: iiq, ierr
+    INTEGER                   :: nhori, nvert
+    REAL                      :: zsto, zout, zjulian
+    INTEGER,SAVE              :: nid_tra     ! pointe vers le fichier histrac.nc         
 !$OMP THREADPRIVATE(nid_tra)
-  REAL,DIMENSION(klon)      :: zx_tmp_fi2d ! variable temporaire grille physique
-  INTEGER                   :: itau_w      ! pas de temps ecriture = nstep + itau_phy
-  LOGICAL,PARAMETER         :: ok_sync=.TRUE.
-
-!
-! Nature du traceur
-!------------------
-  LOGICAL,DIMENSION(:),ALLOCATABLE,SAVE :: aerosol  ! aerosol(it) = true  => aerosol => lessivage
+    REAL,DIMENSION(klon)      :: zx_tmp_fi2d ! variable temporaire grille physique
+    INTEGER                   :: itau_w      ! pas de temps ecriture = nstep + itau_phy
+    LOGICAL,PARAMETER         :: ok_sync=.TRUE.
+
+    !
+    ! Nature du traceur
+    !------------------
+    LOGICAL,DIMENSION(:),ALLOCATABLE,SAVE :: aerosol  ! aerosol(it) = true  => aerosol => lessivage
 !$OMP THREADPRIVATE(aerosol)                        ! aerosol(it) = false => gaz
-  REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
-!
-! Tendances de traceurs (Td) et flux de traceurs:
-!------------------------
-  REAL,DIMENSION(klon,klev)      :: d_tr     ! Td dans l'atmosphere
-  REAL,DIMENSION(klon,klev)      :: Mint
-  REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
-  REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
-  REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
-! Physique
-!---------- 
-  REAL,DIMENSION(klon,klev,nbtr) :: flestottr ! flux de lessivage dans chaque couche 
-  REAL,DIMENSION(klon,klev)      :: zmasse    ! densité atmosphérique Kg/m2
-  REAL,DIMENSION(klon,klev)      :: ztra_th
-!PhH
-  REAL,DIMENSION(klon,klev)      :: zrho
-  REAL,DIMENSION(klon,klev)      :: zdz
-  REAL                           :: evaplsc,dx,beta ! variable pour lessivage Genthon
-  REAL,DIMENSION(klon)           :: his_dh          ! ---
-! in-cloud scav variables
-  REAL           :: ql_incloud_ref     ! ref value of in-cloud condensed water content
-  
-!Controles:
-!---------
-  INTEGER,SAVE :: iflag_vdf_trac,iflag_con_trac,iflag_the_trac
-  INTEGER,SAVE  :: iflag_con_trac_omp, iflag_vdf_trac_omp,iflag_the_trac_omp
+    REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
+    !
+    ! Tendances de traceurs (Td) et flux de traceurs:
+    !------------------------
+    REAL,DIMENSION(klon,klev)      :: d_tr     ! Td dans l'atmosphere
+    REAL,DIMENSION(klon,klev)      :: Mint
+    REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
+    REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
+    REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
+    ! Physique
+    !---------- 
+    REAL,DIMENSION(klon,klev,nbtr) :: flestottr ! flux de lessivage dans chaque couche 
+    REAL,DIMENSION(klon,klev)      :: zmasse    ! densité atmosphérique Kg/m2
+    REAL,DIMENSION(klon,klev)      :: ztra_th
+    !PhH
+    REAL,DIMENSION(klon,klev)      :: zrho
+    REAL,DIMENSION(klon,klev)      :: zdz
+    REAL                           :: evaplsc,dx,beta ! variable pour lessivage Genthon
+    REAL,DIMENSION(klon)           :: his_dh          ! ---
+    ! in-cloud scav variables
+    REAL           :: ql_incloud_ref     ! ref value of in-cloud condensed water content
+
+    !Controles:
+    !---------
+    INTEGER,SAVE :: iflag_vdf_trac,iflag_con_trac,iflag_the_trac
+    INTEGER,SAVE  :: iflag_con_trac_omp, iflag_vdf_trac_omp,iflag_the_trac_omp
 !$OMP THREADPRIVATE(iflag_vdf_trac,iflag_con_trac,iflag_the_trac)
 
-  LOGICAL,SAVE :: lessivage
+    LOGICAL,SAVE :: lessivage
 !$OMP THREADPRIVATE(lessivage)
 
-  CHARACTER(len=8),DIMENSION(nbtr) :: solsym
-!RomP >>>
-  INTEGER,SAVE  :: iflag_lscav_omp,iflag_lscav
-  LOGICAL,SAVE  :: convscav_omp,convscav
+    CHARACTER(len=8),DIMENSION(nbtr) :: solsym
+    !RomP >>>
+    INTEGER,SAVE  :: iflag_lscav_omp,iflag_lscav
+    LOGICAL,SAVE  :: convscav_omp,convscav
 !$OMP THREADPRIVATE(iflag_lscav)
 !$OMP THREADPRIVATE(convscav)
-!RomP <<<
-!######################################################################
-!                    -- INITIALIZATION --
-!######################################################################
-IF (debutphy) THEN
-ALLOCATE(d_tr_cl(klon,klev,nbtr),d_tr_dry(klon,nbtr))
-ALLOCATE(flux_tr_dry(klon,nbtr),d_tr_dec(klon,klev,nbtr),d_tr_cv(klon,klev,nbtr))
-ALLOCATE(d_tr_insc(klon,klev,nbtr),d_tr_bcscav(klon,klev,nbtr))
-ALLOCATE(d_tr_evapls(klon,klev,nbtr),d_tr_ls(klon,klev,nbtr))
-ALLOCATE(qPrls(klon,nbtr),d_tr_trsp(klon,klev,nbtr))
-ALLOCATE(d_tr_sscav(klon,klev,nbtr),d_tr_sat(klon,klev,nbtr))
-ALLOCATE(d_tr_uscav(klon,klev,nbtr),qPr(klon,klev,nbtr),qDi(klon,klev,nbtr))
-ALLOCATE(qPa(klon,klev,nbtr),qMel(klon,klev,nbtr))
-ALLOCATE(qTrdi(klon,klev,nbtr),dtrcvMA(klon,klev,nbtr))
-ALLOCATE(d_tr_th(klon,klev,nbtr))
-ALLOCATE(d_tr_lessi_impa(klon,klev,nbtr),d_tr_lessi_nucl(klon,klev,nbtr))
-ENDIF
-
-  DO k=1,klev
-     DO i=1,klon
-      sourceBE(i,k)=0.
-      Mint(i,k)=0.
-      zrho(i,k)=0.
-      zdz(i,k)=0.
-     END DO
-  END DO
-
-  DO it=1, nbtr
-   DO k=1,klev
-    DO i=1,klon
-    d_tr_insc(i,k,it)=0.
-    d_tr_bcscav(i,k,it)=0.
-    d_tr_evapls(i,k,it)=0.
-    d_tr_ls(i,k,it)=0.
-    d_tr_cv(i,k,it)=0.
-    d_tr_cl(i,k,it)=0.
-    d_tr_trsp(i,k,it)=0.
-    d_tr_sscav(i,k,it)=0.
-    d_tr_sat(i,k,it)=0.
-    d_tr_uscav(i,k,it)=0.
-    d_tr_lessi_impa(i,k,it)=0.
-    d_tr_lessi_nucl(i,k,it)=0.
-    qDi(i,k,it)=0.
-    qPr(i,k,it)=0.
-    qPa(i,k,it)=0.
-    qMel(i,k,it)=0.
-    qTrdi(i,k,it)=0.
-    dtrcvMA(i,k,it)=0.
-    zmfd1a(i,k,it)=0.
-    zmfdam(i,k,it)=0.
-    zmfphi2(i,k,it)=0.
+    !RomP <<<
+    !######################################################################
+    !                    -- INITIALIZATION --
+    !######################################################################
+    IF (debutphy) THEN
+       ALLOCATE(d_tr_cl(klon,klev,nbtr),d_tr_dry(klon,nbtr))
+       ALLOCATE(flux_tr_dry(klon,nbtr),d_tr_dec(klon,klev,nbtr),d_tr_cv(klon,klev,nbtr))
+       ALLOCATE(d_tr_insc(klon,klev,nbtr),d_tr_bcscav(klon,klev,nbtr))
+       ALLOCATE(d_tr_evapls(klon,klev,nbtr),d_tr_ls(klon,klev,nbtr))
+       ALLOCATE(qPrls(klon,nbtr),d_tr_trsp(klon,klev,nbtr))
+       ALLOCATE(d_tr_sscav(klon,klev,nbtr),d_tr_sat(klon,klev,nbtr))
+       ALLOCATE(d_tr_uscav(klon,klev,nbtr),qPr(klon,klev,nbtr),qDi(klon,klev,nbtr))
+       ALLOCATE(qPa(klon,klev,nbtr),qMel(klon,klev,nbtr))
+       ALLOCATE(qTrdi(klon,klev,nbtr),dtrcvMA(klon,klev,nbtr))
+       ALLOCATE(d_tr_th(klon,klev,nbtr))
+       ALLOCATE(d_tr_lessi_impa(klon,klev,nbtr),d_tr_lessi_nucl(klon,klev,nbtr))
+    ENDIF
+
+    DO k=1,klev
+       DO i=1,klon
+          sourceBE(i,k)=0.
+          Mint(i,k)=0.
+          zrho(i,k)=0.
+          zdz(i,k)=0.
+       END DO
     END DO
-   END DO
-  END DO
-  IF (debutphy) THEN
-!!jyg
+
+    DO it=1, nbtr
+       DO k=1,klev
+          DO i=1,klon
+             d_tr_insc(i,k,it)=0.
+             d_tr_bcscav(i,k,it)=0.
+             d_tr_evapls(i,k,it)=0.
+             d_tr_ls(i,k,it)=0.
+             d_tr_cv(i,k,it)=0.
+             d_tr_cl(i,k,it)=0.
+             d_tr_trsp(i,k,it)=0.
+             d_tr_sscav(i,k,it)=0.
+             d_tr_sat(i,k,it)=0.
+             d_tr_uscav(i,k,it)=0.
+             d_tr_lessi_impa(i,k,it)=0.
+             d_tr_lessi_nucl(i,k,it)=0.
+             qDi(i,k,it)=0.
+             qPr(i,k,it)=0.
+             qPa(i,k,it)=0.
+             qMel(i,k,it)=0.
+             qTrdi(i,k,it)=0.
+             dtrcvMA(i,k,it)=0.
+             zmfd1a(i,k,it)=0.
+             zmfdam(i,k,it)=0.
+             zmfphi2(i,k,it)=0.
+          END DO
+       END DO
+    END DO
+
+    DO k = 1, klev
+       DO i = 1, klon
+          delp(i,k) = paprs(i,k)-paprs(i,k+1)
+       END DO
+    END DO
+
+    IF (debutphy) THEN
+       !!jyg
 !$OMP BARRIER
-   ecrit_tra=86400. ! frequence de stokage en dur
-                    ! obsolete car remplace par des ecritures dans phys_output_write
-!RomP >>>
-!
-!Config Key  = convscav
-!Config Desc = Convective scavenging switch: 0=off, 1=on.
-!Config Def  = .false.
-!Config Help = 
-!
+       ecrit_tra=86400. ! frequence de stokage en dur
+       ! obsolete car remplace par des ecritures dans phys_output_write
+       !RomP >>>
+       !
+       !Config Key  = convscav
+       !Config Desc = Convective scavenging switch: 0=off, 1=on.
+       !Config Def  = .false.
+       !Config Help = 
+       !
 !$OMP MASTER
-  convscav_omp=.false.
-  call getin('convscav', convscav_omp)
-  iflag_vdf_trac_omp=1
-  call getin('iflag_vdf_trac', iflag_vdf_trac_omp)
-  iflag_con_trac_omp=1
-  call getin('iflag_con_trac', iflag_con_trac_omp)
-  iflag_the_trac_omp=1
-  call getin('iflag_the_trac', iflag_the_trac_omp)
+       convscav_omp=.false.
+       call getin('convscav', convscav_omp)
+       iflag_vdf_trac_omp=1
+       call getin('iflag_vdf_trac', iflag_vdf_trac_omp)
+       iflag_con_trac_omp=1
+       call getin('iflag_con_trac', iflag_con_trac_omp)
+       iflag_the_trac_omp=1
+       call getin('iflag_the_trac', iflag_the_trac_omp)
 !$OMP END MASTER
 !$OMP BARRIER
-  convscav=convscav_omp
-  iflag_vdf_trac=iflag_vdf_trac_omp
-  iflag_con_trac=iflag_con_trac_omp
-  iflag_the_trac=iflag_the_trac_omp
-  print*,'phytrac passage dans routine conv avec lessivage', convscav
-!
-!Config Key  = iflag_lscav
-!Config Desc = Large scale scavenging parametrization: 0=none, 1=old(Genthon92),
-!              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
-!Config Def  = 1
-!Config Help = 
-!
+       convscav=convscav_omp
+       iflag_vdf_trac=iflag_vdf_trac_omp
+       iflag_con_trac=iflag_con_trac_omp
+       iflag_the_trac=iflag_the_trac_omp
+       write(lunout,*) 'phytrac passage dans routine conv avec lessivage', convscav
+       !
+       !Config Key  = iflag_lscav
+       !Config Desc = Large scale scavenging parametrization: 0=none, 1=old(Genthon92),
+       !              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
+       !Config Def  = 1
+       !Config Help = 
+       !
 !$OMP MASTER
-  iflag_lscav_omp=1
-  call getin('iflag_lscav', iflag_lscav_omp)
+       iflag_lscav_omp=1
+       call getin('iflag_lscav', iflag_lscav_omp)
 !$OMP END MASTER
 !$OMP BARRIER
-  iflag_lscav=iflag_lscav_omp
+       iflag_lscav=iflag_lscav_omp
+       !
+       SELECT CASE(iflag_lscav)
+       CASE(0)
+          WRITE(lunout,*)  'Large scale scavenging: none'
+       CASE(1)
+          WRITE(lunout,*)  'Large scale scavenging: C. Genthon, Tellus(1992), 44B, 371-389'
+       CASE(2)
+          WRITE(lunout,*)  'Large scale scavenging: C. Genthon, modified P. Heinrich'
+       CASE(3)
+          WRITE(lunout,*)  'Large scale scavenging: M. Shekkar Reddy and O. Boucher, JGR(2004), 109, D14202'
+       CASE(4)
+          WRITE(lunout,*)  'Large scale scavenging: Reddy and Boucher, modified R. Pilon'
+       END SELECT
+       !RomP <<<
+       WRITE(*,*) 'FIRST TIME IN PHYTRAC : pdtphys(sec) = ',pdtphys,'ecrit_tra (sec) = ',ecrit_tra
+       ALLOCATE( source(klon,nbtr), stat=ierr)
+       IF (ierr /= 0) CALL abort_gcm('phytrac', 'pb in allocation 1',1)
+
+       ALLOCATE( aerosol(nbtr), stat=ierr)
+       IF (ierr /= 0) CALL abort_gcm('phytrac', 'pb in allocation 2',1)
+
+
+       ! Initialize module for specific tracers
+       SELECT CASE(type_trac)
+       CASE('lmdz')
+          CALL traclmdz_init(pctsrf,xlat,xlon,ftsol,tr_seri,t_seri,pplay,sh,pdtphys,aerosol,lessivage)
+       CASE('inca')
+          source(:,:)=0.
+          CALL tracinca_init(aerosol,lessivage)
+       CASE('repr')
+          source(:,:)=0.
+       END SELECT
+
+       !
+       !--initialising coefficients for scavenging in the case of NP
+       !
+       ALLOCATE(flag_cvltr(nbtr))
+       IF (iflag_con.EQ.3) THEN
+          !
+          ALLOCATE(ccntrAA(nbtr))
+          ALLOCATE(ccntrENV(nbtr))
+          ALLOCATE(coefcoli(nbtr))
+          !
+          DO it=1, nbtr
+             SELECT CASE(type_trac)
+             CASE('lmdz')
+                IF (convscav.and.aerosol(it)) THEN
+                   flag_cvltr(it)=.true.
+                   ccntrAA(it) =1.0         !--a modifier par JYG a lire depuis fichier 
+                   ccntrENV(it)=1.0 
+                   coefcoli(it)=0.001
+                ELSE 
+                   flag_cvltr(it)=.false.
+                ENDIF
+
+             CASE('inca')
+!                IF ((it.EQ.id_Rn222) .OR. ((it.GE.id_SO2) .AND. (it.LE.id_NH3)) ) THEN 
+!                   !--gas-phase species
+!                   flag_cvltr(it)=.false.
 !
-  SELECT CASE(iflag_lscav)
-  CASE(0)
-   PRINT*, 'Large scale scavenging: none'
-  CASE(1)
-   PRINT*, 'Large scale scavenging: C. Genthon, Tellus(1992), 44B, 371-389'
-  CASE(2)
-   PRINT*, 'Large scale scavenging: C. Genthon, modified P. Heinrich'
-  CASE(3)
-   PRINT*, 'Large scale scavenging: M. Shekkar Reddy and O. Boucher, JGR(2004), 109, D14202'
-  CASE(4)
-   PRINT*, 'Large scale scavenging: Reddy and Boucher, modified R. Pilon'
-  END SELECT
-!RomP <<<
-     WRITE(*,*) 'FIRST TIME IN PHYTRAC : pdtphys(sec) = ',pdtphys,'ecrit_tra (sec) = ',ecrit_tra
-     ALLOCATE( source(klon,nbtr), stat=ierr)
-     IF (ierr /= 0) CALL abort_gcm('phytrac', 'pb in allocation 1',1)
-     
-     ALLOCATE( aerosol(nbtr), stat=ierr)
-     IF (ierr /= 0) CALL abort_gcm('phytrac', 'pb in allocation 2',1)
-     
-
-     ! Initialize module for specific tracers
-     SELECT CASE(type_trac)
-     CASE('lmdz')
-        CALL traclmdz_init(pctsrf, xlat, xlon, ftsol, tr_seri, t_seri, pplay, sh, pdtphys, aerosol, lessivage)
-     CASE('inca')
-        source(:,:)=0.
-        CALL tracinca_init(aerosol,lessivage)
-     CASE('repr')
-        source(:,:)=0.
-     END SELECT
-!
-! Initialize diagnostic output
-! ----------------------------
+!                ELSEIF ( (it.GE.id_CIDUSTM) .AND. (it.LE.id_AIN) ) THEN
+!                   !--insoluble aerosol species
+!                   flag_cvltr(it)=.true.
+!                   ccntrAA(it)=0.7
+!                   ccntrENV(it)=0.7
+!                   coefcoli(it)=0.001
+!                ELSEIF ( (it.EQ.id_Pb210) .OR. ((it.GE.id_CSSSM) .AND. (it.LE.id_SSN))) THEN
+!                   !--soluble aerosol species
+!                   flag_cvltr(it)=.true.
+!                   ccntrAA(it)=0.9
+!                   ccntrENV(it)=0.9 
+!                   coefcoli(it)=0.001
+!                ELSE 
+!                   WRITE(lunout,*) 'pb it=', it
+!                   CALL abort_gcm('phytrac','pb it scavenging',1)
+!                ENDIF
+                !--test OB 
+                !--for now we do not scavenge in cvltr
+                flag_cvltr(it)=.false.
+             END SELECT
+          ENDDO
+          !
+       ELSE ! iflag_con .ne. 3 
+          flag_cvltr(:) = .false. 
+       ENDIF
+       !
+       ! Initialize diagnostic output
+       ! ----------------------------
 #ifdef CPP_IOIPSL
-!     INCLUDE "ini_histrac.h"
+       !     INCLUDE "ini_histrac.h"
 #endif
-  END IF ! of IF (debutphy)
-!############################################ END INITIALIZATION #######
-
-  DO k=1,klev
-     DO i=1,klon
-        zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/rg
-     END DO
-  END DO
-!
-  IF (id_be .GT. 0) THEN
-  DO k=1,klev
-     DO i=1,klon
-        sourceBE(i,k)=srcbe(i,k)       !RomP  -> pour sortie histrac
-     END DO
-  END DO
-  ENDIF
-
-!===============================================================================
-!    -- Do specific treatment according to chemestry model or local LMDZ tracers
-!      
-!===============================================================================
-  SELECT CASE(type_trac)
-  CASE('lmdz')
-     !    -- Traitement des traceurs avec traclmdz
-     CALL traclmdz(nstep, julien, gmtime, pdtphys, t_seri, paprs, pplay, &
-          cdragh,  coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon,iflag_vdf_trac>=0,sh, &
-           rh, pphi, ustar, wstar, ale_bl, ale_wake,  u10m, v10m, &
-           tr_seri, source, solsym, d_tr_cl,d_tr_dec, zmasse)               !RomP
-
-  CASE('inca')
-     !    -- CHIMIE INCA  config_inca = aero or chem --
-
-     CALL tracinca(&
-          nstep,    julien,   gmtime,         lafin,     &
-          pdtphys,  t_seri,   paprs,          pplay,     &
-          pmfu,     ftsol,    pctsrf,         pphis,     &
-          pphi,     albsol,   sh,             rh,        &
-          cldfra,   rneb,     diafra,         cldliq,    &
-          itop_con, ibas_con, pmflxr,         pmflxs,    &
-          prfl,     psfl,     aerosol_couple, flxmass_w, &
-          tau_aero, piz_aero, cg_aero,        ccm,       &
-          rfname,                                        &
-          tr_seri,  source,   solsym)      
-
-  CASE('repr')
-     !   -- CHIMIE REPROBUS --
-
-     CALL tracreprobus(pdtphys, gmtime, debutphy, julien, &
-          presnivs, xlat, xlon, pphis, pphi, &
-          t_seri, pplay, paprs, sh , &
-          tr_seri, solsym)
-     
-  END SELECT
-!======================================================================
-!       -- Calcul de l'effet de la convection --
-!======================================================================
-
-  IF (iflag_con_trac==1) THEN
-     DO it=1, nbtr
-        IF ( conv_flg(it) == 0 ) CYCLE
-        IF (iflag_con.LT.2) THEN
-           d_tr_cv(:,:,it)=0.
-        ELSE IF (iflag_con.EQ.2) THEN
-!..Tiedke
-           CALL nflxtr(pdtphys, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
-                pplay, paprs, tr_seri(:,:,it), d_tr_cv(:,:,it))
-! RomP >>>                
-        ELSE   
-!..K.Emanuel                  !RomP modif arg
-        if (convscav.and.aerosol(it)) then    ! lessivage convectif pour aerosol
-!
-          CALL cvltr(pdtphys, da, phi,phi2,d1a,dam, mp,ep,              &
-!!               sigd,sij,clw,elij,epmlmMm,eplaMm,                        &   !RL
-               sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,              &     !RL
-               pmflxr,pmflxs,evap,t_seri,wdtrainA,wdtrainM,             &   
-               paprs,it,tr_seri,upwd,dnwd,itop_con,ibas_con,            &
-               d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr,&
-               qPa,qMel,qTrdi,dtrcvMA,Mint,                             &
-               zmfd1a,zmfphi2,zmfdam)
-        else  !pas de lessivage convectif ou n'est pas un aerosol
-!!           CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,&      !jyg
-!!                    upwd,dnwd,d_tr_cv)                                      !jyg
-           CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,pplay, &  !jyg
-                    tr_seri,upwd,dnwd,d_tr_cv)                                !jyg
-        endif
-        END IF
-! RomP <<<
-
-        DO k = 1, klev
-           DO i = 1, klon        
-              tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr_cv(i,k,it)
-           END DO
-        END DO
-
-        CALL minmaxqfi(tr_seri(:,:,it),0.,1.e33,'convection it = '//solsym(it))
-             
-     END DO ! nbtr
-  END IF ! convection
-
-!======================================================================
-!    -- Calcul de l'effet des thermiques --
-!======================================================================
-
-  DO it=1,nbtr
-     DO k=1,klev
-        DO i=1,klon
-           d_tr_th(i,k,it)=0.
-           tr_seri(i,k,it)=MAX(tr_seri(i,k,it),0.)
-           tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
-        END DO
-     END DO
-  END DO
-  
-  IF (iflag_thermals.GT.0.AND.iflag_the_trac>0) THEN   
-     nsplit=10
-     DO it=1, nbtr
-        DO isplit=1,nsplit
-
-           CALL dqthermcell(klon,klev,pdtphys/nsplit, &
-                fm_therm,entr_therm,zmasse, &
-                tr_seri(1:klon,1:klev,it),d_tr,ztra_th)
-
-           DO k=1,klev
-              DO i=1,klon
-                 d_tr(i,k)=pdtphys*d_tr(i,k)/nsplit
-                 d_tr_th(i,k,it)=d_tr_th(i,k,it)+d_tr(i,k)
-                 tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr(i,k),0.)
-              END DO
-           END DO
-        END DO ! nsplit
-     END DO ! it
-  END IF ! Thermiques
-
-!======================================================================
-!     -- Calcul de l'effet de la couche limite --
-!======================================================================
-
-  DO k = 1, klev
-     DO i = 1, klon
-        delp(i,k) = paprs(i,k)-paprs(i,k+1)
-     END DO
-  END DO
-
-  IF (iflag_vdf_trac==1) THEN
-     DO it=1, nbtr
-        if (prt_level > 20) write(lunout,*)'trac pbl ',it,pbl_flg(it)
-        IF( pbl_flg(it) /= 0 ) THEN
-           CALL cltrac(pdtphys, coefh,t_seri,       &
-                tr_seri(:,:,it), source(:,it),      &
-                paprs, pplay, delp,                 &
-                d_tr_cl(:,:,it),d_tr_dry(:,it),flux_tr_dry(:,it))
-           tr_seri(:,:,it)=tr_seri(:,:,it)+d_tr_cl(:,:,it)
-        END IF
-     END DO
-  ELSE IF (iflag_vdf_trac==0) THEN
-!   Injection of source in the first model layer
+       !
+       ! print out all tracer flags 
+       !
+       WRITE(lunout,*) 'print out all tracer flags'
+       WRITE(lunout,*) 'type_trac      =', type_trac
+       WRITE(lunout,*) 'config_inca    =', config_inca
+       WRITE(lunout,*) 'iflag_con_trac =', iflag_con_trac
+       WRITE(lunout,*) 'iflag_con      =', iflag_con
+       WRITE(lunout,*) 'convscav       =', convscav
+       WRITE(lunout,*) 'iflag_lscav    =', iflag_lscav
+       WRITE(lunout,*) 'aerosol        =', aerosol
+       WRITE(lunout,*) 'iflag_the_trac =', iflag_the_trac
+       WRITE(lunout,*) 'iflag_thermals =', iflag_thermals
+       WRITE(lunout,*) 'iflag_vdf_trac =', iflag_vdf_trac
+       WRITE(lunout,*) 'pbl_flg        =', pbl_flg
+       WRITE(lunout,*) 'lessivage      =', lessivage
+       write(lunout,*)  'flag_cvltr    = ', flag_cvltr
+
+       IF (lessivage.AND.config_inca.EQ.'inca') THEN
+          CALL abort_gcm('phytrac', 'lessivage=T config_inca=inca impossible',1)
+          STOP
+       ENDIF
+       !
+    END IF ! of IF (debutphy)
+    !############################################ END INITIALIZATION #######
+
+    DO k=1,klev
+       DO i=1,klon
+          zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/rg
+       END DO
+    END DO
+    !
+    IF (id_be .GT. 0) THEN
+       DO k=1,klev
+          DO i=1,klon
+             sourceBE(i,k)=srcbe(i,k)       !RomP  -> pour sortie histrac
+          END DO
+       END DO
+    ENDIF
+
+    !===============================================================================
+    !    -- Do specific treatment according to chemestry model or local LMDZ tracers
+    !      
+    !===============================================================================
+    SELECT CASE(type_trac)
+    CASE('lmdz')
+       !    -- Traitement des traceurs avec traclmdz
+       CALL traclmdz(nstep, julien, gmtime, pdtphys, t_seri, paprs, pplay, &
+            cdragh,  coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon,iflag_vdf_trac>=0,sh, &
+            rh, pphi, ustar, wstar, ale_bl, ale_wake,  u10m, v10m, &
+            tr_seri, source, solsym, d_tr_cl,d_tr_dec, zmasse)               !RomP
+
+    CASE('inca')
+       !    -- CHIMIE INCA  config_inca = aero or chem --
+
+       CALL tracinca(&
+            nstep,    julien,   gmtime,         lafin,     &
+            pdtphys,  t_seri,   paprs,          pplay,     &
+            pmfu,     upwd,     ftsol,  pctsrf, pphis,     &
+            pphi,     albsol,   sh,             rh,        &
+            cldfra,   rneb,     diafra,         cldliq,    &
+            itop_con, ibas_con, pmflxr,         pmflxs,    &
+            prfl,     psfl,     aerosol_couple, flxmass_w, &
+            tau_aero, piz_aero, cg_aero,        ccm,       &
+            rfname,                                        &
+            tr_seri,  source,   solsym)      
+
+    CASE('repr')
+       !   -- CHIMIE REPROBUS --
+
+       CALL tracreprobus(pdtphys, gmtime, debutphy, julien, &
+            presnivs, xlat, xlon, pphis, pphi, &
+            t_seri, pplay, paprs, sh , &
+            tr_seri, solsym)
+
+    END SELECT
+    !======================================================================
+    !       -- Calcul de l'effet de la convection --
+    !======================================================================
+
+    IF (iflag_con_trac==1) THEN
+
+       DO it=1, nbtr
+          IF ( conv_flg(it) == 0 ) CYCLE
+          IF (iflag_con.LT.2) THEN
+             !--pas de transport convectif
+
+             d_tr_cv(:,:,it)=0.
+          ELSE IF (iflag_con.EQ.2) THEN
+             !--ancien transport convectif de Tiedtke
+
+             CALL nflxtr(pdtphys, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
+                  pplay, paprs, tr_seri(:,:,it), d_tr_cv(:,:,it))
+          ELSE   
+             !--nouveau transport convectif de Emanuel
+
+             IF (flag_cvltr(it)) THEN
+                !--nouveau transport convectif de Emanuel avec lessivage convectif
+                !
+                !
+                ccntrAA_3d(:,:) =ccntrAA(it)
+                ccntrENV_3d(:,:)=ccntrENV(it)
+                coefcoli_3d(:,:)=coefcoli(it)
+
+                !--beware this interface is a bit weird because it is called for each tracer 
+                !--with the full array tr_seri even if only item it is processed
+
+                CALL cvltr_scav(pdtphys, da, phi,phi2,d1a,dam, mp,ep,         &
+                     sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,              &     
+                     pmflxr,pmflxs,evap,t_seri,wdtrainA,wdtrainM,             &   
+                     paprs,it,tr_seri,upwd,dnwd,itop_con,ibas_con,            &
+                     ccntrAA_3d,ccntrENV_3d,coefcoli_3d,                      &
+                     d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr,&
+                     qPa,qMel,qTrdi,dtrcvMA,Mint,                             &
+                     zmfd1a,zmfphi2,zmfdam)
+
+
+             ELSE  !---flag_cvltr(it).EQ.FALSE
+                !--nouveau transport convectif de Emanuel mais pas de lessivage convectif
+
+                !--beware this interface is a bit weird because it is called for each tracer 
+                !--with the full array tr_seri even if only item it is processed
+                !
+                CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,pplay, &  !jyg
+                     tr_seri,upwd,dnwd,d_tr_cv)                                !jyg
+
+             ENDIF
+
+          ENDIF !--iflag
+
+          !--on ajoute les tendances
+
+          DO k = 1, klev
+             DO i = 1, klon        
+                tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr_cv(i,k,it)
+             END DO
+          END DO
+
+          CALL minmaxqfi(tr_seri(:,:,it),0.,1.e33,'convection it = '//solsym(it))
+
+       END DO ! nbtr
+
+    END IF ! convection
+
+    !======================================================================
+    !    -- Calcul de l'effet des thermiques --
+    !======================================================================
+
     DO it=1,nbtr
-       d_tr_cl(:,1,it)=source(:,it)*rg/delp(:,1)*pdtphys
-       tr_seri(:,1,it)=tr_seri(:,1,it)+d_tr_cl(:,1,it)
-    ENDDO
-    d_tr_cl(:,2:klev,1:nbtr)=0.
-  ELSE IF (iflag_vdf_trac==-1) THEN
-    d_tr_cl=0.
-  ELSE
-    CALL abort_gcm('iflag_vdf_trac', 'cas non prevu',1)
-  END IF ! couche limite
-
-
-
-!======================================================================
-!   Calcul de l'effet de la precipitation grande echelle
-!======================================================================
-  IF (lessivage) THEN
-
-   ql_incloud_ref = 10.e-4
-   ql_incloud_ref =  5.e-4
-
-
-! calcul du contenu en eau liquide au sein du nuage
-     ql_incl = ql_incloud_ref
-! choix du lessivage
-!
-  IF (iflag_lscav .EQ. 3 .OR. iflag_lscav .EQ. 4) THEN
-! ********  Olivier Boucher version (3) possibly with modified ql_incl (4)
-!
-   DO it = 1, nbtr
-!  incloud scavenging and removal by large scale rain ! orig : ql_incl was replaced by 0.5e-3 kg/kg
-! the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR
-! Liu (2001) proposed to use 1.5e-3 kg/kg
-
-    CALL lsc_scav(pdtphys,it,iflag_lscav,ql_incl,prfl,psfl,rneb,beta_fisrt,  &
+       DO k=1,klev
+          DO i=1,klon
+             d_tr_th(i,k,it)=0.
+             tr_seri(i,k,it)=MAX(tr_seri(i,k,it),0.)
+             tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
+          END DO
+       END DO
+    END DO
+
+    IF (iflag_thermals.GT.0.AND.iflag_the_trac>0) THEN   
+
+       DO it=1, nbtr
+
+          CALL thermcell_dq(klon,klev,1,pdtphys,fm_therm,entr_therm, &
+               zmasse,tr_seri(1:klon,1:klev,it),        &
+               d_tr_th(1:klon,1:klev,it),ztra_th,0 )
+
+          DO k=1,klev
+             DO i=1,klon
+                d_tr_th(i,k,it)=pdtphys*d_tr_th(i,k,it)
+                tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr_th(i,k,it),0.)
+             END DO
+          END DO
+
+       END DO ! it
+
+    END IF ! Thermiques
+
+    !======================================================================
+    !     -- Calcul de l'effet de la couche limite --
+    !======================================================================
+
+    IF (iflag_vdf_trac==1) THEN
+
+       !  Injection during BL mixing
+       !
+       DO it=1, nbtr
+          !
+          IF( pbl_flg(it) /= 0 ) THEN
+             !
+             CALL cltrac(pdtphys, coefh,t_seri,       &
+                  tr_seri(:,:,it), source(:,it),      &
+                  paprs, pplay, delp,                 &
+                  d_tr_cl(:,:,it),d_tr_dry(:,it),flux_tr_dry(:,it))
+             !
+             tr_seri(:,:,it)=tr_seri(:,:,it)+d_tr_cl(:,:,it)
+             !
+          END IF
+          !
+       END DO
+       !
+    ELSE IF (iflag_vdf_trac==0) THEN
+       !
+       !   Injection of source in the first model layer
+       !
+       DO it=1,nbtr
+          d_tr_cl(:,1,it)=source(:,it)*RG/delp(:,1)*pdtphys
+          tr_seri(:,1,it)=tr_seri(:,1,it)+d_tr_cl(:,1,it)
+       ENDDO
+       d_tr_cl(:,2:klev,1:nbtr)=0.
+       !
+    ELSE IF (iflag_vdf_trac==-1) THEN
+       !
+       ! Nothing happens
+       !
+       d_tr_cl=0.
+       !
+    ELSE
+       !
+       CALL abort_gcm('iflag_vdf_trac', 'cas non prevu',1)
+       !
+    END IF ! couche limite
+
+    !======================================================================
+    !   Calcul de l'effet de la precipitation grande echelle
+    !   POUR INCA le lessivage est fait directement dans INCA
+    !======================================================================
+
+    IF (lessivage) THEN
+
+       ql_incloud_ref = 10.e-4
+       ql_incloud_ref =  5.e-4
+
+
+       ! calcul du contenu en eau liquide au sein du nuage
+       ql_incl = ql_incloud_ref
+       ! choix du lessivage
+       !
+       IF (iflag_lscav .EQ. 3 .OR. iflag_lscav .EQ. 4) THEN
+          ! ********  Olivier Boucher version (3) possibly with modified ql_incl (4)
+          !
+          DO it = 1, nbtr
+             !  incloud scavenging and removal by large scale rain ! orig : ql_incl was replaced by 0.5e-3 kg/kg
+             ! the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR
+             ! Liu (2001) proposed to use 1.5e-3 kg/kg
+
+             CALL lsc_scav(pdtphys,it,iflag_lscav,ql_incl,prfl,psfl,rneb,beta_fisrt,  &
                   beta_v1,pplay,paprs,t_seri,tr_seri,d_tr_insc,   &
                   d_tr_bcscav,d_tr_evapls,qPrls)
 
-!large scale scavenging tendency
-   DO k = 1, klev
-    DO i = 1, klon
-    d_tr_ls(i,k,it)=d_tr_insc(i,k,it)+d_tr_bcscav(i,k,it)+d_tr_evapls(i,k,it)
-    tr_seri(i,k,it)=tr_seri(i,k,it)+d_tr_ls(i,k,it)
-    ENDDO
-   ENDDO
-     CALL minmaxqfi(tr_seri(:,:,it),0.,1.e33,'lsc scav it = '//solsym(it))
-   END DO  !tr
-
- ELSE IF (iflag_lscav .EQ. 2) THEN ! frac_impa, frac_nucl
-! *********   modified  old version
-
-     d_tr_lessi_nucl(:,:,:) = 0. 
-     d_tr_lessi_impa(:,:,:) = 0.
-     flestottr(:,:,:) = 0. 
-! Tendance des aerosols nuclees et impactes 
-     DO it = 1, nbtr
-        IF (aerosol(it)) THEN
-        his_dh(:)=0.
-           DO k = 1, klev
-              DO i = 1, klon
-!PhH
-              zrho(i,k)=pplay(i,k)/t_seri(i,k)/RD
-              zdz(i,k)=(paprs(i,k)-paprs(i,k+1))/zrho(i,k)/RG
-!
-              END DO
-           END DO
-
-          DO k=klev-1, 1, -1
-            DO i=1, klon
-!             d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.)
-             dx=d_tr_ls(i,k,it)
-             his_dh(i)=his_dh(i)-dx*zrho(i,k)*zdz(i,k)/pdtphys !  kg/m2/s
-             evaplsc = prfl(i,k) - prfl(i,k+1) + psfl(i,k) - psfl(i,k+1)
-! Evaporation Partielle -> Liberation Partielle 0.5*evap
-            IF ( evaplsc .LT.0..and.abs(prfl(i,k+1)+psfl(i,k+1)).gt.1.e-10) THEN
-                evaplsc = (-evaplsc)/(prfl(i,k+1)+psfl(i,k+1))
-! evaplsc est donc positif, his_dh(i) est positif
-!--------------  
-             d_tr_evapls(i,k,it)=0.5*evaplsc*(d_tr_lessi_nucl(i,k+1,it) &
-                                  +d_tr_lessi_impa(i,k+1,it))
-!-------------   d_tr_evapls(i,k,it)=-0.5*evaplsc*(d_tr_lsc(i,k+1,it))
-             beta=0.5*evaplsc
-              if ((prfl(i,k)+psfl(i,k)).lt.1.e-10) THEN
-               beta=1.0*evaplsc
-              endif
-            dx=beta*his_dh(i)/zrho(i,k)/zdz(i,k)*pdtphys
-            his_dh(i)=(1.-beta)*his_dh(i)   ! tracer from
-            d_tr_evapls(i,k,it)=dx
-            ENDIF
-            d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.) &
-                            +d_tr_evapls(i,k,it)
-
-!--------------
-                 d_tr_lessi_nucl(i,k,it) = d_tr_lessi_nucl(i,k,it) +    &
-                      ( 1 - frac_nucl(i,k) )*tr_seri(i,k,it)
-                 d_tr_lessi_impa(i,k,it) = d_tr_lessi_impa(i,k,it) +    &
-                      ( 1 - frac_impa(i,k) )*tr_seri(i,k,it)
-!
-! Flux lessivage total 
-                 flestottr(i,k,it) = flestottr(i,k,it) -   &
-                      ( d_tr_lessi_nucl(i,k,it)   +        &
-                      d_tr_lessi_impa(i,k,it) ) *          &
-                      ( paprs(i,k)-paprs(i,k+1) ) /        &
-                      (RG * pdtphys)
-!! Mise a jour des traceurs due a l'impaction,nucleation 
-!                 tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k)
-!!  calcul de la tendance liee au lessivage stratiforme
-!                 d_tr_ls(i,k,it)=tr_seri(i,k,it)*&
-!                                (1.-1./(frac_impa(i,k)*frac_nucl(i,k)))
-!--------------
-              END DO
-           END DO
-        END IF
-     END DO
-! *********   end modified old version
-
- ELSE IF (iflag_lscav .EQ. 1) THEN ! frac_impa, frac_nucl
-! *********    old version
-
-     d_tr_lessi_nucl(:,:,:) = 0. 
-     d_tr_lessi_impa(:,:,:) = 0.
-     flestottr(:,:,:) = 0. 
-!=========================
-! LESSIVAGE LARGE SCALE : 
-!=========================
-
-! Tendance des aerosols nuclees et impactes 
-! -----------------------------------------
-     DO it = 1, nbtr
-        IF (aerosol(it)) THEN
-           DO k = 1, klev
-              DO i = 1, klon
-                 d_tr_lessi_nucl(i,k,it) = d_tr_lessi_nucl(i,k,it) +    &
-                      ( 1 - frac_nucl(i,k) )*tr_seri(i,k,it)
-                 d_tr_lessi_impa(i,k,it) = d_tr_lessi_impa(i,k,it) +    &
-                      ( 1 - frac_impa(i,k) )*tr_seri(i,k,it)
-
-!
-! Flux lessivage total 
-! ------------------------------------------------------------
-                 flestottr(i,k,it) = flestottr(i,k,it) -   &
-                      ( d_tr_lessi_nucl(i,k,it)   +        &
-                      d_tr_lessi_impa(i,k,it) ) *          &
-                      ( paprs(i,k)-paprs(i,k+1) ) /        &
-                      (RG * pdtphys)
-!
-! Mise a jour des traceurs due a l'impaction,nucleation 
-! ----------------------------------------------------------------------
-                 tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k)
-              END DO
-           END DO
-        END IF
-     END DO
-     
-! *********   end old version
-  ENDIF  !  iflag_lscav . EQ. 1, 2, 3 or 4
-!
-  END IF !  lessivage
-
-!=============================================================
-!   Ecriture des sorties
-!=============================================================
+             !large scale scavenging tendency
+             DO k = 1, klev
+                DO i = 1, klon
+                   d_tr_ls(i,k,it)=d_tr_insc(i,k,it)+d_tr_bcscav(i,k,it)+d_tr_evapls(i,k,it)
+                   tr_seri(i,k,it)=tr_seri(i,k,it)+d_tr_ls(i,k,it)
+                ENDDO
+             ENDDO
+             CALL minmaxqfi(tr_seri(:,:,it),0.,1.e33,'lsc scav it = '//solsym(it))
+          END DO  !tr
+
+       ELSE IF (iflag_lscav .EQ. 2) THEN ! frac_impa, frac_nucl
+          ! *********   modified  old version
+
+          d_tr_lessi_nucl(:,:,:) = 0. 
+          d_tr_lessi_impa(:,:,:) = 0.
+          flestottr(:,:,:) = 0. 
+          ! Tendance des aerosols nuclees et impactes 
+          DO it = 1, nbtr
+             IF (aerosol(it)) THEN
+                his_dh(:)=0.
+                DO k = 1, klev
+                   DO i = 1, klon
+                      !PhH
+                      zrho(i,k)=pplay(i,k)/t_seri(i,k)/RD
+                      zdz(i,k)=(paprs(i,k)-paprs(i,k+1))/zrho(i,k)/RG
+                      !
+                   END DO
+                END DO
+
+                DO k=klev-1, 1, -1
+                   DO i=1, klon
+                      !             d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.)
+                      dx=d_tr_ls(i,k,it)
+                      his_dh(i)=his_dh(i)-dx*zrho(i,k)*zdz(i,k)/pdtphys !  kg/m2/s
+                      evaplsc = prfl(i,k) - prfl(i,k+1) + psfl(i,k) - psfl(i,k+1)
+                      ! Evaporation Partielle -> Liberation Partielle 0.5*evap
+                      IF ( evaplsc .LT.0..and.abs(prfl(i,k+1)+psfl(i,k+1)).gt.1.e-10) THEN
+                         evaplsc = (-evaplsc)/(prfl(i,k+1)+psfl(i,k+1))
+                         ! evaplsc est donc positif, his_dh(i) est positif
+                         !--------------  
+                         d_tr_evapls(i,k,it)=0.5*evaplsc*(d_tr_lessi_nucl(i,k+1,it) &
+                              +d_tr_lessi_impa(i,k+1,it))
+                         !-------------   d_tr_evapls(i,k,it)=-0.5*evaplsc*(d_tr_lsc(i,k+1,it))
+                         beta=0.5*evaplsc
+                         if ((prfl(i,k)+psfl(i,k)).lt.1.e-10) THEN
+                            beta=1.0*evaplsc
+                         endif
+                         dx=beta*his_dh(i)/zrho(i,k)/zdz(i,k)*pdtphys
+                         his_dh(i)=(1.-beta)*his_dh(i)   ! tracer from
+                         d_tr_evapls(i,k,it)=dx
+                      ENDIF
+                      d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.) &
+                           +d_tr_evapls(i,k,it)
+
+                      !--------------
+                      d_tr_lessi_nucl(i,k,it) = d_tr_lessi_nucl(i,k,it) +    &
+                           ( 1 - frac_nucl(i,k) )*tr_seri(i,k,it)
+                      d_tr_lessi_impa(i,k,it) = d_tr_lessi_impa(i,k,it) +    &
+                           ( 1 - frac_impa(i,k) )*tr_seri(i,k,it)
+                      !
+                      ! Flux lessivage total 
+                      flestottr(i,k,it) = flestottr(i,k,it) -   &
+                           ( d_tr_lessi_nucl(i,k,it)   +        &
+                           d_tr_lessi_impa(i,k,it) ) *          &
+                           ( paprs(i,k)-paprs(i,k+1) ) /        &
+                           (RG * pdtphys)
+                      !! Mise a jour des traceurs due a l'impaction,nucleation 
+                      !                 tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k)
+                      !!  calcul de la tendance liee au lessivage stratiforme
+                      !                 d_tr_ls(i,k,it)=tr_seri(i,k,it)*&
+                      !                                (1.-1./(frac_impa(i,k)*frac_nucl(i,k)))
+                      !--------------
+                   END DO
+                END DO
+             END IF
+          END DO
+          ! *********   end modified old version
+
+       ELSE IF (iflag_lscav .EQ. 1) THEN ! frac_impa, frac_nucl
+          ! *********    old version
+
+          d_tr_lessi_nucl(:,:,:) = 0. 
+          d_tr_lessi_impa(:,:,:) = 0.
+          flestottr(:,:,:) = 0. 
+          !=========================
+          ! LESSIVAGE LARGE SCALE : 
+          !=========================
+
+          ! Tendance des aerosols nuclees et impactes 
+          ! -----------------------------------------
+          DO it = 1, nbtr
+             IF (aerosol(it)) THEN
+                DO k = 1, klev
+                   DO i = 1, klon
+                      d_tr_lessi_nucl(i,k,it) = d_tr_lessi_nucl(i,k,it) +    &
+                           ( 1 - frac_nucl(i,k) )*tr_seri(i,k,it)
+                      d_tr_lessi_impa(i,k,it) = d_tr_lessi_impa(i,k,it) +    &
+                           ( 1 - frac_impa(i,k) )*tr_seri(i,k,it)
+
+                      !
+                      ! Flux lessivage total 
+                      ! ------------------------------------------------------------
+                      flestottr(i,k,it) = flestottr(i,k,it) -   &
+                           ( d_tr_lessi_nucl(i,k,it)   +        &
+                           d_tr_lessi_impa(i,k,it) ) *          &
+                           ( paprs(i,k)-paprs(i,k+1) ) /        &
+                           (RG * pdtphys)
+                      !
+                      ! Mise a jour des traceurs due a l'impaction,nucleation 
+                      ! ----------------------------------------------------------------------
+                      tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k)
+                   END DO
+                END DO
+             END IF
+          END DO
+
+          ! *********   end old version
+       ENDIF  !  iflag_lscav . EQ. 1, 2, 3 or 4
+       !
+    END IF !  lessivage
+
+    !=============================================================
+    !   Ecriture des sorties
+    !=============================================================
 #ifdef CPP_IOIPSL
-! INCLUDE "write_histrac.h"
+    ! INCLUDE "write_histrac.h"
 #endif
 
-END SUBROUTINE phytrac
+  END SUBROUTINE phytrac
 
 END MODULE
Index: /LMDZ5/trunk/libf/phylmd/radlwsw_m.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/radlwsw_m.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/radlwsw_m.F90	(revision 2146)
@@ -16,5 +16,6 @@
    flag_aerosol_strat,&
    tau_aero, piz_aero, cg_aero,&
-   tau_aero_rrtm, piz_aero_rrtm, cg_aero_rrtm,& ! rajoute par OB pour RRTM
+   tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,& ! rajoute par OB pour RRTM
+   tau_aero_lw_rrtm, &                                   ! rajoute par C. Kleinschmitt pour RRTM
    cldtaupi, new_aod, &
    qsat, flwc, fiwc, &
@@ -32,4 +33,9 @@
    solsw_aero, solsw0_aero, &
    topswcf_aero, solswcf_aero,&
+!-C. Kleinschmitt for LW diagnostics
+   toplwad_aero, sollwad_aero,&
+   toplwai_aero, sollwai_aero, &
+   toplwad0_aero, sollwad0_aero,&
+!-end
    ZLWFT0_i, ZFLDN0, ZFLUP0,&
    ZSWFT0_i, ZFSDN0, ZFSUP0)
@@ -51,5 +57,6 @@
 !     USE YOERAD   , ONLY : NSW      ,LRRTM    ,LCCNL    ,LCCNO ,&
 ! NSW mis dans .def MPL 20140211
-      USE YOERAD   , ONLY : LRRTM    ,LCCNL    ,LCCNO ,&
+! NLW ajoute par OB
+      USE YOERAD   , ONLY : NLW, LRRTM    ,LCCNL    ,LCCNO ,&
           NRADIP   , NRADLP , NICEOPT, NLIQOPT ,RCCNLND  , RCCNSEA
       USE YOELW    , ONLY : NSIL     ,NTRA     ,NUA      ,TSTAND   ,XP
@@ -67,4 +74,6 @@
       USE YOERRTWN , ONLY : DELWAVE   ,TOTPLNK      
       USE YOMPHY3  , ONLY : RII0
+#else
+      USE aero_mod, ONLY : nbands_lw_rrtm
 #endif
 
@@ -182,8 +191,17 @@
   REAL,    INTENT(in)  :: cg_aero(KLON,KLEV,9,2)                         ! aerosol optical properties (see aeropt.F)
 !--OB
-  REAL,    INTENT(in)  :: tau_aero_rrtm(KLON,KLEV,2,NSW)                 ! aerosol optical properties RRTM
-  REAL,    INTENT(in)  :: piz_aero_rrtm(KLON,KLEV,2,NSW)                 ! aerosol optical properties RRTM
-  REAL,    INTENT(in)  :: cg_aero_rrtm(KLON,KLEV,2,NSW)                  ! aerosol optical properties RRTM
+  REAL,    INTENT(in)  :: tau_aero_sw_rrtm(KLON,KLEV,2,NSW)                 ! aerosol optical properties RRTM
+  REAL,    INTENT(in)  :: piz_aero_sw_rrtm(KLON,KLEV,2,NSW)                 ! aerosol optical properties RRTM
+  REAL,    INTENT(in)  :: cg_aero_sw_rrtm(KLON,KLEV,2,NSW)                  ! aerosol optical properties RRTM
 !--OB fin
+
+!--C. Kleinschmitt
+#ifdef CPP_RRTM
+  REAL,    INTENT(in)  :: tau_aero_lw_rrtm(KLON,KLEV,2,NLW)                 ! LW aerosol optical properties RRTM
+#else
+  REAL,    INTENT(in)  :: tau_aero_lw_rrtm(KLON,KLEV,2,nbands_lw_rrtm)
+#endif
+!--C. Kleinschmitt end
+
   REAL,    INTENT(in)  :: cldtaupi(KLON,KLEV)                            ! cloud optical thickness for pre-industrial aerosol concentrations
   LOGICAL, INTENT(in)  :: new_aod                                        ! flag pour retrouver les resultats exacts de l'AR4 dans le cas ou l'on ne travaille qu'avec les sulfates
@@ -209,6 +227,10 @@
   REAL,    INTENT(out) :: topswad_aero(KLON), solswad_aero(KLON)         ! output: aerosol direct forcing at TOA and surface
   REAL,    INTENT(out) :: topswai_aero(KLON), solswai_aero(KLON)         ! output: aerosol indirect forcing atTOA and surface
+  REAL,    INTENT(out) :: toplwad_aero(KLON), sollwad_aero(KLON)         ! output: LW aerosol direct forcing at TOA and surface
+  REAL,    INTENT(out) :: toplwai_aero(KLON), sollwai_aero(KLON)         ! output: LW aerosol indirect forcing atTOA and surface
   REAL, DIMENSION(klon), INTENT(out)    :: topswad0_aero 
   REAL, DIMENSION(klon), INTENT(out)    :: solswad0_aero
+  REAL, DIMENSION(klon), INTENT(out)    :: toplwad0_aero 
+  REAL, DIMENSION(klon), INTENT(out)    :: sollwad0_aero
   REAL, DIMENSION(kdlon,9), INTENT(out) :: topsw_aero
   REAL, DIMENSION(kdlon,9), INTENT(out) :: topsw0_aero
@@ -271,4 +293,9 @@
   REAL(KIND=8) ztopswad0aero(kdlon), zsolswad0aero(kdlon)   ! Aerosol direct forcing at TOAand surface
   REAL(KIND=8) ztopswaiaero(kdlon), zsolswaiaero(kdlon)     ! dito, indirect
+!-LW by CK
+  REAL(KIND=8) ztoplwadaero(kdlon), zsollwadaero(kdlon)     ! LW Aerosol direct forcing at TOAand surface
+  REAL(KIND=8) ztoplwad0aero(kdlon), zsollwad0aero(kdlon)   ! LW Aerosol direct forcing at TOAand surface
+  REAL(KIND=8) ztoplwaiaero(kdlon), zsollwaiaero(kdlon)     ! dito, indirect
+!-end
   REAL(KIND=8) ztopsw_aero(kdlon,9), ztopsw0_aero(kdlon,9)
   REAL(KIND=8) zsolsw_aero(kdlon,9), zsolsw0_aero(kdlon,9)
@@ -316,4 +343,8 @@
       REAL(KIND=8) PCGA_NAT(klon,klev,NSW)
       REAL(KIND=8) PTAU_NAT(klon,klev,NSW)
+#ifdef CPP_RRTM
+      REAL(KIND=8) PTAU_LW_TOT(klon,klev,NLW)
+      REAL(KIND=8) PTAU_LW_NAT(klon,klev,NLW)
+#endif
       REAL(KIND=8) PSFSWDIR(klon,NSW)
       REAL(KIND=8) PSFSWDIF(klon,NSW)
@@ -644,11 +675,11 @@
       DO kk=1, NSW
 !
-      PTAU_TOT(i,kflev+1-k,kk)=tau_aero_rrtm(i,k,2,kk)
-      PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_rrtm(i,k,2,kk)
-      PCGA_TOT(i,kflev+1-k,kk)=cg_aero_rrtm(i,k,2,kk)
-!
-      PTAU_NAT(i,kflev+1-k,kk)=tau_aero_rrtm(i,k,1,kk)
-      PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_rrtm(i,k,1,kk)
-      PCGA_NAT(i,kflev+1-k,kk)=cg_aero_rrtm(i,k,1,kk)
+      PTAU_TOT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,2,kk)
+      PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,2,kk)
+      PCGA_TOT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,2,kk)
+!
+      PTAU_NAT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,1,kk)
+      PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,1,kk)
+      PCGA_NAT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,1,kk)
 !
       ENDDO
@@ -657,4 +688,19 @@
 !-end OB
 !
+!--C. Kleinschmitt
+!--aerosol TOT  - anthropogenic+natural
+!--aerosol NAT  - natural only
+!
+      DO i = 1, kdlon
+      DO k = 1, kflev
+      DO kk=1, NLW
+!
+      PTAU_LW_TOT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,2,kk)
+      PTAU_LW_NAT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,1,kk)
+!
+      ENDDO
+      ENDDO
+      ENDDO
+!-end C. Kleinschmitt
 !      
       DO i = 1, kdlon
@@ -761,4 +807,5 @@
          PPIZA_TOT, PCGA_TOT,PTAU_TOT,&
          PPIZA_NAT, PCGA_NAT,PTAU_NAT,           &  ! rajoute par OB pour diagnostiquer effet direct
+         PTAU_LW_TOT, PTAU_LW_NAT,               &  ! rajoute par C. Kleinschmitt
          ZFLUX_i  , ZFLUC_i ,&
          ZFSDWN_i , ZFSUP_i , ZFCDWN_i, ZFCUP_i,&
@@ -767,4 +814,7 @@
          ZTOPSWAIAERO,ZSOLSWAIAERO, &
          ZTOPSWCF_AERO,ZSOLSWCF_AERO, &
+         ZTOPLWADAERO,ZSOLLWADAERO,&  ! rajoute par C. Kleinscmitt pour LW diagnostics
+         ZTOPLWAD0AERO,ZSOLLWAD0AERO,&
+         ZTOPLWAIAERO,ZSOLLWAIAERO, &
          ok_ade, ok_aie, flag_aerosol,flag_aerosol_strat) ! flags aerosols
             
@@ -813,5 +863,7 @@
 !  PPIZA_NAT    (KPROMA,KLEV,NSW); Single scattering albedo of natural aerosols 
 !  PCGA_NAT     (KPROMA,KLEV,NSW); Assymetry factor for natural aerosols 
-!  PTAU_NAT     (KPROMA,KLEV,NSW); Optical depth of natiral aerosols 
+!  PTAU_NAT     (KPROMA,KLEV,NSW); Optical depth of natiral aerosols
+!  PTAU_LW_TOT  (KPROMA,KLEV,NLW); LW Optical depth of total aerosols  
+!  PTAU_LW_NAT  (KPROMA,KLEV,NLW); LW Optical depth of natural aerosols  
 !  PSFSWDIR     (KPROMA,NSW)     ;
 !  PSFSWDIF     (KPROMA,NSW)     ;
@@ -974,5 +1026,10 @@
           solsw0_aero(iof+i,:) = zsolsw0_aero(i,:)
           topswcf_aero(iof+i,:) = ztopswcf_aero(i,:)
-          solswcf_aero(iof+i,:) = zsolswcf_aero(i,:)          
+          solswcf_aero(iof+i,:) = zsolswcf_aero(i,:)   
+          !-LW
+          toplwad_aero(iof+i) = ztoplwadaero(i)
+          toplwad0_aero(iof+i) = ztoplwad0aero(i)
+          sollwad_aero(iof+i) = zsollwadaero(i)
+          sollwad0_aero(iof+i) = zsollwad0aero(i)    
         ENDDO
     ELSE
@@ -986,4 +1043,9 @@
           solsw_aero(iof+i,:) = 0.
           solsw0_aero(iof+i,:) = 0.
+          !-LW
+          toplwad_aero(iof+i) = 0.0
+          sollwad_aero(iof+i) = 0.0
+          toplwad0_aero(iof+i) = 0.0
+          sollwad0_aero(iof+i) = 0.0
         ENDDO
     ENDIF
@@ -992,4 +1054,7 @@
           topswai_aero(iof+i) = ztopswaiaero(i)
           solswai_aero(iof+i) = zsolswaiaero(i)
+          !-LW
+          toplwai_aero(iof+i) = ztoplwaiaero(i)
+          sollwai_aero(iof+i) = zsollwaiaero(i)
         ENDDO
     ELSE
@@ -997,4 +1062,7 @@
           topswai_aero(iof+i) = 0.0
           solswai_aero(iof+i) = 0.0
+          !-LW
+          toplwai_aero(iof+i) = 0.0
+          sollwai_aero(iof+i) = 0.0
         ENDDO
     ENDIF
Index: /LMDZ5/trunk/libf/phylmd/readaerosol_optic.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/readaerosol_optic.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/readaerosol_optic.F90	(revision 2146)
@@ -14,6 +14,6 @@
   USE dimphy
   USE aero_mod
-  USE phys_local_var_mod, only: sconcso4,sconcoa,sconcbc,sconcss,sconcdust, &
-      concso4,concoa,concbc,concss,concdust,loadso4,loadoa,loadbc,loadss,loaddust, &
+  USE phys_local_var_mod, only: sconcso4,sconcno3,sconcoa,sconcbc,sconcss,sconcdust, &
+      concso4,concno3,concoa,concbc,concss,concdust,loadso4,loadoa,loadbc,loadss,loaddust, &
       load_tmp1,load_tmp2,load_tmp3,load_tmp4,load_tmp5,load_tmp6,load_tmp7
   IMPLICIT NONE
@@ -82,5 +82,5 @@
        flag_aerosol .EQ. 6 ) THEN 
 
-     CALL readaerosol_interp(id_ASSO4M, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sulfate, sulfate_pi,loadso4)
+     CALL readaerosol_interp(id_ASSO4M_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sulfate, sulfate_pi,loadso4)
   ELSE
      sulfate(:,:) = 0. ; sulfate_pi(:,:) = 0.
@@ -93,6 +93,6 @@
 
      ! Get bc aerosol distribution 
-     CALL readaerosol_interp(id_ASBCM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcsol, bcsol_pi, load_tmp1 )
-     CALL readaerosol_interp(id_AIBCM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcins, bcins_pi, load_tmp2 )
+     CALL readaerosol_interp(id_ASBCM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcsol, bcsol_pi, load_tmp1 )
+     CALL readaerosol_interp(id_AIBCM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcins, bcins_pi, load_tmp2 )
      loadbc(:)=load_tmp1(:)+load_tmp2(:)
   ELSE
@@ -107,6 +107,6 @@
        flag_aerosol .EQ. 6 ) THEN
 
-     CALL readaerosol_interp(id_ASPOMM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomsol, pomsol_pi, load_tmp3)
-     CALL readaerosol_interp(id_AIPOMM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomins, pomins_pi, load_tmp4)
+     CALL readaerosol_interp(id_ASPOMM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomsol, pomsol_pi, load_tmp3)
+     CALL readaerosol_interp(id_AIPOMM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomins, pomins_pi, load_tmp4)
      loadoa(:)=load_tmp3(:)+load_tmp4(:)
   ELSE
@@ -121,7 +121,7 @@
       flag_aerosol .EQ. 6 ) THEN 
 
-      CALL readaerosol_interp(id_SSSSM ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sssupco, sssupco_pi, load_tmp5) 
-      CALL readaerosol_interp(id_CSSSM ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sscoarse,sscoarse_pi, load_tmp6) 
-      CALL readaerosol_interp(id_ASSSM ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, ssacu, ssacu_pi, load_tmp7) 
+      CALL readaerosol_interp(id_SSSSM_phy ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sssupco, sssupco_pi, load_tmp5) 
+      CALL readaerosol_interp(id_CSSSM_phy ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sscoarse,sscoarse_pi, load_tmp6) 
+      CALL readaerosol_interp(id_ASSSM_phy ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, ssacu, ssacu_pi, load_tmp7) 
      loadss(:)=load_tmp5(:)+load_tmp6(:)+load_tmp7(:)
   ELSE
@@ -136,5 +136,5 @@
       flag_aerosol .EQ. 6 ) THEN 
 
-      CALL readaerosol_interp(id_CIDUSTM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, cidust, cidust_pi, loaddust) 
+      CALL readaerosol_interp(id_CIDUSTM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, cidust, cidust_pi, loaddust) 
 
   ELSE
@@ -146,14 +146,14 @@
 ! Store all aerosols in one variable
 !
-  m_allaer(:,:,id_ASBCM)  = bcsol(:,:)        ! ASBCM
-  m_allaer(:,:,id_ASPOMM) = pomsol(:,:)       ! ASPOMM
-  m_allaer(:,:,id_ASSO4M) = sulfate(:,:)      ! ASSO4M (= SO4) 
-  m_allaer(:,:,id_CSSO4M) = 0.                ! CSSO4M 
-  m_allaer(:,:,id_SSSSM)  = sssupco(:,:)      ! SSSSM
-  m_allaer(:,:,id_CSSSM)  = sscoarse(:,:)     ! CSSSM
-  m_allaer(:,:,id_ASSSM)  = ssacu(:,:)        ! ASSSM
-  m_allaer(:,:,id_CIDUSTM)= cidust(:,:)       ! CIDUSTM
-  m_allaer(:,:,id_AIBCM)  = bcins(:,:)        ! AIBCM
-  m_allaer(:,:,id_AIPOMM) = pomins(:,:)       ! AIPOMM
+  m_allaer(:,:,id_ASBCM_phy)  = bcsol(:,:)        ! ASBCM
+  m_allaer(:,:,id_ASPOMM_phy) = pomsol(:,:)       ! ASPOMM
+  m_allaer(:,:,id_ASSO4M_phy) = sulfate(:,:)      ! ASSO4M (= SO4) 
+  m_allaer(:,:,id_CSSO4M_phy) = 0.                ! CSSO4M 
+  m_allaer(:,:,id_SSSSM_phy)  = sssupco(:,:)      ! SSSSM
+  m_allaer(:,:,id_CSSSM_phy)  = sscoarse(:,:)     ! CSSSM
+  m_allaer(:,:,id_ASSSM_phy)  = ssacu(:,:)        ! ASSSM
+  m_allaer(:,:,id_CIDUSTM_phy)= cidust(:,:)       ! CIDUSTM
+  m_allaer(:,:,id_AIBCM_phy)  = bcins(:,:)        ! AIBCM
+  m_allaer(:,:,id_AIPOMM_phy) = pomins(:,:)       ! AIPOMM
 
 !RAF
@@ -207,5 +207,5 @@
 
      CALL aeropt(pplay, paprs, t_seri, sulfate, rhcl, &
-          tau_aero(:,:,id_ASSO4M,:), piz_aero(:,:,id_ASSO4M,:), cg_aero(:,:,id_ASSO4M,:), aerindex)
+          tau_aero(:,:,id_ASSO4M_phy,:), piz_aero(:,:,id_ASSO4M_phy,:), cg_aero(:,:,id_ASSO4M_phy,:), aerindex)
      
   END IF
@@ -213,14 +213,16 @@
 
 ! Diagnostics calculation for CMIP5 protocol
-  sconcso4(:)=m_allaer(:,1,id_ASSO4M)*1.e-9
-  sconcoa(:)=(m_allaer(:,1,id_ASPOMM)+m_allaer(:,1,id_AIPOMM))*1.e-9
-  sconcbc(:)=(m_allaer(:,1,id_ASBCM)+m_allaer(:,1,id_AIBCM))*1.e-9
-  sconcss(:)=(m_allaer(:,1,id_ASSSM)+m_allaer(:,1,id_CSSSM)+m_allaer(:,1,id_SSSSM))*1.e-9
-  sconcdust(:)=m_allaer(:,1,id_CIDUSTM)*1.e-9
-  concso4(:,:)=m_allaer(:,:,id_ASSO4M)*1.e-9
-  concoa(:,:)=(m_allaer(:,:,id_ASPOMM)+m_allaer(:,:,id_AIPOMM))*1.e-9
-  concbc(:,:)=(m_allaer(:,:,id_ASBCM)+m_allaer(:,:,id_AIBCM))*1.e-9
-  concss(:,:)=(m_allaer(:,:,id_ASSSM)+m_allaer(:,:,id_CSSSM)+m_allaer(:,:,id_SSSSM))*1.e-9
-  concdust(:,:)=m_allaer(:,:,id_CIDUSTM)*1.e-9
+  sconcso4(:)=m_allaer(:,1,id_ASSO4M_phy)*1.e-9
+!  sconcno3(:)=m_allaer(:,1,id_ASNO3M_phy)*1.e-9
+  sconcoa(:)=(m_allaer(:,1,id_ASPOMM_phy)+m_allaer(:,1,id_AIPOMM_phy))*1.e-9
+  sconcbc(:)=(m_allaer(:,1,id_ASBCM_phy)+m_allaer(:,1,id_AIBCM_phy))*1.e-9
+  sconcss(:)=(m_allaer(:,1,id_ASSSM_phy)+m_allaer(:,1,id_CSSSM_phy)+m_allaer(:,1,id_SSSSM_phy))*1.e-9
+  sconcdust(:)=m_allaer(:,1,id_CIDUSTM_phy)*1.e-9
+  concso4(:,:)=m_allaer(:,:,id_ASSO4M_phy)*1.e-9
+!  concno3(:,:)=m_allaer(:,:,id_ASNO3M_phy)*1.e-9
+  concoa(:,:)=(m_allaer(:,:,id_ASPOMM_phy)+m_allaer(:,:,id_AIPOMM_phy))*1.e-9
+  concbc(:,:)=(m_allaer(:,:,id_ASBCM_phy)+m_allaer(:,:,id_AIBCM_phy))*1.e-9
+  concss(:,:)=(m_allaer(:,:,id_ASSSM_phy)+m_allaer(:,:,id_CSSSM_phy)+m_allaer(:,:,id_SSSSM_phy))*1.e-9
+  concdust(:,:)=m_allaer(:,:,id_CIDUSTM_phy)*1.e-9
 
 
Index: /LMDZ5/trunk/libf/phylmd/readaerosolstrato.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/readaerosolstrato.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/readaerosolstrato.F90	(revision 2146)
@@ -142,9 +142,8 @@
     ENDIF !--debut ou nouveau mois
 
-!--total vertical aod at the 5 wavelengths
+!--total vertical aod at the 6 wavelengths
     DO wave=1, nwave
     DO k=1, klev
-    tausum_aero(:,wave,id_STRAT)=tausum_aero(:,wave,id_STRAT)+tau_aer_strat(:,k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
-!    tausum_aero(:,wave,id_ASBCM)=tausum_aero(:,wave,id_ASBCM)+tau_aer_strat(:,k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
+    tausum_aero(:,wave,id_STRAT_phy)=tausum_aero(:,wave,id_STRAT_phy)+tau_aer_strat(:,k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
     ENDDO
     ENDDO
Index: /LMDZ5/trunk/libf/phylmd/rrtm/aeropt_5wv_rrtm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/aeropt_5wv_rrtm.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/aeropt_5wv_rrtm.F90	(revision 2146)
@@ -12,5 +12,4 @@
   USE aero_mod
   USE phys_local_var_mod, only: od550aer,od865aer,ec550aer,od550lt1aer
-  USE YOMCST           , only : RD , RG
 
   !
@@ -50,4 +49,5 @@
   !
   IMPLICIT NONE
+  INCLUDE "YOMCST.h"
   !
   ! Input arguments:
@@ -55,5 +55,5 @@
   REAL, DIMENSION(klon,klev), INTENT(in)   :: pdel
   REAL, INTENT(in)                         :: delt
-  REAL, DIMENSION(klon,klev,naero_spc), INTENT(in) :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_tot), INTENT(in) :: m_allaer
   REAL, DIMENSION(klon,klev), INTENT(in)   :: RHcl     ! humidite relative ciel clair
   INTEGER,INTENT(in)                       :: flag_aerosol
@@ -73,5 +73,5 @@
   LOGICAL :: soluble
   
-  INTEGER :: i, k, m
+  INTEGER :: i, k, m, aerindex
   INTEGER :: spsol, spinsol, la
   INTEGER :: RH_num(klon,klev)
@@ -96,5 +96,6 @@
   REAL :: zdp1(klon,klev) 
   INTEGER, ALLOCATABLE, DIMENSION(:)  :: aerosol_name
-  INTEGER :: nb_aer
+  INTEGER :: nb_aer, itau
+  LOGICAL :: ok_itau
   
   REAL :: dh(KLON,KLEV)
@@ -105,5 +106,5 @@
   REAL :: alpha_aeri_5wv(las,naero_insoluble)         ! Ext. coeff. ** m2/g 
 
-  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp
+  REAL, DIMENSION(klon,klev,naero_tot) :: mass_temp
   
   !
@@ -113,5 +114,5 @@
   LOGICAL :: used_tau(naero_tot)
   INTEGER :: n
-  
+
 ! From here on we look at the optical parameters at 5 wavelengths:  
 ! 443nm, 550, 670, 765 and 865 nm 
@@ -222,39 +223,39 @@
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M
-     aerosol_name(2) = id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy
+     aerosol_name(2) = id_CSSO4M_phy
   ELSEIF (flag_aerosol .EQ. 2) THEN
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASBCM
-     aerosol_name(2) = id_AIBCM
+     aerosol_name(1) = id_ASBCM_phy
+     aerosol_name(2) = id_AIBCM_phy
   ELSEIF (flag_aerosol .EQ. 3) THEN 
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASPOMM
-     aerosol_name(2) = id_AIPOMM
+     aerosol_name(1) = id_ASPOMM_phy
+     aerosol_name(2) = id_AIPOMM_phy
   ELSEIF (flag_aerosol .EQ. 4) THEN 
      nb_aer = 3
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CSSSM
-     aerosol_name(2) = id_SSSSM
-     aerosol_name(3) = id_ASSSM
+     aerosol_name(1) = id_CSSSM_phy
+     aerosol_name(2) = id_SSSSM_phy
+     aerosol_name(3) = id_ASSSM_phy
   ELSEIF (flag_aerosol .EQ. 5) THEN 
      nb_aer = 1
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CIDUSTM
+     aerosol_name(1) = id_CIDUSTM_phy
   ELSEIF (flag_aerosol .EQ. 6) THEN 
      nb_aer = 10
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M      
-     aerosol_name(2) = id_ASBCM
-     aerosol_name(3) = id_AIBCM
-     aerosol_name(4) = id_ASPOMM
-     aerosol_name(5) = id_AIPOMM
-     aerosol_name(6) = id_CSSSM
-     aerosol_name(7) = id_SSSSM
-     aerosol_name(8) = id_ASSSM
-     aerosol_name(9) = id_CIDUSTM
-     aerosol_name(10) = id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy      
+     aerosol_name(2) = id_ASBCM_phy
+     aerosol_name(3) = id_AIBCM_phy
+     aerosol_name(4) = id_ASPOMM_phy
+     aerosol_name(5) = id_AIPOMM_phy
+     aerosol_name(6) = id_CSSSM_phy
+     aerosol_name(7) = id_SSSSM_phy
+     aerosol_name(8) = id_ASSSM_phy
+     aerosol_name(9) = id_CIDUSTM_phy
+     aerosol_name(10) = id_CSSO4M_phy
   ENDIF
 
@@ -293,34 +294,34 @@
   DO m=1,nb_aer   ! tau is only computed for each mass    
     fac=1.0
-    IF (aerosol_name(m).EQ.id_ASBCM) THEN
+    IF (aerosol_name(m).EQ.id_ASBCM_phy) THEN
         soluble=.TRUE.
         spsol=1
-    ELSEIF (aerosol_name(m).EQ.id_ASPOMM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_ASPOMM_phy) THEN 
         soluble=.TRUE.
         spsol=2 
-    ELSEIF (aerosol_name(m).EQ.id_ASSO4M) THEN
+    ELSEIF (aerosol_name(m).EQ.id_ASSO4M_phy) THEN
         soluble=.TRUE.
         spsol=3
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-    ELSEIF (aerosol_name(m).EQ.id_CSSO4M) THEN
+    ELSEIF (aerosol_name(m).EQ.id_CSSO4M_phy) THEN
         soluble=.TRUE.
         spsol=4
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-    ELSEIF (aerosol_name(m).EQ.id_SSSSM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_SSSSM_phy) THEN 
         soluble=.TRUE.
         spsol=5
-    ELSEIF (aerosol_name(m).EQ.id_CSSSM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_CSSSM_phy) THEN 
         soluble=.TRUE.
         spsol=6
-    ELSEIF (aerosol_name(m).EQ.id_ASSSM) THEN
+    ELSEIF (aerosol_name(m).EQ.id_ASSSM_phy) THEN
         soluble=.TRUE.
         spsol=7
-    ELSEIF (aerosol_name(m).EQ.id_CIDUSTM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_CIDUSTM_phy) THEN 
         soluble=.FALSE.
         spinsol=1
-    ELSEIF  (aerosol_name(m).EQ.id_AIBCM) THEN 
+    ELSEIF  (aerosol_name(m).EQ.id_AIBCM_phy) THEN 
         soluble=.FALSE.
         spinsol=2
-    ELSEIF (aerosol_name(m).EQ.id_AIPOMM) THEN 
+    ELSEIF (aerosol_name(m).EQ.id_AIPOMM_phy) THEN 
         soluble=.FALSE.
         spinsol=3
@@ -335,4 +336,6 @@
     ENDIF
 
+    aerindex=aerosol_name(m)
+
     DO la=1,las
 
@@ -344,10 +347,10 @@
                              (alpha_aers_5wv(RH_num(i,k)+1,la,spsol) - & 
                               alpha_aers_5wv(RH_num(i,k),la,spsol))
-              tau(i,k,la,spsol) = mass_temp(i,k,spsol)*1000.*zdp1(i,k)   &
-                                 *tau_ae5wv_int*delt*fac
-              tausum(i,la,spsol)=tausum(i,la,spsol)+tau(i,k,la,spsol)
+              tau(i,k,la,aerindex) = mass_temp(i,k,aerindex)*1000.*zdp1(i,k)*   &
+                                    tau_ae5wv_int*delt*fac
+              tausum(i,la,aerindex)=tausum(i,la,aerindex)+tau(i,k,la,aerindex)
             ENDDO
           ENDDO
-
+ 
       ELSE                         ! For insoluble aerosol
 
@@ -355,8 +358,7 @@
           DO i=1, KLON
             tau_ae5wv_int = alpha_aeri_5wv(la,spinsol)
-            tau(i,k,la,naero_soluble+spinsol) = mass_temp(i,k,naero_soluble+spinsol)*1000.*zdp1(i,k)* &
-                                                tau_ae5wv_int*delt*fac
-            tausum(i,la,naero_soluble+spinsol)= tausum(i,la,naero_soluble+spinsol)  &
-                                               +tau(i,k,la,naero_soluble+spinsol)
+            tau(i,k,la,aerindex) = mass_temp(i,k,aerindex)*1000.*zdp1(i,k)* &
+                                   tau_ae5wv_int*delt*fac
+            tausum(i,la,aerindex)= tausum(i,la,aerindex)+tau(i,k,la,aerindex)
           ENDDO
         ENDDO
@@ -405,7 +407,7 @@
   ENDDO
 
-  od550lt1aer(:)=tausum(:,la550,id_ASSO4M)+tausum(:,la550,id_ASBCM) +tausum(:,la550,id_AIBCM)+ &
-                 tausum(:,la550,id_ASPOMM)+tausum(:,la550,id_AIPOMM)+tausum(:,la550,id_ASSSM)+ &
-                 0.03*tausum(:,la550,id_CSSSM)+0.4*tausum(:,la550,id_CIDUSTM)
+  od550lt1aer(:)=tausum(:,la550,id_ASSO4M_phy)+tausum(:,la550,id_ASBCM_phy) +tausum(:,la550,id_AIBCM_phy)+ &
+                 tausum(:,la550,id_ASPOMM_phy)+tausum(:,la550,id_AIPOMM_phy)+tausum(:,la550,id_ASSSM_phy)+ &
+                 0.03*tausum(:,la550,id_CSSSM_phy)+0.4*tausum(:,la550,id_CIDUSTM_phy)
 
   DEALLOCATE(aerosol_name) 
Index: /LMDZ5/trunk/libf/phylmd/rrtm/aeropt_6bands_rrtm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/aeropt_6bands_rrtm.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/aeropt_6bands_rrtm.F90	(revision 2146)
@@ -6,10 +6,9 @@
      tau_allaer, piz_allaer, &
      cg_allaer, m_allaer_pi, &
-     flag_aerosol, pplay, t_seri )
+     flag_aerosol, zrho )
 
   USE dimphy
   USE aero_mod
   USE phys_local_var_mod, only: absvisaer
-  USE YOMCST            , only: RD , RG
 
   !    Yves Balkanski le 12 avril 2006
@@ -22,4 +21,5 @@
   IMPLICIT NONE
 
+  INCLUDE "YOMCST.h"
   INCLUDE "iniprint.h"
   INCLUDE "clesphys.h"
@@ -30,10 +30,9 @@
   REAL, DIMENSION(klon,klev),     INTENT(in)  :: pdel
   REAL,                           INTENT(in)  :: delt
-  REAL, DIMENSION(klon,klev,naero_spc),   INTENT(in)  :: m_allaer
-  REAL, DIMENSION(klon,klev,naero_spc),   INTENT(in)  :: m_allaer_pi
+  REAL, DIMENSION(klon,klev,naero_tot),   INTENT(in)  :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_tot),   INTENT(in)  :: m_allaer_pi
   REAL, DIMENSION(klon,klev),     INTENT(in)  :: RHcl       ! humidite relative ciel clair
   INTEGER,                        INTENT(in)  :: flag_aerosol
-  REAL, DIMENSION(klon,klev),     INTENT(in)  :: pplay
-  REAL, DIMENSION(klon,klev),     INTENT(in)  :: t_seri
+  REAL, DIMENSION(klon,klev),     INTENT(in)  :: zrho
   !
   ! Output arguments:
@@ -41,7 +40,7 @@
   ! 2= natural aerosols
   !
-  REAL, DIMENSION(klon,klev,2,nbands_rrtm), INTENT(out) :: tau_allaer ! epaisseur optique aerosol
-  REAL, DIMENSION(klon,klev,2,nbands_rrtm), INTENT(out) :: piz_allaer ! single scattering albedo aerosol
-  REAL, DIMENSION(klon,klev,2,nbands_rrtm), INTENT(out) :: cg_allaer  ! asymmetry parameter aerosol
+  REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(out) :: tau_allaer ! epaisseur optique aerosol
+  REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(out) :: piz_allaer ! single scattering albedo aerosol
+  REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(out) :: cg_allaer  ! asymmetry parameter aerosol
 
   !
@@ -67,5 +66,4 @@
   REAL :: cg_ae2b_int    ! Intermediate computation of Assymetry parameter
   REAL :: Fact_RH(nbre_RH)
-  REAL :: zrho
   REAL :: fac
   REAL :: zdp1(klon,klev) 
@@ -73,10 +71,10 @@
   INTEGER :: nb_aer
 
-  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp
-  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp_pi
-  REAL, DIMENSION(klon,klev,naero_tot,nbands_rrtm) ::  tau_ae
-  REAL, DIMENSION(klon,klev,naero_tot,nbands_rrtm) ::  tau_ae_pi
-  REAL, DIMENSION(klon,klev,naero_tot,nbands_rrtm) ::  piz_ae
-  REAL, DIMENSION(klon,klev,naero_tot,nbands_rrtm) ::  cg_ae
+  REAL, DIMENSION(klon,klev,naero_tot) :: mass_temp
+  REAL, DIMENSION(klon,klev,naero_tot) :: mass_temp_pi
+  REAL, DIMENSION(klon,klev,naero_tot,nbands_sw_rrtm) ::  tau_ae
+  REAL, DIMENSION(klon,klev,naero_tot,nbands_sw_rrtm) ::  tau_ae_pi
+  REAL, DIMENSION(klon,klev,naero_tot,nbands_sw_rrtm) ::  piz_ae
+  REAL, DIMENSION(klon,klev,naero_tot,nbands_sw_rrtm) ::  cg_ae
 
 
@@ -84,10 +82,10 @@
   ! Proprietes optiques
   !
-  REAL:: alpha_aers_6bands(nbre_RH,nbands_rrtm,naero_soluble)   !--unit m2/g SO4
-  REAL:: alpha_aeri_6bands(nbands_rrtm,naero_insoluble)
-  REAL:: cg_aers_6bands(nbre_RH,nbands_rrtm,naero_soluble)      !--unit 
-  REAL:: cg_aeri_6bands(nbands_rrtm,naero_insoluble)
-  REAL:: piz_aers_6bands(nbre_RH,nbands_rrtm,naero_soluble)     !-- unit
-  REAL:: piz_aeri_6bands(nbands_rrtm,naero_insoluble)        !-- unit
+  REAL:: alpha_aers_6bands(nbre_RH,nbands_sw_rrtm,naero_soluble)   !--unit m2/g SO4
+  REAL:: alpha_aeri_6bands(nbands_sw_rrtm,naero_insoluble)
+  REAL:: cg_aers_6bands(nbre_RH,nbands_sw_rrtm,naero_soluble)      !--unit 
+  REAL:: cg_aeri_6bands(nbands_sw_rrtm,naero_insoluble)
+  REAL:: piz_aers_6bands(nbre_RH,nbands_sw_rrtm,naero_soluble)     !-- unit
+  REAL:: piz_aeri_6bands(nbands_sw_rrtm,naero_insoluble)        !-- unit
 
   INTEGER :: id
@@ -280,16 +278,15 @@
   spsol = 0
   spinsol = 0 
-  if(NSW.NE.nbands_rrtm) then
+  IF (NSW.NE.nbands_sw_rrtm) THEN
      print *,'Erreur NSW doit etre egal a 6 pour cette routine'
      stop
-  endif
+  ENDIF
 
   DO k=1, klev
     DO i=1, klon
-      zrho=pplay(i,k)/t_seri(i,k)/RD                  ! kg/m3
-!CDIR UNROLL=naero_spc
-      mass_temp(i,k,:) = m_allaer(i,k,:) / zrho / 1.e+9
-!CDIR UNROLL=naero_spc
-      mass_temp_pi(i,k,:) = m_allaer_pi(i,k,:) / zrho / 1.e+9
+!CDIR UNROLL=naero_tot
+      mass_temp(i,k,:) = m_allaer(i,k,:) / zrho(i,k) / 1.e+9  !--kg/kg
+!CDIR UNROLL=naero_tot
+      mass_temp_pi(i,k,:) = m_allaer_pi(i,k,:) / zrho(i,k) / 1.e+9
       zdp1(i,k)=pdel(i,k)/(RG*delt)      ! air mass auxiliary  variable --> zdp1 [kg/(m^2 *s)]
     ENDDO
@@ -299,39 +296,39 @@
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M
-     aerosol_name(2) = id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy
+     aerosol_name(2) = id_CSSO4M_phy
   ELSEIF (flag_aerosol .EQ. 2) THEN
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASBCM
-     aerosol_name(2) = id_AIBCM
+     aerosol_name(1) = id_ASBCM_phy
+     aerosol_name(2) = id_AIBCM_phy
   ELSEIF (flag_aerosol .EQ. 3) THEN 
      nb_aer = 2
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASPOMM
-     aerosol_name(2) = id_AIPOMM
+     aerosol_name(1) = id_ASPOMM_phy
+     aerosol_name(2) = id_AIPOMM_phy
   ELSEIF (flag_aerosol .EQ. 4) THEN 
      nb_aer = 3
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CSSSM
-     aerosol_name(2) = id_SSSSM
-     aerosol_name(3) = id_ASSSM
+     aerosol_name(1) = id_CSSSM_phy
+     aerosol_name(2) = id_SSSSM_phy
+     aerosol_name(3) = id_ASSSM_phy
   ELSEIF (flag_aerosol .EQ. 5) THEN 
      nb_aer = 1
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_CIDUSTM
+     aerosol_name(1) = id_CIDUSTM_phy
   ELSEIF (flag_aerosol .EQ. 6) THEN 
      nb_aer = 10
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M      
-     aerosol_name(2) = id_ASBCM
-     aerosol_name(3) = id_AIBCM
-     aerosol_name(4) = id_ASPOMM
-     aerosol_name(5) = id_AIPOMM
-     aerosol_name(6) = id_CSSSM
-     aerosol_name(7) = id_SSSSM
-     aerosol_name(8) = id_ASSSM
-     aerosol_name(9) = id_CIDUSTM
-     aerosol_name(10)= id_CSSO4M
+     aerosol_name(1) = id_ASSO4M_phy      
+     aerosol_name(2) = id_ASBCM_phy
+     aerosol_name(3) = id_AIBCM_phy
+     aerosol_name(4) = id_ASPOMM_phy
+     aerosol_name(5) = id_AIPOMM_phy
+     aerosol_name(6) = id_CSSSM_phy
+     aerosol_name(7) = id_SSSSM_phy
+     aerosol_name(8) = id_ASSSM_phy
+     aerosol_name(9) = id_CIDUSTM_phy
+     aerosol_name(10)= id_CSSO4M_phy
   ENDIF
 
@@ -354,5 +351,5 @@
     DO i=1, KLON
       rh(i,k)=MIN(RHcl(i,k)*100.,RH_MAX)
-      RH_num(i,k) = INT( rh(i,k)/10. + 1.)
+      RH_num(i,k) = INT(rh(i,k)/10. + 1.)
       IF (rh(i,k).GT.85.) RH_num(i,k)=10
       IF (rh(i,k).GT.90.) RH_num(i,k)=11
@@ -365,34 +362,34 @@
   DO m=1,nb_aer   ! tau is only computed for each mass
      fac=1.0
-     IF (aerosol_name(m).EQ.id_ASBCM) THEN
+     IF (aerosol_name(m).EQ.id_ASBCM_phy) THEN
         soluble=.TRUE.
         spsol=1
-     ELSEIF (aerosol_name(m).EQ.id_ASPOMM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_ASPOMM_phy) THEN 
         soluble=.TRUE.
         spsol=2 
-     ELSEIF (aerosol_name(m).EQ.id_ASSO4M) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_ASSO4M_phy) THEN 
         soluble=.TRUE.
         spsol=3
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-     ELSEIF  (aerosol_name(m).EQ.id_CSSO4M) THEN
+     ELSEIF  (aerosol_name(m).EQ.id_CSSO4M_phy) THEN
         soluble=.TRUE.
         spsol=4
         fac=1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
-     ELSEIF (aerosol_name(m).EQ.id_SSSSM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_SSSSM_phy) THEN 
          soluble=.TRUE.
          spsol=5
-     ELSEIF (aerosol_name(m).EQ.id_CSSSM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_CSSSM_phy) THEN 
          soluble=.TRUE.
          spsol=6
-     ELSEIF (aerosol_name(m).EQ.id_ASSSM) THEN
+     ELSEIF (aerosol_name(m).EQ.id_ASSSM_phy) THEN
          soluble=.TRUE.
          spsol=7
-     ELSEIF (aerosol_name(m).EQ.id_CIDUSTM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_CIDUSTM_phy) THEN 
          soluble=.FALSE.
          spinsol=1
-     ELSEIF  (aerosol_name(m).EQ.id_AIBCM) THEN 
+     ELSEIF  (aerosol_name(m).EQ.id_AIBCM_phy) THEN 
          soluble=.FALSE.
          spinsol=2
-     ELSEIF (aerosol_name(m).EQ.id_AIPOMM) THEN 
+     ELSEIF (aerosol_name(m).EQ.id_AIPOMM_phy) THEN 
          soluble=.FALSE.
          spinsol=3
@@ -471,67 +468,67 @@
        DO i=1, KLON
 !--anthropogenic aerosol
-         tau_allaer(i,k,2,inu)=tau_ae(i,k,id_ASSO4M,inu)+tau_ae(i,k,id_CSSO4M,inu)+ &
-                               tau_ae(i,k,id_ASBCM,inu)+tau_ae(i,k,id_AIBCM,inu)+   &
-                               tau_ae(i,k,id_ASPOMM,inu)+tau_ae(i,k,id_AIPOMM,inu)+ &
-                               tau_ae(i,k,id_ASSSM,inu)+tau_ae(i,k,id_CSSSM,inu)+   &
-                               tau_ae(i,k,id_SSSSM,inu)+ tau_ae(i,k,id_CIDUSTM,inu)
+         tau_allaer(i,k,2,inu)=tau_ae(i,k,id_ASSO4M_phy,inu)+tau_ae(i,k,id_CSSO4M_phy,inu)+ &
+                               tau_ae(i,k,id_ASBCM_phy,inu)+tau_ae(i,k,id_AIBCM_phy,inu)+   &
+                               tau_ae(i,k,id_ASPOMM_phy,inu)+tau_ae(i,k,id_AIPOMM_phy,inu)+ &
+                               tau_ae(i,k,id_ASSSM_phy,inu)+tau_ae(i,k,id_CSSSM_phy,inu)+   &
+                               tau_ae(i,k,id_SSSSM_phy,inu)+ tau_ae(i,k,id_CIDUSTM_phy,inu)
          tau_allaer(i,k,2,inu)=MAX(tau_allaer(i,k,2,inu),1e-5)
 
-         piz_allaer(i,k,2,inu)=(tau_ae(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)+ &
-                                tau_ae(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)+ &
-                                tau_ae(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)+ &
-                                tau_ae(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)+ &
-                                tau_ae(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)+ &
-                                tau_ae(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)+ &
-                                tau_ae(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)+ &
-                                tau_ae(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)+ &
-                                tau_ae(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)+ &
-                                tau_ae(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)) &
+         piz_allaer(i,k,2,inu)=(tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)+ &
+                                tau_ae(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)+ &
+                                tau_ae(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)+ &
+                                tau_ae(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)+ &
+                                tau_ae(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)+ &
+                                tau_ae(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)+ &
+                                tau_ae(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)+ &
+                                tau_ae(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)+ &
+                                tau_ae(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)+ &
+                                tau_ae(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)) &
                                 /tau_allaer(i,k,2,inu)
          piz_allaer(i,k,2,inu)=MAX(piz_allaer(i,k,2,inu),0.1)
 
-         cg_allaer(i,k,2,inu)=(tau_ae(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)*cg_ae(i,k,id_ASSO4M,inu)+ &
-                               tau_ae(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)*cg_ae(i,k,id_CSSO4M,inu)+ &
-                               tau_ae(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)*cg_ae(i,k,id_ASBCM,inu)+ &
-                               tau_ae(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)*cg_ae(i,k,id_AIBCM,inu)+ &
-                               tau_ae(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)*cg_ae(i,k,id_ASPOMM,inu)+ &
-                               tau_ae(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)*cg_ae(i,k,id_AIPOMM,inu)+ &
-                               tau_ae(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)*cg_ae(i,k,id_ASSSM,inu)+ &
-                               tau_ae(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)*cg_ae(i,k,id_CSSSM,inu)+ &
-                               tau_ae(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)*cg_ae(i,k,id_SSSSM,inu)+ &
-                               tau_ae(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)*cg_ae(i,k,id_CIDUSTM,inu))/ &
+         cg_allaer(i,k,2,inu)=(tau_ae(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)*cg_ae(i,k,id_ASSO4M_phy,inu)+ &
+                               tau_ae(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)*cg_ae(i,k,id_CSSO4M_phy,inu)+ &
+                               tau_ae(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)*cg_ae(i,k,id_ASBCM_phy,inu)+ &
+                               tau_ae(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)*cg_ae(i,k,id_AIBCM_phy,inu)+ &
+                               tau_ae(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)*cg_ae(i,k,id_ASPOMM_phy,inu)+ &
+                               tau_ae(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)*cg_ae(i,k,id_AIPOMM_phy,inu)+ &
+                               tau_ae(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)*cg_ae(i,k,id_ASSSM_phy,inu)+ &
+                               tau_ae(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)*cg_ae(i,k,id_CSSSM_phy,inu)+ &
+                               tau_ae(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)*cg_ae(i,k,id_SSSSM_phy,inu)+ &
+                               tau_ae(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)*cg_ae(i,k,id_CIDUSTM_phy,inu))/ &
                                (tau_allaer(i,k,2,inu)*piz_allaer(i,k,2,inu))
 
 !--natural aerosol
-         tau_allaer(i,k,1,inu)=tau_ae_pi(i,k,id_ASSO4M,inu)+tau_ae_pi(i,k,id_CSSO4M,inu)+ &
-                               tau_ae_pi(i,k,id_ASBCM,inu)+tau_ae_pi(i,k,id_AIBCM,inu)+   &
-                               tau_ae_pi(i,k,id_ASPOMM,inu)+tau_ae_pi(i,k,id_AIPOMM,inu)+ &
-                               tau_ae_pi(i,k,id_ASSSM,inu)+tau_ae_pi(i,k,id_CSSSM,inu)+   &
-                               tau_ae_pi(i,k,id_SSSSM,inu)+ tau_ae_pi(i,k,id_CIDUSTM,inu)
+         tau_allaer(i,k,1,inu)=tau_ae_pi(i,k,id_ASSO4M_phy,inu)+tau_ae_pi(i,k,id_CSSO4M_phy,inu)+ &
+                               tau_ae_pi(i,k,id_ASBCM_phy,inu)+tau_ae_pi(i,k,id_AIBCM_phy,inu)+   &
+                               tau_ae_pi(i,k,id_ASPOMM_phy,inu)+tau_ae_pi(i,k,id_AIPOMM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_ASSSM_phy,inu)+tau_ae_pi(i,k,id_CSSSM_phy,inu)+   &
+                               tau_ae_pi(i,k,id_SSSSM_phy,inu)+ tau_ae_pi(i,k,id_CIDUSTM_phy,inu)
          tau_allaer(i,k,1,inu)=MAX(tau_allaer(i,k,1,inu),1e-5)
 
-         piz_allaer(i,k,1,inu)=(tau_ae_pi(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)+ &
-                                tau_ae_pi(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)+ &
-                                tau_ae_pi(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)+ &
-                                tau_ae_pi(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)+ &
-                                tau_ae_pi(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)+ &
-                                tau_ae_pi(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)+ &
-                                tau_ae_pi(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)+ &
-                                tau_ae_pi(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)+ &
-                                tau_ae_pi(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)+ &
-                                tau_ae_pi(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)) &
+         piz_allaer(i,k,1,inu)=(tau_ae_pi(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)+ &
+                                tau_ae_pi(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)+ &
+                                tau_ae_pi(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)+ &
+                                tau_ae_pi(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)+ &
+                                tau_ae_pi(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)+ &
+                                tau_ae_pi(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)+ &
+                                tau_ae_pi(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)+ &
+                                tau_ae_pi(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)+ &
+                                tau_ae_pi(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)+ &
+                                tau_ae_pi(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)) &
                                 /tau_allaer(i,k,1,inu)
          piz_allaer(i,k,1,inu)=MAX(piz_allaer(i,k,1,inu),0.1)
 
-         cg_allaer(i,k,1,inu)=(tau_ae_pi(i,k,id_ASSO4M,inu)*piz_ae(i,k,id_ASSO4M,inu)*cg_ae(i,k,id_ASSO4M,inu)+ &
-                               tau_ae_pi(i,k,id_CSSO4M,inu)*piz_ae(i,k,id_CSSO4M,inu)*cg_ae(i,k,id_CSSO4M,inu)+ &
-                               tau_ae_pi(i,k,id_ASBCM,inu)*piz_ae(i,k,id_ASBCM,inu)*cg_ae(i,k,id_ASBCM,inu)+ &
-                               tau_ae_pi(i,k,id_AIBCM,inu)*piz_ae(i,k,id_AIBCM,inu)*cg_ae(i,k,id_AIBCM,inu)+ &
-                               tau_ae_pi(i,k,id_ASPOMM,inu)*piz_ae(i,k,id_ASPOMM,inu)*cg_ae(i,k,id_ASPOMM,inu)+ &
-                               tau_ae_pi(i,k,id_AIPOMM,inu)*piz_ae(i,k,id_AIPOMM,inu)*cg_ae(i,k,id_AIPOMM,inu)+ &
-                               tau_ae_pi(i,k,id_ASSSM,inu)*piz_ae(i,k,id_ASSSM,inu)*cg_ae(i,k,id_ASSSM,inu)+ &
-                               tau_ae_pi(i,k,id_CSSSM,inu)*piz_ae(i,k,id_CSSSM,inu)*cg_ae(i,k,id_CSSSM,inu)+ &
-                               tau_ae_pi(i,k,id_SSSSM,inu)*piz_ae(i,k,id_SSSSM,inu)*cg_ae(i,k,id_SSSSM,inu)+ &
-                               tau_ae_pi(i,k,id_CIDUSTM,inu)*piz_ae(i,k,id_CIDUSTM,inu)*cg_ae(i,k,id_CIDUSTM,inu))/ &
+         cg_allaer(i,k,1,inu)=(tau_ae_pi(i,k,id_ASSO4M_phy,inu)*piz_ae(i,k,id_ASSO4M_phy,inu)*cg_ae(i,k,id_ASSO4M_phy,inu)+ &
+                               tau_ae_pi(i,k,id_CSSO4M_phy,inu)*piz_ae(i,k,id_CSSO4M_phy,inu)*cg_ae(i,k,id_CSSO4M_phy,inu)+ &
+                               tau_ae_pi(i,k,id_ASBCM_phy,inu)*piz_ae(i,k,id_ASBCM_phy,inu)*cg_ae(i,k,id_ASBCM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_AIBCM_phy,inu)*piz_ae(i,k,id_AIBCM_phy,inu)*cg_ae(i,k,id_AIBCM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_ASPOMM_phy,inu)*piz_ae(i,k,id_ASPOMM_phy,inu)*cg_ae(i,k,id_ASPOMM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_AIPOMM_phy,inu)*piz_ae(i,k,id_AIPOMM_phy,inu)*cg_ae(i,k,id_AIPOMM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_ASSSM_phy,inu)*piz_ae(i,k,id_ASSSM_phy,inu)*cg_ae(i,k,id_ASSSM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_CSSSM_phy,inu)*piz_ae(i,k,id_CSSSM_phy,inu)*cg_ae(i,k,id_CSSSM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_SSSSM_phy,inu)*piz_ae(i,k,id_SSSSM_phy,inu)*cg_ae(i,k,id_SSSSM_phy,inu)+ &
+                               tau_ae_pi(i,k,id_CIDUSTM_phy,inu)*piz_ae(i,k,id_CIDUSTM_phy,inu)*cg_ae(i,k,id_CIDUSTM_phy,inu))/ &
                                (tau_allaer(i,k,1,inu)*piz_allaer(i,k,1,inu))
 
Index: /LMDZ5/trunk/libf/phylmd/rrtm/radlsw.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/radlsw.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/radlsw.F90	(revision 2146)
@@ -11,6 +11,7 @@
  & PFRSOD,PSUDU , PUVDF, PPARF, PPARCF, PTINCF,&
  & PSFSWDIR, PSFSWDIF,PFSDNN,PFSDNV ,&  
- & LRDUST,PPIZA_DST,PCGA_DST,PTAUREL_DST,PFLUX,PFLUC,&
- & PFSDN ,PFSUP , PFSCDN , PFSCUP)
+ & LRDUST,PPIZA_DST,PCGA_DST,PTAUREL_DST,&
+ & PTAU_LW,&
+ & PFLUX,PFLUC,PFSDN ,PFSUP , PFSCDN , PFSCUP)
 
 use write_field_phy
@@ -57,4 +58,5 @@
 ! PCGA_DST   : (KPROMA,KLEV,NSW); Assymetry factor for dust 
 ! PTAUREL_DST: (KPROMA,KLEV,NSW); Optical depth of dust relative to at 550nm
+! PTAU_LW  (KPROMA,KLEV,NLW); LW Optical depth of aerosols 
 ! PREF_LIQ (KPROMA,KLEV)        ; Liquid droplet radius (um)
 ! PREF_ICE (KPROMA,KLEV)        ; Ice crystal radius (um)
@@ -127,5 +129,5 @@
 !USE YOERAD   , ONLY : NSW      ,LRRTM    ,LCCNL    ,LCCNO, LDIFFC, &
 ! NSW mis dans .def MPL 20140211
-USE YOERAD   , ONLY : LRRTM    ,LCCNL    ,LCCNO, LDIFFC, &
+USE YOERAD   , ONLY : NLW, LRRTM    ,LCCNL    ,LCCNO, LDIFFC, &
  & NRADIP , NRADLP , NICEOPT, NLIQOPT, NINHOM ,NLAYINH ,&
  & RCCNLND, RCCNSEA, RLWINHF, RSWINHF, RRe2De ,&  
@@ -154,4 +156,5 @@
 
 include "clesphys.h"
+!!include "clesrrtm.h"
 include "YOETHF.h"
 INTEGER(KIND=JPIM),INTENT(IN)    :: KLON 
@@ -192,4 +195,7 @@
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PCGA_DST(KLON,KLEV,NSW)
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAUREL_DST(KLON,KLEV,NSW)
+!--C.Kleinschmitt
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW(KLON,KLEV,NLW)
+!--end
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PREF_LIQ(KLON,KLEV)
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PREF_ICE(KLON,KLEV)
@@ -1101,7 +1107,8 @@
      & PTS   , PTH   , PT,&
      & ZEMIS , ZEMIW,&
-     & PQ    , PCCO2 , ZOZN  , ZCLDSW  , ZTAUCLD,&
-     & ZEMIT , PFLUX , PFLUC , ZTCLEAR &
-     & )  
+     & PQ    , PCCO2 , ZOZN  ,&
+     & ZCLDSW  , ZTAUCLD,&
+     & PTAU_LW,&
+     & ZEMIT , PFLUX , PFLUC , ZTCLEAR )
     print *,'RADLSW: apres CALL RRTM_RRTM_140GP'
 
Index: /LMDZ5/trunk/libf/phylmd/rrtm/radlsw.intfb.h
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/radlsw.intfb.h	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/radlsw.intfb.h	(revision 2146)
@@ -1,19 +1,21 @@
 INTERFACE
-SUBROUTINE RADLSW&
- & ( KIDIA, KFDIA , KLON , KLEV , KMODE, KAER,&
+SUBROUTINE RADLSW &
+ & ( KIDIA, KFDIA , KLON , KLEV  , KMODE, KAER,&
  & PRII0,&
  & PAER , PALBD , PALBP, PAPH , PAP,&
  & PCCNL, PCCNO,&
- & PCCO2, PCLFR , PDP , PEMIS, PEMIW , PLSM , PMU0, POZON,&
- & PQ , PQIWP , PQLWP, PQS , PQRAIN, PRAINT,&
- & PTH , PT , PTS , PNBAS, PNTOP,&
- & PREF_LIQ , PREF_ICE,&
- & PEMIT, PFCT , PFLT , PFCS , PFLS,&
+ & PCCO2, PCLFR , PDP  , PEMIS, PEMIW , PLSM , PMU0, POZON,&
+ & PQ   , PQIWP , PQLWP, PQS  , PQRAIN, PRAINT,&
+ & PTH  , PT    , PTS  , PNBAS, PNTOP,&
+ & PREF_LIQ, PREF_ICE,&
+ & PEMIT, PFCT  , PFLT , PFCS , PFLS,&
  & PFRSOD,PSUDU , PUVDF, PPARF, PPARCF, PTINCF,&
- & PSFSWDIR, PSFSWDIF,PFSDNN,PFSDNV,&
- & LRDUST,PPIZA_DST,PCGA_DST,PTAUREL_DST,PFLUX,PFLUC,&
- & PFSDN ,PFSUP , PFSCDN , PFSCUP)
+ & PSFSWDIR, PSFSWDIF,PFSDNN,PFSDNV ,&  
+ & LRDUST,PPIZA_DST,PCGA_DST,PTAUREL_DST,&
+ & PTAU_LW,&
+ & PFLUX,PFLUC,PFSDN ,PFSUP , PFSCDN , PFSCUP)
+
 USE PARKIND1 ,ONLY : JPIM ,JPRB
-USE YOERAD , ONLY : LRRTM ,LCCNL ,LCCNO, LDIFFC,&
+USE YOERAD , ONLY : NLW, LRRTM ,LCCNL ,LCCNO, LDIFFC,&
  & NRADIP , NRADLP , NICEOPT, NLIQOPT, NINHOM ,NLAYINH ,&
  & RCCNLND, RCCNSEA, RLWINHF, RSWINHF, RRe2De ,&
@@ -59,4 +61,7 @@
 REAL(KIND=JPRB) ,INTENT(IN) :: PCGA_DST(KLON,KLEV,NSW)
 REAL(KIND=JPRB) ,INTENT(IN) :: PTAUREL_DST(KLON,KLEV,NSW)
+!--C.Kleinschmitt
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW(KLON,KLEV,NLW)
+!--end
 REAL(KIND=JPRB) ,INTENT(OUT) :: PEMIT(KLON)
 REAL(KIND=JPRB) ,INTENT(OUT) :: PFCT(KLON,KLEV+1)
Index: /LMDZ5/trunk/libf/phylmd/rrtm/readaerosol_optic_rrtm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/readaerosol_optic_rrtm.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/readaerosol_optic_rrtm.F90	(revision 2146)
@@ -1,26 +1,33 @@
 ! $Id$
 !
-SUBROUTINE readaerosol_optic_rrtm(debut, new_aod, flag_aerosol, itap, rjourvrai, &
+SUBROUTINE readaerosol_optic_rrtm(debut, aerosol_couple,  &
+     new_aod, flag_aerosol, itap, rjourvrai, &
      pdtphys, pplay, paprs, t_seri, rhcl, presnivs, &
-     mass_solu_aero, mass_solu_aero_pi, &
+     tr_seri, mass_solu_aero, mass_solu_aero_pi, &
      tau_aero, piz_aero, cg_aero, &
      tausum_aero, tau3d_aero )
 
-! This routine will :
-! 1) recevie the aerosols(already read and interpolated) corresponding to flag_aerosol
-! 2) calculate the optical properties for the aerosols
-!
-  
+  ! This routine will :
+  ! 1) recevie the aerosols(already read and interpolated) corresponding to flag_aerosol
+  ! 2) calculate the optical properties for the aerosols
+  !
+
   USE dimphy
   USE aero_mod
-  USE phys_local_var_mod, only: sconcso4,sconcoa,sconcbc,sconcss,sconcdust, &
-      concso4,concoa,concbc,concss,concdust,loadso4,loadoa,loadbc,loadss,loaddust, &
-      load_tmp1,load_tmp2,load_tmp3,load_tmp4,load_tmp5,load_tmp6,load_tmp7
+  USE phys_local_var_mod, only: sconcso4,sconcno3,sconcoa,sconcbc,sconcss,sconcdust, &
+       concso4,concno3,concoa,concbc,concss,concdust,loadso4,loadoa,loadbc,loadss,loaddust, &
+       load_tmp1,load_tmp2,load_tmp3,load_tmp4,load_tmp5,load_tmp6,load_tmp7
+
+  USE infotrac
+
   IMPLICIT NONE
   include "clesphys.h"
-
-! Input arguments
-!****************************************************************************************
+  include "YOMCST.h"
+
+
+  ! Input arguments
+  !****************************************************************************************
   LOGICAL, INTENT(IN)                      :: debut
+  LOGICAL, INTENT(IN)                      :: aerosol_couple
   LOGICAL, INTENT(IN)                      :: new_aod
   INTEGER, INTENT(IN)                      :: flag_aerosol
@@ -33,7 +40,8 @@
   REAL, DIMENSION(klon,klev), INTENT(IN)   :: rhcl   ! humidite relative ciel clair
   REAL, DIMENSION(klev), INTENT(IN)        :: presnivs
-
-! Output arguments
-!****************************************************************************************
+  REAL, DIMENSION(klon,klev,nbtr), INTENT(IN) :: tr_seri ! concentration tracer
+
+  ! Output arguments
+  !****************************************************************************************
   REAL, DIMENSION(klon,klev), INTENT(OUT)     :: mass_solu_aero    ! Total mass for all soluble aerosols
   REAL, DIMENSION(klon,klev), INTENT(OUT)     :: mass_solu_aero_pi !     -"-     preindustrial values
@@ -41,23 +49,25 @@
   REAL, DIMENSION(klon,klev,2,NSW), INTENT(OUT) :: piz_aero    ! Single scattering albedo aerosol
   REAL, DIMENSION(klon,klev,2,NSW), INTENT(OUT) :: cg_aero     ! asymmetry parameter aerosol
-!  REAL, DIMENSION(klon,nwave,naero_spc), INTENT(OUT)       :: tausum_aero
-!  REAL, DIMENSION(klon,klev,nwave,naero_spc), INTENT(OUT)  :: tau3d_aero
-!--correction minibug OB
   REAL, DIMENSION(klon,nwave,naero_tot), INTENT(OUT)       :: tausum_aero
   REAL, DIMENSION(klon,klev,nwave,naero_tot), INTENT(OUT)  :: tau3d_aero
 
-! Local variables
-!****************************************************************************************
-  REAL, DIMENSION(klon)        :: aerindex ! POLDER aerosol index 
-  REAL, DIMENSION(klon,klev)   :: sulfate  ! SO4 aerosol concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: bcsol    ! BC soluble concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: bcins    ! BC insoluble concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: pomsol   ! POM soluble concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: pomins   ! POM insoluble concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: cidust    ! DUST aerosol concentration  [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: sscoarse  ! SS Coarse concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: sssupco   ! SS Super Coarse concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: ssacu     ! SS Acumulation concentration [ug/m3]
-  REAL, DIMENSION(klon,klev)   :: sulfate_pi
+  ! Local variables
+  !****************************************************************************************
+  REAL, DIMENSION(klon)        :: aerindex      ! POLDER aerosol index 
+  REAL, DIMENSION(klon,klev)   :: sulfacc       ! SO4 accumulation concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: sulfcoarse    ! SO4 coarse concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: bcsol         ! BC soluble concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: bcins         ! BC insoluble concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: pomsol        ! POM soluble concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: pomins        ! POM insoluble concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: cidust        ! DUST aerosol concentration  [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: sscoarse      ! SS Coarse concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: sssupco       ! SS Super Coarse concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: ssacu         ! SS Acumulation concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: nitracc       ! nitrate accumulation concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: nitrcoarse    ! nitrate coarse concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: nitrinscoarse ! nitrate insoluble coarse concentration [ug/m3]
+  REAL, DIMENSION(klon,klev)   :: sulfacc_pi
+  REAL, DIMENSION(klon,klev)   :: sulfcoarse_pi
   REAL, DIMENSION(klon,klev)   :: bcsol_pi
   REAL, DIMENSION(klon,klev)   :: bcins_pi
@@ -68,118 +78,225 @@
   REAL, DIMENSION(klon,klev)   :: sssupco_pi
   REAL, DIMENSION(klon,klev)   :: ssacu_pi
-  REAL, DIMENSION(klon,klev)   :: pdel
-  REAL, DIMENSION(klon,klev,naero_spc) :: m_allaer
-  REAL, DIMENSION(klon,klev,naero_spc) :: m_allaer_pi !RAF  
-!  REAL, DIMENSION(klon,naero_tot)      :: fractnat_allaer !RAF delete??
-
+  REAL, DIMENSION(klon,klev)   :: nitracc_pi
+  REAL, DIMENSION(klon,klev)   :: nitrcoarse_pi
+  REAL, DIMENSION(klon,klev)   :: nitrinscoarse_pi
+  REAL, DIMENSION(klon,klev)   :: pdel, zrho
+  REAL, DIMENSION(klon,klev,naero_tot) :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_tot) :: m_allaer_pi !RAF  
+  !  REAL, DIMENSION(klon,naero_tot)      :: fractnat_allaer !RAF delete??
+  character(len=8), dimension(nbtr) :: tracname
+  integer :: id_ASBCM, id_ASPOMM, id_ASSO4M, id_ASMSAM, id_CSSO4M, id_CSMSAM, id_SSSSM
+  integer :: id_CSSSM, id_ASSSM, id_CIDUSTM, id_AIBCM, id_AIPOMM, id_ASNO3M, id_CSNO3M, id_CINO3M
   INTEGER :: k, i
-  
-!****************************************************************************************
-! 1) Get aerosol mass
-!    
-!****************************************************************************************
-! Read and interpolate sulfate
-  IF ( flag_aerosol .EQ. 1 .OR. &
-       flag_aerosol .EQ. 6 ) THEN 
-
-     CALL readaerosol_interp(id_ASSO4M, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sulfate, sulfate_pi,loadso4)
-  ELSE
-     sulfate(:,:) = 0. ; sulfate_pi(:,:) = 0.
-     loadso4=0.
-  END IF
-
-! Read and interpolate bcsol and bcins
-  IF ( flag_aerosol .EQ. 2 .OR. &
-       flag_aerosol .EQ. 6 ) THEN 
-
-     ! Get bc aerosol distribution 
-     CALL readaerosol_interp(id_ASBCM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcsol, bcsol_pi, load_tmp1 )
-     CALL readaerosol_interp(id_AIBCM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcins, bcins_pi, load_tmp2 )
-     loadbc(:)=load_tmp1(:)+load_tmp2(:)
-  ELSE
-     bcsol(:,:) = 0. ; bcsol_pi(:,:) = 0.
-     bcins(:,:) = 0. ; bcins_pi(:,:) = 0.
-     loadbc=0.
-  END IF
-
-
-! Read and interpolate pomsol and pomins
-  IF ( flag_aerosol .EQ. 3 .OR. &
-       flag_aerosol .EQ. 6 ) THEN
-
-     CALL readaerosol_interp(id_ASPOMM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomsol, pomsol_pi, load_tmp3)
-     CALL readaerosol_interp(id_AIPOMM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomins, pomins_pi, load_tmp4)
-     loadoa(:)=load_tmp3(:)+load_tmp4(:)
-  ELSE
-     pomsol(:,:) = 0. ; pomsol_pi(:,:) = 0.
-     pomins(:,:) = 0. ; pomins_pi(:,:) = 0.
-     loadoa=0.
-  END IF
-
-
-! Read and interpolate csssm, ssssm, assssm
-  IF (flag_aerosol .EQ. 4 .OR. &
-      flag_aerosol .EQ. 6 ) THEN 
-
-      CALL readaerosol_interp(id_SSSSM ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sssupco, sssupco_pi, load_tmp5) 
-      CALL readaerosol_interp(id_CSSSM ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sscoarse,sscoarse_pi, load_tmp6) 
-      CALL readaerosol_interp(id_ASSSM ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, ssacu, ssacu_pi, load_tmp7) 
-     loadss(:)=load_tmp5(:)+load_tmp6(:)+load_tmp7(:)
-  ELSE
-     sscoarse(:,:) = 0. ; sscoarse_pi(:,:) = 0. 
-     ssacu(:,:)    = 0. ; ssacu_pi(:,:) = 0. 
-     sssupco(:,:)  = 0. ; sssupco_pi = 0. 
-     loadss=0.
-  ENDIF
-
-! Read and interpolate cidustm
-  IF (flag_aerosol .EQ. 5 .OR.  &
-      flag_aerosol .EQ. 6 ) THEN 
-
-      CALL readaerosol_interp(id_CIDUSTM, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, cidust, cidust_pi, loaddust) 
-
-  ELSE
-      cidust(:,:) = 0. ; cidust_pi(:,:) = 0. 
-      loaddust=0.
-  ENDIF
-
-!
-! Store all aerosols in one variable
-!
-  m_allaer(:,:,id_ASBCM)  = bcsol(:,:)        ! ASBCM
-  m_allaer(:,:,id_ASPOMM) = pomsol(:,:)       ! ASPOMM
-  m_allaer(:,:,id_ASSO4M) = sulfate(:,:)      ! ASSO4M (= SO4) 
-  m_allaer(:,:,id_CSSO4M) = 0.                ! CSSO4M 
-  m_allaer(:,:,id_SSSSM)  = sssupco(:,:)      ! SSSSM
-  m_allaer(:,:,id_CSSSM)  = sscoarse(:,:)     ! CSSSM
-  m_allaer(:,:,id_ASSSM)  = ssacu(:,:)        ! ASSSM
-  m_allaer(:,:,id_CIDUSTM)= cidust(:,:)       ! CIDUSTM
-  m_allaer(:,:,id_AIBCM)  = bcins(:,:)        ! AIBCM
-  m_allaer(:,:,id_AIPOMM) = pomins(:,:)       ! AIPOMM
-
-!RAF
-  m_allaer_pi(:,:,1)  = bcsol_pi(:,:)        ! ASBCM pre-ind
-  m_allaer_pi(:,:,2)  = pomsol_pi(:,:)       ! ASPOMM pre-ind
-  m_allaer_pi(:,:,3)  = sulfate_pi(:,:)      ! ASSO4M (= SO4) pre-ind
-  m_allaer_pi(:,:,4)  = 0.                   ! CSSO4M pre-ind
-  m_allaer_pi(:,:,5)  = sssupco_pi(:,:)      ! SSSSM pre-ind
-  m_allaer_pi(:,:,6)  = sscoarse_pi(:,:)     ! CSSSM pre-ind
-  m_allaer_pi(:,:,7)  = ssacu_pi(:,:)        ! ASSSM pre-ind
-  m_allaer_pi(:,:,8)  = cidust_pi(:,:)       ! CIDUSTM pre-ind
-  m_allaer_pi(:,:,9)  = bcins_pi(:,:)        ! AIBCM pre-ind
-  m_allaer_pi(:,:,10) = pomins_pi(:,:)       ! AIPOMM pre-ind
-
-!
-! Calculate the total mass of all soluble aersosols
-!
-  mass_solu_aero(:,:)    = sulfate(:,:)    + bcsol(:,:)    + pomsol(:,:) !   + &
-!       sscoarse(:,:)    + ssacu(:,:)    + sssupco(:,:) 
-  mass_solu_aero_pi(:,:) = sulfate_pi(:,:) + bcsol_pi(:,:) + pomsol_pi(:,:) ! + &
-!       sscoarse_pi(:,:) + ssacu_pi(:,:) + sssupco_pi(:,:)
-
-!****************************************************************************************
-! 2) Calculate optical properties for the aerosols
-!
-!****************************************************************************************
+
+  !--air density
+  zrho(:,:)=pplay(:,:)/t_seri(:,:)/RD                     !--kg/m3
+
+  !****************************************************************************************
+  ! 1) Get aerosol mass
+  !    
+  !****************************************************************************************
+  !
+  !
+  IF (aerosol_couple) THEN   !--we get aerosols from tr_seri array from INCA
+     !
+     !--copy fields from INCA tr_seri 
+     !--convert to ug m-3 unit for consistency with offline fields
+     !
+#ifdef INCA
+     call tracinca_name(tracname)
+#endif
+
+     do i=1,nbtr
+        select case(trim(tracname(i)))
+           case ("ASBCM")
+              id_ASBCM = i
+           case ("ASPOMM") 
+              id_ASPOMM = i 
+           case ("ASSO4M")
+              id_ASSO4M = i 
+           case ("ASMSAM")
+              id_ASMSAM = i 
+           case ("CSSO4M")
+              id_CSSO4M = i 
+           case ("CSMSAM")
+              id_CSMSAM = i 
+           case ("SSSSM")
+              id_SSSSM = i 
+           case ("CSSSM")
+              id_CSSSM = i 
+           case ("ASSSM")
+              id_ASSSM = i 
+           case ("CIDUSTM")
+              id_CIDUSTM = i 
+           case ("AIBCM")
+              id_AIBCM = i 
+           case ("AIPOMM")
+              id_AIPOMM = i 
+           case ("ASNO3M")
+              id_ASNO3M = i 
+           case ("CSNO3M")
+              id_CSNO3M = i 
+           case ("CINO3M")
+              id_CINO3M = i 
+           end select
+     enddo
+
+
+     bcsol(:,:)        =   tr_seri(:,:,id_ASBCM)                         *zrho(:,:)*1.e9  ! ASBCM
+     pomsol(:,:)       =   tr_seri(:,:,id_ASPOMM)                        *zrho(:,:)*1.e9  ! ASPOMM
+     sulfacc(:,:)      =  (tr_seri(:,:,id_ASSO4M)+tr_seri(:,:,id_ASMSAM))*zrho(:,:)*1.e9  ! ASSO4M (=SO4) + ASMSAM (=MSA)
+     sulfcoarse(:,:)   =  (tr_seri(:,:,id_CSSO4M)+tr_seri(:,:,id_CSMSAM))*zrho(:,:)*1.e9  ! CSSO4M (=SO4) + CSMSAM (=MSA)
+     sssupco(:,:)      =   tr_seri(:,:,id_SSSSM)                         *zrho(:,:)*1.e9  ! SSSSM
+     sscoarse(:,:)     =   tr_seri(:,:,id_CSSSM)                         *zrho(:,:)*1.e9  ! CSSSM
+     ssacu(:,:)        =   tr_seri(:,:,id_ASSSM)                         *zrho(:,:)*1.e9  ! ASSSM
+     cidust(:,:)       =   tr_seri(:,:,id_CIDUSTM)                       *zrho(:,:)*1.e9  ! CIDUSTM
+     bcins(:,:)        =   tr_seri(:,:,id_AIBCM)                         *zrho(:,:)*1.e9  ! AIBCM
+     pomins(:,:)       =   tr_seri(:,:,id_AIPOMM)                        *zrho(:,:)*1.e9  ! AIPOMM
+     nitracc(:,:)      =   tr_seri(:,:,id_ASNO3M)                        *zrho(:,:)*1.e9  ! ASNO3M
+     nitrcoarse(:,:)   =   tr_seri(:,:,id_CSNO3M)                        *zrho(:,:)*1.e9  ! CSNO3M
+     nitrinscoarse(:,:)=   tr_seri(:,:,id_CINO3M)                        *zrho(:,:)*1.e9  ! CINO3M
+     !
+     bcsol_pi(:,:)        =   0.0 ! ASBCM pre-ind
+     pomsol_pi(:,:)       =   0.0 ! ASPOMM pre-ind
+     sulfacc_pi(:,:)      =   0.0 ! ASSO4M (=SO4) + ASMSAM (=MSA) pre-ind
+     sulfcoarse_pi(:,:)   =   0.0 ! CSSO4M (=SO4) + CSMSAM (=MSA) pre-ind
+     sssupco_pi(:,:)      =   0.0 ! SSSSM pre-ind
+     sscoarse_pi(:,:)     =   0.0 ! CSSSM pre-ind
+     ssacu_pi(:,:)        =   0.0 ! ASSSM pre-ind
+     cidust_pi(:,:)       =   0.0 ! CIDUSTM pre-ind
+     bcins_pi(:,:)        =   0.0 ! AIBCM pre-ind
+     pomins_pi(:,:)       =   0.0 ! AIPOMM pre-ind
+     nitracc_pi(:,:)      =   0.0 ! ASNO3M pre-ind
+     nitrcoarse_pi(:,:)   =   0.0 ! CSNO3M pre-ind
+     nitrinscoarse_pi(:,:)=   0.0 ! CINO3M
+     !
+  ELSE !--not aerosol_couple
+     !
+     ! Read and interpolate sulfate
+     IF ( flag_aerosol .EQ. 1 .OR. &
+          flag_aerosol .EQ. 6 ) THEN 
+
+        CALL readaerosol_interp(id_ASSO4M_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sulfacc, sulfacc_pi,loadso4)
+     ELSE
+        sulfacc(:,:) = 0. ; sulfacc_pi(:,:) = 0.
+        loadso4=0.
+     END IF
+
+     ! Read and interpolate bcsol and bcins
+     IF ( flag_aerosol .EQ. 2 .OR. &
+          flag_aerosol .EQ. 6 ) THEN 
+
+        ! Get bc aerosol distribution 
+        CALL readaerosol_interp(id_ASBCM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcsol, bcsol_pi, load_tmp1 )
+        CALL readaerosol_interp(id_AIBCM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, bcins, bcins_pi, load_tmp2 )
+        loadbc(:)=load_tmp1(:)+load_tmp2(:)
+     ELSE
+        bcsol(:,:) = 0. ; bcsol_pi(:,:) = 0.
+        bcins(:,:) = 0. ; bcins_pi(:,:) = 0.
+        loadbc=0.
+     END IF
+
+
+     ! Read and interpolate pomsol and pomins
+     IF ( flag_aerosol .EQ. 3 .OR. &
+          flag_aerosol .EQ. 6 ) THEN
+
+        CALL readaerosol_interp(id_ASPOMM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomsol, pomsol_pi, load_tmp3)
+        CALL readaerosol_interp(id_AIPOMM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomins, pomins_pi, load_tmp4)
+        loadoa(:)=load_tmp3(:)+load_tmp4(:)
+     ELSE
+        pomsol(:,:) = 0. ; pomsol_pi(:,:) = 0.
+        pomins(:,:) = 0. ; pomins_pi(:,:) = 0.
+        loadoa=0.
+     END IF
+
+
+     ! Read and interpolate csssm, ssssm, assssm
+     IF (flag_aerosol .EQ. 4 .OR. &
+          flag_aerosol .EQ. 6 ) THEN 
+
+        CALL readaerosol_interp(id_SSSSM_phy ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sssupco, sssupco_pi, load_tmp5) 
+        CALL readaerosol_interp(id_CSSSM_phy ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sscoarse,sscoarse_pi, load_tmp6) 
+        CALL readaerosol_interp(id_ASSSM_phy ,itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, ssacu, ssacu_pi, load_tmp7) 
+        loadss(:)=load_tmp5(:)+load_tmp6(:)+load_tmp7(:)
+     ELSE
+        sscoarse(:,:) = 0. ; sscoarse_pi(:,:) = 0. 
+        ssacu(:,:)    = 0. ; ssacu_pi(:,:) = 0. 
+        sssupco(:,:)  = 0. ; sssupco_pi = 0. 
+        loadss=0.
+     ENDIF
+
+     ! Read and interpolate cidustm
+     IF (flag_aerosol .EQ. 5 .OR.  &
+          flag_aerosol .EQ. 6 ) THEN 
+
+        CALL readaerosol_interp(id_CIDUSTM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, cidust, cidust_pi, loaddust) 
+
+     ELSE
+        cidust(:,:) = 0. ; cidust_pi(:,:) = 0. 
+        loaddust=0.
+     ENDIF
+     !
+     sulfcoarse(:,:)      =   0.0 ! CSSO4M (=SO4) + CSMSAM (=MSA) 
+     sulfcoarse_pi(:,:)   =   0.0 ! CSSO4M (=SO4) + CSMSAM (=MSA) pre-ind
+     !
+     !--placeholder for offline nitrate   
+     !
+     nitracc(:,:)         =   0.0 
+     nitracc_pi(:,:)      =   0.0 
+     nitrcoarse(:,:)      =   0.0
+     nitrcoarse_pi(:,:)   =   0.0
+     nitrinscoarse(:,:)   =   0.0
+     nitrinscoarse_pi(:,:)=   0.0
+
+  ENDIF !--not aerosol_couple
+
+  !
+  ! Store all aerosols in one variable
+  !
+  m_allaer(:,:,id_ASBCM_phy)  = bcsol(:,:)        ! ASBCM
+  m_allaer(:,:,id_ASPOMM_phy) = pomsol(:,:)       ! ASPOMM
+  m_allaer(:,:,id_ASSO4M_phy) = sulfacc(:,:)      ! ASSO4M (= SO4) 
+  m_allaer(:,:,id_CSSO4M_phy) = sulfcoarse(:,:)   ! CSSO4M 
+  m_allaer(:,:,id_SSSSM_phy)  = sssupco(:,:)      ! SSSSM
+  m_allaer(:,:,id_CSSSM_phy)  = sscoarse(:,:)     ! CSSSM
+  m_allaer(:,:,id_ASSSM_phy)  = ssacu(:,:)        ! ASSSM
+  m_allaer(:,:,id_CIDUSTM_phy)= cidust(:,:)       ! CIDUSTM
+  m_allaer(:,:,id_AIBCM_phy)  = bcins(:,:)        ! AIBCM
+  m_allaer(:,:,id_ASNO3M_phy) = nitracc(:,:)      ! ASNO3M
+  m_allaer(:,:,id_CSNO3M_phy) = nitrcoarse(:,:)   ! CSNO3M
+  m_allaer(:,:,id_CINO3M_phy) = nitrinscoarse(:,:)! CINO3M
+  m_allaer(:,:,id_AIPOMM_phy) = pomins(:,:)       ! AIPOMM
+  m_allaer(:,:,id_STRAT_phy)  = 0.0
+
+  !RAF
+  m_allaer_pi(:,:,id_ASBCM_phy)  = bcsol_pi(:,:)        ! ASBCM pre-ind
+  m_allaer_pi(:,:,id_ASPOMM_phy) = pomsol_pi(:,:)       ! ASPOMM pre-ind
+  m_allaer_pi(:,:,id_ASSO4M_phy) = sulfacc_pi(:,:)      ! ASSO4M (= SO4) pre-ind
+  m_allaer_pi(:,:,id_CSSO4M_phy) = sulfcoarse_pi(:,:)   ! CSSO4M pre-ind
+  m_allaer_pi(:,:,id_SSSSM_phy)  = sssupco_pi(:,:)      ! SSSSM pre-ind
+  m_allaer_pi(:,:,id_CSSSM_phy)  = sscoarse_pi(:,:)     ! CSSSM pre-ind
+  m_allaer_pi(:,:,id_ASSSM_phy)  = ssacu_pi(:,:)        ! ASSSM pre-ind
+  m_allaer_pi(:,:,id_CIDUSTM_phy)= cidust_pi(:,:)       ! CIDUSTM pre-ind
+  m_allaer_pi(:,:,id_AIBCM_phy)  = bcins_pi(:,:)        ! AIBCM pre-ind
+  m_allaer_pi(:,:,id_ASNO3M_phy) = nitracc_pi(:,:)      ! ASNO3M pre-ind
+  m_allaer_pi(:,:,id_CSNO3M_phy) = nitrcoarse_pi(:,:)   ! CSNO3M pre-ind
+  m_allaer_pi(:,:,id_CINO3M_phy) = nitrinscoarse_pi(:,:)! CINO3M pre-ind
+  m_allaer_pi(:,:,id_AIPOMM_phy) = pomins_pi(:,:)       ! AIPOMM pre-ind
+  m_allaer_pi(:,:,id_STRAT_phy)  = 0.0
+
+  !
+  ! Calculate the total mass of all soluble aersosols
+  ! to be revisited for AR6
+  mass_solu_aero(:,:)    = sulfacc(:,:)    + bcsol(:,:)    + pomsol(:,:)   + nitracc(:,:)   ! + & 
+  !                           sscoarse(:,:)    + ssacu(:,:)    + sssupco(:,:) 
+  mass_solu_aero_pi(:,:) = sulfacc_pi(:,:) + bcsol_pi(:,:) + pomsol_pi(:,:) + nitracc_pi(:,:) ! + &
+  !                           sscoarse_pi(:,:) + ssacu_pi(:,:) + sssupco_pi(:,:)
+
+  !****************************************************************************************
+  ! 2) Calculate optical properties for the aerosols
+  !
+  !****************************************************************************************
   DO k = 1, klev
      DO i = 1, klon
@@ -188,28 +305,31 @@
   END DO
 
+  ! aeropt_6bands for rrtm
   CALL aeropt_6bands_rrtm( &
-          pdel, m_allaer, pdtphys, rhcl, & 
-          tau_aero, piz_aero, cg_aero,   &
-          m_allaer_pi, flag_aerosol, &
-          pplay, t_seri, presnivs) 
-     
-     ! aeropt_5wv only for validation and diagnostics.
-     CALL aeropt_5wv_rrtm(                    &
-          pdel, m_allaer,                &
-          pdtphys, rhcl, aerindex,       & 
-          flag_aerosol, pplay, t_seri,   &
-          tausum_aero, tau3d_aero )
-
-! Diagnostics calculation for CMIP5 protocol
-  sconcso4(:)=m_allaer(:,1,id_ASSO4M)*1.e-9
-  sconcoa(:)=(m_allaer(:,1,id_ASPOMM)+m_allaer(:,1,id_AIPOMM))*1.e-9
-  sconcbc(:)=(m_allaer(:,1,id_ASBCM)+m_allaer(:,1,id_AIBCM))*1.e-9
-  sconcss(:)=(m_allaer(:,1,id_ASSSM)+m_allaer(:,1,id_CSSSM)+m_allaer(:,1,id_SSSSM))*1.e-9
-  sconcdust(:)=m_allaer(:,1,id_CIDUSTM)*1.e-9
-  concso4(:,:)=m_allaer(:,:,id_ASSO4M)*1.e-9
-  concoa(:,:)=(m_allaer(:,:,id_ASPOMM)+m_allaer(:,:,id_AIPOMM))*1.e-9
-  concbc(:,:)=(m_allaer(:,:,id_ASBCM)+m_allaer(:,:,id_AIBCM))*1.e-9
-  concss(:,:)=(m_allaer(:,:,id_ASSSM)+m_allaer(:,:,id_CSSSM)+m_allaer(:,:,id_SSSSM))*1.e-9
-  concdust(:,:)=m_allaer(:,:,id_CIDUSTM)*1.e-9
+       pdel, m_allaer, pdtphys, rhcl, & 
+       tau_aero, piz_aero, cg_aero,   &
+       m_allaer_pi, flag_aerosol, &
+       zrho ) 
+
+  ! aeropt_5wv only for validation and diagnostics
+  CALL aeropt_5wv_rrtm(                    &
+       pdel, m_allaer,                &
+       pdtphys, rhcl, aerindex,       & 
+       flag_aerosol, pplay, t_seri,   &
+       tausum_aero, tau3d_aero )
+
+  ! Diagnostics calculation for CMIP5 protocol
+  sconcso4(:)  =m_allaer(:,1,id_ASSO4M_phy)*1.e-9
+  sconcno3(:)  =(m_allaer(:,1,id_ASNO3M_phy)+m_allaer(:,1,id_CSNO3M_phy)+m_allaer(:,1,id_CINO3M_phy))*1.e-9
+  sconcoa(:)   =(m_allaer(:,1,id_ASPOMM_phy)+m_allaer(:,1,id_AIPOMM_phy))*1.e-9
+  sconcbc(:)   =(m_allaer(:,1,id_ASBCM_phy)+m_allaer(:,1,id_AIBCM_phy))*1.e-9
+  sconcss(:)   =(m_allaer(:,1,id_ASSSM_phy)+m_allaer(:,1,id_CSSSM_phy)+m_allaer(:,1,id_SSSSM_phy))*1.e-9
+  sconcdust(:) =m_allaer(:,1,id_CIDUSTM_phy)*1.e-9
+  concso4(:,:) =m_allaer(:,:,id_ASSO4M_phy)*1.e-9
+  concno3(:,:) =(m_allaer(:,:,id_ASNO3M_phy)+m_allaer(:,:,id_CSNO3M_phy)+m_allaer(:,:,id_CINO3M_phy))*1.e-9
+  concoa(:,:)  =(m_allaer(:,:,id_ASPOMM_phy)+m_allaer(:,:,id_AIPOMM_phy))*1.e-9
+  concbc(:,:)  =(m_allaer(:,:,id_ASBCM_phy)+m_allaer(:,:,id_AIBCM_phy))*1.e-9
+  concss(:,:)  =(m_allaer(:,:,id_ASSSM_phy)+m_allaer(:,:,id_CSSSM_phy)+m_allaer(:,:,id_SSSSM_phy))*1.e-9
+  concdust(:,:)=m_allaer(:,:,id_CIDUSTM_phy)*1.e-9
 
 END SUBROUTINE readaerosol_optic_rrtm
Index: /LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato_rrtm.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato_rrtm.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato_rrtm.F90	(revision 2146)
@@ -16,7 +16,9 @@
     USE aero_mod
     USE dimphy
+    USE YOERAD   , ONLY : NLW
 
     implicit none
 
+    include "YOMCST.h"
     include "dimensions.h"
 
@@ -33,5 +35,5 @@
     real, pointer:: time(:)
     real, pointer:: lev(:)
-    integer k, band, wave
+    integer k, band, wave, i
     integer, save :: mth_pre
 
@@ -45,4 +47,6 @@
     real, allocatable:: tauaerstrat_mois_glo_bands(:,:,:)
 
+    real, allocatable:: sum_tau_aer_strat(:)
+
 ! For NetCDF:
     integer ncid_in  ! IDs for input files
@@ -50,16 +54,30 @@
 
 ! Stratospheric aerosols optical properties
-! alpha_strat over the 2 bands is normalised by the 550 nm extinction coefficient
-! alpha_strat_wave is *not* normalised by the 550 nm extinction coefficient
-    real, dimension(nbands_rrtm) :: alpha_strat, piz_strat, cg_strat
-    data alpha_strat/0.938538969, 0.990073204, 0.992904723, 0.829215884, 0.439313501, 0.156857833/
-    data cg_strat   /0.699142992, 0.716326416, 0.735462785, 0.736726701, 0.712068975, 0.575097859/
-    data piz_strat  /1.000000000, 1.000000000, 1.000000000, 1.000000000, 0.997781098, 0.452584684/
-    real, dimension(nwave) :: alpha_strat_wave
-    data alpha_strat_wave/3.36780953,3.34667683,3.20444202,3.0293026,2.82108808/
-
+! alpha_sw_strat over the 6 bands is normalised by the 550 nm extinction coefficient
+    real, dimension(nbands_sw_rrtm) :: alpha_sw_strat, piz_sw_strat, cg_sw_strat
+    data alpha_sw_strat/0.8545564, 0.8451642, 0.9821724, 0.8145110, 0.3073565, 7.7966176E-02/
+    data cg_sw_strat   /0.6997170, 0.6810035, 0.7403592, 0.7562674, 0.6676504, 0.3478689/
+    data piz_sw_strat  /0.9999998, 0.9999998, 1.000000000, 0.9999958, 0.9977155, 0.4510679/
+!
+!--diagnostics AOD in the SW
+! alpha_sw_strat_wave is *not* normalised by the 550 nm extinction coefficient
+    real, dimension(nwave) :: alpha_sw_strat_wave
+    data alpha_sw_strat_wave/3.708007,4.125824,4.136584,3.887478,3.507738/
+!
+!--diagnostics AOD in the LW at 10 um 
+    real :: alpha_lw_strat_wave
+    data alpha_lw_strat_wave/0.2746812/
+!
+    real, dimension(nbands_lw_rrtm) :: alpha_lw_abs_rrtm
+    data alpha_lw_abs_rrtm/   8.8340312E-02, 6.9856711E-02, 6.2652975E-02, 5.7188231E-02, &
+                              6.3157059E-02, 5.5072524E-02, 5.0571125E-02, 0.1349073, &    
+                              0.1381676, 9.6506312E-02, 5.1312990E-02, 2.4256418E-02, &
+                              2.7191756E-02, 3.3862915E-02, 1.6132960E-02, 1.4275438E-02/ ! calculated with Mie_SW_LW_RRTM_V2.4 (bimodal, corrected)
+                                                                                          ! for r_0=/0.13E-6, 0.41E-6/ m, sigma_g=/1.26, 1.30/
+                                                                                          ! order: increasing wavelength!
 !--------------------------------------------------------
 
     IF (.not.ALLOCATED(tau_aer_strat)) ALLOCATE(tau_aer_strat(klon,klev))
+    IF (.not.ALLOCATED(sum_tau_aer_strat)) ALLOCATE(sum_tau_aer_strat(klon))
 
     IF (is_mpi_root) THEN
@@ -67,6 +85,6 @@
     IF (debut.OR.mth_cur.NE.mth_pre) THEN
 
-    IF (nbands_rrtm.NE.6) THEN 
-        print *,'nbands_rrtm doit etre egal a 6 dans readaerosolstrat_rrtm'
+    IF (nbands_sw_rrtm.NE.6) THEN 
+        print *,'nbands_sw_rrtm doit etre egal a 6 dans readaerosolstrat_rrtm'
         STOP
     ENDIF
@@ -112,5 +130,5 @@
     ALLOCATE(tauaerstrat_mois(n_lon, n_lat, n_lev))
     ALLOCATE(tauaerstrat_mois_glo(klon_glo, n_lev))
-    ALLOCATE(tauaerstrat_mois_glo_bands(klon_glo, n_lev,nbands_rrtm))
+    ALLOCATE(tauaerstrat_mois_glo_bands(klon_glo, n_lev,nbands_sw_rrtm))
 
 !--reading stratospheric AOD at 550 nm
@@ -143,31 +161,48 @@
     ENDIF !--is_mpi_root
 
-!--total vertical aod at the 5 wavelengths
+!--total vertical aod at the 5 SW wavelengths
     DO wave=1, nwave
     DO k=1, klev
-    tausum_aero(:,wave,id_strat)=tausum_aero(:,wave,id_strat)+tau_aer_strat(:,k)*alpha_strat_wave(wave)/alpha_strat_wave(2)
+    tausum_aero(:,wave,id_STRAT_phy)=tausum_aero(:,wave,id_STRAT_phy)+tau_aer_strat(:,k)*alpha_sw_strat_wave(wave)/alpha_sw_strat_wave(2)
     ENDDO
     ENDDO
 
 !--weighted average for cg, piz and tau, adding strat aerosols on top of tropospheric ones
-    DO band=1, nbands_rrtm
-!--anthropogenic aerosols bands 1 to nbands_rrtm 
-    cg_aero_rrtm(:,:,2,band)  = ( cg_aero_rrtm(:,:,2,band)*piz_aero_rrtm(:,:,2,band)*tau_aero_rrtm(:,:,2,band) + &
-                                  cg_strat(band)*piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) /        &
-                             MAX( piz_aero_rrtm(:,:,2,band)*tau_aero_rrtm(:,:,2,band) +                          &
-                                  piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:), 1.e-15 )
-    piz_aero_rrtm(:,:,2,band)  = ( piz_aero_rrtm(:,:,2,band)*tau_aero_rrtm(:,:,2,band) +                         &
-                              piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) /                           &
-                              MAX( tau_aero_rrtm(:,:,2,band) + alpha_strat(band)*tau_aer_strat(:,:), 1.e-15 )
-    tau_aero_rrtm(:,:,2,band)  = tau_aero_rrtm(:,:,2,band) + alpha_strat(band)*tau_aer_strat(:,:)
-!--natural aerosols bands 1 to nbands_rrtm
-    cg_aero_rrtm(:,:,1,band)  = ( cg_aero_rrtm(:,:,1,band)*piz_aero_rrtm(:,:,1,band)*tau_aero_rrtm(:,:,1,band) + &
-                             cg_strat(band)*piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) /             &
-                             MAX( piz_aero_rrtm(:,:,1,band)*tau_aero_rrtm(:,:,1,band) +                          &
-                                  piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:), 1.e-15 )
-    piz_aero_rrtm(:,:,1,band)  = ( piz_aero_rrtm(:,:,1,band)*tau_aero_rrtm(:,:,1,band) +                         & 
-                              piz_strat(band)*alpha_strat(band)*tau_aer_strat(:,:) ) /                           &
-                              MAX( tau_aero_rrtm(:,:,1,band) + alpha_strat(band)*tau_aer_strat(:,:),1.e-15 )
-    tau_aero_rrtm(:,:,1,band)  = tau_aero_rrtm(:,:,1,band) + alpha_strat(band)*tau_aer_strat(:,:)
+    DO band=1, nbands_sw_rrtm
+!--anthropogenic aerosols bands 1 to nbands_sw_rrtm 
+    cg_aero_sw_rrtm(:,:,2,band)  = ( cg_aero_sw_rrtm(:,:,2,band)*piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) + &
+                                  cg_sw_strat(band)*piz_sw_strat(band)*alpha_sw_strat(band)*tau_aer_strat(:,:) ) /           &
+                             MAX( piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) +                                &
+                                  piz_sw_strat(band)*alpha_sw_strat(band)*tau_aer_strat(:,:), 1.e-15 )
+    piz_aero_sw_rrtm(:,:,2,band)  = ( piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) +                            &
+                              piz_sw_strat(band)*alpha_sw_strat(band)*tau_aer_strat(:,:) ) /                                 &
+                              MAX( tau_aero_sw_rrtm(:,:,2,band) + alpha_sw_strat(band)*tau_aer_strat(:,:), 1.e-15 )
+    tau_aero_sw_rrtm(:,:,2,band)  = tau_aero_sw_rrtm(:,:,2,band) + alpha_sw_strat(band)*tau_aer_strat(:,:)
+!--natural aerosols bands 1 to nbands_sw_rrtm
+    cg_aero_sw_rrtm(:,:,1,band)  = ( cg_aero_sw_rrtm(:,:,1,band)*piz_aero_sw_rrtm(:,:,1,band)*tau_aero_sw_rrtm(:,:,1,band) + &
+                             cg_sw_strat(band)*piz_sw_strat(band)*alpha_sw_strat(band)*tau_aer_strat(:,:) ) /                &
+                             MAX( piz_aero_sw_rrtm(:,:,1,band)*tau_aero_sw_rrtm(:,:,1,band) +                                &
+                                  piz_sw_strat(band)*alpha_sw_strat(band)*tau_aer_strat(:,:), 1.e-15 )
+    piz_aero_sw_rrtm(:,:,1,band)  = ( piz_aero_sw_rrtm(:,:,1,band)*tau_aero_sw_rrtm(:,:,1,band) +                            &
+                              piz_sw_strat(band)*alpha_sw_strat(band)*tau_aer_strat(:,:) ) /                                 &
+                              MAX( tau_aero_sw_rrtm(:,:,1,band) + alpha_sw_strat(band)*tau_aer_strat(:,:),1.e-15 )
+    tau_aero_sw_rrtm(:,:,1,band)  = tau_aero_sw_rrtm(:,:,1,band) + alpha_sw_strat(band)*tau_aer_strat(:,:)
+!--no stratospheric aerosol in index 1 for these tests
+!    cg_aero_sw_rrtm(:,:,1,band)  =  cg_aero_sw_rrtm(:,:,1,band)
+!    piz_aero_sw_rrtm(:,:,1,band)  = piz_aero_sw_rrtm(:,:,1,band)
+!    tau_aero_sw_rrtm(:,:,1,band)  = tau_aero_sw_rrtm(:,:,1,band)
+    ENDDO
+
+!--stratospheric AOD in LW
+    IF (nbands_lw_rrtm .NE. NLW) then
+      print*, 'different values for NLW (=',NLW,') and nbands_lw_rrtm (=', nbands_lw_rrtm, ')'
+      STOP
+    ENDIF 
+
+    DO band=1, nbands_lw_rrtm
+    tau_aero_lw_rrtm(:,:,2,band)  = tau_aero_lw_rrtm(:,:,2,band) + alpha_lw_abs_rrtm(band)*tau_aer_strat(:,:)
+    tau_aero_lw_rrtm(:,:,1,band)  = tau_aero_lw_rrtm(:,:,1,band) + alpha_lw_abs_rrtm(band)*tau_aer_strat(:,:) 
+!--no stratospheric aerosols in index 1 for these tests
+!    tau_aero_lw_rrtm(:,:,1,band)  = tau_aero_lw_rrtm(:,:,1,band) 
     ENDDO
 
Index: /LMDZ5/trunk/libf/phylmd/rrtm/recmwf_aero.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/recmwf_aero.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/recmwf_aero.F90	(revision 2146)
@@ -20,4 +20,7 @@
  & PPIZA_NAT,PCGA_NAT,PTAU_NAT, & 
 !--fin OB 
+!--C.Kleinschmitt
+ & PTAU_LW_TOT, PTAU_LW_NAT, & 
+!--end
  & PFLUX,PFLUC,&
  & PFSDN ,PFSUP , PFSCDN , PFSCUP,&
@@ -27,4 +30,9 @@
  & PTOPSWAIAERO,PSOLSWAIAERO,&
  & PTOPSWCFAERO,PSOLSWCFAERO,&
+!--LW diagnostics CK
+ & PTOPLWADAERO,PSOLLWADAERO,&
+ & PTOPLWAD0AERO,PSOLLWAD0AERO,&
+ & PTOPLWAIAERO,PSOLLWAIAERO,&
+!..end
  & ok_ade, ok_aie, flag_aerosol,flag_aerosol_strat)
 !--fin
@@ -79,4 +87,6 @@
 ! PCGA_NAT   : (KPROMA,KLEV,NSW); Assymetry factor for natural aerosol
 ! PTAU_NAT: (KPROMA,KLEV,NSW)   ; Optical depth of natural aerosol
+! PTAU_LW_TOT  (KPROMA,KLEV,NLW); LW Optical depth of total aerosols  
+! PTAU_LW_NAT  (KPROMA,KLEV,NLW); LW Optical depth of natural aerosols 
 !--fin OB
 
@@ -136,4 +146,5 @@
 USE YOMCST   , ONLY :         RMD      ,RMO3
 USE YOMPHY3  , ONLY : RII0
+USE YOERAD   , ONLY : NLW, NAER, RCCNLND  ,RCCNSEA  
 USE YOERAD   , ONLY : NAER, RCCNLND  ,RCCNSEA  
 USE YOERDU   , ONLY : REPSCQ
@@ -150,4 +161,5 @@
 IMPLICIT NONE
 INCLUDE "clesphys.h"
+
 
 INTEGER(KIND=JPIM),INTENT(IN)    :: KPROMA 
@@ -186,4 +198,9 @@
 REAL(KIND=JPRB)                  :: PTAU_ZERO(KPROMA,KLEV,NSW)
 !--fin
+!--C.Kleinschmitt
+REAL(KIND=JPRB)                  :: PTAU_LW_ZERO(KPROMA,KLEV,NLW)
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW_TOT(KPROMA,KLEV,NLW)
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW_NAT(KPROMA,KLEV,NLW)
+!--end
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PREF_LIQ(KPROMA,KLEV)
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PREF_ICE(KPROMA,KLEV)
@@ -199,4 +216,9 @@
 REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTOPSWCFAERO(KPROMA,3), PSOLSWCFAERO(KPROMA,3) !--do we keep this ?
 !--fin
+!--CK
+REAL(KIND=JPRB)   ,INTENT(out)   :: PTOPLWADAERO(KPROMA), PSOLLWADAERO(KPROMA)       ! LW Aerosol direct forcing at TOA + surface
+REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTOPLWAD0AERO(KPROMA), PSOLLWAD0AERO(KPROMA)     ! LW Aerosol direct forcing at TOA + surface
+REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTOPLWAIAERO(KPROMA), PSOLLWAIAERO(KPROMA)       ! LW Aer. indirect forcing at TOA + surface
+!--end
 REAL(KIND=JPRB)   ,INTENT(OUT)   :: PEMTD(KPROMA,KLEV+1) 
 REAL(KIND=JPRB)   ,INTENT(OUT)   :: PEMTU(KPROMA,KLEV+1) 
@@ -295,4 +317,9 @@
 REAL(KIND=JPRB) ::  ZFSUP0_AERO(KPROMA,KLEV+1,5)
 REAL(KIND=JPRB) ::  ZFSDN0_AERO(KPROMA,KLEV+1,5)
+!--LW (CK):
+REAL(KIND=JPRB) ::  LWUP_AERO(KPROMA,KLEV+1,5)
+REAL(KIND=JPRB) ::  LWDN_AERO(KPROMA,KLEV+1,5)
+REAL(KIND=JPRB) ::  LWUP0_AERO(KPROMA,KLEV+1,5)
+REAL(KIND=JPRB) ::  LWDN0_AERO(KPROMA,KLEV+1,5)
 
 #include "radlsw.intfb.h"
@@ -313,7 +340,14 @@
 ZFSDN0_AERO(:,:,:)=0.
 
+LWUP_AERO (:,:,:)=0.
+LWDN_AERO (:,:,:)=0.
+LWUP0_AERO(:,:,:)=0.
+LWDN0_AERO(:,:,:)=0.
+
 PTAU_ZERO(:,:,:) =1.e-15
 PPIZA_ZERO(:,:,:)=1.0
 PCGA_ZERO(:,:,:) =0.0
+
+PTAU_LW_ZERO(:,:,:) =1.e-15
 
 
@@ -431,5 +465,5 @@
  & ZFRSOD, ZSUDU  , ZUVDF   , ZPARF   , ZPARCF, ZTINCF, PSFSWDIR,&
  & PSFSWDIF,PFSDNN, PFSDNV  ,&  
- & LRDUST,PPIZA_NAT,PCGA_NAT,PTAU_NAT,PFLUX,PFLUC,&
+ & LRDUST,PPIZA_NAT,PCGA_NAT,PTAU_NAT,PTAU_LW_NAT,PFLUX,PFLUC,&
  & PFSDN , PFSUP  , PFSCDN  , PFSCUP )
 
@@ -440,4 +474,10 @@
 ZFSUP_AERO(:,:,1) =  PFSUP(:,:)
 ZFSDN_AERO(:,:,1) =  PFSDN(:,:)
+
+LWUP0_AERO(:,:,1) = PFLUC(:,1,:)
+LWDN0_AERO(:,:,1) = PFLUC(:,2,:)
+
+LWUP_AERO(:,:,1) = PFLUX(:,1,:)
+LWDN_AERO(:,:,1) = PFLUX(:,2,:)
 
 ENDIF 
@@ -463,5 +503,5 @@
  & ZFRSOD, ZSUDU  , ZUVDF   , ZPARF   , ZPARCF, ZTINCF, PSFSWDIR,&
  & PSFSWDIF,PFSDNN, PFSDNV  ,&  
- & LRDUST,PPIZA_NAT,PCGA_NAT,PTAU_NAT,PFLUX,PFLUC,&
+ & LRDUST,PPIZA_NAT,PCGA_NAT,PTAU_NAT,PTAU_LW_NAT,PFLUX,PFLUC,&
  & PFSDN , PFSUP  , PFSCDN  , PFSCUP )
 
@@ -472,4 +512,10 @@
 ZFSUP_AERO(:,:,2) =  PFSUP(:,:)
 ZFSDN_AERO(:,:,2) =  PFSDN(:,:)
+
+LWUP0_AERO(:,:,2) = PFLUC(:,1,:)
+LWDN0_AERO(:,:,2) = PFLUC(:,2,:)
+
+LWUP_AERO(:,:,2) = PFLUX(:,1,:)
+LWDN_AERO(:,:,2) = PFLUX(:,2,:)
 
 ENDIF ! ok_aie      
@@ -495,5 +541,5 @@
  & ZFRSOD, ZSUDU  , ZUVDF   , ZPARF   , ZPARCF, ZTINCF, PSFSWDIR,&
  & PSFSWDIF,PFSDNN, PFSDNV  ,&  
- & LRDUST,PPIZA_TOT,PCGA_TOT,PTAU_TOT,PFLUX,PFLUC,&
+ & LRDUST,PPIZA_TOT,PCGA_TOT,PTAU_TOT,PTAU_LW_TOT,PFLUX,PFLUC,&
  & PFSDN , PFSUP  , PFSCDN  , PFSCUP )
 
@@ -504,4 +550,10 @@
 ZFSUP_AERO(:,:,3) =  PFSUP(:,:)
 ZFSDN_AERO(:,:,3) =  PFSDN(:,:)
+
+LWUP0_AERO(:,:,3) = PFLUC(:,1,:)
+LWDN0_AERO(:,:,3) = PFLUC(:,2,:)
+
+LWUP_AERO(:,:,3) = PFLUX(:,1,:)
+LWDN_AERO(:,:,3) = PFLUX(:,2,:)
 
 ENDIF !-end ok_ade
@@ -527,5 +579,5 @@
  & ZFRSOD, ZSUDU  , ZUVDF   , ZPARF   , ZPARCF, ZTINCF, PSFSWDIR,&
  & PSFSWDIF,PFSDNN, PFSDNV  ,&  
- & LRDUST,PPIZA_TOT,PCGA_TOT,PTAU_TOT,PFLUX,PFLUC,&
+ & LRDUST,PPIZA_TOT,PCGA_TOT,PTAU_TOT,PTAU_LW_TOT,PFLUX,PFLUC,&
  & PFSDN , PFSUP  , PFSCDN  , PFSCUP )
 
@@ -536,4 +588,10 @@
 ZFSUP_AERO(:,:,4) =  PFSUP(:,:)
 ZFSDN_AERO(:,:,4) =  PFSDN(:,:)
+
+LWUP0_AERO(:,:,4) = PFLUC(:,1,:)
+LWDN0_AERO(:,:,4) = PFLUC(:,2,:)
+
+LWUP_AERO(:,:,4) = PFLUX(:,1,:)
+LWDN_AERO(:,:,4) = PFLUX(:,2,:)
 
 ENDIF ! ok_ade .and. ok_aie
@@ -563,5 +621,5 @@
  & ZFRSOD, ZSUDU  , ZUVDF   , ZPARF   , ZPARCF, ZTINCF, PSFSWDIR,&
  & PSFSWDIF,PFSDNN, PFSDNV  ,&  
- & LRDUST,PPIZA_ZERO,PCGA_ZERO,PTAU_ZERO,PFLUX,PFLUC,&
+ & LRDUST,PPIZA_ZERO,PCGA_ZERO,PTAU_ZERO, PTAU_LW_ZERO,PFLUX,PFLUC,&
  & PFSDN , PFSUP  , PFSCDN  , PFSCUP )
 
@@ -572,4 +630,10 @@
 ZFSUP_AERO(:,:,5) =  PFSUP(:,:)
 ZFSDN_AERO(:,:,5) =  PFSDN(:,:)
+
+LWUP0_AERO(:,:,5) = PFLUC(:,1,:)
+LWDN0_AERO(:,:,5) = PFLUC(:,2,:)
+
+LWUP_AERO(:,:,5) = PFLUX(:,1,:)
+LWDN_AERO(:,:,5) = PFLUX(:,2,:)
 
 ENDIF ! .not. AEROSOLFEEDBACK_ACTIVE
@@ -643,4 +707,9 @@
     PFSCUP(:,:) =   ZFSUP0_AERO(:,:,4)
     PFSCDN(:,:) =   ZFSDN0_AERO(:,:,4)
+
+    PFLUX(:,1,:) =  LWUP_AERO(:,:,4)
+    PFLUX(:,2,:) =  LWDN_AERO(:,:,4)
+    PFLUC(:,1,:) =  LWUP0_AERO(:,:,4)
+    PFLUC(:,2,:) =  LWDN0_AERO(:,:,4)    
   ENDIF
 
@@ -650,4 +719,9 @@
     PFSCUP(:,:) =   ZFSUP0_AERO(:,:,3)
     PFSCDN(:,:) =   ZFSDN0_AERO(:,:,3)
+
+    PFLUX(:,1,:) =  LWUP_AERO(:,:,3)
+    PFLUX(:,2,:) =  LWDN_AERO(:,:,3)
+    PFLUC(:,1,:) =  LWUP0_AERO(:,:,3)
+    PFLUC(:,2,:) =  LWDN0_AERO(:,:,3) 
   ENDIF
 
@@ -657,4 +731,9 @@
     PFSCUP(:,:) =   ZFSUP0_AERO(:,:,2)
     PFSCDN(:,:) =   ZFSDN0_AERO(:,:,2)
+
+    PFLUX(:,1,:) =  LWUP_AERO(:,:,2)
+    PFLUX(:,2,:) =  LWDN_AERO(:,:,2)
+    PFLUC(:,1,:) =  LWUP0_AERO(:,:,2)
+    PFLUC(:,2,:) =  LWDN0_AERO(:,:,2) 
   ENDiF
 
@@ -664,4 +743,9 @@
     PFSCUP(:,:) =   ZFSUP0_AERO(:,:,1)
     PFSCDN(:,:) =   ZFSDN0_AERO(:,:,1)
+
+    PFLUX(:,1,:) =  LWUP_AERO(:,:,1)
+    PFLUX(:,2,:) =  LWDN_AERO(:,:,1)
+    PFLUC(:,1,:) =  LWUP0_AERO(:,:,1)
+    PFLUC(:,2,:) =  LWDN0_AERO(:,:,1) 
   ENDIF
 
@@ -677,4 +761,9 @@
     PFSCDN(:,:) =   ZFSDN0_AERO(:,:,5)
 
+    PFLUX(:,1,:) =  LWUP_AERO(:,:,5)
+    PFLUX(:,2,:) =  LWDN_AERO(:,:,5)
+    PFLUC(:,1,:) =  LWUP0_AERO(:,:,5)
+    PFLUC(:,2,:) =  LWDN0_AERO(:,:,5) 
+
 ENDIF
 
@@ -683,5 +772,5 @@
 ! requires a natural aerosol field read and used 
 ! Difference of net fluxes from double call to radiation
-! Will need to be extended to LW radiation
+! Will need to be extended to LW radiation -> done by CK (2014-05-23)
 
 IF (flag_aerosol .GT. 0 .OR. flag_aerosol_strat) THEN
@@ -709,4 +798,14 @@
      PTOPSWCFAERO(:,3) = 0.0
 
+! LW direct anthropogenic forcing
+     PSOLLWADAERO(:)  = (-LWDN_AERO(:,1,4)      -LWUP_AERO(:,1,4))      -(-LWDN_AERO(:,1,2)      -LWUP_AERO(:,1,2))
+     PTOPLWADAERO(:)  = (-LWDN_AERO(:,KLEV+1,4) -LWUP_AERO(:,KLEV+1,4)) -(-LWDN_AERO(:,KLEV+1,2) -LWUP_AERO(:,KLEV+1,2))
+     PSOLLWAD0AERO(:) = (-LWDN0_AERO(:,1,4)     -LWUP0_AERO(:,1,4))     -(-LWDN0_AERO(:,1,2)     -LWUP0_AERO(:,1,2))
+     PTOPLWAD0AERO(:) = (-LWDN0_AERO(:,KLEV+1,4)-LWUP0_AERO(:,KLEV+1,4))-(-LWDN0_AERO(:,KLEV+1,2)-LWUP0_AERO(:,KLEV+1,2))
+
+! LW indirect anthropogenic forcing
+     PSOLLWAIAERO(:) = (-LWDN_AERO(:,1,4)     -LWUP_AERO(:,1,4))     -(-LWDN_AERO(:,1,3)     -LWUP_AERO(:,1,3))
+     PTOPLWAIAERO(:) = (-LWDN_AERO(:,KLEV+1,4)-LWUP_AERO(:,KLEV+1,4))-(-LWDN_AERO(:,KLEV+1,3)-LWUP_AERO(:,KLEV+1,3))
+
 ENDIF
 
@@ -733,4 +832,14 @@
      PTOPSWCFAERO(:,3) = 0.0
 
+! LW direct anthropogenic forcing
+     PSOLLWADAERO(:)  = (-LWDN_AERO(:,1,3)      -LWUP_AERO(:,1,3))      -(-LWDN_AERO(:,1,1)      -LWUP_AERO(:,1,1))
+     PTOPLWADAERO(:)  = (-LWDN_AERO(:,KLEV+1,3) -LWUP_AERO(:,KLEV+1,3)) -(-LWDN_AERO(:,KLEV+1,1) -LWUP_AERO(:,KLEV+1,1))
+     PSOLLWAD0AERO(:) = (-LWDN0_AERO(:,1,3)     -LWUP0_AERO(:,1,3))     -(-LWDN0_AERO(:,1,1)     -LWUP0_AERO(:,1,1))
+     PTOPLWAD0AERO(:) = (-LWDN0_AERO(:,KLEV+1,3)-LWUP0_AERO(:,KLEV+1,3))-(-LWDN0_AERO(:,KLEV+1,1)-LWUP0_AERO(:,KLEV+1,1))
+
+! LW indirect anthropogenic forcing
+     PSOLLWAIAERO(:) = 0.0
+     PTOPLWAIAERO(:) = 0.0 
+
 ENDIF
 
@@ -757,4 +866,14 @@
      PTOPSWCFAERO(:,3) = 0.0
 
+! LW direct anthropogenic forcing
+     PSOLLWADAERO(:)  = 0.0
+     PTOPLWADAERO(:)  = 0.0
+     PSOLLWAD0AERO(:) = 0.0
+     PTOPLWAD0AERO(:) = 0.0
+
+! LW indirect anthropogenic forcing
+     PSOLLWAIAERO(:) = (-LWDN_AERO(:,1,2)     -LWUP_AERO(:,1,2))     -(-LWDN_AERO(:,1,1)     -LWUP_AERO(:,1,1))
+     PTOPLWAIAERO(:) = (-LWDN_AERO(:,KLEV+1,2)-LWUP_AERO(:,KLEV+1,2))-(-LWDN_AERO(:,KLEV+1,1)-LWUP_AERO(:,KLEV+1,1))
+
 ENDIF
 
@@ -781,4 +900,14 @@
      PTOPSWCFAERO(:,3) = 0.0
 
+! LW direct anthropogenic forcing
+     PSOLLWADAERO(:)  = 0.0
+     PTOPLWADAERO(:)  = 0.0
+     PSOLLWAD0AERO(:) = 0.0
+     PTOPLWAD0AERO(:) = 0.0
+
+! LW indirect anthropogenic forcing
+     PSOLLWAIAERO(:) = 0.0 
+     PTOPLWAIAERO(:) = 0.0
+
 ENDIF
 
@@ -790,4 +919,5 @@
      PSOLSWCFAERO(:,3) = (ZFSDN_AERO(:,1,5)     -ZFSUP_AERO(:,1,5))     -(ZFSDN0_AERO(:,1,5)     -ZFSUP0_AERO(:,1,5))
      PTOPSWCFAERO(:,3) = (ZFSDN_AERO(:,KLEV+1,5)-ZFSUP_AERO(:,KLEV+1,5))-(ZFSDN0_AERO(:,KLEV+1,5)-ZFSUP0_AERO(:,KLEV+1,5))
+
 ENDIF
 
Index: /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_ecrt_140gp.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_ecrt_140gp.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_ecrt_140gp.F90	(revision 2146)
@@ -10,6 +10,8 @@
  & P_ZEMIS, P_ZEMIW,&
  & pq   , pcco2, pozn, pcldf, ptaucld, ptclear,&
- & P_CLDFRAC,P_TAUCLD,P_COLDRY,P_WKL,P_WX,&
- & P_TAUAERL,PAVEL,P_TAVEL,PZ,P_TZ,P_TBOUND,K_NLAYERS,P_SEMISS,K_IREFLECT)  
+ & P_CLDFRAC,P_TAUCLD,&
+ & PTAU_LW,&
+ & P_COLDRY,P_WKL,P_WX,&
+ & P_TAUAERL,PAVEL,P_TAVEL,PZ,P_TZ,P_TBOUND,K_NLAYERS,P_SEMISS,K_IREFLECT )  
 
 !     Reformatted for F90 by JJMorcrette, ECMWF, 980714
@@ -28,15 +30,13 @@
 USE PARRRTM  , ONLY : JPBAND   ,JPXSEC   ,JPLAY   ,&
  & JPINPX  
-USE YOERAD   , ONLY : NOVLP
-!USE YOERDI   , ONLY :    RCH4     ,RN2O    ,RCFC11  ,RCFC12
+USE YOERAD   , ONLY : NLW      ,NOVLP
+USE YOERDI   , ONLY :    RCH4     ,RN2O    ,RCFC11  ,RCFC12
 USE YOESW    , ONLY : RAER
 
 !------------------------------Arguments--------------------------------
 
-
-
 IMPLICIT NONE
 
-#include "clesphys.h"
+
 INTEGER(KIND=JPIM),INTENT(IN)    :: KLON! Number of atmospheres (longitudes) 
 INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV! Number of atmospheric layers 
@@ -56,4 +56,7 @@
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLDF(KLON,KLEV) ! Cloud fraction
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAUCLD(KLON,KLEV,JPBAND) ! Cloud optical depth
+!--C.Kleinschmitt
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW(KLON,KLEV,NLW) ! LW Optical depth of aerosols  
+!--end
 REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTCLEAR 
 REAL(KIND=JPRB)   ,INTENT(OUT)   :: P_CLDFRAC(JPLAY) ! Cloud fraction
@@ -258,4 +261,13 @@
   P_TAUAERL(I_L,16)=ZTAUAER(5)
 ENDDO
+!--Use LW AOD from own Mie calculations (C. Kleinschmitt)
+DO I_L=1,KLEV
+  JK=KLEV-I_L+1
+!  DO JAE=1, NLW 
+  DO JAE=1, 16
+    P_TAUAERL(I_L,JAE) = MAX( PTAU_LW(K_IPLON, JK, JAE), 1e-30 )
+  ENDDO
+ENDDO
+!--end C. Kleinschmitt
 
 DO J2=1,KLEV
@@ -390,6 +402,4 @@
 !     ------------------------------------------------------------------
 
-
-
 IF (LHOOK) CALL DR_HOOK('RRTM_ECRT_140GP',1,ZHOOK_HANDLE)
 END SUBROUTINE RRTM_ECRT_140GP
Index: /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_ecrt_140gp.intfb.h
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_ecrt_140gp.intfb.h	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_ecrt_140gp.intfb.h	(revision 2146)
@@ -1,14 +1,19 @@
-INTERFACE
-SUBROUTINE RRTM_ECRT_140GP&
+INTERFACE 
+SUBROUTINE RRTM_ECRT_140GP &
  & ( K_IPLON, klon , klev, kcld,&
  & paer , paph , pap,&
- & pts , pth , pt,&
+ & pts  , pth  , pt,&
  & P_ZEMIS, P_ZEMIW,&
- & pq , pcco2, pozn, pcldf, ptaucld, ptclear,&
- & P_CLDFRAC,P_TAUCLD,P_COLDRY,P_WKL,P_WX,&
- & P_TAUAERL,PAVEL,P_TAVEL,PZ,P_TZ,P_TBOUND,K_NLAYERS,P_SEMISS,K_IREFLECT) 
-USE PARKIND1 ,ONLY : JPIM ,JPRB
-USE PARRRTM , ONLY : JPBAND ,JPXSEC ,JPLAY ,&
- & JPINPX 
+ & pq   , pcco2, pozn, pcldf, ptaucld, ptclear,&
+ & P_CLDFRAC,P_TAUCLD,&
+ & PTAU_LW,&
+ & P_COLDRY,P_WKL,P_WX,&
+ & P_TAUAERL,PAVEL,P_TAVEL,PZ,P_TZ,P_TBOUND,K_NLAYERS,P_SEMISS,K_IREFLECT )
+USE PARKIND1  ,ONLY : JPIM     ,JPRB
+USE PARRRTM  , ONLY : JPBAND   ,JPXSEC   ,JPLAY   ,&
+ & JPINPX  
+USE YOERAD   , ONLY : NLW      ,NOVLP
+USE YOERDI   , ONLY :    RCH4     ,RN2O    ,RCFC11  ,RCFC12
+USE YOESW    , ONLY : RAER
 INTEGER(KIND=JPIM),INTENT(IN) :: KLON
 INTEGER(KIND=JPIM),INTENT(IN) :: KLEV
@@ -28,4 +33,7 @@
 REAL(KIND=JPRB) ,INTENT(IN) :: PCLDF(KLON,KLEV)
 REAL(KIND=JPRB) ,INTENT(IN) :: PTAUCLD(KLON,KLEV,JPBAND)
+!--C.Kleinschmitt
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW(KLON,KLEV,NLW) ! LW Optical depth of aerosols  
+!--end
 REAL(KIND=JPRB) ,INTENT(OUT) :: PTCLEAR
 REAL(KIND=JPRB) ,INTENT(OUT) :: P_CLDFRAC(JPLAY)
Index: /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_rrtm_140gp.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_rrtm_140gp.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_rrtm_140gp.F90	(revision 2146)
@@ -40,4 +40,5 @@
  & PQ    , PCCO2 , POZN,&
  & PCLDF , PTAUCLD,&
+ & PTAU_LW,&
  & PEMIT , PFLUX , PFLUC, PTCLEAR &
  & )  
@@ -55,5 +56,5 @@
 USE PARKIND1  ,ONLY : JPIM     ,JPRB
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
-
+USE YOERAD    ,ONLY : NLW
 USE PARRRTM  , ONLY : JPBAND   ,JPXSEC   ,JPGPT    ,JPLAY    ,&
  & JPINPX  
@@ -80,4 +81,7 @@
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PCLDF(KLON,KLEV) ! Cloud fraction
 REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAUCLD(KLON,KLEV,JPBAND) ! Cloud optical depth
+!--C.Kleinschmitt
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW(KLON,KLEV,NLW) ! LW Optical depth of aerosols
+!--end
 REAL(KIND=JPRB)   ,INTENT(OUT)   :: PEMIT(KLON) ! Surface LW emissivity
 REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFLUX(KLON,2,KLEV+1) ! LW total sky flux (1=up, 2=down)
@@ -204,5 +208,7 @@
    & P_ZEMIS, P_ZEMIW,&
    & pq   , pcco2, pozn, pcldf, ptaucld, ztclear,&
-   & Z_CLDFRAC,Z_TAUCLD,Z_COLDRY,Z_WKL,Z_WX,&
+   & Z_CLDFRAC,Z_TAUCLD,&
+   & PTAU_LW,&
+   & Z_COLDRY,Z_WKL,Z_WX,&
    & Z_TAUAERL,Z_PAVEL,Z_TAVEL,Z_PZ,Z_TZ,Z_TBOUND,I_NLAYERS,Z_SEMISS,IREFLECT)  
 
Index: /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_rrtm_140gp.intfb.h
===================================================================
--- /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_rrtm_140gp.intfb.h	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/rrtm/rrtm_rrtm_140gp.intfb.h	(revision 2146)
@@ -1,15 +1,18 @@
 INTERFACE
-SUBROUTINE RRTM_RRTM_140GP&
+SUBROUTINE RRTM_RRTM_140GP &
  & ( KIDIA , KFDIA , KLON , KLEV,&
- & PAER , PAPH , PAP,&
- & PTS , PTH , PT,&
+ & PAER  , PAPH  , PAP,&
+ & PTS   , PTH   , PT,&
  & P_ZEMIS , P_ZEMIW,&
- & PQ , PCCO2 , POZN,&
+ & PQ    , PCCO2 , POZN,&
  & PCLDF , PTAUCLD,&
- & PEMIT , PFLUX , PFLUC, PTCLEAR&
- & ) 
+ & PTAU_LW,&
+ & PEMIT , PFLUX , PFLUC, PTCLEAR )
 USE PARKIND1 ,ONLY : JPIM ,JPRB
+USE YOERAD   ,ONLY : NLW !--C.Kleinschmitt
 USE PARRRTM , ONLY : JPBAND ,JPXSEC ,JPGPT ,JPLAY ,&
- & JPINPX 
+ & JPINPX  
+!-NLW in clesphys now OB
+include "clesphys.h"
 INTEGER(KIND=JPIM),INTENT(IN) :: KLON
 INTEGER(KIND=JPIM),INTENT(IN) :: KLEV
@@ -29,4 +32,7 @@
 REAL(KIND=JPRB) ,INTENT(IN) :: PCLDF(KLON,KLEV)
 REAL(KIND=JPRB) ,INTENT(IN) :: PTAUCLD(KLON,KLEV,JPBAND)
+!--C.Kleinschmitt
+REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAU_LW(KLON,KLEV,NLW) ! LW Optical depth of aerosols  
+!--end
 REAL(KIND=JPRB) ,INTENT(OUT) :: PEMIT(KLON)
 REAL(KIND=JPRB) ,INTENT(OUT) :: PFLUX(KLON,2,KLEV+1)
Index: /LMDZ5/trunk/libf/phylmd/tracinca_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/tracinca_mod.F90	(revision 2145)
+++ /LMDZ5/trunk/libf/phylmd/tracinca_mod.F90	(revision 2146)
@@ -28,5 +28,5 @@
        nstep,    julien,   gmtime,         lafin,     &
        pdtphys,  t_seri,   paprs,          pplay,     &
-       pmfu,     ftsol,    pctsrf,         pphis,     &
+       pmfu,     upwd,     ftsol,  pctsrf, pphis,     &
        pphi,     albsol,   sh,             rh,        &
        cldfra,   rneb,     diafra,         cldliq,    &
@@ -88,5 +88,6 @@
 !Convection:
 !----------
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfu  ! flux de masse dans le panache montant
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfu  ! flux de masse dans le panache montant - Tiedtke
+    REAL,DIMENSION(klon,klev),INTENT(IN) :: upwd  ! flux de masse dans le panache montant - Emanuel
 
 !...Tiedke     
@@ -120,4 +121,5 @@
     INTEGER :: k
     REAL,DIMENSION(klon,klev) :: pdel
+    REAL,DIMENSION(klon,klev) :: zpmfu  ! flux de masse dans le panache montant
     REAL    :: calday
     INTEGER :: ncsec
@@ -133,4 +135,6 @@
     END DO
     
+    zpmfu(:,:)=pmfu(:,:)
+
     IF (config_inca == 'aero') THEN
 #ifdef INCA
@@ -138,5 +142,5 @@
             aerosol_couple,tr_seri,pdtphys, &
             pplay,pdel,prfl,pmflxr,psfl,    &
-            pmflxs,pmfu,itop_con,ibas_con,  &
+            pmflxs,zpmfu,itop_con,ibas_con,  &
             pphi,airephy,nstep,rneb,t_seri, &      
             rh,tau_aero,piz_aero,cg_aero,   &
@@ -144,4 +148,17 @@
 #endif
     END IF
+
+    IF (config_inca == 'aeNP') THEN
+#ifdef INCA
+       zpmfu(:,:)=upwd(:,:)
+       CALL aerosolmainNP(                  &
+            aerosol_couple,tr_seri,pdtphys, &
+            pplay,pdel,prfl,pmflxr,psfl,    &
+            pmflxs,zpmfu,itop_con,ibas_con,  &
+            pphi,airephy,nstep,rneb,t_seri, &      
+            rh,lafin)
+#endif
+    END IF
+
 
 #ifdef INCA
@@ -172,5 +189,5 @@
          psfl,       & !flxsst
          pmflxs,     & !flxscv
-         pmfu,       & !flxupd
+         zpmfu,      & !flxupd   !--now depends on whether AP or NP
          flxmass_w,  & !flxmass_w
          t_seri,     & !tfld
