Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_2bands.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_2bands.F90	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_2bands.F90	(revision 1181)
@@ -6,5 +6,5 @@
 
   USE dimphy
-
+  USE aerosol_mod
 
   !    Yves Balkanski le 12 avril 2006
@@ -23,7 +23,7 @@
   REAL,                           INTENT(in)  :: pdel(KLON,KLEV)
   REAL,                           INTENT(in)  :: delt
-  REAL, DIMENSION(klon,klev,8),   INTENT(in)  :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_spc),   INTENT(in)  :: m_allaer
   REAL,                           INTENT(in)  :: RHcl(KLON,KLEV)     ! humidite relative ciel clair
-  REAL, DIMENSION(klon,10),       INTENT(in)  :: fractnat_allaer
+  REAL, DIMENSION(klon,naero_tot),INTENT(in)  :: fractnat_allaer
   INTEGER,                        INTENT(in)  :: flag_aerosol
   REAL,                           INTENT(in)  :: pplay(klon,klev)
@@ -33,14 +33,14 @@
   ! Output arguments:
   !
-  REAL, DIMENSION(klon,klev,9,2), INTENT(out) :: tau_allaer ! epaisseur optique aerosol
-  REAL, DIMENSION(klon,klev,9,2), INTENT(out) :: piz_allaer ! single scattering albedo aerosol
-  REAL, DIMENSION(klon,klev,9,2), INTENT(out) :: cg_allaer  ! asymmetry parameter aerosol
+  REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(out) :: tau_allaer ! epaisseur optique aerosol
+  REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(out) :: piz_allaer ! single scattering albedo aerosol
+  REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(out) :: cg_allaer  ! asymmetry parameter aerosol
 
   !
   ! Local
   !
-  REAL, DIMENSION(klon,klev,10,2) ::  tau_ae
-  REAL, DIMENSION(klon,klev,10,2) ::  piz_ae
-  REAL, DIMENSION(klon,klev,10,2) ::  cg_ae
+  REAL, DIMENSION(klon,klev,naero_tot,nbands) ::  tau_ae
+  REAL, DIMENSION(klon,klev,naero_tot,nbands) ::  piz_ae
+  REAL, DIMENSION(klon,klev,naero_tot,nbands) ::  cg_ae
   LOGICAL ::  soluble
   INTEGER :: i, k, inu, m, mrfspecies
@@ -49,11 +49,11 @@
 
   PARAMETER (nbre_RH=12)
-  PARAMETER (nbsol_compaer=5)        ! 1- Seasalt AS: 2- Sesalt CS; 3- BC soluble; 4- POM soluble; 5- SO4.
+  PARAMETER (nbsol_compaer=5)        ! 1- Seasalt AS; 2- Sesalt CS; 3- BC soluble; 4- POM soluble; 5- SO4.
   PARAMETER (nbinsol_compaer=3)      ! 1- Dust; 2- BC insoluble; 3- POM insoluble
   REAL:: RH_tab(nbre_RH)
   REAL:: RH_MAX, DELTA, rh 
-  REAL:: tau_ae2b_int(KLON,KLEV,2)   ! Intermediate computation of epaisseur optique aerosol
-  REAL:: piz_ae2b_int(KLON,KLEV,2)   ! Intermediate computation of Single scattering albedo
-  REAL:: cg_ae2b_int(KLON,KLEV,2)    ! Intermediate computation of Assymetry parameter
+  REAL:: tau_ae2b_int(KLON,KLEV,nbands)   ! Intermediate computation of epaisseur optique aerosol
+  REAL:: piz_ae2b_int(KLON,KLEV,nbands)   ! Intermediate computation of Single scattering albedo
+  REAL:: cg_ae2b_int(KLON,KLEV,nbands)    ! Intermediate computation of Assymetry parameter
   PARAMETER (RH_MAX=95.)
   DATA RH_tab/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./
@@ -62,27 +62,17 @@
   REAL :: zdp1(klon,klev) 
   REAL, PARAMETER ::  gravit = 9.80616    ! m2/s
-  INTEGER, ALLOCATABLE, DIMENSION(:)  :: aerosol_name
-  INTEGER, PARAMETER :: id_SSSSM    = 1
-  INTEGER, PARAMETER :: id_CSSSM    = 2
-  INTEGER, PARAMETER :: id_ASSSM    = 3
-  INTEGER, PARAMETER :: id_ASBCM    = 4
-  INTEGER, PARAMETER :: id_ASPOMM   = 5
-  INTEGER, PARAMETER :: id_ASSO4M   = 6
-  INTEGER, PARAMETER :: id_CSSO4M   = 7
-  INTEGER, PARAMETER :: id_CIDUSTM  = 8
-  INTEGER, PARAMETER :: id_AIBCM    = 9
-  INTEGER, PARAMETER :: id_AIPOMM   = 10
+  INTEGER, ALLOCATABLE, DIMENSION(:)   :: aerosol_name
   INTEGER :: nb_aer
-  REAL, DIMENSION(klon,klev,8) :: mass_temp
+  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp
 
   !
   ! Proprietes optiques
   !
-  REAL:: alpha_aers_2bands(nbre_RH,2,nbsol_compaer)   !--unit m2/g SO4
-  REAL:: alpha_aeri_2bands(2,nbinsol_compaer)
-  REAL:: cg_aers_2bands(nbre_RH,2,nbsol_compaer)      !--unit 
-  REAL:: cg_aeri_2bands(2,nbinsol_compaer)
-  REAL:: piz_aers_2bands(nbre_RH,2,nbsol_compaer)     !-- unit
-  REAL:: piz_aeri_2bands(2,nbinsol_compaer)           !-- unit
+  REAL:: alpha_aers_2bands(nbre_RH,nbands,nbsol_compaer)   !--unit m2/g SO4
+  REAL:: alpha_aeri_2bands(nbands,nbinsol_compaer)
+  REAL:: cg_aers_2bands(nbre_RH,nbands,nbsol_compaer)      !--unit 
+  REAL:: cg_aeri_2bands(nbands,nbinsol_compaer)
+  REAL:: piz_aers_2bands(nbre_RH,nbands,nbsol_compaer)     !-- unit
+  REAL:: piz_aeri_2bands(nbands,nbinsol_compaer)           !-- unit
 
 
@@ -233,24 +223,25 @@
      aerosol_name(2) = id_AIPOMM
   ELSEIF (flag_aerosol .EQ. 4) THEN 
-     nb_aer = 5
+     nb_aer = 3
      ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M
+     aerosol_name(1) = id_CSSSM
+     aerosol_name(2) = id_SSSSM
+     aerosol_name(3) = id_ASSSM
+  ELSEIF (flag_aerosol .EQ. 5) THEN 
+     nb_aer = 1
+     ALLOCATE (aerosol_name(nb_aer)) 
+     aerosol_name(1) = id_CIDUSTM
+  ELSEIF (flag_aerosol .EQ. 6) THEN 
+     nb_aer = 9
+     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
-  ELSEIF (flag_aerosol .EQ. 5) THEN 
-     nb_aer = 4
-     ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASBCM
-     aerosol_name(2) = id_AIBCM
-     aerosol_name(3) = id_ASPOMM
-     aerosol_name(4) = id_AIPOMM
-  ELSEIF (flag_aerosol .EQ. 6) THEN 
-     nb_aer = 3
-     ALLOCATE (aerosol_name(nb_aer)) 
-     aerosol_name(1) = id_ASSO4M      
-     aerosol_name(2) = id_ASPOMM
-     aerosol_name(3) = id_AIPOMM
+     aerosol_name(6) = id_CSSSM
+     aerosol_name(7) = id_SSSSM
+     aerosol_name(8) = id_ASSSM
+     aerosol_name(9) = id_CIDUSTM
   ENDIF
 
@@ -327,5 +318,5 @@
            DELTA=(rh-RH_tab(RH_num))/(RH_tab(RH_num+1)-RH_tab(RH_num))
 
-           DO inu=1,2
+           DO inu=1,nbands
               IF (soluble) THEN
                  tau_ae2b_int(i,k,inu)= &
@@ -344,5 +335,6 @@
                       cg_aers_2bands(RH_num,inu,spsol))
 
-                 tau_ae(i,k,aerosol_name(m),inu) = mass_temp(i,k,spsol)*1000.*zdp1(i,k)*delt*tau_ae2b_int(i,k,inu)*fac
+                 tau_ae(i,k,aerosol_name(m),inu) = &
+                    mass_temp(i,k,spsol)*1000.*zdp1(i,k)*delt*tau_ae2b_int(i,k,inu)*fac
 
               ELSE
@@ -351,5 +343,6 @@
                  cg_ae2b_int(i,k,inu) = cg_aeri_2bands(inu,spinsol) 
 
-                 tau_ae(i,k,aerosol_name(m),inu) = mass_temp(i,k,5+ spinsol)*1000.*zdp1(i,k)*delt*tau_ae2b_int(i,k,inu)*fac
+                 tau_ae(i,k,aerosol_name(m),inu) = &
+                    mass_temp(i,k,5+ spinsol)*1000.*zdp1(i,k)*delt*tau_ae2b_int(i,k,inu)*fac
               ENDIF
 
@@ -365,6 +358,6 @@
 
 
-  DO inu=1, 2
-     DO mrfspecies=1,9
+  DO inu=1, nbands
+     DO mrfspecies=1,naero_grp
         DO k=1, KLEV
            DO i=1, KLON
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_5wv.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_5wv.F90	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aeropt_5wv.F90	(revision 1181)
@@ -4,7 +4,9 @@
    pdel, m_allaer, delt, &
    RHcl, ai, flag_aerosol, &
-   pplay, t_seri)
+   pplay, t_seri, &
+   tausum, tau)
 
   USE DIMPHY
+  USE aerosol_mod
 
   !
@@ -50,19 +52,21 @@
   REAL, DIMENSION(klon,klev), INTENT(in)   :: pdel
   REAL, INTENT(in)                         :: delt
-  REAL, DIMENSION(klon,klev,8), INTENT(in) :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_spc), INTENT(in) :: m_allaer
   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
-
   !
   ! Output arguments:
   !
-  REAL, DIMENSION(klon), INTENT(out)       :: ai      ! POLDER aerosol index 
+  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
+
 
   !
   ! Local
   !
-  INTEGER, PARAMETER :: las = 5
+  INTEGER, PARAMETER :: las = nwave
   LOGICAL :: soluble
   
@@ -92,14 +96,4 @@
   REAL, PARAMETER ::  gravit = 9.80616    ! m2/s
   INTEGER, ALLOCATABLE, DIMENSION(:)  :: aerosol_name
-  INTEGER, PARAMETER :: id_SSSSM    = 1
-  INTEGER, PARAMETER :: id_CSSSM    = 2
-  INTEGER, PARAMETER :: id_ASSSM    = 3
-  INTEGER, PARAMETER :: id_ASBCM    = 4
-  INTEGER, PARAMETER :: id_ASPOMM   = 5
-  INTEGER, PARAMETER :: id_ASSO4M   = 6
-  INTEGER, PARAMETER :: id_CSSO4M   = 7
-  INTEGER, PARAMETER :: id_CIDUSTM  = 8
-  INTEGER, PARAMETER :: id_AIBCM    = 9
-  INTEGER, PARAMETER :: id_AIPOMM   = 10
   INTEGER :: nb_aer
   
@@ -118,7 +112,5 @@
   REAL :: piz_aeri_5wv(las,nbinsol_compaer)           ! Insoluble comp. 1- Dust: 2- BC; 3- POM
 
-  REAL, ALLOCATABLE :: TAUSUM(:,:,:)     ! Aerosol optical thickness per species
-  REAL, ALLOCATABLE :: TAU(:,:,:,:)     ! Aerosol optical thickness per species
-  REAL, DIMENSION(klon,klev,8) :: mass_temp
+  REAL, DIMENSION(klon,klev,naero_spc) :: mass_temp
   
   !
@@ -330,4 +322,11 @@
      0.972, 0.963, 0.943, 0.923, 0.897/
 
+  ! Initialisations
+  ai(:) = 0.
+  tau_ae5wv_int(:,:,:) = 0.
+  piz_ae5wv_int(:,:,:) = 0.
+  cg_ae5wv_int(:,:,:)  = 0.
+  tausum(:,:,:) = 0.
+  tau(:,:,:,:)  = 0.
 
 
@@ -344,47 +343,41 @@
 
 
-
   IF (flag_aerosol .EQ. 1) THEN 
-      nb_aer = 1
-      ALLOCATE (aerosol_name(nb_aer)) 
-      aerosol_name(1) = id_ASSO4M
+     nb_aer = 1
+     ALLOCATE (aerosol_name(nb_aer)) 
+     aerosol_name(1) = id_ASSO4M
   ELSEIF (flag_aerosol .EQ. 2) THEN
-      nb_aer = 2
-      ALLOCATE (aerosol_name(nb_aer)) 
-      aerosol_name(1) = id_ASBCM
-      aerosol_name(2) = id_AIBCM
+     nb_aer = 2
+     ALLOCATE (aerosol_name(nb_aer)) 
+     aerosol_name(1) = id_ASBCM
+     aerosol_name(2) = id_AIBCM
   ELSEIF (flag_aerosol .EQ. 3) THEN 
-      nb_aer = 2
-      ALLOCATE (aerosol_name(nb_aer)) 
-      aerosol_name(1) = id_ASPOMM
-      aerosol_name(2) = id_AIPOMM
+     nb_aer = 2
+     ALLOCATE (aerosol_name(nb_aer)) 
+     aerosol_name(1) = id_ASPOMM
+     aerosol_name(2) = id_AIPOMM
   ELSEIF (flag_aerosol .EQ. 4) THEN 
-      nb_aer = 5
-      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
+     nb_aer = 3
+     ALLOCATE (aerosol_name(nb_aer)) 
+     aerosol_name(1) = id_CSSSM
+     aerosol_name(2) = id_SSSSM
+     aerosol_name(3) = id_ASSSM
   ELSEIF (flag_aerosol .EQ. 5) THEN 
-      nb_aer = 4
-      ALLOCATE (aerosol_name(nb_aer)) 
-      aerosol_name(1) = id_ASBCM
-      aerosol_name(2) = id_AIBCM
-      aerosol_name(3) = id_ASPOMM
-      aerosol_name(4) = id_AIPOMM
+     nb_aer = 1
+     ALLOCATE (aerosol_name(nb_aer)) 
+     aerosol_name(1) = id_CIDUSTM
   ELSEIF (flag_aerosol .EQ. 6) THEN 
-      nb_aer = 3
-      ALLOCATE (aerosol_name(nb_aer)) 
-      aerosol_name(1) = id_ASSO4M      
-      aerosol_name(2) = id_ASPOMM
-      aerosol_name(3) = id_AIPOMM
+     nb_aer = 9
+     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
   ENDIF
-      
-  ALLOCATE (tausum(klon,las,nb_aer))
-  ALLOCATE (tau(klon,klev,las,nb_aer))
-
-
-
 
   ! 
@@ -395,17 +388,10 @@
   !      compute optical_thickness_at_gridpoint_per_species
   
-  ai(:)=0.
-  
-  tau_ae5wv_int(:,:,:)=0.
-  piz_ae5wv_int(:,:,:)=0.
-  cg_ae5wv_int(:,:,:)=0.
-  tausum(:,:,:)=0.
-  
-  tau(:,:,:,:)=0.
+
   !
   ! Calculations that need to be done since we are not in the subroutines INCA
   !      
   ! air mass auxiliary  variable --> zdp1 [kg/(m^2 *s)]
-  zdp1=pdel/(gravit*delt) 
+  zdp1=pdel(:,:)/(gravit*delt) 
   
   DO m=1,nb_aer   ! tau is only computed for each mass
@@ -491,25 +477,39 @@
         ENDDO     ! Boucle sur les points géographiques (grille horizontale)
       ENDDO     ! Boucle sur les niveaux verticaux
+
+      IF (soluble) THEN
+
+          tau(:,:,la,spsol)=tau3d(:,:)
       
-      tau(:,:,la,m)=tau3d(:,:)
+          DO k=1, KLEV
+            DO i=1,KLON
+              tausum(i,la,spsol)=tausum(i,la,spsol)+tau3d(i,k)
+            ENDDO
+          ENDDO
+      ELSE
+          tau(:,:,la,spsol)=tau3d(:,:)
       
-      DO k=1, KLEV
-        DO i=1,KLON
-          tausum(i,la,m)=tausum(i,la,m)+tau3d(i,k)
-        ENDDO
-      ENDDO
-      
+          DO k=1, KLEV
+            DO i=1,KLON
+              tausum(i,la,5+spinsol)=tausum(i,la,5+spinsol)+tau3d(i,k)
+            ENDDO
+          ENDDO
+      ENDIF
+
+
+
     ENDDO   ! boucle sur les longueurs d'onde
   ENDDO     ! Boucle  sur les masses de traceurs
-
-
-  taue670(:) = SUM(tausum(:,la670,:),dim=2) 
-  taue865(:) = SUM(tausum(:,la865,:),dim=2) 
-
-  DO i=1, klon
-    ai(i)=-LOG(MAX(taue670(i),0.0001)/ &
-       MAX(taue865(i),0.0001))/LOG(670./865.)
-  ENDDO
-
+!
+!
+!  taue670(:) = SUM(tausum(:,la670,:),dim=2) 
+!  taue865(:) = SUM(tausum(:,la865,:),dim=2) 
+!
+!  DO i=1, klon
+!    ai(i)=-LOG(MAX(taue670(i),0.0001)/ &
+!       MAX(taue865(i),0.0001))/LOG(670./865.)
+!  ENDDO
+
+  DEALLOCATE(aerosol_name) 
   
 END SUBROUTINE AEROPT_5WV
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aerosol_mod.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aerosol_mod.F90	(revision 1181)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/aerosol_mod.F90	(revision 1181)
@@ -0,0 +1,63 @@
+! $Id$
+!
+MODULE aerosol_mod
+  ! Declaration des indices pour les aerosols 
+
+  ! Total number of aerosols
+  INTEGER, PARAMETER :: naero_tot = 10 
+
+  ! Identification number used in aeropt_2bands and aeropt_5wv
+  ! corresponding to naero_tot
+  INTEGER, PARAMETER :: id_SSSSM    = 1
+  INTEGER, PARAMETER :: id_CSSSM    = 2
+  INTEGER, PARAMETER :: id_ASSSM    = 3
+  INTEGER, PARAMETER :: id_ASBCM    = 4
+  INTEGER, PARAMETER :: id_ASPOMM   = 5
+  INTEGER, PARAMETER :: id_ASSO4M   = 6
+  INTEGER, PARAMETER :: id_CSSO4M   = 7
+  INTEGER, PARAMETER :: id_CIDUSTM  = 8
+  INTEGER, PARAMETER :: id_AIBCM    = 9
+  INTEGER, PARAMETER :: id_AIPOMM   = 10
+
+  ! Total number of aerosols actually used in LMDZ 
+  ! 1 =  SSSSM || CSSSM
+  ! 2 =  ASSSM
+  ! 3 =  ASBCM
+  ! 4 =  ASPOMM
+  ! 5 =  ASSO4M || CSSO4M   
+  ! 6 =  CIDUSTM
+  ! 7 =  AIBCM
+  ! 8 =  AIPOMM
+  INTEGER, PARAMETER :: naero_spc = 8 
+
+  ! Corresponding names for the aerosols
+  CHARACTER(len=7),DIMENSION(naero_spc) :: name_aero=(/&
+       "CSSSM  ", &
+       "ASSSM  ", &
+       "ASBCM  ", &
+       "ASPOMM ", &
+       "SO4    ", &
+       "CIDUSTM", &
+       "AIBCM  ", &
+       "AIPOMM " /)
+
+  ! Number of aerosol groups
+  ! 1 = ZERO    
+  ! 2 = AER total    
+  ! 3 = NAT    
+  ! 4 = BC    
+  ! 5 = SO4    
+  ! 6 = POM    
+  ! 7 = DUST    
+  ! 8 = SS    
+  ! 9 = NO3    
+  INTEGER, PARAMETER :: naero_grp = 9 
+
+  ! Number of  wavelengths
+  INTEGER, PARAMETER :: nwave = 5
+
+  ! Number of modes spectral bands
+  INTEGER, parameter :: nbands = 2
+
+
+END MODULE aerosol_mod
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90	(revision 1181)
@@ -259,7 +259,7 @@
 ! - flag_aerosol=2 => bc  only 
 ! - flag_aerosol=3 => pom only
-! - flag_aerosol=4 => all aerosol 
-! - flag_aerosol=5 => bcpom
-! - flag_aerosol=6 => pomsulf
+! - flag_aerosol=4 => seasalt only 
+! - flag_aerosol=5 => dust only
+! - flag_aerosol=6 => all aerosol
 
   flag_aerosol_omp = 1
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_local_var_mod.F90	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_local_var_mod.F90	(revision 1181)
@@ -3,4 +3,6 @@
 !
       MODULE phys_local_var_mod
+
+        USE aerosol_mod
 ! Variables locales pour effectuer les appels en serie
 !======================================================================
@@ -81,4 +83,9 @@
       REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:) ! pas utilise, eventuellment pour diag
       !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
+      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:) 
+      !$OMP THREADPRIVATE(tausum_aero) 
+      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:) 
+      !$OMP THREADPRIVATE(tau3d_aero) 
+
 CONTAINS
 
@@ -115,7 +122,9 @@
       allocate(topswai_aero(klon), solswai_aero(klon))
       allocate(topswad0_aero(klon), solswad0_aero(klon))
-      allocate(topsw_aero(klon,9), solsw_aero(klon,9))
-      allocate(topsw0_aero(klon,9), solsw0_aero(klon,9))
+      allocate(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
+      allocate(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
       allocate(d_u_hin(klon,klev),d_v_hin(klon,klev),d_t_hin(klon,klev))
+      allocate(tausum_aero(klon,nwave,naero_spc))
+      allocate(tau3d_aero(klon,klev,nwave,naero_spc)) 
 
 END SUBROUTINE phys_local_var_init
@@ -154,4 +163,6 @@
       deallocate(topsw_aero,solsw_aero)
       deallocate(topsw0_aero,solsw0_aero)
+      deallocate(tausum_aero) 
+      deallocate(tau3d_aero) 
       deallocate(d_u_hin,d_v_hin,d_t_hin)
 
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_state_var_mod.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_state_var_mod.F90	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_state_var_mod.F90	(revision 1181)
@@ -284,4 +284,5 @@
 SUBROUTINE phys_state_var_init
 use dimphy
+use aerosol_mod
 IMPLICIT NONE
 #include "indicesol.h"
@@ -381,6 +382,6 @@
       ALLOCATE(topswad(klon), solswad(klon))
       ALLOCATE(topswai(klon), solswai(klon))
-      ALLOCATE(tau_aero(klon,klev,9,2),piz_aero(klon,klev,9,2),cg_aero(klon,klev,9,2))
-      ALLOCATE(ccm(klon,klev,2))
+      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
+      ALLOCATE(ccm(klon,klev,nbands))
 
 END SUBROUTINE phys_state_var_init
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F	(revision 1181)
@@ -1064,5 +1064,5 @@
 
       ! Aerosol optical properties
-      CHARACTER*4, DIMENSION(9)      :: rfname 
+      CHARACTER*4, DIMENSION(naero_grp) :: rfname 
       REAL, DIMENSION(klon)          :: aerindex     ! POLDER aerosol index
       REAL, DIMENSION(klon,klev)     :: mass_ins_aero! total mass concentration for all indissoluble aerosols[ug/m3]
@@ -2639,5 +2639,6 @@
      &        pplay, paprs, t_seri, rhcl, 
      &        mass_ins_aero, mass_ins_aero_pi, 
-     &        tau_aero, piz_aero, cg_aero )
+     &        tau_aero, piz_aero, cg_aero, 
+     &        tausum_aero, tau3d_aero)
       ELSE
          tau_aero(:,:,:,:) = 0.
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol_interp.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol_interp.F90	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol_interp.F90	(revision 1181)
@@ -16,4 +16,5 @@
   USE mod_phys_lmdz_para, ONLY : mpi_rank  
   USE readaerosol_mod
+  USE aerosol_mod, ONLY : naero_spc, name_aero
   USE write_field_phy
 
@@ -49,7 +50,4 @@
   INTEGER, SAVE                   :: klev_src    ! Number of vertical levles in source field
 !$OMP THREADPRIVATE(klev_src)
-  INTEGER, PARAMETER              :: nb_aero=8
-
-  CHARACTER(len=7),DIMENSION(nb_aero)   :: name_aero
 
   REAL, DIMENSION(klon)             :: psurf_day, pi_psurf_day
@@ -77,5 +75,5 @@
   LOGICAL            :: lnewday      ! Indicates if first time step at a new day
   LOGICAL,SAVE       :: vert_interp  ! Indicates if vertical interpolation will be done
-  LOGICAL,SAVE       :: debug=.TRUE. ! Debugging in this subroutine
+  LOGICAL,SAVE       :: debug=.FALSE.! Debugging in this subroutine
 !$OMP THREADPRIVATE(vert_interp, debug)
 
@@ -85,13 +83,4 @@
 !
 !****************************************************************************************
-! Variable containing aerosols name
-  name_aero(1) = "SSSSM  "
-  name_aero(2) = "ASSSM  "
-  name_aero(3) = "ASBCM  "
-  name_aero(4) = "ASPOMM "
-  name_aero(5) = "SO4    "
-  name_aero(6) = "CIDUSTM"
-  name_aero(7) = "AIBCM  "
-  name_aero(8) = "AIPOMM "
 
 ! Calculation to find if it is a new day
@@ -106,13 +95,13 @@
 
   IF (.NOT. ALLOCATED(var_day)) THEN
-     ALLOCATE( var_day(klon, klev, nb_aero), stat=ierr)
+     ALLOCATE( var_day(klon, klev, naero_spc), stat=ierr)
      IF (ierr /= 0) CALL abort_gcm('readaerosol_interp', 'pb in allocation 1',1)
-     ALLOCATE( pi_var_day(klon, klev, nb_aero), stat=ierr)
+     ALLOCATE( pi_var_day(klon, klev, naero_spc), stat=ierr)
      IF (ierr /= 0) CALL abort_gcm('readaerosol_interp', 'pb in allocation 2',1)
 
-     ALLOCATE( psurf_year(klon, 12, nb_aero), pi_psurf_year(klon, 12, nb_aero), stat=ierr)
+     ALLOCATE( psurf_year(klon, 12, naero_spc), pi_psurf_year(klon, 12, naero_spc), stat=ierr)
      IF (ierr /= 0) CALL abort_gcm('readaerosol_interp', 'pb in allocation 3',1)
 
-     ALLOCATE( load_year(klon, 12, nb_aero), pi_load_year(klon, 12, nb_aero), stat=ierr)
+     ALLOCATE( load_year(klon, 12, naero_spc), pi_load_year(klon, 12, naero_spc), stat=ierr)
      IF (ierr /= 0) CALL abort_gcm('readaerosol_interp', 'pb in allocation 4',1)
 
@@ -136,5 +125,5 @@
           psurf_year(:,:,id_aero), load_year(:,:,id_aero))
      IF (.NOT. ALLOCATED(var_year)) THEN
-        ALLOCATE(var_year(klon, klev_src, 12, nb_aero), stat=ierr)
+        ALLOCATE(var_year(klon, klev_src, 12, naero_spc), stat=ierr)
         IF (ierr /= 0) CALL abort_gcm('readaerosol_interp', 'pb in allocation 5',1)
      END IF
@@ -154,5 +143,5 @@
 
      IF (.NOT. ALLOCATED(pi_var_year)) THEN
-        ALLOCATE(pi_var_year(klon, klev_src, 12, nb_aero), stat=ierr)
+        ALLOCATE(pi_var_year(klon, klev_src, 12, naero_spc), stat=ierr)
         IF (ierr /= 0) CALL abort_gcm('readaerosol_interp', 'pb in allocation 6',1)
      END IF
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol_optic.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol_optic.F90	(revision 1180)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/readaerosol_optic.F90	(revision 1181)
@@ -4,5 +4,6 @@
      pplay, paprs, t_seri, rhcl, &
      mass_ins_aero, mass_ins_aero_pi, &
-     tau_aero, piz_aero, cg_aero )
+     tau_aero, piz_aero, cg_aero, &
+     tausum_aero, tau3d_aero )
 
 ! This routine will :
@@ -12,4 +13,5 @@
   
   USE dimphy
+  USE aerosol_mod
   IMPLICIT NONE
 
@@ -30,12 +32,13 @@
   REAL, DIMENSION(klon,klev), INTENT(OUT)     :: mass_ins_aero    ! Total mass for all indissoluble aerosols
   REAL, DIMENSION(klon,klev), INTENT(OUT)     :: mass_ins_aero_pi !     -"-     preindustrial values
-  REAL, DIMENSION(klon,klev,9,2), INTENT(OUT) :: tau_aero    ! Aerosol optical thickness
-  REAL, DIMENSION(klon,klev,9,2), INTENT(OUT) :: piz_aero    ! Single scattering albedo aerosol
-  REAL, DIMENSION(klon,klev,9,2), INTENT(OUT) :: cg_aero     ! asymmetry parameter aerosol
+  REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(OUT) :: tau_aero    ! Aerosol optical thickness
+  REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(OUT) :: piz_aero    ! Single scattering albedo aerosol
+  REAL, DIMENSION(klon,klev,naero_grp,nbands), 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
 
 ! Local variables
 !****************************************************************************************
   REAL, DIMENSION(klon)        :: aerindex ! POLDER aerosol index 
-  REAL, DIMENSION(klon,10)     :: fractnat_allaer
   REAL, DIMENSION(klon,klev)   :: sulfate  ! SO4 aerosol concentration [ug/m3]
   REAL, DIMENSION(klon,klev)   :: bcsol    ! BC soluble concentration [ug/m3]
@@ -43,4 +46,8 @@
   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
   REAL, DIMENSION(klon,klev)   :: bcsol_pi
@@ -48,6 +55,11 @@
   REAL, DIMENSION(klon,klev)   :: pomsol_pi
   REAL, DIMENSION(klon,klev)   :: pomins_pi
+  REAL, DIMENSION(klon,klev)   :: cidust_pi
+  REAL, DIMENSION(klon,klev)   :: sscoarse_pi
+  REAL, DIMENSION(klon,klev)   :: sssupco_pi
+  REAL, DIMENSION(klon,klev)   :: ssacu_pi
   REAL, DIMENSION(klon,klev)   :: pdel
-  REAL, DIMENSION(klon,klev,8) :: m_allaer
+  REAL, DIMENSION(klon,klev,naero_spc) :: m_allaer
+  REAL, DIMENSION(klon,naero_tot)      :: fractnat_allaer
 
   INTEGER :: k, i
@@ -59,5 +71,4 @@
 ! Read and interpolate sulfate
   IF ( flag_aerosol .EQ. 1 .OR. &
-       flag_aerosol .EQ. 4 .OR. &
        flag_aerosol .EQ. 6 ) THEN 
 
@@ -69,6 +80,5 @@
 ! Read and interpolate bcsol and bcins
   IF ( flag_aerosol .EQ. 2 .OR. &
-       flag_aerosol .EQ. 4 .OR. &
-       flag_aerosol .EQ. 5 ) THEN 
+       flag_aerosol .EQ. 6 ) THEN 
 
      ! Get bc aerosol distribution 
@@ -83,6 +93,4 @@
 ! Read and interpolate pomsol and pomins
   IF ( flag_aerosol .EQ. 3 .OR. &
-       flag_aerosol .EQ. 4 .OR. &
-       flag_aerosol .EQ. 5 .OR. &
        flag_aerosol .EQ. 6 ) THEN
 
@@ -95,17 +103,35 @@
 
 
+! Read and interpolate csssm, ssssm, assssm
+  IF (flag_aerosol .EQ. 4 .OR. &
+      flag_aerosol .EQ. 6 ) THEN 
+
+      CALL readaerosol_interp(1 ,rjourvrai, debut, pplay, paprs, sscoarse,sscoarse_pi) 
+      CALL readaerosol_interp(2 ,rjourvrai, debut, pplay, paprs, ssacu, ssacu_pi) 
+
+  ELSE
+     sscoarse(:,:) = 0. ; sscoarse_pi(:,:) = 0. 
+     ssacu(:,:) = 0.    ; ssacu_pi(:,:) = 0. 
+  ENDIF
+
+! Read and interpolate cidustm
+  IF (flag_aerosol .EQ. 5 .OR.  &
+      flag_aerosol .EQ. 6 ) THEN 
+
+      CALL readaerosol_interp(6 , rjourvrai, debut, pplay, paprs, cidust, cidust_pi) 
+
+  ELSE
+      cidust(:,:) = 0. ; cidust_pi(:,:) = 0. 
+  ENDIF
+
+!
 ! Store all aerosols in one variable
 !
-! ACo pour couplage aerosol offline 07/04/2009
-! Tableau contenant les masses pour tous les aerosols 
-! les valeurs a zero seront a remplacer par les bons
-! tableaux lorsque les routines de lectures seront
-! ajoutees. 
-  m_allaer(:,:,1) = 0.                ! SSSSM || CSSSM ! Coarse Soluble Sea Salt Mass
-  m_allaer(:,:,2) = 0.                ! ASSSM
+  m_allaer(:,:,1) = sscoarse(:,:)     ! SSSSM || CSSSM
+  m_allaer(:,:,2) = ssacu(:,:)        ! ASSSM
   m_allaer(:,:,3) = bcsol(:,:)        ! ASBCM
   m_allaer(:,:,4) = pomsol(:,:)       ! ASPOMM
   m_allaer(:,:,5) = sulfate(:,:)      ! ASSO4M || CSSO4M   
-  m_allaer(:,:,6) = 0.                ! CIDUSTM        ! Coarse Insoluble DUST Mass
+  m_allaer(:,:,6) = cidust(:,:)       ! CIDUSTM
   m_allaer(:,:,7) = bcins(:,:)        ! AIBCM
   m_allaer(:,:,8) = pomins(:,:)       ! AIPOMM
@@ -114,6 +140,8 @@
 ! Calculate the total mass of all indissoluble aersosols
 !
-  mass_ins_aero(:,:)    = sulfate(:,:)    + bcsol(:,:)    + pomsol(:,:) 
-  mass_ins_aero_pi(:,:) = sulfate_pi(:,:) + bcsol_pi(:,:) + pomsol_pi(:,:) 
+  mass_ins_aero(:,:)    = sulfate(:,:)    + bcsol(:,:)    + pomsol(:,:)    + &
+       sscoarse(:,:)   + ssacu(:,:)    + cidust(:,:) 
+  mass_ins_aero_pi(:,:) = sulfate_pi(:,:) + bcsol_pi(:,:) + pomsol_pi(:,:) + &
+       sscoarse_pi(:,:) + ssacu_pi(:,:) + cidust_pi(:,:) 
 
 !****************************************************************************************
@@ -137,10 +165,9 @@
      
      ! aeropt_5wv only for validation and diagnostics.
-     ! In this version no diagnostics are set. 
-     ! jg : may be desactivated if no diagnostics added.
      CALL aeropt_5wv( &
           pdel, m_allaer, &
           pdtphys, rhcl, aerindex, & 
-          flag_aerosol, pplay, t_seri)
+          flag_aerosol, pplay, t_seri, &
+          tausum_aero, tau3d_aero)
   ELSE
 
