Index: LMDZ5/branches/testing/libf/phylmd/aeropt_2bands.F90
===================================================================
--- LMDZ5/branches/testing/libf/phylmd/aeropt_2bands.F90	(revision 2056)
+++ LMDZ5/branches/testing/libf/phylmd/aeropt_2bands.F90	(revision 2160)
@@ -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,35 +944,45 @@
         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))/ &
-                      (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,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    
         ENDDO 
@@ -983,41 +993,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 +1037,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,13 +1053,15 @@
         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))/ &
-                      (tau_allaer(i,k,mrfspecies,inu)*piz_allaer(i,k,mrfspecies,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
         ENDDO
@@ -1059,12 +1071,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 +1087,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 +1098,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
