Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/aeropt_spl.F
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/aeropt_spl.F	(revision 2196)
+++ LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/aeropt_spl.F	(revision 2217)
@@ -50,5 +50,5 @@
       PARAMETER (rh_int=12)
       REAL auxreal
-c      REAL ss_a(nb_lambda,rh_int,nbtr-1)
+c      REAL ss_a(nb_lambda,int,nbtr-1)
 c      DATA ss_a/72*1./
       REAL ss_dust(nb_lambda), ss_acc550(rh_int), alpha_acc
@@ -90,6 +90,11 @@
 c
       IF (ok_chimeredust) THEN 
-      ss_dust=(/0.5167768,0.5684330,0.6531643/)
-      ss_dustsco=(/0.1003391,0.1012288,0.1024651/)
+!JE20150212<< : changes in ustar in dustmod changes emission distribution
+!      ss_dust=(/0.5167768,0.5684330,0.6531643/)
+!      ss_dustsco=(/0.1003391,0.1012288,0.1024651/)
+      ss_dust=(/0.4670522, 0.5077308, 0.5745184/)
+      ss_dustsco=(/0.099858, 0.1007395, 0.1019673/)
+!JE20150212>>
+
       ELSE
       ss_dust=(/0.564, 0.614, 0.700/)
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/aeropt_spl_F_20140902
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/aeropt_spl_F_20140902	(revision 2196)
+++ 	(revision )
@@ -1,189 +1,0 @@
-      SUBROUTINE aeropt_spl(zdz, tr_seri, RHcl,
-     .              id_prec, id_fine, id_coss, id_codu, id_scdu,
-     .                      ztaue550,ztaue670,ztaue865,
-     .                      taue550_tr2,taue670_tr2,taue865_tr2,
-     .                      taue550_ss,taue670_ss,taue865_ss,
-     .                      taue550_dust,taue670_dust,taue865_dust,
-     .             taue550_dustsco,taue670_dustsco,taue865_dustsco)
-c
-      USE dimphy
-      USE infotrac
-      IMPLICIT none
-c
-#include "chem.h"
-#include "dimensions.h"
-c #include "dimphy.h"
-#include "YOMCST.h"
-c
-c Arguments:
-c
-c======================== INPUT ==================================      
-      REAL zdz(klon,klev)
-      REAL tr_seri(klon,klev,nbtr) ! masse of tracer 
-      REAL RHcl(klon,klev)     ! humidite relativen ciel clair
-      INTEGER  id_prec, id_fine, id_coss, id_codu, id_scdu
-c============================== OUTPUT =================================
-      REAL ztaue550(klon) ! epaisseur optique aerosol 550 nm
-      REAL ztaue670(klon) ! epaisseur optique aerosol 670 nm
-      REAL ztaue865(klon) ! epaisseur optique aerosol 865 nm
-      REAL taue550_tr2(klon) ! epaisseur optique aerosol 550 nm, diagnostic
-      REAL taue670_tr2(klon) ! epaisseur optique aerosol 670 nm, diagnostic
-      REAL taue865_tr2(klon) ! epaisseur optique aerosol 865 nm, diagnostic
-      REAL taue550_ss(klon) ! epaisseur optique aerosol 550 nm, diagnostic
-      REAL taue670_ss(klon) ! epaisseur optique aerosol 670 nm, diagnostic
-      REAL taue865_ss(klon) ! epaisseur optique aerosol 865 nm, diagnostic
-      REAL taue550_dust(klon) ! epaisseur optique aerosol 550 nm, diagnostic
-      REAL taue670_dust(klon) ! epaisseur optique aerosol 670 nm, diagnostic
-      REAL taue865_dust(klon) ! epaisseur optique aerosol 865 nm, diagnostic
-      REAL taue550_dustsco(klon) ! epaisseur optique aerosol 550 nm, diagnostic
-      REAL taue670_dustsco(klon) ! epaisseur optique aerosol 670 nm, diagnostic
-      REAL taue865_dustsco(klon) ! epaisseur optique aerosol 865 nm, diagnostic
-c===================== LOCAL VARIABLES ===========================      
-      INTEGER nb_lambda,nbre_RH
-      PARAMETER (nb_lambda=3,nbre_RH=12)
-      INTEGER i, k, RH_num
-      REAL rh, RH_MAX, DELTA, RH_tab(nbre_RH)
-      PARAMETER (RH_MAX=95.)
-      INTEGER rh_int
-      PARAMETER (rh_int=12)
-c      REAL ss_a(nb_lambda,rh_int,nbtr-1)
-c      DATA ss_a/72*1./
-      REAL ss_dust(nb_lambda), ss_acc550(rh_int), alpha_acc
-      REAL ss_dustsco(nb_lambda)
-      REAL ss_acc670(rh_int), ss_acc865(rh_int)
-      REAL ss_ssalt550(rh_int)
-      REAL ss_ssalt670(rh_int), ss_ssalt865(rh_int)
-      REAL burden_ss(klon)
-      DATA ss_acc550 /3.135,3.135,3.135, 3.135, 4.260, 4.807,
-     .                5.546,6.651,8.641,10.335,13.534,22.979/
-      DATA ss_acc670 /2.220,2.220,2.220, 2.220, 3.048, 3.460,
-     .                4.023,4.873,6.426, 7.761,10.322,18.079/
-      DATA ss_acc865 /1.329,1.329,1.329, 1.329, 1.855, 2.124,
-     .                2.494,3.060,4.114, 5.033, 6.831,12.457/  
-!old4tracers      DATA ss_dust/0.564, 0.614, 0.700/ !for bin 0.5-10um
-!      DATA ss_dust/0.553117, 0.610185, 0.7053460 / !for bin 0.5-3um radius
-!      DATA ss_dustsco/0.1014, 0.102156, 0.1035538 / !for bin 3-15um radius
-      DATA ss_dust/0.5345737, 0.5878828, 0.6772957/ !for bin 0.5-3um radius
-      DATA ss_dustsco/0.1009634, 0.1018700, 0.1031178/ !for bin 3-15um radius
-      DATA ss_ssalt550/0.182,0.182,0.182,0.182,0.366,0.430,
-     .                 0.484,0.551,0.648,0.724,0.847,1.218/ !for bin 0.5-20 um, fit_v2
-      DATA ss_ssalt670/0.193,0.193,0.193,0.193,0.377,0.431,
-     .                 0.496,0.587,0.693,0.784,0.925,1.257/ !for bin 0.5-20 um
-      DATA ss_ssalt865/0.188,0.188,0.188,0.188,0.384,0.443,
-     .                 0.502,0.580,0.699,0.799,0.979,1.404/ !for bin 0.5-20 um
-
-      DATA RH_tab/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./
-c
-      DO i=1, klon
-        ztaue550(i)=0.0
-        ztaue670(i)=0.0
-        ztaue865(i)=0.0
-        taue550_tr2(i)=0.0
-        taue670_tr2(i)=0.0
-        taue865_tr2(i)=0.0
-        taue550_ss(i)=0.0
-        taue670_ss(i)=0.0
-        taue865_ss(i)=0.0
-        taue550_dust(i)=0.0
-        taue670_dust(i)=0.0
-        taue865_dust(i)=0.0
-        taue550_dustsco(i)=0.0
-        taue670_dustsco(i)=0.0
-        taue865_dustsco(i)=0.0
-        burden_ss(i)=0.0
-      ENDDO
-
-      DO k=1, klev
-      DO i=1, klon
-c
-      rh=MIN(RHcl(i,k)*100.,RH_MAX)
-      RH_num = INT( rh/10. + 1.)
-      IF (rh.gt.85.) RH_num=10
-      IF (rh.gt.90.) RH_num=11
-c      IF (rh.gt.40.) THEN 
-c          RH_num=5   ! Added by NHL temporarily
-c          print *,'TEMPORARY CASE'
-c      ENDIF
-      DELTA=(rh-RH_tab(RH_num))/(RH_tab(RH_num+1)-RH_tab(RH_num))
-
-
-c*******************************************************************
-c                       AOD at 550 NM
-c*******************************************************************
-        alpha_acc=ss_acc550(RH_num) + DELTA*(ss_acc550(RH_num+1)-
-     .            ss_acc550(RH_num))              !--m2/g
-cnhl_test TOTAL AOD
-        ztaue550(i)=ztaue550(i)+(alpha_acc*tr_seri(i,k,id_fine)+
-     .                 ss_ssalt550(RH_num)*tr_seri(i,k,id_coss)+
-     .                 ss_dust(1)*tr_seri(i,k,id_codu)+
-     .              ss_dustsco(1)*tr_seri(i,k,id_scdu)  )*zdz(i,k)*1.e6
-cnhl_test TOTAL AOD IS NOW AOD COARSE MODE ONLY
-cnhl_test        ztaue550(i)=ztaue550(i)+(                     
-cnhl_test     .                 ss_ssalt550(RH_num)*tr_seri(i,k,3)+
-cnhl_test     .                 ss_dust(1)*tr_seri(i,k,4))*zdz(i,k)*1.e6
-
-        taue550_tr2(i)=taue550_tr2(i)+alpha_acc*tr_seri(i,k,id_fine)*
-     .                 zdz(i,k)*1.e6
-        taue550_ss(i)=taue550_ss(i)+
-     .                ss_ssalt550(RH_num)*tr_seri(i,k,id_coss)*
-     .                zdz(i,k)*1.e6
-        taue550_dust(i)=taue550_dust(i)+ss_dust(1)*tr_seri(i,k,id_codu)*
-     .                zdz(i,k)*1.e6
-        taue550_dustsco(i)=taue550_dustsco(i)+
-     .                ss_dustsco(1)*tr_seri(i,k,id_scdu)*
-     .                zdz(i,k)*1.e6
-!        print *,'taue550_ss = ',SUM(taue550_ss),MINVAL(taue550_ss),
-!     .                                          MAXVAL(taue550_ss)
-
-c*******************************************************************
-c                       AOD at 670 NM
-c*******************************************************************
-        alpha_acc=ss_acc670(RH_num) + DELTA*(ss_acc670(RH_num+1)-
-     .            ss_acc670(RH_num))              !--m2/g
-        ztaue670(i)=ztaue670(i)+(alpha_acc*tr_seri(i,k,id_fine)+
-     .                 ss_ssalt670(RH_num)*tr_seri(i,k,id_coss)+
-     .                 ss_dust(2)*tr_seri(i,k,id_codu)+
-     .               ss_dustsco(2)*tr_seri(i,k,id_scdu))*zdz(i,k)*1.e6
-        taue670_tr2(i)=taue670_tr2(i)+alpha_acc*tr_seri(i,k,id_fine)*
-     .                 zdz(i,k)*1.e6
-        taue670_ss(i)=taue670_ss(i)+
-     .                ss_ssalt670(RH_num)*tr_seri(i,k,id_coss)*
-     .                zdz(i,k)*1.e6
-        taue670_dust(i)=taue670_dust(i)+ss_dust(2)*tr_seri(i,k,id_codu)*
-     .                zdz(i,k)*1.e6
-        taue670_dustsco(i)=taue550_dustsco(i)+
-     .                ss_dustsco(2)*tr_seri(i,k,id_scdu)*
-     .                zdz(i,k)*1.e6
-
-c*******************************************************************
-c                       AOD at 865 NM
-c*******************************************************************
-        alpha_acc=ss_acc865(RH_num) + DELTA*(ss_acc865(RH_num+1)-
-     .            ss_acc865(RH_num))              !--m2/g
-        ztaue865(i)=ztaue865(i)+(alpha_acc*tr_seri(i,k,id_fine)+
-     .                 ss_ssalt865(RH_num)*tr_seri(i,k,id_coss)+
-     .                 ss_dust(3)*tr_seri(i,k,id_codu)+
-     .               ss_dustsco(3)*tr_seri(i,k,id_scdu))*zdz(i,k)*1.e6
-        taue865_tr2(i)=taue865_tr2(i)+alpha_acc*tr_seri(i,k,id_fine)*
-     .                 zdz(i,k)*1.e6
-        taue865_ss(i)=taue865_ss(i)+
-     .                ss_ssalt865(RH_num)*tr_seri(i,k,id_coss)*
-     .                zdz(i,k)*1.e6
-        taue865_dust(i)=taue865_dust(i)+ss_dust(3)*tr_seri(i,k,id_codu)*
-     .                zdz(i,k)*1.e6
-        taue865_dustsco(i)=taue550_dustsco(i)+
-     .                ss_dustsco(3)*tr_seri(i,k,id_scdu)*
-     .                zdz(i,k)*1.e6
-
-
-c
-       burden_ss(i)=burden_ss(i)+tr_seri(i,k,id_coss)*1.e6*1.e3*zdz(i,k)
-      ENDDO            !-loop on klev
-      ENDDO            !-loop on klon
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                          MAXVAL(tr_seri(:,:,3))
-!      print *,'taue550_ss = ',SUM(taue550_ss),MINVAL(taue550_ss),
-!     .                                        MAXVAL(taue550_ss)
-c
-      RETURN
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/dustemission_mod.F90
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/dustemission_mod.F90	(revision 2196)
+++ LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/dustemission_mod.F90	(revision 2217)
@@ -6,4 +6,6 @@
 !  INTEGER, PARAMETER     :: nbins=800  ! number of aerosol bins: for spla
 !  INTEGER, PARAMETER     :: nbins=8000  ! number of aerosol bins: for spla
+  
+  INTEGER, PARAMETER     :: flag_feff=1 ! 0: deactivate feff (drag partition scheme)
   INTEGER, PARAMETER     :: nbins=800  ! number of aerosol bins: for spla
   INTEGER, PARAMETER     :: nmode=3   ! number of soil-dust modes 
@@ -30,5 +32,4 @@
 !  real   , parameter :: e2=3.52/div2
 !  real   , parameter :: e3=3.46/div3
-!  real   , parameter :: factorflux=10.
 !  real   , parameter :: rop=2.65 ! particle density g/m3
 !  real   , parameter :: roa=0.001227  ! air density g/m3
@@ -46,5 +47,4 @@
   real   , parameter :: e2=3.52/div2
   real   , parameter :: e3=3.46/div3
-  real   , parameter :: factorflux=1.
   real   , parameter :: rop=2.65 ! particle density g/m3
   real   , parameter :: roa=0.001227  ! air density g/m3
@@ -53,5 +53,6 @@
 ! C=2.61 from Marticorena and Bergametti 1995 instead of Gillete and Chen 2001
 ! (recommended C=1.1  in supply-limited dust source area.. )
-  real   , parameter :: cd=2.61*roa/gravity
+   real   , parameter :: cd=2.61*roa/gravity
+!  real   , parameter :: cd=1.0*roa/gravity
 !JE20150202>>>>
   real,parameter     :: beta=16300.
@@ -286,5 +287,5 @@
   real,parameter :: sizescohigh=30.  ! in micrometers
 
-  real,parameter :: tunningfine=1.0  ! factor for fine bins!!! important!!
+  real,parameter :: tunningfactor=4.5  ! factor for fine bins!!! important!!
 !JE20140915  real,parameter :: sizeacclow=0.06
 !JE20140915  real,parameter :: sizeacchigh=1.0
@@ -316,5 +317,5 @@
    call abort_gcm('adaptdustemission', 'Dust range problem',1)
   endif
-  print *,'FINE DUST BIN: tunning EMISSION factor= ',tunningfine
+  print *,'ALL DUST BIN: tunning EMISSION factor= ',tunningfactor
   auxr1=9999.
   auxr2=9999.
@@ -394,13 +395,13 @@
    auxr1=auxr1+emisbinlocal(k,i)
   enddo
-  emdustacc(k)= auxr1*tunningfine
+  emdustacc(k)= auxr1*tunningfactor
   do i=imincoalow,imincoahigh-1
     auxr2=auxr2+emisbinlocal(k,i)
   enddo
-  emdustcoa(k)=auxr2
+  emdustcoa(k)=auxr2*tunningfactor
   do i=iminscolow,iminscohigh-1
     auxr3=auxr3+emisbinlocal(k,i)
   enddo
-  emdustsco(k)=auxr3
+  emdustsco(k)=auxr3*tunningfactor
 enddo
 
@@ -822,4 +823,16 @@
           enddo
         enddo
+! JE20150120<<
+  if (flag_feff .eq. 0) then
+    print *,'JE_dbg FORCED deactivated feff'
+    do i=1,klon
+      do k=1,ntyp
+        feff(i,k)=1.
+      enddo
+    enddo
+  endif
+! JE20150120>>
+
+
 if (1==1) then
 !  !  CALL writefield_phy("AA",tmp1(1:klon,1:5),5)
@@ -1062,6 +1075,6 @@
   REAL :: pdfcum,U10mMOD,pdfu,weilambda
   REAL :: z0salt,ceff,cerod,cpcent
-!JE20150202  !REAL :: cdnms,ustarns,modwm,utmin
-  REAL :: cdnms,ustarns,modwm
+  REAL :: cdnms,ustarns,modwm,utmin
+!JE20150202   REAL :: cdnms,ustarns,modwm
   REAL :: fdp1,fdp2,ad1,ad2,ad3,flux_diam
   REAL :: dfec1,dfec2,dfec3,t1,t2,t3,p1,p2,p3,dec,ec
@@ -1259,17 +1272,11 @@
              ENDDO !n=1,ntyp
 70 CONTINUE
-!factorflux
         fluxdust(i,1)=fluxdust(i,1)+flux1*probu(kwb)
         fluxdust(i,2)=fluxdust(i,2)+flux2*probu(kwb)
         fluxdust(i,3)=fluxdust(i,3)+flux3*probu(kwb)
    ENDDO !kwb=1,nwb
-!JE20150202 <<
-!      m1dflux(i)=10.*fluxdust(i,1)
-!      m2dflux(i)=10.*fluxdust(i,2)          ! tous en Kg/m2/s
-!      m3dflux(i)=10.*fluxdust(i,3)
-      m1dflux(i)=factorflux*10.*fluxdust(i,1)
-      m2dflux(i)=factorflux*10.*fluxdust(i,2)          ! tous en Kg/m2/s
-      m3dflux(i)=factorflux*10.*fluxdust(i,3)
-!JE20150202 >>
+      m1dflux(i)=10.*fluxdust(i,1)
+      m2dflux(i)=10.*fluxdust(i,2)          ! tous en Kg/m2/s
+      m3dflux(i)=10.*fluxdust(i,3)
 
 
@@ -1285,6 +1292,5 @@
     DO j=1,nbins
 !JE20150202 <<
-!    emisbin(k,j) = emisbin(k,j)+10*fluxdust(k,i)*massfrac(i,j)  
-    emisbin(k,j) = emisbin(k,j)+factorflux*fluxdust(k,i)*massfrac(i,j)  
+    emisbin(k,j) = emisbin(k,j)+10*fluxdust(k,i)*massfrac(i,j)  
 !JE20150202 >>
     ENDDO !j, nbind
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/dustemission_mod_F90_bck
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/dustemission_mod_F90_bck	(revision 2196)
+++ 	(revision )
@@ -1,1274 +1,0 @@
-MODULE dustemission_mod
-
-  !Parameters   
-!  INTEGER, PARAMETER     :: nbins=12  ! number of aerosol bins: original 
-!  INTEGER, PARAMETER     :: nbins=800  ! number of aerosol bins: for spla
-  INTEGER, PARAMETER     :: nbins=8000  ! number of aerosol bins: for spla
-  INTEGER, PARAMETER     :: nmode=3   ! number of soil-dust modes 
-  INTEGER, PARAMETER     :: ntyp=5   ! number of soil types 
-  INTEGER, PARAMETER     :: nwb=12   ! number of points for the 10m wind
-! speed weibull distribution (>=2)
-  real   ,parameter     :: z10m=1000. !10m in cm
-  REAL,PARAMETER         :: kref=3. !weibull parameter
-  INTEGER, PARAMETER    :: nats=14 !number of mineral types (14 here for sand,
-                                   ! silt, clay etc.)
-  integer, parameter :: nclass=200000
-
-
-  real   , parameter :: dmin=0.0001
-  real   , parameter :: dmax=0.2
-  integer, parameter :: nspe=nmode*3+1
-  integer, parameter :: div1=3.
-  integer, parameter :: div2=3.
-  integer, parameter :: div3=3.
-
-  real   ,parameter     :: vkarm=0.41
-  real   , parameter :: e1=3.61/div1
-  real   , parameter :: e2=3.52/div2
-  real   , parameter :: e3=3.46/div3
-  real   , parameter :: rop=2.65 ! particle density g/m3
-  real   , parameter :: roa=0.001227  ! air density g/m3
-  real   , parameter :: pi=3.14159  !!
-  real   , parameter :: gravity=981. !! cm!!
-  real   , parameter :: cd=1.*roa/gravity
-  real,parameter     :: beta=16300.
-  real, parameter, dimension(3) :: diam=(/1.5,6.7,14.2/)
-  INTEGER, PARAMETER     :: ndistb=3
-  real, parameter, dimension(3) :: sig=(/1.7,1.6,1.5/)
-
-!   INTEGER, PARAMETER     :: nbinsHR=3000 !original
-   INTEGER, PARAMETER     :: nbinsHR=30000
-!min and max dust size in um
-      REAL, PARAMETER     :: sizedustmin=0.0599 ! for spla
-      REAL, PARAMETER     :: sizedustmax=63.
-!      REAL, PARAMETER     :: sizedustmin=0.09  ! original
-!      REAL, PARAMETER     :: sizedustmax=63.
-
-
-  ! Calc variables
-  REAL,DIMENSION(:,:), ALLOCATABLE,SAVE  :: massfrac
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: binsHR
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: binsHRcm
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: itv
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: sizedust !size dust bin (in um)
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: szdcm !the same but (in cm)
-
-  !soil inputs from file donnees_lisa.nc . Should be in the same grid as the
-  !model (regridded with nearest neighborhood from surfnew.nc)
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: sol
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: P
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: zos
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: z01
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: z02
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: D
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: A
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: solspe
-  INTEGER,DIMENSION(:,:),ALLOCATABLE,SAVE :: masklisa
-!!!  INTEGER,DIMENSION(:),ALLOCATABLE,SAVE :: maskdust
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: feff
-
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: size 
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: size2 
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: uth
-  REAL,DIMENSION(:),  ALLOCATABLE,SAVE :: uth2
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: srel
-  REAL,DIMENSION(:,:),  ALLOCATABLE,SAVE :: srel2
-
-  INTEGER :: nat ! SOL data inside the loop (use as soil type index?)
-  REAL :: ustarsalt 
-  REAL :: var3a,var3b
-  INTEGER  :: ns,nd,nsi,npi,ni ! counters
-  INTEGER :: ncl
-
-!$OMP THREADPRIVATE(massfrac) 
-!$OMP THREADPRIVATE(binsHR) 
-!$OMP THREADPRIVATE(binsHRcm) 
-!$OMP THREADPRIVATE(itv) 
-!$OMP THREADPRIVATE(sizedust) 
-!$OMP THREADPRIVATE(szdcm) 
-!$OMP THREADPRIVATE(sol) 
-!$OMP THREADPRIVATE(P) 
-!$OMP THREADPRIVATE(zos) 
-!$OMP THREADPRIVATE(z01) 
-!$OMP THREADPRIVATE(z02) 
-!$OMP THREADPRIVATE(D) 
-!$OMP THREADPRIVATE(A) 
-!$OMP THREADPRIVATE(solspe) 
-!$OMP THREADPRIVATE(masklisa) 
-!!!! $OMP THREADPRIVATE(maskdust) 
-!$OMP THREADPRIVATE(feff) 
-!$OMP THREADPRIVATE(size) 
-!$OMP THREADPRIVATE(size2) 
-!$OMP THREADPRIVATE(uth) 
-!$OMP THREADPRIVATE(uth2) 
-!$OMP THREADPRIVATE(srel) 
-!$OMP THREADPRIVATE(srel2) 
-
-
-
-  CONTAINS
-
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
-  SUBROUTINE dustemission( debutphy, xlat, xlon, &    !Input
-                          pctsrf,zu10m,zv10m,wstar, & !Input
-                          ale_bl,ale_wake, &          !Input
-                          emdustacc,emdustcoa,emdustsco,maskdust)    !Output
-  USE dimphy
-  USE infotrac
-  USE write_field_phy
-
-  IMPLICIT NONE
-  ! input :
-  ! output: flux_sparam_ddfine,flux_sparam_ddcoa,
-  ! first: 
-  ! Model grid parameters
-  REAL,DIMENSION(klon),     INTENT(IN)     :: xlat
-  REAL,DIMENSION(klon),     INTENT(IN)     :: xlon
-  REAL,DIMENSION(klon),     INTENT(IN)     :: pctsrf
-  REAL,DIMENSION(klon),INTENT(IN)          :: zu10m   ! 10m zonal wind
-  REAL,DIMENSION(klon),INTENT(IN)          :: zv10m   ! meridional 10m wind
-  REAL,DIMENSION(klon),INTENT(IN)          :: wstar
-  REAL,DIMENSION(klon),INTENT(IN)          :: ale_bl
-  REAL,DIMENSION(klon),INTENT(IN)          :: ale_wake
-  
-  LOGICAL  :: debutphy ! First physiqs run or not
-  ! Intermediate variable: 12 bins emissions
-  REAL,DIMENSION(:,:), ALLOCATABLE,SAVE  :: emisbinloc ! vertical emission fluxes
-  !$OMP THREADPRIVATE(emisbinloc)
-  !OUT variables
-  REAL,DIMENSION(klon)  :: emdustacc,emdustcoa,emdustsco ! emission in spla dust bins:
-! old radio : acc=0.03-0.5 micrometers, ccoa:0.5-10 micrometers
-! new acc=0.03-0.5 micrometers, coa:0.5-3 micrometers ,sco:3-15 um
-  INTEGER,DIMENSION(klon) :: maskdust ! where the emissions were calculated
-!!!!!!$OMP THREADPRIVATE(maskdust)
-
-
-  IF (debutphy) THEN
-  ALLOCATE( emisbinloc(klon,nbins) )
-  ENDIF
-
-  IF( debutphy ) THEN  
-     CALL initdust(xlat,xlon,pctsrf)
-  ENDIF
-
-  CALL  calcdustemission(debutphy,zu10m,zv10m,wstar,ale_bl,ale_wake,emisbinloc)
-
-  CALL makemask(maskdust)
-
-  IF( debutphy ) THEN  
-   CALL writefield_phy("maskdust",float(maskdust),1)
-  ENDIF
-
-  CALL adaptdustemission(debutphy,emisbinloc,emdustacc,emdustcoa,emdustsco)
-  ! output in kg/m2/s
-
-
-  END SUBROUTINE dustemission
-
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
- SUBROUTINE makemask(maskdustloc) 
-  USE dimphy
-  USE infotrac
-  IMPLICIT NONE
-  !Input
-  INTEGER,DIMENSION(klon) :: maskdustloc
-  INTEGER :: i,j,k
-  integer :: iaux
- 
-
-  do k=1,klon
-      maskdustloc(k)=0
-      do i=1,ntyp
-         if (masklisa(k,i)>0) then
-             maskdustloc(k)=1
-         endif
-      enddo
-  enddo
-
-  END SUBROUTINE makemask
-
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
- SUBROUTINE adaptdustemission(debutphy,emisbinlocal, &
-                               emdustacc,emdustcoa,emdustsco)
-
-  USE dimphy
-  USE infotrac
-  USE write_field_phy
-  IMPLICIT NONE
-  !Input
-  REAL,DIMENSION(klon) :: emdustacc,emdustcoa,emdustsco
-  REAL, DIMENSION(klon,nbins) :: emisbinlocal
-  ! Local
-  INTEGER  :: i,j,k
-!!!  INTEGER,DIMENSION(2) :: iminacclow,iminacchigh,imincoalow,imincoahigh ! in
-!case of small nbins.... not ready
-  INTEGER,SAVE ::iminacclow,iminacchigh,imincoalow
-  INTEGER,SAVE ::imincoahigh,iminscohigh,iminscolow
-!  real,parameter :: sizeacclow=0.03
-!  real,parameter :: sizeacchigh=0.5
-!  real,parameter :: sizecoalow=0.5
-!  real,parameter :: sizecoahigh=10.  ! in micrometers
-  real,parameter :: sizeacclow=0.06
-  real,parameter :: sizeacchigh=1.0
-  real,parameter :: sizecoalow=1.0
-  real,parameter :: sizecoahigh=6.  !20 ! diameter in micrometers
-  real,parameter :: sizescolow=6.
-  real,parameter :: sizescohigh=30.  ! in micrometers
-
-  logical ::  debutphy
-  real :: diff, auxr1,auxr2,auxr3,auxr4
-  real,dimension(klon,nbins) :: itvmean
-  real,dimension(klon,nbins+1) :: itv2
-  integer, save :: counter,counter1 !dbg
-  REAL, DIMENSION(:,:),ALLOCATABLE,SAVE :: emisbinlocalmean,emisbinlocalmean2 !dbg
-  logical :: writeaerosoldistrib
-!$OMP THREADPRIVATE(iminacclow,iminacchigh,imincoalow)
-!$OMP THREADPRIVATE(imincoahigh,iminscohigh,iminscolow)
-!$OMP THREADPRIVATE(emisbinlocalmean,emisbinlocalmean2)
-!$OMP THREADPRIVATE(counter,counter1)
-
-writeaerosoldistrib=.true.
-if (debutphy) then
-
-  if (sizedustmin>sizeacclow .or. sizedustmax<sizescohigh) then 
-   call abort_gcm('adaptdustemission', 'Dust range problem',1)
-  endif
-
-  auxr1=9999.
-  auxr2=9999.
-  auxr3=9999.
-  auxr4=9999.
-  do i=1,nbins+1
-   if (abs(sizeacclow-itv(i))<auxr1) then
-          auxr1=abs( sizeacclow-itv(i))
-          iminacclow=i
-   endif
-   if (abs(sizeacchigh-itv(i))<auxr2) then
-          auxr2=abs( sizeacchigh-itv(i))
-          iminacchigh=i
-          imincoalow=i
-   endif
-   if (abs(sizecoahigh-itv(i))<auxr3) then
-          auxr3=abs( sizecoahigh-itv(i))
-          imincoahigh=i
-          iminscolow=i
-   endif
-   if (abs(sizescohigh-itv(i))<auxr4) then
-          auxr4=abs( sizescohigh-itv(i))
-          iminscohigh=i
-   endif
-  enddo
-if (writeaerosoldistrib) then
-!JEdbg<<
-  do j=1,klon
-  do i=1,nbins
-    itvmean(j,i)=(itv(i)+itv(i+1))/2.
-    itv2(j,i)=itv(i)
-    !print*, itv(i),itvmean(i),itv(i+1)
-    !print*, sizedust(i)
-  enddo
-  itv2(j,nbins+1)=itv(nbins+1)
-  enddo
-  CALL writefield_phy("itv2",itv2,nbins+1)
-  CALL writefield_phy("itvmean",itvmean,nbins)
-
-  ALLOCATE(emisbinlocalmean(klon,nbins))
-  ALLOCATE(emisbinlocalmean2(klon,nbins))
-  do i=1,nbins
-    do j=1,klon
-       emisbinlocalmean(j,i)=0.0
-       emisbinlocalmean2(j,i)=0.0
-    enddo
-  enddo
-  counter=1
-  counter1=0
-!JEdbg>>
-endif
-endif
-
-
-!print *,'JE'
-!print *,iminacclow,iminacchigh,imincoalow,imincoahigh
-
-! estimate and integrate bins into only accumulation and coarse
-
-
-do k=1,klon
-auxr1=0.0
-auxr2=0.0
-auxr3=0.0
-  do i=iminacclow,iminacchigh-1
-   auxr1=auxr1+emisbinlocal(k,i)
-  enddo
-  emdustacc(k)= auxr1
-  do i=imincoalow,imincoahigh-1
-    auxr2=auxr2+emisbinlocal(k,i)
-  enddo
-  emdustcoa(k)=auxr2
-  do i=iminscolow,iminscohigh-1
-    auxr3=auxr3+emisbinlocal(k,i)
-  enddo
-  emdustsco(k)=auxr3
-enddo
-
-!JEdbg<<
-if (writeaerosoldistrib) then
-  do i=1,nbins
-    do j=1,klon
-        emisbinlocalmean(j,i)=emisbinlocalmean(j,i)+emisbinlocal(j,i)
-    enddo 
-  enddo
-counter1=counter1+1
-! 4 timesteps of physics=4*15min=1hour..
-! 1440 = 15 days
-! 480 = 5 days
-if (MOD(counter,1440).eq. 0) THEN
-   !if (MOD(counter,480).eq. 0) THEN
-   do k = 1,klon
-   do i=1,nbins
-     emisbinlocalmean2(k,i)=emisbinlocalmean(k,i)/float(counter1)
-   enddo
-   enddo
-   counter1=0
-   CALL writefield_phy("emisbinlocalmean2",emisbinlocalmean2,nbins)
-   do i=1,nbins
-     do j=1,klon
-        emisbinlocalmean(j,i)=0.0
-     enddo
-   enddo
-endif
-counter=counter+1
-endif
-!JEdbg>>
-
-!CALL abort_gcm('calcdustemission', 'OK1',1)
- 
- END SUBROUTINE adaptdustemission
-
-
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
-
-!--------------------------------------------------------
-  SUBROUTINE initdust(xlat,xlon,pctsrf)
-  USE dimphy
-  USE infotrac
-  USE write_field_phy
-
-  IMPLICIT NONE
-  !Inputs
-  REAL,DIMENSION(klon),     INTENT(IN)     :: xlat
-  REAL,DIMENSION(klon),     INTENT(IN)     :: xlon
-  REAL,DIMENSION(klon),     INTENT(IN)     :: pctsrf
-
-  !Local
-  REAL,DIMENSION(klon,ntyp)                :: solini
-  REAL,DIMENSION(klon,ntyp)                :: Pini
-  REAL,DIMENSION(klon,ntyp)                :: zosini
-  REAL,DIMENSION(klon,ntyp)                :: z01ini
-  REAL,DIMENSION(klon,ntyp)                :: z02ini
-  REAL,DIMENSION(klon,ntyp)                :: Dini
-  REAL,DIMENSION(klon,ntyp)                :: Aini
-
-  REAL,DIMENSION(nclass)                   :: newstep
-
- !TEMPORAL/ MAKE MASK!!!
-  REAL, PARAMETER        :: longmin=-20.
-  REAL, PARAMETER        :: longmax=77.          !35.  
-  REAL, PARAMETER        :: latmin=10.
-  REAL, PARAMETER        :: latmax=40.
- !TEMPORAL/ MAKE MASK!!!
-  !Local
-  REAL, PARAMETER        :: eps=1.e-5
-  REAL, PARAMETER        :: aeff=0.35
-  REAL, PARAMETER        :: xeff=10.
-  REAL, PARAMETER        :: trctunt=0.310723
- 
-  INTEGER     :: i,j,k,nts
-  REAL :: dp,dstep
-  REAL :: aa,bb,cc,dd,ee
-  REAL,DIMENSION(klon,ntyp) :: tmp1
-  REAL :: p3t,var1,var2,et
-
-! Parametres pour le calcul de la surface couverte par les particule de diametre
-! dp srel(nats,nclass)
-  REAL :: stotale,su,su_loc,xk,xl,xm,xn
-  REAL,DIMENSION(nclass)                   :: subsoildist
-
-! isolog and massfrac calcs
-  INTEGER :: nbinsout,nb,miniso,nbins1,nbins2,istart,no
-  REAL :: b1,b2,stepbin,minisograd,exden,d2min,d2max,numin,numax
-  REAL                   :: delta1,delta2,ldmd
-!  REAL, PARAMETER     :: sizedustmin=0.09
-  REAL,DIMENSION(nbinsHR):: binsISOGRAD
-  REAL,DIMENSION(nbinsHR):: vdISOGRAD
-  REAL,DIMENSION(nbinsHR):: logvdISOGRAD
-  REAL                   :: curvd
-  REAL                   :: avdhr
-  REAL                   :: bvdhr
-  REAL,DIMENSION(nbins)  :: dmn1
-  REAL,DIMENSION(nbins)  :: dmn2
-  REAL,DIMENSION(nbins)  :: dmn3
-  REAL,DIMENSION(nbinsHR)                  :: vdHR
-  REAL,DIMENSION(nbinsHR)  :: vdout
-
-
-
-! Parametres pour le calcul de la vitesse de friction seuil uth(nclass)
-! calcul de la vitesse seuil selon la parametrisation de Shao and Lu
-! 2000(icuth=1).
-!  INTEGER                :: ich1
-  REAL                   :: an
-  REAL                   :: gam
-  REAL                   :: sigshao
-  REAL                   :: x1
-  REAL                   :: x2
-
-
-  CHARACTER(LEN=10) :: varname
-  CHARACTER(LEN=80) :: fnsolspe
-  CHARACTER(LEN=200) :: line
-  
-
-! nats: number of mineral types (14 here for sand, silt, clay etc.)
-    ALLOCATE( binsHR(nbinsHR) )
-    ALLOCATE( binsHRcm(nbinsHR) )
-    ALLOCATE( itv(nbins+1) )
-    ALLOCATE( sizedust(nbins) )
-    ALLOCATE( szdcm(nbins) )
-    ALLOCATE( massfrac(ndistb,nbins) )
-    ALLOCATE( sol(klon,ntyp) )
-    ALLOCATE( P(klon,ntyp) )
-    ALLOCATE( zos(klon,ntyp) )
-    ALLOCATE( z01(klon,ntyp) )
-    ALLOCATE( z02(klon,ntyp) )
-    ALLOCATE( D(klon,ntyp) )
-    ALLOCATE( A(klon,ntyp) )
-    ALLOCATE( masklisa(klon,ntyp) )
-    ALLOCATE( solspe(nats,nspe) )
-    ALLOCATE( feff(klon,ntyp) ) 
-    ALLOCATE( size(nclass) )
-    ALLOCATE( size2(nclass) )
-    ALLOCATE( uth(nclass) )
-    ALLOCATE( uth2(nclass) )
-    ALLOCATE( srel(nats,nclass) )
-    ALLOCATE( srel2(nats,nclass) )
-
-  ! read input data from donnees_lisa.nc
-  varname='SOL'
-  CALL read_surface(varname,solini)
-  varname='P'
-  CALL read_surface(varname,Pini)
-  varname='ZOS_'
-  CALL read_surface(varname,zosini)
-  varname='ZO1_'
-  CALL read_surface(varname,z01ini)
-  varname='ZO2_'
-  CALL read_surface(varname,z02ini)
-  varname='D'
-  CALL read_surface(varname,Dini)
-  varname='A'
-  CALL read_surface(varname,Aini)
-
-
-  CALL writefield_phy("SOLinit",solini,5)
-  CALL writefield_phy("Pinit",Pini,5)
-  CALL writefield_phy("ZOSinit",zosini,5)
-  CALL writefield_phy("ZO1init",z01ini,5)
-  CALL writefield_phy("ZO2init",z02ini,5)
-  CALL writefield_phy("Dinit",Dini,5)
-  CALL writefield_phy("Ainit",Aini,5)
-
-
-  DO i=1,klon
-    DO nts=1,ntyp
-        masklisa(i,nts)=0
-        IF(Pini(i,nts)>=0.) THEN
-               masklisa(i,nts)=1
-        ENDIF 
-    ENDDO
-  ENDDO
-  DO i=1,klon
-    !print *,Pini(i,1),Pini(i,2),Pini(i,3),Pini(i,4),Pini(i,5)
-    DO nts=1,ntyp
-      !IF(xlon(i).ge.longmin.and.xlon(i).le.longmax.and. &
-      !&      xlat(i).ge.latmin.and.xlat(i).le.latmax    &
-      !&      .and.pctsrf(i)>0.5.and.Pini(i,nts)>0.)THEN
-      IF(pctsrf(i)>0.5.and.Pini(i,nts)>0.)THEN
-          
-           sol(i,nts) = solini(i,nts)
-             P(i,nts) = Pini(i,nts)
-           zos(i,nts) = zosini(i,nts)
-           z01(i,nts) = z01ini(i,nts)
-           z02(i,nts) = z02ini(i,nts)
-             D(i,nts) = Dini(i,nts)
-             A(i,nts) = Aini(i,nts)
-!             masklisa(i,nts)=1
-      ELSE
-              sol(i,nts) =0.0
-               P(i,nts)  =0.0
-              zos(i,nts) =0.0
-              z01(i,nts) =0.0
-              z02(i,nts) =0.0
-               D(i,nts)  =0.0
-               A(i,nts)  =0.0
-!            masklisa(i,nts)=0
-      ENDIF
-    ENDDO
-  ENDDO
-
-if ( 1==1 ) then
-   CALL writefield_phy("SOL",sol,5)
-   CALL writefield_phy("P",P,5)
-   CALL writefield_phy("ZOS",zos,5)
-   CALL writefield_phy("ZO1",z01,5)
-   CALL writefield_phy("ZO2",z02,5)
-   CALL writefield_phy("D",D,5)
-   CALL writefield_phy("A",A,5)
-   CALL writefield_phy("masklisa",float(masklisa),5)
-   CALL writefield_phy("pctsrf",pctsrf,1)
-   CALL writefield_phy("xlon",xlon,1)
-   CALL writefield_phy("xlat",xlat,1)
-endif
-
-  !CALL abort_gcm('initdustemission', 'OK1',1)
-
-! Lecture des donnees du LISA indiquant le type de sol utilise.
-       ! in lines: landuse
-! nats: number of mineral types (14 here for sand, silt, clay etc.)
-! data format in columns
-! mmd1  sigma1  p1  mmd2  sigma2  p2 mmd3 ... alpha
-
- fnsolspe='SOILSPEC.data'
-  PRINT*,'  o Reading ',fnsolspe(1:40)
-  OPEN(10,file=fnsolspe)
-  READ(10,*)line
-  DO i=1,nats
-     READ(10,*)line
-     READ(10,*)(solspe(i,j),j=1,nspe)
-!JE     alfa(i)=solspe(i,10)
-!     PRINT*,'i,alfa(i)',i,alfa(i)
-!     WRITE(18,*)i,alfa(i)
-  END DO
-!     print*,'solspe(14,10)= ',solspe(14,10)
-  CLOSE(10)
-
-      dstep=0.0005
-      dp=dmin
-      do i=1,nclass
-         dp=dp*exp(dstep)
-         size(i)=dp
-         if(dp.ge.dmax+eps)goto 30
-         newstep(i)=dstep
-        ! WRITE(18,*)i,size(i)
-      enddo
-30   continue
-      print*,'IK5'
-      ncl=i-1
-      print*,'   soil size classes used   ',ncl,' / ',nclass
-      print*,'   soil size min: ',size(1),' soil size max: ',size(ncl)
-      if(ncl.gt.nclass)stop
-
-! 1: Shao and Lu 2000
-            an=0.0123
-            gam=0.3
-            do i=1,ncl
-               sigshao=rop/roa
-               x1=sigshao*gravity*size(i)
-               x2=gam/(roa*size(i))
-               uth(i)=sqrt(an*(x1+x2))
-            enddo
-
-!Calcul de la surface couverte par les particules de diametre dp
-!srel(nats,nclass)
-
-!  OPEN(18,file='srel.dat',form='formatted',access='sequential')
-  DO ns=1,nats
-     stotale=0.
-     DO i=1,ncl
-        su=0.
-        DO j=1,nmode
-           nd=((j-1)*3)+1
-           nsi=((j-1)*3)+2
-           npi=((j-1)*3)+3
-           IF (solspe(ns,nd).EQ.0.)THEN
-              su_loc=0.
-           ELSE
-              xk=solspe(ns,npi)/(sqrt(2.*pi)*log(solspe(ns,nsi)))
-              xl=((log(size(i))-log(solspe(ns,nd)))**2) &
-     &              /(2.*(log(solspe(ns,nsi)))**2)
-              xm=xk*exp(-xl)
-              xn=rop*(2./3.)*(size(i)/2.)
-              su_loc=xm*newstep(i)/xn
-           END IF
-           su=su+su_loc
-        END DO
-        subsoildist(i)=su
-        stotale=stotale+su
-     END DO
-     DO i=1,ncl
-        IF (subsoildist(i).gt.0..and.stotale.gt.0.)THEN
-            srel(ns,i)=subsoildist(i)/stotale
-
-        ELSE
-            srel(ns,i)=0.
-        END IF
-!        WRITE(18,*)i,srel(1,i)
-     END DO
-!     PRINT*,'ns , srel(10000) ',ns,srel(ns,10000)
-  END DO
-
-
-! Calcul de la repartition de l energie feff(klon,ntyp)
-
-  !efficient fraction for the friction velocities as a function
-  !of z0s, Zo1 et Zo2 to retrieve the apparent threshold
-  !wind friction velocity.
-      !    feff(:,:)=0.
-       do i=1,klon
-          do k=1,ntyp
-     !     print*,'IKKK ',i,klon,k,ntyp
-             if (zos(i,k).eq.0..or.z01(i,k).eq.0.) then
-     !       if (zos(i,k)<=0..or.z01(i,k)<=0.) then
-!              if (zos(i,k)<0..or.z01(i,k)<0.) then
-     !            print*,'INI DUST WARNING zos ou z01<0',zos(i,k),z01(i,k)
-!              endif
-              feff(i,k)=0.
- !         print*,'IKKK A ',i,klon,k,ntyp
-            else
-! drag partition betzeen the erodable surface and zo1
-     !     print*,'IKKK B0 ',i,klon,k,ntyp,z01(i,k),zos(i,k),xeff,aeff
-              aa=log(z01(i,k)/zos(i,k))
-              tmp1(i,k)=aa
-              bb=log(aeff*(xeff/zos(i,k))**0.8)
-              cc=1.-aa/bb
-       !   print*,'IKKK B1 ',i,klon,k,ntyp
-! drag partition between zo1 and zo2
-! feff: total efficient fraction
-              if(D(i,k).eq.0.)then
-                 feff(i,k)=cc
-   !       print*,'IKKK C ',i,klon,k,ntyp
-              else
-                 dd=log(z02(i,k)/z01(i,k))
-                 ee=log(aeff*(D(i,k)/z01(i,k))**0.8)
-                 feff(i,k)=(1.-dd/ee)*cc
-   !       print*,'IKKK D ',i,klon,k,ntyp
-              endif
-              if (feff(i,k).lt.0.)feff(i,k)=0.
-              if (feff(i,k).gt.1.)feff(i,k)=1.
-    !      print*,'IKKK E ',i,klon,k,ntyp
-            endif
-          enddo
-        enddo
-if (1==1) then
-  !  CALL writefield_phy("AA",tmp1(1:klon,1:5),5)
-    CALL writefield_phy("REPART5",feff(1:klon,1:5),5)
-endif
-
-
-!c---------------FOR def_prepag01modif(var3a,var3b)-----------------------
-        p3t=0.0001
-        var1=e3**(1./3.)
-        var2=(rop*pi)**(1./3.)
-        var3a=trctunt*var1/var2
-        et=e1+(sqrt(p3t*(e3*e3+e1*e2-e2*e3-e1*e3))/p3t)
-        var1=et**(1./3.)
-        var2=(rop*pi)**(1./3.)
-        var3b=trctunt*var1/var2
-
-! JE20140902: comment all isograd distributions and make own massfrac:
-
-
-!  if (.false.) then
-!!**************L718
-!
-!!c------------------------------------------------------------------------
-!! isolog distrib and massfrac calculations.
-!
-!      nbinsout=nbins+1
-!      b1=log(sizedustmin)
-!      b2=log(sizedustmax)
-!! restricted ISOLOG bins distributions
-!
-!!      step=(b2-b1)/(nbinsout-1)
-!!      DO ni=1,nbinsout
-!!         itv(ni)=exp(b1+(ni-1)*step)
-!!      ENDDO
-!!OPEN(18,file='vdepothrsizbin.dat',form='formatted',access='sequential')
-!! Restricted ISOGRADIENT bins distributions
-!!!!!!!Making HIGH RESOLUTION dust size distribution (in um)!!!!!!
-!  stepbin=(b2-b1)/(nbinsHR-1)
-!  DO nb=1,nbinsHR
-!     binsHR(nb)=exp(b1+(nb-1)*stepbin)
-!  END DO
-!
-!  DO nb=1,nbinsHR
-!     binsHRcm(nb)=binsHR(nb)*1.e-4
-!  END DO
-!! Making HIGH RESOLUTION dry deposition velocity
-!     CALL calcvd(vdout)
-!
-!
-! DO nb=1,nbinsHR
-!     vdHR(nb)=vdout(nb)
-!!  WRITE(18,*),binsHR(nb),vdHR(nb)
-!  END DO
-!
-!   !searching for minimum value of dry deposition velocity
-!  minisograd=1.e20
-!  DO nb=1,nbinsHR
-!     IF(vdHR(nb).le.minisograd)THEN
-!       minisograd=vdHR(nb)
-!       miniso=nb
-!     END IF
-!  END DO
-!
-!! searching for optimal number of bins in positive slope Vd part
-!
-!  nbins1=1
-!  nbins2=nbinsout-1
-!     DO k=1,1000
-!        delta1=abs(log(vdHR(1))-log(vdHR(miniso)) )/nbins1
-!        delta2=abs(log(vdHR(nbinsHR))-log(vdHR(miniso)))/(nbins2-1)
-!        IF(delta2.GE.delta1)THEN
-!        GOTO 50
-!
-!        ELSE
-!           nbins2=nbins2-1
-!           nbins1=nbins1+1
-!        END IF
-!        IF(nbins2.EQ.1)THEN
-!           PRINT*,'!! warning: lower limit was found: STOP'
-!           STOP
-!        END IF
-!     END DO
-! 50  CONTINUE
-!print*,'IK10'
-!! building the optimized distribution
-!  logvdISOGRAD(1)=log(vdHR(1))
-!  binsISOGRAD(1)=binsHR(1)
-!  DO k=2,nbins1
-!     logvdISOGRAD(k)=logvdISOGRAD(1)-(k-1)*delta1
-!  END DO
-!
-!  logvdISOGRAD(nbins1+1)=log(minisograd)
-!
-!  DO k=1,nbins2
-!     logvdISOGRAD(nbins1+1+k)=logvdISOGRAD(nbins1+1)+k*delta2
-!  END DO
-!
-!  DO k=1,nbinsout
-!     vdISOGRAD(k)=exp(logvdISOGRAD(k))
-!  END DO
-!! sequential search of the correspondig particle diameter
-!  istart=1
-!  DO k=2,nbinsout-1
-!     curvd=vdISOGRAD(k)
-!     DO nb=istart,nbinsHR
-!        avdhr=vdHR(nb)
-!        bvdhr=vdHR(nb+1)
-!        IF(nb.LT.(miniso-1).AND.curvd.LT.avdhr.AND. &
-!           curvd.GT.bvdhr)THEN
-!           binsISOGRAD(k)=binsHR(nb)
-!           istart=nb
-!           GOTO 60
-!        END IF
-!        IF(nb.eq.miniso)THEN
-!           binsISOGRAD(k)=binsHR(nb)
-!           istart=nb+1
-!           GOTO 60
-!        END IF
-!        IF(nb.GT.miniso.AND.curvd.GT.avdhr.AND. &
-!                              curvd.LT.bvdhr)THEN
-!           binsISOGRAD(k)=binsHR(nb)
-!           istart=nb
-!           GOTO 60
-!        END IF
-!     END DO
-! 60  CONTINUE
-!  END DO
-!print*,'IK11'
-!  binsISOGRAD(nbinsout)=binsHR(nbinsHR)
-!  vdISOGRAD(nbinsout)=vdHR(nbinsHR)
-!  DO nb=1,nbinsout
-!     itv(nb)=binsISOGRAD(nb)
-!  END DO
-!  end ! JE20140902 if false
-
-! Making dust size distribution (in um)
-!
-      nbinsout=nbins+1
-      b1=log(sizedustmin)
-      b2=log(sizedustmax)
-      stepbin=(b2-b1)/(nbinsout-1)
-     DO ni=1,nbinsout
-        itv(ni)=exp(b1+(ni-1)*stepbin)
-     ENDDO
-
-!  stepbin=(b2-b1)/(nbinsHR-1)
-!  DO nb=1,nbinsHR
-!     binsHR(nb)=exp(b1+(nb-1)*stepbin)
-!  END DO
-!
-!  DO nb=1,nbinsHR
-!     binsHRcm(nb)=binsHR(nb)*1.e-4
-!  END DO
-
-
-
-      DO nb=1,nbins
-         ldmd=(log(itv(nb+1))-log(itv(nb)))/2.
-         sizedust(nb)=exp(log(itv(nb))+ldmd)
-        PRINT*,nb, itv(nb),' < ',sizedust(nb),' < ',itv(nb+1)
-      ENDDO
-! Making dust size distribution (in cm) ???
-      DO nb=1,nbins
-         szdcm(nb)=sizedust(nb)*1.e-4
-      ENDDO
-!c preparation of emissions reaffectation.
-      OPEN (unit=15001, file='massfrac')
-      DO k=1,ndistb
-         exden=sqrt(2.)*log(sig(k))
-         DO nb=1,nbins
-            d2min=itv(nb)
-            d2max=itv(nb+1)
-            numin=log(d2min/diam(k))
-            numax=log(d2max/diam(k))
-            massfrac(k,nb)=0.5*(erf(numax/exden)-erf(numin/exden))
-            !print *,k,nb,massfrac(k,nb)
-           write(15001,*),k,nb,massfrac(k,nb)
-         ENDDO
-      ENDDO
-
- !CALL abort_gcm('calcdustemission', 'OK1',1)
-
-  !------------
-
-
-  END SUBROUTINE initdust
-
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
-  SUBROUTINE calcdustemission(debutphy,zu10m,zv10m,wstar, &
-                              ale_bl,ale_wake,emisbin)
-  ! emisions over 12 dust bin
-  USE dimphy
-  USE infotrac
-
-  IMPLICIT NONE
-  ! Input
-  LOGICAL, INTENT(IN)                   :: debutphy ! First physiqs run or not
-  REAL,DIMENSION(klon),INTENT(IN)          :: zu10m   ! 10m zonal wind
-  REAL,DIMENSION(klon),INTENT(IN)          :: zv10m   ! meridional 10m wind
-  REAL,DIMENSION(klon),INTENT(IN)          :: wstar   
-  REAL,DIMENSION(klon),INTENT(IN)          :: ale_bl
-  REAL,DIMENSION(klon),INTENT(IN)          :: ale_wake
-  
-  ! Local variables
-  INTEGER, PARAMETER :: flag_wstar=150
-  REAL,DIMENSION(:,:), ALLOCATABLE,SAVE :: fluxdust ! horizonal emission fluxes in UNITS for the nmod soil aerosol modes
-  REAL,DIMENSION(:), ALLOCATABLE,SAVE   :: wind10ms   ! 10m wind distribution in m/s
-  REAL,DIMENSION(:), ALLOCATABLE,SAVE   :: wind10cm   ! 10m wind distribution in cm/s
-  REAL,DIMENSION(klon)                  :: zwstar   
-  REAL,DIMENSION(nwb)                :: probu
-!  REAL, DIMENSION(nmode) :: fluxN,ftN,adN,fdpN,pN,eN ! in the original code N=1,2,3
-  REAL :: flux1,flux2,flux3,ft1,ft2,ft3
-
-
-  REAL, PARAMETER        :: umin=21.
-  REAL, PARAMETER        :: woff=0.5  ! min value of 10m wind speed accepted for emissions
-  REAL :: pdfcum,U10mMOD,pdfu
-  REAL :: z0salt,ceff,cerod,cpcent
-  REAL :: cdnms,ustarns,modwm,utmin
-  REAL :: fdp1,fdp2,ad1,ad2,ad3,flux_diam
-  REAL :: dfec1,dfec2,dfec3,t1,t2,t3,p1,p2,p3,dec,ec
-  ! auxiliar counters
-  INTEGER                               :: kwb
-  INTEGER                               :: i,j,k,l,n
-  INTEGER  :: kfin,ideb,ifin,kfin2,istep
-  ! Output
-  !REAL,DIMENSION(:,:), ALLOCATABLE,SAVE  :: emisbin ! vertical emission fluxes in UNITS for the 12 bins
-  REAL,DIMENSION(klon,nbins)  :: emisbin ! vertical emission fluxes in UNITS for the 12 bins
-!$OMP THREADPRIVATE(fluxdust) 
-!$OMP THREADPRIVATE(wind10ms) 
-!$OMP THREADPRIVATE(wind10cm) 
-
-  !----------------------------------------------------
-  ! initialization
-  !----------------------------------------------------
-  IF (debutphy) THEN
-!   ALLOCATE( emisbin(klon,nbins) )
-   ALLOCATE( fluxdust(klon,nmode) )
-   ALLOCATE( wind10ms(nwb) )
-   ALLOCATE( wind10cm(nwb) )
-  ENDIF !debutphy
-
-  
-  DO i=1,klon
-   DO j=1,nbins
-    emisbin(i,j)  = 0.0 
-   ENDDO !j,nbind
-   DO j=1,nmode
-    fluxdust(i,j) = 0.0
-   ENDDO !j,nmode
-  zwstar(i) = 0.0
-  ENDDO !i,klon
-  !----------------------------------------------------
-  ! calculations
-  !----------------------------------------------------
-
-  ! including BL processes..
-  zwstar=sqrt(2.*(ale_bl+0.01*(flag_wstar-100)*ale_wake))
-  ! 
-    DO i=1,klon  ! main loop
-     U10mMOD=MAX(woff,sqrt(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i)))
-     pdfcum=0.
-     ! Wind weibull distribution:
-
-           DO kwb=1,nwb
-                flux1=0.
-                flux2=0.
-                flux3=0.
-                IF(nwb.gt.1)THEN
-                   wind10ms(kwb)=kwb*2.*U10mMOD/nwb
-                   pdfu=(kref/U10mMOD)*(wind10ms(kwb)/U10mMOD)**(kref-1) &
-                      *exp(-(wind10ms(kwb)/U10mMOD)**kref)
-                   probu(kwb)=pdfu*2.*U10mMOD/nwb
-                   pdfcum=pdfcum+probu(kwb)
-                      IF(probu(kwb).le.1.e-2)GOTO 70
-                ELSE
-                   wind10ms(kwb)=U10mMOD
-                   probu(kwb)=1.
-                ENDIF
-             wind10cm(kwb)=wind10ms(kwb)*100.
-             DO n=1,ntyp
-                   ft1=0.
-                   ft2=0.
-                   ft3=0.
-
-!                  nat=int(sol(i,n))
-!                    print *,i,n
-                    IF(sol(i,n).gt.1..and.sol(i,n).lt.15.) nat=int(sol(i,n))
-!JE20140526<<
-!                    print *,'JE: WARNING: nat=0 forced to nat=99!! and doing nothing'
-                   IF(sol(i,n).lt.0.5) THEN
-                      nat=99
-                      GOTO 80
-                    ENDIF
-!JE20140526>>
- 
-
-                 !IF(n.eq.1.and.nat.eq.99)GOTO 80
-             !      if(n.eq.1) print*,'nat1=',nat,'sol1=',sol(i,n)
-                   IF(n.eq.1.and.nat.eq.99)GOTO 80
-                      z0salt=z02(i,n)
-                      ceff=feff(i,n)
-                      cerod=A(i,n)
-                      cpcent=P(i,n)
-                      ustarsalt=0.
-                   IF(ceff.le.0..or.z0salt.eq.0.)GOTO 80
-                   IF(cerod.eq.0.or.cpcent.eq.0.)GOTO 80
-! in cm: utmin, umin, z10m, z0salt, ustarns
-! in meters: modwm
-! no dimension for: cdnms
-! Cas ou wsta=0.
-                      cdnms=vkarm/(log(z10m/z0salt))
-                      modwm=sqrt((wind10ms(kwb)**2)+(1.2*zwstar(i))**2)
-!                      modwm=sqrt((wind10ms(kwb)**2)+(1.2*sqrt(ale_wake(i))
-!                      )**2)
-!                      modwm=sqrt((wind10ms(kwb)**2)+(1.2*sqrt(Ale_bl(i)) )**2)
-!                      modwm=sqrt((wind10ms(kwb)**2))
-                      ustarns=cdnms*modwm*100.
-                      utmin=umin/(cdnms*ceff)
-                   IF(wind10cm(kwb).ge.utmin)THEN
-                      ustarsalt=ustarns+  &
-                    (0.3*(wind10cm(kwb)/100.-utmin/100.)**2.)
-                   ELSE
-                      ustarsalt=ustarns
-                   ENDIF
-                   IF(ustarsalt.lt.umin/ceff)GOTO 80
-!                      print*,'ustarsalt = ',ustarsalt
-!----------------------------------------
-                    CALL def_copyncl(kfin)
-
-!                  CALL def_ag01(kfin,ft1,ft2,ft3)
-      do ni=1,kfin
-         fdp1=1.-(uth2(ni)/(ceff*ustarsalt))
-         if (fdp1.le.0..or.srel2(nat,ni).eq.0.) then
-            ad1=0.
-            ad2=0.
-            ad3=0.
-         else
-       
-            fdp2=(1.+(uth2(ni)/(ceff*ustarsalt)))**2.
-            flux_diam=cd*srel2(nat,ni)*fdp1*fdp2*(ustarsalt**3)
-            dec=flux_diam*beta
-            ec=(pi/3.)*1.e+2*rop* (size2(ni)**3) *(ustarsalt**2)
-            dfec1=(ec-e1)
-            dfec2=(ec-e2)
-            dfec3=(ec-e3)
-            t1=0.
-            t2=0.
-            t3=0.
-            if(ec.ge.e1)t1=1.
-            if(ec.ge.e2)t2=1.
-            if(ec.ge.e3)t3=1.
-            if(dfec3.ne.0.)then
-               p1=t1*dfec1/dfec3
-               p2=t2*(1.-p1)*dfec2/dfec3
-            else
-               p1=0.
-               p2=0.
-            endif
-            p3=t3*(1.-p1-p2)
-            ad1=(pi/6.)*dec*rop*p1*((diam(1)*1.e-4)**3.)/e1
-            ad2=(pi/6.)*dec*rop*p2*((diam(2)*1.e-4)**3.)/e2
-            ad3=(pi/6.)*dec*rop*p3*((diam(3)*1.e-4)**3.)/e3
-
-         endif
-         ft1=ft1+ad1
-         ft2=ft2+ad2
-         ft3=ft3+ad3
-      enddo ! of loop over nc
-
-!....
-
-        flux1=flux1+ft1*cpcent*cerod
-        flux2=flux2+ft2*cpcent*cerod
-        flux3=flux3+ft3*cpcent*cerod
-!       print *,'JEflux :',kwb,n,flux1,flux2,flux3
-80 CONTINUE
-             ENDDO !n=1,ntyp
-70 CONTINUE
-        fluxdust(i,1)=fluxdust(i,1)+flux1*probu(kwb)
-        fluxdust(i,2)=fluxdust(i,2)+flux2*probu(kwb)
-        fluxdust(i,3)=fluxdust(i,3)+flux3*probu(kwb)
-   ENDDO !kwb=1,nwb
-
-
-    ENDDO  ! i, klon
-
-
-
-   
-  !from horizontal to  vertical fluxes for each bin
-  DO k=1,klon
-   DO i=1,ndistb
-    DO j=1,nbins
-    emisbin(k,j) = emisbin(k,j)+10*fluxdust(k,i)*massfrac(i,j)  
-    ENDDO !j, nbind
-   ENDDO  !i, nmode
-  ENDDO !k,klon
-
-
-!print *,' JE fluxdust in calcdust'
-! DO k=1,klon
-!   DO i=1,ndistb
-!!print *,k,i,fluxdust(k,i)
-!enddo
-!enddo
-!print *,' JE emisbin in calcdust'
-!do k=1,klon
-!do j=1,nbins
-!!print *,k,j,emisbin(k,j)
-!enddo
-!enddo 
-!  CALL abort_gcm('calcdustemission', 'OK1',1)
-
-  END SUBROUTINE calcdustemission
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
-
-
-SUBROUTINE def_copyncl(kfin)
-      implicit none
-
- integer i,n,kfin,ideb,ifin,istep,kfin2
-    real dsmin,dsmax
-
-! estimation of the reduced soil size distribution
-         dsmin=var3a*(ustarsalt**(-2./3.))
-         dsmax=var3b*(ustarsalt**(-2./3.))
-!      print*,'ustarsalt = ',ustarsalt,'dsmin=',dsmin,'dsmax=',dsmax
-! dichotomy
-         call def_dichotomy(size,nclass,1,ncl,dsmin,ideb)
-   !      print*,'ideb = ',ideb
-         call def_dichotomy(size,nclass,ideb,ncl,dsmax,ifin)
-   !      print*,'ifin = ',ifin
-! readaptation of large sizes particles
-         kfin=0
-         do i=ideb,ifin
-            kfin=kfin+1
-            size2(kfin)=size(i)
-            uth2(kfin)=uth(i)
-            srel2(nat,kfin)=srel(nat,i)
-         enddo
-  !          print*,'je suis la'
-         kfin2=kfin
-         istep=50
-         do i=ifin,ncl,istep
-            kfin=kfin+1
-            size2(kfin)=size(i)
-            uth2(kfin)=uth(i)
-            srel2(nat,kfin)=srel(nat,i)*istep
-         enddo
-         if(kfin.ge.nclass)then
-            print*,'$$$$ Tables dimension problem:',kfin,'>',nclass
-         endif
-!---------------        
-
-      return
-END SUBROUTINE def_copyncl
-
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
-subroutine def_dichotomy(siz,nclass,i1,i2,ds,iout)
-!c---------------------------------------------------------------
-!c 'size' is the table to scan
-!c      of dimension 'nclass', and reduced size of interest [i1:i2]
-!c 'ds' is the value to find in 'size'
-!c 'iout' is the number in the table 'size' correspondig to 'ds'
-!c---------------------------------------------------------------
-
-      implicit none
-      integer i1,i2,nclass,iout,ismin,ismax,k2,ihalf,idiff
-      real siz(nclass),ds
-!c-----------------------------
-      iout=0
-      ismin=i1
-      ismax=i2
-      ihalf=int((ismax+ismin)/2.)
-      do k2=1,1000000
-          if(ds.gt.siz(ihalf))then
-             ismin=ihalf
-          else
-             ismax=ihalf
-          endif
-          ihalf=int((ismax+ismin)/2.)
-          idiff=ismax-ismin
-          if(idiff.le.1)then
-             iout=ismin
-             goto 52
-          endif
-      enddo
- 52   continue
-      if(iout.eq.0)then
-        print*,'$$$$ Tables dimension problem: ',iout
-      endif
-
-      end subroutine def_dichotomy
-
-!--------------------------------------------------------------------------------------
-!======================================================================================
-!**************************************************************************************
-!======================================================================================
-!--------------------------------------------------------------------------------------
-
-
-  SUBROUTINE calcvd(vdout)
-  IMPLICIT NONE
-  INTEGER                     :: nb
-!JE already def in module  INTEGER,PARAMETER           :: nbinsHR=3000
-  INTEGER,PARAMETER           :: idiffusi=1
-  INTEGER,PARAMETER           :: idrydep=2
-  REAL                        :: dmn1,dmn2,dmn3,ra,rb
-  REAL                        :: rhod,muair,nuair,R,airmolw
-  REAL                        :: bolz,rhoair,gravity,karman,zed,z0m
-  REAL                        :: ustarbin,temp,pres,rac,lambda,ccexp
-  REAL                        :: Cc,rexp,pi,St
-  REAL,DIMENSION(nbinsHR)     :: setvel
-  REAL,DIMENSION(nbinsHR)     :: diffmol1
-  REAL,DIMENSION(nbinsHR)     :: diffmol2
-  REAL,DIMENSION(nbinsHR)     :: schmidtnumb
-  REAL,DIMENSION(nbinsHR)     :: diffmole
-
-  REAL,DIMENSION(nbinsHR),   INTENT(OUT)              :: vdout
-! users physical parameters
-       temp=273.15+25. ! in Kelvin degrees
-       pres=1013. ! in hPa
-! calculation of Ra
-       zed=10.
-       z0m=0.05
-       karman=0.41
-       ustarbin=30. ! cm/s
-       ra=log(zed/z0m)/(karman*ustarbin)
-!c physical constants (all must in units g / cm / s)
-       rhod=2.65                 ! g.cm-3
-       muair=1.72e-4             ! g.cm-1.s-1
-       nuair=0.1461              ! air kinematic viscosity [cm2.s-1]
-       R=8.314                   ! molar gas constant J.mol-1.K-1
-       airmolw=28.8              ! molar weight of air
-       bolz=1.38e-16                    ! g.cm2.s-2
-       rhoair=1.225e-3                  ! g.cm-3
-       gravity=981.                ! gravity [cm.s-2]
-       pi=3.14159
-       rac=sqrt(8.0*airmolw/(pi*R*temp))
-       lambda=(2.*muair)/(pres*rac)
-! c Cc and Vs
-!       binsHRcm=binsize*1.e-4
-       DO nb=1,nbinsHR
-       ccexp=exp((-0.55*binsHRcm(nb))/lambda)
-       Cc=1.+(2.*lambda)/binsHRcm(nb)*(1.257+0.4*ccexp)
-       setvel(nb)=(1./18.)*((binsHRcm(nb))**2*rhod*gravity*Cc)/muair
-!c Molecular diffusivity (s/cm2) and Schmidt number
-!c Note that the molecular diffusivity uses diameter in micro-m
-!c to give a result directly in s/cm2
-       dmn1=2.38e-7/binsHR(nb)
-       dmn2=0.163/binsHR(nb)
-       dmn3=0.0548*exp(-6.66*binsHR(nb))/binsHR(nb)
-       diffmol1(nb)=dmn1*(1.+dmn2+dmn3)
-       diffmol2(nb)=bolz*temp*Cc/(3.*pi*muair*binsHRcm(nb))
-       IF(idiffusi.EQ.1)diffmole(nb)=diffmol1(nb)
-       IF(idiffusi.EQ.2)diffmole(nb)=diffmol2(nb)
-       schmidtnumb(nb)=nuair/diffmole(nb)
-       St=setvel(nb)*ustarbin*ustarbin/(gravity*nuair)
-       rb=1./(ustarbin*((schmidtnumb(nb))**(-2./3.)+10.**(-3./St)))
-!c wesely (primarily designed for gases)
-       IF(idrydep.EQ.1)THEN
-          vdout(nb)=1./(ra+rb+ra*rb*setvel(nb))+setvel(nb)
-       END IF
-!c venkatram and pleim (more adaptated to particles but numerically unstable)
-       IF(idrydep.EQ.2)THEN
-        rexp=exp(-(ra+rb)*setvel(nb))
-        vdout(nb)=setvel(nb)/(1.-rexp)
-       END IF
-       END DO
-!c-----------------
-       RETURN
-      END SUBROUTINE calcvd
-
-
-
-END MODULE dustemission_mod
-
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/gastoparticle_dot_F_orig20140120
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/gastoparticle_dot_F_orig20140120	(revision 2196)
+++ 	(revision )
@@ -1,59 +1,0 @@
-      SUBROUTINE gastoparticle(pdtphys,zdz,zrho,xlat,
-     .                                                        tr_seri)
-cnhl     .                         fluxso4chem, flux_sparam_sulf,
-
-      USE dimphy
-      USE infotrac
-c      USE indice_sol_mod
-
-      IMPLICIT NONE 
-c
-#include "dimensions.h"
-#include "chem.h"
-c #include "../phylmd/dimphy.h"
-#include "../phylmd/YOMCST.h"
-#include "../phylmd/YOECUMF.h"
-c
-      REAL pdtphys
-      REAL zrho(klon,klev)
-      REAL zdz(klon,klev)
-      REAL tr_seri(klon,klev,nbtr)   ! traceurs
-      REAL tend                 ! tendance par espece
-      REAL xlat(klon)       ! latitudes pour chaque point
-      REAL pi
-c
-c------------------------- Scaling Parameter --------------------------
-c
-c      REAL scale_param_so4(klon)  !Scaling parameter for sulfate
-
-      INTEGER i, k
-      REAL tau_chem     !---chemical lifetime in s
-c
-c------------------------- Variables to save --------------------------
-c
-cnhl      REAL fluxso4chem(klon,klev)
-cnhl      REAL flux_sparam_sulf(klon,klev)
-
-c======================================================================
-      pi=atan(1.)*4.
-c
-      DO k = 1, klev
-      DO i = 1, klon
-c
-c        tau_chem=scale_param_so4(i)*86400.*(8.-5.*cos(xlat(i)*pi/180.))    !tchemfctn2
-cnhl        tau_chem=86400.*(8.-5.*cos(xlat(i)*pi/180.))    !tchemfctn2
-        tau_chem=86400.*(5.-4.*cos(xlat(i)*pi/180.))    !
-        tend=tr_seri(i,k,1)*(1.-exp(-pdtphys/tau_chem)) ! Sulfate production
-cnhl        tend=(1.-exp(-pdtphys/tau_chem))
-cnhl        tend=scale_param_so4(i) !as this it works
-c      
-        tr_seri(i,k,1) =tr_seri(i,k,1) - tend
-        tr_seri(i,k,2) =tr_seri(i,k,2) + tend/RNAVO*masse_ammsulfate  !--gAER/KgAir
-c
-cnhl        fluxso4chem(i,k) = tend/RNAVO*masse_ammsulfate
-cnhl        flux_sparam_sulf(i,k) = tend/RNAVO*masse_ammsulfate
-      ENDDO
-      ENDDO
-c
-      RETURN 
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/physiq.F90
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/physiq.F90	(revision 2196)
+++ LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/physiq.F90	(revision 2217)
@@ -3642,5 +3642,6 @@
   nbreg_wstardust=1
   fileregionsdimsind='regions_ind_meta'
-  fileregionsdimsdust='regions_dustacc_meta'
+!  fileregionsdimsdust='regions_dustacc_meta'
+  fileregionsdimsdust='regions_dust_meta'
   fileregionsdimsbb='regions_bb_meta'
   fileregionsdimswstar='regions_pwstarwake_meta'
@@ -3704,4 +3705,7 @@
   paramname_dustcoa='dustcoasco'
   paramname_dustsco='dustcoasco'
+  paramname_dustacc='dust'
+  paramname_dustcoa='dust'
+  paramname_dustsco='dust'
   paramname_wstarBL='pwstarbl'
   paramname_wstarWAKE='pwstarwake'
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_sp_dot_F_20140121_seq
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_sp_dot_F_20140121_seq	(revision 2196)
+++ 	(revision )
@@ -1,2095 +1,0 @@
-      SUBROUTINE phytracr_spl ( debutphy, iflag_con,
-     I                   pdtphys,ftsol,tsol, 
-     I                   t_seri,q_seri,paprs,pplay,RHcl,
-     I                   pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,
-     I                   coefh, cdragh, cdragm, yu1, yv1, 
-     I                   u_seri, v_seri, xlat,xlon,
-     I                   pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,
-     P                   scale_param_ssacc,
-     P                   scale_param_sscoa,scale_param_ind,
-     P                   scale_param_bb,scale_param_ff,
-     P                   scale_param_dustacc,scale_param_dustcoa,
-     E                   dust_ec,u10m_ec,v10m_ec,
-     E                   lmt_sea_salt,
-     E                   lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     E                   lmt_so2bb_l, lmt_so2bb_h,
-     E                   lmt_so2volc_cont,lmt_altvolc_cont,
-     E                   lmt_so2volc_expl,lmt_altvolc_expl,
-     E                   lmt_dmsbio,lmt_h2sbio,lmt_dmsconc,
-     E                   lmt_bcff,lmt_bcnff,lmt_bcbb_l,lmt_bcbb_h,
-     E                   lmt_bcba,lmt_omff,lmt_omnff,lmt_ombb_l,
-     E                   lmt_ombb_h,lmt_omnat,lmt_omba,
-     O                   tr_seri,
-     O                   diff_aod550_tot,diag_aod865_tot,
-     O                   diff_aod550_tr2,diag_aod865_tr2,
-     O                   diag_aod550_dust,diag_aod865_dust,
-     O                   diag_aod550_ss,diag_aod865_ss)
-!     E                   wth,cly,zprecipinsoil,lmt_sea_salt, ! Titane
-c
-      USE IOIPSL
-      USE dimphy
-      USE infotrac
-      USE indice_sol_mod
-c
-      IMPLICIT none
-c
-c======================================================================
-c Auteur(s) FH
-c Objet: Moniteur general des tendances traceurs
-c
-c Remarques en vrac:
-c ------------------
-c 1/ le call phytrac se fait avec nqmax-2 donc nous avons bien 
-c les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
-c======================================================================
-#include "dimensions.h"
-#include "chem.h"
-#include "../phylmd/YOMCST.h"
-#include "../phylmd/YOETHF.h"
-c #include "../phylmd/dimphy.h"
-c #include "../phylmd/indicesol.h"
-#include "paramet.h"
-c======================================================================
-
-c Arguments:
-c
-c   EN ENTREE:
-c   ==========
-c
-c   divers:
-c   -------
-c
-      real pdtphys  ! pas d'integration pour la physique (seconde)
-      real ftsol(klon,nbsrf)  ! temperature du sol par type
-      real tsol(klon)         ! temperature du sol moyenne
-      real t_seri(klon,klev)  ! temperature
-      real u_seri(klon,klev)  ! vent
-      real v_seri(klon,klev)  ! vent
-      real q_seri(klon,klev)  ! vapeur d eau kg/kg
-      real tr_seri(klon,klev,nbtr) ! traceur  
-      real tmp_var(klon,klev) ! auxiliary variable to replace traceur  
-      real tmp_var2(klon,nbtr) ! auxiliary variable to replace source
-      real aux_var2(klon) ! auxiliary variable to replace traceur  
-      real aux_var3(klon,klev) ! auxiliary variable to replace traceur  
-      real d_tr(klon,klev,nbtr)    ! traceur  tendance
-      real sconc_seri(klon,nbtr) ! surface concentration of traceur  
-c
-      integer nbjour
-      save nbjour
-c
-      REAL diff_aod550_tot(klon)  ! epaisseur optique total aerosol 550  nm
-      REAL diag_aod670_tot(klon)  ! epaisseur optique total aerosol 670 nm
-      REAL diag_aod865_tot(klon)  ! epaisseur optique total aerosol 865 nm
-      REAL diff_aod550_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
-      REAL diag_aod670_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
-      REAL diag_aod865_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
-      REAL diag_aod550_ss(klon)   ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
-      REAL diag_aod670_ss(klon)   ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
-      REAL diag_aod865_ss(klon)   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
-      REAL diag_aod550_dust(klon) ! epaisseur optique Dust aerosol 550 nm, diagnostic
-      REAL diag_aod670_dust(klon) ! epaisseur optique Dust aerosol 670 nm, diagnostic
-      REAL diag_aod865_dust(klon) ! epaisseur optique Dust aerosol 865 nm, diagnostic
-c
-      real paprs(klon,klev+1)  ! pression pour chaque inter-couche (en Pa)
-      real pplay(klon,klev)  ! pression pour le mileu de chaque couche (en Pa)
-      real RHcl(klon,klev)  ! humidite relativen ciel clair
-      real znivsig(klev)  ! indice des couches
-      real paire(klon)
-      real pphis(klon)
-      real pctsrf(klon,nbsrf)
-      logical debutphy   ! le flag de l'initialisation de la physique
-c
-c   Scaling Parameters:
-c   ----------------------
-c
-      CHARACTER*33 c_Directory
-      CHARACTER*33 c_FileName1
-      CHARACTER*42 c_FileName2
-      CHARACTER*71 c_FullName1
-      CHARACTER*77 c_FullName2
-      INTEGER :: xidx, yidx
-      INTEGER,DIMENSION(klon) :: mask_bbreg
-      INTEGER,DIMENSION(klon) :: mask_ffso2reg
-      INTEGER :: aux_mask1
-      INTEGER :: aux_mask2
-
-      INTEGER iregion_so4(klon)  !Defines regions for SO4
-      INTEGER iregion_ind(klon)  !Defines regions for SO2, BC & OM
-      INTEGER iregion_bb(klon)   !Defines regions for SO2, BC & OM
-      INTEGER iregion_dust(klon) !Defines  dust regions
-c      REAL scale_param_sulf(jjm+1)  !Scaling parameter for sulfate (input)
-c      REAL scale_param_so4(klon)  !Scaling parameter for sulfate used whithin phytrac
-      REAL scale_param_ssacc  !Scaling parameter for Fine Sea Salt
-      REAL scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
-      REAL scale_param_ind(nbreg_ind) !Scaling parameter for industrial emissionsi of SO2
-      REAL scale_param_bb(nbreg_bb)  !Scaling parameter for biomas burning (SO2, BC & OM)
-      REAL scale_param_ff(nbreg_ind)  !Scaling parameter for industrial emissions (fossil fuel)
-      REAL scale_param_dustacc(nbreg_dust)  !Scaling parameter for Fine Dust
-      REAL scale_param_dustcoa(nbreg_dust)  !Scaling parameter for Coarse Dust
-c
-c   Emissions:
-c   ---------
-c
-c---------------------------- SEA SALT & DUST emissions ------------------------
-      REAL lmt_sea_salt(klon,ss_bins) !Sea salt 0.03-8.0 um
-      REAL u10m_ec1(klon),v10m_ec1(klon)
-      REAL u10m_ec2(klon),v10m_ec2(klon),dust_ec2(klon)
-      REAL dust_ec(klon)
-!      REAL cly(klon),wth(klon),zprecipinsoil(klon)   ! Titane
-c------------------------- SULFUR emissions ----------------------------
-      REAL lmt_so2volc_cont(klon)  ! emissions so2 volcan (continuous)
-      REAL lmt_altvolc_cont(klon)  ! altitude  so2 volcan (continuous)
-      REAL lmt_so2volc_expl(klon)  ! emissions so2 volcan (explosive)
-      REAL lmt_altvolc_expl(klon)  ! altitude  so2 volcan (explosive)
-      REAL lmt_so2ff_l(klon)       ! emissions so2 fossil fuel (low)
-      REAL lmt_so2ff_h(klon)       ! emissions so2 fossil fuel (high)
-      REAL lmt_so2nff(klon)        ! emissions so2 non-fossil fuel
-      REAL lmt_so2bb_l(klon)       ! emissions de so2 biomass burning (low)
-      REAL lmt_so2bb_h(klon)       ! emissions de so2 biomass burning (high)
-      REAL lmt_so2ba(klon)         ! emissions de so2 bateau
-      REAL lmt_dms(klon)           ! emissions de dms
-      REAL lmt_dmsconc(klon)       ! concentration de dms oceanique
-      REAL lmt_dmsbio(klon)        ! emissions de dms bio 
-      REAL lmt_h2sbio(klon)        ! emissions de h2s bio
-c------------------------- BLACK CARBON emissions ----------------------
-      REAL lmt_bcff(klon)       ! emissions de BC fossil fuels
-      REAL lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
-      REAL lmt_bcbb_l(klon)     ! emissions de BC biomass basses
-      REAL lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
-      REAL lmt_bcba(klon)      ! emissions de BC bateau
-c------------------------ ORGANIC MATTER emissions ---------------------      
-      REAL lmt_omff(klon)     ! emissions de OM fossil fuels
-      REAL lmt_omnff(klon)    ! emissions de OM non-fossil fuels
-      REAL lmt_ombb_l(klon)   ! emissions de OM biomass basses
-      REAL lmt_ombb_h(klon)   ! emissions de OM biomass hautes
-      REAL lmt_omnat(klon)    ! emissions de OM Natural
-      REAL lmt_omba(klon)     ! emissions de OM bateau
-                                                                        
-c
-c  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
-c
-c   convection:
-c   -----------
-c
-      REAL pmfu(klon,klev)  ! flux de masse dans le panache montant
-      REAL pmfd(klon,klev)  ! flux de masse dans le panache descendant
-      REAL pen_u(klon,klev) ! flux entraine dans le panache montant
-      REAL pde_u(klon,klev) ! flux detraine dans le panache montant
-      REAL pen_d(klon,klev) ! flux entraine dans le panache descendant
-      REAL pde_d(klon,klev) ! flux detraine dans le panache descendant
-c
-c  Lessivage
-c  ---------
-c
-!      REAL pmflxr(klon,klev+1), pmflxs(klon,klev+1)   !--convection
-!      REAL prfl(klon,klev+1),   psfl(klon,klev+1)     !--large-scale
-      REAL pmflxr(klon,klev), pmflxs(klon,klev)   !--convection       ! Titane
-      REAL prfl(klon,klev),   psfl(klon,klev)     !--large-scale      ! Titane
-c
-c   Couche limite:
-c   --------------
-c
-      REAL coefh(klon,klev) ! coeff melange CL
-      REAL cdragh(klon), cdragm(klon)
-      REAL yu1(klon)        ! vent dans la 1iere couche
-      REAL yv1(klon)        ! vent dans la 1iere couche
-c
-c
-c----------------------------------------------------------------------
-      REAL his_ds(klon,nbtr)
-      REAL his_dhlsc(klon,nbtr)        ! in-cloud scavenging lsc
-      REAL his_dhcon(klon,nbtr)       ! in-cloud scavenging con
-      REAL his_dhbclsc(klon,nbtr)      ! below-cloud scavenging lsc
-      REAL his_dhbccon(klon,nbtr)      ! below-cloud scavenging con
-      REAL trm(klon,nbtr)
-c
-      REAL u10m_ec(klon), v10m_ec(klon)
-c
-c
-c   Coordonnees
-c   -----------
-c
-      REAL xlat(klon)       ! latitudes pour chaque point 
-      REAL xlon(klon)       ! longitudes pour chaque point 
-C
-      INTEGER i, k, it, j, ig 
-c
-c DEFINITION OF DIAGNOSTIC VARIABLES
-c
-      REAL diag_trm(nbtr), diag_drydep(nbtr) 
-      REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
-      REAL diag_emissn(nbtr), diag_g2part
-      REAL diag_sedimt
-      REAL trm_aux(nbtr), src_aux(nbtr)
-c
-c Variables locales pour effectuer les appels en serie
-c----------------------------------------------------
-      REAL source_tr(klon,nbtr)
-      REAL flux_tr(klon,nbtr)
-      REAL m_conc(klon,klev)
-      REAL sed_ss(klon)    ! corresponds to tracer 3
-      REAL sed_dust(klon)  ! corresponds to tracer 4
-      REAL henry(nbtr)  !--cste de Henry  mol/l/atm
-      REAL kk(nbtr)     !--coefficient de var avec T (K)
-      REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
-      REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
-      REAL vdep_oce(nbtr), vdep_sic(nbtr)
-      REAL vdep_ter(nbtr), vdep_lic(nbtr)
-      REAL dtrconv(klon,nbtr)
-      REAL zrho(klon,klev), zdz(klon,klev)
-      REAL zalt(klon,klev)
-      REAL qmin, qmax, aux
-!      PARAMETER (qmin=0.0, qmax=1.e33)
-      PARAMETER (qmin=1.e33, qmax=-1.e33)
-
-c Variables to save data into file
-c----------------------------------
-   
-      CHARACTER*2 str2
-      LOGICAL ok_histrac
-      PARAMETER (ok_histrac=.true.)
-      INTEGER ndex2d(iim*(jjm+1)), ndex3d(iim*(jjm+1)*klev)
-      INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
-      INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      INTEGER itra
-      SAVE itra                    ! compteur pour la physique
-      INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
-      REAL zx_tmp_2d(iim,jjm+1), zx_tmp_3d(iim,jjm+1,klev)
-      REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
-      REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
-      REAL zsto, zout, zout_h, zout_m, zjulian
-      REAL fluxbb(klon), fluxff(klon)
-      REAL fluxbcbb(klon), fluxbcff(klon), fluxbcnff(klon)
-      REAL fluxombb(klon), fluxomff(klon), fluxomnat(klon)
-      REAL fluxomnff(klon), fluxomba(klon), fluxbcba(klon)
-      REAL fluxso2ff(klon), fluxso2bb(klon), fluxso2(klon)
-      REAL fluxso2nff(klon), fluxso2vol(klon), fluxso2ba(klon) 
-      REAL fluxh2sff(klon), fluxh2snff(klon)
-      REAL fluxso4ff(klon), fluxso4bb(klon), fluxso4ba(klon)
-      REAL fluxh2sbio(klon), fluxso4nff(klon)
-      REAL fluxdms(klon)
-      REAL fluxbc(klon), fluxom(klon), fluxso4(klon)
-      REAL fluxdd(klon), fluxss(klon)
-      REAL fluxdustec(klon), fluxssfine(klon), fluxsscoa(klon)
-      REAL fluxddfine(klon), fluxddcoa(klon)
-      REAL flux_sparam_bb(klon), flux_sparam_ff(klon)
-      REAL flux_sparam_ind(klon) !, flux_sparam_sulf(klon,klev)
-      REAL flux_sparam_ddfine(klon), flux_sparam_ddcoa(klon)
-      REAL flux_sparam_ssfine(klon), flux_sparam_sscoa(klon)
-
-c------------------DMS  SO2  SO4   H2S  DMSO MSA H2O2 
-c------------------BC1, BC2, OM1, OM2,flyash  dust1   dust2 
-c------------------Sea Salt 1-8 bins 
-c------------------Precursors (gases), Fine, Coarse Aerosols
-C c
-C       DATA henry   /1.4, 0.0, 0.0, 0.0/
-C c
-C       DATA kk      /2900., 0., 0., 0./
-C c
-C       DATA alpha_r /0., 0.001, 0.001, 0.001/
-C c
-C       DATA alpha_s /0., 0.01, 0.01, 0.01/
-C c
-C cnhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-C cnhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-C       DATA vdep_oce /0.28, 0.28, 1.2, 1.2/
-C c
-C       DATA vdep_sic /0.2, 0.17, 1.2, 1.2/
-C c
-C       DATA vdep_ter /0.3, 0.14, 1.2, 1.2/
-
-C       DATA vdep_lic /0.2, 0.17, 1.2, 1.2/
-      
-c------Molar Masses
-      REAL masse(nbtr)
-c
-      REAL fracso2emis                              !--fraction so2 emis en so2
-      PARAMETER (fracso2emis=0.95) 
-      REAL frach2sofso2                             !--fraction h2s from so2
-      PARAMETER (frach2sofso2=0.0426)
-c
-c   Controles
-c-------------
-      LOGICAL convection,lessivage,lminmax
-      DATA convection,lessivage,lminmax
-     s     /.true.,.true.,.true./
-c
-      REAL xconv(nbtr)
-c
-      LOGICAL anthropo, bateau, edgar
-      DATA anthropo,bateau,edgar/.true.,.true.,.true./
-c
-cc bc_source
-      INTEGER kminbc, kmaxbc
-      PARAMETER (kminbc=3, kmaxbc=5)
-c
-      REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
-c
-c JE for updating in  cltrac
-      REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
-      REAL,DIMENSION(klon,nbtr)       :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-c      SAVE  d_tr_dry
-c JE for include gas to particle conversion in output
-      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
-      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
-c
-      INTEGER iflag_con
-
-c======================================================================
-c   INITIALISATIONS
-c======================================================================
-c
-c---fraction of tracer that is convected (??
-      xconv(1)=0.8
-      xconv(2)=0.5
-      xconv(3)=0.5
-      xconv(4)=0.6
-
-      masse(1)=32.
-      masse(2)=6.02e23
-      masse(3)=6.02e23
-      masse(4)=6.02e23 
-
-      henry= (/1.4, 0.0, 0.0, 0.0/)
-      kk = (/2900., 0., 0., 0./)
-      alpha_r =  (/0., 0.001, 0.001, 0.001/)
-      alpha_s = (/0., 0.01, 0.01, 0.01/)
-
-c nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-c nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-      vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
-      vdep_sic = (/0.2, 0.17, 1.2, 1.2/)     
-      vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
-      vdep_lic = (/0.2, 0.17, 1.2, 1.2/)      
-
-
-
-      lmt_dms(:)=0.0
-      aux_var2(:)=0.0
-      aux_var3(:,:)=0.0
-      source_tr(:,:)=0.0
-      flux_tr(:,:)=0.0
-      flux_sparam_bb(:)=0.0
-      flux_sparam_ff(:)=0.0
-      flux_sparam_ind(:)=0.0
-      flux_sparam_ddfine(:)=0.0
-      flux_sparam_ddcoa(:)=0.0
-      flux_sparam_ssfine(:)=0.0
-      flux_sparam_sscoa(:)=0.0
-!
-      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
-      RG = 9.80665
-      RNAVO =6.02e23
-      RLVTT=2.5008E+6
-      RLSTT=2.8345E+6
-      R4IES=7.66
-      R3IES=21.875
-      R4LES=35.86
-      R3LES=17.269
-      RTT=273.16
-      RMV=18.0153
-      RKBOL=1.380658E-23
-      R=RNAVO*RKBOL
-      R5LES=R3LES*(RTT-R4LES)
-      R5IES=R3IES*(RTT-R4IES)
-      RV=1000.*R/RMV
-      RCPV=4.*RV
-      RCPD=3.5*RD
-      RVTMP2=RCPV/RCPD-1
-      RETV=RV/RD-1.
-c
-      if (debutphy) then
-         print *, 'let s check nbtr=', nbtr
-         print *, 'xlat and xlon'
-c JE   initializon to cero the tracers     
-         DO it=1, nbtr
-            tr_seri(:,:,it)=0.0
-         ENDDO
-c JE endmodification     
-! Initializing to zero tr_seri for comparison purposes
-!        tr_seri(:,:,:)=0.0
-c
-!        DO it=1,nbtr
-!           trm_aux(it)=0.0
-!           src_aux(it)=0.0
-!           diag_trm(it)=0.0
-!           diag_drydep(it)=0.0
-!           diag_wetdep(it)=0.0
-!           diag_cvtdep(it)=0.0
-!           diag_emissn(it)=0.0
-!        ENDDO
-!        diag_g2part=0.0
-         print *,'PREPARE FILES TO SAVE VARIABLES'
-c
-         nbjour=30
-         ecrit_tra =   NINT(86400./pdtphys)                    !--1-day  average
-         ecrit_tra_h = NINT(86400./pdtphys*0.25)               !--6-hour average
-         ecrit_tra_m = NINT(86400./pdtphys*FLOAT(nbjour))      !--1-mth  average
-         print *,'ecrit_tra=', pdtphys, ecrit_tra
-
-         IF (ok_histrac) THEN
-  
-           itra=0
-c
-           CALL ymds2ju(1900, 1, 1, 0.0, zjulian)
-c
-           print *, 'klon,iim,jjm+1 = ',klon,iim,jjm+1
-           CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlon,zx_lon)
-c
-           DO i = 1, iim
-             zx_lon(i,1) = xlon(i+1)
-             zx_lon(i,jjm+1) = xlon(i+1)
-           ENDDO
-c
-           CALL histbeg("histrac_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori1, nid_tra1)
-c
-           CALL histbeg("lessivage_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori2, nid_tra2)
-c
-           CALL histbeg("traceur_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori3, nid_tra3)
-c
-           CALL histvert(nid_tra1, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra2, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra3, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           zsto = pdtphys
-           zout = pdtphys * FLOAT(ecrit_tra)
-           zout_h = pdtphys * FLOAT(ecrit_tra_h)
-           zout_m = pdtphys * FLOAT(ecrit_tra_m)
-           print *,'zsto zout=', zsto, zout
-
-c
-c----------------- HISTORY FILES OF TRACER EMISSIONS -------------------
-c
-c HISTRAC
-c
-           CALL histdef(nid_tra1, "fluxbb", "Flux BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxff", "Flux FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcbb", "Flux BC-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcff", "Flux BC-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcnff", "Flux BC-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcba", "Flux BC-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbc", "Flux BC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxombb", "Flux OM-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomff", "Flux OM-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnff", "Flux OM-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomba", "Flux OM-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnat", "Flux OM-NT", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxom", "Flux OM", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sff","Flux H2S FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2snff","Flux H2S non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2ff","Flux SO2 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2nff","Flux SO2 non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2bb", "Flux SO2 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2vol","Flux SO2 Vol","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2ba", "Flux SO2 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2", "Flux SO2","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4ff","Flux SO4 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4nff","Flux SO4 non-FF",
-     .                  "mgS/m2/s", iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4bb", "Flux SO4 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4ba", "Flux SO4 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4", "Flux SO4","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdms", "Flux DMS", "mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sbio","Flux H2S Bio","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdustec", 
-     .                                 "Flux Dust EC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddfine","DD Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddcoa","DD Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxdd","Flux DD","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxssfine","SS Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxsscoa","SS Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxss","Flux SS","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"fluxso4chem","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ind","Ind emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_bb","BB emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ff","FF emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddfine","DD fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddcoa","DD coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ssfine","SS fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_sscoa","SS coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"u10m","Zonal wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"v10m","Meridional wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"flux_sparam_sulf","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-c TRACEUR
-c
-           CALL histdef(nid_tra3, "taue550", "Tau ext 550", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670", "Tau ext 670", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865", "Tau ext 865", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_tr2", "Tau ext 550tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_tr2", "Tau ext 670tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_tr2", "Tau ext 865tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_ss", "Tau ext 550ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_ss", "Tau ext 670ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_ss", "Tau ext 865ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_dust", "Tau ext 550dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_dust", "Tau ext 670dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_dust", "Tau ext 865dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-           DO it=1, nbtr
-c
-           WRITE(str2,'(i2.2)') it
-c
-           CALL histdef(nid_tra3, "trm"//str2, "Burden No."//str2, 
-     .                  "mgS/m2", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "sconc"//str2, "Surf Conc. No."//str2,
-     .                  "mg/m3", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c LESSIVAGE
-c
-           CALL histdef(nid_tra2, "flux"//str2, "emission"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "ds"//str2, "Depot sec No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dh"//str2,
-     .                  "Depot hum No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dtrconv"//str2,
-     .                  "Depot hum No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           ENDDO
-c
-           CALL histdef(nid_tra2, "sed_ss", "Sedmet. Tr3", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "sed_dust", "Sedmet. Tr4", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)         
-c
-           CALL histdef(nid_tra2, "g2p_gas", "Gas2particle gas sink", 
-     .                  "molec/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "g2p_aer", "Gas2particle tr2 src", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c--------------------------------------------------------------------
-c
-           CALL histend(nid_tra1)
-c
-           CALL histend(nid_tra2)
-c
-           CALL histend(nid_tra3)
-c
-c--------------------------------------------------------------------
-
-!        nbjour=1
-         ENDIF !--ok_histrac
-
-c
-!        IF (.NOT.edgar.AND.bateau) THEN
-!        PRINT *,'ATTENTION risque de compter double les bateaux'
-!        STOP
-!        ENDIF
-c
-c
-c
-      endif ! debutphy
-c
-c======================================================================
-c Initialisations
-c======================================================================
-c
-c
-
-      DO it=1, nbtr
-      DO i=1, klon 
-        his_dhlsc(i,it)=0.0
-        his_dhcon(i,it)=0.0
-        his_dhbclsc(i,it)=0.0
-        his_dhbccon(i,it)=0.0
-        trm(i,it)=0.0
-      ENDDO
-      ENDDO
-cJE:      
-      DO i=1, klon 
-         his_g2pgas(i) = 0.0
-         his_g2paer(i) = 0.0
-      ENDDO
-c endJE
-c
-
-      DO k=1, klev
-      DO i = 1, klon
-        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
-      ENDDO
-      ENDDO
-c
-      DO i = 1, klon
-        zalt(i,1)=pphis(i)/RG
-      ENDDO
-      DO k=1, klev-1
-      DO i = 1, klon
-        zalt(i,k+1)=zalt(i,k)+zdz(i,k)
-      ENDDO
-      ENDDO
-
-c
-c======================================================================
-c Initialisations of Scaling Parameters
-c======================================================================
-C
-C ----------------------------- SO4 -----------------------------------
-C
-c      scale_param_so4(1)=scale_param_sulf(1)
-c      scale_param_so4(klon)=scale_param_sulf(jjm+1)
-                  
-c      DO j = 2, jjm
-c        DO i = 1, iim
-c          ig=iim*(j-2)+i+1
-c          scale_param_so4(ig)=scale_param_sulf(j)
-c        ENDDO
-c      ENDDO
-C
-C ----------------------- SO2, BC & OM --------------------------------
-C ----------------FOSSIL FUEL AND INUDSTRIAL EMISSIONS-----------------
-      iregion_dust(:)=-999
-      iregion_ind(:)=-999
-      iregion_bb(:)=-999
-! READING BB MASK
-!     c_Directory='/ccc/work/cont003/dsm/nhuneeus/REGION_MASK/'
-      c_Directory='/d6/jelmd/LMDZ_INPUT/REGION_MASK/'
-!      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c JE por v2      c_FileName1='GFED_phyBBmask_lowres.txt'
-c JE por v2      c_FileName2='Country_phyFFandSO2mask_lowres.txt'
-c      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c      c_FileName2='Country_phyFFandSO2mask_lowres_v2.txt'
-       c_FileName1='GFED_phyBBmask_lowres_je48x36.txt'
-       c_FileName2='Country_phyFFandSO2mask_lowres_je48x36.txt'
-      c_FullName1=c_Directory//c_FileName1
-      c_FullName2=c_Directory//c_FileName2
-      print *,'BB mask NL = ',c_FullName1
-!
-      OPEN (UNIT=1,FILE=c_FullName1)
-      OPEN (UNIT=111,FILE=c_FullName2)
-      DO j=1,klon
-!         print *, j, klon
-         aux_mask1=0
-         aux_mask2=0
-         READ(1,102) aux_mask1
-!         mask_BBreg(j)=aux_mask1
-         iregion_bb(j)=aux_mask1
-         READ(111,102) aux_mask2
-!         print *,'aux_mask1, aux_mask2
-!     .    =',aux_mask1,aux_mask2,INT(aux_mask1),INT(aux_mask2)
-!         mask_ffso2reg(j)=aux_mask2
-         iregion_ind(j)=aux_mask2
-      ENDDO
-      CLOSE (UNIT=1)
-      CLOSE (UNIT=111)
-!
-      OPEN(25,FILE='dustregions_pyvar.data')
-      OPEN(55,FILE='indregions_pyvar.data')
-      OPEN(75,FILE='bbregions_pyvar.data')
-
-
-      DO i = 1, klon
-C ----------------------- SO2, BC & OM ---------------------------------
-C -----------------------BIOMASS BURNING--------------------------------
-C ------------------------------- DUST ---------------------------------
-C
-        IF ((xlat(i).GT.11).AND.(xlon(i).LT.-85)) THEN
-c NORTH WEST AMERICA = 1
-          iregion_dust(i)=1
-        ELSEIF ((xlat(i).LE.11).AND.(xlon(i).LT.-25)) THEN
-c SOUTH AMERICA = 2
-          iregion_dust(i)=2      
-        ELSEIF ((xlat(i).GE.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.14)) THEN
-c WEST SAHARA = 3
-          iregion_dust(i)=3
-        ELSEIF ((xlat(i).GT.-1.75*xlon(i)+89).AND.
-     .       (xlat(i).GT.0.524*xlon(i)-11.048).AND.
-     .       (xlat(i).LT.-0.464*xlon(i)+53.179).AND.
-     .       (xlat(i).LT.36)) THEN
-c SAUDI ARABIA = 9
-          iregion_dust(i)=9
-        ELSEIF ((xlat(i).LT.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.77)) THEN
-c AFRICA SUB-SAHARA = 5
-          iregion_dust(i)=5
-        ELSEIF ((xlon(i).GT.77).AND.(xlat(i).LT.-5)) THEN
-c AUSTRALIA = 8
-          iregion_dust(i)=8
-        ELSEIF ((xlon(i).GE.77).AND.(xlat(i).GE.-5)) THEN
-c ASIA EAST = 6  REGION ADDED 
-          iregion_dust(i)=6
-        ELSEIF (xlat(i).GT.11.AND.xlon(i).GE.-85.AND.
-     .          xlon(i).LT.-25) THEN
-c NORTH EAST AMERICA = 11
-          iregion_dust(i)=11
-        ELSEIF ((xlon(i).LT.77).AND.(xlat(i).LT.36).AND.
-     .       (xlat(i).GE.11).AND.
-     .       (xlat(i).GT.-0.464*xlon(i)+53.179).OR.
-     .       (xlat(i).LT.0.524*xlon(i)-11.048)) THEN 
-c INDIAN SUBCONTINENT
-          iregion_dust(i)=10
-        ELSEIF ((xlon(i).GT.33).AND.(xlon(i).LT.77).AND.
-     .       (xlat(i).GE.36)) THEN
-c ASIA WEST = 7
-          iregion_dust(i)=7
-        ELSEIF ((xlat(i).GE.11).AND.
-     .       (xlon(i).GT.14).AND.
-     .       (xlat(i).LT.-1.75*xlon(i)+89).OR.xlon(i).LE.33) THEN
-c EAST SAHARA = 4
-          iregion_dust(i)=4
-        ENDIF
-
-c       WRITTING REGIONS INTO FILE
-        IF (iregion_dust(i).LT.10) THEN
-          WRITE (25,101) iregion_dust(i)
-        ELSE
-          WRITE (25,102) iregion_dust(i)
-        ENDIF
-        WRITE (55,*) iregion_ind(i)
-        WRITE (75,*) iregion_bb(i)
-!        WRITE (55,102) iregion_ind(i)
-!        WRITE (75,102) iregion_bb(i)
-
-      ENDDO
-!      print *,'NEW DUST REGION, NOW 11 REGIONS!'
-      CLOSE(25)
-      CLOSE(55)
-      CLOSE(75)
-  101 FORMAT (i1)
-  102 FORMAT (i2)
-!      stop
-c
-c=======================================================================
-c SAVING SURFACE TYPE
-c=======================================================================
-      OPEN(35,FILE='surface_ocean.data')
-      OPEN(45,FILE='surface_seaice.data')
-      OPEN(65,FILE='surface_land.data')
-      OPEN(85,FILE='surface_landice.data')
-      DO i = 1, klon
-         WRITE (35,103) pctsrf(i,is_oce)
-         WRITE (45,103) pctsrf(i,is_sic)
-         WRITE (65,103) pctsrf(i,is_ter)
-         WRITE (85,103) pctsrf(i,is_lic)
-      ENDDO
-      CLOSE(35)
-      CLOSE(45)
-      CLOSE(65)
-      CLOSE(85)
-  103 FORMAT (f6.2)
-!      stop
-c
-c=======================================================================
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-
-
-!        DO it=1, nbtr   
-!           CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,
-!     . 'after kg_to_cm3')
-!        ENDDO
-c=======================================================================
-c
-      DO k=1, klev
-      DO i=1, klon
-        m_conc(i,k)=pplay(i,k)/t_seri(i,k)/RKBOL*1.e-6
-      ENDDO
-      ENDDO
-
-!
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_avt_coarem')
-        ENDDO        
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'avt coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: avt coarem')
-      ENDIF
-c
-c
-c=======================================================================
-c                     EMISSIONS OF COARSE AEROSOLS
-c=======================================================================
-c      
-c      PRINT *, 'DUST EMISSION VALUES FOR REAGION EAST ASIA'
-c      DO i=1, klon
-c        IF ((xlon(i).GT.105).AND.(xlat(i).GE.-5)) THEN
-c           print *, 'DUST_EC,LON,LAT = ',dust_ec(i),xlon(i),xlat(i)
-c        ENDIF
-c      ENDDO
-      print *,'Number of tracers = ',nbtr
-
-      print *,'AT BEGINNING OF PHYTRACR_SPL'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-
-      CALL coarsemission(pctsrf,pdtphys,t_seri,
-     .                   pmflxr,pmflxs,prfl,psfl,
-     .                   scale_param_ssacc,scale_param_sscoa,
-     .                   scale_param_dustacc,scale_param_dustcoa,
-     .                   iregion_dust,dust_ec,
-     .                   lmt_sea_salt,qmin,qmax,
-     .                             flux_sparam_ddfine,flux_sparam_ddcoa,
-     .                             flux_sparam_ssfine,flux_sparam_sscoa,
-     .                                                source_tr,flux_tr)
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_coarem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after coarem')
-      ENDIF
-
-c
-c
-c
-c======================================================================
-c                   EMISSIONS OF AEROSOL PRECURSORS      
-c======================================================================
-c
-      print *,'INPUT TO PRECUREMISSION'
-
-      CALL precuremission(ftsol,u10m_ec,v10m_ec,pctsrf,
-     .                    u_seri,v_seri,paprs,pplay,cdragh,cdragm,
-     .                    t_seri,q_seri,tsol,fracso2emis,frach2sofso2,
-     .                    bateau,zdz,zalt,kminbc,kmaxbc,pdtphys,
-     .                    scale_param_bb,scale_param_ind,
-     .                    iregion_ind, iregion_bb,
-     .                    lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     .                    lmt_so2bb_l,lmt_so2bb_h,
-     .                    lmt_so2volc_cont,lmt_altvolc_cont,
-     .                    lmt_so2volc_expl,lmt_altvolc_expl,
-     .                    lmt_dmsbio,lmt_h2sbio, lmt_dmsconc, lmt_dms,
-     .                                  flux_sparam_ind, flux_sparam_bb,
-     .                                  source_tr,flux_tr,tr_seri)
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after precur')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after precur')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after precur')
-      ENDIF
-
-c
-c
-c=======================================================================
-c                      EMISSIONS OF FINE AEROSOLS
-c=======================================================================
-c
-      CALL finemission(zdz,pdtphys,zalt,kminbc,kmaxbc,
-     .                 scale_param_bb,scale_param_ff,
-     .                 iregion_ind,iregion_bb,
-     .                 lmt_bcff, lmt_bcnff, lmt_bcbb_l,lmt_bcbb_h,
-     .                 lmt_bcba, lmt_omff, lmt_omnff,
-     .                 lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba,
-     .                                  flux_sparam_bb, flux_sparam_ff,
-     .                                        source_tr,flux_tr,tr_seri)
-c
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_fineem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after fineem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after fineem')
-      ENDIF
-c
-c=======================================================================
-c                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
-c=======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before depo')
-      ENDIF
-
-
-
-      CALL deposition(vdep_oce,vdep_sic,vdep_ter,vdep_lic,pctsrf,
-     .                zrho,zdz,pdtphys,RHcl,masse,t_seri,pplay,paprs,
-     .                lminmax,qmin,qmax,
-     .                         his_ds,source_tr,tr_seri)
-c
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after depo')
-      ENDIF
-
-c
-c
-c
-      DO it=1, nbtr
-c      print *,' BEFORE Cltrac'
-c      print *,'tr_seri = ',SUM(tr_seri(:,:,it)),MINVAL(tr_seri(:,:,it)),
-c     .                                         MAXVAL(tr_seri(:,:,it))
-c
-      DO j=1, klev
-      DO i=1, klon
-        tmp_var(i,j)=tr_seri(i,j,it)
-        aux_var2(i)=source_tr(i,it)
-      ENDDO
-      ENDDO
-      CALL cltrac_spl(pdtphys,coefh,yu1,yv1,t_seri,tmp_var,
-     .            aux_var2,paprs,pplay,aux_var3)
-
-! JEnew : to uopdate to the new cltrac     
-!       DO k = 1, klev
-!        DO i = 1, klon
-!         delp(i,k) = paprs(i,k)-paprs(i,k+1)
-!        END DO
-!      END DO
-!
-!      CALL cltrac(pdtphys, coefh,t_seri,tmp_var,paprs,pplay,
-!     .            delp,aux_var3,d_tr_dry,aux_var2)
-! Je new end
-
-!      print *,'CHECKING VALUES OUTSIDE OF CLTRAC'
-!      print *,'tmp_var = ',SUM(tmp_var),MINVAL(tmp_var),MAXVAL(tmp_var)
-!      print *,'aux_var2 = ',SUM(aux_var2),MINVAL(aux_var2),
-!     .                                   MAXVAL(aux_var2)
-!      print *,'aux_var3 = ',SUM(aux_var3),MINVAL(aux_var3),
-!     .                                   MAXVAL(aux_var3)
-      DO i=1, klon
-      DO j=1, klev
-        tr_seri(i,j,it)=tmp_var(i,j)
-        d_tr(i,j,it)=aux_var3(i,j)
-      ENDDO
-      ENDDO
-      DO k = 1, klev
-      DO i = 1, klon
-         tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr(i,k,it)
-      ENDDO
-      ENDDO
-      print *,' AFTER Cltrac'
-      IF (lminmax) THEN
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after cltrac')
-      ENDIF
-c
-      DO j=1,klev
-      DO i=1,klon
-         tmp_var(i,j)=tr_seri(i,j,it)
-      ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay,t_seri,tmp_var)
-      DO j=1,klev
-      DO i=1,klon
-         tr_seri(i,j,it)=tmp_var(i,j)
-      ENDDO
-      ENDDO
-c
-      ENDDO !--end itr loop
-
-c
-!      DO it=1,nbtr
-!      IF (lminmax) THEN
-!        DO j=1,klev
-!        DO i=1,klon
-!           tmp_var(i,j)=tr_seri(i,j,it)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxqfi2(tmp_var,qmin,qmax,'apr cltrac')
-!!        DO j=1,klev
-!!        DO i=1,klon
-!!           tr_seri(i,j,it)=tmp_var(i,j)
-!!        ENDDO
-!!        ENDDO
-!      ENDIF
-!      ENDDO
-c
-!      IF (lminmax) THEN
-!        DO j=1,nbtr
-!        DO i=1,klon
-!           tmp_var2(i,j)=source_tr(i,j)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxsource(tmp_var2,qmin,qmax,'src: apr cltrac')
-!        print *,'Source = ',SUM(source_tr),MINVAL(source_tr),
-!     .                                     MAXVAL(source_tr)
-!      ENDIF
-c
-c
-      print *,' BEFORE Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before sedi')
-      ENDIF
-
-      print *,'SPLA VERSION OF SEDIMENTATION IS USED'
-      CALL sediment_mod(t_seri,pplay,zrho,paprs,pdtphys,RHcl,!xlon,xlat,
-     .                               sed_ss,sed_dust,tr_seri)
-c
-      print *,'AFTER Sediment'
-!      DO it=1,nbtr
-!      IF (lminmax) THEN
-!        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after sedim')
-!      ENDIF
-!      ENDDO
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after sedi')
-      ENDIF
-c
-
-
-
-c
-c
-!      IF (lminmax) THEN
-!        DO j=1,nbtr
-!        DO i=1,klon
-!           tmp_var2(i,j)=source_tr(i,j)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxsource(tmp_var2,qmin,qmax,'src: apr sedim')
-!        print *,'Source = ',SUM(source_tr),MINVAL(source_tr),
-!     .                                     MAXVAL(source_tr)
-!      ENDIF
-c
-c=======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-c
-c======================================================================
-c                      GAS TO PARTICLE CONVERSION      
-c======================================================================
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_beforegastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before gastopar')
-      ENDIF
-
-
-
-      CALL gastoparticle(pdtphys,zdz,zrho,xlat,
-     .              pplay,t_seri,
-     .              tr_seri,his_g2pgas ,his_g2paer) 
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_gastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after gastopar')
-      ENDIF
-  
-
-!    DO it=1,nbtr
-!      IF (lminmax) THEN
-!        DO j=1,klev
-!        DO i=1,klon
-!           tmp_var(i,j)=tr_seri(i,j,it)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxqfi2(tmp_var,qmin,qmax,'apr gas2par')
-!        DO j=1,klev
-!        DO i=1,klon
-!           tr_seri(i,j,it)=tmp_var(i,j)
-!        ENDDO
-!        ENDDO
-!      ENDIF
-!      ENDDO
-c
-c
-!      IF (lminmax) THEN
-!        DO j=1,nbtr
-!        DO i=1,klon
-!           tmp_var2(i,j)=source_tr(i,j)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxsource(tmp_var2,qmin,qmax,'src: apr gas2par')
-!        print *,'Source = ',SUM(source_tr),MINVAL(source_tr),
-!     .                                     MAXVAL(source_tr)
-!      ENDIF
-c
-c======================================================================
-c                        EFFECT OF PRECIPITATION
-c======================================================================
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-c
-      IF (lessivage) THEN
-c
-      print *,' BEFORE Incloud'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_incloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before incloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before incloud')
-      ENDIF
-
-
-!      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-      CALL incloud_scav(.false.,qmin,qmax,masse,henry,kk,prfl,
-     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-     .                                     his_dhlsc,his_dhcon,tr_seri)
-c
-c
-      print *,' BEFORE blcloud (after incloud)'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,1)),MINVAL(tr_seri(:,:,1)),
-!     .                                         MAXVAL(tr_seri(:,:,1))
-!c
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,2)),MINVAL(tr_seri(:,:,2)),
-!     .                                         MAXVAL(tr_seri(:,:,2))
-!c
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,4)),MINVAL(tr_seri(:,:,4)),
-!     .                                         MAXVAL(tr_seri(:,:,4))
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_blcloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before blcloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before blcloud')
-      ENDIF
-
-!      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-      CALL blcloud_scav(.false.,qmin,qmax,pdtphys,prfl,psfl,
-     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-      print *,' AFTER blcloud '
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,1)),MINVAL(tr_seri(:,:,1)),
-!     .                                         MAXVAL(tr_seri(:,:,1))
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,2)),MINVAL(tr_seri(:,:,2)),
-!     .                                         MAXVAL(tr_seri(:,:,2))
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,4)),MINVAL(tr_seri(:,:,4)),
-!     .                                         MAXVAL(tr_seri(:,:,4))
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_blcloud')
-        ENDDO                           
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after blcloud')
-        ENDDO                                  
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after blcloud')
-      ENDIF
-
-
-      ENDIF !--lessivage
-c
-c
-!      IF (lminmax) THEN
-!        DO j=1,nbtr
-!        DO i=1,klon
-!           tmp_var2(i,j)=source_tr(i,j)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxsource(tmp_var2,qmin,qmax,'src: apr lessivage')
-!        print *,'Source = ',SUM(source_tr),MINVAL(source_tr),
-!     .                                     MAXVAL(source_tr)
-!      ENDIF
-c
-c======================================================================
-c                         EFFECT OF CONVECTION 
-c======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-      IF (convection) THEN
-c
-      print *,' BEFORE trconvect'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_trconve')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before trconve')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before trconve')
-      ENDIF
-
-
-
-
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-!     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
-!     .                                                 dtrconv,tr_seri)
-
-     
-        IF (iflag_con.EQ.2) THEN
-
-!JE desactiva trconvect
-        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,.false.,masse,
-     .                                                 dtrconv,tr_seri)
-
-        ELSE IF (iflag_con.GE.3) THEN
-        print *,'JE: iflag_con>=3: convective transport of tracers
-     .             deactivated'
-        DO it=1,nbtr
-        DO i=1,klon
-            dtrconv(i,it)=0.0
-        ENDDO
-        ENDDO
-
-        ENDIF
-! end JE desactiva trconvect
-
-c                  
-c                  
-!      DO it=1,nbtr
-!      IF (lminmax) THEN
-!        DO j=1,klev
-!        DO i=1,klon
-!           tmp_var(i,j)=tr_seri(i,j,it)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxqfi2(tmp_var,qmin,qmax,'apr trconv')
-!     
-!c        CALL minmaxqfi(tmp_var,qmin,qmax,'apr trconv')
-!        DO j=1,klev
-!        DO i=1,klon
-!           tr_seri(i,j,it)=tmp_var(i,j)
-!        ENDDO
-!        ENDDO
-!      ENDIF
-!      ENDDO
-      print *,' AFTER Trconvect'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after trconv')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-c
-c
-!      IF (lminmax) THEN
-!        DO j=1,nbtr
-!        DO i=1,klon
-!           tmp_var2(i,j)=source_tr(i,j)
-!        ENDDO
-!        ENDDO
-!        CALL minmaxsource(tmp_var2,qmin,qmax,'src: apr trconv')
-!        print *,'Source = ',SUM(source_tr),MINVAL(source_tr),
-!     .                                     MAXVAL(source_tr)
-!      ENDIF
-c
-      ENDIF ! convection
-c
-c=======================================================================
-c                         COMPUTING THE BURDEN
-c=======================================================================
-c      
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-c
-c Computing burden in mg/m2
-      DO it=1, nbtr
-      DO k=1, klev
-      DO i=1, klon
-        trm(i,it)=trm(i,it)+tr_seri(i,k,it)*1.e6*zdz(i,k)*
-     .            masse(it)*1.e3/RNAVO     !--mg S/m2
-      ENDDO
-      ENDDO
-      ENDDO
-c
-c Computing Surface concentration in ug/m3
-c
-      DO it=1, nbtr
-      DO i=1, klon
-        sconc_seri(i,it)=tr_seri(i,1,it)*1.e6*
-     .            masse(it)*1.e3/RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
-      ENDDO
-      ENDDO
-c
-c=======================================================================
-c                  CALCULATION OF OPTICAL PROPERTIES
-c=======================================================================
-c      
-      CALL aeropt_spl(zdz, tr_seri, RHcl,
-     .               diff_aod550_tot,diag_aod670_tot,diag_aod865_tot,
-     .               diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2,
-     .               diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,
-     .               diag_aod550_dust,diag_aod670_dust,diag_aod865_dust)
-c
-c======================================================================
-c   Stockage sur bande histoire
-c======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-c
-c======================================================================
-c  SAVING AEROSOL RELATED VARIABLES INTO FILE
-c======================================================================
-c
-      IF (ok_histrac) THEN
-c
-      ndex2d = 0
-      ndex3d = 0 
-c
-      itra=itra+1
-
-      print *,'SAVING VARIABLES FOR DAY ',itra
-c
-      fluxbb(:)=0.0
-      fluxff(:)=0.0
-      fluxbcbb(:)=0.0
-      fluxbcff(:)=0.0
-      fluxbcnff(:)=0.0
-      fluxbcba(:)=0.0
-      fluxbc(:)=0.0
-      fluxombb(:)=0.0
-      fluxomff(:)=0.0
-      fluxomnat(:)=0.0
-      fluxomba(:)=0.0
-      fluxomnff(:)=0.0
-      fluxom(:)=0.0
-      fluxh2sff(:)=0.0
-      fluxh2snff(:)=0.0
-      fluxh2sbio(:)=0.0
-      fluxso2ff(:)=0.0
-      fluxso2nff(:)=0.0
-      fluxso2bb(:)=0.0
-      fluxso2vol(:)=0.0
-      fluxso2ba(:)=0.0
-      fluxso2(:)=0.0
-      fluxso4ff(:)=0.0
-      fluxso4nff(:)=0.0
-      fluxso4bb(:)=0.0
-      fluxso4ba(:)=0.0
-      fluxso4(:)=0.0
-      fluxdms(:)=0.0
-      fluxdustec(:)=0.0
-      fluxddfine(:)=0.0
-      fluxddcoa(:)=0.0
-      fluxdd(:)=0.0
-      fluxssfine(:)=0.0
-      fluxsscoa(:)=0.0
-      fluxss(:)=0.0
-      DO i=1, klon
-         IF (iregion_ind(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxh2sff(i)= (lmt_so2ff_l(i)+lmt_so2ff_h(i))*frach2sofso2*
-     .                    scale_param_ind(iregion_ind(i))*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-           fluxso2ff(i)=scale_param_ind(iregion_ind(i)) * fracso2emis *
-     .                   (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4ff(i)=scale_param_ind(iregion_ind(i))*(1-fracso2emis)*
-     .                    (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcff(i)=scale_param_ff(iregion_ind(i))*
-     .                                        lmt_bcff(i)*1.e4*1.e3  !/g/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxomff(i)=scale_param_ff(iregion_ind(i))*
-     .                          (lmt_omff(i))*1.e4*1.e3  !/g/m2/s
-           ! FOSSIL FUEL EMISSIONS
-           fluxff(i)=fluxbcff(i)+fluxomff(i)
-         ENDIF
-         IF (iregion_bb(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxso2bb(i) =scale_param_bb(iregion_bb(i)) * fracso2emis *
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4bb(i) =scale_param_bb(iregion_bb(i))*(1-fracso2emis)*
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcbb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_bcbb_l(i)+lmt_bcbb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxombb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_ombb_l(i)+lmt_ombb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! BIOMASS BURNING EMISSIONS
-           fluxbb(i)=fluxbcbb(i)+fluxombb(i)
-         ENDIF
-         ! H2S EMISSIONS
-         fluxh2sbio(i)=lmt_h2sbio(i)*1.e4/RNAVO*masse_s*1.e3      ! mgS/m2/s
-         fluxh2snff(i)= lmt_so2nff(i)*frach2sofso2*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-         ! SULFUR DIOXIDE EMISSIONS
-         fluxso2nff(i)=fracso2emis * lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso2vol(i)=(lmt_so2volc_cont(i)+lmt_so2volc_expl(i))
-     .                 *1.e4/RNAVO*masse_s*1.e3        ! mgS/m2/s
-         fluxso2ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3*
-     .                                                   fracso2emis ! mgS/m2/s
-         fluxso2(i)=fluxso2ff(i)+fluxso2bb(i)+fluxso2nff(i)+
-     .              fluxso2vol(i)+fluxso2ba(i)
-         ! DMS EMISSIONS
-         fluxdms(i)=( lmt_dms(i)+lmt_dmsbio(i) )
-     .              *1.e4/RNAVO*masse_s*1.e3          ! mgS/m2/s
-         ! SULPHATE EMISSIONS
-         fluxso4ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3
-     .                 *(1-fracso2emis) ! mgS/m2/s
-         fluxso4nff(i)=(1-fracso2emis)*lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso4(i)=fluxso4ff(i)+fluxso4bb(i)+fluxso4ba(i)+fluxso4nff(i)
-         ! BLACK CARBON EMISSIONS
-
-         fluxbcnff(i)=lmt_bcnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxbcba(i)=lmt_bcba(i)*1.e4*1.e3    !mg/m2/s
-         fluxbc(i)=fluxbcbb(i)+fluxbcff(i)+fluxbcnff(i)+fluxbcba(i)
-         ! ORGANIC MATTER EMISSIONS
-         fluxomnat(i)=lmt_omnat(i)*1.e4*1.e3  !mg/m2/s
-         fluxomba(i)=lmt_omba(i)*1.e4*1.e3  !mg/m2/s
-         fluxomnff(i)=lmt_omnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxom(i)=fluxombb(i)+fluxomff(i)+fluxomnat(i)+fluxomba(i)+
-     .             fluxomnff(i)
-        ! DUST EMISSIONS 
-         fluxdustec(i)=dust_ec(i)*1.e6
-         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
-     .                                  * dust_ec(i)*0.093*1.e6
-         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
-     .                                  * dust_ec(i)*0.905*1.e6
-         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
-        ! SEA SALT EMISSIONS 
-         fluxssfine(i)=scale_param_ssacc*lmt_sea_salt(i,1)*1.e4*1.e3
-         fluxsscoa(i)=scale_param_sscoa*lmt_sea_salt(i,2)*1.e4*1.e3
-         fluxss(i)=fluxssfine(i)+fluxsscoa(i)
-      ENDDO
-c
-c SAVING VARIABLES IN TRACEUR
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c     
-      DO it=1,nbtr
-c
-      WRITE(str2,'(i2.2)') it
-c 
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,trm(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"trm"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sconc_seri(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"sconc"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-c SAVING VARIABLES IN LESSIVAGE
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_tr(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"flux"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_ds(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"ds"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      DO i=1, klon
-        zx_tmp_fi2d(i) = his_dhlsc(i,it)+his_dhcon(i,it)+
-     .                   his_dhbclsc(i,it)+his_dhbccon(i,it)
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,zx_tmp_fi2d,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dh"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-C
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,dtrconv(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dtrconv"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_ss",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_dust",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)              
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2pgas,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_gas",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2paer,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_aer",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c SAVING VARIABLES IN HISTRAC
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-c ========================= BC =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbc,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbc",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= OM =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxombb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxombb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnat,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnat",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxom,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxom",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO4 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= H2S =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2snff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2snff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sbio,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sbio",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO2 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2vol,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2vol",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdms,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdms",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= DD =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdustec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdustec",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdd,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdd",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c ========================= SS =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxsscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxsscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxss,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxss",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,fluxso4chem,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"fluxso4chem",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ind,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ind",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_bb",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ff",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_sscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_sscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,u10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"u10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,v10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"v10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,flux_sparam_sulf,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"flux_sparam_sulf",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      ENDIF ! ok_histrac
-      print *,'END PHYTRACR_SPL '
-
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl.F_20140506_seq
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl.F_20140506_seq	(revision 2196)
+++ 	(revision )
@@ -1,3047 +1,0 @@
-      SUBROUTINE phytracr_spl ( debutphy, iflag_conv,
-     I                   pdtphys,ftsol,tsol, 
-     I                   t_seri,q_seri,paprs,pplay,RHcl,
-     I                   pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,
-     I                   coefh, cdragh, cdragm, yu1, yv1, 
-     I                   u_seri, v_seri, xlat,xlon,
-     I                   pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,
-     I                   da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,
-     I                   epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,
-     I                   evap,wdtrainA,  wdtrainM,wght_cvfd,
-     I                   fm_therm, entr_therm, rneb,
-     I                   beta_fisrt,beta_v1,
-     P                   scale_param_ssacc,
-     P                   scale_param_sscoa,scale_param_ind,
-     P                   scale_param_bb,scale_param_ff,
-     P                   scale_param_dustacc,scale_param_dustcoa,
-     E                   dust_ec,u10m_ec,v10m_ec,
-     E                   lmt_sea_salt,
-     E                   lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     E                   lmt_so2bb_l, lmt_so2bb_h,
-     E                   lmt_so2volc_cont,lmt_altvolc_cont,
-     E                   lmt_so2volc_expl,lmt_altvolc_expl,
-     E                   lmt_dmsbio,lmt_h2sbio,lmt_dmsconc,
-     E                   lmt_bcff,lmt_bcnff,lmt_bcbb_l,lmt_bcbb_h,
-     E                   lmt_bcba,lmt_omff,lmt_omnff,lmt_ombb_l,
-     E                   lmt_ombb_h,lmt_omnat,lmt_omba,
-     O                   tr_seri,
-     O                   diff_aod550_tot,diag_aod865_tot,
-     O                   diff_aod550_tr2,diag_aod865_tr2,
-     O                   diag_aod550_dust,diag_aod865_dust,
-     O                   diag_aod550_ss,diag_aod865_ss)
-!     E                   wth,cly,zprecipinsoil,lmt_sea_salt, ! Titane
-c
-      USE IOIPSL
-      USE dimphy
-      USE infotrac
-      USE indice_sol_mod
-c
-      IMPLICIT none
-c
-c======================================================================
-c Auteur(s) FH
-c Objet: Moniteur general des tendances traceurs
-c
-c Remarques en vrac:
-c ------------------
-c 1/ le call phytrac se fait avec nqmax-2 donc nous avons bien 
-c les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
-c======================================================================
-#include "dimensions.h"
-#include "chem.h"
-#include "../phylmd/YOMCST.h"
-#include "../phylmd/YOETHF.h"
-c #include "../phylmd/dimphy.h"
-c #include "../phylmd/indicesol.h"
-#include "paramet.h"
-#include "thermcell.h"
-
-c======================================================================
-
-c Arguments:
-c
-c   EN ENTREE:
-c   ==========
-c
-c   divers:
-c   -------
-c
-      real pdtphys  ! pas d'integration pour la physique (seconde)
-      real ftsol(klon,nbsrf)  ! temperature du sol par type
-      real tsol(klon)         ! temperature du sol moyenne
-      real t_seri(klon,klev)  ! temperature
-      real u_seri(klon,klev)  ! vent
-      real v_seri(klon,klev)  ! vent
-      real q_seri(klon,klev)  ! vapeur d eau kg/kg
-      real tr_seri(klon,klev,nbtr) ! traceur  
-      real tmp_var(klon,klev) ! auxiliary variable to replace traceur  
-      real tmp_var2(klon,nbtr) ! auxiliary variable to replace source
-      real tmp_var3(klon,klev,nbtr) ! auxiliary variable 3D  
-      real dummy1d ! JE auxiliary variable
-      real aux_var2(klon) ! auxiliary variable to replace traceur  
-      real aux_var3(klon,klev) ! auxiliary variable to replace traceur  
-      real d_tr(klon,klev,nbtr)    ! traceur  tendance
-      real sconc_seri(klon,nbtr) ! surface concentration of traceur  
-c
-      integer nbjour
-      save nbjour
-c
-      REAL diff_aod550_tot(klon)  ! epaisseur optique total aerosol 550  nm
-      REAL diag_aod670_tot(klon)  ! epaisseur optique total aerosol 670 nm
-      REAL diag_aod865_tot(klon)  ! epaisseur optique total aerosol 865 nm
-      REAL diff_aod550_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
-      REAL diag_aod670_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
-      REAL diag_aod865_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
-      REAL diag_aod550_ss(klon)   ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
-      REAL diag_aod670_ss(klon)   ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
-      REAL diag_aod865_ss(klon)   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
-      REAL diag_aod550_dust(klon) ! epaisseur optique Dust aerosol 550 nm, diagnostic
-      REAL diag_aod670_dust(klon) ! epaisseur optique Dust aerosol 670 nm, diagnostic
-      REAL diag_aod865_dust(klon) ! epaisseur optique Dust aerosol 865 nm, diagnostic
-c
-      real paprs(klon,klev+1)  ! pression pour chaque inter-couche (en Pa)
-      real pplay(klon,klev)  ! pression pour le mileu de chaque couche (en Pa)
-      real RHcl(klon,klev)  ! humidite relativen ciel clair
-      real znivsig(klev)  ! indice des couches
-      real paire(klon)
-      real pphis(klon)
-      real pctsrf(klon,nbsrf)
-      logical debutphy   ! le flag de l'initialisation de la physique
-c
-c   Scaling Parameters:
-c   ----------------------
-c
-      CHARACTER*33 c_Directory
-      CHARACTER*33 c_FileName1
-      CHARACTER*42 c_FileName2
-      CHARACTER*71 c_FullName1
-      CHARACTER*77 c_FullName2
-      INTEGER :: xidx, yidx
-      INTEGER,DIMENSION(klon) :: mask_bbreg
-      INTEGER,DIMENSION(klon) :: mask_ffso2reg
-      INTEGER :: aux_mask1
-      INTEGER :: aux_mask2
-
-      INTEGER iregion_so4(klon)  !Defines regions for SO4
-      INTEGER iregion_ind(klon)  !Defines regions for SO2, BC & OM
-      INTEGER iregion_bb(klon)   !Defines regions for SO2, BC & OM
-      INTEGER iregion_dust(klon) !Defines  dust regions
-c      REAL scale_param_sulf(jjm+1)  !Scaling parameter for sulfate (input)
-c      REAL scale_param_so4(klon)  !Scaling parameter for sulfate used whithin phytrac
-      REAL scale_param_ssacc  !Scaling parameter for Fine Sea Salt
-      REAL scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
-      REAL scale_param_ind(nbreg_ind) !Scaling parameter for industrial emissionsi of SO2
-      REAL scale_param_bb(nbreg_bb)  !Scaling parameter for biomas burning (SO2, BC & OM)
-      REAL scale_param_ff(nbreg_ind)  !Scaling parameter for industrial emissions (fossil fuel)
-      REAL scale_param_dustacc(nbreg_dust)  !Scaling parameter for Fine Dust
-      REAL scale_param_dustcoa(nbreg_dust)  !Scaling parameter for Coarse Dust
-c
-c   Emissions:
-c   ---------
-c
-c---------------------------- SEA SALT & DUST emissions ------------------------
-      REAL lmt_sea_salt(klon,ss_bins) !Sea salt 0.03-8.0 um
-      REAL u10m_ec1(klon),v10m_ec1(klon)
-      REAL u10m_ec2(klon),v10m_ec2(klon),dust_ec2(klon)
-      REAL dust_ec(klon)
-!      REAL cly(klon),wth(klon),zprecipinsoil(klon)   ! Titane
-c------------------------- SULFUR emissions ----------------------------
-      REAL lmt_so2volc_cont(klon)  ! emissions so2 volcan (continuous)
-      REAL lmt_altvolc_cont(klon)  ! altitude  so2 volcan (continuous)
-      REAL lmt_so2volc_expl(klon)  ! emissions so2 volcan (explosive)
-      REAL lmt_altvolc_expl(klon)  ! altitude  so2 volcan (explosive)
-      REAL lmt_so2ff_l(klon)       ! emissions so2 fossil fuel (low)
-      REAL lmt_so2ff_h(klon)       ! emissions so2 fossil fuel (high)
-      REAL lmt_so2nff(klon)        ! emissions so2 non-fossil fuel
-      REAL lmt_so2bb_l(klon)       ! emissions de so2 biomass burning (low)
-      REAL lmt_so2bb_h(klon)       ! emissions de so2 biomass burning (high)
-      REAL lmt_so2ba(klon)         ! emissions de so2 bateau
-      REAL lmt_dms(klon)           ! emissions de dms
-      REAL lmt_dmsconc(klon)       ! concentration de dms oceanique
-      REAL lmt_dmsbio(klon)        ! emissions de dms bio 
-      REAL lmt_h2sbio(klon)        ! emissions de h2s bio
-c------------------------- BLACK CARBON emissions ----------------------
-      REAL lmt_bcff(klon)       ! emissions de BC fossil fuels
-      REAL lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
-      REAL lmt_bcbb_l(klon)     ! emissions de BC biomass basses
-      REAL lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
-      REAL lmt_bcba(klon)      ! emissions de BC bateau
-c------------------------ ORGANIC MATTER emissions ---------------------      
-      REAL lmt_omff(klon)     ! emissions de OM fossil fuels
-      REAL lmt_omnff(klon)    ! emissions de OM non-fossil fuels
-      REAL lmt_ombb_l(klon)   ! emissions de OM biomass basses
-      REAL lmt_ombb_h(klon)   ! emissions de OM biomass hautes
-      REAL lmt_omnat(klon)    ! emissions de OM Natural
-      REAL lmt_omba(klon)     ! emissions de OM bateau
-                                                                        
-c
-c  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
-c
-c   convection:
-c   -----------
-c
-      REAL pmfu(klon,klev)  ! flux de masse dans le panache montant
-      REAL pmfd(klon,klev)  ! flux de masse dans le panache descendant
-      REAL pen_u(klon,klev) ! flux entraine dans le panache montant
-      REAL pde_u(klon,klev) ! flux detraine dans le panache montant
-      REAL pen_d(klon,klev) ! flux entraine dans le panache descendant
-      REAL pde_d(klon,klev) ! flux detraine dans le panache descendant
-c
-c  Convection KE scheme:
-c  ---------------------
-c
-c! Variables pour le lessivage convectif
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated
-c            updraft mass flux
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated
-c            downdraft mass flux
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: evap
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
-
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
-       REAL,DIMENSION(klon),INTENT(IN)           :: sigd
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
-       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)      :: wght_cvfd          !RL
-
-
-c     KE: Tendances de traceurs (Td) et flux de traceurs:
-!     ------------------------
-       REAL,DIMENSION(klon,klev)      :: Mint
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPr,qDi ! concentration tra
-c       dans pluie,air descente insaturee
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPa,qMel
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qTrdi,dtrcvMA ! conc traceur
-c              descente air insaturee et td convective MA
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv  ! Td convection/traceur
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_th  ! Td thermique
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_insc
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_bcscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_evapls
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_ls
-       REAL,DIMENSION(:,:),ALLOCATABLE,SAVE      :: qPrls      !jyg: concentration 
-!                                                        !tra dans pluie LS a la surf.
-!      outputs for cvltr_spl
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv_o  
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav_o
-
-
-
-       INTEGER ::  nsplit
-!
-
-     
-
-!CHECK!!
-!!!$OMP
-!!!!THREADPRIVATE(qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa,d_tr_lessi_nucl)
-!!!!$OMP THREADPRIVATE(d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qPr,qDi)
-!$OMP THREADPRIVATE(d_tr_insc,d_tr_bcscav,d_tr_evapls,d_tr_ls,qPrls)
-!!!!!$OMP THREADPRIVATE(d_tr,d_tr_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
-
-
-c
-c  Lessivage
-c  ---------
-c
-      REAL pmflxr(klon,klev+1), pmflxs(klon,klev+1)   !--convection
-      REAL prfl(klon,klev+1),   psfl(klon,klev+1)     !--large-scale
-! JE      REAL pmflxr(klon,klev), pmflxs(klon,klev)   !--convection       ! Titane
-! JE      REAL prfl(klon,klev),   psfl(klon,klev)     !--large-scale      ! Titane
-      REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
-      REAL  :: ql_incloud_ref    ! ref value of in-cloud condensed water content
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb    ! fraction nuageuse (grande echelle)
-!
-
-      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,SAVE  :: iflag_lscav_omp,iflag_lscav
-
-
-
-
-!Thermiques:
-!----------
-      REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-      REAL,DIMENSION(klon,klev),INTENT(IN)     :: entr_therm
-
-
-c
-c   Couche limite:
-c   --------------
-c
-      REAL coefh(klon,klev) ! coeff melange CL
-      REAL cdragh(klon), cdragm(klon)
-      REAL yu1(klon)        ! vent dans la 1iere couche
-      REAL yv1(klon)        ! vent dans la 1iere couche
-c
-c
-c----------------------------------------------------------------------
-      REAL his_ds(klon,nbtr)
-      REAL his_dhlsc(klon,nbtr)        ! in-cloud scavenging lsc
-      REAL his_dhcon(klon,nbtr)       ! in-cloud scavenging con
-      REAL his_dhbclsc(klon,nbtr)      ! below-cloud scavenging lsc
-      REAL his_dhbccon(klon,nbtr)      ! below-cloud scavenging con
-      REAL trm(klon,nbtr)
-c
-      REAL u10m_ec(klon), v10m_ec(klon)
-c
-      REAL his_th(klon,nbtr)
-      REAL his_dhkecv(klon,nbtr)
-      REAL his_dhkelsc(klon,nbtr)
-
-
-c
-c   Coordonnees
-c   -----------
-c
-      REAL xlat(klon)       ! latitudes pour chaque point 
-      REAL xlon(klon)       ! longitudes pour chaque point 
-C
-      INTEGER i, k, it, j, ig 
-c
-c DEFINITION OF DIAGNOSTIC VARIABLES
-c
-      REAL diag_trm(nbtr), diag_drydep(nbtr) 
-      REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
-      REAL diag_emissn(nbtr), diag_g2part
-      REAL diag_sedimt
-      REAL trm_aux(nbtr), src_aux(nbtr)
-c
-c Variables locales pour effectuer les appels en serie
-c----------------------------------------------------
-      REAL source_tr(klon,nbtr)
-      REAL flux_tr(klon,nbtr)
-      REAL m_conc(klon,klev)
-      REAL sed_ss(klon)    ! corresponds to tracer 3
-      REAL sed_dust(klon)  ! corresponds to tracer 4
-      REAL henry(nbtr)  !--cste de Henry  mol/l/atm
-      REAL kk(nbtr)     !--coefficient de var avec T (K)
-      REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
-      REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
-      REAL vdep_oce(nbtr), vdep_sic(nbtr)
-      REAL vdep_ter(nbtr), vdep_lic(nbtr)
-      REAL dtrconv(klon,nbtr)
-      REAL zrho(klon,klev), zdz(klon,klev)
-      REAL zalt(klon,klev)
-      REAL,DIMENSION(klon,klev)      :: zmasse    ! densité atmosphérique
-c     .                                              Kg/m2
-      REAL,DIMENSION(klon,klev)      :: ztra_th
-      REAL qmin, qmax, aux
-!      PARAMETER (qmin=0.0, qmax=1.e33)
-      PARAMETER (qmin=1.e33, qmax=-1.e33)
-
-c Variables to save data into file
-c----------------------------------
-   
-      CHARACTER*2 str2
-      LOGICAL ok_histrac
-      PARAMETER (ok_histrac=.true.)
-      INTEGER ndex2d(iim*(jjm+1)), ndex3d(iim*(jjm+1)*klev)
-      INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
-      INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      INTEGER itra
-      SAVE itra                    ! compteur pour la physique
-      INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
-      REAL zx_tmp_2d(iim,jjm+1), zx_tmp_3d(iim,jjm+1,klev)
-      REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
-      REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
-      REAL zsto, zout, zout_h, zout_m, zjulian
-      REAL fluxbb(klon), fluxff(klon)
-      REAL fluxbcbb(klon), fluxbcff(klon), fluxbcnff(klon)
-      REAL fluxombb(klon), fluxomff(klon), fluxomnat(klon)
-      REAL fluxomnff(klon), fluxomba(klon), fluxbcba(klon)
-      REAL fluxso2ff(klon), fluxso2bb(klon), fluxso2(klon)
-      REAL fluxso2nff(klon), fluxso2vol(klon), fluxso2ba(klon) 
-      REAL fluxh2sff(klon), fluxh2snff(klon)
-      REAL fluxso4ff(klon), fluxso4bb(klon), fluxso4ba(klon)
-      REAL fluxh2sbio(klon), fluxso4nff(klon)
-      REAL fluxdms(klon)
-      REAL fluxbc(klon), fluxom(klon), fluxso4(klon)
-      REAL fluxdd(klon), fluxss(klon)
-      REAL fluxdustec(klon), fluxssfine(klon), fluxsscoa(klon)
-      REAL fluxddfine(klon), fluxddcoa(klon)
-      REAL flux_sparam_bb(klon), flux_sparam_ff(klon)
-      REAL flux_sparam_ind(klon) !, flux_sparam_sulf(klon,klev)
-      REAL flux_sparam_ddfine(klon), flux_sparam_ddcoa(klon)
-      REAL flux_sparam_ssfine(klon), flux_sparam_sscoa(klon)
-
-c------------------DMS  SO2  SO4   H2S  DMSO MSA H2O2 
-c------------------BC1, BC2, OM1, OM2,flyash  dust1   dust2 
-c------------------Sea Salt 1-8 bins 
-c------------------Precursors (gases), Fine, Coarse Aerosols
-C c
-C       DATA henry   /1.4, 0.0, 0.0, 0.0/
-C c
-C       DATA kk      /2900., 0., 0., 0./
-C c
-C       DATA alpha_r /0., 0.001, 0.001, 0.001/
-C c
-C       DATA alpha_s /0., 0.01, 0.01, 0.01/
-C c
-C cnhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-C cnhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-C       DATA vdep_oce /0.28, 0.28, 1.2, 1.2/
-C c
-C       DATA vdep_sic /0.2, 0.17, 1.2, 1.2/
-C c
-C       DATA vdep_ter /0.3, 0.14, 1.2, 1.2/
-
-C       DATA vdep_lic /0.2, 0.17, 1.2, 1.2/
-      
-c------Molar Masses
-      REAL masse(nbtr)
-c
-      REAL fracso2emis                              !--fraction so2 emis en so2
-      PARAMETER (fracso2emis=0.95) 
-      REAL frach2sofso2                             !--fraction h2s from so2
-      PARAMETER (frach2sofso2=0.0426)
-c
-c   Controles
-c-------------
-      LOGICAL convection,lessivage,lminmax
-      DATA convection,lessivage,lminmax
-     s     /.true.,.true.,.true./
-c
-      REAL xconv(nbtr)
-c
-      LOGICAL anthropo, bateau, edgar
-      DATA anthropo,bateau,edgar/.true.,.true.,.true./
-c
-cc bc_source
-      INTEGER kminbc, kmaxbc
-      PARAMETER (kminbc=3, kmaxbc=5)
-c
-      REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
-c
-c JE for updating in  cltrac
-      REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
-      REAL,DIMENSION(klon,nbtr)       :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-      REAL,DIMENSION(klon,nbtr)        ::  flux_tr_dry
-c      SAVE  d_tr_dry
-c JE for include gas to particle conversion in output
-      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
-      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
-c
-      INTEGER iflag_conv
-      LOGICAL iscm3  ! debug variable. for checkmass ! JE
-
-c------------------------------------------------------------------------
-c   only to compute time consumption of each process
-c----
-      INTEGER clock_start,clock_end,clock_rate,clock_start_spla
-      INTEGER clock_end_outphytracr,clock_start_outphytracr
-      INTEGER ti_init,dife,ti_inittype,ti_inittwrite
-      INTEGER ti_spla,ti_emis,ti_depo,ti_cltr,ti_ther
-      INTEGER ti_sedi,ti_gasp,ti_wetap,ti_cvltr,ti_lscs,ti_brop,ti_outs
-      INTEGER ti_nophytracr,clock_per_max
-      REAL tia_init,tia_inittype,tia_inittwrite
-      REAL tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther
-      REAL tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs
-      REAL tia_brop,tia_outs
-      REAL tia_nophytracr
- 
-      SAVE tia_init,tia_inittype,tia_inittwrite
-      SAVE tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther
-      SAVE tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs
-      SAVE tia_brop,tia_outs
-      SAVE ti_nophytracr
-      SAVE tia_nophytracr
-      SAVE clock_end_outphytracr,clock_start_outphytracr
-      SAVE clock_per_max
-      LOGICAL logitime
-
-c======================================================================
-c   INITIALISATIONS
-c======================================================================
-c
-c computing time
-        logitime=.true.
-        IF (logitime) THEN
-        clock_start=0
-        clock_end=0
-        clock_rate=0
-       CALL SYSTEM_CLOCK(COUNT_RATE=clock_rate,COUNT_MAX=clock_per_max)
-        CALL SYSTEM_CLOCK(COUNT=clock_start_spla)
-        clock_start=clock_start_spla
-!        IF (.NOT.debutphy) THEN
-        clock_end_outphytracr=clock_start_spla
-!        print*,'JE clock',clock_rate,clock_per_max
-!        ENDIF
-        ENDIF
-
-
-
-c---fraction of tracer that is convected (??
-      xconv(1)=0.8
-      xconv(2)=0.5
-      xconv(3)=0.5
-      xconv(4)=0.6
-
-      masse(1)=32.
-      masse(2)=6.02e23
-      masse(3)=6.02e23
-      masse(4)=6.02e23 
-
-      henry= (/1.4, 0.0, 0.0, 0.0/)
-      kk = (/2900., 0., 0., 0./)
-      alpha_r =  (/0., 0.001, 0.001, 0.001/)
-      alpha_s = (/0., 0.01, 0.01, 0.01/)
-
-c nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-c nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-      vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
-      vdep_sic = (/0.2, 0.17, 1.2, 1.2/)     
-      vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
-      vdep_lic = (/0.2, 0.17, 1.2, 1.2/)      
-
-
-
-      lmt_dms(:)=0.0
-      aux_var2(:)=0.0
-      aux_var3(:,:)=0.0
-      source_tr(:,:)=0.0
-      flux_tr(:,:)=0.0
-      flux_sparam_bb(:)=0.0
-      flux_sparam_ff(:)=0.0
-      flux_sparam_ind(:)=0.0
-      flux_sparam_ddfine(:)=0.0
-      flux_sparam_ddcoa(:)=0.0
-      flux_sparam_ssfine(:)=0.0
-      flux_sparam_sscoa(:)=0.0
-      
-      d_tr_dry(:,:)=0.0
-      flux_tr_dry(:,:)=0.0
-!
-      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
-      RG = 9.80665
-      RNAVO =6.02e23
-      RLVTT=2.5008E+6
-      RLSTT=2.8345E+6
-      R4IES=7.66
-      R3IES=21.875
-      R4LES=35.86
-      R3LES=17.269
-      RTT=273.16
-      RMV=18.0153
-      RKBOL=1.380658E-23
-      R=RNAVO*RKBOL
-      R5LES=R3LES*(RTT-R4LES)
-      R5IES=R3IES*(RTT-R4IES)
-      RV=1000.*R/RMV
-      RCPV=4.*RV
-      RCPD=3.5*RD
-      RVTMP2=RCPV/RCPD-1
-      RETV=RV/RD-1.
-
-c
-      iscm3=.false.
-      if (debutphy) then
-         print *, 'let s check nbtr=', nbtr
-         print *, 'xlat and xlon'
-c JE   initializon to cero the tracers     
-         DO it=1, nbtr
-            tr_seri(:,:,it)=0.0
-         ENDDO
-c JE end     
-! Initializing to zero tr_seri for comparison purposes
-!        tr_seri(:,:,:)=0.0
-c
-!        DO it=1,nbtr
-!           trm_aux(it)=0.0
-!           src_aux(it)=0.0
-!           diag_trm(it)=0.0
-!           diag_drydep(it)=0.0
-!           diag_wetdep(it)=0.0
-!           diag_cvtdep(it)=0.0
-!           diag_emissn(it)=0.0
-!        ENDDO
-!        diag_g2part=0.0
-         print *,'PREPARE FILES TO SAVE VARIABLES'
-c
-         nbjour=30
-         ecrit_tra =   NINT(86400./pdtphys)                    !--1-day  average
-         ecrit_tra_h = NINT(86400./pdtphys*0.25)               !--6-hour average
-         ecrit_tra_m = NINT(86400./pdtphys*FLOAT(nbjour))      !--1-mth  average
-         print *,'ecrit_tra=', pdtphys, ecrit_tra
-
-         IF (ok_histrac) THEN
-  
-           itra=0
-c
-           CALL ymds2ju(1900, 1, 1, 0.0, zjulian)
-c
-           print *, 'klon,iim,jjm+1 = ',klon,iim,jjm+1
-           CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlon,zx_lon)
-c
-           DO i = 1, iim
-             zx_lon(i,1) = xlon(i+1)
-             zx_lon(i,jjm+1) = xlon(i+1)
-           ENDDO
-c
-           CALL histbeg("histrac_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori1, nid_tra1)
-c
-           CALL histbeg("lessivage_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori2, nid_tra2)
-c
-           CALL histbeg("traceur_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori3, nid_tra3)
-c
-           CALL histvert(nid_tra1, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra2, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra3, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           zsto = pdtphys
-           zout = pdtphys * FLOAT(ecrit_tra)
-           zout_h = pdtphys * FLOAT(ecrit_tra_h)
-           zout_m = pdtphys * FLOAT(ecrit_tra_m)
-           print *,'zsto zout=', zsto, zout
-
-c
-c----------------- HISTORY FILES OF TRACER EMISSIONS -------------------
-c
-c HISTRAC
-c
-           CALL histdef(nid_tra1, "fluxbb", "Flux BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxff", "Flux FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcbb", "Flux BC-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcff", "Flux BC-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcnff", "Flux BC-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcba", "Flux BC-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbc", "Flux BC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxombb", "Flux OM-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomff", "Flux OM-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnff", "Flux OM-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomba", "Flux OM-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnat", "Flux OM-NT", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxom", "Flux OM", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sff","Flux H2S FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2snff","Flux H2S non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2ff","Flux SO2 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2nff","Flux SO2 non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2bb", "Flux SO2 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2vol","Flux SO2 Vol","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2ba", "Flux SO2 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2", "Flux SO2","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4ff","Flux SO4 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4nff","Flux SO4 non-FF",
-     .                  "mgS/m2/s", iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4bb", "Flux SO4 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4ba", "Flux SO4 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4", "Flux SO4","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdms", "Flux DMS", "mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sbio","Flux H2S Bio","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdustec", 
-     .                                 "Flux Dust EC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddfine","DD Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddcoa","DD Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxdd","Flux DD","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxssfine","SS Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxsscoa","SS Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxss","Flux SS","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"fluxso4chem","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ind","Ind emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_bb","BB emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ff","FF emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddfine","DD fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddcoa","DD coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ssfine","SS fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_sscoa","SS coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"u10m","Zonal wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"v10m","Meridional wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"flux_sparam_sulf","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-c TRACEUR
-c
-           CALL histdef(nid_tra3, "taue550", "Tau ext 550", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670", "Tau ext 670", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865", "Tau ext 865", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_tr2", "Tau ext 550tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_tr2", "Tau ext 670tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_tr2", "Tau ext 865tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_ss", "Tau ext 550ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_ss", "Tau ext 670ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_ss", "Tau ext 865ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_dust", "Tau ext 550dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_dust", "Tau ext 670dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_dust", "Tau ext 865dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-           DO it=1, nbtr
-c
-           WRITE(str2,'(i2.2)') it
-c
-           CALL histdef(nid_tra3, "trm"//str2, "Burden No."//str2, 
-     .                  "mgS/m2", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "sconc"//str2, "Surf Conc. No."//str2,
-     .                  "mg/m3", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c LESSIVAGE
-c
-           CALL histdef(nid_tra2, "flux"//str2, "emission"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "ds"//str2, "Depot sec No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dh"//str2,
-     .                  "Depot hum No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dtrconv"//str2,
-     .                  "Tiedke convective"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-           CALL histdef(nid_tra2,"dtherm"//str2,
-     .                  "Thermals dtracer"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-           CALL histdef(nid_tra2,"dhkecv"//str2,
-     .                  "KE dep hum convective"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"dhkelsc"//str2,
-     .                  "KE dep hum large scale"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-
-           CALL histdef(nid_tra2,"d_tr_cv"//str2,
-     .                  "cvltr d_tr_cv"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"d_tr_trsp"//str2
-     .                  ,"cvltr d_tr_trsp"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"d_tr_sscav"//str2
-     .                  ,"cvltr d_tr_sscav"//str2,"mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"d_tr_sat"//str2
-     .                  ,"cvltr d_tr_sat"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-         CALL histdef(nid_tra2,"d_tr_uscav"//str2
-     .                  ,"cvltr d_tr_uscav"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-
-
-
-c
-           ENDDO
-c
-           CALL histdef(nid_tra2, "sed_ss", "Sedmet. Tr3", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "sed_dust", "Sedmet. Tr4", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)         
-c
-           CALL histdef(nid_tra2, "g2p_gas", "Gas2particle gas sink", 
-     .                  "mg-S/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "g2p_aer", "Gas2particle tr2 src", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c--------------------------------------------------------------------
-c
-           CALL histend(nid_tra1)
-c
-           CALL histend(nid_tra2)
-c
-           CALL histend(nid_tra3)
-c
-c--------------------------------------------------------------------
-
-!        nbjour=1
-         ENDIF !--ok_histrac
-
-c
-!        IF (.NOT.edgar.AND.bateau) THEN
-!        PRINT *,'ATTENTION risque de compter double les bateaux'
-!        STOP
-!        ENDIF
-c
-c
-c
-      endif ! debutphy
-c
-c======================================================================
-c Initialisations
-c======================================================================
-c
-c
-c je  KE init
-      IF (debutphy) THEN
-        ALLOCATE(d_tr_cv(klon,klev,nbtr))
-        ALLOCATE(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_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))
-
-        ALLOCATE(d_tr_cv_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_trsp_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_sscav_o(klon,klev,nbtr),
-     .           d_tr_sat_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_uscav_o(klon,klev,nbtr))
-!
-!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  = 4
-!Config
-        !$OMP MASTER
-        iflag_lscav_omp=4
-        call getin('iflag_lscav', iflag_lscav_omp)
-        !$OMP END MASTER
-        !$OMP BARRIER
-        iflag_lscav=iflag_lscav_omp
-! initialiation for time computation
-
-        tia_spla=0.
-        tia_emis=0.
-        tia_depo=0.
-        tia_cltr=0.
-        tia_ther=0.
-        tia_sedi=0.
-        tia_gasp=0.
-        tia_wetap=0.
-        tia_cvltr=0.
-        tia_lscs=0.
-        tia_brop=0.
-        tia_outs=0.
-        tia_nophytracr=0.
-        clock_start_outphytracr=clock_end_outphytracr+1
-
-       ENDIF ! debutphy
-     
-
-! initialiation for time computation
-        
-        ti_spla=0
-        ti_emis=0
-        ti_depo=0
-        ti_cltr=0
-        ti_ther=0
-        ti_sedi=0
-        ti_gasp=0
-        ti_wetap=0
-        ti_cvltr=0
-        ti_lscs=0
-        ti_brop=0
-        ti_outs=0
-
-
-       DO k=1,klev
-        DO i=1,klon
-         Mint(i,k)=0.
-        END DO
-       END DO
-
-
-c
-      DO it=1, nbtr
-       DO k=1,klev
-        DO i=1,klon
-         d_tr_cv(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(i,k,it)=0.
-         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_o(i,k,it)=0.
-         d_tr_trsp_o(i,k,it)=0.
-         d_tr_sscav_o(i,k,it)=0.
-         d_tr_sat_o(i,k,it)=0.
-         d_tr_uscav_o(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 it=1, nbtr
-       DO i=1,klon
-          qPrls(i,it)=0.0
-          dtrconv(i,it)=0.0
-       ENDDO
-      ENDDO
-
-      DO it=1, nbtr
-      DO i=1, klon 
-        his_dhlsc(i,it)=0.0
-        his_dhcon(i,it)=0.0
-        his_dhbclsc(i,it)=0.0
-        his_dhbccon(i,it)=0.0
-        trm(i,it)=0.0
-        his_th(i,it)=0.0
-        his_dhkecv(i,it)=0.0
-        his_dhkelsc(i,it)=0.0
-
-      ENDDO
-      ENDDO
-cJE:      
-      DO i=1, klon 
-         his_g2pgas(i) = 0.0
-         his_g2paer(i) = 0.0
-      ENDDO
-c endJE
-c
-
-      DO k=1, klev
-      DO i = 1, klon
-        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
-        zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/RG
-      ENDDO
-      ENDDO
-c
-      DO i = 1, klon
-        zalt(i,1)=pphis(i)/RG
-      ENDDO
-      DO k=1, klev-1
-      DO i = 1, klon
-        zalt(i,k+1)=zalt(i,k)+zdz(i,k)
-      ENDDO
-      ENDDO
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_init=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_init=tia_init+REAL(ti_init)/REAL(clock_rate)
-      ENDIF
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-c
-c======================================================================
-c Initialisations of Scaling Parameters
-c======================================================================
-C
-C ----------------------------- SO4 -----------------------------------
-C
-c      scale_param_so4(1)=scale_param_sulf(1)
-c      scale_param_so4(klon)=scale_param_sulf(jjm+1)
-                  
-c      DO j = 2, jjm
-c        DO i = 1, iim
-c          ig=iim*(j-2)+i+1
-c          scale_param_so4(ig)=scale_param_sulf(j)
-c        ENDDO
-c      ENDDO
-C
-C ----------------------- SO2, BC & OM --------------------------------
-C ----------------FOSSIL FUEL AND INUDSTRIAL EMISSIONS-----------------
-      iregion_dust(:)=-999
-      iregion_ind(:)=-999
-      iregion_bb(:)=-999
-! READING BB MASK
-!     c_Directory='/ccc/work/cont003/dsm/nhuneeus/REGION_MASK/'
-      c_Directory='/d6/jelmd/LMDZ_INPUT/REGION_MASK/'
-!      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c JE por v2      c_FileName1='GFED_phyBBmask_lowres.txt'
-c JE por v2      c_FileName2='Country_phyFFandSO2mask_lowres.txt'
-c      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c      c_FileName2='Country_phyFFandSO2mask_lowres_v2.txt'
-       c_FileName1='GFED_phyBBmask_lowres_je48x36.txt'
-       c_FileName2='Country_phyFFandSO2mask_lowres_je48x36.txt'
-      c_FullName1=c_Directory//c_FileName1
-      c_FullName2=c_Directory//c_FileName2
-      print *,'BB mask NL = ',c_FullName1
-!
-      OPEN (UNIT=1,FILE=c_FullName1)
-      OPEN (UNIT=111,FILE=c_FullName2)
-      DO j=1,klon
-!         print *, j, klon
-         aux_mask1=0
-         aux_mask2=0
-         READ(1,102) aux_mask1
-!         mask_BBreg(j)=aux_mask1
-         iregion_bb(j)=aux_mask1
-         READ(111,102) aux_mask2
-!         print *,'aux_mask1, aux_mask2
-!     .    =',aux_mask1,aux_mask2,INT(aux_mask1),INT(aux_mask2)
-!         mask_ffso2reg(j)=aux_mask2
-         iregion_ind(j)=aux_mask2
-      ENDDO
-      CLOSE (UNIT=1)
-      CLOSE (UNIT=111)
-!
-      IF (debutphy) THEN
-      OPEN(25,FILE='dustregions_pyvar.data')
-      OPEN(55,FILE='indregions_pyvar.data')
-      OPEN(75,FILE='bbregions_pyvar.data')
-      ENDIF
-
-      DO i = 1, klon
-C ----------------------- SO2, BC & OM ---------------------------------
-C -----------------------BIOMASS BURNING--------------------------------
-C ------------------------------- DUST ---------------------------------
-C
-        IF ((xlat(i).GT.11).AND.(xlon(i).LT.-85)) THEN
-c NORTH WEST AMERICA = 1
-          iregion_dust(i)=1
-        ELSEIF ((xlat(i).LE.11).AND.(xlon(i).LT.-25)) THEN
-c SOUTH AMERICA = 2
-          iregion_dust(i)=2      
-        ELSEIF ((xlat(i).GE.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.14)) THEN
-c WEST SAHARA = 3
-          iregion_dust(i)=3
-        ELSEIF ((xlat(i).GT.-1.75*xlon(i)+89).AND.
-     .       (xlat(i).GT.0.524*xlon(i)-11.048).AND.
-     .       (xlat(i).LT.-0.464*xlon(i)+53.179).AND.
-     .       (xlat(i).LT.36)) THEN
-c SAUDI ARABIA = 9
-          iregion_dust(i)=9
-        ELSEIF ((xlat(i).LT.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.77)) THEN
-c AFRICA SUB-SAHARA = 5
-          iregion_dust(i)=5
-        ELSEIF ((xlon(i).GT.77).AND.(xlat(i).LT.-5)) THEN
-c AUSTRALIA = 8
-          iregion_dust(i)=8
-        ELSEIF ((xlon(i).GE.77).AND.(xlat(i).GE.-5)) THEN
-c ASIA EAST = 6  REGION ADDED 
-          iregion_dust(i)=6
-        ELSEIF (xlat(i).GT.11.AND.xlon(i).GE.-85.AND.
-     .          xlon(i).LT.-25) THEN
-c NORTH EAST AMERICA = 11
-          iregion_dust(i)=11
-        ELSEIF ((xlon(i).LT.77).AND.(xlat(i).LT.36).AND.
-     .       (xlat(i).GE.11).AND.
-     .       (xlat(i).GT.-0.464*xlon(i)+53.179).OR.
-     .       (xlat(i).LT.0.524*xlon(i)-11.048)) THEN 
-c INDIAN SUBCONTINENT
-          iregion_dust(i)=10
-        ELSEIF ((xlon(i).GT.33).AND.(xlon(i).LT.77).AND.
-     .       (xlat(i).GE.36)) THEN
-c ASIA WEST = 7
-          iregion_dust(i)=7
-        ELSEIF ((xlat(i).GE.11).AND.
-     .       (xlon(i).GT.14).AND.
-     .       (xlat(i).LT.-1.75*xlon(i)+89).OR.xlon(i).LE.33) THEN
-c EAST SAHARA = 4
-          iregion_dust(i)=4
-        ENDIF
-
-      IF (debutphy) THEN
-c       WRITTING REGIONS INTO FILE
-        IF (iregion_dust(i).LT.10) THEN
-          WRITE (25,101) iregion_dust(i)
-        ELSE
-          WRITE (25,102) iregion_dust(i)
-        ENDIF
-        WRITE (55,*) iregion_ind(i)
-        WRITE (75,*) iregion_bb(i)
-!        WRITE (55,102) iregion_ind(i)
-!        WRITE (75,102) iregion_bb(i)
-
-      ENDIF ! debutphy/write regions
-      ENDDO
-!      print *,'NEW DUST REGION, NOW 11 REGIONS!'
-      IF (debutphy) THEN
-
-      CLOSE(25)
-      CLOSE(55)
-      CLOSE(75)
-  101 FORMAT (i1)
-  102 FORMAT (i2)
-!      stop
-
-      ENDIF
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_inittype=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_inittype=tia_inittype+REAL(ti_inittype)/REAL(clock_rate)
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-c
-c=======================================================================
-c SAVING SURFACE TYPE
-c=======================================================================
-      IF (debutphy) THEN
-
-      OPEN(35,FILE='surface_ocean.data')
-      OPEN(45,FILE='surface_seaice.data')
-      OPEN(65,FILE='surface_land.data')
-      OPEN(85,FILE='surface_landice.data')
-      DO i = 1, klon
-         WRITE (35,103) pctsrf(i,is_oce)
-         WRITE (45,103) pctsrf(i,is_sic)
-         WRITE (65,103) pctsrf(i,is_ter)
-         WRITE (85,103) pctsrf(i,is_lic)
-      ENDDO
-      CLOSE(35)
-      CLOSE(45)
-      CLOSE(65)
-      CLOSE(85)
-  103 FORMAT (f6.2)
-      ENDIF
-!      stop
-c
-c=======================================================================
-
-!        CALL checknanqfi(tr_seri(:,:,1),qmin,qmax,'nan_TEST0it1')
-!        CALL checknanqfi(tr_seri(:,:,2),qmin,qmax,'nan_TEST0it2')
-!        CALL checknanqfi(tr_seri(:,:,3),qmin,qmax,'nan_TEST0it3')
-!        CALL checknanqfi(tr_seri(:,:,4),qmin,qmax,'nan_TEST0it4')
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-      iscm3=.true.
-
-!        CALL checknanqfi(t_seri(:,:),qmin,qmax,'nan_t_seri')
-!       CALL abort_gcm('TEST1', 'Pass nan t_seri', 1)
-!        CALL checknanqfi(tr_seri(:,:,1),qmin,qmax,'nan_TEST1it1')
-!        CALL checknanqfi(tr_seri(:,:,2),qmin,qmax,'nan_TEST1it2')
-!        CALL checknanqfi(tr_seri(:,:,3),qmin,qmax,'nan_TEST1it3')
-!        CALL checknanqfi(tr_seri(:,:,4),qmin,qmax,'nan_TEST1it4')
-!        DO it=1, nbtr   
-!           CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,
-!     . 'after kg_to_cm3')
-!        ENDDO
-c=======================================================================
-c
-      DO k=1, klev
-      DO i=1, klon
-        m_conc(i,k)=pplay(i,k)/t_seri(i,k)/RKBOL*1.e-6
-      ENDDO
-      ENDDO
-
-!
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_avt_coarem')
-        ENDDO        
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'avt coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: avt coarem')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_inittwrite=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_inittwrite=tia_inittwrite+REAL(ti_inittwrite)/REAL(clock_rate)
-      ENDIF
-
-c
-c
-c=======================================================================
-c                     EMISSIONS OF COARSE AEROSOLS
-c=======================================================================
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-
-c      
-c      PRINT *, 'DUST EMISSION VALUES FOR REAGION EAST ASIA'
-c      DO i=1, klon
-c        IF ((xlon(i).GT.105).AND.(xlat(i).GE.-5)) THEN
-c           print *, 'DUST_EC,LON,LAT = ',dust_ec(i),xlon(i),xlat(i)
-c        ENDIF
-c      ENDDO
-      print *,'Number of tracers = ',nbtr
-
-      print *,'AT BEGINNING OF PHYTRACR_SPL'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-
-      CALL coarsemission(pctsrf,pdtphys,t_seri,
-     .                   pmflxr,pmflxs,prfl,psfl,
-     .                   scale_param_ssacc,scale_param_sscoa,
-     .                   scale_param_dustacc,scale_param_dustcoa,
-     .                   iregion_dust,dust_ec,
-     .                   lmt_sea_salt,qmin,qmax,
-     .                             flux_sparam_ddfine,flux_sparam_ddcoa,
-     .                             flux_sparam_ssfine,flux_sparam_sscoa,
-     .                                                source_tr,flux_tr)
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_coarem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after coarem')
-      ENDIF
-
-c
-c
-c
-c======================================================================
-c                   EMISSIONS OF AEROSOL PRECURSORS      
-c======================================================================
-c
-      print *,'INPUT TO PRECUREMISSION'
-
-      CALL precuremission(ftsol,u10m_ec,v10m_ec,pctsrf,
-     .                    u_seri,v_seri,paprs,pplay,cdragh,cdragm,
-     .                    t_seri,q_seri,tsol,fracso2emis,frach2sofso2,
-     .                    bateau,zdz,zalt,kminbc,kmaxbc,pdtphys,
-     .                    scale_param_bb,scale_param_ind,
-     .                    iregion_ind, iregion_bb,
-     .                    lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     .                    lmt_so2bb_l,lmt_so2bb_h,
-     .                    lmt_so2volc_cont,lmt_altvolc_cont,
-     .                    lmt_so2volc_expl,lmt_altvolc_expl,
-     .                    lmt_dmsbio,lmt_h2sbio, lmt_dmsconc, lmt_dms,
-     .                                  flux_sparam_ind, flux_sparam_bb,
-     .                                  source_tr,flux_tr,tr_seri)
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after precur')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after precur')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after precur')
-      ENDIF
-
-c
-c
-c=======================================================================
-c                      EMISSIONS OF FINE AEROSOLS
-c=======================================================================
-c
-      CALL finemission(zdz,pdtphys,zalt,kminbc,kmaxbc,
-     .                 scale_param_bb,scale_param_ff,
-     .                 iregion_ind,iregion_bb,
-     .                 lmt_bcff, lmt_bcnff, lmt_bcbb_l,lmt_bcbb_h,
-     .                 lmt_bcba, lmt_omff, lmt_omnff,
-     .                 lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba,
-     .                                  flux_sparam_bb, flux_sparam_ff,
-     .                                        source_tr,flux_tr,tr_seri)
-c
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_fineem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after fineem')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after fineem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after fineem')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_emis=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_emis=tia_emis+REAL(ti_emis)/REAL(clock_rate)
-      ENDIF
-
-
-
-
-
-c
-c=======================================================================
-c                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
-c=======================================================================
-c
-!        DO it=1,nbtr
-!         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-!     .      pplay,t_seri,iscm3,'')
-!        ENDDO
-
-!======================================================================
-!    -- Dry deposition --
-!======================================================================
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-      iscm3=.false.
-c----------------------------
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before depo')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before depo')
-      ENDIF
-
-      CALL deposition(vdep_oce,vdep_sic,vdep_ter,vdep_lic,pctsrf,
-     .                zrho,zdz,pdtphys,RHcl,masse,t_seri,pplay,paprs,
-     .                lminmax,qmin,qmax,
-     .                         his_ds,source_tr,tr_seri)
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after depo')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after depo')
-        ENDDO
-
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after depo')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_depo=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_depo=tia_depo+REAL(ti_depo)/REAL(clock_rate)
-      ENDIF
-
-
-c
-!======================================================================
-!    -- Boundary layer mixing --
-!======================================================================
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-c
-
-       DO k = 1, klev
-        DO i = 1, klon
-         delp(i,k) = paprs(i,k)-paprs(i,k+1)
-        END DO
-      END DO
-c
-      DO it=1, nbtr
-      DO j=1, klev
-      DO i=1, klon
-        tmp_var(i,j)=tr_seri(i,j,it)
-        aux_var2(i)=source_tr(i,it)
-      ENDDO
-      ENDDO
-      IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL cltrac_spl(pdtphys,coefh,yu1,yv1,t_seri,tmp_var,
-     .            aux_var2,paprs,pplay,aux_var3)
-
-      ELSE IF (iflag_conv.GE.3) THEN
-!KE
-      CALL cltrac(pdtphys, coefh,t_seri,tmp_var,aux_var2,paprs,pplay,
-     .            delp,aux_var3,d_tr_dry,flux_tr_dry(:,it))
-      ENDIF
-
-      DO i=1, klon
-      DO j=1, klev
-        tr_seri(i,j,it)=tmp_var(i,j)
-        d_tr(i,j,it)=aux_var3(i,j)
-      ENDDO
-      ENDDO
-      DO k = 1, klev
-      DO i = 1, klon
-         tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr(i,k,it)
-      ENDDO
-      ENDDO
-      print *,' AFTER Cltrac'
-      IF (lminmax) THEN
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after cltrac')
-      ENDIF
-      ENDDO !--end itr loop
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_cltr=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_cltr=tia_cltr+REAL(ti_cltr)/REAL(clock_rate)
-      ENDIF
-
-
-
-!======================================================================
-!    -- Calcul de l'effet des thermiques for KE--
-!======================================================================
-
-      IF (iflag_conv.GE.3) THEN
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-
-
-      
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before therm')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before therm')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before therm')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'before therm')
-      ENDIF
-
-      DO it=1,nbtr
-         DO k=1,klev
-            DO i=1,klon
-               tmp_var3(i,k,it)=tr_seri(i,k,it)
-               d_tr_th(i,k,it)=0.
-               tr_seri(i,k,it)=MAX(tr_seri(i,k,it),0.)
-!JE: precursor >>1e10         tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
-            END DO
-         END DO
-      END DO
-
-!JE  new implicit scheme 20140323
-      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(1:klon,1:klev,it),ztra_th,0 )
-
-        DO k=1,klev
-           DO i=1,klon
-              d_tr(i,k,it)=pdtphys*d_tr(i,k,it)
-              d_tr_th(i,k,it)=d_tr_th(i,k,it)+d_tr(i,k,it)
-              tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr(i,k,it),0.)
-              END DO
-        END DO
-
-      ENDDO
-
-! old scheme explicit
-!       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(1:klon,1:klev,it),ztra_th)
-!            DO k=1,klev
-!               DO i=1,klon
-!                  d_tr(i,k,it)=pdtphys*d_tr(i,k,it)/nsplit
-!                  d_tr_th(i,k,it)=d_tr_th(i,k,it)+d_tr(i,k,it)
-!                  tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr(i,k,it),0.)
-!               END DO
-!            END DO
-!         END DO ! nsplit1
-!      END DO ! it
-!JE end modif 20140323
-
-      DO it=1,nbtr
-         DO k=1,klev
-            DO i=1,klon
-          tmp_var(i,k)=tr_seri(i,k,it)-tmp_var3(i,k,it)
-            ENDDO
-         ENDDO
-       IF (lminmax) THEN
-         CALL checkmass(tmp_var(:,:),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'dtr therm ')
-       ENDIF
-         CALL kg_to_cm3(pplay,t_seri,tmp_var)
-
-         DO k=1,klev
-            DO i=1,klon
-               his_th(i,it)=his_th(i,it)+
-     .                      (tmp_var(i,k))/RNAVO*
-     .                masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-            END DO !klon
-         END DO !klev
-
-      END DO !it
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after therm')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after therm')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after therm')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'after therm')
-       ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_ther=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_ther=tia_ther+REAL(ti_ther)/REAL(clock_rate)
-      ENDIF
-
-
-      ENDIF ! iflag_conv KE
-c------------------------------------
-c      Sedimentation
-c-----------------------------------
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-      DO it=1,nbtr
-      DO j=1,klev
-      DO i=1,klon
-         tmp_var(i,j)=tr_seri(i,j,it)
-      ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay,t_seri,tmp_var)
-      DO j=1,klev
-      DO i=1,klon
-         tr_seri(i,j,it)=tmp_var(i,j)
-      ENDDO
-      ENDDO
-      ENDDO !--end itr loop
-      iscm3=.true.
-c--------------------------------------
-      print *,' BEFORE Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before sedi')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before sedi')
-      ENDIF
-
-      print *,'SPLA VERSION OF SEDIMENTATION IS USED'
-      CALL sediment_mod(t_seri,pplay,zrho,paprs,pdtphys,RHcl,!xlon,xlat,
-     .                               sed_ss,sed_dust,tr_seri)
-c
-      print *,'AFTER Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after sedi')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after sedi')
-      ENDIF
-c
-c=======================================================================
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_sedi=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_sedi=tia_sedi+REAL(ti_sedi)/REAL(clock_rate)
-      ENDIF
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-      iscm3=.false.
-c
-c
-c======================================================================
-c                      GAS TO PARTICLE CONVERSION      
-c======================================================================
-c
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_beforegastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before gastopar')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before gastopar')
-      ENDIF
-
-      CALL gastoparticle(pdtphys,zdz,zrho,xlat,
-     .              pplay,t_seri,
-     .              tr_seri,his_g2pgas ,his_g2paer) 
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_gastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after gastopar')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after gastopar')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_gasp=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_gasp=tia_gasp+REAL(ti_gasp)/REAL(clock_rate)
-      ENDIF
-
-
-c
-c======================================================================
-c          EFFECT OF PRECIPITATION: iflag_conv=2
-c======================================================================
-c
-      IF (iflag_conv.EQ.2) THEN
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-
-
-       DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-       iscm3=.true.
-c------------------------------
-
-      print *,'iflag_conv bef lessiv',iflag_conv
-      IF (lessivage) THEN
-c
-      print *,' BEFORE Incloud'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_incloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before incloud')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before incloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before incloud')
-      ENDIF
-
-
-!      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-      print *,'iflag_conv bef incloud',iflag_conv
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL incloud_scav(.false.,qmin,qmax,masse,henry,kk,prfl,
-     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-     .                                     his_dhlsc,his_dhcon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL incloud_scav_lsc(.false.,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-!--------------------------------------------------------------
-
-        ENDIF
-c
-c
-      print *,' BEFORE blcloud (after incloud)'
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_blcloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before blcloud')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before blcloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before blcloud')
-      ENDIF
-
-!      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-
-      CALL blcloud_scav(.false.,qmin,qmax,pdtphys,prfl,psfl,
-     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!           and comment IF iflag=2 after "EFFECT OF PRECIPITATION:"
-!        
-!
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL blcloud_scav_lsc(.false.,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-!
-!----------------------------------------------------------------------
-        ENDIF
-
-
-      print *,' AFTER blcloud '
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_blcloud')
-        ENDDO                           
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after blcloud')
-        ENDDO                                  
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after blcloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after blcloud')
-      ENDIF
-
-
-      ENDIF !--lessivage
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-       iscm3=.false.
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_wetap=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_wetap=tia_wetap+REAL(ti_wetap)/REAL(clock_rate)
-      ENDIF
-
-
-
-
-      ENDIF ! iflag_conv=2
-
-c
-c
-c======================================================================
-c                         EFFECT OF CONVECTION 
-c======================================================================
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-      IF (convection) THEN
-c
-      print *,' BEFORE trconvect'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_trconve')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before trconve')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before trconve')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before trconve')
-      ENDIF
-
-
-! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-!     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
-!     .                                                 dtrconv,tr_seri)
-! -------------------------------------------------------------     
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-         CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,.false.,masse,
-     .                                                 dtrconv,tr_seri)
-         DO it=1, nbtr
-           d_tr_cv(:,:,it)=0.
-         ENDDO
-
-        ELSE IF (iflag_conv.GE.3) THEN
-! KE
-         print *,'JE: KE in phytracr_spl'
-         DO it=1, nbtr
-             DO k = 1, klev
-              DO i = 1, klon
-               tmp_var3(i,k,it)=tr_seri(i,k,it)
-              END DO
-             END DO
-         ENDDO
-
-         DO it=1, nbtr
-!          routine for aerosols . otherwise, check cvltrorig
-         print *,'Check sum before cvltr it',it,SUM(tr_seri(:,:,it))
-           IF (.FALSE.) THEN 
-           CALL cvltr_spl(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,
-     .       paprs,it,tmp_var3,upwd,dnwd,itop_con,ibas_con,
-     .       henry,kk,zrho,
-     .       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)
-           print *,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
-!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-           ENDIF
-
-
-           IF (.FALSE.) THEN 
-           CALL cvltr(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,tmp_var3,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)
-!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-           ENDIF
-
-
-
-!!!!!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
-!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
-!!!     .               upwd,dnwd,d_tr_cv)
-!             CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,
-!     .            pplay,tmp_var3,upwd,dnwd,d_tr_cv)
-
-             DO k = 1, klev
-              DO i = 1, klon
-!               tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr_cv(i,k,it)
-               tr_seri(i,k,it)=(tmp_var3(i,k,it)+d_tr_cv(i,k,it))
-               tmp_var(i,k)=d_tr_cv(i,k,it)
-
-              END DO
-             END DO
-
-        CALL kg_to_cm3(pplay,t_seri,tmp_var) !just for his_* computation
-
-             DO k = 1, klev
-              DO i = 1, klon
-               dtrconv(i,it)=0.0
-               his_dhkecv(i,it)=his_dhkecv(i,it)-tmp_var(i,k)
-     .                /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-              END DO
-             END DO
-         print *,'Check sum after cvltr it',it,SUM(tr_seri(:,:,it))
-        CALL minmaxqfi2(d_tr_cv(:,:,it),qmin,qmax,'d_tr_cv:')
-        CALL minmaxqfi2(d_tr_trsp(:,:,it),qmin,qmax,'d_tr_trsp:')
-        CALL minmaxqfi2(d_tr_sscav(:,:,it),qmin,qmax,'d_tr_sscav:')
-        CALL minmaxqfi2(d_tr_sat(:,:,it),qmin,qmax,'d_tr_sat:')
-        CALL minmaxqfi2(d_tr_uscav(:,:,it),qmin,qmax,'d_tr_uscav:')
-        CALL checkmass(d_tr_cv(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,.false.,'d_tr_cv:')
-
-         ENDDO ! it=1,nbtr
-
-        ENDIF ! iflag_conv
-       IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after trconv')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after trconv')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-      ENDIF ! convection
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_cvltr=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_cvltr=tia_cvltr+REAL(ti_cvltr)/REAL(clock_rate)
-      ENDIF
-
-
-
-c
-c
-c=======================================================================
-c      LARGE SCALE SCAVENGING KE
-c=======================================================================
-c     
-
-       IF (iflag_conv.GE.3) THEN
-       IF (logitime) THEN
-       CALL SYSTEM_CLOCK(COUNT=clock_start)
-       ENDIF
-
-
-       IF (lessivage)  THEN
-       print *,' BEFORE lsc_scav '
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before lsc_scav')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before lsc_scav')
-      ENDIF
-
-
-
-       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
-      print *,'JE iflag_lscav',iflag_lscav
-       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)
-          tmp_var(i,k)=d_tr_ls(i,k,it)
-        ENDDO
-       ENDDO
-
-       CALL kg_to_cm3(pplay,t_seri,tmp_var)
-         DO k=1,klev
-            DO i=1,klon
-            his_dhkelsc(i,it)=his_dhkelsc(i,it)-tmp_var(i,k)
-     .                /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-     
-            END DO
-         END DO
-
-       END DO  !tr
-      ELSE
-        his_dhkelsc(i,it)=0.0
-        print *,'WARNING: NO lsc_scav, Please choose iflag_lscav=3 or 4'
-       ENDIF !iflag_lscav
-
-       print *,' AFTER lsc_scav '
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after lsc_scav')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after lsc_scav')
-      ENDIF
-
-      ENDIF ! lessivage
- 
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_lscs=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_lscs=tia_lscs+REAL(ti_lscs)/REAL(clock_rate)
-      ENDIF
-
-
-
-      ENDIF !iflag_conv
-
- 
-c=======================================================================
-c                         COMPUTING THE BURDEN
-c=======================================================================
-c    
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-  
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-       iscm3=.true.
-
-c
-c Computing burden in mg/m2
-      DO it=1, nbtr
-      DO k=1, klev
-      DO i=1, klon
-        trm(i,it)=trm(i,it)+tr_seri(i,k,it)*1.e6*zdz(i,k)*
-     .            masse(it)*1.e3/RNAVO     !--mg S/m2
-      ENDDO
-      ENDDO
-      ENDDO
-c
-c Computing Surface concentration in ug/m3
-c
-      DO it=1, nbtr
-      DO i=1, klon
-        sconc_seri(i,it)=tr_seri(i,1,it)*1.e6*
-     .            masse(it)*1.e3/RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
-      ENDDO
-      ENDDO
-c
-c=======================================================================
-c                  CALCULATION OF OPTICAL PROPERTIES
-c=======================================================================
-c      
-      CALL aeropt_spl(zdz, tr_seri, RHcl,
-     .               diff_aod550_tot,diag_aod670_tot,diag_aod865_tot,
-     .               diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2,
-     .               diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,
-     .               diag_aod550_dust,diag_aod670_dust,diag_aod865_dust)
-
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_brop=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_brop=tia_brop+REAL(ti_brop)/REAL(clock_rate)
-      ENDIF
-
-
-
-c
-c======================================================================
-c   Stockage sur bande histoire
-c======================================================================
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-       iscm3=.false.
-
-c
-c
-c======================================================================
-c  SAVING AEROSOL RELATED VARIABLES INTO FILE
-c======================================================================
-c
-      IF (ok_histrac) THEN
-c
-      ndex2d = 0
-      ndex3d = 0 
-c
-      itra=itra+1
-
-      print *,'SAVING VARIABLES FOR DAY ',itra
-c
-      fluxbb(:)=0.0
-      fluxff(:)=0.0
-      fluxbcbb(:)=0.0
-      fluxbcff(:)=0.0
-      fluxbcnff(:)=0.0
-      fluxbcba(:)=0.0
-      fluxbc(:)=0.0
-      fluxombb(:)=0.0
-      fluxomff(:)=0.0
-      fluxomnat(:)=0.0
-      fluxomba(:)=0.0
-      fluxomnff(:)=0.0
-      fluxom(:)=0.0
-      fluxh2sff(:)=0.0
-      fluxh2snff(:)=0.0
-      fluxh2sbio(:)=0.0
-      fluxso2ff(:)=0.0
-      fluxso2nff(:)=0.0
-      fluxso2bb(:)=0.0
-      fluxso2vol(:)=0.0
-      fluxso2ba(:)=0.0
-      fluxso2(:)=0.0
-      fluxso4ff(:)=0.0
-      fluxso4nff(:)=0.0
-      fluxso4bb(:)=0.0
-      fluxso4ba(:)=0.0
-      fluxso4(:)=0.0
-      fluxdms(:)=0.0
-      fluxdustec(:)=0.0
-      fluxddfine(:)=0.0
-      fluxddcoa(:)=0.0
-      fluxdd(:)=0.0
-      fluxssfine(:)=0.0
-      fluxsscoa(:)=0.0
-      fluxss(:)=0.0
-      DO i=1, klon
-         IF (iregion_ind(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxh2sff(i)= (lmt_so2ff_l(i)+lmt_so2ff_h(i))*frach2sofso2*
-     .                    scale_param_ind(iregion_ind(i))*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-           fluxso2ff(i)=scale_param_ind(iregion_ind(i)) * fracso2emis *
-     .                   (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4ff(i)=scale_param_ind(iregion_ind(i))*(1-fracso2emis)*
-     .                    (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcff(i)=scale_param_ff(iregion_ind(i))*
-     .                                        lmt_bcff(i)*1.e4*1.e3  !/g/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxomff(i)=scale_param_ff(iregion_ind(i))*
-     .                          (lmt_omff(i))*1.e4*1.e3  !/g/m2/s
-           ! FOSSIL FUEL EMISSIONS
-           fluxff(i)=fluxbcff(i)+fluxomff(i)
-         ENDIF
-         IF (iregion_bb(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxso2bb(i) =scale_param_bb(iregion_bb(i)) * fracso2emis *
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4bb(i) =scale_param_bb(iregion_bb(i))*(1-fracso2emis)*
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcbb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_bcbb_l(i)+lmt_bcbb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxombb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_ombb_l(i)+lmt_ombb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! BIOMASS BURNING EMISSIONS
-           fluxbb(i)=fluxbcbb(i)+fluxombb(i)
-         ENDIF
-         ! H2S EMISSIONS
-         fluxh2sbio(i)=lmt_h2sbio(i)*1.e4/RNAVO*masse_s*1.e3      ! mgS/m2/s
-         fluxh2snff(i)= lmt_so2nff(i)*frach2sofso2*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-         ! SULFUR DIOXIDE EMISSIONS
-         fluxso2nff(i)=fracso2emis * lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso2vol(i)=(lmt_so2volc_cont(i)+lmt_so2volc_expl(i))
-     .                 *1.e4/RNAVO*masse_s*1.e3        ! mgS/m2/s
-         fluxso2ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3*
-     .                                                   fracso2emis ! mgS/m2/s
-         fluxso2(i)=fluxso2ff(i)+fluxso2bb(i)+fluxso2nff(i)+
-     .              fluxso2vol(i)+fluxso2ba(i)
-         ! DMS EMISSIONS
-         fluxdms(i)=( lmt_dms(i)+lmt_dmsbio(i) )
-     .              *1.e4/RNAVO*masse_s*1.e3          ! mgS/m2/s
-         ! SULPHATE EMISSIONS
-         fluxso4ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3
-     .                 *(1-fracso2emis) ! mgS/m2/s
-         fluxso4nff(i)=(1-fracso2emis)*lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso4(i)=fluxso4ff(i)+fluxso4bb(i)+fluxso4ba(i)+fluxso4nff(i)
-         ! BLACK CARBON EMISSIONS
-
-         fluxbcnff(i)=lmt_bcnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxbcba(i)=lmt_bcba(i)*1.e4*1.e3    !mg/m2/s
-         fluxbc(i)=fluxbcbb(i)+fluxbcff(i)+fluxbcnff(i)+fluxbcba(i)
-         ! ORGANIC MATTER EMISSIONS
-         fluxomnat(i)=lmt_omnat(i)*1.e4*1.e3  !mg/m2/s
-         fluxomba(i)=lmt_omba(i)*1.e4*1.e3  !mg/m2/s
-         fluxomnff(i)=lmt_omnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxom(i)=fluxombb(i)+fluxomff(i)+fluxomnat(i)+fluxomba(i)+
-     .             fluxomnff(i)
-        ! DUST EMISSIONS 
-         fluxdustec(i)=dust_ec(i)*1.e6
-         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
-     .                                  * dust_ec(i)*0.093*1.e6
-         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
-     .                                  * dust_ec(i)*0.905*1.e6
-         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
-        ! SEA SALT EMISSIONS 
-         fluxssfine(i)=scale_param_ssacc*lmt_sea_salt(i,1)*1.e4*1.e3
-         fluxsscoa(i)=scale_param_sscoa*lmt_sea_salt(i,2)*1.e4*1.e3
-         fluxss(i)=fluxssfine(i)+fluxsscoa(i)
-      ENDDO
-!      prepare outputs cvltr
-
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_cv(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_cv_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_trsp(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_trsp_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_sscav(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_sscav_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_sat(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_sat_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_uscav(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_uscav_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-
-
-
-c
-c SAVING VARIABLES IN TRACEUR
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c     
-      DO it=1,nbtr
-c
-      WRITE(str2,'(i2.2)') it
-c 
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,trm(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"trm"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sconc_seri(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"sconc"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-c SAVING VARIABLES IN LESSIVAGE
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_tr(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"flux"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_ds(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"ds"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      DO i=1, klon
-        zx_tmp_fi2d(i) = his_dhlsc(i,it)+his_dhcon(i,it)+
-     .                   his_dhbclsc(i,it)+his_dhbccon(i,it)
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,zx_tmp_fi2d,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dh"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-C
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_dhkecv(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dhkecv"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_dhkelsc(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dhkelsc"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_cv_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_cv"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_trsp_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_trsp"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_sscav_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_sscav"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_sat_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_sat"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_uscav_o(1,1,it),
-     .                  zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_uscav"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-
-
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,dtrconv(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dtrconv"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_th(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dtherm"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_ss",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_dust",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)              
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2pgas,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_gas",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2paer,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_aer",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c SAVING VARIABLES IN HISTRAC
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-c ========================= BC =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbc,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbc",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= OM =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxombb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxombb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnat,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnat",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxom,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxom",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO4 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= H2S =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2snff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2snff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sbio,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sbio",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO2 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2vol,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2vol",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdms,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdms",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= DD =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdustec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdustec",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdd,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdd",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c ========================= SS =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxsscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxsscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxss,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxss",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,fluxso4chem,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"fluxso4chem",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ind,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ind",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_bb",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ff",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_sscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_sscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,u10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"u10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,v10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"v10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,flux_sparam_sulf,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"flux_sparam_sulf",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      ENDIF ! ok_histrac
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-
-      dife=clock_end-clock_start
-      ti_outs=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_outs=tia_outs+REAL(ti_outs)/REAL(clock_rate)
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-
-      dife=clock_end-clock_start_spla
-      ti_spla=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-
-
-      tia_spla=tia_spla+REAL(ti_spla)/REAL(clock_rate)
-      print *,'---times for this timestep: time proc, time proc/time
-     . phytracr_spl---'
-      print *,'time spla',REAL(ti_spla)/REAL(clock_rate)
-     . ,REAL(ti_spla)/REAL(ti_spla)
-      print *,'time init',REAL(ti_init)/REAL(clock_rate)
-     . ,REAL(ti_init)/REAL(ti_spla)
-      print *,'time inittype',REAL(ti_inittype)/REAL(clock_rate)
-     . ,REAL(ti_inittype)/REAL(ti_spla)
-      print *,'time inittwrite',REAL(ti_inittwrite)/REAL(clock_rate)
-     . ,REAL(ti_inittwrite)/REAL(ti_spla)
-      print *,'time emis',REAL(ti_emis)/REAL(clock_rate)
-     . ,REAL(ti_emis)/REAL(ti_spla)
-      print *,'time depo ',REAL(ti_depo)/REAL(clock_rate)
-     . ,REAL(ti_depo)/REAL(ti_spla)
-      print *,'time cltr',REAL(ti_cltr)/REAL(clock_rate)
-     . ,REAL(ti_cltr)/REAL(ti_spla)
-      print *,'time ther',REAL(ti_ther)/REAL(clock_rate)
-     . ,REAL(ti_ther)/REAL(ti_spla)
-      print *,'time sedi',REAL(ti_sedi)/REAL(clock_rate)
-     . ,REAL(ti_sedi)/REAL(ti_spla)
-      print *,'time gas to part',REAL(ti_gasp)/REAL(clock_rate)
-     . ,REAL(ti_gasp)/REAL(ti_spla)
-      print *,'time AP wet',REAL(ti_wetap)/REAL(clock_rate)
-     . ,REAL(ti_wetap)/REAL(ti_spla)
-      print *,'time convective',REAL(ti_cvltr)/REAL(clock_rate)
-     . ,REAL(ti_cvltr)/REAL(ti_spla)
-      print *,'time NP lsc scav',REAL(ti_lscs)/REAL(clock_rate)
-     . ,REAL(ti_lscs)/REAL(ti_spla)
-      print *,'time opt,brdn,etc',REAL(ti_brop)/REAL(clock_rate)
-     . ,REAL(ti_brop)/REAL(ti_spla)
-      print *,'time outputs',REAL(ti_outs)/REAL(clock_rate)
-     . ,REAL(ti_outs)/REAL(ti_spla)
-
-
-      print *,'---time accumulated: time proc, time proc/time
-     . phytracr_spl---'
-      print *,'time spla',tia_spla
-      print *,'time init',tia_init,tia_init/tia_spla
-      print *,'time inittype',tia_inittype,tia_inittype/tia_spla
-      print *,'time inittwrite',tia_inittwrite,tia_inittwrite/tia_spla
-      print *,'time emis',tia_emis,tia_emis/tia_spla
-      print *,'time depo',tia_depo,tia_depo/tia_spla
-      print *,'time cltr',tia_cltr,tia_cltr/tia_spla
-      print *,'time ther',tia_ther,tia_ther/tia_spla
-      print *,'time sedi',tia_sedi,tia_sedi/tia_spla
-      print *,'time gas to part',tia_gasp,tia_gasp/tia_spla
-      print *,'time AP wet',tia_wetap,tia_wetap/tia_spla
-      print *,'time convective',tia_cvltr,tia_cvltr/tia_spla
-      print *,'time NP lsc scav',tia_lscs,tia_lscs/tia_spla
-      print *,'time opt,brdn,etc',tia_brop,tia_brop/tia_spla
-      print *,'time outputs',tia_outs,tia_outs/tia_spla
-
-
-
-      dife=clock_end_outphytracr-clock_start_outphytracr
-      ti_nophytracr=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_nophytracr=tia_nophytracr+REAL(ti_nophytracr)/REAL(clock_rate)
-      print *,'Time outside phytracr; Time accum outside phytracr'
-      print*,REAL(ti_nophytracr)/REAL(clock_rate),tia_nophytracr
-
-      clock_start_outphytracr=clock_end
-
-      ENDIF      
-      print *,'END PHYTRACR_SPL '
-
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl.F_20140507_seq
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl.F_20140507_seq	(revision 2196)
+++ 	(revision )
@@ -1,3063 +1,0 @@
-      SUBROUTINE phytracr_spl ( debutphy, iflag_conv,
-     I                   pdtphys,ftsol,tsol, 
-     I                   t_seri,q_seri,paprs,pplay,RHcl,
-     I                   pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,
-     I                   coefh, cdragh, cdragm, yu1, yv1, 
-     I                   u_seri, v_seri, xlat,xlon,
-     I                   pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,
-     I                   da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,
-     I                   epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,
-     I                   evap,wdtrainA,  wdtrainM,wght_cvfd,
-     I                   fm_therm, entr_therm, rneb,
-     I                   beta_fisrt,beta_v1,
-     P                   scale_param_ssacc,
-     P                   scale_param_sscoa,scale_param_ind,
-     P                   scale_param_bb,scale_param_ff,
-     P                   scale_param_dustacc,scale_param_dustcoa,
-     E                   dust_ec,u10m_ec,v10m_ec,
-     E                   lmt_sea_salt,
-     E                   lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     E                   lmt_so2bb_l, lmt_so2bb_h,
-     E                   lmt_so2volc_cont,lmt_altvolc_cont,
-     E                   lmt_so2volc_expl,lmt_altvolc_expl,
-     E                   lmt_dmsbio,lmt_h2sbio,lmt_dmsconc,
-     E                   lmt_bcff,lmt_bcnff,lmt_bcbb_l,lmt_bcbb_h,
-     E                   lmt_bcba,lmt_omff,lmt_omnff,lmt_ombb_l,
-     E                   lmt_ombb_h,lmt_omnat,lmt_omba,
-     O                   tr_seri,
-     O                   diff_aod550_tot,diag_aod865_tot,
-     O                   diff_aod550_tr2,diag_aod865_tr2,
-     O                   diag_aod550_dust,diag_aod865_dust,
-     O                   diag_aod550_ss,diag_aod865_ss)
-!     E                   wth,cly,zprecipinsoil,lmt_sea_salt, ! Titane
-c
-      USE IOIPSL
-      USE dimphy
-      USE infotrac
-      USE indice_sol_mod
-c
-      IMPLICIT none
-c
-c======================================================================
-c Auteur(s) FH
-c Objet: Moniteur general des tendances traceurs
-c
-c Remarques en vrac:
-c ------------------
-c 1/ le call phytrac se fait avec nqmax-2 donc nous avons bien 
-c les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
-c======================================================================
-#include "dimensions.h"
-#include "chem.h"
-#include "../phylmd/YOMCST.h"
-#include "../phylmd/YOETHF.h"
-c #include "../phylmd/dimphy.h"
-c #include "../phylmd/indicesol.h"
-#include "paramet.h"
-#include "thermcell.h"
-
-c======================================================================
-
-c Arguments:
-c
-c   EN ENTREE:
-c   ==========
-c
-c   divers:
-c   -------
-c
-      real,intent(in) :: pdtphys  ! pas d'integration pour la physique (seconde)
-      real, intent(in) ::  ftsol(klon,nbsrf)  ! temperature du sol par type
-      real , intent(in) :: tsol(klon)         ! temperature du sol moyenne
-      real, intent(in) ::  t_seri(klon,klev)  ! temperature
-      real, intent(in) ::  u_seri(klon,klev)  ! vent
-      real , intent(in) :: v_seri(klon,klev)  ! vent
-      real , intent(in) :: q_seri(klon,klev)  ! vapeur d eau kg/kg
-      real tr_seri(klon,klev,nbtr) ! traceur  
-      real tmp_var(klon,klev) ! auxiliary variable to replace traceur  
-      real tmp_var2(klon,nbtr) ! auxiliary variable to replace source
-      real tmp_var3(klon,klev,nbtr) ! auxiliary variable 3D  
-      real dummy1d ! JE auxiliary variable
-      real aux_var2(klon) ! auxiliary variable to replace traceur  
-      real aux_var3(klon,klev) ! auxiliary variable to replace traceur  
-      real d_tr(klon,klev,nbtr)    ! traceur  tendance
-      real sconc_seri(klon,nbtr) ! surface concentration of traceur  
-c
-      integer nbjour
-      save nbjour
-c
-      REAL diff_aod550_tot(klon)  ! epaisseur optique total aerosol 550  nm
-      REAL diag_aod670_tot(klon)  ! epaisseur optique total aerosol 670 nm
-      REAL diag_aod865_tot(klon)  ! epaisseur optique total aerosol 865 nm
-      REAL diff_aod550_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
-      REAL diag_aod670_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
-      REAL diag_aod865_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
-      REAL diag_aod550_ss(klon)   ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
-      REAL diag_aod670_ss(klon)   ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
-      REAL diag_aod865_ss(klon)   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
-      REAL diag_aod550_dust(klon) ! epaisseur optique Dust aerosol 550 nm, diagnostic
-      REAL diag_aod670_dust(klon) ! epaisseur optique Dust aerosol 670 nm, diagnostic
-      REAL diag_aod865_dust(klon) ! epaisseur optique Dust aerosol 865 nm, diagnostic
-c
-      real , intent(in) :: paprs(klon,klev+1)  ! pression pour chaque inter-couche (en Pa)
-      real , intent(in) :: pplay(klon,klev)  ! pression pour le mileu de chaque couche (en Pa)
-      real , intent(in) :: RHcl(klon,klev)  ! humidite relativen ciel clair
-      real znivsig(klev)  ! indice des couches
-      real paire(klon)
-      real, intent(in) ::  pphis(klon)
-      real, intent(in) ::  pctsrf(klon,nbsrf)
-      logical , intent(in) :: debutphy   ! le flag de l'initialisation de la physique
-c
-c   Scaling Parameters:
-c   ----------------------
-c
-      CHARACTER*33 c_Directory
-      CHARACTER*33 c_FileName1
-      CHARACTER*42 c_FileName2
-      CHARACTER*71 c_FullName1
-      CHARACTER*77 c_FullName2
-      INTEGER :: xidx, yidx
-      INTEGER,DIMENSION(klon) :: mask_bbreg
-      INTEGER,DIMENSION(klon) :: mask_ffso2reg
-      INTEGER :: aux_mask1
-      INTEGER :: aux_mask2
-
-      INTEGER iregion_so4(klon)  !Defines regions for SO4
-      INTEGER iregion_ind(klon)  !Defines regions for SO2, BC & OM
-      INTEGER iregion_bb(klon)   !Defines regions for SO2, BC & OM
-      INTEGER iregion_dust(klon) !Defines  dust regions
-c      REAL scale_param_sulf(jjm+1)  !Scaling parameter for sulfate (input)
-c      REAL scale_param_so4(klon)  !Scaling parameter for sulfate used whithin phytrac
-      REAL scale_param_ssacc  !Scaling parameter for Fine Sea Salt
-      REAL scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
-      REAL scale_param_ind(nbreg_ind) !Scaling parameter for industrial emissionsi of SO2
-      REAL scale_param_bb(nbreg_bb)  !Scaling parameter for biomas burning (SO2, BC & OM)
-      REAL scale_param_ff(nbreg_ind)  !Scaling parameter for industrial emissions (fossil fuel)
-      REAL scale_param_dustacc(nbreg_dust)  !Scaling parameter for Fine Dust
-      REAL scale_param_dustcoa(nbreg_dust)  !Scaling parameter for Coarse Dust
-c
-c   Emissions:
-c   ---------
-c
-c---------------------------- SEA SALT & DUST emissions ------------------------
-      REAL lmt_sea_salt(klon,ss_bins) !Sea salt 0.03-8.0 um
-      REAL u10m_ec1(klon),v10m_ec1(klon)
-      REAL u10m_ec2(klon),v10m_ec2(klon),dust_ec2(klon)
-      REAL dust_ec(klon)
-!      REAL cly(klon),wth(klon),zprecipinsoil(klon)   ! Titane
-c------------------------- SULFUR emissions ----------------------------
-      REAL lmt_so2volc_cont(klon)  ! emissions so2 volcan (continuous)
-      REAL lmt_altvolc_cont(klon)  ! altitude  so2 volcan (continuous)
-      REAL lmt_so2volc_expl(klon)  ! emissions so2 volcan (explosive)
-      REAL lmt_altvolc_expl(klon)  ! altitude  so2 volcan (explosive)
-      REAL lmt_so2ff_l(klon)       ! emissions so2 fossil fuel (low)
-      REAL lmt_so2ff_h(klon)       ! emissions so2 fossil fuel (high)
-      REAL lmt_so2nff(klon)        ! emissions so2 non-fossil fuel
-      REAL lmt_so2bb_l(klon)       ! emissions de so2 biomass burning (low)
-      REAL lmt_so2bb_h(klon)       ! emissions de so2 biomass burning (high)
-      REAL lmt_so2ba(klon)         ! emissions de so2 bateau
-      REAL lmt_dms(klon)           ! emissions de dms
-      REAL lmt_dmsconc(klon)       ! concentration de dms oceanique
-      REAL lmt_dmsbio(klon)        ! emissions de dms bio 
-      REAL lmt_h2sbio(klon)        ! emissions de h2s bio
-c------------------------- BLACK CARBON emissions ----------------------
-      REAL lmt_bcff(klon)       ! emissions de BC fossil fuels
-      REAL lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
-      REAL lmt_bcbb_l(klon)     ! emissions de BC biomass basses
-      REAL lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
-      REAL lmt_bcba(klon)      ! emissions de BC bateau
-c------------------------ ORGANIC MATTER emissions ---------------------      
-      REAL lmt_omff(klon)     ! emissions de OM fossil fuels
-      REAL lmt_omnff(klon)    ! emissions de OM non-fossil fuels
-      REAL lmt_ombb_l(klon)   ! emissions de OM biomass basses
-      REAL lmt_ombb_h(klon)   ! emissions de OM biomass hautes
-      REAL lmt_omnat(klon)    ! emissions de OM Natural
-      REAL lmt_omba(klon)     ! emissions de OM bateau
-                                                                        
-c
-c  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
-c
-c   convection:
-c   -----------
-c
-      REAL , intent(in) :: pmfu(klon,klev)  ! flux de masse dans le panache montant
-      REAL , intent(in) :: pmfd(klon,klev)  ! flux de masse dans le panache descendant
-      REAL, intent(in) ::  pen_u(klon,klev) ! flux entraine dans le panache montant
-      REAL, intent(in) ::  pde_u(klon,klev) ! flux detraine dans le panache montant
-      REAL, intent(in) ::  pen_d(klon,klev) ! flux entraine dans le panache descendant
-      REAL, intent(in) ::  pde_d(klon,klev) ! flux detraine dans le panache descendant
-c
-c  Convection KE scheme:
-c  ---------------------
-c
-c! Variables pour le lessivage convectif
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated
-c            updraft mass flux
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated
-c            downdraft mass flux
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: evap
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
-
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
-       REAL,DIMENSION(klon),INTENT(IN)           :: sigd
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
-       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)      :: wght_cvfd          !RL
-
-
-c     KE: Tendances de traceurs (Td) et flux de traceurs:
-!     ------------------------
-       REAL,DIMENSION(klon,klev)      :: Mint
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPr,qDi ! concentration tra
-c       dans pluie,air descente insaturee
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPa,qMel
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qTrdi,dtrcvMA ! conc traceur
-c              descente air insaturee et td convective MA
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv  ! Td convection/traceur
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_th  ! Td thermique
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_insc
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_bcscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_evapls
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_ls
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cl
-       REAL,DIMENSION(:,:),ALLOCATABLE,SAVE      :: qPrls      !jyg: concentration 
-!                                                        !tra dans pluie LS a la surf.
-!      outputs for cvltr_spl
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv_o  
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav_o
-
-
-
-       INTEGER ::  nsplit
-!
-
-     
-
-!CHECK!!
-!!!$OMP
-!!!!THREADPRIVATE(qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa,d_tr_lessi_nucl)
-!!!!$OMP THREADPRIVATE(d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qPr,qDi)
-!$OMP THREADPRIVATE(d_tr_insc,d_tr_bcscav,d_tr_evapls,d_tr_ls,qPrls)
-!!!!!$OMP THREADPRIVATE(d_tr,d_tr_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
-
-
-c
-c  Lessivage
-c  ---------
-c
-      REAL, intent(in) ::  pmflxr(klon,klev+1), pmflxs(klon,klev+1)   !--convection
-      REAL, intent(in) ::  prfl(klon,klev+1),   psfl(klon,klev+1)     !--large-scale
-! JE      REAL pmflxr(klon,klev), pmflxs(klon,klev)   !--convection       ! Titane
-! JE      REAL prfl(klon,klev),   psfl(klon,klev)     !--large-scale      ! Titane
-      REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
-      REAL  :: ql_incloud_ref    ! ref value of in-cloud condensed water content
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb    ! fraction nuageuse (grande echelle)
-!
-
-      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,SAVE  :: iflag_lscav_omp,iflag_lscav
-
-
-
-
-!Thermiques:
-!----------
-      REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-      REAL,DIMENSION(klon,klev),INTENT(IN)     :: entr_therm
-
-
-c
-c   Couche limite:
-c   --------------
-c
-      REAL , intent(in) :: coefh(klon,klev) ! coeff melange CL
-      REAL , intent(in) :: cdragh(klon), cdragm(klon)
-      REAL, intent(in) ::  yu1(klon)        ! vent dans la 1iere couche
-      REAL, intent(in) ::  yv1(klon)        ! vent dans la 1iere couche
-c
-c
-c----------------------------------------------------------------------
-      REAL his_ds(klon,nbtr)
-      REAL his_dhlsc(klon,nbtr)        ! in-cloud scavenging lsc
-      REAL his_dhcon(klon,nbtr)       ! in-cloud scavenging con
-      REAL his_dhbclsc(klon,nbtr)      ! below-cloud scavenging lsc
-      REAL his_dhbccon(klon,nbtr)      ! below-cloud scavenging con
-      REAL trm(klon,nbtr)
-c
-      REAL u10m_ec(klon), v10m_ec(klon)
-c
-      REAL his_th(klon,nbtr)
-      REAL his_dhkecv(klon,nbtr)
-      REAL his_dhkelsc(klon,nbtr)
-
-
-c
-c   Coordonnees
-c   -----------
-c
-      REAL, intent(in) ::  xlat(klon)       ! latitudes pour chaque point 
-      REAL, intent(in) ::  xlon(klon)       ! longitudes pour chaque point 
-C
-      INTEGER i, k, it, j, ig 
-c
-c DEFINITION OF DIAGNOSTIC VARIABLES
-c
-      REAL diag_trm(nbtr), diag_drydep(nbtr) 
-      REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
-      REAL diag_emissn(nbtr), diag_g2part
-      REAL diag_sedimt
-      REAL trm_aux(nbtr), src_aux(nbtr)
-c
-c Variables locales pour effectuer les appels en serie
-c----------------------------------------------------
-      REAL source_tr(klon,nbtr)
-      REAL flux_tr(klon,nbtr)
-      REAL m_conc(klon,klev)
-      REAL sed_ss(klon)    ! corresponds to tracer 3
-      REAL sed_dust(klon)  ! corresponds to tracer 4
-      REAL henry(nbtr)  !--cste de Henry  mol/l/atm
-      REAL kk(nbtr)     !--coefficient de var avec T (K)
-      REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
-      REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
-      REAL vdep_oce(nbtr), vdep_sic(nbtr)
-      REAL vdep_ter(nbtr), vdep_lic(nbtr)
-      REAL dtrconv(klon,nbtr)
-      REAL zrho(klon,klev), zdz(klon,klev)
-      REAL zalt(klon,klev)
-      REAL,DIMENSION(klon,klev)      :: zmasse    ! densité atmosphérique
-c     .                                              Kg/m2
-      REAL,DIMENSION(klon,klev)      :: ztra_th
-      REAL qmin, qmax, aux
-!      PARAMETER (qmin=0.0, qmax=1.e33)
-      PARAMETER (qmin=1.e33, qmax=-1.e33)
-
-c Variables to save data into file
-c----------------------------------
-   
-      CHARACTER*2 str2
-      LOGICAL ok_histrac
-      PARAMETER (ok_histrac=.true.)
-      INTEGER ndex2d(iim*(jjm+1)), ndex3d(iim*(jjm+1)*klev)
-      INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
-      INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      INTEGER itra
-      SAVE itra                    ! compteur pour la physique
-      INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
-      REAL zx_tmp_2d(iim,jjm+1), zx_tmp_3d(iim,jjm+1,klev)
-      REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
-      REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
-      REAL zsto, zout, zout_h, zout_m, zjulian
-      REAL fluxbb(klon), fluxff(klon)
-      REAL fluxbcbb(klon), fluxbcff(klon), fluxbcnff(klon)
-      REAL fluxombb(klon), fluxomff(klon), fluxomnat(klon)
-      REAL fluxomnff(klon), fluxomba(klon), fluxbcba(klon)
-      REAL fluxso2ff(klon), fluxso2bb(klon), fluxso2(klon)
-      REAL fluxso2nff(klon), fluxso2vol(klon), fluxso2ba(klon) 
-      REAL fluxh2sff(klon), fluxh2snff(klon)
-      REAL fluxso4ff(klon), fluxso4bb(klon), fluxso4ba(klon)
-      REAL fluxh2sbio(klon), fluxso4nff(klon)
-      REAL fluxdms(klon)
-      REAL fluxbc(klon), fluxom(klon), fluxso4(klon)
-      REAL fluxdd(klon), fluxss(klon)
-      REAL fluxdustec(klon), fluxssfine(klon), fluxsscoa(klon)
-      REAL fluxddfine(klon), fluxddcoa(klon)
-      REAL flux_sparam_bb(klon), flux_sparam_ff(klon)
-      REAL flux_sparam_ind(klon) !, flux_sparam_sulf(klon,klev)
-      REAL flux_sparam_ddfine(klon), flux_sparam_ddcoa(klon)
-      REAL flux_sparam_ssfine(klon), flux_sparam_sscoa(klon)
-
-c------------------DMS  SO2  SO4   H2S  DMSO MSA H2O2 
-c------------------BC1, BC2, OM1, OM2,flyash  dust1   dust2 
-c------------------Sea Salt 1-8 bins 
-c------------------Precursors (gases), Fine, Coarse Aerosols
-C c
-C       DATA henry   /1.4, 0.0, 0.0, 0.0/
-C c
-C       DATA kk      /2900., 0., 0., 0./
-C c
-C       DATA alpha_r /0., 0.001, 0.001, 0.001/
-C c
-C       DATA alpha_s /0., 0.01, 0.01, 0.01/
-C c
-C cnhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-C cnhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-C       DATA vdep_oce /0.28, 0.28, 1.2, 1.2/
-C c
-C       DATA vdep_sic /0.2, 0.17, 1.2, 1.2/
-C c
-C       DATA vdep_ter /0.3, 0.14, 1.2, 1.2/
-
-C       DATA vdep_lic /0.2, 0.17, 1.2, 1.2/
-      
-c------Molar Masses
-      REAL masse(nbtr)
-c
-      REAL fracso2emis                              !--fraction so2 emis en so2
-      PARAMETER (fracso2emis=0.95) 
-      REAL frach2sofso2                             !--fraction h2s from so2
-      PARAMETER (frach2sofso2=0.0426)
-c
-c   Controles
-c-------------
-      LOGICAL convection,lessivage,lminmax
-      DATA convection,lessivage,lminmax
-     s     /.true.,.true.,.true./
-c
-      REAL xconv(nbtr)
-c
-      LOGICAL anthropo, bateau, edgar
-      DATA anthropo,bateau,edgar/.true.,.true.,.true./
-c
-cc bc_source
-      INTEGER kminbc, kmaxbc
-      PARAMETER (kminbc=3, kmaxbc=5)
-c
-      REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
-c
-c JE for updating in  cltrac
-      REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
-      REAL,DIMENSION(klon,nbtr)       :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-      REAL,DIMENSION(klon,nbtr)        ::  flux_tr_dry
-c      SAVE  d_tr_dry
-c JE for include gas to particle conversion in output
-      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
-      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
-c
-      INTEGER ,intent(in) :: iflag_conv
-      LOGICAL iscm3  ! debug variable. for checkmass ! JE
-
-c------------------------------------------------------------------------
-c   only to compute time consumption of each process
-c----
-      INTEGER clock_start,clock_end,clock_rate,clock_start_spla
-      INTEGER clock_end_outphytracr,clock_start_outphytracr
-      INTEGER ti_init,dife,ti_inittype,ti_inittwrite
-      INTEGER ti_spla,ti_emis,ti_depo,ti_cltr,ti_ther
-      INTEGER ti_sedi,ti_gasp,ti_wetap,ti_cvltr,ti_lscs,ti_brop,ti_outs
-      INTEGER ti_nophytracr,clock_per_max
-      REAL tia_init,tia_inittype,tia_inittwrite
-      REAL tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther
-      REAL tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs
-      REAL tia_brop,tia_outs
-      REAL tia_nophytracr
- 
-      SAVE tia_init,tia_inittype,tia_inittwrite
-      SAVE tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther
-      SAVE tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs
-      SAVE tia_brop,tia_outs
-      SAVE ti_nophytracr
-      SAVE tia_nophytracr
-      SAVE clock_end_outphytracr,clock_start_outphytracr
-      SAVE clock_per_max
-      LOGICAL logitime
-
-c======================================================================
-c   INITIALISATIONS
-c======================================================================
-
-             CALL checknanqfi(da(:,:),1.,-1.,' da_ before
-     . phytracr_inphytracr')
-
-c
-c computing time
-        logitime=.true.
-        IF (logitime) THEN
-        clock_start=0
-        clock_end=0
-        clock_rate=0
-       CALL SYSTEM_CLOCK(COUNT_RATE=clock_rate,COUNT_MAX=clock_per_max)
-        CALL SYSTEM_CLOCK(COUNT=clock_start_spla)
-        clock_start=clock_start_spla
-!        IF (.NOT.debutphy) THEN
-        clock_end_outphytracr=clock_start_spla
-!        print*,'JE clock',clock_rate,clock_per_max
-!        ENDIF
-        ENDIF
-
-
-
-c---fraction of tracer that is convected (??
-      xconv(1)=0.8
-      xconv(2)=0.5
-      xconv(3)=0.5
-      xconv(4)=0.6
-
-      masse(1)=32.
-      masse(2)=6.02e23
-      masse(3)=6.02e23
-      masse(4)=6.02e23 
-
-      henry= (/1.4, 0.0, 0.0, 0.0/)
-      kk = (/2900., 0., 0., 0./)
-      alpha_r =  (/0., 0.001, 0.001, 0.001/)
-      alpha_s = (/0., 0.01, 0.01, 0.01/)
-
-c nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-c nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-      vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
-      vdep_sic = (/0.2, 0.17, 1.2, 1.2/)     
-      vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
-      vdep_lic = (/0.2, 0.17, 1.2, 1.2/)      
-
-
-
-      lmt_dms(:)=0.0
-      aux_var2(:)=0.0
-      aux_var3(:,:)=0.0
-      source_tr(:,:)=0.0
-      flux_tr(:,:)=0.0
-      flux_sparam_bb(:)=0.0
-      flux_sparam_ff(:)=0.0
-      flux_sparam_ind(:)=0.0
-      flux_sparam_ddfine(:)=0.0
-      flux_sparam_ddcoa(:)=0.0
-      flux_sparam_ssfine(:)=0.0
-      flux_sparam_sscoa(:)=0.0
-      
-      d_tr_dry(:,:)=0.0
-      flux_tr_dry(:,:)=0.0
-!
-      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
-      RG = 9.80665
-      RNAVO =6.02e23
-      RLVTT=2.5008E+6
-      RLSTT=2.8345E+6
-      R4IES=7.66
-      R3IES=21.875
-      R4LES=35.86
-      R3LES=17.269
-      RTT=273.16
-      RMV=18.0153
-      RKBOL=1.380658E-23
-      R=RNAVO*RKBOL
-      R5LES=R3LES*(RTT-R4LES)
-      R5IES=R3IES*(RTT-R4IES)
-      RV=1000.*R/RMV
-      RCPV=4.*RV
-      RCPD=3.5*RD
-      RVTMP2=RCPV/RCPD-1
-      RETV=RV/RD-1.
-
-c
-      iscm3=.false.
-      if (debutphy) then
-         print *, 'let s check nbtr=', nbtr
-         print *, 'xlat and xlon'
-c JE   initializon to cero the tracers     
-         DO it=1, nbtr
-            tr_seri(:,:,it)=0.0
-         ENDDO
-c JE end     
-! Initializing to zero tr_seri for comparison purposes
-!        tr_seri(:,:,:)=0.0
-c
-!        DO it=1,nbtr
-!           trm_aux(it)=0.0
-!           src_aux(it)=0.0
-!           diag_trm(it)=0.0
-!           diag_drydep(it)=0.0
-!           diag_wetdep(it)=0.0
-!           diag_cvtdep(it)=0.0
-!           diag_emissn(it)=0.0
-!        ENDDO
-!        diag_g2part=0.0
-         print *,'PREPARE FILES TO SAVE VARIABLES'
-c
-         nbjour=30
-         ecrit_tra =   NINT(86400./pdtphys)                    !--1-day  average
-         ecrit_tra_h = NINT(86400./pdtphys*0.25)               !--6-hour average
-         ecrit_tra_m = NINT(86400./pdtphys*FLOAT(nbjour))      !--1-mth  average
-         print *,'ecrit_tra=', pdtphys, ecrit_tra
-
-         IF (ok_histrac) THEN
-  
-           itra=0
-c
-           CALL ymds2ju(1900, 1, 1, 0.0, zjulian)
-c
-           print *, 'klon,iim,jjm+1 = ',klon,iim,jjm+1
-           CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlon,zx_lon)
-c
-           DO i = 1, iim
-             zx_lon(i,1) = xlon(i+1)
-             zx_lon(i,jjm+1) = xlon(i+1)
-           ENDDO
-c
-           CALL histbeg("histrac_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori1, nid_tra1)
-c
-           CALL histbeg("lessivage_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori2, nid_tra2)
-c
-           CALL histbeg("traceur_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori3, nid_tra3)
-c
-           CALL histvert(nid_tra1, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra2, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra3, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           zsto = pdtphys
-           zout = pdtphys * FLOAT(ecrit_tra)
-           zout_h = pdtphys * FLOAT(ecrit_tra_h)
-           zout_m = pdtphys * FLOAT(ecrit_tra_m)
-           print *,'zsto zout=', zsto, zout
-
-c
-c----------------- HISTORY FILES OF TRACER EMISSIONS -------------------
-c
-c HISTRAC
-c
-           CALL histdef(nid_tra1, "fluxbb", "Flux BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxff", "Flux FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcbb", "Flux BC-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcff", "Flux BC-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcnff", "Flux BC-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcba", "Flux BC-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbc", "Flux BC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxombb", "Flux OM-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomff", "Flux OM-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnff", "Flux OM-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomba", "Flux OM-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnat", "Flux OM-NT", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxom", "Flux OM", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sff","Flux H2S FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2snff","Flux H2S non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2ff","Flux SO2 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2nff","Flux SO2 non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2bb", "Flux SO2 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2vol","Flux SO2 Vol","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2ba", "Flux SO2 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2", "Flux SO2","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4ff","Flux SO4 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4nff","Flux SO4 non-FF",
-     .                  "mgS/m2/s", iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4bb", "Flux SO4 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4ba", "Flux SO4 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4", "Flux SO4","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdms", "Flux DMS", "mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sbio","Flux H2S Bio","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdustec", 
-     .                                 "Flux Dust EC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddfine","DD Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddcoa","DD Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxdd","Flux DD","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxssfine","SS Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxsscoa","SS Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxss","Flux SS","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"fluxso4chem","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ind","Ind emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_bb","BB emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ff","FF emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddfine","DD fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddcoa","DD coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ssfine","SS fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_sscoa","SS coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"u10m","Zonal wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"v10m","Meridional wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"flux_sparam_sulf","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-c TRACEUR
-c
-           CALL histdef(nid_tra3, "taue550", "Tau ext 550", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670", "Tau ext 670", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865", "Tau ext 865", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_tr2", "Tau ext 550tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_tr2", "Tau ext 670tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_tr2", "Tau ext 865tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_ss", "Tau ext 550ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_ss", "Tau ext 670ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_ss", "Tau ext 865ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_dust", "Tau ext 550dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_dust", "Tau ext 670dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_dust", "Tau ext 865dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-           DO it=1, nbtr
-c
-           WRITE(str2,'(i2.2)') it
-c
-           CALL histdef(nid_tra3, "trm"//str2, "Burden No."//str2, 
-     .                  "mgS/m2", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "sconc"//str2, "Surf Conc. No."//str2,
-     .                  "mg/m3", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c LESSIVAGE
-c
-           CALL histdef(nid_tra2, "flux"//str2, "emission"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "ds"//str2, "Depot sec No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dh"//str2,
-     .                  "Depot hum No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dtrconv"//str2,
-     .                  "Tiedke convective"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-           CALL histdef(nid_tra2,"dtherm"//str2,
-     .                  "Thermals dtracer"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-           CALL histdef(nid_tra2,"dhkecv"//str2,
-     .                  "KE dep hum convective"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"dhkelsc"//str2,
-     .                  "KE dep hum large scale"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-
-           CALL histdef(nid_tra2,"d_tr_cv"//str2,
-     .                  "cvltr d_tr_cv"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"d_tr_trsp"//str2
-     .                  ,"cvltr d_tr_trsp"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"d_tr_sscav"//str2
-     .                  ,"cvltr d_tr_sscav"//str2,"mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-           CALL histdef(nid_tra2,"d_tr_sat"//str2
-     .                  ,"cvltr d_tr_sat"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-         CALL histdef(nid_tra2,"d_tr_uscav"//str2
-     .                  ,"cvltr d_tr_uscav"//str2,
-     .                  "mgS/m2/s",
-     .                  iim,jjm+1,nhori2, klev,1,klev,nvert, 32,
-     .                  "ave(X)", zsto,zout)
-
-
-
-c
-           ENDDO
-c
-           CALL histdef(nid_tra2, "sed_ss", "Sedmet. Tr3", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "sed_dust", "Sedmet. Tr4", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)         
-c
-           CALL histdef(nid_tra2, "g2p_gas", "Gas2particle gas sink", 
-     .                  "mg-S/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "g2p_aer", "Gas2particle tr2 src", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c--------------------------------------------------------------------
-c
-           CALL histend(nid_tra1)
-c
-           CALL histend(nid_tra2)
-c
-           CALL histend(nid_tra3)
-c
-c--------------------------------------------------------------------
-
-!        nbjour=1
-         ENDIF !--ok_histrac
-
-c
-!        IF (.NOT.edgar.AND.bateau) THEN
-!        PRINT *,'ATTENTION risque de compter double les bateaux'
-!        STOP
-!        ENDIF
-c
-c
-c
-      endif ! debutphy
-c
-c======================================================================
-c Initialisations
-c======================================================================
-c
-c
-c je  KE init
-      IF (debutphy) THEN
-        ALLOCATE(d_tr_cv(klon,klev,nbtr))
-        ALLOCATE(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_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))
-        ALLOCATE(d_tr_cl(klon,klev,nbtr))
-
-        ALLOCATE(d_tr_cv_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_trsp_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_sscav_o(klon,klev,nbtr),
-     .           d_tr_sat_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_uscav_o(klon,klev,nbtr))
-!
-!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  = 4
-!Config
-        !$OMP MASTER
-        iflag_lscav_omp=4
-        call getin('iflag_lscav', iflag_lscav_omp)
-        !$OMP END MASTER
-        !$OMP BARRIER
-        iflag_lscav=iflag_lscav_omp
-! initialiation for time computation
-
-        tia_spla=0.
-        tia_emis=0.
-        tia_depo=0.
-        tia_cltr=0.
-        tia_ther=0.
-        tia_sedi=0.
-        tia_gasp=0.
-        tia_wetap=0.
-        tia_cvltr=0.
-        tia_lscs=0.
-        tia_brop=0.
-        tia_outs=0.
-        tia_nophytracr=0.
-        clock_start_outphytracr=clock_end_outphytracr+1
-
-       ENDIF ! debutphy
-     
-
-! initialiation for time computation
-        
-        ti_spla=0
-        ti_emis=0
-        ti_depo=0
-        ti_cltr=0
-        ti_ther=0
-        ti_sedi=0
-        ti_gasp=0
-        ti_wetap=0
-        ti_cvltr=0
-        ti_lscs=0
-        ti_brop=0
-        ti_outs=0
-
-
-       DO k=1,klev
-        DO i=1,klon
-         Mint(i,k)=0.
-        END DO
-       END DO
-
-
-c
-      DO it=1, nbtr
-       DO k=1,klev
-        DO i=1,klon
-         d_tr_cv(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(i,k,it)=0.
-         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_cl(i,k,it)=0.
-  
-         d_tr_cv_o(i,k,it)=0.
-         d_tr_trsp_o(i,k,it)=0.
-         d_tr_sscav_o(i,k,it)=0.
-         d_tr_sat_o(i,k,it)=0.
-         d_tr_uscav_o(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 it=1, nbtr
-       DO i=1,klon
-          qPrls(i,it)=0.0
-          dtrconv(i,it)=0.0
-       ENDDO
-      ENDDO
-
-      DO it=1, nbtr
-      DO i=1, klon 
-        his_dhlsc(i,it)=0.0
-        his_dhcon(i,it)=0.0
-        his_dhbclsc(i,it)=0.0
-        his_dhbccon(i,it)=0.0
-        trm(i,it)=0.0
-        his_th(i,it)=0.0
-        his_dhkecv(i,it)=0.0
-        his_dhkelsc(i,it)=0.0
-
-      ENDDO
-      ENDDO
-cJE:      
-      DO i=1, klon 
-         his_g2pgas(i) = 0.0
-         his_g2paer(i) = 0.0
-      ENDDO
-c endJE
-c
-
-      DO k=1, klev
-      DO i = 1, klon
-        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
-        zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/RG
-      ENDDO
-      ENDDO
-c
-      DO i = 1, klon
-        zalt(i,1)=pphis(i)/RG
-      ENDDO
-      DO k=1, klev-1
-      DO i = 1, klon
-        zalt(i,k+1)=zalt(i,k)+zdz(i,k)
-      ENDDO
-      ENDDO
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_init=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_init=tia_init+REAL(ti_init)/REAL(clock_rate)
-      ENDIF
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-c
-c======================================================================
-c Initialisations of Scaling Parameters
-c======================================================================
-C
-C ----------------------------- SO4 -----------------------------------
-C
-c      scale_param_so4(1)=scale_param_sulf(1)
-c      scale_param_so4(klon)=scale_param_sulf(jjm+1)
-                  
-c      DO j = 2, jjm
-c        DO i = 1, iim
-c          ig=iim*(j-2)+i+1
-c          scale_param_so4(ig)=scale_param_sulf(j)
-c        ENDDO
-c      ENDDO
-C
-C ----------------------- SO2, BC & OM --------------------------------
-C ----------------FOSSIL FUEL AND INUDSTRIAL EMISSIONS-----------------
-      iregion_dust(:)=-999
-      iregion_ind(:)=-999
-      iregion_bb(:)=-999
-! READING BB MASK
-!     c_Directory='/ccc/work/cont003/dsm/nhuneeus/REGION_MASK/'
-      c_Directory='/d6/jelmd/LMDZ_INPUT/REGION_MASK/'
-!      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c JE por v2      c_FileName1='GFED_phyBBmask_lowres.txt'
-c JE por v2      c_FileName2='Country_phyFFandSO2mask_lowres.txt'
-c      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c      c_FileName2='Country_phyFFandSO2mask_lowres_v2.txt'
-       c_FileName1='GFED_phyBBmask_lowres_je48x36.txt'
-       c_FileName2='Country_phyFFandSO2mask_lowres_je48x36.txt'
-      c_FullName1=c_Directory//c_FileName1
-      c_FullName2=c_Directory//c_FileName2
-      print *,'BB mask NL = ',c_FullName1
-!
-      OPEN (UNIT=1,FILE=c_FullName1)
-      OPEN (UNIT=111,FILE=c_FullName2)
-      DO j=1,klon
-!         print *, j, klon
-         aux_mask1=0
-         aux_mask2=0
-         READ(1,102) aux_mask1
-!         mask_BBreg(j)=aux_mask1
-         iregion_bb(j)=aux_mask1
-         READ(111,102) aux_mask2
-!         print *,'aux_mask1, aux_mask2
-!     .    =',aux_mask1,aux_mask2,INT(aux_mask1),INT(aux_mask2)
-!         mask_ffso2reg(j)=aux_mask2
-         iregion_ind(j)=aux_mask2
-      ENDDO
-      CLOSE (UNIT=1)
-      CLOSE (UNIT=111)
-!
-      IF (debutphy) THEN
-      OPEN(25,FILE='dustregions_pyvar.data')
-      OPEN(55,FILE='indregions_pyvar.data')
-      OPEN(75,FILE='bbregions_pyvar.data')
-      ENDIF
-
-      DO i = 1, klon
-C ----------------------- SO2, BC & OM ---------------------------------
-C -----------------------BIOMASS BURNING--------------------------------
-C ------------------------------- DUST ---------------------------------
-C
-        IF ((xlat(i).GT.11).AND.(xlon(i).LT.-85)) THEN
-c NORTH WEST AMERICA = 1
-          iregion_dust(i)=1
-        ELSEIF ((xlat(i).LE.11).AND.(xlon(i).LT.-25)) THEN
-c SOUTH AMERICA = 2
-          iregion_dust(i)=2      
-        ELSEIF ((xlat(i).GE.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.14)) THEN
-c WEST SAHARA = 3
-          iregion_dust(i)=3
-        ELSEIF ((xlat(i).GT.-1.75*xlon(i)+89).AND.
-     .       (xlat(i).GT.0.524*xlon(i)-11.048).AND.
-     .       (xlat(i).LT.-0.464*xlon(i)+53.179).AND.
-     .       (xlat(i).LT.36)) THEN
-c SAUDI ARABIA = 9
-          iregion_dust(i)=9
-        ELSEIF ((xlat(i).LT.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.77)) THEN
-c AFRICA SUB-SAHARA = 5
-          iregion_dust(i)=5
-        ELSEIF ((xlon(i).GT.77).AND.(xlat(i).LT.-5)) THEN
-c AUSTRALIA = 8
-          iregion_dust(i)=8
-        ELSEIF ((xlon(i).GE.77).AND.(xlat(i).GE.-5)) THEN
-c ASIA EAST = 6  REGION ADDED 
-          iregion_dust(i)=6
-        ELSEIF (xlat(i).GT.11.AND.xlon(i).GE.-85.AND.
-     .          xlon(i).LT.-25) THEN
-c NORTH EAST AMERICA = 11
-          iregion_dust(i)=11
-        ELSEIF ((xlon(i).LT.77).AND.(xlat(i).LT.36).AND.
-     .       (xlat(i).GE.11).AND.
-     .       (xlat(i).GT.-0.464*xlon(i)+53.179).OR.
-     .       (xlat(i).LT.0.524*xlon(i)-11.048)) THEN 
-c INDIAN SUBCONTINENT
-          iregion_dust(i)=10
-        ELSEIF ((xlon(i).GT.33).AND.(xlon(i).LT.77).AND.
-     .       (xlat(i).GE.36)) THEN
-c ASIA WEST = 7
-          iregion_dust(i)=7
-        ELSEIF ((xlat(i).GE.11).AND.
-     .       (xlon(i).GT.14).AND.
-     .       (xlat(i).LT.-1.75*xlon(i)+89).OR.xlon(i).LE.33) THEN
-c EAST SAHARA = 4
-          iregion_dust(i)=4
-        ENDIF
-
-      IF (debutphy) THEN
-c       WRITTING REGIONS INTO FILE
-        IF (iregion_dust(i).LT.10) THEN
-          WRITE (25,101) iregion_dust(i)
-        ELSE
-          WRITE (25,102) iregion_dust(i)
-        ENDIF
-        WRITE (55,*) iregion_ind(i)
-        WRITE (75,*) iregion_bb(i)
-!        WRITE (55,102) iregion_ind(i)
-!        WRITE (75,102) iregion_bb(i)
-
-      ENDIF ! debutphy/write regions
-      ENDDO
-!      print *,'NEW DUST REGION, NOW 11 REGIONS!'
-      IF (debutphy) THEN
-
-      CLOSE(25)
-      CLOSE(55)
-      CLOSE(75)
-  101 FORMAT (i1)
-  102 FORMAT (i2)
-!      stop
-
-      ENDIF
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_inittype=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_inittype=tia_inittype+REAL(ti_inittype)/REAL(clock_rate)
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-c
-c=======================================================================
-c SAVING SURFACE TYPE
-c=======================================================================
-      IF (debutphy) THEN
-
-      OPEN(35,FILE='surface_ocean.data')
-      OPEN(45,FILE='surface_seaice.data')
-      OPEN(65,FILE='surface_land.data')
-      OPEN(85,FILE='surface_landice.data')
-      DO i = 1, klon
-         WRITE (35,103) pctsrf(i,is_oce)
-         WRITE (45,103) pctsrf(i,is_sic)
-         WRITE (65,103) pctsrf(i,is_ter)
-         WRITE (85,103) pctsrf(i,is_lic)
-      ENDDO
-      CLOSE(35)
-      CLOSE(45)
-      CLOSE(65)
-      CLOSE(85)
-  103 FORMAT (f6.2)
-      ENDIF
-!      stop
-c
-c=======================================================================
-
-!        CALL checknanqfi(tr_seri(:,:,1),qmin,qmax,'nan_TEST0it1')
-!        CALL checknanqfi(tr_seri(:,:,2),qmin,qmax,'nan_TEST0it2')
-!        CALL checknanqfi(tr_seri(:,:,3),qmin,qmax,'nan_TEST0it3')
-!        CALL checknanqfi(tr_seri(:,:,4),qmin,qmax,'nan_TEST0it4')
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-      iscm3=.true.
-
-!        CALL checknanqfi(t_seri(:,:),qmin,qmax,'nan_t_seri')
-!       CALL abort_gcm('TEST1', 'Pass nan t_seri', 1)
-!        CALL checknanqfi(tr_seri(:,:,1),qmin,qmax,'nan_TEST1it1')
-!        CALL checknanqfi(tr_seri(:,:,2),qmin,qmax,'nan_TEST1it2')
-!        CALL checknanqfi(tr_seri(:,:,3),qmin,qmax,'nan_TEST1it3')
-!        CALL checknanqfi(tr_seri(:,:,4),qmin,qmax,'nan_TEST1it4')
-!        DO it=1, nbtr   
-!           CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,
-!     . 'after kg_to_cm3')
-!        ENDDO
-c=======================================================================
-c
-      DO k=1, klev
-      DO i=1, klon
-        m_conc(i,k)=pplay(i,k)/t_seri(i,k)/RKBOL*1.e-6
-      ENDDO
-      ENDDO
-
-!
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_avt_coarem')
-        ENDDO        
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'avt coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: avt coarem')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_inittwrite=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_inittwrite=tia_inittwrite+REAL(ti_inittwrite)/REAL(clock_rate)
-      ENDIF
-
-c
-c
-c=======================================================================
-c                     EMISSIONS OF COARSE AEROSOLS
-c=======================================================================
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-
-c      
-c      PRINT *, 'DUST EMISSION VALUES FOR REAGION EAST ASIA'
-c      DO i=1, klon
-c        IF ((xlon(i).GT.105).AND.(xlat(i).GE.-5)) THEN
-c           print *, 'DUST_EC,LON,LAT = ',dust_ec(i),xlon(i),xlat(i)
-c        ENDIF
-c      ENDDO
-      print *,'Number of tracers = ',nbtr
-
-      print *,'AT BEGINNING OF PHYTRACR_SPL'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-
-      CALL coarsemission(pctsrf,pdtphys,t_seri,
-     .                   pmflxr,pmflxs,prfl,psfl,
-     .                   scale_param_ssacc,scale_param_sscoa,
-     .                   scale_param_dustacc,scale_param_dustcoa,
-     .                   iregion_dust,dust_ec,
-     .                   lmt_sea_salt,qmin,qmax,
-     .                             flux_sparam_ddfine,flux_sparam_ddcoa,
-     .                             flux_sparam_ssfine,flux_sparam_sscoa,
-     .                                                source_tr,flux_tr)
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_coarem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after coarem')
-      ENDIF
-
-c
-c
-c
-c======================================================================
-c                   EMISSIONS OF AEROSOL PRECURSORS      
-c======================================================================
-c
-      print *,'INPUT TO PRECUREMISSION'
-
-      CALL precuremission(ftsol,u10m_ec,v10m_ec,pctsrf,
-     .                    u_seri,v_seri,paprs,pplay,cdragh,cdragm,
-     .                    t_seri,q_seri,tsol,fracso2emis,frach2sofso2,
-     .                    bateau,zdz,zalt,kminbc,kmaxbc,pdtphys,
-     .                    scale_param_bb,scale_param_ind,
-     .                    iregion_ind, iregion_bb,
-     .                    lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     .                    lmt_so2bb_l,lmt_so2bb_h,
-     .                    lmt_so2volc_cont,lmt_altvolc_cont,
-     .                    lmt_so2volc_expl,lmt_altvolc_expl,
-     .                    lmt_dmsbio,lmt_h2sbio, lmt_dmsconc, lmt_dms,
-     .                                  flux_sparam_ind, flux_sparam_bb,
-     .                                  source_tr,flux_tr,tr_seri)
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after precur')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after precur')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after precur')
-      ENDIF
-
-c
-c
-c=======================================================================
-c                      EMISSIONS OF FINE AEROSOLS
-c=======================================================================
-c
-      CALL finemission(zdz,pdtphys,zalt,kminbc,kmaxbc,
-     .                 scale_param_bb,scale_param_ff,
-     .                 iregion_ind,iregion_bb,
-     .                 lmt_bcff, lmt_bcnff, lmt_bcbb_l,lmt_bcbb_h,
-     .                 lmt_bcba, lmt_omff, lmt_omnff,
-     .                 lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba,
-     .                                  flux_sparam_bb, flux_sparam_ff,
-     .                                        source_tr,flux_tr,tr_seri)
-c
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_fineem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after fineem')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after fineem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after fineem')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_emis=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_emis=tia_emis+REAL(ti_emis)/REAL(clock_rate)
-      ENDIF
-
-
-
-
-
-c
-c=======================================================================
-c                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
-c=======================================================================
-c
-!        DO it=1,nbtr
-!         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-!     .      pplay,t_seri,iscm3,'')
-!        ENDDO
-
-!======================================================================
-!    -- Dry deposition --
-!======================================================================
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-      iscm3=.false.
-c----------------------------
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before depo')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before depo')
-      ENDIF
-
-      CALL deposition(vdep_oce,vdep_sic,vdep_ter,vdep_lic,pctsrf,
-     .                zrho,zdz,pdtphys,RHcl,masse,t_seri,pplay,paprs,
-     .                lminmax,qmin,qmax,
-     .                         his_ds,source_tr,tr_seri)
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after depo')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after depo')
-        ENDDO
-
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after depo')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_depo=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_depo=tia_depo+REAL(ti_depo)/REAL(clock_rate)
-      ENDIF
-
-
-c
-!======================================================================
-!    -- Boundary layer mixing --
-!======================================================================
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-c
-
-       DO k = 1, klev
-        DO i = 1, klon
-         delp(i,k) = paprs(i,k)-paprs(i,k+1)
-        END DO
-      END DO
-c
-      DO it=1, nbtr
-      DO j=1, klev
-      DO i=1, klon
-        tmp_var(i,j)=tr_seri(i,j,it)
-        aux_var2(i)=source_tr(i,it)
-      ENDDO
-      ENDDO
-      IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL cltrac_spl(pdtphys,coefh,yu1,yv1,t_seri,tmp_var,
-     .            aux_var2,paprs,pplay,aux_var3)
-
-      ELSE IF (iflag_conv.GE.3) THEN
-!KE
-      CALL cltrac(pdtphys, coefh,t_seri,tmp_var,aux_var2,paprs,pplay,
-     .            delp,aux_var3,d_tr_dry,flux_tr_dry(:,it))
-      ENDIF
-
-      DO i=1, klon
-      DO j=1, klev
-        tr_seri(i,j,it)=tmp_var(i,j)
-        d_tr(i,j,it)=aux_var3(i,j)
-      ENDDO
-      ENDDO
-      DO k = 1, klev
-      DO i = 1, klon
-         tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr(i,k,it)
-      ENDDO
-      ENDDO
-      print *,' AFTER Cltrac'
-      IF (lminmax) THEN
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after cltrac')
-      ENDIF
-      ENDDO !--end itr loop
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_cltr=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_cltr=tia_cltr+REAL(ti_cltr)/REAL(clock_rate)
-      ENDIF
-
-
-
-!======================================================================
-!    -- Calcul de l'effet des thermiques for KE--
-!======================================================================
-
-      IF (iflag_conv.GE.3) THEN
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-
-
-      
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before therm')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before therm')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before therm')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'before therm')
-      ENDIF
-
-      DO it=1,nbtr
-         DO k=1,klev
-            DO i=1,klon
-               tmp_var3(i,k,it)=tr_seri(i,k,it)
-               d_tr_th(i,k,it)=0.
-               tr_seri(i,k,it)=MAX(tr_seri(i,k,it),0.)
-!JE: precursor >>1e10         tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
-            END DO
-         END DO
-      END DO
-
-!JE  new implicit scheme 20140323
-      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(1:klon,1:klev,it),ztra_th,0 )
-
-        DO k=1,klev
-           DO i=1,klon
-              d_tr(i,k,it)=pdtphys*d_tr(i,k,it)
-              d_tr_th(i,k,it)=d_tr_th(i,k,it)+d_tr(i,k,it)
-              tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr(i,k,it),0.)
-              END DO
-        END DO
-
-      ENDDO
-
-! old scheme explicit
-!       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(1:klon,1:klev,it),ztra_th)
-!            DO k=1,klev
-!               DO i=1,klon
-!                  d_tr(i,k,it)=pdtphys*d_tr(i,k,it)/nsplit
-!                  d_tr_th(i,k,it)=d_tr_th(i,k,it)+d_tr(i,k,it)
-!                  tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr(i,k,it),0.)
-!               END DO
-!            END DO
-!         END DO ! nsplit1
-!      END DO ! it
-!JE end modif 20140323
-
-      DO it=1,nbtr
-         DO k=1,klev
-            DO i=1,klon
-          tmp_var(i,k)=tr_seri(i,k,it)-tmp_var3(i,k,it)
-            ENDDO
-         ENDDO
-       IF (lminmax) THEN
-         CALL checkmass(tmp_var(:,:),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'dtr therm ')
-       ENDIF
-         CALL kg_to_cm3(pplay,t_seri,tmp_var)
-
-         DO k=1,klev
-            DO i=1,klon
-               his_th(i,it)=his_th(i,it)+
-     .                      (tmp_var(i,k))/RNAVO*
-     .                masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-            END DO !klon
-         END DO !klev
-
-      END DO !it
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after therm')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after therm')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after therm')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'after therm')
-       ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_ther=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_ther=tia_ther+REAL(ti_ther)/REAL(clock_rate)
-      ENDIF
-
-
-      ENDIF ! iflag_conv KE
-c------------------------------------
-c      Sedimentation
-c-----------------------------------
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-      DO it=1,nbtr
-      DO j=1,klev
-      DO i=1,klon
-         tmp_var(i,j)=tr_seri(i,j,it)
-      ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay,t_seri,tmp_var)
-      DO j=1,klev
-      DO i=1,klon
-         tr_seri(i,j,it)=tmp_var(i,j)
-      ENDDO
-      ENDDO
-      ENDDO !--end itr loop
-      iscm3=.true.
-c--------------------------------------
-      print *,' BEFORE Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before sedi')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before sedi')
-      ENDIF
-
-      print *,'SPLA VERSION OF SEDIMENTATION IS USED'
-      CALL sediment_mod(t_seri,pplay,zrho,paprs,pdtphys,RHcl,!xlon,xlat,
-     .                               sed_ss,sed_dust,tr_seri)
-c
-      print *,'AFTER Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after sedi')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after sedi')
-      ENDIF
-c
-c=======================================================================
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_sedi=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_sedi=tia_sedi+REAL(ti_sedi)/REAL(clock_rate)
-      ENDIF
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-      iscm3=.false.
-c
-c
-c======================================================================
-c                      GAS TO PARTICLE CONVERSION      
-c======================================================================
-c
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_beforegastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before gastopar')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before gastopar')
-      ENDIF
-
-      CALL gastoparticle(pdtphys,zdz,zrho,xlat,
-     .              pplay,t_seri,
-     .              tr_seri,his_g2pgas ,his_g2paer) 
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_gastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after gastopar')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after gastopar')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_gasp=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_gasp=tia_gasp+REAL(ti_gasp)/REAL(clock_rate)
-      ENDIF
-
-
-c
-c======================================================================
-c          EFFECT OF PRECIPITATION: iflag_conv=2
-c======================================================================
-c
-      IF (iflag_conv.EQ.2) THEN
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-
-
-       DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-       iscm3=.true.
-c------------------------------
-
-      print *,'iflag_conv bef lessiv',iflag_conv
-      IF (lessivage) THEN
-c
-      print *,' BEFORE Incloud'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_incloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before incloud')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before incloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before incloud')
-      ENDIF
-
-
-!      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-      print *,'iflag_conv bef incloud',iflag_conv
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL incloud_scav(.false.,qmin,qmax,masse,henry,kk,prfl,
-     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-     .                                     his_dhlsc,his_dhcon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL incloud_scav_lsc(.false.,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-!--------------------------------------------------------------
-
-        ENDIF
-c
-c
-      print *,' BEFORE blcloud (after incloud)'
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_blcloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before blcloud')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before blcloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before blcloud')
-      ENDIF
-
-!      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-
-      CALL blcloud_scav(.false.,qmin,qmax,pdtphys,prfl,psfl,
-     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!           and comment IF iflag=2 after "EFFECT OF PRECIPITATION:"
-!        
-!
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL blcloud_scav_lsc(.false.,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-!
-!----------------------------------------------------------------------
-        ENDIF
-
-
-      print *,' AFTER blcloud '
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_blcloud')
-        ENDDO                           
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after blcloud')
-        ENDDO                                  
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after blcloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after blcloud')
-      ENDIF
-
-
-      ENDIF !--lessivage
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-       iscm3=.false.
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_wetap=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_wetap=tia_wetap+REAL(ti_wetap)/REAL(clock_rate)
-      ENDIF
-
-
-
-
-      ENDIF ! iflag_conv=2
-
-c
-c
-c======================================================================
-c                         EFFECT OF CONVECTION 
-c======================================================================
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-      IF (convection) THEN
-c
-      print *,' BEFORE trconvect'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_trconve')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before trconve')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before trconve')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before trconve')
-      ENDIF
-
-
-! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-!     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
-!     .                                                 dtrconv,tr_seri)
-! -------------------------------------------------------------     
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-         CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,.false.,masse,
-     .                                                 dtrconv,tr_seri)
-         DO it=1, nbtr
-           d_tr_cv(:,:,it)=0.
-         ENDDO
-
-        ELSE IF (iflag_conv.GE.3) THEN
-! KE
-         print *,'JE: KE in phytracr_spl'
-         DO it=1, nbtr
-             DO k = 1, klev
-              DO i = 1, klon
-               tmp_var3(i,k,it)=tr_seri(i,k,it)
-              END DO
-             END DO
-         ENDDO
-
-         DO it=1, nbtr
-!          routine for aerosols . otherwise, check cvltrorig
-         print *,'Check sum before cvltr it',it,SUM(tr_seri(:,:,it))
-           IF (.FALSE.) THEN 
-           CALL cvltr_spl(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,
-     .       paprs,it,tmp_var3,upwd,dnwd,itop_con,ibas_con,
-     .       henry,kk,zrho,
-     .       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)
-!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-           ENDIF
-
-           IF (.FALSE.) THEN 
-           CALL cvltr(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,tmp_var3,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)
-!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-           ENDIF
-
-
-
-!!!!!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
-!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
-!!!     .               upwd,dnwd,d_tr_cv)
-             print *,'justbefore cvltrnoscav it= ',it
-             CALL checknanqfi(da(:,:),1.,-1.,' da')
-             CALL checknanqfi(wght_cvfd(:,:),1.,-1.,'weigth ')
-             CALL checknanqfi(mp(:,:),1.,-1.,'mp ')
-             CALL checknanqfi(paprs(:,:),1.,-1.,'paprs ')
-             CALL checknanqfi(pplay(:,:),1.,-1.,'pplay ')
-             CALL checknanqfi(tmp_var3(:,:,it),1.,-1.,'tmp_var3 ')
-             CALL checknanqfi(upwd(:,:),1.,-1.,'upwd ')
-             CALL checknanqfi(dnwd(:,:),1.,-1.,'dnwd ')
-             CALL checknanqfi(d_tr_cv(:,:,it),1.,-1.,'d_tr_cv ')
-             IF (.TRUE.) THEN
-             CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,
-     .            pplay,tmp_var3,upwd,dnwd,d_tr_cv)
-             ENDIF
-             DO k = 1, klev
-              DO i = 1, klon
-!               tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr_cv(i,k,it)
-               tr_seri(i,k,it)=(tmp_var3(i,k,it)+d_tr_cv(i,k,it))
-               tmp_var(i,k)=d_tr_cv(i,k,it)
-
-              END DO
-             END DO
-
-        CALL kg_to_cm3(pplay,t_seri,tmp_var) !just for his_* computation
-
-             DO k = 1, klev
-              DO i = 1, klon
-               dtrconv(i,it)=0.0
-               his_dhkecv(i,it)=his_dhkecv(i,it)-tmp_var(i,k)
-     .                /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-              END DO
-             END DO
-         print *,'Check sum after cvltr it',it,SUM(tr_seri(:,:,it))
-        CALL minmaxqfi2(d_tr_cv(:,:,it),qmin,qmax,'d_tr_cv:')
-        CALL minmaxqfi2(d_tr_trsp(:,:,it),qmin,qmax,'d_tr_trsp:')
-        CALL minmaxqfi2(d_tr_sscav(:,:,it),qmin,qmax,'d_tr_sscav:')
-        CALL minmaxqfi2(d_tr_sat(:,:,it),qmin,qmax,'d_tr_sat:')
-        CALL minmaxqfi2(d_tr_uscav(:,:,it),qmin,qmax,'d_tr_uscav:')
-        CALL checkmass(d_tr_cv(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,.false.,'d_tr_cv:')
-
-         ENDDO ! it=1,nbtr
-
-        ENDIF ! iflag_conv
-       IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after trconv')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after trconv')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-      ENDIF ! convection
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_cvltr=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_cvltr=tia_cvltr+REAL(ti_cvltr)/REAL(clock_rate)
-      ENDIF
-
-
-
-c
-c
-c=======================================================================
-c      LARGE SCALE SCAVENGING KE
-c=======================================================================
-c     
-
-       IF (iflag_conv.GE.3) THEN
-       IF (logitime) THEN
-       CALL SYSTEM_CLOCK(COUNT=clock_start)
-       ENDIF
-
-
-       IF (lessivage)  THEN
-       print *,' BEFORE lsc_scav '
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'before lsc_scav')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before lsc_scav')
-      ENDIF
-
-
-
-       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
-      print *,'JE iflag_lscav',iflag_lscav
-       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)
-          tmp_var(i,k)=d_tr_ls(i,k,it)
-        ENDDO
-       ENDDO
-
-       CALL kg_to_cm3(pplay,t_seri,tmp_var)
-         DO k=1,klev
-            DO i=1,klon
-            his_dhkelsc(i,it)=his_dhkelsc(i,it)-tmp_var(i,k)
-     .                /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-     
-            END DO
-         END DO
-
-       END DO  !tr
-      ELSE
-        his_dhkelsc(i,it)=0.0
-        print *,'WARNING: NO lsc_scav, Please choose iflag_lscav=3 or 4'
-       ENDIF !iflag_lscav
-
-       print *,' AFTER lsc_scav '
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-         CALL checkmass(tr_seri(:,:,it),RNAVO,masse(it),zdz,
-     .      pplay,t_seri,iscm3,'after lsc_scav')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after lsc_scav')
-      ENDIF
-
-      ENDIF ! lessivage
- 
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_lscs=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_lscs=tia_lscs+REAL(ti_lscs)/REAL(clock_rate)
-      ENDIF
-
-
-
-      ENDIF !iflag_conv
-
- 
-c=======================================================================
-c                         COMPUTING THE BURDEN
-c=======================================================================
-c    
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-  
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-       iscm3=.true.
-
-c
-c Computing burden in mg/m2
-      DO it=1, nbtr
-      DO k=1, klev
-      DO i=1, klon
-        trm(i,it)=trm(i,it)+tr_seri(i,k,it)*1.e6*zdz(i,k)*
-     .            masse(it)*1.e3/RNAVO     !--mg S/m2
-      ENDDO
-      ENDDO
-      ENDDO
-c
-c Computing Surface concentration in ug/m3
-c
-      DO it=1, nbtr
-      DO i=1, klon
-        sconc_seri(i,it)=tr_seri(i,1,it)*1.e6*
-     .            masse(it)*1.e3/RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
-      ENDDO
-      ENDDO
-c
-c=======================================================================
-c                  CALCULATION OF OPTICAL PROPERTIES
-c=======================================================================
-c      
-      CALL aeropt_spl(zdz, tr_seri, RHcl,
-     .               diff_aod550_tot,diag_aod670_tot,diag_aod865_tot,
-     .               diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2,
-     .               diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,
-     .               diag_aod550_dust,diag_aod670_dust,diag_aod865_dust)
-
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_brop=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_brop=tia_brop+REAL(ti_brop)/REAL(clock_rate)
-      ENDIF
-
-
-
-c
-c======================================================================
-c   Stockage sur bande histoire
-c======================================================================
-c
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-       iscm3=.false.
-
-c
-c
-c======================================================================
-c  SAVING AEROSOL RELATED VARIABLES INTO FILE
-c======================================================================
-c
-      IF (ok_histrac) THEN
-c
-      ndex2d = 0
-      ndex3d = 0 
-c
-      itra=itra+1
-
-      print *,'SAVING VARIABLES FOR DAY ',itra
-c
-      fluxbb(:)=0.0
-      fluxff(:)=0.0
-      fluxbcbb(:)=0.0
-      fluxbcff(:)=0.0
-      fluxbcnff(:)=0.0
-      fluxbcba(:)=0.0
-      fluxbc(:)=0.0
-      fluxombb(:)=0.0
-      fluxomff(:)=0.0
-      fluxomnat(:)=0.0
-      fluxomba(:)=0.0
-      fluxomnff(:)=0.0
-      fluxom(:)=0.0
-      fluxh2sff(:)=0.0
-      fluxh2snff(:)=0.0
-      fluxh2sbio(:)=0.0
-      fluxso2ff(:)=0.0
-      fluxso2nff(:)=0.0
-      fluxso2bb(:)=0.0
-      fluxso2vol(:)=0.0
-      fluxso2ba(:)=0.0
-      fluxso2(:)=0.0
-      fluxso4ff(:)=0.0
-      fluxso4nff(:)=0.0
-      fluxso4bb(:)=0.0
-      fluxso4ba(:)=0.0
-      fluxso4(:)=0.0
-      fluxdms(:)=0.0
-      fluxdustec(:)=0.0
-      fluxddfine(:)=0.0
-      fluxddcoa(:)=0.0
-      fluxdd(:)=0.0
-      fluxssfine(:)=0.0
-      fluxsscoa(:)=0.0
-      fluxss(:)=0.0
-      DO i=1, klon
-         IF (iregion_ind(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxh2sff(i)= (lmt_so2ff_l(i)+lmt_so2ff_h(i))*frach2sofso2*
-     .                    scale_param_ind(iregion_ind(i))*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-           fluxso2ff(i)=scale_param_ind(iregion_ind(i)) * fracso2emis *
-     .                   (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4ff(i)=scale_param_ind(iregion_ind(i))*(1-fracso2emis)*
-     .                    (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcff(i)=scale_param_ff(iregion_ind(i))*
-     .                                        lmt_bcff(i)*1.e4*1.e3  !/g/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxomff(i)=scale_param_ff(iregion_ind(i))*
-     .                          (lmt_omff(i))*1.e4*1.e3  !/g/m2/s
-           ! FOSSIL FUEL EMISSIONS
-           fluxff(i)=fluxbcff(i)+fluxomff(i)
-         ENDIF
-         IF (iregion_bb(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxso2bb(i) =scale_param_bb(iregion_bb(i)) * fracso2emis *
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4bb(i) =scale_param_bb(iregion_bb(i))*(1-fracso2emis)*
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcbb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_bcbb_l(i)+lmt_bcbb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxombb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_ombb_l(i)+lmt_ombb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! BIOMASS BURNING EMISSIONS
-           fluxbb(i)=fluxbcbb(i)+fluxombb(i)
-         ENDIF
-         ! H2S EMISSIONS
-         fluxh2sbio(i)=lmt_h2sbio(i)*1.e4/RNAVO*masse_s*1.e3      ! mgS/m2/s
-         fluxh2snff(i)= lmt_so2nff(i)*frach2sofso2*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-         ! SULFUR DIOXIDE EMISSIONS
-         fluxso2nff(i)=fracso2emis * lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso2vol(i)=(lmt_so2volc_cont(i)+lmt_so2volc_expl(i))
-     .                 *1.e4/RNAVO*masse_s*1.e3        ! mgS/m2/s
-         fluxso2ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3*
-     .                                                   fracso2emis ! mgS/m2/s
-         fluxso2(i)=fluxso2ff(i)+fluxso2bb(i)+fluxso2nff(i)+
-     .              fluxso2vol(i)+fluxso2ba(i)
-         ! DMS EMISSIONS
-         fluxdms(i)=( lmt_dms(i)+lmt_dmsbio(i) )
-     .              *1.e4/RNAVO*masse_s*1.e3          ! mgS/m2/s
-         ! SULPHATE EMISSIONS
-         fluxso4ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3
-     .                 *(1-fracso2emis) ! mgS/m2/s
-         fluxso4nff(i)=(1-fracso2emis)*lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso4(i)=fluxso4ff(i)+fluxso4bb(i)+fluxso4ba(i)+fluxso4nff(i)
-         ! BLACK CARBON EMISSIONS
-
-         fluxbcnff(i)=lmt_bcnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxbcba(i)=lmt_bcba(i)*1.e4*1.e3    !mg/m2/s
-         fluxbc(i)=fluxbcbb(i)+fluxbcff(i)+fluxbcnff(i)+fluxbcba(i)
-         ! ORGANIC MATTER EMISSIONS
-         fluxomnat(i)=lmt_omnat(i)*1.e4*1.e3  !mg/m2/s
-         fluxomba(i)=lmt_omba(i)*1.e4*1.e3  !mg/m2/s
-         fluxomnff(i)=lmt_omnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxom(i)=fluxombb(i)+fluxomff(i)+fluxomnat(i)+fluxomba(i)+
-     .             fluxomnff(i)
-        ! DUST EMISSIONS 
-         fluxdustec(i)=dust_ec(i)*1.e6
-         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
-     .                                  * dust_ec(i)*0.093*1.e6
-         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
-     .                                  * dust_ec(i)*0.905*1.e6
-         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
-        ! SEA SALT EMISSIONS 
-         fluxssfine(i)=scale_param_ssacc*lmt_sea_salt(i,1)*1.e4*1.e3
-         fluxsscoa(i)=scale_param_sscoa*lmt_sea_salt(i,2)*1.e4*1.e3
-         fluxss(i)=fluxssfine(i)+fluxsscoa(i)
-      ENDDO
-!      prepare outputs cvltr
-
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_cv(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_cv_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_trsp(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_trsp_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_sscav(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_sscav_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_sat(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_sat_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO it=1, nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_uscav(i,k,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_uscav_o(i,k,it)=tmp_var(i,k)
-     .                    /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-
-
-
-c
-c SAVING VARIABLES IN TRACEUR
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c     
-      DO it=1,nbtr
-c
-      WRITE(str2,'(i2.2)') it
-c 
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,trm(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"trm"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sconc_seri(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"sconc"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-c SAVING VARIABLES IN LESSIVAGE
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_tr(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"flux"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_ds(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"ds"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      DO i=1, klon
-        zx_tmp_fi2d(i) = his_dhlsc(i,it)+his_dhcon(i,it)+
-     .                   his_dhbclsc(i,it)+his_dhbccon(i,it)
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,zx_tmp_fi2d,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dh"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-C
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_dhkecv(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dhkecv"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_dhkelsc(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dhkelsc"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_cv_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_cv"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_trsp_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_trsp"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_sscav_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_sscav"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_sat_o(1,1,it),
-     .                 zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_sat"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_uscav_o(1,1,it),
-     .                  zx_tmp_3d)
-      CALL histwrite(nid_tra2,"d_tr_uscav"//str2,itra,zx_tmp_3d, 
-     .                             iim*(jjm+1)*klev,ndex3d)
-
-
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,dtrconv(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dtrconv"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_th(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dtherm"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_ss",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_dust",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)              
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2pgas,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_gas",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2paer,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_aer",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c SAVING VARIABLES IN HISTRAC
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-c ========================= BC =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbc,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbc",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= OM =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxombb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxombb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnat,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnat",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxom,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxom",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO4 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= H2S =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2snff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2snff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sbio,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sbio",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO2 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2vol,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2vol",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdms,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdms",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= DD =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdustec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdustec",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdd,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdd",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c ========================= SS =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxsscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxsscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxss,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxss",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,fluxso4chem,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"fluxso4chem",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ind,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ind",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_bb",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ff",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_sscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_sscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,u10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"u10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,v10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"v10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,flux_sparam_sulf,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"flux_sparam_sulf",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      ENDIF ! ok_histrac
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-
-      dife=clock_end-clock_start
-      ti_outs=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_outs=tia_outs+REAL(ti_outs)/REAL(clock_rate)
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-
-      dife=clock_end-clock_start_spla
-      ti_spla=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-
-
-      tia_spla=tia_spla+REAL(ti_spla)/REAL(clock_rate)
-      print *,'---times for this timestep: time proc, time proc/time
-     . phytracr_spl---'
-      print *,'time spla',REAL(ti_spla)/REAL(clock_rate)
-     . ,REAL(ti_spla)/REAL(ti_spla)
-      print *,'time init',REAL(ti_init)/REAL(clock_rate)
-     . ,REAL(ti_init)/REAL(ti_spla)
-      print *,'time inittype',REAL(ti_inittype)/REAL(clock_rate)
-     . ,REAL(ti_inittype)/REAL(ti_spla)
-      print *,'time inittwrite',REAL(ti_inittwrite)/REAL(clock_rate)
-     . ,REAL(ti_inittwrite)/REAL(ti_spla)
-      print *,'time emis',REAL(ti_emis)/REAL(clock_rate)
-     . ,REAL(ti_emis)/REAL(ti_spla)
-      print *,'time depo ',REAL(ti_depo)/REAL(clock_rate)
-     . ,REAL(ti_depo)/REAL(ti_spla)
-      print *,'time cltr',REAL(ti_cltr)/REAL(clock_rate)
-     . ,REAL(ti_cltr)/REAL(ti_spla)
-      print *,'time ther',REAL(ti_ther)/REAL(clock_rate)
-     . ,REAL(ti_ther)/REAL(ti_spla)
-      print *,'time sedi',REAL(ti_sedi)/REAL(clock_rate)
-     . ,REAL(ti_sedi)/REAL(ti_spla)
-      print *,'time gas to part',REAL(ti_gasp)/REAL(clock_rate)
-     . ,REAL(ti_gasp)/REAL(ti_spla)
-      print *,'time AP wet',REAL(ti_wetap)/REAL(clock_rate)
-     . ,REAL(ti_wetap)/REAL(ti_spla)
-      print *,'time convective',REAL(ti_cvltr)/REAL(clock_rate)
-     . ,REAL(ti_cvltr)/REAL(ti_spla)
-      print *,'time NP lsc scav',REAL(ti_lscs)/REAL(clock_rate)
-     . ,REAL(ti_lscs)/REAL(ti_spla)
-      print *,'time opt,brdn,etc',REAL(ti_brop)/REAL(clock_rate)
-     . ,REAL(ti_brop)/REAL(ti_spla)
-      print *,'time outputs',REAL(ti_outs)/REAL(clock_rate)
-     . ,REAL(ti_outs)/REAL(ti_spla)
-
-
-      print *,'---time accumulated: time proc, time proc/time
-     . phytracr_spl---'
-      print *,'time spla',tia_spla
-      print *,'time init',tia_init,tia_init/tia_spla
-      print *,'time inittype',tia_inittype,tia_inittype/tia_spla
-      print *,'time inittwrite',tia_inittwrite,tia_inittwrite/tia_spla
-      print *,'time emis',tia_emis,tia_emis/tia_spla
-      print *,'time depo',tia_depo,tia_depo/tia_spla
-      print *,'time cltr',tia_cltr,tia_cltr/tia_spla
-      print *,'time ther',tia_ther,tia_ther/tia_spla
-      print *,'time sedi',tia_sedi,tia_sedi/tia_spla
-      print *,'time gas to part',tia_gasp,tia_gasp/tia_spla
-      print *,'time AP wet',tia_wetap,tia_wetap/tia_spla
-      print *,'time convective',tia_cvltr,tia_cvltr/tia_spla
-      print *,'time NP lsc scav',tia_lscs,tia_lscs/tia_spla
-      print *,'time opt,brdn,etc',tia_brop,tia_brop/tia_spla
-      print *,'time outputs',tia_outs,tia_outs/tia_spla
-
-
-
-      dife=clock_end_outphytracr-clock_start_outphytracr
-      ti_nophytracr=dife*MAX(0,SIGN(1,dife))
-     . +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_nophytracr=tia_nophytracr+REAL(ti_nophytracr)/REAL(clock_rate)
-      print *,'Time outside phytracr; Time accum outside phytracr'
-      print*,REAL(ti_nophytracr)/REAL(clock_rate),tia_nophytracr
-
-      clock_start_outphytracr=clock_end
-
-      ENDIF      
-      print *,'END PHYTRACR_SPL '
-
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl_dot_F_20140210_seq
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl_dot_F_20140210_seq	(revision 2196)
+++ 	(revision )
@@ -1,2236 +1,0 @@
-      SUBROUTINE phytracr_spl ( debutphy, iflag_conv,
-     I                   pdtphys,ftsol,tsol, 
-     I                   t_seri,q_seri,paprs,pplay,RHcl,
-     I                   pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,
-     I                   coefh, cdragh, cdragm, yu1, yv1, 
-     I                   u_seri, v_seri, xlat,xlon,
-     I                   pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,
-     I                   da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,
-     I                   epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,
-     I                   evap,wdtrainA,  wdtrainM,
-     I                   fm_therm, entr_therm,
-     P                   scale_param_ssacc,
-     P                   scale_param_sscoa,scale_param_ind,
-     P                   scale_param_bb,scale_param_ff,
-     P                   scale_param_dustacc,scale_param_dustcoa,
-     E                   dust_ec,u10m_ec,v10m_ec,
-     E                   lmt_sea_salt,
-     E                   lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     E                   lmt_so2bb_l, lmt_so2bb_h,
-     E                   lmt_so2volc_cont,lmt_altvolc_cont,
-     E                   lmt_so2volc_expl,lmt_altvolc_expl,
-     E                   lmt_dmsbio,lmt_h2sbio,lmt_dmsconc,
-     E                   lmt_bcff,lmt_bcnff,lmt_bcbb_l,lmt_bcbb_h,
-     E                   lmt_bcba,lmt_omff,lmt_omnff,lmt_ombb_l,
-     E                   lmt_ombb_h,lmt_omnat,lmt_omba,
-     O                   tr_seri,
-     O                   diff_aod550_tot,diag_aod865_tot,
-     O                   diff_aod550_tr2,diag_aod865_tr2,
-     O                   diag_aod550_dust,diag_aod865_dust,
-     O                   diag_aod550_ss,diag_aod865_ss)
-!     E                   wth,cly,zprecipinsoil,lmt_sea_salt, ! Titane
-c
-      USE IOIPSL
-      USE dimphy
-      USE infotrac
-      USE indice_sol_mod
-c
-      IMPLICIT none
-c
-c======================================================================
-c Auteur(s) FH
-c Objet: Moniteur general des tendances traceurs
-c
-c Remarques en vrac:
-c ------------------
-c 1/ le call phytrac se fait avec nqmax-2 donc nous avons bien 
-c les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
-c======================================================================
-#include "dimensions.h"
-#include "chem.h"
-#include "../phylmd/YOMCST.h"
-#include "../phylmd/YOETHF.h"
-c #include "../phylmd/dimphy.h"
-c #include "../phylmd/indicesol.h"
-#include "paramet.h"
-#include "thermcell.h"
-
-c======================================================================
-
-c Arguments:
-c
-c   EN ENTREE:
-c   ==========
-c
-c   divers:
-c   -------
-c
-      real pdtphys  ! pas d'integration pour la physique (seconde)
-      real ftsol(klon,nbsrf)  ! temperature du sol par type
-      real tsol(klon)         ! temperature du sol moyenne
-      real t_seri(klon,klev)  ! temperature
-      real u_seri(klon,klev)  ! vent
-      real v_seri(klon,klev)  ! vent
-      real q_seri(klon,klev)  ! vapeur d eau kg/kg
-      real tr_seri(klon,klev,nbtr) ! traceur  
-      real tmp_var(klon,klev) ! auxiliary variable to replace traceur  
-      real tmp_var2(klon,nbtr) ! auxiliary variable to replace source
-      real tmp_var3(klon,klev,nbtr) ! auxiliary variable 3D  
-      real dummy1d ! JE auxiliary variable
-      real aux_var2(klon) ! auxiliary variable to replace traceur  
-      real aux_var3(klon,klev) ! auxiliary variable to replace traceur  
-      real d_tr(klon,klev,nbtr)    ! traceur  tendance
-      real sconc_seri(klon,nbtr) ! surface concentration of traceur  
-c
-      integer nbjour
-      save nbjour
-c
-      REAL diff_aod550_tot(klon)  ! epaisseur optique total aerosol 550  nm
-      REAL diag_aod670_tot(klon)  ! epaisseur optique total aerosol 670 nm
-      REAL diag_aod865_tot(klon)  ! epaisseur optique total aerosol 865 nm
-      REAL diff_aod550_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
-      REAL diag_aod670_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
-      REAL diag_aod865_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
-      REAL diag_aod550_ss(klon)   ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
-      REAL diag_aod670_ss(klon)   ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
-      REAL diag_aod865_ss(klon)   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
-      REAL diag_aod550_dust(klon) ! epaisseur optique Dust aerosol 550 nm, diagnostic
-      REAL diag_aod670_dust(klon) ! epaisseur optique Dust aerosol 670 nm, diagnostic
-      REAL diag_aod865_dust(klon) ! epaisseur optique Dust aerosol 865 nm, diagnostic
-c
-      real paprs(klon,klev+1)  ! pression pour chaque inter-couche (en Pa)
-      real pplay(klon,klev)  ! pression pour le mileu de chaque couche (en Pa)
-      real RHcl(klon,klev)  ! humidite relativen ciel clair
-      real znivsig(klev)  ! indice des couches
-      real paire(klon)
-      real pphis(klon)
-      real pctsrf(klon,nbsrf)
-      logical debutphy   ! le flag de l'initialisation de la physique
-c
-c   Scaling Parameters:
-c   ----------------------
-c
-      CHARACTER*33 c_Directory
-      CHARACTER*33 c_FileName1
-      CHARACTER*42 c_FileName2
-      CHARACTER*71 c_FullName1
-      CHARACTER*77 c_FullName2
-      INTEGER :: xidx, yidx
-      INTEGER,DIMENSION(klon) :: mask_bbreg
-      INTEGER,DIMENSION(klon) :: mask_ffso2reg
-      INTEGER :: aux_mask1
-      INTEGER :: aux_mask2
-
-      INTEGER iregion_so4(klon)  !Defines regions for SO4
-      INTEGER iregion_ind(klon)  !Defines regions for SO2, BC & OM
-      INTEGER iregion_bb(klon)   !Defines regions for SO2, BC & OM
-      INTEGER iregion_dust(klon) !Defines  dust regions
-c      REAL scale_param_sulf(jjm+1)  !Scaling parameter for sulfate (input)
-c      REAL scale_param_so4(klon)  !Scaling parameter for sulfate used whithin phytrac
-      REAL scale_param_ssacc  !Scaling parameter for Fine Sea Salt
-      REAL scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
-      REAL scale_param_ind(nbreg_ind) !Scaling parameter for industrial emissionsi of SO2
-      REAL scale_param_bb(nbreg_bb)  !Scaling parameter for biomas burning (SO2, BC & OM)
-      REAL scale_param_ff(nbreg_ind)  !Scaling parameter for industrial emissions (fossil fuel)
-      REAL scale_param_dustacc(nbreg_dust)  !Scaling parameter for Fine Dust
-      REAL scale_param_dustcoa(nbreg_dust)  !Scaling parameter for Coarse Dust
-c
-c   Emissions:
-c   ---------
-c
-c---------------------------- SEA SALT & DUST emissions ------------------------
-      REAL lmt_sea_salt(klon,ss_bins) !Sea salt 0.03-8.0 um
-      REAL u10m_ec1(klon),v10m_ec1(klon)
-      REAL u10m_ec2(klon),v10m_ec2(klon),dust_ec2(klon)
-      REAL dust_ec(klon)
-!      REAL cly(klon),wth(klon),zprecipinsoil(klon)   ! Titane
-c------------------------- SULFUR emissions ----------------------------
-      REAL lmt_so2volc_cont(klon)  ! emissions so2 volcan (continuous)
-      REAL lmt_altvolc_cont(klon)  ! altitude  so2 volcan (continuous)
-      REAL lmt_so2volc_expl(klon)  ! emissions so2 volcan (explosive)
-      REAL lmt_altvolc_expl(klon)  ! altitude  so2 volcan (explosive)
-      REAL lmt_so2ff_l(klon)       ! emissions so2 fossil fuel (low)
-      REAL lmt_so2ff_h(klon)       ! emissions so2 fossil fuel (high)
-      REAL lmt_so2nff(klon)        ! emissions so2 non-fossil fuel
-      REAL lmt_so2bb_l(klon)       ! emissions de so2 biomass burning (low)
-      REAL lmt_so2bb_h(klon)       ! emissions de so2 biomass burning (high)
-      REAL lmt_so2ba(klon)         ! emissions de so2 bateau
-      REAL lmt_dms(klon)           ! emissions de dms
-      REAL lmt_dmsconc(klon)       ! concentration de dms oceanique
-      REAL lmt_dmsbio(klon)        ! emissions de dms bio 
-      REAL lmt_h2sbio(klon)        ! emissions de h2s bio
-c------------------------- BLACK CARBON emissions ----------------------
-      REAL lmt_bcff(klon)       ! emissions de BC fossil fuels
-      REAL lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
-      REAL lmt_bcbb_l(klon)     ! emissions de BC biomass basses
-      REAL lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
-      REAL lmt_bcba(klon)      ! emissions de BC bateau
-c------------------------ ORGANIC MATTER emissions ---------------------      
-      REAL lmt_omff(klon)     ! emissions de OM fossil fuels
-      REAL lmt_omnff(klon)    ! emissions de OM non-fossil fuels
-      REAL lmt_ombb_l(klon)   ! emissions de OM biomass basses
-      REAL lmt_ombb_h(klon)   ! emissions de OM biomass hautes
-      REAL lmt_omnat(klon)    ! emissions de OM Natural
-      REAL lmt_omba(klon)     ! emissions de OM bateau
-                                                                        
-c
-c  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
-c
-c   convection:
-c   -----------
-c
-      REAL pmfu(klon,klev)  ! flux de masse dans le panache montant
-      REAL pmfd(klon,klev)  ! flux de masse dans le panache descendant
-      REAL pen_u(klon,klev) ! flux entraine dans le panache montant
-      REAL pde_u(klon,klev) ! flux detraine dans le panache montant
-      REAL pen_d(klon,klev) ! flux entraine dans le panache descendant
-      REAL pde_d(klon,klev) ! flux detraine dans le panache descendant
-c
-c  Convection KE scheme:
-c  ---------------------
-c
-c! Variables pour le lessivage convectif
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated
-c            updraft mass flux
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated
-c            downdraft mass flux
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: evap
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
-
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
-       REAL,DIMENSION(klon),INTENT(IN)           :: sigd
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: elij
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: epmlmMm
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: eplaMm
-
-c     KE: Tendances de traceurs (Td) et flux de traceurs:
-!     ------------------------
-       REAL,DIMENSION(klon,klev)      :: Mint
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPr,qDi ! concentration tra
-c       dans pluie,air descente insaturee
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPa,qMel
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qTrdi,dtrcvMA ! conc traceur
-c              descente air insaturee et td convective MA
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv  ! Td convection/traceur
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_th  ! Td thermique
-       INTEGER ::  nsplit
-!
-
-     
-
-!CHECK!!
-!!!$OMP
-!!!!THREADPRIVATE(qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa,d_tr_lessi_nucl)
-!!!!$OMP THREADPRIVATE(d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qPr,qDi)
-!!!!!$OMP THREADPRIVATE(d_tr_insc,d_tr_bcscav,d_tr_evapls,d_tr_ls,qPrls)
-!!!!!$OMP THREADPRIVATE(d_tr,d_tr_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
-
-
-c
-c  Lessivage
-c  ---------
-c
-      REAL pmflxr(klon,klev+1), pmflxs(klon,klev+1)   !--convection
-      REAL prfl(klon,klev+1),   psfl(klon,klev+1)     !--large-scale
-! JE      REAL pmflxr(klon,klev), pmflxs(klon,klev)   !--convection       ! Titane
-! JE      REAL prfl(klon,klev),   psfl(klon,klev)     !--large-scale      ! Titane
-
-!Thermiques:
-!----------
-      REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-      REAL,DIMENSION(klon,klev),INTENT(IN)     :: entr_therm
-
-
-c
-c   Couche limite:
-c   --------------
-c
-      REAL coefh(klon,klev) ! coeff melange CL
-      REAL cdragh(klon), cdragm(klon)
-      REAL yu1(klon)        ! vent dans la 1iere couche
-      REAL yv1(klon)        ! vent dans la 1iere couche
-c
-c
-c----------------------------------------------------------------------
-      REAL his_ds(klon,nbtr)
-      REAL his_dhlsc(klon,nbtr)        ! in-cloud scavenging lsc
-      REAL his_dhcon(klon,nbtr)       ! in-cloud scavenging con
-      REAL his_dhbclsc(klon,nbtr)      ! below-cloud scavenging lsc
-      REAL his_dhbccon(klon,nbtr)      ! below-cloud scavenging con
-      REAL trm(klon,nbtr)
-c
-      REAL u10m_ec(klon), v10m_ec(klon)
-c
-c
-c   Coordonnees
-c   -----------
-c
-      REAL xlat(klon)       ! latitudes pour chaque point 
-      REAL xlon(klon)       ! longitudes pour chaque point 
-C
-      INTEGER i, k, it, j, ig 
-c
-c DEFINITION OF DIAGNOSTIC VARIABLES
-c
-      REAL diag_trm(nbtr), diag_drydep(nbtr) 
-      REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
-      REAL diag_emissn(nbtr), diag_g2part
-      REAL diag_sedimt
-      REAL trm_aux(nbtr), src_aux(nbtr)
-c
-c Variables locales pour effectuer les appels en serie
-c----------------------------------------------------
-      REAL source_tr(klon,nbtr)
-      REAL flux_tr(klon,nbtr)
-      REAL m_conc(klon,klev)
-      REAL sed_ss(klon)    ! corresponds to tracer 3
-      REAL sed_dust(klon)  ! corresponds to tracer 4
-      REAL henry(nbtr)  !--cste de Henry  mol/l/atm
-      REAL kk(nbtr)     !--coefficient de var avec T (K)
-      REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
-      REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
-      REAL vdep_oce(nbtr), vdep_sic(nbtr)
-      REAL vdep_ter(nbtr), vdep_lic(nbtr)
-      REAL dtrconv(klon,nbtr)
-      REAL zrho(klon,klev), zdz(klon,klev)
-      REAL zalt(klon,klev)
-      REAL,DIMENSION(klon,klev)      :: zmasse    ! densité atmosphérique
-c     .                                              Kg/m2
-      REAL,DIMENSION(klon,klev)      :: ztra_th
-      REAL qmin, qmax, aux
-!      PARAMETER (qmin=0.0, qmax=1.e33)
-      PARAMETER (qmin=1.e33, qmax=-1.e33)
-
-c Variables to save data into file
-c----------------------------------
-   
-      CHARACTER*2 str2
-      LOGICAL ok_histrac
-      PARAMETER (ok_histrac=.true.)
-      INTEGER ndex2d(iim*(jjm+1)), ndex3d(iim*(jjm+1)*klev)
-      INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
-      INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      INTEGER itra
-      SAVE itra                    ! compteur pour la physique
-      INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
-      REAL zx_tmp_2d(iim,jjm+1), zx_tmp_3d(iim,jjm+1,klev)
-      REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
-      REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
-      REAL zsto, zout, zout_h, zout_m, zjulian
-      REAL fluxbb(klon), fluxff(klon)
-      REAL fluxbcbb(klon), fluxbcff(klon), fluxbcnff(klon)
-      REAL fluxombb(klon), fluxomff(klon), fluxomnat(klon)
-      REAL fluxomnff(klon), fluxomba(klon), fluxbcba(klon)
-      REAL fluxso2ff(klon), fluxso2bb(klon), fluxso2(klon)
-      REAL fluxso2nff(klon), fluxso2vol(klon), fluxso2ba(klon) 
-      REAL fluxh2sff(klon), fluxh2snff(klon)
-      REAL fluxso4ff(klon), fluxso4bb(klon), fluxso4ba(klon)
-      REAL fluxh2sbio(klon), fluxso4nff(klon)
-      REAL fluxdms(klon)
-      REAL fluxbc(klon), fluxom(klon), fluxso4(klon)
-      REAL fluxdd(klon), fluxss(klon)
-      REAL fluxdustec(klon), fluxssfine(klon), fluxsscoa(klon)
-      REAL fluxddfine(klon), fluxddcoa(klon)
-      REAL flux_sparam_bb(klon), flux_sparam_ff(klon)
-      REAL flux_sparam_ind(klon) !, flux_sparam_sulf(klon,klev)
-      REAL flux_sparam_ddfine(klon), flux_sparam_ddcoa(klon)
-      REAL flux_sparam_ssfine(klon), flux_sparam_sscoa(klon)
-
-c------------------DMS  SO2  SO4   H2S  DMSO MSA H2O2 
-c------------------BC1, BC2, OM1, OM2,flyash  dust1   dust2 
-c------------------Sea Salt 1-8 bins 
-c------------------Precursors (gases), Fine, Coarse Aerosols
-C c
-C       DATA henry   /1.4, 0.0, 0.0, 0.0/
-C c
-C       DATA kk      /2900., 0., 0., 0./
-C c
-C       DATA alpha_r /0., 0.001, 0.001, 0.001/
-C c
-C       DATA alpha_s /0., 0.01, 0.01, 0.01/
-C c
-C cnhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-C cnhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-C       DATA vdep_oce /0.28, 0.28, 1.2, 1.2/
-C c
-C       DATA vdep_sic /0.2, 0.17, 1.2, 1.2/
-C c
-C       DATA vdep_ter /0.3, 0.14, 1.2, 1.2/
-
-C       DATA vdep_lic /0.2, 0.17, 1.2, 1.2/
-      
-c------Molar Masses
-      REAL masse(nbtr)
-c
-      REAL fracso2emis                              !--fraction so2 emis en so2
-      PARAMETER (fracso2emis=0.95) 
-      REAL frach2sofso2                             !--fraction h2s from so2
-      PARAMETER (frach2sofso2=0.0426)
-c
-c   Controles
-c-------------
-      LOGICAL convection,lessivage,lminmax
-      DATA convection,lessivage,lminmax
-     s     /.true.,.true.,.true./
-c
-      REAL xconv(nbtr)
-c
-      LOGICAL anthropo, bateau, edgar
-      DATA anthropo,bateau,edgar/.true.,.true.,.true./
-c
-cc bc_source
-      INTEGER kminbc, kmaxbc
-      PARAMETER (kminbc=3, kmaxbc=5)
-c
-      REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
-c
-c JE for updating in  cltrac
-      REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
-      REAL,DIMENSION(klon,nbtr)       :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-      REAL,DIMENSION(klon,nbtr)        ::  flux_tr_dry
-c      SAVE  d_tr_dry
-c JE for include gas to particle conversion in output
-      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
-      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
-c
-      INTEGER iflag_conv
-
-c======================================================================
-c   INITIALISATIONS
-c======================================================================
-c
-c---fraction of tracer that is convected (??
-      xconv(1)=0.8
-      xconv(2)=0.5
-      xconv(3)=0.5
-      xconv(4)=0.6
-
-      masse(1)=32.
-      masse(2)=6.02e23
-      masse(3)=6.02e23
-      masse(4)=6.02e23 
-
-      henry= (/1.4, 0.0, 0.0, 0.0/)
-      kk = (/2900., 0., 0., 0./)
-      alpha_r =  (/0., 0.001, 0.001, 0.001/)
-      alpha_s = (/0., 0.01, 0.01, 0.01/)
-
-c nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-c nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-      vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
-      vdep_sic = (/0.2, 0.17, 1.2, 1.2/)     
-      vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
-      vdep_lic = (/0.2, 0.17, 1.2, 1.2/)      
-
-
-
-      lmt_dms(:)=0.0
-      aux_var2(:)=0.0
-      aux_var3(:,:)=0.0
-      source_tr(:,:)=0.0
-      flux_tr(:,:)=0.0
-      flux_sparam_bb(:)=0.0
-      flux_sparam_ff(:)=0.0
-      flux_sparam_ind(:)=0.0
-      flux_sparam_ddfine(:)=0.0
-      flux_sparam_ddcoa(:)=0.0
-      flux_sparam_ssfine(:)=0.0
-      flux_sparam_sscoa(:)=0.0
-      
-      d_tr_dry(:,:)=0.0
-      flux_tr_dry(:,:)=0.0
-!
-      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
-      RG = 9.80665
-      RNAVO =6.02e23
-      RLVTT=2.5008E+6
-      RLSTT=2.8345E+6
-      R4IES=7.66
-      R3IES=21.875
-      R4LES=35.86
-      R3LES=17.269
-      RTT=273.16
-      RMV=18.0153
-      RKBOL=1.380658E-23
-      R=RNAVO*RKBOL
-      R5LES=R3LES*(RTT-R4LES)
-      R5IES=R3IES*(RTT-R4IES)
-      RV=1000.*R/RMV
-      RCPV=4.*RV
-      RCPD=3.5*RD
-      RVTMP2=RCPV/RCPD-1
-      RETV=RV/RD-1.
-
-c
-      if (debutphy) then
-         print *, 'let s check nbtr=', nbtr
-         print *, 'xlat and xlon'
-c JE   initializon to cero the tracers     
-         DO it=1, nbtr
-            tr_seri(:,:,it)=0.0
-         ENDDO
-c JE end     
-! Initializing to zero tr_seri for comparison purposes
-!        tr_seri(:,:,:)=0.0
-c
-!        DO it=1,nbtr
-!           trm_aux(it)=0.0
-!           src_aux(it)=0.0
-!           diag_trm(it)=0.0
-!           diag_drydep(it)=0.0
-!           diag_wetdep(it)=0.0
-!           diag_cvtdep(it)=0.0
-!           diag_emissn(it)=0.0
-!        ENDDO
-!        diag_g2part=0.0
-         print *,'PREPARE FILES TO SAVE VARIABLES'
-c
-         nbjour=30
-         ecrit_tra =   NINT(86400./pdtphys)                    !--1-day  average
-         ecrit_tra_h = NINT(86400./pdtphys*0.25)               !--6-hour average
-         ecrit_tra_m = NINT(86400./pdtphys*FLOAT(nbjour))      !--1-mth  average
-         print *,'ecrit_tra=', pdtphys, ecrit_tra
-
-         IF (ok_histrac) THEN
-  
-           itra=0
-c
-           CALL ymds2ju(1900, 1, 1, 0.0, zjulian)
-c
-           print *, 'klon,iim,jjm+1 = ',klon,iim,jjm+1
-           CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlon,zx_lon)
-c
-           DO i = 1, iim
-             zx_lon(i,1) = xlon(i+1)
-             zx_lon(i,jjm+1) = xlon(i+1)
-           ENDDO
-c
-           CALL histbeg("histrac_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori1, nid_tra1)
-c
-           CALL histbeg("lessivage_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori2, nid_tra2)
-c
-           CALL histbeg("traceur_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori3, nid_tra3)
-c
-           CALL histvert(nid_tra1, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra2, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra3, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           zsto = pdtphys
-           zout = pdtphys * FLOAT(ecrit_tra)
-           zout_h = pdtphys * FLOAT(ecrit_tra_h)
-           zout_m = pdtphys * FLOAT(ecrit_tra_m)
-           print *,'zsto zout=', zsto, zout
-
-c
-c----------------- HISTORY FILES OF TRACER EMISSIONS -------------------
-c
-c HISTRAC
-c
-           CALL histdef(nid_tra1, "fluxbb", "Flux BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxff", "Flux FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcbb", "Flux BC-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcff", "Flux BC-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcnff", "Flux BC-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcba", "Flux BC-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbc", "Flux BC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxombb", "Flux OM-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomff", "Flux OM-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnff", "Flux OM-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomba", "Flux OM-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnat", "Flux OM-NT", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxom", "Flux OM", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sff","Flux H2S FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2snff","Flux H2S non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2ff","Flux SO2 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2nff","Flux SO2 non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2bb", "Flux SO2 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2vol","Flux SO2 Vol","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2ba", "Flux SO2 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2", "Flux SO2","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4ff","Flux SO4 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4nff","Flux SO4 non-FF",
-     .                  "mgS/m2/s", iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4bb", "Flux SO4 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4ba", "Flux SO4 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4", "Flux SO4","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdms", "Flux DMS", "mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sbio","Flux H2S Bio","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdustec", 
-     .                                 "Flux Dust EC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddfine","DD Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddcoa","DD Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxdd","Flux DD","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxssfine","SS Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxsscoa","SS Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxss","Flux SS","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"fluxso4chem","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ind","Ind emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_bb","BB emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ff","FF emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddfine","DD fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddcoa","DD coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ssfine","SS fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_sscoa","SS coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"u10m","Zonal wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"v10m","Meridional wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"flux_sparam_sulf","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-c TRACEUR
-c
-           CALL histdef(nid_tra3, "taue550", "Tau ext 550", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670", "Tau ext 670", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865", "Tau ext 865", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_tr2", "Tau ext 550tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_tr2", "Tau ext 670tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_tr2", "Tau ext 865tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_ss", "Tau ext 550ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_ss", "Tau ext 670ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_ss", "Tau ext 865ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_dust", "Tau ext 550dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_dust", "Tau ext 670dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_dust", "Tau ext 865dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-           DO it=1, nbtr
-c
-           WRITE(str2,'(i2.2)') it
-c
-           CALL histdef(nid_tra3, "trm"//str2, "Burden No."//str2, 
-     .                  "mgS/m2", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "sconc"//str2, "Surf Conc. No."//str2,
-     .                  "mg/m3", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c LESSIVAGE
-c
-           CALL histdef(nid_tra2, "flux"//str2, "emission"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "ds"//str2, "Depot sec No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dh"//str2,
-     .                  "Depot hum No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dtrconv"//str2,
-     .                  "Tiedke convective"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-
-
-c
-           ENDDO
-c
-           CALL histdef(nid_tra2, "sed_ss", "Sedmet. Tr3", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "sed_dust", "Sedmet. Tr4", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)         
-c
-           CALL histdef(nid_tra2, "g2p_gas", "Gas2particle gas sink", 
-     .                  "mg-S/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "g2p_aer", "Gas2particle tr2 src", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c--------------------------------------------------------------------
-c
-           CALL histend(nid_tra1)
-c
-           CALL histend(nid_tra2)
-c
-           CALL histend(nid_tra3)
-c
-c--------------------------------------------------------------------
-
-!        nbjour=1
-         ENDIF !--ok_histrac
-
-c
-!        IF (.NOT.edgar.AND.bateau) THEN
-!        PRINT *,'ATTENTION risque de compter double les bateaux'
-!        STOP
-!        ENDIF
-c
-c
-c
-      endif ! debutphy
-c
-c======================================================================
-c Initialisations
-c======================================================================
-c
-c
-c je  KE init
-      IF (debutphy) THEN
-        ALLOCATE(d_tr_cv(klon,klev,nbtr))
-        ALLOCATE(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))
-
-       ENDIF
-      
-       DO k=1,klev
-        DO i=1,klon
-         Mint(i,k)=0.
-        END DO
-       END DO
-
-
-c
-      DO it=1, nbtr
-       DO k=1,klev
-        DO i=1,klon
-         d_tr_cv(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.
-
-         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 it=1, nbtr
-       DO i=1,klon
-          dtrconv(i,it)=0.0
-       ENDDO
-      ENDDO
-
-      DO it=1, nbtr
-      DO i=1, klon 
-        his_dhlsc(i,it)=0.0
-        his_dhcon(i,it)=0.0
-        his_dhbclsc(i,it)=0.0
-        his_dhbccon(i,it)=0.0
-        trm(i,it)=0.0
-      ENDDO
-      ENDDO
-cJE:      
-      DO i=1, klon 
-         his_g2pgas(i) = 0.0
-         his_g2paer(i) = 0.0
-      ENDDO
-c endJE
-c
-
-      DO k=1, klev
-      DO i = 1, klon
-        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
-        zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/RG
-      ENDDO
-      ENDDO
-c
-      DO i = 1, klon
-        zalt(i,1)=pphis(i)/RG
-      ENDDO
-      DO k=1, klev-1
-      DO i = 1, klon
-        zalt(i,k+1)=zalt(i,k)+zdz(i,k)
-      ENDDO
-      ENDDO
-
-c
-c======================================================================
-c Initialisations of Scaling Parameters
-c======================================================================
-C
-C ----------------------------- SO4 -----------------------------------
-C
-c      scale_param_so4(1)=scale_param_sulf(1)
-c      scale_param_so4(klon)=scale_param_sulf(jjm+1)
-                  
-c      DO j = 2, jjm
-c        DO i = 1, iim
-c          ig=iim*(j-2)+i+1
-c          scale_param_so4(ig)=scale_param_sulf(j)
-c        ENDDO
-c      ENDDO
-C
-C ----------------------- SO2, BC & OM --------------------------------
-C ----------------FOSSIL FUEL AND INUDSTRIAL EMISSIONS-----------------
-      iregion_dust(:)=-999
-      iregion_ind(:)=-999
-      iregion_bb(:)=-999
-! READING BB MASK
-!     c_Directory='/ccc/work/cont003/dsm/nhuneeus/REGION_MASK/'
-      c_Directory='/d6/jelmd/LMDZ_INPUT/REGION_MASK/'
-!      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c JE por v2      c_FileName1='GFED_phyBBmask_lowres.txt'
-c JE por v2      c_FileName2='Country_phyFFandSO2mask_lowres.txt'
-c      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c      c_FileName2='Country_phyFFandSO2mask_lowres_v2.txt'
-       c_FileName1='GFED_phyBBmask_lowres_je48x36.txt'
-       c_FileName2='Country_phyFFandSO2mask_lowres_je48x36.txt'
-      c_FullName1=c_Directory//c_FileName1
-      c_FullName2=c_Directory//c_FileName2
-      print *,'BB mask NL = ',c_FullName1
-!
-      OPEN (UNIT=1,FILE=c_FullName1)
-      OPEN (UNIT=111,FILE=c_FullName2)
-      DO j=1,klon
-!         print *, j, klon
-         aux_mask1=0
-         aux_mask2=0
-         READ(1,102) aux_mask1
-!         mask_BBreg(j)=aux_mask1
-         iregion_bb(j)=aux_mask1
-         READ(111,102) aux_mask2
-!         print *,'aux_mask1, aux_mask2
-!     .    =',aux_mask1,aux_mask2,INT(aux_mask1),INT(aux_mask2)
-!         mask_ffso2reg(j)=aux_mask2
-         iregion_ind(j)=aux_mask2
-      ENDDO
-      CLOSE (UNIT=1)
-      CLOSE (UNIT=111)
-!
-      OPEN(25,FILE='dustregions_pyvar.data')
-      OPEN(55,FILE='indregions_pyvar.data')
-      OPEN(75,FILE='bbregions_pyvar.data')
-
-
-      DO i = 1, klon
-C ----------------------- SO2, BC & OM ---------------------------------
-C -----------------------BIOMASS BURNING--------------------------------
-C ------------------------------- DUST ---------------------------------
-C
-        IF ((xlat(i).GT.11).AND.(xlon(i).LT.-85)) THEN
-c NORTH WEST AMERICA = 1
-          iregion_dust(i)=1
-        ELSEIF ((xlat(i).LE.11).AND.(xlon(i).LT.-25)) THEN
-c SOUTH AMERICA = 2
-          iregion_dust(i)=2      
-        ELSEIF ((xlat(i).GE.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.14)) THEN
-c WEST SAHARA = 3
-          iregion_dust(i)=3
-        ELSEIF ((xlat(i).GT.-1.75*xlon(i)+89).AND.
-     .       (xlat(i).GT.0.524*xlon(i)-11.048).AND.
-     .       (xlat(i).LT.-0.464*xlon(i)+53.179).AND.
-     .       (xlat(i).LT.36)) THEN
-c SAUDI ARABIA = 9
-          iregion_dust(i)=9
-        ELSEIF ((xlat(i).LT.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.77)) THEN
-c AFRICA SUB-SAHARA = 5
-          iregion_dust(i)=5
-        ELSEIF ((xlon(i).GT.77).AND.(xlat(i).LT.-5)) THEN
-c AUSTRALIA = 8
-          iregion_dust(i)=8
-        ELSEIF ((xlon(i).GE.77).AND.(xlat(i).GE.-5)) THEN
-c ASIA EAST = 6  REGION ADDED 
-          iregion_dust(i)=6
-        ELSEIF (xlat(i).GT.11.AND.xlon(i).GE.-85.AND.
-     .          xlon(i).LT.-25) THEN
-c NORTH EAST AMERICA = 11
-          iregion_dust(i)=11
-        ELSEIF ((xlon(i).LT.77).AND.(xlat(i).LT.36).AND.
-     .       (xlat(i).GE.11).AND.
-     .       (xlat(i).GT.-0.464*xlon(i)+53.179).OR.
-     .       (xlat(i).LT.0.524*xlon(i)-11.048)) THEN 
-c INDIAN SUBCONTINENT
-          iregion_dust(i)=10
-        ELSEIF ((xlon(i).GT.33).AND.(xlon(i).LT.77).AND.
-     .       (xlat(i).GE.36)) THEN
-c ASIA WEST = 7
-          iregion_dust(i)=7
-        ELSEIF ((xlat(i).GE.11).AND.
-     .       (xlon(i).GT.14).AND.
-     .       (xlat(i).LT.-1.75*xlon(i)+89).OR.xlon(i).LE.33) THEN
-c EAST SAHARA = 4
-          iregion_dust(i)=4
-        ENDIF
-
-c       WRITTING REGIONS INTO FILE
-        IF (iregion_dust(i).LT.10) THEN
-          WRITE (25,101) iregion_dust(i)
-        ELSE
-          WRITE (25,102) iregion_dust(i)
-        ENDIF
-        WRITE (55,*) iregion_ind(i)
-        WRITE (75,*) iregion_bb(i)
-!        WRITE (55,102) iregion_ind(i)
-!        WRITE (75,102) iregion_bb(i)
-
-      ENDDO
-!      print *,'NEW DUST REGION, NOW 11 REGIONS!'
-      CLOSE(25)
-      CLOSE(55)
-      CLOSE(75)
-  101 FORMAT (i1)
-  102 FORMAT (i2)
-!      stop
-c
-c=======================================================================
-c SAVING SURFACE TYPE
-c=======================================================================
-      OPEN(35,FILE='surface_ocean.data')
-      OPEN(45,FILE='surface_seaice.data')
-      OPEN(65,FILE='surface_land.data')
-      OPEN(85,FILE='surface_landice.data')
-      DO i = 1, klon
-         WRITE (35,103) pctsrf(i,is_oce)
-         WRITE (45,103) pctsrf(i,is_sic)
-         WRITE (65,103) pctsrf(i,is_ter)
-         WRITE (85,103) pctsrf(i,is_lic)
-      ENDDO
-      CLOSE(35)
-      CLOSE(45)
-      CLOSE(65)
-      CLOSE(85)
-  103 FORMAT (f6.2)
-!      stop
-c
-c=======================================================================
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-
-
-!        DO it=1, nbtr   
-!           CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,
-!     . 'after kg_to_cm3')
-!        ENDDO
-c=======================================================================
-c
-      DO k=1, klev
-      DO i=1, klon
-        m_conc(i,k)=pplay(i,k)/t_seri(i,k)/RKBOL*1.e-6
-      ENDDO
-      ENDDO
-
-!
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_avt_coarem')
-        ENDDO        
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'avt coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: avt coarem')
-      ENDIF
-c
-c
-c=======================================================================
-c                     EMISSIONS OF COARSE AEROSOLS
-c=======================================================================
-c      
-c      PRINT *, 'DUST EMISSION VALUES FOR REAGION EAST ASIA'
-c      DO i=1, klon
-c        IF ((xlon(i).GT.105).AND.(xlat(i).GE.-5)) THEN
-c           print *, 'DUST_EC,LON,LAT = ',dust_ec(i),xlon(i),xlat(i)
-c        ENDIF
-c      ENDDO
-      print *,'Number of tracers = ',nbtr
-
-      print *,'AT BEGINNING OF PHYTRACR_SPL'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-
-      CALL coarsemission(pctsrf,pdtphys,t_seri,
-     .                   pmflxr,pmflxs,prfl,psfl,
-     .                   scale_param_ssacc,scale_param_sscoa,
-     .                   scale_param_dustacc,scale_param_dustcoa,
-     .                   iregion_dust,dust_ec,
-     .                   lmt_sea_salt,qmin,qmax,
-     .                             flux_sparam_ddfine,flux_sparam_ddcoa,
-     .                             flux_sparam_ssfine,flux_sparam_sscoa,
-     .                                                source_tr,flux_tr)
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_coarem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after coarem')
-      ENDIF
-
-c
-c
-c
-c======================================================================
-c                   EMISSIONS OF AEROSOL PRECURSORS      
-c======================================================================
-c
-      print *,'INPUT TO PRECUREMISSION'
-
-      CALL precuremission(ftsol,u10m_ec,v10m_ec,pctsrf,
-     .                    u_seri,v_seri,paprs,pplay,cdragh,cdragm,
-     .                    t_seri,q_seri,tsol,fracso2emis,frach2sofso2,
-     .                    bateau,zdz,zalt,kminbc,kmaxbc,pdtphys,
-     .                    scale_param_bb,scale_param_ind,
-     .                    iregion_ind, iregion_bb,
-     .                    lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     .                    lmt_so2bb_l,lmt_so2bb_h,
-     .                    lmt_so2volc_cont,lmt_altvolc_cont,
-     .                    lmt_so2volc_expl,lmt_altvolc_expl,
-     .                    lmt_dmsbio,lmt_h2sbio, lmt_dmsconc, lmt_dms,
-     .                                  flux_sparam_ind, flux_sparam_bb,
-     .                                  source_tr,flux_tr,tr_seri)
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after precur')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after precur')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after precur')
-      ENDIF
-
-c
-c
-c=======================================================================
-c                      EMISSIONS OF FINE AEROSOLS
-c=======================================================================
-c
-      CALL finemission(zdz,pdtphys,zalt,kminbc,kmaxbc,
-     .                 scale_param_bb,scale_param_ff,
-     .                 iregion_ind,iregion_bb,
-     .                 lmt_bcff, lmt_bcnff, lmt_bcbb_l,lmt_bcbb_h,
-     .                 lmt_bcba, lmt_omff, lmt_omnff,
-     .                 lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba,
-     .                                  flux_sparam_bb, flux_sparam_ff,
-     .                                        source_tr,flux_tr,tr_seri)
-c
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_fineem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after fineem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after fineem')
-      ENDIF
-c
-c=======================================================================
-c                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
-c=======================================================================
-c
-
-!======================================================================
-!    -- Dry deposition --
-!======================================================================
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before depo')
-      ENDIF
-
-
-
-      CALL deposition(vdep_oce,vdep_sic,vdep_ter,vdep_lic,pctsrf,
-     .                zrho,zdz,pdtphys,RHcl,masse,t_seri,pplay,paprs,
-     .                lminmax,qmin,qmax,
-     .                         his_ds,source_tr,tr_seri)
-c
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after depo')
-      ENDIF
-
-c
-!======================================================================
-!    -- 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
-!
-!      nsplit01=10
-!      DO it=1, nbtr
-!         DO isplit=1, nsplit01
-
-
-!
-       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 ! nsplit1
-      END DO ! it
-
-
-
-
-
-!======================================================================
-!    -- Boundary layer mixing --
-!======================================================================
-
-c
-
-       DO k = 1, klev
-        DO i = 1, klon
-         delp(i,k) = paprs(i,k)-paprs(i,k+1)
-        END DO
-      END DO
-
-c
-      DO it=1, nbtr
-c      print *,' BEFORE Cltrac'
-c      print *,'tr_seri = ',SUM(tr_seri(:,:,it)),MINVAL(tr_seri(:,:,it)),
-c     .                                         MAXVAL(tr_seri(:,:,it))
-c
-      DO j=1, klev
-      DO i=1, klon
-        tmp_var(i,j)=tr_seri(i,j,it)
-        aux_var2(i)=source_tr(i,it)
-      ENDDO
-      ENDDO
-
-! JEnew : to uopdate to the new cltrac     
-
-      IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL cltrac_spl(pdtphys,coefh,yu1,yv1,t_seri,tmp_var,
-     .            aux_var2,paprs,pplay,aux_var3)
-
-      ELSE IF (iflag_conv.GE.3) THEN
-!KE
-    
-
-      CALL cltrac(pdtphys, coefh,t_seri,tmp_var,aux_var2,paprs,pplay,
-     .            delp,aux_var3,d_tr_dry,flux_tr_dry(:,it))
-      ENDIF
- 
-! Je new end
-
-      DO i=1, klon
-      DO j=1, klev
-        tr_seri(i,j,it)=tmp_var(i,j)
-        d_tr(i,j,it)=aux_var3(i,j)
-      ENDDO
-      ENDDO
-      DO k = 1, klev
-      DO i = 1, klon
-         tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr(i,k,it)
-      ENDDO
-      ENDDO
-      print *,' AFTER Cltrac'
-      IF (lminmax) THEN
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after cltrac')
-      ENDIF
-c
-      DO j=1,klev
-      DO i=1,klon
-         tmp_var(i,j)=tr_seri(i,j,it)
-      ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay,t_seri,tmp_var)
-      DO j=1,klev
-      DO i=1,klon
-         tr_seri(i,j,it)=tmp_var(i,j)
-      ENDDO
-      ENDDO
-c
-      ENDDO !--end itr loop
-
-c
-      print *,' BEFORE Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before sedi')
-      ENDIF
-
-      print *,'SPLA VERSION OF SEDIMENTATION IS USED'
-      CALL sediment_mod(t_seri,pplay,zrho,paprs,pdtphys,RHcl,!xlon,xlat,
-     .                               sed_ss,sed_dust,tr_seri)
-c
-      print *,'AFTER Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after sedi')
-      ENDIF
-c
-
-c
-c=======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-c
-c======================================================================
-c                      GAS TO PARTICLE CONVERSION      
-c======================================================================
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_beforegastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before gastopar')
-      ENDIF
-
-
-
-      CALL gastoparticle(pdtphys,zdz,zrho,xlat,
-     .              pplay,t_seri,
-     .              tr_seri,his_g2pgas ,his_g2paer) 
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_gastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after gastopar')
-      ENDIF
-c
-c======================================================================
-c                        EFFECT OF PRECIPITATION
-c======================================================================
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-c
-
-      print *,'iflag_conv bef lessiv',iflag_conv
-      IF (lessivage) THEN
-c
-      print *,' BEFORE Incloud'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_incloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before incloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before incloud')
-      ENDIF
-
-
-!      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-      print *,'iflag_conv bef incloud',iflag_conv
-c      CALL incloud_scav_lsc(.false.,qmin,qmax,masse,henry,kk,prfl,
-c     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-c     .                                     his_dhlsc,his_dhcon,tr_seri)
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL incloud_scav(.false.,qmin,qmax,masse,henry,kk,prfl,
-     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-     .                                     his_dhlsc,his_dhcon,tr_seri)
-
-        ELSE IF (iflag_conv.GE.3) THEN
-
-      CALL incloud_scav_lsc(.false.,qmin,qmax,masse,henry,kk,prfl,
-     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-     .                                     his_dhlsc,his_dhcon,tr_seri)
-
-        ENDIF
-c
-c
-      print *,' BEFORE blcloud (after incloud)'
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_blcloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before blcloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before blcloud')
-      ENDIF
-
-!      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-      CALL blcloud_scav_lsc(.false.,qmin,qmax,pdtphys,prfl,psfl,
-     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-
-      CALL blcloud_scav(.false.,qmin,qmax,pdtphys,prfl,psfl,
-     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-        ELSE IF (iflag_conv.GE.3) THEN
-
-      CALL blcloud_scav_lsc(.false.,qmin,qmax,pdtphys,prfl,psfl,
-     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-        ENDIF
-
-
-      print *,' AFTER blcloud '
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_blcloud')
-        ENDDO                           
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after blcloud')
-        ENDDO                                  
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after blcloud')
-      ENDIF
-
-
-      ENDIF !--lessivage
-c
-c
-c======================================================================
-c                         EFFECT OF CONVECTION 
-c======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-      IF (convection) THEN
-c
-      print *,' BEFORE trconvect'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_trconve')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before trconve')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before trconve')
-      ENDIF
-
-
-! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-!     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
-!     .                                                 dtrconv,tr_seri)
-! -------------------------------------------------------------     
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-         CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,.false.,masse,
-     .                                                 dtrconv,tr_seri)
-         DO it=1, nbtr
-           d_tr_cv(:,:,it)=0.
-         ENDDO
-
-        ELSE IF (iflag_conv.GE.3) THEN
-! KE
-         print *,'JE: KE in phytracr_spl'
-
-
-         DO it=1, nbtr
-             DO k = 1, klev
-              DO i = 1, klon
-               tmp_var3(i,k,it)=tr_seri(i,k,it)!/1000. ! change mg/kg to g/kg
-              END DO
-             END DO
-         ENDDO
-
-         DO it=1, nbtr
-!          routine for aerosols . otherwise, check cvltrorig
-         print *,'Check sum before cvltr it',it,SUM(tr_seri(:,:,it))
-           CALL cvltr_spl(pdtphys, da, phi,phi2,d1a,dam, mp,ep,
-     .       sigd,sij,clw,elij,epmlmMm,eplaMm,
-     .       pmflxr,pmflxs,evap,t_seri,wdtrainA,wdtrainM,
-!     .       paprs,it,tr_seri,upwd,dnwd,itop_con,ibas_con,
-     .       paprs,it,tmp_var3,upwd,dnwd,itop_con,ibas_con,
-     .       henry,kk,zrho,
-     .       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)
-!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-
-!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
-!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
-!     .               upwd,dnwd,d_tr_cv)
-             DO k = 1, klev
-              DO i = 1, klon
-!               tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr_cv(i,k,it)
-               tr_seri(i,k,it)=(tmp_var3(i,k,it)+d_tr_cv(i,k,it))!*1000.
-               tmp_var(i,k)=d_tr_cv(i,k,it)!*1000. ! back to mg/kg
-
-              END DO
-             END DO
-
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-
-             DO k = 1, klev
-              DO i = 1, klon
-               dtrconv(i,it)=dtrconv(i,it)+tmp_var(i,k)
-     .                /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-              END DO
-             END DO
-         print *,'Check sum after cvltr it',it,SUM(tr_seri(:,:,it))
-        CALL minmaxqfi2(d_tr_cv(:,:,it),qmin,qmax,'d_tr_cv:')
-        CALL minmaxqfi2(d_tr_trsp(:,:,it),qmin,qmax,'d_tr_trsp:')
-        CALL minmaxqfi2(d_tr_sscav(:,:,it),qmin,qmax,'d_tr_sscav:')
-        CALL minmaxqfi2(d_tr_sat(:,:,it),qmin,qmax,'d_tr_sat:')
-        CALL minmaxqfi2(d_tr_uscav(:,:,it),qmin,qmax,'d_tr_uscav:')
-
-         ENDDO ! it=1,nbtr
-        ENDIF ! iflag_conv
-        IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after trconv')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-
-
-!  -----------------------------------------------------------
-! end JE desactiva trconvect
-      print *,' AFTER Trconvect'
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after trconv')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-c
-c
-      ENDIF ! convection
-c
-c=======================================================================
-c                         COMPUTING THE BURDEN
-c=======================================================================
-c      
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-c
-c Computing burden in mg/m2
-      DO it=1, nbtr
-      DO k=1, klev
-      DO i=1, klon
-        trm(i,it)=trm(i,it)+tr_seri(i,k,it)*1.e6*zdz(i,k)*
-     .            masse(it)*1.e3/RNAVO     !--mg S/m2
-      ENDDO
-      ENDDO
-      ENDDO
-c
-c Computing Surface concentration in ug/m3
-c
-      DO it=1, nbtr
-      DO i=1, klon
-        sconc_seri(i,it)=tr_seri(i,1,it)*1.e6*
-     .            masse(it)*1.e3/RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
-      ENDDO
-      ENDDO
-c
-c=======================================================================
-c                  CALCULATION OF OPTICAL PROPERTIES
-c=======================================================================
-c      
-      CALL aeropt_spl(zdz, tr_seri, RHcl,
-     .               diff_aod550_tot,diag_aod670_tot,diag_aod865_tot,
-     .               diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2,
-     .               diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,
-     .               diag_aod550_dust,diag_aod670_dust,diag_aod865_dust)
-c
-c======================================================================
-c   Stockage sur bande histoire
-c======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-c
-c======================================================================
-c  SAVING AEROSOL RELATED VARIABLES INTO FILE
-c======================================================================
-c
-      IF (ok_histrac) THEN
-c
-      ndex2d = 0
-      ndex3d = 0 
-c
-      itra=itra+1
-
-      print *,'SAVING VARIABLES FOR DAY ',itra
-c
-      fluxbb(:)=0.0
-      fluxff(:)=0.0
-      fluxbcbb(:)=0.0
-      fluxbcff(:)=0.0
-      fluxbcnff(:)=0.0
-      fluxbcba(:)=0.0
-      fluxbc(:)=0.0
-      fluxombb(:)=0.0
-      fluxomff(:)=0.0
-      fluxomnat(:)=0.0
-      fluxomba(:)=0.0
-      fluxomnff(:)=0.0
-      fluxom(:)=0.0
-      fluxh2sff(:)=0.0
-      fluxh2snff(:)=0.0
-      fluxh2sbio(:)=0.0
-      fluxso2ff(:)=0.0
-      fluxso2nff(:)=0.0
-      fluxso2bb(:)=0.0
-      fluxso2vol(:)=0.0
-      fluxso2ba(:)=0.0
-      fluxso2(:)=0.0
-      fluxso4ff(:)=0.0
-      fluxso4nff(:)=0.0
-      fluxso4bb(:)=0.0
-      fluxso4ba(:)=0.0
-      fluxso4(:)=0.0
-      fluxdms(:)=0.0
-      fluxdustec(:)=0.0
-      fluxddfine(:)=0.0
-      fluxddcoa(:)=0.0
-      fluxdd(:)=0.0
-      fluxssfine(:)=0.0
-      fluxsscoa(:)=0.0
-      fluxss(:)=0.0
-      DO i=1, klon
-         IF (iregion_ind(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxh2sff(i)= (lmt_so2ff_l(i)+lmt_so2ff_h(i))*frach2sofso2*
-     .                    scale_param_ind(iregion_ind(i))*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-           fluxso2ff(i)=scale_param_ind(iregion_ind(i)) * fracso2emis *
-     .                   (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4ff(i)=scale_param_ind(iregion_ind(i))*(1-fracso2emis)*
-     .                    (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcff(i)=scale_param_ff(iregion_ind(i))*
-     .                                        lmt_bcff(i)*1.e4*1.e3  !/g/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxomff(i)=scale_param_ff(iregion_ind(i))*
-     .                          (lmt_omff(i))*1.e4*1.e3  !/g/m2/s
-           ! FOSSIL FUEL EMISSIONS
-           fluxff(i)=fluxbcff(i)+fluxomff(i)
-         ENDIF
-         IF (iregion_bb(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxso2bb(i) =scale_param_bb(iregion_bb(i)) * fracso2emis *
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4bb(i) =scale_param_bb(iregion_bb(i))*(1-fracso2emis)*
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcbb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_bcbb_l(i)+lmt_bcbb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxombb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_ombb_l(i)+lmt_ombb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! BIOMASS BURNING EMISSIONS
-           fluxbb(i)=fluxbcbb(i)+fluxombb(i)
-         ENDIF
-         ! H2S EMISSIONS
-         fluxh2sbio(i)=lmt_h2sbio(i)*1.e4/RNAVO*masse_s*1.e3      ! mgS/m2/s
-         fluxh2snff(i)= lmt_so2nff(i)*frach2sofso2*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-         ! SULFUR DIOXIDE EMISSIONS
-         fluxso2nff(i)=fracso2emis * lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso2vol(i)=(lmt_so2volc_cont(i)+lmt_so2volc_expl(i))
-     .                 *1.e4/RNAVO*masse_s*1.e3        ! mgS/m2/s
-         fluxso2ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3*
-     .                                                   fracso2emis ! mgS/m2/s
-         fluxso2(i)=fluxso2ff(i)+fluxso2bb(i)+fluxso2nff(i)+
-     .              fluxso2vol(i)+fluxso2ba(i)
-         ! DMS EMISSIONS
-         fluxdms(i)=( lmt_dms(i)+lmt_dmsbio(i) )
-     .              *1.e4/RNAVO*masse_s*1.e3          ! mgS/m2/s
-         ! SULPHATE EMISSIONS
-         fluxso4ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3
-     .                 *(1-fracso2emis) ! mgS/m2/s
-         fluxso4nff(i)=(1-fracso2emis)*lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso4(i)=fluxso4ff(i)+fluxso4bb(i)+fluxso4ba(i)+fluxso4nff(i)
-         ! BLACK CARBON EMISSIONS
-
-         fluxbcnff(i)=lmt_bcnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxbcba(i)=lmt_bcba(i)*1.e4*1.e3    !mg/m2/s
-         fluxbc(i)=fluxbcbb(i)+fluxbcff(i)+fluxbcnff(i)+fluxbcba(i)
-         ! ORGANIC MATTER EMISSIONS
-         fluxomnat(i)=lmt_omnat(i)*1.e4*1.e3  !mg/m2/s
-         fluxomba(i)=lmt_omba(i)*1.e4*1.e3  !mg/m2/s
-         fluxomnff(i)=lmt_omnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxom(i)=fluxombb(i)+fluxomff(i)+fluxomnat(i)+fluxomba(i)+
-     .             fluxomnff(i)
-        ! DUST EMISSIONS 
-         fluxdustec(i)=dust_ec(i)*1.e6
-         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
-     .                                  * dust_ec(i)*0.093*1.e6
-         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
-     .                                  * dust_ec(i)*0.905*1.e6
-         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
-        ! SEA SALT EMISSIONS 
-         fluxssfine(i)=scale_param_ssacc*lmt_sea_salt(i,1)*1.e4*1.e3
-         fluxsscoa(i)=scale_param_sscoa*lmt_sea_salt(i,2)*1.e4*1.e3
-         fluxss(i)=fluxssfine(i)+fluxsscoa(i)
-      ENDDO
-c
-c SAVING VARIABLES IN TRACEUR
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c     
-      DO it=1,nbtr
-c
-      WRITE(str2,'(i2.2)') it
-c 
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,trm(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"trm"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sconc_seri(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"sconc"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-c SAVING VARIABLES IN LESSIVAGE
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_tr(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"flux"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_ds(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"ds"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      DO i=1, klon
-        zx_tmp_fi2d(i) = his_dhlsc(i,it)+his_dhcon(i,it)+
-     .                   his_dhbclsc(i,it)+his_dhbccon(i,it)
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,zx_tmp_fi2d,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dh"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-C
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,dtrconv(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dtrconv"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_ss",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_dust",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)              
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2pgas,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_gas",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2paer,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_aer",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c SAVING VARIABLES IN HISTRAC
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-c ========================= BC =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbc,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbc",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= OM =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxombb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxombb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnat,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnat",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxom,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxom",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO4 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= H2S =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2snff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2snff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sbio,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sbio",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO2 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2vol,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2vol",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdms,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdms",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= DD =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdustec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdustec",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdd,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdd",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c ========================= SS =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxsscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxsscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxss,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxss",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,fluxso4chem,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"fluxso4chem",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ind,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ind",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_bb",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ff",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_sscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_sscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,u10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"u10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,v10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"v10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,flux_sparam_sulf,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"flux_sparam_sulf",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      ENDIF ! ok_histrac
-      print *,'END PHYTRACR_SPL '
-
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl_dot_F_20140210b_seq
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl_dot_F_20140210b_seq	(revision 2196)
+++ 	(revision )
@@ -1,2356 +1,0 @@
-      SUBROUTINE phytracr_spl ( debutphy, iflag_conv,
-     I                   pdtphys,ftsol,tsol, 
-     I                   t_seri,q_seri,paprs,pplay,RHcl,
-     I                   pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,
-     I                   coefh, cdragh, cdragm, yu1, yv1, 
-     I                   u_seri, v_seri, xlat,xlon,
-     I                   pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,
-     I                   da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,
-     I                   epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,
-     I                   evap,wdtrainA,  wdtrainM,
-     I                   fm_therm, entr_therm, rneb,
-     I                   beta_fisrt,beta_v1,
-     P                   scale_param_ssacc,
-     P                   scale_param_sscoa,scale_param_ind,
-     P                   scale_param_bb,scale_param_ff,
-     P                   scale_param_dustacc,scale_param_dustcoa,
-     E                   dust_ec,u10m_ec,v10m_ec,
-     E                   lmt_sea_salt,
-     E                   lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     E                   lmt_so2bb_l, lmt_so2bb_h,
-     E                   lmt_so2volc_cont,lmt_altvolc_cont,
-     E                   lmt_so2volc_expl,lmt_altvolc_expl,
-     E                   lmt_dmsbio,lmt_h2sbio,lmt_dmsconc,
-     E                   lmt_bcff,lmt_bcnff,lmt_bcbb_l,lmt_bcbb_h,
-     E                   lmt_bcba,lmt_omff,lmt_omnff,lmt_ombb_l,
-     E                   lmt_ombb_h,lmt_omnat,lmt_omba,
-     O                   tr_seri,
-     O                   diff_aod550_tot,diag_aod865_tot,
-     O                   diff_aod550_tr2,diag_aod865_tr2,
-     O                   diag_aod550_dust,diag_aod865_dust,
-     O                   diag_aod550_ss,diag_aod865_ss)
-!     E                   wth,cly,zprecipinsoil,lmt_sea_salt, ! Titane
-c
-      USE IOIPSL
-      USE dimphy
-      USE infotrac
-      USE indice_sol_mod
-c
-      IMPLICIT none
-c
-c======================================================================
-c Auteur(s) FH
-c Objet: Moniteur general des tendances traceurs
-c
-c Remarques en vrac:
-c ------------------
-c 1/ le call phytrac se fait avec nqmax-2 donc nous avons bien 
-c les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
-c======================================================================
-#include "dimensions.h"
-#include "chem.h"
-#include "../phylmd/YOMCST.h"
-#include "../phylmd/YOETHF.h"
-c #include "../phylmd/dimphy.h"
-c #include "../phylmd/indicesol.h"
-#include "paramet.h"
-#include "thermcell.h"
-
-c======================================================================
-
-c Arguments:
-c
-c   EN ENTREE:
-c   ==========
-c
-c   divers:
-c   -------
-c
-      real pdtphys  ! pas d'integration pour la physique (seconde)
-      real ftsol(klon,nbsrf)  ! temperature du sol par type
-      real tsol(klon)         ! temperature du sol moyenne
-      real t_seri(klon,klev)  ! temperature
-      real u_seri(klon,klev)  ! vent
-      real v_seri(klon,klev)  ! vent
-      real q_seri(klon,klev)  ! vapeur d eau kg/kg
-      real tr_seri(klon,klev,nbtr) ! traceur  
-      real tmp_var(klon,klev) ! auxiliary variable to replace traceur  
-      real tmp_var2(klon,nbtr) ! auxiliary variable to replace source
-      real tmp_var3(klon,klev,nbtr) ! auxiliary variable 3D  
-      real dummy1d ! JE auxiliary variable
-      real aux_var2(klon) ! auxiliary variable to replace traceur  
-      real aux_var3(klon,klev) ! auxiliary variable to replace traceur  
-      real d_tr(klon,klev,nbtr)    ! traceur  tendance
-      real sconc_seri(klon,nbtr) ! surface concentration of traceur  
-c
-      integer nbjour
-      save nbjour
-c
-      REAL diff_aod550_tot(klon)  ! epaisseur optique total aerosol 550  nm
-      REAL diag_aod670_tot(klon)  ! epaisseur optique total aerosol 670 nm
-      REAL diag_aod865_tot(klon)  ! epaisseur optique total aerosol 865 nm
-      REAL diff_aod550_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
-      REAL diag_aod670_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
-      REAL diag_aod865_tr2(klon)  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
-      REAL diag_aod550_ss(klon)   ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
-      REAL diag_aod670_ss(klon)   ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
-      REAL diag_aod865_ss(klon)   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
-      REAL diag_aod550_dust(klon) ! epaisseur optique Dust aerosol 550 nm, diagnostic
-      REAL diag_aod670_dust(klon) ! epaisseur optique Dust aerosol 670 nm, diagnostic
-      REAL diag_aod865_dust(klon) ! epaisseur optique Dust aerosol 865 nm, diagnostic
-c
-      real paprs(klon,klev+1)  ! pression pour chaque inter-couche (en Pa)
-      real pplay(klon,klev)  ! pression pour le mileu de chaque couche (en Pa)
-      real RHcl(klon,klev)  ! humidite relativen ciel clair
-      real znivsig(klev)  ! indice des couches
-      real paire(klon)
-      real pphis(klon)
-      real pctsrf(klon,nbsrf)
-      logical debutphy   ! le flag de l'initialisation de la physique
-c
-c   Scaling Parameters:
-c   ----------------------
-c
-      CHARACTER*33 c_Directory
-      CHARACTER*33 c_FileName1
-      CHARACTER*42 c_FileName2
-      CHARACTER*71 c_FullName1
-      CHARACTER*77 c_FullName2
-      INTEGER :: xidx, yidx
-      INTEGER,DIMENSION(klon) :: mask_bbreg
-      INTEGER,DIMENSION(klon) :: mask_ffso2reg
-      INTEGER :: aux_mask1
-      INTEGER :: aux_mask2
-
-      INTEGER iregion_so4(klon)  !Defines regions for SO4
-      INTEGER iregion_ind(klon)  !Defines regions for SO2, BC & OM
-      INTEGER iregion_bb(klon)   !Defines regions for SO2, BC & OM
-      INTEGER iregion_dust(klon) !Defines  dust regions
-c      REAL scale_param_sulf(jjm+1)  !Scaling parameter for sulfate (input)
-c      REAL scale_param_so4(klon)  !Scaling parameter for sulfate used whithin phytrac
-      REAL scale_param_ssacc  !Scaling parameter for Fine Sea Salt
-      REAL scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
-      REAL scale_param_ind(nbreg_ind) !Scaling parameter for industrial emissionsi of SO2
-      REAL scale_param_bb(nbreg_bb)  !Scaling parameter for biomas burning (SO2, BC & OM)
-      REAL scale_param_ff(nbreg_ind)  !Scaling parameter for industrial emissions (fossil fuel)
-      REAL scale_param_dustacc(nbreg_dust)  !Scaling parameter for Fine Dust
-      REAL scale_param_dustcoa(nbreg_dust)  !Scaling parameter for Coarse Dust
-c
-c   Emissions:
-c   ---------
-c
-c---------------------------- SEA SALT & DUST emissions ------------------------
-      REAL lmt_sea_salt(klon,ss_bins) !Sea salt 0.03-8.0 um
-      REAL u10m_ec1(klon),v10m_ec1(klon)
-      REAL u10m_ec2(klon),v10m_ec2(klon),dust_ec2(klon)
-      REAL dust_ec(klon)
-!      REAL cly(klon),wth(klon),zprecipinsoil(klon)   ! Titane
-c------------------------- SULFUR emissions ----------------------------
-      REAL lmt_so2volc_cont(klon)  ! emissions so2 volcan (continuous)
-      REAL lmt_altvolc_cont(klon)  ! altitude  so2 volcan (continuous)
-      REAL lmt_so2volc_expl(klon)  ! emissions so2 volcan (explosive)
-      REAL lmt_altvolc_expl(klon)  ! altitude  so2 volcan (explosive)
-      REAL lmt_so2ff_l(klon)       ! emissions so2 fossil fuel (low)
-      REAL lmt_so2ff_h(klon)       ! emissions so2 fossil fuel (high)
-      REAL lmt_so2nff(klon)        ! emissions so2 non-fossil fuel
-      REAL lmt_so2bb_l(klon)       ! emissions de so2 biomass burning (low)
-      REAL lmt_so2bb_h(klon)       ! emissions de so2 biomass burning (high)
-      REAL lmt_so2ba(klon)         ! emissions de so2 bateau
-      REAL lmt_dms(klon)           ! emissions de dms
-      REAL lmt_dmsconc(klon)       ! concentration de dms oceanique
-      REAL lmt_dmsbio(klon)        ! emissions de dms bio 
-      REAL lmt_h2sbio(klon)        ! emissions de h2s bio
-c------------------------- BLACK CARBON emissions ----------------------
-      REAL lmt_bcff(klon)       ! emissions de BC fossil fuels
-      REAL lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
-      REAL lmt_bcbb_l(klon)     ! emissions de BC biomass basses
-      REAL lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
-      REAL lmt_bcba(klon)      ! emissions de BC bateau
-c------------------------ ORGANIC MATTER emissions ---------------------      
-      REAL lmt_omff(klon)     ! emissions de OM fossil fuels
-      REAL lmt_omnff(klon)    ! emissions de OM non-fossil fuels
-      REAL lmt_ombb_l(klon)   ! emissions de OM biomass basses
-      REAL lmt_ombb_h(klon)   ! emissions de OM biomass hautes
-      REAL lmt_omnat(klon)    ! emissions de OM Natural
-      REAL lmt_omba(klon)     ! emissions de OM bateau
-                                                                        
-c
-c  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
-c
-c   convection:
-c   -----------
-c
-      REAL pmfu(klon,klev)  ! flux de masse dans le panache montant
-      REAL pmfd(klon,klev)  ! flux de masse dans le panache descendant
-      REAL pen_u(klon,klev) ! flux entraine dans le panache montant
-      REAL pde_u(klon,klev) ! flux detraine dans le panache montant
-      REAL pen_d(klon,klev) ! flux entraine dans le panache descendant
-      REAL pde_d(klon,klev) ! flux detraine dans le panache descendant
-c
-c  Convection KE scheme:
-c  ---------------------
-c
-c! Variables pour le lessivage convectif
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated
-c            updraft mass flux
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated
-c            downdraft mass flux
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: evap
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
-
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
-       REAL,DIMENSION(klon),INTENT(IN)           :: sigd
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: elij
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: epmlmMm
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: eplaMm
-
-c     KE: Tendances de traceurs (Td) et flux de traceurs:
-!     ------------------------
-       REAL,DIMENSION(klon,klev)      :: Mint
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPr,qDi ! concentration tra
-c       dans pluie,air descente insaturee
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPa,qMel
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qTrdi,dtrcvMA ! conc traceur
-c              descente air insaturee et td convective MA
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv  ! Td convection/traceur
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_th  ! Td thermique
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_insc
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_bcscav
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_evapls
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_ls
-       REAL,DIMENSION(:,:),ALLOCATABLE,SAVE      :: qPrls      !jyg: concentration 
-!                                                        !tra dans pluie LS a la surf.
-
-       INTEGER ::  nsplit
-!
-
-     
-
-!CHECK!!
-!!!$OMP
-!!!!THREADPRIVATE(qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa,d_tr_lessi_nucl)
-!!!!$OMP THREADPRIVATE(d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qPr,qDi)
-!$OMP THREADPRIVATE(d_tr_insc,d_tr_bcscav,d_tr_evapls,d_tr_ls,qPrls)
-!!!!!$OMP THREADPRIVATE(d_tr,d_tr_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
-
-
-c
-c  Lessivage
-c  ---------
-c
-      REAL pmflxr(klon,klev+1), pmflxs(klon,klev+1)   !--convection
-      REAL prfl(klon,klev+1),   psfl(klon,klev+1)     !--large-scale
-! JE      REAL pmflxr(klon,klev), pmflxs(klon,klev)   !--convection       ! Titane
-! JE      REAL prfl(klon,klev),   psfl(klon,klev)     !--large-scale      ! Titane
-      REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
-      REAL  :: ql_incloud_ref    ! ref value of in-cloud condensed water content
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb    ! fraction nuageuse (grande echelle)
-!
-
-      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,SAVE  :: iflag_lscav_omp,iflag_lscav
-
-
-
-
-!Thermiques:
-!----------
-      REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-      REAL,DIMENSION(klon,klev),INTENT(IN)     :: entr_therm
-
-
-c
-c   Couche limite:
-c   --------------
-c
-      REAL coefh(klon,klev) ! coeff melange CL
-      REAL cdragh(klon), cdragm(klon)
-      REAL yu1(klon)        ! vent dans la 1iere couche
-      REAL yv1(klon)        ! vent dans la 1iere couche
-c
-c
-c----------------------------------------------------------------------
-      REAL his_ds(klon,nbtr)
-      REAL his_dhlsc(klon,nbtr)        ! in-cloud scavenging lsc
-      REAL his_dhcon(klon,nbtr)       ! in-cloud scavenging con
-      REAL his_dhbclsc(klon,nbtr)      ! below-cloud scavenging lsc
-      REAL his_dhbccon(klon,nbtr)      ! below-cloud scavenging con
-      REAL trm(klon,nbtr)
-c
-      REAL u10m_ec(klon), v10m_ec(klon)
-c
-c
-c   Coordonnees
-c   -----------
-c
-      REAL xlat(klon)       ! latitudes pour chaque point 
-      REAL xlon(klon)       ! longitudes pour chaque point 
-C
-      INTEGER i, k, it, j, ig 
-c
-c DEFINITION OF DIAGNOSTIC VARIABLES
-c
-      REAL diag_trm(nbtr), diag_drydep(nbtr) 
-      REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
-      REAL diag_emissn(nbtr), diag_g2part
-      REAL diag_sedimt
-      REAL trm_aux(nbtr), src_aux(nbtr)
-c
-c Variables locales pour effectuer les appels en serie
-c----------------------------------------------------
-      REAL source_tr(klon,nbtr)
-      REAL flux_tr(klon,nbtr)
-      REAL m_conc(klon,klev)
-      REAL sed_ss(klon)    ! corresponds to tracer 3
-      REAL sed_dust(klon)  ! corresponds to tracer 4
-      REAL henry(nbtr)  !--cste de Henry  mol/l/atm
-      REAL kk(nbtr)     !--coefficient de var avec T (K)
-      REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
-      REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
-      REAL vdep_oce(nbtr), vdep_sic(nbtr)
-      REAL vdep_ter(nbtr), vdep_lic(nbtr)
-      REAL dtrconv(klon,nbtr)
-      REAL zrho(klon,klev), zdz(klon,klev)
-      REAL zalt(klon,klev)
-      REAL,DIMENSION(klon,klev)      :: zmasse    ! densité atmosphérique
-c     .                                              Kg/m2
-      REAL,DIMENSION(klon,klev)      :: ztra_th
-      REAL qmin, qmax, aux
-!      PARAMETER (qmin=0.0, qmax=1.e33)
-      PARAMETER (qmin=1.e33, qmax=-1.e33)
-
-c Variables to save data into file
-c----------------------------------
-   
-      CHARACTER*2 str2
-      LOGICAL ok_histrac
-      PARAMETER (ok_histrac=.true.)
-      INTEGER ndex2d(iim*(jjm+1)), ndex3d(iim*(jjm+1)*klev)
-      INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
-      INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      INTEGER itra
-      SAVE itra                    ! compteur pour la physique
-      INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
-      REAL zx_tmp_2d(iim,jjm+1), zx_tmp_3d(iim,jjm+1,klev)
-      REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
-      REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
-      REAL zsto, zout, zout_h, zout_m, zjulian
-      REAL fluxbb(klon), fluxff(klon)
-      REAL fluxbcbb(klon), fluxbcff(klon), fluxbcnff(klon)
-      REAL fluxombb(klon), fluxomff(klon), fluxomnat(klon)
-      REAL fluxomnff(klon), fluxomba(klon), fluxbcba(klon)
-      REAL fluxso2ff(klon), fluxso2bb(klon), fluxso2(klon)
-      REAL fluxso2nff(klon), fluxso2vol(klon), fluxso2ba(klon) 
-      REAL fluxh2sff(klon), fluxh2snff(klon)
-      REAL fluxso4ff(klon), fluxso4bb(klon), fluxso4ba(klon)
-      REAL fluxh2sbio(klon), fluxso4nff(klon)
-      REAL fluxdms(klon)
-      REAL fluxbc(klon), fluxom(klon), fluxso4(klon)
-      REAL fluxdd(klon), fluxss(klon)
-      REAL fluxdustec(klon), fluxssfine(klon), fluxsscoa(klon)
-      REAL fluxddfine(klon), fluxddcoa(klon)
-      REAL flux_sparam_bb(klon), flux_sparam_ff(klon)
-      REAL flux_sparam_ind(klon) !, flux_sparam_sulf(klon,klev)
-      REAL flux_sparam_ddfine(klon), flux_sparam_ddcoa(klon)
-      REAL flux_sparam_ssfine(klon), flux_sparam_sscoa(klon)
-
-c------------------DMS  SO2  SO4   H2S  DMSO MSA H2O2 
-c------------------BC1, BC2, OM1, OM2,flyash  dust1   dust2 
-c------------------Sea Salt 1-8 bins 
-c------------------Precursors (gases), Fine, Coarse Aerosols
-C c
-C       DATA henry   /1.4, 0.0, 0.0, 0.0/
-C c
-C       DATA kk      /2900., 0., 0., 0./
-C c
-C       DATA alpha_r /0., 0.001, 0.001, 0.001/
-C c
-C       DATA alpha_s /0., 0.01, 0.01, 0.01/
-C c
-C cnhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-C cnhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-C       DATA vdep_oce /0.28, 0.28, 1.2, 1.2/
-C c
-C       DATA vdep_sic /0.2, 0.17, 1.2, 1.2/
-C c
-C       DATA vdep_ter /0.3, 0.14, 1.2, 1.2/
-
-C       DATA vdep_lic /0.2, 0.17, 1.2, 1.2/
-      
-c------Molar Masses
-      REAL masse(nbtr)
-c
-      REAL fracso2emis                              !--fraction so2 emis en so2
-      PARAMETER (fracso2emis=0.95) 
-      REAL frach2sofso2                             !--fraction h2s from so2
-      PARAMETER (frach2sofso2=0.0426)
-c
-c   Controles
-c-------------
-      LOGICAL convection,lessivage,lminmax
-      DATA convection,lessivage,lminmax
-     s     /.true.,.true.,.true./
-c
-      REAL xconv(nbtr)
-c
-      LOGICAL anthropo, bateau, edgar
-      DATA anthropo,bateau,edgar/.true.,.true.,.true./
-c
-cc bc_source
-      INTEGER kminbc, kmaxbc
-      PARAMETER (kminbc=3, kmaxbc=5)
-c
-      REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
-c
-c JE for updating in  cltrac
-      REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
-      REAL,DIMENSION(klon,nbtr)       :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-      REAL,DIMENSION(klon,nbtr)        ::  flux_tr_dry
-c      SAVE  d_tr_dry
-c JE for include gas to particle conversion in output
-      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
-      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
-c
-      INTEGER iflag_conv
-
-c======================================================================
-c   INITIALISATIONS
-c======================================================================
-c
-c---fraction of tracer that is convected (??
-      xconv(1)=0.8
-      xconv(2)=0.5
-      xconv(3)=0.5
-      xconv(4)=0.6
-
-      masse(1)=32.
-      masse(2)=6.02e23
-      masse(3)=6.02e23
-      masse(4)=6.02e23 
-
-      henry= (/1.4, 0.0, 0.0, 0.0/)
-      kk = (/2900., 0., 0., 0./)
-      alpha_r =  (/0., 0.001, 0.001, 0.001/)
-      alpha_s = (/0., 0.01, 0.01, 0.01/)
-
-c nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-c nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-      vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
-      vdep_sic = (/0.2, 0.17, 1.2, 1.2/)     
-      vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
-      vdep_lic = (/0.2, 0.17, 1.2, 1.2/)      
-
-
-
-      lmt_dms(:)=0.0
-      aux_var2(:)=0.0
-      aux_var3(:,:)=0.0
-      source_tr(:,:)=0.0
-      flux_tr(:,:)=0.0
-      flux_sparam_bb(:)=0.0
-      flux_sparam_ff(:)=0.0
-      flux_sparam_ind(:)=0.0
-      flux_sparam_ddfine(:)=0.0
-      flux_sparam_ddcoa(:)=0.0
-      flux_sparam_ssfine(:)=0.0
-      flux_sparam_sscoa(:)=0.0
-      
-      d_tr_dry(:,:)=0.0
-      flux_tr_dry(:,:)=0.0
-!
-      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
-      RG = 9.80665
-      RNAVO =6.02e23
-      RLVTT=2.5008E+6
-      RLSTT=2.8345E+6
-      R4IES=7.66
-      R3IES=21.875
-      R4LES=35.86
-      R3LES=17.269
-      RTT=273.16
-      RMV=18.0153
-      RKBOL=1.380658E-23
-      R=RNAVO*RKBOL
-      R5LES=R3LES*(RTT-R4LES)
-      R5IES=R3IES*(RTT-R4IES)
-      RV=1000.*R/RMV
-      RCPV=4.*RV
-      RCPD=3.5*RD
-      RVTMP2=RCPV/RCPD-1
-      RETV=RV/RD-1.
-
-c
-      if (debutphy) then
-         print *, 'let s check nbtr=', nbtr
-         print *, 'xlat and xlon'
-c JE   initializon to cero the tracers     
-         DO it=1, nbtr
-            tr_seri(:,:,it)=0.0
-         ENDDO
-c JE end     
-! Initializing to zero tr_seri for comparison purposes
-!        tr_seri(:,:,:)=0.0
-c
-!        DO it=1,nbtr
-!           trm_aux(it)=0.0
-!           src_aux(it)=0.0
-!           diag_trm(it)=0.0
-!           diag_drydep(it)=0.0
-!           diag_wetdep(it)=0.0
-!           diag_cvtdep(it)=0.0
-!           diag_emissn(it)=0.0
-!        ENDDO
-!        diag_g2part=0.0
-         print *,'PREPARE FILES TO SAVE VARIABLES'
-c
-         nbjour=30
-         ecrit_tra =   NINT(86400./pdtphys)                    !--1-day  average
-         ecrit_tra_h = NINT(86400./pdtphys*0.25)               !--6-hour average
-         ecrit_tra_m = NINT(86400./pdtphys*FLOAT(nbjour))      !--1-mth  average
-         print *,'ecrit_tra=', pdtphys, ecrit_tra
-
-         IF (ok_histrac) THEN
-  
-           itra=0
-c
-           CALL ymds2ju(1900, 1, 1, 0.0, zjulian)
-c
-           print *, 'klon,iim,jjm+1 = ',klon,iim,jjm+1
-           CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlon,zx_lon)
-c
-           DO i = 1, iim
-             zx_lon(i,1) = xlon(i+1)
-             zx_lon(i,jjm+1) = xlon(i+1)
-           ENDDO
-c
-           CALL histbeg("histrac_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori1, nid_tra1)
-c
-           CALL histbeg("lessivage_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori2, nid_tra2)
-c
-           CALL histbeg("traceur_spl", iim,zx_lon, jjm+1,zx_lat,
-     .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
-     .                 nhori3, nid_tra3)
-c
-           CALL histvert(nid_tra1, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra2, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           CALL histvert(nid_tra3, "presnivs", "Vertical levels", "mb",
-     .                 klev, presnivs, nvert)
-c
-           zsto = pdtphys
-           zout = pdtphys * FLOAT(ecrit_tra)
-           zout_h = pdtphys * FLOAT(ecrit_tra_h)
-           zout_m = pdtphys * FLOAT(ecrit_tra_m)
-           print *,'zsto zout=', zsto, zout
-
-c
-c----------------- HISTORY FILES OF TRACER EMISSIONS -------------------
-c
-c HISTRAC
-c
-           CALL histdef(nid_tra1, "fluxbb", "Flux BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxff", "Flux FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcbb", "Flux BC-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcff", "Flux BC-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcnff", "Flux BC-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbcba", "Flux BC-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxbc", "Flux BC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxombb", "Flux OM-BB", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomff", "Flux OM-FF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnff", "Flux OM-NFF", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomba", "Flux OM-BA", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxomnat", "Flux OM-NT", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxom", "Flux OM", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sff","Flux H2S FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2snff","Flux H2S non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2ff","Flux SO2 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2nff","Flux SO2 non-FF",
-     .                  "mgS/m2/s",iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2bb", "Flux SO2 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso2vol","Flux SO2 Vol","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2ba", "Flux SO2 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso2", "Flux SO2","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4ff","Flux SO4 FF","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxso4nff","Flux SO4 non-FF",
-     .                  "mgS/m2/s", iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4bb", "Flux SO4 BB","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4ba", "Flux SO4 Ba","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxso4", "Flux SO4","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdms", "Flux DMS", "mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxh2sbio","Flux H2S Bio","mgS/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1, "fluxdustec", 
-     .                                 "Flux Dust EC", "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddfine","DD Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxddcoa","DD Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxdd","Flux DD","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxssfine","SS Fine Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxsscoa","SS Coarse Mode","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"fluxss","Flux SS","mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"fluxso4chem","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ind","Ind emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_bb","BB emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ff","FF emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddfine","DD fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ddcoa","DD coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_ssfine","SS fine emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"flux_sparam_sscoa","SS coarse emiss",
-     .                  "mg/m2/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"u10m","Zonal wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra1,"v10m","Meridional wind at 10 m",
-     .                  "m/s",
-     .                  iim,jjm+1,nhori1, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-cnhl           CALL histdef(nid_tra1,"flux_sparam_sulf","SO4 chem prod",
-cnhl     .                  "gAer/kgAir",
-cnhl     .                  iim,jjm+1,nhori1, klev,1,klev,nvert, 32,
-cnhl     .                  "ave(X)", zsto,zout)
-c
-c TRACEUR
-c
-           CALL histdef(nid_tra3, "taue550", "Tau ext 550", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670", "Tau ext 670", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865", "Tau ext 865", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_tr2", "Tau ext 550tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_tr2", "Tau ext 670tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_tr2", "Tau ext 865tr2", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_ss", "Tau ext 550ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_ss", "Tau ext 670ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_ss", "Tau ext 865ss", " ",
-     .                  iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue550_dust", "Tau ext 550dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue670_dust", "Tau ext 670dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "taue865_dust", "Tau ext 865dust", " "
-     .                  ,iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-           DO it=1, nbtr
-c
-           WRITE(str2,'(i2.2)') it
-c
-           CALL histdef(nid_tra3, "trm"//str2, "Burden No."//str2, 
-     .                  "mgS/m2", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra3, "sconc"//str2, "Surf Conc. No."//str2,
-     .                  "mg/m3", iim,jjm+1,nhori3, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c LESSIVAGE
-c
-           CALL histdef(nid_tra2, "flux"//str2, "emission"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "ds"//str2, "Depot sec No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dh"//str2,
-     .                  "Depot hum No."//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2,"dtrconv"//str2,
-     .                  "Tiedke convective"//str2, 
-     .                  "mgS/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-
-
-
-c
-           ENDDO
-c
-           CALL histdef(nid_tra2, "sed_ss", "Sedmet. Tr3", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "sed_dust", "Sedmet. Tr4", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)         
-c
-           CALL histdef(nid_tra2, "g2p_gas", "Gas2particle gas sink", 
-     .                  "mg-S/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-           CALL histdef(nid_tra2, "g2p_aer", "Gas2particle tr2 src", 
-     .                  "mg/m2/s", iim,jjm+1,nhori2, 1,1,1, -99, 32,
-     .                  "ave(X)", zsto,zout)
-c
-c--------------------------------------------------------------------
-c
-           CALL histend(nid_tra1)
-c
-           CALL histend(nid_tra2)
-c
-           CALL histend(nid_tra3)
-c
-c--------------------------------------------------------------------
-
-!        nbjour=1
-         ENDIF !--ok_histrac
-
-c
-!        IF (.NOT.edgar.AND.bateau) THEN
-!        PRINT *,'ATTENTION risque de compter double les bateaux'
-!        STOP
-!        ENDIF
-c
-c
-c
-      endif ! debutphy
-c
-c======================================================================
-c Initialisations
-c======================================================================
-c
-c
-c je  KE init
-      IF (debutphy) THEN
-        ALLOCATE(d_tr_cv(klon,klev,nbtr))
-        ALLOCATE(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_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))
-
-
-
-!
-!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  = 4
-!Config
-        !$OMP MASTER
-        iflag_lscav_omp=4
-        call getin('iflag_lscav', iflag_lscav_omp)
-        !$OMP END MASTER
-        !$OMP BARRIER
-        iflag_lscav=iflag_lscav_omp
-        !
-
-
-
-
-
-       ENDIF
-      
-       DO k=1,klev
-        DO i=1,klon
-         Mint(i,k)=0.
-        END DO
-       END DO
-
-
-c
-      DO it=1, nbtr
-       DO k=1,klev
-        DO i=1,klon
-         d_tr_cv(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(i,k,it)=0.
-         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.
-  
-
-
-         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 it=1, nbtr
-       DO i=1,klon
-          qPrls(i,it)=0.0
-          dtrconv(i,it)=0.0
-       ENDDO
-      ENDDO
-
-      DO it=1, nbtr
-      DO i=1, klon 
-        his_dhlsc(i,it)=0.0
-        his_dhcon(i,it)=0.0
-        his_dhbclsc(i,it)=0.0
-        his_dhbccon(i,it)=0.0
-        trm(i,it)=0.0
-      ENDDO
-      ENDDO
-cJE:      
-      DO i=1, klon 
-         his_g2pgas(i) = 0.0
-         his_g2paer(i) = 0.0
-      ENDDO
-c endJE
-c
-
-      DO k=1, klev
-      DO i = 1, klon
-        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
-        zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/RG
-      ENDDO
-      ENDDO
-c
-      DO i = 1, klon
-        zalt(i,1)=pphis(i)/RG
-      ENDDO
-      DO k=1, klev-1
-      DO i = 1, klon
-        zalt(i,k+1)=zalt(i,k)+zdz(i,k)
-      ENDDO
-      ENDDO
-
-c
-c======================================================================
-c Initialisations of Scaling Parameters
-c======================================================================
-C
-C ----------------------------- SO4 -----------------------------------
-C
-c      scale_param_so4(1)=scale_param_sulf(1)
-c      scale_param_so4(klon)=scale_param_sulf(jjm+1)
-                  
-c      DO j = 2, jjm
-c        DO i = 1, iim
-c          ig=iim*(j-2)+i+1
-c          scale_param_so4(ig)=scale_param_sulf(j)
-c        ENDDO
-c      ENDDO
-C
-C ----------------------- SO2, BC & OM --------------------------------
-C ----------------FOSSIL FUEL AND INUDSTRIAL EMISSIONS-----------------
-      iregion_dust(:)=-999
-      iregion_ind(:)=-999
-      iregion_bb(:)=-999
-! READING BB MASK
-!     c_Directory='/ccc/work/cont003/dsm/nhuneeus/REGION_MASK/'
-      c_Directory='/d6/jelmd/LMDZ_INPUT/REGION_MASK/'
-!      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c JE por v2      c_FileName1='GFED_phyBBmask_lowres.txt'
-c JE por v2      c_FileName2='Country_phyFFandSO2mask_lowres.txt'
-c      c_FileName1='GFED_phyBBmask_lowres_v2.txt'
-c      c_FileName2='Country_phyFFandSO2mask_lowres_v2.txt'
-       c_FileName1='GFED_phyBBmask_lowres_je48x36.txt'
-       c_FileName2='Country_phyFFandSO2mask_lowres_je48x36.txt'
-      c_FullName1=c_Directory//c_FileName1
-      c_FullName2=c_Directory//c_FileName2
-      print *,'BB mask NL = ',c_FullName1
-!
-      OPEN (UNIT=1,FILE=c_FullName1)
-      OPEN (UNIT=111,FILE=c_FullName2)
-      DO j=1,klon
-!         print *, j, klon
-         aux_mask1=0
-         aux_mask2=0
-         READ(1,102) aux_mask1
-!         mask_BBreg(j)=aux_mask1
-         iregion_bb(j)=aux_mask1
-         READ(111,102) aux_mask2
-!         print *,'aux_mask1, aux_mask2
-!     .    =',aux_mask1,aux_mask2,INT(aux_mask1),INT(aux_mask2)
-!         mask_ffso2reg(j)=aux_mask2
-         iregion_ind(j)=aux_mask2
-      ENDDO
-      CLOSE (UNIT=1)
-      CLOSE (UNIT=111)
-!
-      OPEN(25,FILE='dustregions_pyvar.data')
-      OPEN(55,FILE='indregions_pyvar.data')
-      OPEN(75,FILE='bbregions_pyvar.data')
-
-
-      DO i = 1, klon
-C ----------------------- SO2, BC & OM ---------------------------------
-C -----------------------BIOMASS BURNING--------------------------------
-C ------------------------------- DUST ---------------------------------
-C
-        IF ((xlat(i).GT.11).AND.(xlon(i).LT.-85)) THEN
-c NORTH WEST AMERICA = 1
-          iregion_dust(i)=1
-        ELSEIF ((xlat(i).LE.11).AND.(xlon(i).LT.-25)) THEN
-c SOUTH AMERICA = 2
-          iregion_dust(i)=2      
-        ELSEIF ((xlat(i).GE.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.14)) THEN
-c WEST SAHARA = 3
-          iregion_dust(i)=3
-        ELSEIF ((xlat(i).GT.-1.75*xlon(i)+89).AND.
-     .       (xlat(i).GT.0.524*xlon(i)-11.048).AND.
-     .       (xlat(i).LT.-0.464*xlon(i)+53.179).AND.
-     .       (xlat(i).LT.36)) THEN
-c SAUDI ARABIA = 9
-          iregion_dust(i)=9
-        ELSEIF ((xlat(i).LT.11).AND.(xlon(i).GE.-25).AND.
-     .       (xlon(i).LE.77)) THEN
-c AFRICA SUB-SAHARA = 5
-          iregion_dust(i)=5
-        ELSEIF ((xlon(i).GT.77).AND.(xlat(i).LT.-5)) THEN
-c AUSTRALIA = 8
-          iregion_dust(i)=8
-        ELSEIF ((xlon(i).GE.77).AND.(xlat(i).GE.-5)) THEN
-c ASIA EAST = 6  REGION ADDED 
-          iregion_dust(i)=6
-        ELSEIF (xlat(i).GT.11.AND.xlon(i).GE.-85.AND.
-     .          xlon(i).LT.-25) THEN
-c NORTH EAST AMERICA = 11
-          iregion_dust(i)=11
-        ELSEIF ((xlon(i).LT.77).AND.(xlat(i).LT.36).AND.
-     .       (xlat(i).GE.11).AND.
-     .       (xlat(i).GT.-0.464*xlon(i)+53.179).OR.
-     .       (xlat(i).LT.0.524*xlon(i)-11.048)) THEN 
-c INDIAN SUBCONTINENT
-          iregion_dust(i)=10
-        ELSEIF ((xlon(i).GT.33).AND.(xlon(i).LT.77).AND.
-     .       (xlat(i).GE.36)) THEN
-c ASIA WEST = 7
-          iregion_dust(i)=7
-        ELSEIF ((xlat(i).GE.11).AND.
-     .       (xlon(i).GT.14).AND.
-     .       (xlat(i).LT.-1.75*xlon(i)+89).OR.xlon(i).LE.33) THEN
-c EAST SAHARA = 4
-          iregion_dust(i)=4
-        ENDIF
-
-c       WRITTING REGIONS INTO FILE
-        IF (iregion_dust(i).LT.10) THEN
-          WRITE (25,101) iregion_dust(i)
-        ELSE
-          WRITE (25,102) iregion_dust(i)
-        ENDIF
-        WRITE (55,*) iregion_ind(i)
-        WRITE (75,*) iregion_bb(i)
-!        WRITE (55,102) iregion_ind(i)
-!        WRITE (75,102) iregion_bb(i)
-
-      ENDDO
-!      print *,'NEW DUST REGION, NOW 11 REGIONS!'
-      CLOSE(25)
-      CLOSE(55)
-      CLOSE(75)
-  101 FORMAT (i1)
-  102 FORMAT (i2)
-!      stop
-c
-c=======================================================================
-c SAVING SURFACE TYPE
-c=======================================================================
-      OPEN(35,FILE='surface_ocean.data')
-      OPEN(45,FILE='surface_seaice.data')
-      OPEN(65,FILE='surface_land.data')
-      OPEN(85,FILE='surface_landice.data')
-      DO i = 1, klon
-         WRITE (35,103) pctsrf(i,is_oce)
-         WRITE (45,103) pctsrf(i,is_sic)
-         WRITE (65,103) pctsrf(i,is_ter)
-         WRITE (85,103) pctsrf(i,is_lic)
-      ENDDO
-      CLOSE(35)
-      CLOSE(45)
-      CLOSE(65)
-      CLOSE(85)
-  103 FORMAT (f6.2)
-!      stop
-c
-c=======================================================================
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-
-
-!        DO it=1, nbtr   
-!           CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,
-!     . 'after kg_to_cm3')
-!        ENDDO
-c=======================================================================
-c
-      DO k=1, klev
-      DO i=1, klon
-        m_conc(i,k)=pplay(i,k)/t_seri(i,k)/RKBOL*1.e-6
-      ENDDO
-      ENDDO
-
-!
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_avt_coarem')
-        ENDDO        
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'avt coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: avt coarem')
-      ENDIF
-c
-c
-c=======================================================================
-c                     EMISSIONS OF COARSE AEROSOLS
-c=======================================================================
-c      
-c      PRINT *, 'DUST EMISSION VALUES FOR REAGION EAST ASIA'
-c      DO i=1, klon
-c        IF ((xlon(i).GT.105).AND.(xlat(i).GE.-5)) THEN
-c           print *, 'DUST_EC,LON,LAT = ',dust_ec(i),xlon(i),xlat(i)
-c        ENDIF
-c      ENDDO
-      print *,'Number of tracers = ',nbtr
-
-      print *,'AT BEGINNING OF PHYTRACR_SPL'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
-
-      CALL coarsemission(pctsrf,pdtphys,t_seri,
-     .                   pmflxr,pmflxs,prfl,psfl,
-     .                   scale_param_ssacc,scale_param_sscoa,
-     .                   scale_param_dustacc,scale_param_dustcoa,
-     .                   iregion_dust,dust_ec,
-     .                   lmt_sea_salt,qmin,qmax,
-     .                             flux_sparam_ddfine,flux_sparam_ddcoa,
-     .                             flux_sparam_ssfine,flux_sparam_sscoa,
-     .                                                source_tr,flux_tr)
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_coarem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after coarem')
-      ENDIF
-
-c
-c
-c
-c======================================================================
-c                   EMISSIONS OF AEROSOL PRECURSORS      
-c======================================================================
-c
-      print *,'INPUT TO PRECUREMISSION'
-
-      CALL precuremission(ftsol,u10m_ec,v10m_ec,pctsrf,
-     .                    u_seri,v_seri,paprs,pplay,cdragh,cdragm,
-     .                    t_seri,q_seri,tsol,fracso2emis,frach2sofso2,
-     .                    bateau,zdz,zalt,kminbc,kmaxbc,pdtphys,
-     .                    scale_param_bb,scale_param_ind,
-     .                    iregion_ind, iregion_bb,
-     .                    lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba,
-     .                    lmt_so2bb_l,lmt_so2bb_h,
-     .                    lmt_so2volc_cont,lmt_altvolc_cont,
-     .                    lmt_so2volc_expl,lmt_altvolc_expl,
-     .                    lmt_dmsbio,lmt_h2sbio, lmt_dmsconc, lmt_dms,
-     .                                  flux_sparam_ind, flux_sparam_bb,
-     .                                  source_tr,flux_tr,tr_seri)
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after precur')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after precur')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after precur')
-      ENDIF
-
-c
-c
-c=======================================================================
-c                      EMISSIONS OF FINE AEROSOLS
-c=======================================================================
-c
-      CALL finemission(zdz,pdtphys,zalt,kminbc,kmaxbc,
-     .                 scale_param_bb,scale_param_ff,
-     .                 iregion_ind,iregion_bb,
-     .                 lmt_bcff, lmt_bcnff, lmt_bcbb_l,lmt_bcbb_h,
-     .                 lmt_bcba, lmt_omff, lmt_omnff,
-     .                 lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba,
-     .                                  flux_sparam_bb, flux_sparam_ff,
-     .                                        source_tr,flux_tr,tr_seri)
-c
-!
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_fineem')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after fineem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after fineem')
-      ENDIF
-c
-c=======================================================================
-c                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
-c=======================================================================
-c
-
-!======================================================================
-!    -- Dry deposition --
-!======================================================================
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before depo')
-      ENDIF
-
-
-
-      CALL deposition(vdep_oce,vdep_sic,vdep_ter,vdep_lic,pctsrf,
-     .                zrho,zdz,pdtphys,RHcl,masse,t_seri,pplay,paprs,
-     .                lminmax,qmin,qmax,
-     .                         his_ds,source_tr,tr_seri)
-c
-
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_depo')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after depo')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after depo')
-      ENDIF
-
-c
-!======================================================================
-!    -- Calcul de l'effet des thermiques for KE--
-!======================================================================
-
-      IF (iflag_conv.GE.3) THEN
-      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
-!
-       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(1:klon,1:klev,it),ztra_th)
- 
-            DO k=1,klev
-               DO i=1,klon
-                  d_tr(i,k,it)=pdtphys*d_tr(i,k,it)/nsplit
-                  d_tr_th(i,k,it)=d_tr_th(i,k,it)+d_tr(i,k,it)
-                  tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr(i,k,it),0.)
-               END DO
-            END DO
-         END DO ! nsplit1
-      END DO ! it
-      ENDIF ! KE
-
-
-
-
-
-!======================================================================
-!    -- Boundary layer mixing --
-!======================================================================
-
-c
-
-       DO k = 1, klev
-        DO i = 1, klon
-         delp(i,k) = paprs(i,k)-paprs(i,k+1)
-        END DO
-      END DO
-
-c
-      DO it=1, nbtr
-c      print *,' BEFORE Cltrac'
-c      print *,'tr_seri = ',SUM(tr_seri(:,:,it)),MINVAL(tr_seri(:,:,it)),
-c     .                                         MAXVAL(tr_seri(:,:,it))
-c
-      DO j=1, klev
-      DO i=1, klon
-        tmp_var(i,j)=tr_seri(i,j,it)
-        aux_var2(i)=source_tr(i,it)
-      ENDDO
-      ENDDO
-
-! JEnew : to uopdate to the new cltrac     
-
-      IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL cltrac_spl(pdtphys,coefh,yu1,yv1,t_seri,tmp_var,
-     .            aux_var2,paprs,pplay,aux_var3)
-
-      ELSE IF (iflag_conv.GE.3) THEN
-!KE
-    
-
-      CALL cltrac(pdtphys, coefh,t_seri,tmp_var,aux_var2,paprs,pplay,
-     .            delp,aux_var3,d_tr_dry,flux_tr_dry(:,it))
-      ENDIF
- 
-! Je new end
-
-      DO i=1, klon
-      DO j=1, klev
-        tr_seri(i,j,it)=tmp_var(i,j)
-        d_tr(i,j,it)=aux_var3(i,j)
-      ENDDO
-      ENDDO
-      DO k = 1, klev
-      DO i = 1, klon
-         tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr(i,k,it)
-      ENDDO
-      ENDDO
-      print *,' AFTER Cltrac'
-      IF (lminmax) THEN
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after cltrac')
-      ENDIF
-c
-      DO j=1,klev
-      DO i=1,klon
-         tmp_var(i,j)=tr_seri(i,j,it)
-      ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay,t_seri,tmp_var)
-      DO j=1,klev
-      DO i=1,klon
-         tr_seri(i,j,it)=tmp_var(i,j)
-      ENDDO
-      ENDDO
-c
-      ENDDO !--end itr loop
-
-c
-      print *,' BEFORE Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before sedi')
-      ENDIF
-
-      print *,'SPLA VERSION OF SEDIMENTATION IS USED'
-      CALL sediment_mod(t_seri,pplay,zrho,paprs,pdtphys,RHcl,!xlon,xlat,
-     .                               sed_ss,sed_dust,tr_seri)
-c
-      print *,'AFTER Sediment'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_sedi')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after sedi')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after sedi')
-      ENDIF
-c
-
-c
-c=======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-c
-c======================================================================
-c                      GAS TO PARTICLE CONVERSION      
-c======================================================================
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_beforegastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before gastopar')
-      ENDIF
-
-
-
-      CALL gastoparticle(pdtphys,zdz,zrho,xlat,
-     .              pplay,t_seri,
-     .              tr_seri,his_g2pgas ,his_g2paer) 
-c
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_gastopar')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after gastopar')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after gastopar')
-      ENDIF
-c
-c======================================================================
-c                        EFFECT OF PRECIPITATION
-c======================================================================
-c
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-c
-
-      print *,'iflag_conv bef lessiv',iflag_conv
-      IF (lessivage) THEN
-c
-      print *,' BEFORE Incloud'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_incloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before incloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before incloud')
-      ENDIF
-
-
-!      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-      print *,'iflag_conv bef incloud',iflag_conv
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-      CALL incloud_scav(.false.,qmin,qmax,masse,henry,kk,prfl,
-     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-     .                                     his_dhlsc,his_dhcon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL incloud_scav_lsc(.false.,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-!--------------------------------------------------------------
-
-        ENDIF
-c
-c
-      print *,' BEFORE blcloud (after incloud)'
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_blcloud')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before blcloud')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before blcloud')
-      ENDIF
-
-!      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-
-      CALL blcloud_scav(.false.,qmin,qmax,pdtphys,prfl,psfl,
-     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL blcloud_scav_lsc(.false.,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-!
-!----------------------------------------------------------------------
-        ENDIF
-
-
-      print *,' AFTER blcloud '
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_blcloud')
-        ENDDO                           
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after blcloud')
-        ENDDO                                  
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after blcloud')
-      ENDIF
-
-
-      ENDIF !--lessivage
-c
-c
-c======================================================================
-c                         EFFECT OF CONVECTION 
-c======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-      IF (convection) THEN
-c
-      print *,' BEFORE trconvect'
-
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_trconve')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before trconve')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before trconve')
-      ENDIF
-
-
-! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-!     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
-!     .                                                 dtrconv,tr_seri)
-! -------------------------------------------------------------     
-        IF (iflag_conv.EQ.2) THEN
-! Tiedke
-         CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,.false.,masse,
-     .                                                 dtrconv,tr_seri)
-         DO it=1, nbtr
-           d_tr_cv(:,:,it)=0.
-         ENDDO
-
-        ELSE IF (iflag_conv.GE.3) THEN
-! KE
-         print *,'JE: KE in phytracr_spl'
-
-
-         DO it=1, nbtr
-             DO k = 1, klev
-              DO i = 1, klon
-               tmp_var3(i,k,it)=tr_seri(i,k,it)!/1000. ! change mg/kg to g/kg
-              END DO
-             END DO
-         ENDDO
-
-         DO it=1, nbtr
-!          routine for aerosols . otherwise, check cvltrorig
-         print *,'Check sum before cvltr it',it,SUM(tr_seri(:,:,it))
-           CALL cvltr_spl(pdtphys, da, phi,phi2,d1a,dam, mp,ep,
-     .       sigd,sij,clw,elij,epmlmMm,eplaMm,
-     .       pmflxr,pmflxs,evap,t_seri,wdtrainA,wdtrainM,
-!     .       paprs,it,tr_seri,upwd,dnwd,itop_con,ibas_con,
-     .       paprs,it,tmp_var3,upwd,dnwd,itop_con,ibas_con,
-     .       henry,kk,zrho,
-     .       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)
-!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-
-!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
-!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
-!     .               upwd,dnwd,d_tr_cv)
-             DO k = 1, klev
-              DO i = 1, klon
-!               tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr_cv(i,k,it)
-               tr_seri(i,k,it)=(tmp_var3(i,k,it)+d_tr_cv(i,k,it))!*1000.
-               tmp_var(i,k)=d_tr_cv(i,k,it)!*1000. ! back to mg/kg
-
-              END DO
-             END DO
-
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-
-             DO k = 1, klev
-              DO i = 1, klon
-               dtrconv(i,it)=dtrconv(i,it)+tmp_var(i,k)
-     .                /RNAVO*masse(it)*1.e3*1.e6*zdz(i,k)/pdtphys
-              END DO
-             END DO
-         print *,'Check sum after cvltr it',it,SUM(tr_seri(:,:,it))
-        CALL minmaxqfi2(d_tr_cv(:,:,it),qmin,qmax,'d_tr_cv:')
-        CALL minmaxqfi2(d_tr_trsp(:,:,it),qmin,qmax,'d_tr_trsp:')
-        CALL minmaxqfi2(d_tr_sscav(:,:,it),qmin,qmax,'d_tr_sscav:')
-        CALL minmaxqfi2(d_tr_sat(:,:,it),qmin,qmax,'d_tr_sat:')
-        CALL minmaxqfi2(d_tr_uscav(:,:,it),qmin,qmax,'d_tr_uscav:')
-
-         ENDDO ! it=1,nbtr
-        ENDIF ! iflag_conv
-        IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after trconv')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-
-
-!  -----------------------------------------------------------
-! end JE desactiva trconvect
-      print *,' AFTER Trconvect'
-      IF (lminmax) THEN
-        DO it=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after trconv')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-c
-c
-      ENDIF ! convection
-c
-c
-c=======================================================================
-c      LARGE SCALE SCAVENGING KE
-c=======================================================================
-c     
-
-       IF (iflag_conv.GE.3) THEN
-
-       print *,' BEFORE lsc_scav '
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_before_lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'before lsc_scav')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before lsc_scav')
-      ENDIF
-
-
-
-       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
-
-       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
-c        CALL minmaxqfi(tr_seri(:,:,it),0.,1.e33,
-c     .                'lsc scav it ='//solsym(it))
-       END DO  !tr
-      ELSE
-        print *,'WARNING: NO lsc_scav, Please choose iflag_lscav=3 or 4'
-       ENDIF !iflag_lscav
-
-       print *,' AFTER lsc_scav '
-       IF (lminmax) THEN
-        DO it=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,it),qmin,qmax,'nan_after_lsc_scav')
-        ENDDO
-        DO it=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,it),qmin,qmax,'after lsc_scav')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after lsc_scav')
-      ENDIF
-
-
-      ENDIF !iflag_conv
-
- 
-c=======================================================================
-c                         COMPUTING THE BURDEN
-c=======================================================================
-c      
-      DO it=1, nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-c
-c Computing burden in mg/m2
-      DO it=1, nbtr
-      DO k=1, klev
-      DO i=1, klon
-        trm(i,it)=trm(i,it)+tr_seri(i,k,it)*1.e6*zdz(i,k)*
-     .            masse(it)*1.e3/RNAVO     !--mg S/m2
-      ENDDO
-      ENDDO
-      ENDDO
-c
-c Computing Surface concentration in ug/m3
-c
-      DO it=1, nbtr
-      DO i=1, klon
-        sconc_seri(i,it)=tr_seri(i,1,it)*1.e6*
-     .            masse(it)*1.e3/RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
-      ENDDO
-      ENDDO
-c
-c=======================================================================
-c                  CALCULATION OF OPTICAL PROPERTIES
-c=======================================================================
-c      
-      CALL aeropt_spl(zdz, tr_seri, RHcl,
-     .               diff_aod550_tot,diag_aod670_tot,diag_aod865_tot,
-     .               diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2,
-     .               diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,
-     .               diag_aod550_dust,diag_aod670_dust,diag_aod865_dust)
-c
-c======================================================================
-c   Stockage sur bande histoire
-c======================================================================
-c
-      DO it=1, nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,it)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,it)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-c
-c
-c======================================================================
-c  SAVING AEROSOL RELATED VARIABLES INTO FILE
-c======================================================================
-c
-      IF (ok_histrac) THEN
-c
-      ndex2d = 0
-      ndex3d = 0 
-c
-      itra=itra+1
-
-      print *,'SAVING VARIABLES FOR DAY ',itra
-c
-      fluxbb(:)=0.0
-      fluxff(:)=0.0
-      fluxbcbb(:)=0.0
-      fluxbcff(:)=0.0
-      fluxbcnff(:)=0.0
-      fluxbcba(:)=0.0
-      fluxbc(:)=0.0
-      fluxombb(:)=0.0
-      fluxomff(:)=0.0
-      fluxomnat(:)=0.0
-      fluxomba(:)=0.0
-      fluxomnff(:)=0.0
-      fluxom(:)=0.0
-      fluxh2sff(:)=0.0
-      fluxh2snff(:)=0.0
-      fluxh2sbio(:)=0.0
-      fluxso2ff(:)=0.0
-      fluxso2nff(:)=0.0
-      fluxso2bb(:)=0.0
-      fluxso2vol(:)=0.0
-      fluxso2ba(:)=0.0
-      fluxso2(:)=0.0
-      fluxso4ff(:)=0.0
-      fluxso4nff(:)=0.0
-      fluxso4bb(:)=0.0
-      fluxso4ba(:)=0.0
-      fluxso4(:)=0.0
-      fluxdms(:)=0.0
-      fluxdustec(:)=0.0
-      fluxddfine(:)=0.0
-      fluxddcoa(:)=0.0
-      fluxdd(:)=0.0
-      fluxssfine(:)=0.0
-      fluxsscoa(:)=0.0
-      fluxss(:)=0.0
-      DO i=1, klon
-         IF (iregion_ind(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxh2sff(i)= (lmt_so2ff_l(i)+lmt_so2ff_h(i))*frach2sofso2*
-     .                    scale_param_ind(iregion_ind(i))*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-           fluxso2ff(i)=scale_param_ind(iregion_ind(i)) * fracso2emis *
-     .                   (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4ff(i)=scale_param_ind(iregion_ind(i))*(1-fracso2emis)*
-     .                    (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcff(i)=scale_param_ff(iregion_ind(i))*
-     .                                        lmt_bcff(i)*1.e4*1.e3  !/g/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxomff(i)=scale_param_ff(iregion_ind(i))*
-     .                          (lmt_omff(i))*1.e4*1.e3  !/g/m2/s
-           ! FOSSIL FUEL EMISSIONS
-           fluxff(i)=fluxbcff(i)+fluxomff(i)
-         ENDIF
-         IF (iregion_bb(i).GT.0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxso2bb(i) =scale_param_bb(iregion_bb(i)) * fracso2emis *
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4bb(i) =scale_param_bb(iregion_bb(i))*(1-fracso2emis)*
-     .                 (lmt_so2bb_l(i)+lmt_so2bb_h(i))*
-     .           (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcbb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_bcbb_l(i)+lmt_bcbb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxombb(i)=scale_param_bb(iregion_bb(i))*
-     .                      (lmt_ombb_l(i)+lmt_ombb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! BIOMASS BURNING EMISSIONS
-           fluxbb(i)=fluxbcbb(i)+fluxombb(i)
-         ENDIF
-         ! H2S EMISSIONS
-         fluxh2sbio(i)=lmt_h2sbio(i)*1.e4/RNAVO*masse_s*1.e3      ! mgS/m2/s
-         fluxh2snff(i)= lmt_so2nff(i)*frach2sofso2*
-     .                               1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-         ! SULFUR DIOXIDE EMISSIONS
-         fluxso2nff(i)=fracso2emis * lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso2vol(i)=(lmt_so2volc_cont(i)+lmt_so2volc_expl(i))
-     .                 *1.e4/RNAVO*masse_s*1.e3        ! mgS/m2/s
-         fluxso2ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3*
-     .                                                   fracso2emis ! mgS/m2/s
-         fluxso2(i)=fluxso2ff(i)+fluxso2bb(i)+fluxso2nff(i)+
-     .              fluxso2vol(i)+fluxso2ba(i)
-         ! DMS EMISSIONS
-         fluxdms(i)=( lmt_dms(i)+lmt_dmsbio(i) )
-     .              *1.e4/RNAVO*masse_s*1.e3          ! mgS/m2/s
-         ! SULPHATE EMISSIONS
-         fluxso4ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3
-     .                 *(1-fracso2emis) ! mgS/m2/s
-         fluxso4nff(i)=(1-fracso2emis)*lmt_so2nff(i) * 1.e4/RNAVO *
-     .                                               masse_s * 1.e3  ! mgS/m2/s
-         fluxso4(i)=fluxso4ff(i)+fluxso4bb(i)+fluxso4ba(i)+fluxso4nff(i)
-         ! BLACK CARBON EMISSIONS
-
-         fluxbcnff(i)=lmt_bcnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxbcba(i)=lmt_bcba(i)*1.e4*1.e3    !mg/m2/s
-         fluxbc(i)=fluxbcbb(i)+fluxbcff(i)+fluxbcnff(i)+fluxbcba(i)
-         ! ORGANIC MATTER EMISSIONS
-         fluxomnat(i)=lmt_omnat(i)*1.e4*1.e3  !mg/m2/s
-         fluxomba(i)=lmt_omba(i)*1.e4*1.e3  !mg/m2/s
-         fluxomnff(i)=lmt_omnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxom(i)=fluxombb(i)+fluxomff(i)+fluxomnat(i)+fluxomba(i)+
-     .             fluxomnff(i)
-        ! DUST EMISSIONS 
-         fluxdustec(i)=dust_ec(i)*1.e6
-         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
-     .                                  * dust_ec(i)*0.093*1.e6
-         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
-     .                                  * dust_ec(i)*0.905*1.e6
-         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
-        ! SEA SALT EMISSIONS 
-         fluxssfine(i)=scale_param_ssacc*lmt_sea_salt(i,1)*1.e4*1.e3
-         fluxsscoa(i)=scale_param_sscoa*lmt_sea_salt(i,2)*1.e4*1.e3
-         fluxss(i)=fluxssfine(i)+fluxsscoa(i)
-      ENDDO
-c
-c SAVING VARIABLES IN TRACEUR
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tot,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diff_aod550_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_tr2,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_tr2",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_ss",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod550_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue550_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod670_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue670_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1, klon,iim,jjm+1, diag_aod865_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra3,"taue865_dust",itra,zx_tmp_2d,
-     .                                 iim*(jjm+1),ndex2d)
-c     
-      DO it=1,nbtr
-c
-      WRITE(str2,'(i2.2)') it
-c 
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,trm(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"trm"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sconc_seri(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra3,"sconc"//str2,itra,zx_tmp_2d,
-     .                                    iim*(jjm+1),ndex2d)
-c
-c SAVING VARIABLES IN LESSIVAGE
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_tr(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"flux"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_ds(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"ds"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      DO i=1, klon
-        zx_tmp_fi2d(i) = his_dhlsc(i,it)+his_dhcon(i,it)+
-     .                   his_dhbclsc(i,it)+his_dhbccon(i,it)
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,zx_tmp_fi2d,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dh"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-C
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,dtrconv(1,it),zx_tmp_2d)
-      CALL histwrite(nid_tra2,"dtrconv"//str2,itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-
-      ENDDO
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_ss,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_ss",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,sed_dust,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"sed_dust",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)              
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2pgas,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_gas",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,his_g2paer,zx_tmp_2d)
-      CALL histwrite(nid_tra2,"g2p_aer",itra,zx_tmp_2d,
-     .               iim*(jjm+1),ndex2d)
-c SAVING VARIABLES IN HISTRAC
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-c ========================= BC =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcbb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcbb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbcba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbcba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxbc,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxbc",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= OM =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxombb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxombb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxomnat,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxomnat",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxom,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxom",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO4 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso4,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso4",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= H2S =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2snff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2snff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxh2sbio,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxh2sbio",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= SO2 =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2nff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2nff",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2bb",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2vol,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2vol",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2ba,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2ba",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxso2,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxso2",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdms,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdms",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c ========================= DD =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdustec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdustec",itra,zx_tmp_2d,
-     .                               iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxdd,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxdd",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c ========================= SS =============================
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxsscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxsscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,fluxss,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"fluxss",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,fluxso4chem,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"fluxso4chem",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ind,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ind",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_bb,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_bb",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ff,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ff",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ddcoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ddcoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_ssfine,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_ssfine",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,flux_sparam_sscoa,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"flux_sparam_sscoa",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,u10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"u10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-      CALL gr_fi_ecrit(1,klon,iim,jjm+1,v10m_ec,zx_tmp_2d)
-      CALL histwrite(nid_tra1,"v10m",itra,zx_tmp_2d, 
-     .                             iim*(jjm+1),ndex2d)
-c
-cnhl      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,flux_sparam_sulf,zx_tmp_3d)
-cnhl      CALL histwrite(nid_tra1,"flux_sparam_sulf",itra,zx_tmp_3d, 
-cnhl     .                             iim*(jjm+1)*klev,ndex3d)
-c
-      ENDIF ! ok_histrac
-      print *,'END PHYTRACR_SPL '
-
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl_mod.F90
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl_mod.F90	(revision 2196)
+++ LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phytracr_spl_mod.F90	(revision 2217)
@@ -2054,5 +2054,6 @@
 !      ENDIF
 !
-      c_FullName1='regions_dustacc'
+      !c_FullName1='regions_dustacc'
+      c_FullName1='regions_dust'
       call readregions_spl(iregion_dust,c_FullName1)
       c_FullName1='regions_ind'
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/read_newemissions_dot_F_orig_je20140113_seq
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/read_newemissions_dot_F_orig_je20140113_seq	(revision 2196)
+++ 	(revision )
@@ -1,299 +1,0 @@
-C Routine to read the emissions of the different species
-C
-      subroutine read_newemissions(julien, edgar, flag_dms, debutphy, 
-     I                             pdtphys,lafinphy, nbjour, pctsrf,
-     I                             t_seri, xlat, xlon,
-     I                             pmflxr, pmflxs, prfl, psfl,
-     O                             u10m_ec, v10m_ec, dust_ec, 
-     O                             lmt_sea_salt, lmt_so2ff_l, 
-     O                             lmt_so2ff_h, lmt_so2nff, lmt_so2ba,
-     O                             lmt_so2bb_l, lmt_so2bb_h,
-     O                             lmt_so2volc_cont, lmt_altvolc_cont,
-     O                             lmt_so2volc_expl, lmt_altvolc_expl,
-     O                             lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, 
-     O                             lmt_bcff, lmt_bcnff, lmt_bcbb_l, 
-     O                             lmt_bcbb_h, lmt_bcba, lmt_omff, 
-     O                             lmt_omnff, lmt_ombb_l, lmt_ombb_h, 
-     O                             lmt_omnat, lmt_omba)
-      
-      USE dimphy
-      USE indice_sol_mod
-      IMPLICIT NONE
-
-
-#include "dimensions.h"
-c      INCLUDE 'dimphy.h'      
-      INCLUDE 'paramet.h'      
-      INCLUDE 'chem.h'      
-c      INCLUDE 'indicesol.h'
-
-      logical debutphy, lafinphy, edgar
-      INTEGER test_vent, test_day, step_vent, flag_dms, nbjour
-      INTEGER julien, i, iday
-      SAVE step_vent, test_vent, test_day, iday
-      REAL pct_ocean(klon), pctsrf(klon,nbsrf)
-      REAL pdtphys  ! pas d'integration pour la physique (seconde)      
-      REAL t_seri(klon,klev)  ! temperature
-
-      REAL xlat(klon)       ! latitudes pour chaque point 
-      REAL xlon(klon)       ! longitudes pour chaque point 
-      
-c
-c   Emissions:
-c   ---------
-c
-c---------------------------- SEA SALT & DUST emissions ------------------------
-      REAL lmt_sea_salt(klon,ss_bins) !Sea salt 0.03-8.0 um !NOT SAVED OK
-      REAL clyfac, avgdryrate, drying
-c je      REAL u10m_ec1(klon), v10m_ec1(klon), dust_ec1(klon)
-c je      REAL u10m_ec2(klon), v10m_ec2(klon), dust_ec2(klon)
-
-      REAL, SAVE, ALLOCATABLE :: u10m_ec1(:), v10m_ec1(:), dust_ec1(:)
-      REAL, SAVE, ALLOCATABLE :: u10m_ec2(:), v10m_ec2(:), dust_ec2(:)
-      REAL u10m_nc(iip1,jjp1), v10m_nc(iip1,jjp1)
-      REAL u10m_ec(klon), v10m_ec(klon), dust_ec(klon)
-c      REAL cly(klon), wth(klon), zprecipinsoil(klon)
-      REAL, SAVE, ALLOCATABLE :: cly(:), wth(:), zprecipinsoil(:)
-
-
-c je     SAVE u10m_ec2, v10m_ec2, dust_ec2
-c je      SAVE u10m_ec1, v10m_ec1, dust_ec1   ! Added on titane
-c je      SAVE cly, wth, zprecipinsoil        ! Added on titane
-!     SAVE cly, wth, zprecipinsoil, u10m_ec2, v10m_ec2, dust_ec2
-c------------------------- BLACK CARBON emissions ----------------------
-      REAL lmt_bcff(klon)       ! emissions de BC fossil fuels
-      REAL lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
-      REAL lmt_bcbb_l(klon)     ! emissions de BC biomass basses
-      REAL lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
-      REAL lmt_bcba(klon)       ! emissions de BC bateau
-c------------------------ ORGANIC MATTER emissions ---------------------
-      REAL lmt_omff(klon)     ! emissions de OM fossil fuels
-      REAL lmt_omnff(klon)    ! emissions de OM non-fossil fuels
-      REAL lmt_ombb_l(klon)   ! emissions de OM biomass basses
-      REAL lmt_ombb_h(klon)   ! emissions de OM biomass hautes
-      REAL lmt_omnat(klon)    ! emissions de OM Natural
-      REAL lmt_omba(klon)     ! emissions de OM bateau
-c------------------------- SULFUR emissions ----------------------------
-      REAL lmt_so2ff_l(klon)       ! emissions so2 fossil fuels (low)
-      REAL lmt_so2ff_h(klon)       ! emissions so2 fossil fuels (high)
-      REAL lmt_so2nff(klon)        ! emissions so2 non-fossil fuels
-      REAL lmt_so2bb_l(klon)       ! emissions de so2 biomass burning basse
-      REAL lmt_so2bb_h(klon)       ! emissions de so2 biomass burning hautes
-      REAL lmt_so2ba(klon)         ! emissions de so2 bateau
-      REAL lmt_so2volc_cont(klon)  ! emissions so2 volcan continuous
-      REAL lmt_altvolc_cont(klon)  ! altitude  so2 volcan continuous
-      REAL lmt_so2volc_expl(klon)  ! emissions so2 volcan explosive
-      REAL lmt_altvolc_expl(klon)  ! altitude  so2 volcan explosive
-      REAL lmt_dmsconc(klon)       ! concentration de dms oceanique
-      REAL lmt_dmsbio(klon)        ! emissions de dms bio
-      REAL lmt_h2sbio(klon)        ! emissions de h2s bio
-
-      REAL,SAVE,ALLOCATABLE ::  lmt_dms(:)           ! emissions de dms
-c
-c  Lessivage
-c  ---------
-c
-      REAL pmflxr(klon,klev), pmflxs(klon,klev) !--convection
-      REAL prfl(klon,klev),   psfl(klon,klev)   !--large-scale
-c
-c  Variable interne
-c  ----------------
-c      
-      INTEGER icount
-      REAL tau_1, tau_2                  
-      REAL max_flux, min_flux                                          
-      INTRINSIC MIN, MAX
-c
-c JE: Changes due to new pdtphys in new physics.
-c      REAL windintime ! time in hours of the wind input files resolution 
-c      REAL dayemintime ! time in hours of the other emissions input files resolution 
-
-
-
-c je
-c allocate if necessary
-c
-
-      IF (.NOT. ALLOCATED(u10m_ec1)) ALLOCATE(u10m_ec1(klon))
-      IF (.NOT. ALLOCATED(v10m_ec1)) ALLOCATE(v10m_ec1(klon))
-      IF (.NOT. ALLOCATED(dust_ec1)) ALLOCATE(dust_ec1(klon))
-      IF (.NOT. ALLOCATED(u10m_ec2)) ALLOCATE(u10m_ec2(klon))
-      IF (.NOT. ALLOCATED(v10m_ec2)) ALLOCATE(v10m_ec2(klon))
-      IF (.NOT. ALLOCATED(dust_ec2)) ALLOCATE(dust_ec2(klon))
-      IF (.NOT. ALLOCATED(cly)) ALLOCATE(cly(klon))
-      IF (.NOT. ALLOCATED(wth)) ALLOCATE(wth(klon))
-      IF (.NOT. ALLOCATED(zprecipinsoil)) ALLOCATE(zprecipinsoil(klon))
-      IF (.NOT. ALLOCATED(lmt_dms)) ALLOCATE(lmt_dms(klon))
-c end je nov2013
-c
-C***********************************************************************
-C DUST EMISSIONS
-C***********************************************************************
-c
-      IF (debutphy) THEN 
-C---Fields are read only at the beginning of the period
-c--reading wind and dust
-        iday=julien
-        step_vent=1
-        test_vent=0
-        test_day=0
-        CALL read_vent(.true.,step_vent,nbjour,u10m_ec2,v10m_ec2)
-        print *,'Read (debut) dust emissions: step_vent,julien,nbjour', 
-     .                                   step_vent,julien,nbjour
-        CALL read_dust(.true.,step_vent,nbjour,dust_ec2)
-C Threshold velocity map
-        OPEN(51,file='wth.dat',status='unknown',form='formatted')
-        READ(51,'(G18.10)') (wth(i),i=1,klon)
-        CLOSE(51)
-c Clay content
-        OPEN(52,file='cly.dat',status='unknown',form='formatted')
-        READ(52,'(G18.10)') (cly(i),i=1,klon)
-        CLOSE(52)
-        OPEN(53,file='precipinsoil.dat',
-     .        status='old',form='formatted',err=999)
-        READ(53,'(G18.10)') (zprecipinsoil(i),i=1,klon)
-        PRINT *,'lecture precipinsoil.dat'
-        GOTO 1000
- 999    CONTINUE
-        DO i=1, klon
-          zprecipinsoil(i)=0.0
-        ENDDO
- 1000   CLOSE(53)
-c
-      ENDIF !--- debutphy
-        
-      print *,'READ_EMISSION: test_vent & test_day = ',test_vent, 
-     +                                                 test_day
-      IF (test_vent.EQ.0) THEN    !--on lit toutes les 6 h                                                                      
-        CALL SCOPY(klon, u10m_ec2, 1, u10m_ec1, 1)
-        CALL SCOPY(klon, v10m_ec2, 1, v10m_ec1, 1)
-        CALL SCOPY(klon, dust_ec2, 1, dust_ec1, 1)
-        step_vent=step_vent+1
-        !PRINT *,'step_vent=', step_vent
-        CALL read_vent(.false.,step_vent,nbjour,u10m_ec2,v10m_ec2)
-        print *,'Reading dust emissions: step_vent, julien, nbjour ', 
-     .                                   step_vent, julien, nbjour
-        !print *,'test_vent, julien = ',test_vent, julien
-        CALL read_dust(.false.,step_vent,nbjour,dust_ec2)
-      
-      ENDIF !--test_vent
-
-c     ubicacion original
-c      test_vent=test_vent+1
-c      IF (test_vent.EQ.(6*2)) test_vent=0 !on remet a zero ttes les 6 h
-            
-      tau_2=FLOAT(test_vent)/12.
-      tau_1=1.-tau_2
-      DO i=1, klon
-        u10m_ec(i)=tau_1*u10m_ec1(i)+tau_2*u10m_ec2(i)
-        v10m_ec(i)=tau_1*v10m_ec1(i)+tau_2*v10m_ec2(i)
-        dust_ec(i)=tau_1*dust_ec1(i)+tau_2*dust_ec2(i)
-      ENDDO
-c
-      IF (test_vent.EQ.(6*2)) THEN
-        PRINT *,'6 hrs interval reached'
-        print *,'day in read_emission, test_vent = ',julien, test_vent
-      ENDIF
-c
-      test_vent=test_vent+1
-      IF (test_vent.EQ.(6*2)) test_vent=0 !on remet a zero ttes les 6 h
-c
-      avgdryrate=300./365.*pdtphys/86400.
-c
-      DO i=1, klon
-c
-        IF (cly(i).LT.9990..AND.wth(i).LT.9990.) THEN
-          zprecipinsoil(i)=zprecipinsoil(i) +
-     .           (pmflxr(i,1)+pmflxs(i,1)+prfl(i,1)+psfl(i,1))*pdtphys
-c
-          clyfac=MIN(16., cly(i)*0.4+8.) ![mm] max amount of water hold in top soil
-          drying=avgdryrate*exp(0.03905491*
-     .                    exp(0.17446*(t_seri(i,1)-273.15))) ! [mm]
-          zprecipinsoil(i)=min(max(0.,zprecipinsoil(i)-drying),clyfac) ! [mm]
-        ENDIF
-!        zprecipinsoil(i)=0.0 ! Temporarely introduced to reproduce obelix result
-      ENDDO
-
-!      print *,'cly = ',sum(cly),maxval(cly),minval(cly)
-!      print *,'wth = ',sum(wth),maxval(wth),minval(wth)
-!      print *,'t_seri = ',sum(t_seri),maxval(t_seri),minval(t_seri)
-!      print *,'precipinsoil = ',sum(zprecipinsoil),maxval(zprecipinsoil)
-!     .                      ,minval(zprecipinsoil)
-      icount=0
-      DO i=1, klon
-        IF (cly(i).GE.9990..OR.wth(i).GE.9990..OR.
-     .     t_seri(i,1).LE.273.15.OR.zprecipinsoil(i).GT.1.e-8) THEN
-             dust_ec(i)=0.0 ! commented out for test dustemtest
-!             print *,'Dust emissions surpressed at grid = ',i
-!             icount=icount+1
-        ENDIF
-      ENDDO                            
-c
-      print *,'Total N of grids with surpressed emission = ',icount
-      print *,'dust_ec = ',SUM(dust_ec),MINVAL(dust_ec),
-     .                                  MAXVAL(dust_ec)
-cnhl Transitory scaling of desert dust emissions
-      
-cnhl      DO i=1, klon
-cnhl         dust_ec(i)=dust_ec(i)/2.
-cnhl      ENDDO                            
-
-C-saving precipitation field to be read in next simulation
-      
-      IF (lafinphy) THEN
-c
-        OPEN(53,file='newprecipinsoil.dat',
-     .          status='unknown',form='formatted')
-        WRITE(53,'(G18.10)') (zprecipinsoil(i),i=1,klon)
-        CLOSE(53)
-c
-      ENDIF
-c
-C***********************************************************************
-C SEA SALT EMISSIONS
-C***********************************************************************
-c
-      DO i=1,klon
-        pct_ocean(i)=pctsrf(i,is_oce)
-      ENDDO
-
-      print *,'IS_OCE = ',is_oce
-      CALL seasalt(v10m_ec, u10m_ec, pct_ocean, lmt_sea_salt) !mgSeaSalt/cm2/s
-!      print *,'SUM, MAX & MIN Sea Salt = ',SUM(lmt_sea_salt),
-!     .               MAXVAL(lmt_sea_salt),MINVAL(lmt_sea_salt)
-c      
-C***********************************************************************
-C SULFUR & CARBON EMISSIONS
-C***********************************************************************
-c
-      
-      IF (test_day.EQ.0) THEN
-        print *,'Computing SULFATE emissions for day : ',iday,julien, 
-     .                                                   step_vent
-        CALL condsurfs_new(iday, edgar, flag_dms,
-     O                      lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, 
-     O                      lmt_so2bb_l, lmt_so2bb_h, lmt_so2ba, 
-     O                      lmt_so2volc_cont, lmt_altvolc_cont, 
-     O                      lmt_so2volc_expl, lmt_altvolc_expl, 
-     O                      lmt_dmsbio, lmt_h2sbio, lmt_dms,lmt_dmsconc)
-        print *,'Computing CARBON emissions for day : ',iday,julien,
-     .                                                   step_vent
-        CALL condsurfc_new(iday,
-     O                       lmt_bcff,lmt_bcnff,lmt_bcbb_l,lmt_bcbb_h,
-     O                       lmt_bcba,lmt_omff,lmt_omnff,lmt_ombb_l,
-     O                       lmt_ombb_h, lmt_omnat, lmt_omba)
-        print *,'IDAY = ',iday
-        iday=iday+1
-        print *,'BCBB_L emissions :',SUM(lmt_bcbb_l), MAXVAL(lmt_bcbb_l)
-     .                              ,MINVAL(lmt_bcbb_l)
-        print *,'BCBB_H emissions :',SUM(lmt_bcbb_h), MAXVAL(lmt_bcbb_h)
-     .                              ,MINVAL(lmt_bcbb_h)
-      ENDIF
-      
-      test_day=test_day+1
-      IF (test_day.EQ.(24*2.)) THEN
-        test_day=0 !on remet a zero ttes les 24 h
-        print *,'LAST TIME STEP OF DAY ',julien
-      ENDIF
-
-      END
Index: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/sediment_mod.F
===================================================================
--- LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/sediment_mod.F	(revision 2196)
+++ LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/sediment_mod.F	(revision 2217)
@@ -76,6 +76,10 @@
 !JE20140911        mmd_dustsco=15.56554  !micrometer for bin 0.5-20 and 0.5-10 um
         IF (ok_chimeredust) THEN 
-        mmd_dust=3.761212  !micrometer for bin 0.5-3 and 0.5-10 um
-        mmd_dustsco=15.06167  !micrometer for bin 3-20 and 0.5-10 um
+!JE20150212<< : changes in ustar in dustmod changes emission distribution
+!        mmd_dust=3.761212  !micrometer for bin 0.5-3 and 0.5-10 um
+!        mmd_dustsco=15.06167  !micrometer for bin 3-20 and 0.5-10 um
+!JE20150212>>
+        mmd_dust=3.983763
+        mmd_dustsco=15.10854 
         ELSE 
         mmd_dust=11.0  !micrometer for bin 0.5-20 and 0.5-10 um
