Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F	(revision 5098)
@@ -210,8 +210,4 @@
 
             DO ij=iip2+1,ip1jm
-#ifdef CRAY
-               dxq(ij,l)=
-     ,         cvmgp(dxqu(ij-1)+dxqu(ij),0.,dxqu(ij-1)*dxqu(ij))
-#else
                IF(dxqu(ij-1)*dxqu(ij)>0) THEN
                   dxq(ij,l)=dxqu(ij-1)+dxqu(ij)
@@ -220,5 +216,4 @@
                   dxq(ij,l)=0.
                ENDIF
-#endif
                dxq(ij,l)=0.5*dxq(ij,l)
                dxq(ij,l)=
@@ -274,20 +269,4 @@
 c   calcul des flux a gauche et a droite
 
-#ifdef CRAY
-
-      DO l=1,llm
-       DO ij=iip2,ip1jm-1
-          zdum(ij,l)=cvmgp(1.-u_m(ij,l)/masse(ij,l,iq),
-     ,                     1.+u_m(ij,l)/masse(ij+1,l,iq),
-     ,                     u_m(ij,l))
-          zdum(ij,l)=0.5*zdum(ij,l)
-          u_mq(ij,l)=cvmgp(
-     ,                q(ij,l,iq)+zdum(ij,l)*dxq(ij,l),
-     ,                q(ij+1,l,iq)-zdum(ij,l)*dxq(ij+1,l),
-     ,                u_m(ij,l))
-          u_mq(ij,l)=u_m(ij,l)*u_mq(ij,l)
-       ENDDO
-      ENDDO
-#else
 c   on cumule le flux correspondant a toutes les mailles dont la masse
 c   au travers de la paroi pENDant le pas de temps.
@@ -307,5 +286,4 @@
        ENDDO
       ENDDO
-#endif
 
 c	go to 9999
@@ -883,12 +861,8 @@
       INTEGER ifils,iq2 ! CRisi
 
-      LOGICAL testcpu
-      SAVE testcpu
-
 #ifdef BIDON
       REAL temps0,temps1,second
       SAVE temps0,temps1
 
-      DATA testcpu/.false./
       DATA temps0,temps1/0.,0./
 #endif
@@ -899,9 +873,4 @@
       !write(*,*) 'vlz 923: entree'
 
-#ifdef BIDON
-      IF(testcpu) THEN
-         temps0=second(0.)
-      ENDIF
-#endif
       DO l=2,llm
          DO ij=1,ip1jmp1
@@ -913,8 +882,4 @@
       DO l=2,llm-1
          DO ij=1,ip1jmp1
-#ifdef CRAY
-            dzq(ij,l)=0.5*
-     ,      cvmgp(dzqw(ij,l)+dzqw(ij,l+1),0.,dzqw(ij,l)*dzqw(ij,l+1))
-#else
             IF(dzqw(ij,l)*dzqw(ij,l+1)>0.) THEN
                 dzq(ij,l)=0.5*(dzqw(ij,l)+dzqw(ij,l+1))
@@ -922,5 +887,4 @@
                 dzq(ij,l)=0.
             ENDIF
-#endif
             dzqmax=pente_max*min(adzqw(ij,l),adzqw(ij,l+1))
             dzq(ij,l)=sign(min(abs(dzq(ij,l)),dzqmax),dzq(ij,l))
@@ -934,9 +898,4 @@
       ENDDO
 
-#ifdef BIDON
-      IF(testcpu) THEN
-         temps1=temps1+second(0.)-temps0
-      ENDIF
-#endif
 c ---------------------------------------------------------------
 c   .... calcul des termes d'advection verticale  .......
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F	(revision 5098)
@@ -55,11 +55,8 @@
       REAL temps1,temps2,temps3
       REAL zzpbar, zzw
-      LOGICAL testcpu
-      SAVE testcpu
       SAVE temps1,temps2,temps3
 
       REAL qmin,qmax
       DATA qmin,qmax/0.,1.e33/
-      DATA testcpu/.false./
       DATA temps1,temps2,temps3/0.,0.,0./
 
@@ -220,6 +217,6 @@
       INTEGER ifils,iq2 ! CRisi
 
-      Logical first,testcpu
-      SAVE first,testcpu
+      Logical first
+      SAVE first
 
       REAL      SSUM
@@ -228,5 +225,5 @@
 
 
-      DATA first,testcpu/.true.,.false./
+      DATA first/.true./
 
       IF(first) THEN
@@ -278,8 +275,4 @@
 
             DO ij=iip2+1,ip1jm
-#ifdef CRAY
-               dxq(ij,l)=
-     ,         cvmgp(dxqu(ij-1)+dxqu(ij),0.,dxqu(ij-1)*dxqu(ij))
-#else
                IF(dxqu(ij-1)*dxqu(ij)>0) THEN
                   dxq(ij,l)=dxqu(ij-1)+dxqu(ij)
@@ -288,5 +281,4 @@
                   dxq(ij,l)=0.
                ENDIF
-#endif
                dxq(ij,l)=0.5*dxq(ij,l)
                dxq(ij,l)=
@@ -341,20 +333,4 @@
 c   calcul des flux a gauche et a droite
 
-#ifdef CRAY
-c--pas encore modification sur Qsat
-      DO l=1,llm
-       DO ij=iip2,ip1jm-1
-          zdum(ij,l)=cvmgp(1.-u_m(ij,l)/masse(ij,l,iq),
-     ,                     1.+u_m(ij,l)/masse(ij+1,l,iq),
-     ,                     u_m(ij,l))
-          zdum(ij,l)=0.5*zdum(ij,l)
-          u_mq(ij,l)=cvmgp(
-     ,                q(ij,l,iq)+zdum(ij,l)*dxq(ij,l),
-     ,                q(ij+1,l,iq)-zdum(ij,l)*dxq(ij+1,l),
-     ,                u_m(ij,l))
-          u_mq(ij,l)=u_m(ij,l)*u_mq(ij,l)
-       ENDDO
-      ENDDO
-#else
 c   on cumule le flux correspondant a toutes les mailles dont la masse
 c   au travers de la paroi pENDant le pas de temps.
@@ -373,5 +349,4 @@
        ENDDO
       ENDDO
-#endif
 
 
@@ -581,8 +556,8 @@
       REAL qpns,qpsn,dyn1,dys1,dyn2,dys2,newmasse,fn,fs
 c     REAL newq,oldmasse
-      Logical first,testcpu
+      Logical first
       REAL temps0,temps1,temps2,temps3,temps4,temps5
       SAVE temps0,temps1,temps2,temps3,temps4,temps5
-      SAVE first,testcpu
+      SAVE first
 
       REAL convpn,convps,convmpn,convmps
@@ -598,5 +573,5 @@
       REAL      SSUM
 
-      DATA first,testcpu/.true.,.false./
+      DATA first/.true./
       DATA temps0,temps1,temps2,temps3,temps4,temps5/0.,0.,0.,0.,0.,0./
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advn.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advn.F	(revision 5098)
@@ -31,5 +31,5 @@
       REAL w(ip1jmp1,llm),pdt
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -47,17 +47,10 @@
       real zqh(ip1jmp1,llm),zqb(ip1jmp1,llm)
       real temps0,temps1,temps2,temps3
-      real ztemps1,ztemps2,ztemps3,ssum
-      logical testcpu
-      save testcpu
+      real ztemps1,ztemps2,ssum
       save temps1,temps2,temps3
       real zzpbar,zzw
 
-#ifdef CRAY
-      real second
-#endif
-
       real qmin,qmax
       data qmin,qmax/0.,1./
-      data testcpu/.false./
       data temps1,temps2,temps3/0.,0.,0./
 
@@ -120,11 +113,4 @@
 c     call minmaxq(zq,qmin,qmax,'apres vlx     ')
 
-#ifdef CRAY
-      if(testcpu) then
-         ztemps1=second(0.)
-         temps1=temps1+ztemps1-ztemps2
-            print*,'VLSPLT X:',temps1,'   Y:',temps2,'   Z:',temps3
-      endif
-#endif
       do l=1,llm
          do ij=1,ip1jmp1
@@ -155,5 +141,5 @@
       real q(ip1jmp1,llm),qg(ip1jmp1,llm),qd(ip1jmp1,llm)
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -272,5 +258,5 @@
       real q(ip1jmp1,llm),qs(ip1jmp1,llm),qn(ip1jmp1,llm)
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -368,5 +354,5 @@
       real q(ip1jmp1,llm),qh(ip1jmp1,llm),qb(ip1jmp1,llm)
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -493,5 +479,5 @@
       real q(ip1jmp1,llm),qd(ip1jmp1,llm),qg(ip1jmp1,llm)
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -510,9 +496,5 @@
       save prec
 
-#ifdef CRAY
-      data prec/1.e-24/
-#else
       data prec/1.e-15/
-#endif
 
       do l=1,llm
@@ -573,5 +555,5 @@
                  u_mq(ij,l)=
      s           sign(zm,u_m(ij,l))*(zsigp*zqp+(zsig-zsigp)*zqm)
-             endif 
+             endif
           else
              if (zsig<=zsigp) then
@@ -703,5 +685,5 @@
             endif
          enddo
-      endif  ! n0.gt.0 
+      endif  ! n0.gt.0
 
 c   bouclage en latitude
@@ -758,5 +740,5 @@
       real q(ip1jmp1,llm),qn(ip1jmp1,llm),qs(ip1jmp1,llm)
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -772,9 +754,5 @@
       save prec
 
-#ifdef CRAY
-      data prec/1.e-24/
-#else
       data prec/1.e-15/
-#endif
       do l=1,llm
             do ij=1,ip1jmp1
@@ -825,5 +803,5 @@
           else
               zz=0.5*(zsig-zsigp)/zsigm
-              v_mq(ij,l)=sign(zm,v_m(ij,l))*( 0.5*(zq+zqp)*zsigp 
+              v_mq(ij,l)=sign(zm,v_m(ij,l))*( 0.5*(zq+zqp)*zsigp
      s        +(zsig-zsigp)*(zq+zz*(zqm-zq)) )
           endif
@@ -890,5 +868,5 @@
 
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -902,9 +880,5 @@
       save prec
 
-#ifdef CRAY
-      data prec/1.e-24/
-#else
       data prec/1.e-13/
-#endif
 
       do l=1,llm
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/infotrac.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/infotrac.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/infotrac.F90	(revision 5098)
@@ -3,277 +3,277 @@
 MODULE infotrac
 
-   USE       strings_mod, ONLY: msg, fmsg, maxlen, cat, dispTable, int2str, bool2str, strStack, strParse
-   USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers, setGeneration, itZonIso, nzone, tran0, isoZone, &
-        delPhase, niso, getKey, isot_type, processIsotopes,  isotope, maxTableWidth, iqIsoPha, nphas, ixIso, isoPhas, &
-        addPhase, iH2O, addKey, isoSelect, testTracersFiles, isoKeys, indexUpdate,  iqWIsoPha, nbIso, ntiso, isoName, isoCheck
-   IMPLICIT NONE
-
-   PRIVATE
-
-   !=== FOR TRACERS:
-   PUBLIC :: init_infotrac                                 !--- Initialization of the tracers
-   PUBLIC :: tracers, type_trac                            !--- Full tracers database, tracers type keyword
-   PUBLIC :: nqtot,   nbtr,   nqo,   nqCO2,   nqtottr      !--- Main dimensions
-   PUBLIC :: conv_flg, pbl_flg                             !--- Convection & boundary layer activation keys
-
-   !=== FOR ISOTOPES: General
-   PUBLIC :: isot_type, nbIso                              !--- Derived type, full isotopes families database + nb of families
-   PUBLIC :: isoSelect, ixIso                              !--- Isotopes family selection tool + selected family index
-   !=== FOR ISOTOPES: Specific to water
-   PUBLIC :: iH2O                                          !--- H2O isotopes class index
-   PUBLIC :: min_qParent, min_qMass, min_ratio             !--- Min. values for various isotopic quantities
-   !=== FOR ISOTOPES: Depending on the selected isotopes family
-   PUBLIC :: isotope, isoKeys                              !--- Selected isotopes database + associated keys (cf. getKey)
-   PUBLIC :: isoName, isoZone, isoPhas                     !--- Isotopes and tagging zones names, phases
-   PUBLIC :: niso,    nzone,   nphas,   ntiso              !---  " " numbers + isotopes & tagging tracers number
-   PUBLIC :: itZonIso                                      !--- idx "it" (in "isoName(1:niso)") = function(tagging idx, isotope idx)
-   PUBLIC :: iqIsoPha                                      !--- idx "iq" (in "qx") = function(isotope idx, phase idx) + aliases
-   PUBLIC :: isoCheck                                      !--- Run isotopes checking routines
-   !=== FOR BOTH TRACERS AND ISOTOPES
-   PUBLIC :: getKey                                        !--- Get a key from "tracers" or "isotope"
-
-!=== CONVENTIONS FOR TRACERS NUMBERS:
-!  |--------------------+-----------------------+-----------------+---------------+----------------------------|
-!  | water in different |    water tagging      |  water isotopes | other tracers | additional tracers moments |
-!  | phases: H2O_[gls]  |      isotopes         |                 |               |  for higher order schemes  |
-!  |--------------------+-----------------------+-----------------+---------------+----------------------------|
-!  |                    |                       |                 |               |                            |
-!  |<--     nqo      -->|<-- nqo*niso* nzone -->|<-- nqo*niso  -->|<--  nbtr   -->|<--        (nmom)        -->|         
-!  |                    |                                         |                                            |
-!  |                    |<-- nqo*niso*(nzone+1)  =   nqo*ntiso -->|<--    nqtottr = nbtr + nmom             -->|
-!  |                                                                              = nqtot - nqo*(ntiso+1)      |
-!  |                                                                                                           |
-!  |<--                        nqtrue  =  nbtr + nqo*(ntiso+1)                 -->|                            |
-!  |                                                                                                           |
-!  |<--                        nqtot   =  nqtrue + nmom                                                     -->|
-!  |                                                                                                           |
-!  |-----------------------------------------------------------------------------------------------------------|
-!  NOTES FOR THIS TABLE:
-!  * Used "niso", "nzone" and "ntiso" are components of "isotopes(ip)" for water (isotopes(ip)%parent == 'H2O'),
-!    since water is so far the sole tracers family, except passive CO2, removed from the main tracers table.
-!  * For water, "nqo" is equal to the more general field "isotopes(ip)%nphas".
-!  * "niso", "nzone", "ntiso", "nphas" are defined for other isotopic tracers families, if any.
-!
-!=== DERIVED TYPE EMBEDDING MOST OF THE TRACERS-RELATED QUANTITIES (LENGTH: nqtot)
-!    Each entry is accessible using "%" sign.
-!  |-------------+------------------------------------------------------+-------------+------------------------+
-!  |  entry      | Meaning                                              | Former name | Possible values        |
-!  |-------------+------------------------------------------------------+-------------+------------------------+
-!  | name        | Name (short)                                         | tname       |                        |
-!  | gen0Name    | Name of the 1st generation ancestor                  | /           |                        |
-!  | parent      | Name of the parent                                   | /           |                        |
-!  | longName    | Long name (with adv. scheme suffix) for outputs      | ttext       |                        |
-!  | type        | Type (so far: tracer or tag)                         | /           | tracer,tag             |
-!  | phase       | Phases list ("g"as / "l"iquid / "s"olid)             | /           | [g][l][s]              |
-!  | component   | Name(s) of the merged/cumulated section(s)           | /           | coma-separated names   |
-!  | iGeneration | Generation (>=1)                                     | /           |                        |
-!  | iqParent    | Index of the parent tracer                           | iqpere      | 1:nqtot                |
-!  | iqDescen    | Indexes of the childs       (all generations)        | iqfils      | 1:nqtot                |
-!  | nqDescen    | Number of the descendants   (all generations)        | nqdesc      | 1:nqtot                |
-!  | nqChildren  | Number of childs            (1st generation only)    | nqfils      | 1:nqtot                |
-!  | keys        | key/val pairs accessible with "getKey" routine       | /           |                        |
-!  | iadv        | Advection scheme number                              | iadv        | 1,2,10-20(exc.15,19),30|
-!  | isAdvected  | advected tracers flag (.TRUE. if iadv >= 0)          | /           | nqtrue  .TRUE. values  |
-!  | isInPhysics | tracers not extracted from the main table in physics | /           | nqtottr .TRUE. values  |
-!  | iso_iGroup  | Isotopes group index in isotopes(:)                  | /           | 1:nbIso                |
-!  | iso_iName   | Isotope  name  index in isotopes(iso_iGroup)%trac(:) | iso_indnum  | 1:niso                 |
-!  | iso_iZone   | Isotope  zone  index in isotopes(iso_iGroup)%zone(:) | zone_num    | 1:nzone                |
-!  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
-!  +-------------+------------------------------------------------------+-------------+------------------------+
-!
-!=== DERIVED TYPE EMBEDDING MOST OF THE ISOTOPES-RELATED QUANTITIES (LENGTH: nbIso, NUMBER OF ISOTOPES FAMILIES)
-!    Each entry is accessible using "%" sign.
-!  |-----------------+--------------------------------------------------+--------------------+-----------------+
-!  |  entry | length | Meaning                                          |    Former name     | Possible values |
-!  |-----------------+--------------------------------------------------+--------------------+-----------------+
-!  | parent          | Parent tracer (isotopes family name)             |                    |                 |
-!  | keys   | niso   | Isotopes keys/values pairs list + number         |                    |                 |
-!  | trac   | ntiso  | Isotopes + tagging tracers list + number         | / | ntraciso       |                 |
-!  | zone   | nzone  | Geographic tagging zones   list + number         | / | ntraceurs_zone |                 |
-!  | phase  | nphas  | Phases                     list + number         |                    | [g][l][s], 1:3  |
-!  | iqIsoPha        | Index in "qx"           = f(name(1:ntiso)),phas) | iqiso              | 1:nqtot         |
-!  | itZonIso        | Index in "trac(1:ntiso)"= f(zone, name(1:niso))  | index_trac         | 1:ntiso         |
-!  +-----------------+--------------------------------------------------+--------------------+-----------------+
-
-   REAL, PARAMETER :: min_qParent = 1.e-30, min_qMass = 1.e-18, min_ratio = 1.e-16 ! MVals et CRisi
-
-   !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES
-   INTEGER,               SAVE :: nqtot,  &                     !--- Tracers nb in dynamics (incl. higher moments + H2O)
-                                  nbtr,   &                     !--- Tracers nb in physics  (excl. higher moments + H2O)
-                                  nqo,    &                     !--- Number of water phases
-                                  nqtottr, &                    !--- Number of tracers passed to phytrac (TO BE DELETED ?)
-                                  nqCO2                         !--- Number of tracers of CO2  (ThL)
-   CHARACTER(LEN=maxlen), SAVE :: type_trac                     !--- Keyword for tracers type
-
-   !=== VARIABLES FOR INCA
-   INTEGER,               SAVE, ALLOCATABLE :: conv_flg(:), &   !--- Convection     activation ; needed for INCA        (nbtr)
-                                                pbl_flg(:)      !--- Boundary layer activation ; needed for INCA        (nbtr)
+  USE       strings_mod, ONLY : msg, fmsg, maxlen, cat, dispTable, int2str, bool2str, strStack, strParse
+  USE readTracFiles_mod, ONLY : trac_type, readTracersFiles, tracers, setGeneration, itZonIso, nzone, tran0, isoZone, &
+          delPhase, niso, getKey, isot_type, processIsotopes, isotope, maxTableWidth, iqIsoPha, nphas, ixIso, isoPhas, &
+          addPhase, iH2O, addKey, isoSelect, testTracersFiles, isoKeys, indexUpdate, iqWIsoPha, nbIso, ntiso, isoName, isoCheck
+  IMPLICIT NONE
+
+  PRIVATE
+
+  !=== FOR TRACERS:
+  PUBLIC :: init_infotrac                                 !--- Initialization of the tracers
+  PUBLIC :: tracers, type_trac                            !--- Full tracers database, tracers type keyword
+  PUBLIC :: nqtot, nbtr, nqo, nqCO2, nqtottr      !--- Main dimensions
+  PUBLIC :: conv_flg, pbl_flg                             !--- Convection & boundary layer activation keys
+
+  !=== FOR ISOTOPES: General
+  PUBLIC :: isot_type, nbIso                              !--- Derived type, full isotopes families database + nb of families
+  PUBLIC :: isoSelect, ixIso                              !--- Isotopes family selection tool + selected family index
+  !=== FOR ISOTOPES: Specific to water
+  PUBLIC :: iH2O                                          !--- H2O isotopes class index
+  PUBLIC :: min_qParent, min_qMass, min_ratio             !--- Min. values for various isotopic quantities
+  !=== FOR ISOTOPES: Depending on the selected isotopes family
+  PUBLIC :: isotope, isoKeys                              !--- Selected isotopes database + associated keys (cf. getKey)
+  PUBLIC :: isoName, isoZone, isoPhas                     !--- Isotopes and tagging zones names, phases
+  PUBLIC :: niso, nzone, nphas, ntiso              !---  " " numbers + isotopes & tagging tracers number
+  PUBLIC :: itZonIso                                      !--- idx "it" (in "isoName(1:niso)") = function(tagging idx, isotope idx)
+  PUBLIC :: iqIsoPha                                      !--- idx "iq" (in "qx") = function(isotope idx, phase idx) + aliases
+  PUBLIC :: isoCheck                                      !--- Run isotopes checking routines
+  !=== FOR BOTH TRACERS AND ISOTOPES
+  PUBLIC :: getKey                                        !--- Get a key from "tracers" or "isotope"
+
+  !=== CONVENTIONS FOR TRACERS NUMBERS:
+  !  |--------------------+-----------------------+-----------------+---------------+----------------------------|
+  !  | water in different |    water tagging      |  water isotopes | other tracers | additional tracers moments |
+  !  | phases: H2O_[gls]  |      isotopes         |                 |               |  for higher order schemes  |
+  !  |--------------------+-----------------------+-----------------+---------------+----------------------------|
+  !  |                    |                       |                 |               |                            |
+  !  |<--     nqo      -->|<-- nqo*niso* nzone -->|<-- nqo*niso  -->|<--  nbtr   -->|<--        (nmom)        -->|
+  !  |                    |                                         |                                            |
+  !  |                    |<-- nqo*niso*(nzone+1)  =   nqo*ntiso -->|<--    nqtottr = nbtr + nmom             -->|
+  !  |                                                                              = nqtot - nqo*(ntiso+1)      |
+  !  |                                                                                                           |
+  !  |<--                        nqtrue  =  nbtr + nqo*(ntiso+1)                 -->|                            |
+  !  |                                                                                                           |
+  !  |<--                        nqtot   =  nqtrue + nmom                                                     -->|
+  !  |                                                                                                           |
+  !  |-----------------------------------------------------------------------------------------------------------|
+  !  NOTES FOR THIS TABLE:
+  !  * Used "niso", "nzone" and "ntiso" are components of "isotopes(ip)" for water (isotopes(ip)%parent == 'H2O'),
+  !    since water is so far the sole tracers family, except passive CO2, removed from the main tracers table.
+  !  * For water, "nqo" is equal to the more general field "isotopes(ip)%nphas".
+  !  * "niso", "nzone", "ntiso", "nphas" are defined for other isotopic tracers families, if any.
+  !
+  !=== DERIVED TYPE EMBEDDING MOST OF THE TRACERS-RELATED QUANTITIES (LENGTH: nqtot)
+  !    Each entry is accessible using "%" sign.
+  !  |-------------+------------------------------------------------------+-------------+------------------------+
+  !  |  entry      | Meaning                                              | Former name | Possible values        |
+  !  |-------------+------------------------------------------------------+-------------+------------------------+
+  !  | name        | Name (short)                                         | tname       |                        |
+  !  | gen0Name    | Name of the 1st generation ancestor                  | /           |                        |
+  !  | parent      | Name of the parent                                   | /           |                        |
+  !  | longName    | Long name (with adv. scheme suffix) for outputs      | ttext       |                        |
+  !  | type        | Type (so far: tracer or tag)                         | /           | tracer,tag             |
+  !  | phase       | Phases list ("g"as / "l"iquid / "s"olid)             | /           | [g][l][s]              |
+  !  | component   | Name(s) of the merged/cumulated section(s)           | /           | coma-separated names   |
+  !  | iGeneration | Generation (>=1)                                     | /           |                        |
+  !  | iqParent    | Index of the parent tracer                           | iqpere      | 1:nqtot                |
+  !  | iqDescen    | Indexes of the childs       (all generations)        | iqfils      | 1:nqtot                |
+  !  | nqDescen    | Number of the descendants   (all generations)        | nqdesc      | 1:nqtot                |
+  !  | nqChildren  | Number of childs            (1st generation only)    | nqfils      | 1:nqtot                |
+  !  | keys        | key/val pairs accessible with "getKey" routine       | /           |                        |
+  !  | iadv        | Advection scheme number                              | iadv        | 1,2,10-20(exc.15,19),30|
+  !  | isAdvected  | advected tracers flag (.TRUE. if iadv >= 0)          | /           | nqtrue  .TRUE. values  |
+  !  | isInPhysics | tracers not extracted from the main table in physics | /           | nqtottr .TRUE. values  |
+  !  | iso_iGroup  | Isotopes group index in isotopes(:)                  | /           | 1:nbIso                |
+  !  | iso_iName   | Isotope  name  index in isotopes(iso_iGroup)%trac(:) | iso_indnum  | 1:niso                 |
+  !  | iso_iZone   | Isotope  zone  index in isotopes(iso_iGroup)%zone(:) | zone_num    | 1:nzone                |
+  !  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
+  !  +-------------+------------------------------------------------------+-------------+------------------------+
+  !
+  !=== DERIVED TYPE EMBEDDING MOST OF THE ISOTOPES-RELATED QUANTITIES (LENGTH: nbIso, NUMBER OF ISOTOPES FAMILIES)
+  !    Each entry is accessible using "%" sign.
+  !  |-----------------+--------------------------------------------------+--------------------+-----------------+
+  !  |  entry | length | Meaning                                          |    Former name     | Possible values |
+  !  |-----------------+--------------------------------------------------+--------------------+-----------------+
+  !  | parent          | Parent tracer (isotopes family name)             |                    |                 |
+  !  | keys   | niso   | Isotopes keys/values pairs list + number         |                    |                 |
+  !  | trac   | ntiso  | Isotopes + tagging tracers list + number         | / | ntraciso       |                 |
+  !  | zone   | nzone  | Geographic tagging zones   list + number         | / | ntraceurs_zone |                 |
+  !  | phase  | nphas  | Phases                     list + number         |                    | [g][l][s], 1:3  |
+  !  | iqIsoPha        | Index in "qx"           = f(name(1:ntiso)),phas) | iqiso              | 1:nqtot         |
+  !  | itZonIso        | Index in "trac(1:ntiso)"= f(zone, name(1:niso))  | index_trac         | 1:ntiso         |
+  !  +-----------------+--------------------------------------------------+--------------------+-----------------+
+
+  REAL, PARAMETER :: min_qParent = 1.e-30, min_qMass = 1.e-18, min_ratio = 1.e-16 ! MVals et CRisi
+
+  !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES
+  INTEGER, SAVE :: nqtot, &                     !--- Tracers nb in dynamics (incl. higher moments + H2O)
+          nbtr, &                     !--- Tracers nb in physics  (excl. higher moments + H2O)
+          nqo, &                     !--- Number of water phases
+          nqtottr, &                    !--- Number of tracers passed to phytrac (TO BE DELETED ?)
+          nqCO2                         !--- Number of tracers of CO2  (ThL)
+  CHARACTER(LEN = maxlen), SAVE :: type_trac                     !--- Keyword for tracers type
+
+  !=== VARIABLES FOR INCA
+  INTEGER, SAVE, ALLOCATABLE :: conv_flg(:), &   !--- Convection     activation ; needed for INCA        (nbtr)
+          pbl_flg(:)      !--- Boundary layer activation ; needed for INCA        (nbtr)
 
 CONTAINS
 
-SUBROUTINE init_infotrac
-   USE control_mod, ONLY: planet_type
+  SUBROUTINE init_infotrac
+    USE control_mod, ONLY : planet_type
 #ifdef REPROBUS
    USE CHEM_REP,    ONLY: Init_chem_rep_trac
 #endif
-   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
-   IMPLICIT NONE
-!==============================================================================================================================
-!
-!   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
-!   -------
-!
-!   Modifications:
-!   --------------
-!   05/94: F.Forget      Modif special traceur
-!   02/02: M-A Filiberti Lecture de traceur.def
-!   01/22: D. Cugnet     Nouveaux tracer.def et tracer_*.def + encapsulation (types trac_type et isot_type)
-!
-!   Objet:
-!   ------
-!   GCM LMD nouvelle grille
-!
-!==============================================================================================================================
-!   ... modification de l'integration de q ( 26/04/94 ) ....
-!------------------------------------------------------------------------------------------------------------------------------
-! Declarations:
-   INCLUDE "dimensions.h"
-   INCLUDE "iniprint.h"
-
-!------------------------------------------------------------------------------------------------------------------------------
-! Local variables
-   INTEGER, ALLOCATABLE :: hadv(:), vadv(:)                          !--- Horizontal/vertical transport scheme number
-   INTEGER, ALLOCATABLE :: had (:), hadv_inca(:), conv_flg_inca(:), &!--- Variables specific to INCA
-                           vad (:), vadv_inca(:),  pbl_flg_inca(:)
-   CHARACTER(LEN=8), ALLOCATABLE :: solsym_inca(:)                   !--- Tracers names for INCA
-   INTEGER :: nqINCA
-   CHARACTER(LEN=2)      ::   suff(9)                                !--- Suffixes for schemes of order 3 or 4 (Prather)
-   CHARACTER(LEN=3)      :: descrq(30)                               !--- Advection scheme description tags
-   CHARACTER(LEN=maxlen) :: msg1, texp, ttp                          !--- Strings for messages and expanded tracers type
-   INTEGER :: fType                                                  !--- Tracers description file type ; 0: none
-                                                                     !--- 1/2/3: "traceur.def"/"tracer.def"/"tracer_*.def"
-   INTEGER :: nqtrue                                                 !--- Tracers nb from tracer.def (no higher order moments)
-   INTEGER :: iad                                                    !--- Advection scheme number
-   INTEGER :: iq, jq, nt, im, nm                                     !--- Indexes and temporary variables
-   LOGICAL :: lerr, ll
-   TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:)
-   TYPE(trac_type), POINTER             :: t1, t(:)
-   CHARACTER(LEN=maxlen),   ALLOCATABLE :: types_trac(:)  !--- Keyword for tracers type(s), parsed version
-
-   CHARACTER(LEN=*), PARAMETER :: modname="init_infotrac"
-!------------------------------------------------------------------------------------------------------------------------------
-! Initialization :
-!------------------------------------------------------------------------------------------------------------------------------
-   suff          = ['x ','y ','z ','xx','xy','xz','yy','yz','zz']
-   descrq( 1:30) =  '   '
-   descrq( 1: 2) = ['LMV','BAK']
-   descrq(10:20) = ['VL1','VLP','FH1','FH2','VLH','   ','PPM','PPS','PPP','   ','SLP']
-   descrq(30)    =  'PRA'
-    
-   CALL msg('type_trac = "'//TRIM(type_trac)//'"', modname)
-
-   lerr=strParse(type_trac, '|', types_trac, n=nt)
-   IF (nt > 1) THEN
+    USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_INCA, CPPKEY_STRATAER
+    IMPLICIT NONE
+    !==============================================================================================================================
+    !
+    !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
+    !   -------
+    !
+    !   Modifications:
+    !   --------------
+    !   05/94: F.Forget      Modif special traceur
+    !   02/02: M-A Filiberti Lecture de traceur.def
+    !   01/22: D. Cugnet     Nouveaux tracer.def et tracer_*.def + encapsulation (types trac_type et isot_type)
+    !
+    !   Objet:
+    !   ------
+    !   GCM LMD nouvelle grille
+    !
+    !==============================================================================================================================
+    !   ... modification de l'integration de q ( 26/04/94 ) ....
+    !------------------------------------------------------------------------------------------------------------------------------
+    ! Declarations:
+    INCLUDE "dimensions.h"
+    INCLUDE "iniprint.h"
+
+    !------------------------------------------------------------------------------------------------------------------------------
+    ! Local variables
+    INTEGER, ALLOCATABLE :: hadv(:), vadv(:)                          !--- Horizontal/vertical transport scheme number
+    INTEGER, ALLOCATABLE :: had (:), hadv_inca(:), conv_flg_inca(:), &!--- Variables specific to INCA
+            vad (:), vadv_inca(:), pbl_flg_inca(:)
+    CHARACTER(LEN = 8), ALLOCATABLE :: solsym_inca(:)                   !--- Tracers names for INCA
+    INTEGER :: nqINCA
+    CHARACTER(LEN = 2) :: suff(9)                                !--- Suffixes for schemes of order 3 or 4 (Prather)
+    CHARACTER(LEN = 3) :: descrq(30)                               !--- Advection scheme description tags
+    CHARACTER(LEN = maxlen) :: msg1, texp, ttp                          !--- Strings for messages and expanded tracers type
+    INTEGER :: fType                                                  !--- Tracers description file type ; 0: none
+    !--- 1/2/3: "traceur.def"/"tracer.def"/"tracer_*.def"
+    INTEGER :: nqtrue                                                 !--- Tracers nb from tracer.def (no higher order moments)
+    INTEGER :: iad                                                    !--- Advection scheme number
+    INTEGER :: iq, jq, nt, im, nm                                     !--- Indexes and temporary variables
+    LOGICAL :: lerr, ll
+    TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:)
+    TYPE(trac_type), POINTER :: t1, t(:)
+    CHARACTER(LEN = maxlen), ALLOCATABLE :: types_trac(:)  !--- Keyword for tracers type(s), parsed version
+
+    CHARACTER(LEN = *), PARAMETER :: modname = "init_infotrac"
+    !------------------------------------------------------------------------------------------------------------------------------
+    ! Initialization :
+    !------------------------------------------------------------------------------------------------------------------------------
+    suff = ['x ', 'y ', 'z ', 'xx', 'xy', 'xz', 'yy', 'yz', 'zz']
+    descrq(1:30) = '   '
+    descrq(1:2) = ['LMV', 'BAK']
+    descrq(10:20) = ['VL1', 'VLP', 'FH1', 'FH2', 'VLH', '   ', 'PPM', 'PPS', 'PPP', '   ', 'SLP']
+    descrq(30) = 'PRA'
+
+    CALL msg('type_trac = "' // TRIM(type_trac) // '"', modname)
+
+    lerr = strParse(type_trac, '|', types_trac, n = nt)
+    IF (nt > 1) THEN
       IF (nt > 2) CALL abort_gcm(modname, 'you need to modify type_trac, this version is not supported by lmdz', 1)
-      if (nt == 2) type_trac=types_trac(2)
-   ENDIF
-
-
-   
-   !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
-   msg1 = 'For type_trac = "'//TRIM(type_trac)//'":'
-   SELECT CASE(type_trac)
-      CASE('inca'); CALL msg(TRIM(msg1)//' coupling with INCA chemistry model',        modname)
-      CASE('inco'); CALL msg(TRIM(msg1)//' coupling jointly with INCA and CO2 cycle',  modname)
-      CASE('repr'); CALL msg(TRIM(msg1)//' coupling with REPROBUS chemistry model',    modname)
-      CASE('co2i'); CALL msg(TRIM(msg1)//' you have chosen to run with CO2 cycle',     modname)
-      CASE('coag'); CALL msg(TRIM(msg1)//' tracers are treated for COAGULATION tests', modname)
-      CASE('lmdz'); CALL msg(TRIM(msg1)//' tracers are treated in LMDZ only',          modname)
-      CASE DEFAULT; CALL abort_gcm(modname,'type_trac='//TRIM(type_trac)//' not possible yet.',1)
-   END SELECT
-
-   !--- COHERENCE TEST BETWEEN "type_trac" AND PREPROCESSING KEYS
-   SELECT CASE(type_trac)
-      CASE('inca', 'inco')
+      if (nt == 2) type_trac = types_trac(2)
+    ENDIF
+
+
+
+    !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
+    msg1 = 'For type_trac = "' // TRIM(type_trac) // '":'
+    SELECT CASE(type_trac)
+    CASE('inca'); CALL msg(TRIM(msg1) // ' coupling with INCA chemistry model', modname)
+    CASE('inco'); CALL msg(TRIM(msg1) // ' coupling jointly with INCA and CO2 cycle', modname)
+    CASE('repr'); CALL msg(TRIM(msg1) // ' coupling with REPROBUS chemistry model', modname)
+    CASE('co2i'); CALL msg(TRIM(msg1) // ' you have chosen to run with CO2 cycle', modname)
+    CASE('coag'); CALL msg(TRIM(msg1) // ' tracers are treated for COAGULATION tests', modname)
+    CASE('lmdz'); CALL msg(TRIM(msg1) // ' tracers are treated in LMDZ only', modname)
+    CASE DEFAULT; CALL abort_gcm(modname, 'type_trac=' // TRIM(type_trac) // ' not possible yet.', 1)
+    END SELECT
+
+    !--- COHERENCE TEST BETWEEN "type_trac" AND PREPROCESSING KEYS
+    SELECT CASE(type_trac)
+    CASE('inca', 'inco')
       IF (CPPKEY_INCA) THEN
-         CALL abort_gcm(modname, 'You must add cpp key INCA and compile with INCA code', 1)
+        CALL abort_gcm(modname, 'You must add cpp key INCA and compile with INCA code', 1)
       END IF
-      CASE('repr')
+    CASE('repr')
 #ifndef REPROBUS
-         CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)
+      CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)
 #endif
-      CASE('coag')
-#ifndef CPP_StratAer
-         CALL abort_gcm(modname, 'You must add cpp key StratAer and compile with StratAer code', 1)
-#endif
-   END SELECT
-
-   nqCO2 = COUNT( [type_trac == 'inco', type_trac == 'co2i'] )
-
-!==============================================================================================================================
-! 1) Get the numbers of: true (first order only) tracers "nqtrue", water tracers "nqo" (vapor/liquid/solid)
-!==============================================================================================================================
-   texp = type_trac                                                  !=== EXPANDED VERSION OF "type_trac", WITH "|" SEPARATOR
-   IF(texp == 'inco') texp = 'co2i|inca'
-   IF(texp /= 'lmdz') texp = 'lmdz|'//TRIM(texp)
-
-   !=== DETERMINE THE TYPE OF THE INPUT TRACERS DESCRIPTION FILE
-   IF(testTracersFiles(modname, texp, fType, .TRUE.)) CALL abort_gcm(modname, 'problem with tracers file(s)',1)
-   ttp = type_trac; IF(fType /= 1) ttp = texp
-
-   IF(readTracersFiles(ttp, lRepr=type_trac=='repr')) CALL abort_gcm(modname, 'problem with tracers file(s)',1)
-   !---------------------------------------------------------------------------------------------------------------------------
-   IF(fType == 0) CALL abort_gcm(modname, 'Missing tracers file: "traceur.def", "tracer.def" or "tracer_<keyword>.def file.',1)
-   !---------------------------------------------------------------------------------------------------------------------------
-   IF(fType == 1 .AND. ANY(['inca','inco']==type_trac)) THEN         !=== FOUND OLD STYLE INCA "traceur.def"
-   !---------------------------------------------------------------------------------------------------------------------------
-   IF (CPPKEY_INCA) THEN
-      nqo = SIZE(tracers) - nqCO2
-      CALL Init_chem_inca_trac(nqINCA)                               !--- Get nqINCA from INCA
-      nbtr = nqINCA + nqCO2                                          !--- Number of tracers passed to phytrac
-      nqtrue = nbtr + nqo                                            !--- Total number of "true" tracers
-      IF(ALL([2,3] /= nqo)) CALL abort_gcm(modname, 'Only 2 or 3 water phases allowed ; found nqo='//TRIM(int2str(nqo)), 1)
-      ALLOCATE(hadv(nqtrue), hadv_inca(nqINCA), conv_flg_inca(nqINCA), solsym_inca(nqINCA))
-      ALLOCATE(vadv(nqtrue), vadv_inca(nqINCA),  pbl_flg_inca(nqINCA))
-      CALL init_transport(solsym_inca, conv_flg_inca, pbl_flg_inca, hadv_inca, vadv_inca)
-      ALLOCATE(ttr(nqtrue))
-      ttr(1:nqo+nqCO2)                  = tracers
-      ttr(1    :      nqo   )%component = 'lmdz'
-      ttr(1+nqo:nqCO2+nqo   )%component = 'co2i'
-      ttr(1+nqo+nqCO2:nqtrue)%component = 'inca'
-      ttr(1+nqo      :nqtrue)%name      = [('CO2     ', iq=1, nqCO2), solsym_inca]
-      ttr(1+nqo+nqCO2:nqtrue)%parent    = tran0
-      ttr(1+nqo+nqCO2:nqtrue)%phase     = 'g'
-      lerr = getKey('hadv', had, ky=tracers(:)%keys)
-      lerr = getKey('vadv', vad, ky=tracers(:)%keys)
-      hadv(1:nqo+nqCO2) = had(:); hadv(1+nqo+nqCO2:nqtrue) = hadv_inca
-      vadv(1:nqo+nqCO2) = vad(:); vadv(1+nqo+nqCO2:nqtrue) = vadv_inca
-      CALL MOVE_ALLOC(FROM=ttr, TO=tracers)
-      DO iq = 1, nqtrue
-         t1 => tracers(iq)
-         CALL addKey('name',      t1%name,      t1%keys)
-         CALL addKey('component', t1%component, t1%keys)
-         CALL addKey('parent',    t1%parent,    t1%keys)
-         CALL addKey('phase',     t1%phase,     t1%keys)
-      END DO
-      IF(setGeneration(tracers)) CALL abort_gcm(modname,'See above',1) !- SET FIELDS %iGeneration, %gen0Name
-      DEALLOCATE(had, hadv_inca, vad, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca)
-   END IF
-   !---------------------------------------------------------------------------------------------------------------------------
-   ELSE                                                              !=== OTHER CASES (OLD OR NEW FORMAT, NO INCA MODULE)
-   !---------------------------------------------------------------------------------------------------------------------------
-      nqo    =        COUNT(delPhase(tracers(:)%name)     == 'H2O' &
-                               .AND. tracers(:)%component == 'lmdz') !--- Number of water phases
+    CASE('coag')
+      IF (.NOT. CPPKEY_STRATAER) THEN
+        CALL abort_gcm(modname, 'You must add cpp key StratAer and compile with StratAer code', 1)
+      END IF
+    END SELECT
+
+    nqCO2 = COUNT([type_trac == 'inco', type_trac == 'co2i'])
+
+    !==============================================================================================================================
+    ! 1) Get the numbers of: true (first order only) tracers "nqtrue", water tracers "nqo" (vapor/liquid/solid)
+    !==============================================================================================================================
+    texp = type_trac                                                  !=== EXPANDED VERSION OF "type_trac", WITH "|" SEPARATOR
+    IF(texp == 'inco') texp = 'co2i|inca'
+    IF(texp /= 'lmdz') texp = 'lmdz|' // TRIM(texp)
+
+    !=== DETERMINE THE TYPE OF THE INPUT TRACERS DESCRIPTION FILE
+    IF(testTracersFiles(modname, texp, fType, .TRUE.)) CALL abort_gcm(modname, 'problem with tracers file(s)', 1)
+    ttp = type_trac; IF(fType /= 1) ttp = texp
+
+    IF(readTracersFiles(ttp, lRepr = type_trac=='repr')) CALL abort_gcm(modname, 'problem with tracers file(s)', 1)
+    !---------------------------------------------------------------------------------------------------------------------------
+    IF(fType == 0) CALL abort_gcm(modname, 'Missing tracers file: "traceur.def", "tracer.def" or "tracer_<keyword>.def file.', 1)
+    !---------------------------------------------------------------------------------------------------------------------------
+    IF(fType == 1 .AND. ANY(['inca', 'inco']==type_trac)) THEN         !=== FOUND OLD STYLE INCA "traceur.def"
+      !---------------------------------------------------------------------------------------------------------------------------
+      IF (CPPKEY_INCA) THEN
+        nqo = SIZE(tracers) - nqCO2
+        CALL Init_chem_inca_trac(nqINCA)                               !--- Get nqINCA from INCA
+        nbtr = nqINCA + nqCO2                                          !--- Number of tracers passed to phytrac
+        nqtrue = nbtr + nqo                                            !--- Total number of "true" tracers
+        IF(ALL([2, 3] /= nqo)) CALL abort_gcm(modname, 'Only 2 or 3 water phases allowed ; found nqo=' // TRIM(int2str(nqo)), 1)
+        ALLOCATE(hadv(nqtrue), hadv_inca(nqINCA), conv_flg_inca(nqINCA), solsym_inca(nqINCA))
+        ALLOCATE(vadv(nqtrue), vadv_inca(nqINCA), pbl_flg_inca(nqINCA))
+        CALL init_transport(solsym_inca, conv_flg_inca, pbl_flg_inca, hadv_inca, vadv_inca)
+        ALLOCATE(ttr(nqtrue))
+        ttr(1:nqo + nqCO2) = tracers
+        ttr(1:nqo)%component = 'lmdz'
+        ttr(1 + nqo:nqCO2 + nqo)%component = 'co2i'
+        ttr(1 + nqo + nqCO2:nqtrue)%component = 'inca'
+        ttr(1 + nqo:nqtrue)%name = [('CO2     ', iq = 1, nqCO2), solsym_inca]
+        ttr(1 + nqo + nqCO2:nqtrue)%parent = tran0
+        ttr(1 + nqo + nqCO2:nqtrue)%phase = 'g'
+        lerr = getKey('hadv', had, ky = tracers(:)%keys)
+        lerr = getKey('vadv', vad, ky = tracers(:)%keys)
+        hadv(1:nqo + nqCO2) = had(:); hadv(1 + nqo + nqCO2:nqtrue) = hadv_inca
+        vadv(1:nqo + nqCO2) = vad(:); vadv(1 + nqo + nqCO2:nqtrue) = vadv_inca
+        CALL MOVE_ALLOC(FROM = ttr, TO = tracers)
+        DO iq = 1, nqtrue
+          t1 => tracers(iq)
+          CALL addKey('name', t1%name, t1%keys)
+          CALL addKey('component', t1%component, t1%keys)
+          CALL addKey('parent', t1%parent, t1%keys)
+          CALL addKey('phase', t1%phase, t1%keys)
+        END DO
+        IF(setGeneration(tracers)) CALL abort_gcm(modname, 'See above', 1) !- SET FIELDS %iGeneration, %gen0Name
+        DEALLOCATE(had, hadv_inca, vad, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca)
+      END IF
+      !---------------------------------------------------------------------------------------------------------------------------
+    ELSE                                                              !=== OTHER CASES (OLD OR NEW FORMAT, NO INCA MODULE)
+      !---------------------------------------------------------------------------------------------------------------------------
+      nqo = COUNT(delPhase(tracers(:)%name)     == 'H2O' &
+              .AND. tracers(:)%component == 'lmdz') !--- Number of water phases
       nqtrue = SIZE(tracers)                                         !--- Total number of "true" tracers
-      nbtr   = nqtrue-COUNT(delPhase(tracers(:)%gen0Name) == 'H2O' &
-                               .AND. tracers(:)%component == 'lmdz') !--- Number of tracers passed to phytrac
-   IF (CPPKEY_INCA) THEN
-      nqINCA = COUNT(tracers(:)%component == 'inca')
-   END IF
-      lerr = getKey('hadv', hadv, ky=tracers(:)%keys)
-      lerr = getKey('vadv', vadv, ky=tracers(:)%keys)
-   !---------------------------------------------------------------------------------------------------------------------------
-   END IF
-   !---------------------------------------------------------------------------------------------------------------------------
+      nbtr = nqtrue - COUNT(delPhase(tracers(:)%gen0Name) == 'H2O' &
+              .AND. tracers(:)%component == 'lmdz') !--- Number of tracers passed to phytrac
+      IF (CPPKEY_INCA) THEN
+        nqINCA = COUNT(tracers(:)%component == 'inca')
+      END IF
+      lerr = getKey('hadv', hadv, ky = tracers(:)%keys)
+      lerr = getKey('vadv', vadv, ky = tracers(:)%keys)
+      !---------------------------------------------------------------------------------------------------------------------------
+    END IF
+    !---------------------------------------------------------------------------------------------------------------------------
 
 #ifdef REPROBUS
@@ -282,60 +282,60 @@
 
 #endif
-!==============================================================================================================================
-! 2) Calculate nqtot, number of tracers needed (greater if advection schemes 20 or 30 have been chosen).
-!==============================================================================================================================
-   DO iq = 1, nqtrue
-      IF( hadv(iq)<20 .OR. (ANY(hadv(iq)==[20,30]) .AND. hadv(iq)==vadv(iq)) ) CYCLE
-      WRITE(msg1,'("The choice hadv=",i0,", vadv=",i0,a)')hadv(iq),vadv(iq),' for "'//TRIM(tracers(iq)%name)//'" is not available'
+    !==============================================================================================================================
+    ! 2) Calculate nqtot, number of tracers needed (greater if advection schemes 20 or 30 have been chosen).
+    !==============================================================================================================================
+    DO iq = 1, nqtrue
+      IF(hadv(iq)<20 .OR. (ANY(hadv(iq)==[20, 30]) .AND. hadv(iq)==vadv(iq))) CYCLE
+      WRITE(msg1, '("The choice hadv=",i0,", vadv=",i0,a)')hadv(iq), vadv(iq), ' for "' // TRIM(tracers(iq)%name) // '" is not available'
       CALL abort_gcm(modname, TRIM(msg1), 1)
-   END DO
-   nqtot =    COUNT( hadv< 20 .AND. vadv< 20 ) &                     !--- No additional tracer
-         +  4*COUNT( hadv==20 .AND. vadv==20 ) &                     !--- 3  additional tracers
-         + 10*COUNT( hadv==30 .AND. vadv==30 )                       !--- 9  additional tracers
-
-   !--- More tracers due to the choice of advection scheme => assign total number of tracers
-   IF( nqtot /= nqtrue ) THEN
+    END DO
+    nqtot = COUNT(hadv< 20 .AND. vadv< 20) &                     !--- No additional tracer
+            + 4 * COUNT(hadv==20 .AND. vadv==20) &                     !--- 3  additional tracers
+            + 10 * COUNT(hadv==30 .AND. vadv==30)                       !--- 9  additional tracers
+
+    !--- More tracers due to the choice of advection scheme => assign total number of tracers
+    IF(nqtot /= nqtrue) THEN
       CALL msg('The choice of advection scheme for one or more tracers makes it necessary to add tracers')
-      CALL msg('The number of true tracers is '//TRIM(int2str(nqtrue)))
-      CALL msg('The total number of tracers needed is '//TRIM(int2str(nqtot)))
-   END IF
-
-!==============================================================================================================================
-! 3) Determine the advection scheme choice for water and tracers "iadv" and the fields long name, isAdvected.
-!     iadv = 1    "LMDZ-specific humidity transport" (for H2O vapour)          LMV
-!     iadv = 2    backward                           (for H2O liquid)          BAK
-!     iadv = 14   Van-Leer + specific humidity, modified by Francis Codron     VLH
-!     iadv = 10   Van-Leer (chosen for vapour and liquid water)                VL1
-!     iadv = 11   Van-Leer for hadv and PPM version (Monotonic) for vadv       VLP
-!     iadv = 12   Frederic Hourdin I                                           FH1
-!     iadv = 13   Frederic Hourdin II                                          FH2
-!     iadv = 16   Monotonic         PPM (Collela & Woodward 1984)              PPM
-!     iadv = 17   Semi-monotonic    PPM (overshoots allowed)                   PPS
-!     iadv = 18   Definite positive PPM (overshoots and undershoots allowed)   PPP
-!     iadv = 20   Slopes                                                       SLP
-!     iadv = 30   Prather                                                      PRA
-!
-!        In array q(ij,l,iq) : iq = 1/2[/3]    for vapour/liquid[/ice] water
-!        And optionaly:        iq = 3[4],nqtot for other tracers
-!==============================================================================================================================
-   ALLOCATE(ttr(nqtot))
-   jq = nqtrue+1; tracers(:)%iadv = -1
-   DO iq = 1, nqtrue
+      CALL msg('The number of true tracers is ' // TRIM(int2str(nqtrue)))
+      CALL msg('The total number of tracers needed is ' // TRIM(int2str(nqtot)))
+    END IF
+
+    !==============================================================================================================================
+    ! 3) Determine the advection scheme choice for water and tracers "iadv" and the fields long name, isAdvected.
+    !     iadv = 1    "LMDZ-specific humidity transport" (for H2O vapour)          LMV
+    !     iadv = 2    backward                           (for H2O liquid)          BAK
+    !     iadv = 14   Van-Leer + specific humidity, modified by Francis Codron     VLH
+    !     iadv = 10   Van-Leer (chosen for vapour and liquid water)                VL1
+    !     iadv = 11   Van-Leer for hadv and PPM version (Monotonic) for vadv       VLP
+    !     iadv = 12   Frederic Hourdin I                                           FH1
+    !     iadv = 13   Frederic Hourdin II                                          FH2
+    !     iadv = 16   Monotonic         PPM (Collela & Woodward 1984)              PPM
+    !     iadv = 17   Semi-monotonic    PPM (overshoots allowed)                   PPS
+    !     iadv = 18   Definite positive PPM (overshoots and undershoots allowed)   PPP
+    !     iadv = 20   Slopes                                                       SLP
+    !     iadv = 30   Prather                                                      PRA
+    !
+    !        In array q(ij,l,iq) : iq = 1/2[/3]    for vapour/liquid[/ice] water
+    !        And optionaly:        iq = 3[4],nqtot for other tracers
+    !==============================================================================================================================
+    ALLOCATE(ttr(nqtot))
+    jq = nqtrue + 1; tracers(:)%iadv = -1
+    DO iq = 1, nqtrue
       t1 => tracers(iq)
 
       !--- VERIFY THE CHOICE OF ADVECTION SCHEME
       iad = -1
-      IF(hadv(iq)     ==    vadv(iq)    ) iad = hadv(iq)
+      IF(hadv(iq)     ==    vadv(iq)) iad = hadv(iq)
       IF(hadv(iq)==10 .AND. vadv(iq)==16) iad = 11
-      WRITE(msg1,'("Bad choice of advection scheme for ",a,": hadv = ",i0,", vadv = ",i0)')TRIM(t1%name), hadv(iq), vadv(iq)
+      WRITE(msg1, '("Bad choice of advection scheme for ",a,": hadv = ",i0,", vadv = ",i0)')TRIM(t1%name), hadv(iq), vadv(iq)
       IF(iad == -1) CALL abort_gcm(modname, msg1, 1)
 
       !--- SET FIELDS %longName, %iadv, %isAdvected, %isInPhysics
-      t1%longName   = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad)
-      t1%iadv       = iad
+      t1%longName = t1%name; IF(iad > 0) t1%longName = TRIM(t1%name) // descrq(iad)
+      t1%iadv = iad
       t1%isAdvected = iad >= 0
-      t1%isInPhysics= delPhase(t1%gen0Name) /= 'H2O' &
-                          .OR. t1%component /= 'lmdz' !=== OTHER EXCEPTIONS TO BE ADDED: CO2i, SURSATURATED WATER CLOUD...
-      ttr(iq)       = t1
+      t1%isInPhysics = delPhase(t1%gen0Name) /= 'H2O' &
+              .OR. t1%component /= 'lmdz' !=== OTHER EXCEPTIONS TO BE ADDED: CO2i, SURSATURATED WATER CLOUD...
+      ttr(iq) = t1
 
       !--- DEFINE THE HIGHER ORDER TRACERS, IF ANY
@@ -344,85 +344,85 @@
       IF(iad == 30) nm = 9                                           !--- 3rd order scheme
       IF(nm == 0) CYCLE                                              !--- No higher moments
-      ttr(jq+1:jq+nm)             = t1
-      ttr(jq+1:jq+nm)%name        = [ (TRIM(t1%name)    //'-'//TRIM(suff(im)), im=1, nm) ]
-      ttr(jq+1:jq+nm)%parent      = [ (TRIM(t1%parent)  //'-'//TRIM(suff(im)), im=1, nm) ]
-      ttr(jq+1:jq+nm)%longName    = [ (TRIM(t1%longName)//'-'//TRIM(suff(im)), im=1, nm) ]
-      ttr(jq+1:jq+nm)%iadv        = [ (-iad,    im=1, nm) ]
-      ttr(jq+1:jq+nm)%isAdvected  = [ (.FALSE., im=1, nm) ]
+      ttr(jq + 1:jq + nm) = t1
+      ttr(jq + 1:jq + nm)%name = [ (TRIM(t1%name) // '-' // TRIM(suff(im)), im = 1, nm) ]
+      ttr(jq + 1:jq + nm)%parent = [ (TRIM(t1%parent) // '-' // TRIM(suff(im)), im = 1, nm) ]
+      ttr(jq + 1:jq + nm)%longName = [ (TRIM(t1%longName) // '-' // TRIM(suff(im)), im = 1, nm) ]
+      ttr(jq + 1:jq + nm)%iadv = [ (-iad, im = 1, nm) ]
+      ttr(jq + 1:jq + nm)%isAdvected = [ (.FALSE., im = 1, nm) ]
       jq = jq + nm
-   END DO
-   DEALLOCATE(hadv, vadv)
-   CALL MOVE_ALLOC(FROM=ttr, TO=tracers)
-
-   !--- SET FIELDS %iqParent, %nqChildren, %iGeneration, %iqDescen, %nqDescen
-   IF(indexUpdate(tracers)) CALL abort_gcm(modname, 'problem with tracers indices update', 1)
-
-   !=== TEST ADVECTION SCHEME
-   DO iq=1,nqtot ; t1 => tracers(iq); iad = t1%iadv
-
-      !--- ONLY TESTED VALUES FOR TRACERS FOR NOW:               iadv = 14, 10 (and 0 for non-transported tracers)
-      IF(ALL([10,14,0] /= iad)) &
-         CALL abort_gcm(modname, 'Not tested for iadv='//TRIM(int2str(iad))//' ; 10 or 14 only are allowed !', 1)
-
-      !--- ONLY TESTED VALUES FOR PARENTS HAVING CHILDS FOR NOW: iadv = 14, 10 (PARENTS: TRACERS OF GENERATION 1)
-      IF(ALL([10,14] /= iad) .AND. t1%iGeneration == 1 .AND. ANY(tracers(:)%iGeneration > 1)) &
-         CALL abort_gcm(modname, 'iadv='//TRIM(int2str(iad))//' not implemented for parents ; 10 or 14 only are allowed !', 1)
-
-      !--- ONLY TESTED VALUES FOR CHILDS FOR NOW:                iadv = 10     (CHILDS:  TRACERS OF GENERATION GREATER THAN 1)
-      IF(fmsg('WARNING ! iadv='//TRIM(int2str(iad))//' not implemented for childs. Setting iadv=10 for "'//TRIM(t1%name)//'"',&
-         modname, iad /= 10 .AND. t1%iGeneration > 1)) t1%iadv = 10
-
-      !--- ONLY VALID SCHEME NUMBER FOR WATER VAPOUR:            iadv = 14
-      ll = t1%name /= addPhase('H2O','g')
-      IF(fmsg('WARNING ! iadv=14 is valid for water vapour only. Setting iadv=10 for "'//TRIM(t1%name)//'".', &
-         modname, iad == 14 .AND. ll))                 t1%iadv = 10
-   END DO
-
-   !=== READ PHYSICAL PARAMETERS FOR ISOTOPES ; DONE HERE BECAUSE dynetat0 AND iniacademic NEED "tnat" AND "alpha_ideal"
-   niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE.
-   IF(processIsotopes()) CALL abort_gcm(modname, 'problem when processing isotopes parameters', 1)
-
-   !--- Convection / boundary layer activation for all tracers
-   ALLOCATE(conv_flg(nbtr)); conv_flg(1:nbtr) = 1
-   ALLOCATE( pbl_flg(nbtr));  pbl_flg(1:nbtr) = 1
-
-   !--- Note: nqtottr can differ from nbtr when nmom/=0
-   nqtottr = nqtot - COUNT(delPhase(tracers%gen0Name) == 'H2O' .AND. tracers%component == 'lmdz')
-   IF(COUNT(tracers%iso_iName == 0) - COUNT(delPhase(tracers%name) == 'H2O' .AND. tracers%component == 'lmdz') /= nqtottr) &
-      CALL abort_gcm(modname, 'problem with the computation of nqtottr', 1)
-
-   !=== DISPLAY THE RESULTS
-   CALL msg('nqo    = '//TRIM(int2str(nqo)),    modname)
-   CALL msg('nbtr   = '//TRIM(int2str(nbtr)),   modname)
-   CALL msg('nqtrue = '//TRIM(int2str(nqtrue)), modname)
-   CALL msg('nqtot  = '//TRIM(int2str(nqtot)),  modname)
-   CALL msg('niso   = '//TRIM(int2str(niso)),   modname)
-   CALL msg('ntiso  = '//TRIM(int2str(ntiso)),  modname)
-   IF (CPPKEY_INCA) THEN
-      CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
-      CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
-   END IF
-   t => tracers
-   CALL msg('Information stored in infotrac :', modname)
-
-   IF(dispTable('isssssssssiiiiiiiii', ['iq  ', 'name', 'lNam', 'g0Nm', 'prnt', 'type', 'phas', 'comp',    &
-                'isPh', 'isAd', 'iadv', 'iGen', 'iqPr', 'nqDe', 'nqCh', 'iGrp', 'iNam', 'iZon', 'iPha'],   &
-      cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, bool2str(t%isInPhysics), &
-                                                                                  bool2str(t%isAdvected)), &
-      cat([(iq, iq=1, nqtot)], t%iadv, t%iGeneration, t%iqParent, t%nqDescen, t%nqChildren, t%iso_iGroup,  &
-                  t%iso_iName, t%iso_iZone, t%iso_iPhase), nColMax=maxTableWidth, nHead=2, sub=modname))   &
-      CALL abort_gcm(modname, "problem with the tracers table content", 1)
-   IF(niso > 0) THEN
-      CALL msg('Where, for isotopes family "'//TRIM(isotope%parent)//'":', modname)
-      CALL msg('  isoKeys%name = '//strStack(isoKeys%name), modname)
-      CALL msg('  isoName = '//strStack(isoName),      modname)
-      CALL msg('  isoZone = '//strStack(isoZone),      modname)
-      CALL msg('  isoPhas = '//TRIM(isoPhas),          modname)
-   ELSE
+    END DO
+    DEALLOCATE(hadv, vadv)
+    CALL MOVE_ALLOC(FROM = ttr, TO = tracers)
+
+    !--- SET FIELDS %iqParent, %nqChildren, %iGeneration, %iqDescen, %nqDescen
+    IF(indexUpdate(tracers)) CALL abort_gcm(modname, 'problem with tracers indices update', 1)
+
+    !=== TEST ADVECTION SCHEME
+    DO iq = 1, nqtot ; t1 => tracers(iq); iad = t1%iadv
+
+    !--- ONLY TESTED VALUES FOR TRACERS FOR NOW:               iadv = 14, 10 (and 0 for non-transported tracers)
+    IF(ALL([10, 14, 0] /= iad)) &
+            CALL abort_gcm(modname, 'Not tested for iadv=' // TRIM(int2str(iad)) // ' ; 10 or 14 only are allowed !', 1)
+
+    !--- ONLY TESTED VALUES FOR PARENTS HAVING CHILDS FOR NOW: iadv = 14, 10 (PARENTS: TRACERS OF GENERATION 1)
+    IF(ALL([10, 14] /= iad) .AND. t1%iGeneration == 1 .AND. ANY(tracers(:)%iGeneration > 1)) &
+            CALL abort_gcm(modname, 'iadv=' // TRIM(int2str(iad)) // ' not implemented for parents ; 10 or 14 only are allowed !', 1)
+
+    !--- ONLY TESTED VALUES FOR CHILDS FOR NOW:                iadv = 10     (CHILDS:  TRACERS OF GENERATION GREATER THAN 1)
+    IF(fmsg('WARNING ! iadv=' // TRIM(int2str(iad)) // ' not implemented for childs. Setting iadv=10 for "' // TRIM(t1%name) // '"', &
+            modname, iad /= 10 .AND. t1%iGeneration > 1)) t1%iadv = 10
+
+    !--- ONLY VALID SCHEME NUMBER FOR WATER VAPOUR:            iadv = 14
+    ll = t1%name /= addPhase('H2O', 'g')
+    IF(fmsg('WARNING ! iadv=14 is valid for water vapour only. Setting iadv=10 for "' // TRIM(t1%name) // '".', &
+            modname, iad == 14 .AND. ll))                 t1%iadv = 10
+    END DO
+
+    !=== READ PHYSICAL PARAMETERS FOR ISOTOPES ; DONE HERE BECAUSE dynetat0 AND iniacademic NEED "tnat" AND "alpha_ideal"
+    niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE.
+    IF(processIsotopes()) CALL abort_gcm(modname, 'problem when processing isotopes parameters', 1)
+
+    !--- Convection / boundary layer activation for all tracers
+    ALLOCATE(conv_flg(nbtr)); conv_flg(1:nbtr) = 1
+    ALLOCATE(pbl_flg(nbtr));  pbl_flg(1:nbtr) = 1
+
+    !--- Note: nqtottr can differ from nbtr when nmom/=0
+    nqtottr = nqtot - COUNT(delPhase(tracers%gen0Name) == 'H2O' .AND. tracers%component == 'lmdz')
+    IF(COUNT(tracers%iso_iName == 0) - COUNT(delPhase(tracers%name) == 'H2O' .AND. tracers%component == 'lmdz') /= nqtottr) &
+            CALL abort_gcm(modname, 'problem with the computation of nqtottr', 1)
+
+    !=== DISPLAY THE RESULTS
+    CALL msg('nqo    = ' // TRIM(int2str(nqo)), modname)
+    CALL msg('nbtr   = ' // TRIM(int2str(nbtr)), modname)
+    CALL msg('nqtrue = ' // TRIM(int2str(nqtrue)), modname)
+    CALL msg('nqtot  = ' // TRIM(int2str(nqtot)), modname)
+    CALL msg('niso   = ' // TRIM(int2str(niso)), modname)
+    CALL msg('ntiso  = ' // TRIM(int2str(ntiso)), modname)
+    IF (CPPKEY_INCA) THEN
+      CALL msg('nqCO2  = ' // TRIM(int2str(nqCO2)), modname)
+      CALL msg('nqINCA = ' // TRIM(int2str(nqINCA)), modname)
+    END IF
+    t => tracers
+    CALL msg('Information stored in infotrac :', modname)
+
+    IF(dispTable('isssssssssiiiiiiiii', ['iq  ', 'name', 'lNam', 'g0Nm', 'prnt', 'type', 'phas', 'comp', &
+            'isPh', 'isAd', 'iadv', 'iGen', 'iqPr', 'nqDe', 'nqCh', 'iGrp', 'iNam', 'iZon', 'iPha'], &
+            cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, bool2str(t%isInPhysics), &
+                    bool2str(t%isAdvected)), &
+            cat([(iq, iq = 1, nqtot)], t%iadv, t%iGeneration, t%iqParent, t%nqDescen, t%nqChildren, t%iso_iGroup, &
+                    t%iso_iName, t%iso_iZone, t%iso_iPhase), nColMax = maxTableWidth, nHead = 2, sub = modname))   &
+            CALL abort_gcm(modname, "problem with the tracers table content", 1)
+    IF(niso > 0) THEN
+      CALL msg('Where, for isotopes family "' // TRIM(isotope%parent) // '":', modname)
+      CALL msg('  isoKeys%name = ' // strStack(isoKeys%name), modname)
+      CALL msg('  isoName = ' // strStack(isoName), modname)
+      CALL msg('  isoZone = ' // strStack(isoZone), modname)
+      CALL msg('  isoPhas = ' // TRIM(isoPhas), modname)
+    ELSE
       CALL msg('No isotopes identified.', modname)
-   END IF
-   CALL msg('end', modname)
-
-END SUBROUTINE init_infotrac
+    END IF
+    CALL msg('end', modname)
+
+  END SUBROUTINE init_infotrac
 
 END MODULE infotrac
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limx.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limx.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limx.F	(revision 5098)
@@ -43,5 +43,5 @@
       save first
 
-      REAL      SSUM,CVMGP,CVMGT
+      REAL      SSUM
       integer ismax,ismin
       EXTERNAL  SSUM, ismin,ismax
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limz.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limz.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limz.F	(revision 5098)
@@ -43,5 +43,5 @@
       save first
 
-      REAL      SSUM,CVMGP,CVMGT
+      REAL      SSUM
       integer ismax,ismin
       EXTERNAL  SSUM, ismin,ismax
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.F	(revision 5098)
@@ -4,5 +4,5 @@
       RECURSIVE SUBROUTINE vlx_loc(q,pente_max,masse,u_m,ijb_x,ije_x,iq)
 
-c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
+c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
 c
 c    ********************************************************************
@@ -28,8 +28,8 @@
       REAL u_m( ijb_u:ije_u,llm),pbarv( iip1,jjb_v:jje_v,llm)
       REAL q(ijb_u:ije_u,llm,nqtot) ! CRisi: ajout dimension nqtot
-      REAL w(ijb_u:ije_u,llm) 
+      REAL w(ijb_u:ije_u,llm)
       INTEGER iq ! CRisi
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -49,10 +49,9 @@
 
       REAL      SSUM
-      EXTERNAL  SSUM
 
       REAL z1,z2,z3
 
       INTEGER ijb,ije,ijb_x,ije_x
-      
+
       !write(*,*) 'vlsplt 58: entree dans vlx_loc, iq,ijb_x=',
 !     &   iq,ijb_x
@@ -61,8 +60,8 @@
       ijb=ijb_x
       ije=ije_x
-        
+
       if (pole_nord.and.ijb==1) ijb=ijb+iip1
       if (pole_sud.and.ije==ip1jmp1)  ije=ije-iip1
-         
+
       IF (pente_max>-1.e-5) THEN
 c       IF (pente_max.gt.10) THEN
@@ -72,7 +71,7 @@
       ! on a besoin de q entre ijb et ije
 c   calcul de la pente aux points u
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)         
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
          DO l = 1, llm
-            
+
             DO ij=ijb,ije-1
                dxqu(ij)=q(ij+1,l,iq)-q(ij,l,iq)
@@ -96,5 +95,5 @@
 c limitation subtile
 c    ,      min(adxqu(ij-1)/sigu(ij-1),adxqu(ij)/(1.-sigu(ij)))
-          
+
 
             ENDDO
@@ -105,8 +104,4 @@
 
             DO ij=ijb+1,ije
-#ifdef CRAY
-               dxq(ij,l)=
-     ,         cvmgp(dxqu(ij-1)+dxqu(ij),0.,dxqu(ij-1)*dxqu(ij))
-#else
                IF(dxqu(ij-1)*dxqu(ij)>0) THEN
                   dxq(ij,l)=dxqu(ij-1)+dxqu(ij)
@@ -115,5 +110,4 @@
                   dxq(ij,l)=0.
                ENDIF
-#endif
                dxq(ij,l)=0.5*dxq(ij,l)
                dxq(ij,l)=
@@ -172,21 +166,5 @@
 c   calcul des flux a gauche et a droite
 
-#ifdef CRAY
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
-      DO l=1,llm
-       DO ij=ijb,ije-1
-          zdum(ij,l)=cvmgp(1.-u_m(ij,l)/masse(ij,l,iq),
-     ,                     1.+u_m(ij,l)/masse(ij+1,l,iq),
-     ,                     u_m(ij,l,iq))
-          zdum(ij,l)=0.5*zdum(ij,l)
-          u_mq(ij,l)=cvmgp(
-     ,                q(ij,l,iq)+zdum(ij,l)*dxq(ij,l),
-     ,                q(ij+1,l,iq)-zdum(ij,l)*dxq(ij+1,l),
-     ,                u_m(ij,l))
-          u_mq(ij,l)=u_m(ij,l)*u_mq(ij,l)
-       ENDDO
-      ENDDO
-c$OMP END DO NOWAIT
-#else
+
 c   on cumule le flux correspondant a toutes les mailles dont la masse
 c   au travers de la paroi pENDant le pas de temps.
@@ -209,7 +187,5 @@
       ENDDO
 c$OMP END DO NOWAIT
-#endif
-
-c	go to 9999
+
 c   detection des points ou on advecte plus que la masse de la
 c   maille
@@ -234,5 +210,5 @@
 c$OMP END DO NOWAIT
 c	 print*,'Ok test 2'
-        
+
 
 c   traitement special pour le cas ou on advecte en longitude plus que le
@@ -313,6 +289,5 @@
          ENDDO
 c$OMP END DO NOWAIT
-cym      ENDIF  ! n0.gt.0 
-9999    continue
+cym      ENDIF  ! n0.gt.0
 
 c   bouclage en latitude
@@ -346,5 +321,5 @@
               Ratio(ij,l,iq2)=min_ratio
             endif
-          enddo   
+          enddo
         enddo
 c$OMP END DO NOWAIT
@@ -377,12 +352,12 @@
 
 ! retablir les fils en rapport de melange par rapport a l'air:
-      ! On calcule q entre ijb+1 et ije -> on fait pareil pour ratio 
+      ! On calcule q entre ijb+1 et ije -> on fait pareil pour ratio
       ! puis on boucle en longitude
       do ifils=1,tracers(iq)%nqDescen
         iq2=tracers(iq)%iqDescen(ifils)
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
         DO l=1,llm
           DO ij=ijb+1,ije
-            q(ij,l,iq2)=q(ij,l,iq)*Ratio(ij,l,iq2)            
+            q(ij,l,iq2)=q(ij,l,iq)*Ratio(ij,l,iq2)
           enddo
           DO ij=ijb+iip1-1,ije,iip1
@@ -404,5 +379,5 @@
       RECURSIVE SUBROUTINE vly_loc(q,pente_max,masse,masse_adv_v,iq)
 c
-c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
+c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
 c
 c    ********************************************************************
@@ -416,5 +391,5 @@
       USE parallel_lmdz
       USE infotrac, ONLY : nqtot,tracers, ! CRisi                 &
-     &                     min_qParent,min_qMass,min_ratio ! MVals et CRisi    
+     &                     min_qParent,min_qMass,min_ratio ! MVals et CRisi
       USE comconst_mod, ONLY: pi
       IMPLICIT NONE
@@ -432,5 +407,5 @@
       INTEGER iq ! CRisi
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -444,10 +419,10 @@
       REAL qpns,qpsn,appn,apps,dyn1,dys1,dyn2,dys2,newmasse,fn,fs
 c     REAL newq,oldmasse
-      Logical extremum,first,testcpu
+      Logical extremum,first
       REAL temps0,temps1,temps2,temps3,temps4,temps5,second
       SAVE temps0,temps1,temps2,temps3,temps4,temps5
 c$OMP THREADPRIVATE(temps0,temps1,temps2,temps3,temps4,temps5)
-      SAVE first,testcpu
-c$OMP THREADPRIVATE(first,testcpu)
+      SAVE first
+c$OMP THREADPRIVATE(first)
 
       REAL convpn,convps,convmpn,convmps
@@ -467,5 +442,5 @@
       EXTERNAL  SSUM
 
-      DATA first,testcpu/.true.,.false./
+      DATA first/.true./
       DATA temps0,temps1,temps2,temps3,temps4,temps5/0.,0.,0.,0.,0.,0./
       INTEGER ijb,ije
@@ -473,5 +448,5 @@
 
       ijb=ij_begin-2*iip1
-      ije=ij_end+2*iip1  
+      ije=ij_end+2*iip1
       if (pole_nord) ijb=ij_begin
       if (pole_sud)  ije=ij_end
@@ -491,5 +466,5 @@
          sinlondlon(1)=sinlondlon(iip1)
          airej2 = SSUM( iim, aire(iip2), 1 )
-         airejjm= SSUM( iim, aire(ip1jm -iim), 1 ) 
+         airejjm= SSUM( iim, aire(ip1jm -iim), 1 )
       ENDIF
 
@@ -497,5 +472,5 @@
 c	PRINT*,'CALCUL EN LATITUDE'
 
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)      
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
       DO l = 1, llm
 c
@@ -507,5 +482,5 @@
 c   de latitude autour du pole (qpns pour le pole nord et qpsn pour
 c    le pole nord) qui sera utilisee pour evaluer les pentes au pole.
-      
+
       if (pole_nord) then
         DO i = 1, iim
@@ -514,5 +489,5 @@
         qpns   = SSUM( iim,  airescb ,1 ) / airej2
       endif
-      
+
       if (pole_sud) then
         DO i = 1, iim
@@ -521,5 +496,5 @@
         qpsn   = SSUM( iim,  airesch ,1 ) / airejjm
       endif
-      
+
 c   calcul des pentes aux points v
 
@@ -528,5 +503,5 @@
       if (pole_nord) ijb=ij_begin
       if (pole_sud)  ije=ij_end-iip1
-      
+
       ! on a besoin de q entre ij_begin-2*iip1 et ij_end+2*iip1
       ! Si pole sud, entre ij_begin-2*iip1 et ij_end
@@ -536,5 +511,5 @@
          adyqv(ij)=abs(dyqv(ij))
       ENDDO
- 
+
 
 c   calcul des pentes aux points scalaires
@@ -543,5 +518,5 @@
       if (pole_nord) ijb=ij_begin+iip1
       if (pole_sud)  ije=ij_end-iip1
-      
+
       DO ij=ijb,ije
          dyq(ij,l)=.5*(dyqv(ij-iip1)+dyqv(ij))
@@ -555,5 +530,5 @@
            dyq(ij,l)=qpns-q(ij+iip1,l,iq)
         ENDDO
-        
+
         dyn1=0.
         dyn2=0.
@@ -565,5 +540,5 @@
           dyq(ij,l)=dyn1*sinlon(ij)+dyn2*coslon(ij)
         ENDDO
-        
+
         DO ij=1,iip1
          dyq(ij,l)=0.
@@ -571,5 +546,5 @@
 c ym tout cela ne sert pas a grand chose
       ENDIF
-      
+
       IF (pole_sud) THEN
 
@@ -589,5 +564,5 @@
           dyq(ip1jm+ij,l)=dys1*sinlon(ij)+dys2*coslon(ij)
         ENDDO
-        
+
         DO ij=1,iip1
          dyq(ip1jm+ij,l)=0.
@@ -619,5 +594,5 @@
 
 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
-C  En memoire de dIFferents tests sur la 
+C  En memoire de dIFferents tests sur la
 C  limitation des pentes aux poles.
 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
@@ -732,5 +707,5 @@
       ijem=ij_end+iip1
       if (pole_nord) ijb=ij_begin
-      if (pole_sud)  ije=ij_end  
+      if (pole_sud)  ije=ij_end
       if (pole_nord) ijbm=ij_begin
       if (pole_sud)  ijem=ij_end
@@ -738,9 +713,9 @@
       do ifils=1,tracers(iq)%nqDescen
         iq2=tracers(iq)%iqDescen(ifils)
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
         DO l=1,llm
         ! modif des bornes: CRisi 16 nov 2020
         ! d'abord masse avec bornes corrigées
-          DO ij=ijbm,ijem 
+          DO ij=ijbm,ijem
           !MVals: veiller a ce qu'on n'ait pas de denominateur nul
             masse(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass)
@@ -753,7 +728,7 @@
               Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq)
             else
-              Ratio(ij,l,iq2)=min_ratio  
-            endif     
-          enddo !DO ij=ijbm,ijem  
+              Ratio(ij,l,iq2)=min_ratio
+            endif
+          enddo !DO ij=ijbm,ijem
         enddo !DO l=1,llm
 c$OMP END DO NOWAIT
@@ -765,11 +740,11 @@
       enddo
 ! end CRisi
-      
+
       ijb=ij_begin
       ije=ij_end
       if (pole_nord) ijb=ij_begin+iip1
       if (pole_sud)  ije=ij_end-iip1
-      
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)      
+
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
       DO l=1,llm
          DO ij=ijb,ije
@@ -801,10 +776,10 @@
            enddo
          endif
-         
+
 c        convps=-SSUM(iim,qbyv(ip1jm-iim,l),1)/apols
 c        convmps=-ssum(iim,masse_adv_v(ip1jm-iim,l),1)/apols
-         
+
          if (pole_sud) then
-         
+
            convps=-SSUM(iim,qbyv(ip1jm-iim,l),1)
            convmps=-ssum(iim,masse_adv_v(ip1jm-iim,l),1)
@@ -854,8 +829,8 @@
       do ifils=1,tracers(iq)%nqDescen
         iq2=tracers(iq)%iqDescen(ifils)
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
         DO l=1,llm
           DO ij=ijb,ije
-            q(ij,l,iq2)=q(ij,l,iq)*Ratio(ij,l,iq2)            
+            q(ij,l,iq2)=q(ij,l,iq)*Ratio(ij,l,iq2)
           enddo
         enddo
@@ -866,10 +841,10 @@
       RETURN
       END
-      
-      
-      
+
+
+
       RECURSIVE SUBROUTINE vlz_loc(q,pente_max,masse,w,ijb_x,ije_x,iq)
 c
-c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
+c     Auteurs:   P.Le Van, F.Hourdin, F.Forget
 c
 c    ********************************************************************
@@ -885,5 +860,5 @@
       USE infotrac, ONLY : nqtot,tracers, ! CRisi                 &
      &                     min_qParent,min_qMass,min_ratio ! MVals et CRisi
-      
+
       IMPLICIT NONE
 c
@@ -900,5 +875,5 @@
       INTEGER iq
 c
-c      Local 
+c      Local
 c   ---------
 c
@@ -915,7 +890,4 @@
       REAL sigw
 
-      LOGICAL testcpu
-      SAVE testcpu
-c$OMP THREADPRIVATE(testcpu)
       REAL temps0,temps1,temps2,temps3,temps4,temps5,second
       SAVE temps0,temps1,temps2,temps3,temps4,temps5
@@ -923,7 +895,5 @@
 
       REAL      SSUM
-      EXTERNAL  SSUM
-
-      DATA testcpu/.false./
+
       DATA temps0,temps1,temps2,temps3,temps4,temps5/0.,0.,0.,0.,0.,0./
       INTEGER ijb,ije,ijb_x,ije_x
@@ -933,5 +903,5 @@
       !REAL masseq(ijb_u:ije_u,llm,nqtot),Ratio(ijb_u:ije_u,llm,nqtot) ! CRisi
       ! Ces varibles doivent être déclarées en pointer et en save dans
-      ! vlz_loc si on veut qu'elles soient vues par tous les threads.  
+      ! vlz_loc si on veut qu'elles soient vues par tous les threads.
       INTEGER ifils,iq2 ! CRisi
 
@@ -939,19 +909,14 @@
       IF (first) THEN
        first=.FALSE.
-      ENDIF              
+      ENDIF
 c    On oriente tout dans le sens de la pression c'est a dire dans le
 c    sens de W
 
       !write(*,*) 'vlsplt 926: entree dans vlz_loc, iq=',iq
-#ifdef BIDON
-      IF(testcpu) THEN
-         temps0=second(0.)
-      ENDIF
-#endif
 
       ijb=ijb_x
       ije=ije_x
 
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)      
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
       DO l=2,llm
          DO ij=ijb,ije
@@ -965,8 +930,4 @@
       DO l=2,llm-1
          DO ij=ijb,ije
-#ifdef CRAY
-            dzq(ij,l)=0.5*
-     ,      cvmgp(dzqw(ij,l)+dzqw(ij,l+1),0.,dzqw(ij,l)*dzqw(ij,l+1))
-#else
             IF(dzqw(ij,l)*dzqw(ij,l+1)>0.) THEN
                 dzq(ij,l)=0.5*(dzqw(ij,l)+dzqw(ij,l+1))
@@ -974,5 +935,4 @@
                 dzq(ij,l)=0.
             ENDIF
-#endif
             dzqmax=pente_max*min(adzqw(ij,l),adzqw(ij,l+1))
             dzq(ij,l)=sign(min(abs(dzq(ij,l)),dzqmax),dzq(ij,l))
@@ -988,9 +948,4 @@
 c$OMP END MASTER
 c$OMP BARRIER
-#ifdef BIDON
-      IF(testcpu) THEN
-         temps1=temps1+second(0.)-temps0
-      ENDIF
-#endif
 
 !--------------------------------------------------------
@@ -1008,5 +963,5 @@
          ENDDO
       ENDDO
-c$OMP END DO NOWAIT    
+c$OMP END DO NOWAIT
 
 c ---------------------------------------------------------------
@@ -1041,6 +996,6 @@
          ENDDO
        ENDDO
-c$OMP END DO NOWAIT    
-       !write(*,*) 'vlz 1001'    
+c$OMP END DO NOWAIT
+       !write(*,*) 'vlz 1001'
 
       ELSE ! countcfl>=1
@@ -1079,5 +1034,5 @@
 c  on itère jusqu'à ce que tous les poins satisfassent
 c  le critère
-      DO WHILE (countcfl>=1) 
+      DO WHILE (countcfl>=1)
         IF (prt_level>9) THEN
           WRITE(lunout,*)'On viole le CFL Vertical sur ',countcfl,' pts'
@@ -1130,5 +1085,5 @@
          ENDDO
        ENDDO
-c$OMP END DO NOWAIT    
+c$OMP END DO NOWAIT
 
 
@@ -1162,5 +1117,5 @@
             !wq(ij,l,iq2)=wq(ij,l,iq) ! correction bug le 15mai2015
             w(ij,l,iq2)=wq(ij,l,iq)
-          enddo   
+          enddo
         enddo
 c$OMP END DO NOWAIT
@@ -1172,5 +1127,5 @@
         call vlz_loc(Ratio,pente_max,masse,w,ijb_x,ije_x,iq2)
       enddo
-! end CRisi  
+! end CRisi
 
 ! CRisi: On rajoute ici une barrière car on veut être sur que tous les
@@ -1190,12 +1145,12 @@
 c$OMP END DO NOWAIT
 
-      
+
 ! retablir les fils en rapport de melange par rapport a l'air:
       do ifils=1,tracers(iq)%nqDescen
         iq2=tracers(iq)%iqDescen(ifils)
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)   
+c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
         DO l=1,llm
           DO ij=ijb,ije
-            q(ij,l,iq2)=q(ij,l,iq)*Ratio(ij,l,iq2)            
+            q(ij,l,iq2)=q(ij,l,iq)*Ratio(ij,l,iq2)
           enddo
         enddo
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.F	(revision 5098)
@@ -13,5 +13,5 @@
       USE parallel_lmdz
       USE infotrac, ONLY : nqtot,tracers, ! CRisi                 &
-     &                     min_qParent,min_qMass,min_ratio ! MVals et CRisi
+     &                     min_qParent,min_qMass,min_ratio ! MVals et CRisi7
       IMPLICIT NONE
 c
@@ -91,5 +91,5 @@
 c limitation subtile
 c    ,      min(adxqu(ij-1)/sigu(ij-1),adxqu(ij)/(1.-sigu(ij)))
-          
+
 
             ENDDO
@@ -100,8 +100,4 @@
 
             DO ij=ijb+1,ije
-#ifdef CRAY
-               dxq(ij,l)=
-     ,         cvmgp(dxqu(ij-1)+dxqu(ij),0.,dxqu(ij-1)*dxqu(ij))
-#else
                IF(dxqu(ij-1)*dxqu(ij)>0) THEN
                   dxq(ij,l)=dxqu(ij-1)+dxqu(ij)
@@ -110,5 +106,4 @@
                   dxq(ij,l)=0.
                ENDIF
-#endif
                dxq(ij,l)=0.5*dxq(ij,l)
                dxq(ij,l)=
@@ -179,24 +174,4 @@
               
 c   calcul des flux a gauche et a droite
-
-#ifdef CRAY
-c--pas encore modification sur Qsat
-c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
-      DO l=1,llm
-       DO ij=ijb,ije-1
-          zdum(ij,l)=cvmgp(1.-u_m(ij,l)/masse(ij,l,iq),
-     ,                     1.+u_m(ij,l)/masse(ij+1,l,iq),
-     ,                     u_m(ij,l))
-          zdum(ij,l)=0.5*zdum(ij,l)
-          u_mq(ij,l)=cvmgp(
-     ,                q(ij,l,iq)+zdum(ij,l)*dxq(ij,l),
-     ,                q(ij+1,l,iq)-zdum(ij,l)*dxq(ij+1,l),
-     ,                u_m(ij,l))
-          u_mq(ij,l)=u_m(ij,l)*u_mq(ij,l)
-       ENDDO
-      ENDDO
-c$OMP END DO NOWAIT
-
-#else
 c   on cumule le flux correspondant a toutes les mailles dont la masse
 c   au travers de la paroi pENDant le pas de temps.
@@ -217,5 +192,4 @@
       ENDDO
 c$OMP END DO NOWAIT
-#endif
 
 
@@ -466,9 +440,9 @@
       INTEGER ifils,iq2 ! CRisi
 
-      REAL      SSUM
-
       DATA first/.true./
       INTEGER ijb,ije
       INTEGER ijbm,ijem
+
+      REAL ssum
 
       ijb=ij_begin-2*iip1
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 5098)
@@ -17,9 +17,5 @@
   USE vertical_layers_mod, ONLY : init_vertical_layers
   USE infotrac, ONLY: nbtr, type_trac
-#ifdef CPP_StratAer
-  USE infotrac_phy, ONLY: nbtr_bin, nbtr_sulgas, id_OCS_strat, &
-                      id_SO2_strat, id_H2SO4_strat, id_BIN01_strat
 
-#endif
 #ifdef REPROBUS
   USE CHEM_REP, ONLY : Init_chem_rep_phys
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90	(revision 5098)
@@ -43,10 +43,8 @@
     LOGICAL, SAVE :: first_call_inifilr = .TRUE.
 
-#ifdef CRAY
     INTEGER   ISMIN
     EXTERNAL  ISMIN
     INTEGER iymin 
     INTEGER ixmineq
-#endif
     !
     ! ------------------------------------------------------------
@@ -104,10 +102,5 @@
     ENDDO
     !
-#ifdef CRAY
-    iymin   = ISMIN( jjm, dlatu, 1 )
-    ixmineq = ISMIN( iim, dlonu, 1 )
-    dymin   = dlatu( iymin )
-    dxmin   = dlonu( ixmineq )
-#else
+
     dxmin   =  dlonu(1)
     DO  i  = 2, iim
@@ -118,5 +111,4 @@
        dymin = MIN( dymin,dlatu(j) )
     ENDDO
-#endif
     !
     ! For a regular grid, we want the filter to start at latitudes
@@ -372,7 +364,5 @@
           ENDDO
        ENDDO ! of DO i=1,iim
-#ifdef CRAY
-       CALL MXM( eignfnv,iim,eignft,iim,matriceun(1,1,j),iim )
-#else
+
 #ifdef BLAS
        CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, &
@@ -389,5 +379,4 @@
        ENDDO ! of DO k = 1, iim
 #endif
-#endif
 
     ENDDO ! of DO j = 2, jfiltnu
@@ -402,7 +391,4 @@
           ENDDO
        ENDDO ! of DO i=1,iim
-#ifdef CRAY
-       CALL MXM(eignfnv,iim,eignft,iim,matriceus(1,1,j-jfiltsu+1),iim)
-#else
 #ifdef BLAS
        CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, &
@@ -420,5 +406,4 @@
        ENDDO ! of DO k = 1, iim
 #endif
-#endif
 
     ENDDO ! of DO j = jfiltsu, jjm
@@ -439,7 +424,5 @@
           ENDDO
        ENDDO
-#ifdef CRAY
-       CALL MXM( eignfnu,iim,eignft,iim,matricevn(1,1,j),iim )
-#else
+
 #ifdef BLAS
        CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, &
@@ -456,5 +439,4 @@
        ENDDO
 #endif
-#endif
 
     ENDDO ! of DO j = 1, jfiltnv
@@ -469,7 +451,5 @@
           ENDDO
        ENDDO
-#ifdef CRAY
-       CALL MXM(eignfnu,iim,eignft,iim,matricevs(1,1,j-jfiltsv+1),iim)
-#else
+
 #ifdef BLAS
        CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, &
@@ -487,5 +467,4 @@
        ENDDO
 #endif
-#endif
 
     ENDDO ! of DO j = jfiltsv, jjm
@@ -506,7 +485,5 @@
           ENDDO
        ENDDO
-#ifdef CRAY
-       CALL MXM( eignfnv,iim,eignft,iim,matrinvn(1,1,j),iim )
-#else
+
 #ifdef BLAS
        CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, &
@@ -523,5 +500,4 @@
        ENDDO
 #endif
-#endif
 
     ENDDO ! of DO j = 2, jfiltnu
@@ -536,7 +512,4 @@
           ENDDO
        ENDDO
-#ifdef CRAY
-       CALL MXM(eignfnv,iim,eignft,iim,matrinvs(1,1,j-jfiltsu+1),iim)
-#else
 #ifdef BLAS
        CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, &
@@ -553,5 +526,4 @@
        ENDDO
 #endif
-#endif
 
     ENDDO ! of DO j = jfiltsu, jjm
@@ -569,7 +541,5 @@
     !
 334 FORMAT(1x,24i3)
-755 FORMAT(1x,6f10.3,i3)
-
-    RETURN
+
   END SUBROUTINE inifilr
 
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.F	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.F	(revision 5098)
@@ -67,8 +67,4 @@
       END DO
 c
-#ifdef CRAY
-      CALL MXM(eignfnu,iim,eignfnv,iim,vec ,iim)
-      CALL MXM(eignfnv,iim,eignfnu,iim,vec1,iim)
-#else
       DO j = 1, iim
       DO i = 1, iim
@@ -81,5 +77,4 @@
       ENDDO
       ENDDO
-#endif
 
 c
Index: LMDZ6/branches/Amaury_dev/libf/misc/cray.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/cray.F	(revision 5095)
+++ 	(revision )
@@ -1,42 +1,0 @@
-!
-! $Header$
-!
-#ifdef CRAY
-      SUBROUTINE riencray
-      END
-#else
-      subroutine scopy(n,sx,incx,sy,incy)
-c
-      IMPLICIT NONE
-c
-      integer n,incx,incy,ix,iy,i
-      real sx((n-1)*incx+1),sy((n-1)*incy+1)
-c
-      iy=1
-      ix=1
-      DO i=1,n
-         sy(iy)=sx(ix)
-         ix=ix+incx
-         iy=iy+incy
-      END DO
-c
-      return
-      end
-
-      function ssum(n,sx,incx)
-c
-      IMPLICIT NONE
-c
-      integer n,incx,i,ix
-      real ssum,sx((n-1)*incx+1)
-c
-      ssum=0.
-      ix=1
-      do i=1,n
-         ssum=ssum+sx(ix)
-         ix=ix+incx
-      END DO
-c
-      return
-      end
-#endif
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_TO_MOVE_ssum_scopy.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_TO_MOVE_ssum_scopy.f90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_TO_MOVE_ssum_scopy.f90	(revision 5098)
@@ -0,0 +1,37 @@
+! TO MOVE SOMEWHERE ELSE !! (Amaury - 07/2024)
+! Move with other vector/math functions
+! Those are old legacy CRAY replacement functions, that are now used in several parts of the code.
+
+subroutine scopy(n, sx, incx, sy, incy)
+
+  IMPLICIT NONE
+
+  integer n, incx, incy, ix, iy, i
+  real sx((n - 1) * incx + 1), sy((n - 1) * incy + 1)
+
+  iy = 1
+  ix = 1
+  DO i = 1, n
+    sy(iy) = sx(ix)
+    ix = ix + incx
+    iy = iy + incy
+  END DO
+
+end
+
+function ssum(n, sx, incx)
+
+  IMPLICIT NONE
+
+  integer n, incx, i, ix
+  real ssum, sx((n - 1) * incx + 1)
+
+  ssum = 0.
+  ix = 1
+  do i = 1, n
+    ssum = ssum + sx(ix)
+    ix = ix + incx
+  END DO
+
+end
+
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90	(revision 5098)
@@ -2,5 +2,5 @@
 ! This file is part of an effort to replace most uses of preprocessor CPP keys by fortran variables,
 ! to improve readability, compilation coverage, and linting.
-! CPP keys used here should ONLY be used here,
+! CPP keys used here should ONLY be used here (unless specified explicitely),
 ! and imported through USE ..., ONLY: ... elsewhere
 ! CPP keys supported (key -> fortran variables associated):
@@ -8,4 +8,5 @@
 !      CPP_PHYS  -> CPPKEY_PHYS
 !      INCA      -> CPPKEY_INCA
+!      CPP_StratAer-> CPPKEY_STRATAER
 ! ---------------------------------------------
 
@@ -14,5 +15,5 @@
   USE netcdf, ONLY: nf90_float, nf90_double
   IMPLICIT NONE; PRIVATE
-  PUBLIC nf90_format, CPPKEY_PHYS, CPPKEY_INCA
+  PUBLIC nf90_format, CPPKEY_PHYS, CPPKEY_INCA, CPPKEY_STRATAER
 
 #ifdef NC_DOUBLE
@@ -34,3 +35,9 @@
 #endif
 
+#ifdef CPP_StratAer
+  LOGICAL, PARAMETER :: CPPKEY_STRATAER = .TRUE.
+#else
+  LOGICAL, PARAMETER :: CPPKEY_STRATAER = .FALSE.
+#endif
+
 END MODULE lmdz_cppkeys_wrapper
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aer_sedimnt.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aer_sedimnt.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aer_sedimnt.F90	(revision 5098)
@@ -22,5 +22,5 @@
   USE infotrac_phy
   USE aerophys
-  USE YOMCST
+  USE lmdz_yomcst
 
 IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90	(revision 5098)
@@ -9,5 +9,5 @@
   USE dimphy
   USE temps_mod
-  USE YOMCST
+  USE lmdz_yomcst
 
   IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/coagulate.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/coagulate.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/coagulate.F90	(revision 5098)
@@ -28,4 +28,5 @@
   USE phys_local_var_mod, ONLY: DENSO4, DENSO4B, f_r_wet, f_r_wetB
   USE strataer_local_var_mod, ONLY: flag_new_strat_compo
+  USE lmdz_yomcst
   
   IMPLICIT NONE
@@ -83,6 +84,4 @@
   REAL                                          :: EvdW
 
-  include "YOMCST.h"
-
 ! ff(i,j,k): Volume fraction of Vi,j that is partitioned to each model bin k
 ! just need to be calculated in model initialization because mdw(:) size is fixed
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/cond_evap_tstep_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/cond_evap_tstep_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/cond_evap_tstep_mod.F90	(revision 5098)
@@ -28,10 +28,10 @@
       USE aerophys
       USE infotrac_phy
-      USE YOMCST, ONLY : RPI
+      USE lmdz_yomcst, ONLY : RPI
       USE sulfate_aer_mod, ONLY : wph2so4, surftension, solh2so4, rpmvh2so4
       USE strataer_local_var_mod, ONLY : ALPH2SO4, RRSI
       
       IMPLICIT NONE
-      
+
       REAL, PARAMETER :: third=1./3.
       
@@ -177,5 +177,5 @@
       USE aerophys
       USE infotrac_phy
-      USE YOMCST, ONLY : RPI
+      USE lmdz_yomcst, ONLY : RPI
       USE strataer_local_var_mod, ONLY : ALPH2SO4, RRSI
 
@@ -290,5 +290,5 @@
       USE aerophys
       USE infotrac_phy
-      USE YOMCST, ONLY : RPI
+      USE lmdz_yomcst, ONLY : RPI
       USE strataer_local_var_mod, ONLY : RRSI,Vbin
       
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5098)
@@ -18,5 +18,5 @@
   USE infotrac_phy
   USE aerophys
-  USE YOMCST
+  USE lmdz_yomcst
   USE strataer_local_var_mod, ONLY : flag_newclim_file,flag_verbose_strataer
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/micphy_tstep.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/micphy_tstep.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/micphy_tstep.F90	(revision 5098)
@@ -13,5 +13,5 @@
   USE cond_evap_tstep_mod
   USE sulfate_aer_mod, ONLY : STRAACT
-  USE YOMCST, ONLY : RPI, RD, RG
+  USE lmdz_yomcst, ONLY : RPI, RD, RG
   USE print_control_mod, ONLY: lunout
   USE strataer_local_var_mod ! contains also RRSI and Vbin
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/miecalc_aer.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/miecalc_aer.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/miecalc_aer.F90	(revision 5098)
@@ -20,5 +20,5 @@
   USE infotrac_phy, ONLY : nbtr, nbtr_bin, nbtr_sulgas, id_SO2_strat
   USE dimphy
-  USE YOMCST  , ONLY : RG, RPI
+  USE lmdz_yomcst  , ONLY : RG, RPI
   USE mod_phys_lmdz_para, only: gather, scatter, bcast
   USE mod_grid_phy_lmdz, ONLY : klon_glo
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/nucleation_tstep_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/nucleation_tstep_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/nucleation_tstep_mod.F90	(revision 5098)
@@ -11,4 +11,5 @@
   USE infotrac_phy
   USE strataer_local_var_mod, ONLY : flag_new_nucl
+  USE lmdz_yomcst
   
   IMPLICIT NONE
@@ -37,6 +38,4 @@
   REAL airn    ! Air molecule concentration in (cm-3) NOT IN USE
   REAL ipr     ! Ion pair production rate (cm-3 s-1) NOT IN USE
-
-  include "YOMCST.h"
 
   ! call nucleation routine
@@ -332,4 +331,5 @@
 
   USE aerophys
+  USE lmdz_yomcst
 
   IMPLICIT NONE 
@@ -385,6 +385,4 @@
   DOUBLE PRECISION :: xloss       ! Ion loss rate 
   DOUBLE PRECISION :: recomb      ! Ion-ion recombination rate 
-
-  include "YOMCST.h"
 
   !--- 0) Initializations:
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/ocs_to_so2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/ocs_to_so2.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/ocs_to_so2.F90	(revision 5098)
@@ -7,5 +7,5 @@
   USE aerophys
   USE infotrac_phy
-  USE YOMCST, ONLY : RG
+  USE lmdz_yomcst, ONLY : RG
   USE phys_local_var_mod, ONLY : OCS_lifetime, budg_3D_ocs_to_so2, budg_ocs_to_so2
   USE strataer_local_var_mod, ONLY : flag_min_rreduce
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/so2_to_h2so4.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/so2_to_h2so4.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/so2_to_h2so4.F90	(revision 5098)
@@ -7,5 +7,5 @@
   USE aerophys
   USE infotrac_phy
-  USE YOMCST, ONLY : RG, RD
+  USE lmdz_yomcst, ONLY : RG, RD
   ! lifetime (sec) et O3_clim (VMR)
   USE phys_local_var_mod, ONLY : SO2_lifetime, H2SO4_lifetime, O3_clim, budg_3D_so2_to_h2so4, budg_so2_to_h2so4
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5098)
@@ -19,9 +19,9 @@
   USE infotrac_phy
   USE aerophys
-  USE YOMCST
+  USE lmdz_yomcst
   USE strataer_local_var_mod, ONLY : flag_newclim_file
   
   IMPLICIT NONE
-  
+
   include "dimensions.h"
   
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_emiss_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_emiss_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_emiss_mod.F90	(revision 5098)
@@ -219,6 +219,5 @@
     USE print_control_mod, ONLY : lunout
     USE strataer_local_var_mod
-
-    INCLUDE "YOMCST.h"  !--RPI
+    USE lmdz_yomcst, ONLY: RPI
 
     ! local var
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_local_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_local_var_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_local_var_mod.F90	(revision 5098)
@@ -1,184 +1,184 @@
 MODULE strataer_local_var_mod
-! This module contains strato microphysic model parameters & variables
-  
+  ! This module contains strato microphysic model parameters & variables
+
   IMPLICIT NONE
-  
+
   !============= GENERAL PARAMS =============
   !flag for type emission scenario: (0) background aer ; (1) volcanic eruption with Sulfur ;
   !(2,3) strato aer injections (SAI) ; (4) volcanic eruption chimistry; (5) rocket
-  INTEGER,SAVE :: flag_emit
+  INTEGER, SAVE :: flag_emit
   !$OMP THREADPRIVATE(flag_emit)
-  
+
   ! flag for emission altitude distribution: (0) gaussian; (1) uniform
-  INTEGER,SAVE :: flag_emit_distrib
+  INTEGER, SAVE :: flag_emit_distrib
   !$OMP THREADPRIVATE(flag_emit_distrib)
-  
+
   ! flag to choose nucleation nucleation method
-  LOGICAL,SAVE :: flag_new_nucl   ! T=new routine from A. Maattanen (LATMOS), F=older routine from H. Vehkamäki (FMI)
+  LOGICAL, SAVE :: flag_new_nucl   ! T=new routine from A. Maattanen (LATMOS), F=older routine from H. Vehkamäki (FMI)
   !$OMP THREADPRIVATE(flag_new_nucl)
-  
+
   ! Use relative humidity from 2D model stratospheric H2O because LMDz is too dry in the stratosphere
   ! (no CH4 oxidation)
-  LOGICAL,SAVE :: flag_H2O2d_nucleation
+  LOGICAL, SAVE :: flag_H2O2d_nucleation
   !$OMP THREADPRIVATE(flag_H2O2d_nucleation)
-  
+
   ! OH reduction from SO2. OH is reduced when its reaction with SO2 competes sufficiently with its reaction
   ! with O3 (Bekki, 1995). As a result, SO2 lifetime is extended. 2D model O3 climatologies are needed.
-  LOGICAL,SAVE :: flag_OH_reduced
+  LOGICAL, SAVE :: flag_OH_reduced
   !$OMP THREADPRIVATE(flag_OH_reduced)
-  
+
   ! H2SO4 photolysis: H2SO4 is converted into SO2 by complex photolytic processes. Here simplified approach
   ! by setting H2SO4 cross-sections = 0.3*HCl cross-sections (Rinsland et al., 1995)
-  LOGICAL,SAVE :: flag_H2SO4_photolysis
+  LOGICAL, SAVE :: flag_H2SO4_photolysis
   !$OMP THREADPRIVATE(flag_H2SO4_photolysis)
-  
+
   ! flag for minimum lifetime (=1.5 pdt phys)
-  LOGICAL,SAVE :: flag_min_rreduce
+  LOGICAL, SAVE :: flag_min_rreduce
   !$OMP THREADPRIVATE(flag_min_rreduce)
-  
+
   ! flag to read new climato (O3, H2O & H2SO4_LIFET)
-  LOGICAL,SAVE :: flag_newclim_file
+  LOGICAL, SAVE :: flag_newclim_file
   !$OMP THREADPRIVATE(flag_newclim_file)
-  
+
   ! flag to choose new H2SO4 density and weight percent from Tabazadeh et al. (1994).
-  LOGICAL,SAVE :: flag_new_strat_compo
+  LOGICAL, SAVE :: flag_new_strat_compo
   !$OMP THREADPRIVATE(flag_new_strat_compo)
-  
+
   ! Verbose mode to get more print info
   LOGICAL, SAVE :: flag_verbose_strataer
   !$OMP THREADPRIVATE(flag_verbose_strataer)
-  
-  
+
+
   !============= NUCLEATION VARS =============
   ! MOLECULAR ACCOMODATION OF H2SO4 (Raes and Van Dingen)
-  REAL,SAVE    :: ALPH2SO4               ! H2SO4 accommodation  coefficient [condensation/evaporation]
+  REAL, SAVE :: ALPH2SO4               ! H2SO4 accommodation  coefficient [condensation/evaporation]
   !$OMP THREADPRIVATE(ALPH2SO4)
-  
+
   ! flag to constraint nucleation rate in a lat/pres box
-  LOGICAL,SAVE :: flag_nuc_rate_box      ! Nucleation rate limit or not to a lat/pres
+  LOGICAL, SAVE :: flag_nuc_rate_box      ! Nucleation rate limit or not to a lat/pres
   !$OMP THREADPRIVATE(flag_nuc_rate_box)
-  REAL,SAVE    :: nuclat_min             ! min lat to activate nuc rate
-  REAL,SAVE    :: nuclat_max             ! max lat to activate nuc rate
-  REAL,SAVE    :: nucpres_min            ! min pres to activate nuc rate
-  REAL,SAVE    :: nucpres_max            ! max pres to activate nuc rate
+  REAL, SAVE :: nuclat_min             ! min lat to activate nuc rate
+  REAL, SAVE :: nuclat_max             ! max lat to activate nuc rate
+  REAL, SAVE :: nucpres_min            ! min pres to activate nuc rate
+  REAL, SAVE :: nucpres_max            ! max pres to activate nuc rate
   !$OMP THREADPRIVATE(nuclat_min, nuclat_max, nucpres_min, nucpres_max)
 
-  LOGICAL,SAVE :: ok_qemiss
+  LOGICAL, SAVE :: ok_qemiss
   !$OMP THREADPRIVATE(ok_qemiss)
-  INTEGER,SAVE :: flh2o  ! ds stratemit : flh2o =0 (tr_seri), flh2o=1 (dq) 
+  INTEGER, SAVE :: flh2o  ! ds stratemit : flh2o =0 (tr_seri), flh2o=1 (dq)
   !$OMP THREADPRIVATE(flh2o)
-  
-  REAL,ALLOCATABLE,SAVE    :: budg_emi(:,:)            !DIMENSION(klon,n)
+
+  REAL, ALLOCATABLE, SAVE :: budg_emi(:, :)            !DIMENSION(klon,n)
   !$OMP THREADPRIVATE(budg_emi)
-  
-  
+
+
   !============= EMISSION VARS =============
   !--flag_emit=1 OR == 4 -- Volcanic eruption(s)
-  INTEGER,SAVE             :: nErupt                    ! number of eruptions specs
-  REAL,SAVE                :: injdur                    ! volcanic injection duration
+  INTEGER, SAVE :: nErupt                    ! number of eruptions specs
+  REAL, SAVE :: injdur                    ! volcanic injection duration
   !$OMP THREADPRIVATE(nErupt, injdur)
-  INTEGER,ALLOCATABLE,SAVE :: year_emit_vol(:)          ! year of emission date
-  INTEGER,ALLOCATABLE,SAVE :: mth_emit_vol(:)           ! month of emission date
-  INTEGER,ALLOCATABLE,SAVE :: day_emit_vol(:)           ! day of emission date
+  INTEGER, ALLOCATABLE, SAVE :: year_emit_vol(:)          ! year of emission date
+  INTEGER, ALLOCATABLE, SAVE :: mth_emit_vol(:)           ! month of emission date
+  INTEGER, ALLOCATABLE, SAVE :: day_emit_vol(:)           ! day of emission date
   !$OMP THREADPRIVATE(year_emit_vol, mth_emit_vol, day_emit_vol)
-  REAL,ALLOCATABLE,SAVE    :: altemiss_vol(:)           ! emission altitude in m
-  REAL,ALLOCATABLE,SAVE    :: sigma_alt_vol(:)          ! standard deviation of emission altitude in m
+  REAL, ALLOCATABLE, SAVE :: altemiss_vol(:)           ! emission altitude in m
+  REAL, ALLOCATABLE, SAVE :: sigma_alt_vol(:)          ! standard deviation of emission altitude in m
   !$OMP THREADPRIVATE(altemiss_vol, sigma_alt_vol)
-  INTEGER,ALLOCATABLE,SAVE :: ponde_lonlat_vol(:)       ! lon/lat ponderation factor
-  REAL,ALLOCATABLE,SAVE    :: xlat_min_vol(:)           ! min latitude of volcano in degree
-  REAL,ALLOCATABLE,SAVE    :: xlat_max_vol(:)           ! max latitude of volcano in degree
-  REAL,ALLOCATABLE,SAVE    :: xlon_min_vol(:)           ! min longitude of volcano in degree
-  REAL,ALLOCATABLE,SAVE    :: xlon_max_vol(:)           ! max longitude of volcano in degree
+  INTEGER, ALLOCATABLE, SAVE :: ponde_lonlat_vol(:)       ! lon/lat ponderation factor
+  REAL, ALLOCATABLE, SAVE :: xlat_min_vol(:)           ! min latitude of volcano in degree
+  REAL, ALLOCATABLE, SAVE :: xlat_max_vol(:)           ! max latitude of volcano in degree
+  REAL, ALLOCATABLE, SAVE :: xlon_min_vol(:)           ! min longitude of volcano in degree
+  REAL, ALLOCATABLE, SAVE :: xlon_max_vol(:)           ! max longitude of volcano in degree
   !$OMP THREADPRIVATE(ponde_lonlat_vol, xlat_min_vol, xlat_max_vol, xlon_min_vol, xlon_max_vol)
-  
+
   !--flag_emit=1
-  INTEGER,SAVE             :: nAerErupt                 ! number Aerosol 
+  INTEGER, SAVE :: nAerErupt                 ! number Aerosol
   !$OMP THREADPRIVATE(nAerErupt)
-  REAL,ALLOCATABLE,SAVE    :: m_sulf_emiss_vol(:)        ! emitted sulfur mass in kgS, e.g. 7Tg(S)=14Tg(SO2)
-  REAL,ALLOCATABLE,SAVE    :: m_aer_emiss_vol(:,:)
+  REAL, ALLOCATABLE, SAVE :: m_sulf_emiss_vol(:)        ! emitted sulfur mass in kgS, e.g. 7Tg(S)=14Tg(SO2)
+  REAL, ALLOCATABLE, SAVE :: m_aer_emiss_vol(:, :)
   !$OMP THREADPRIVATE(m_sulf_emiss_vol,m_aer_emiss_vol)
-  
+
   !--flag_emit=2 --SAI
-  REAL,SAVE    :: m_aer_emiss_sai        ! emitted sulfur mass in kgS, eg 1e9=1TgS, 1e10=10TgS
-  REAL,SAVE    :: altemiss_sai           ! emission altitude in m
-  REAL,SAVE    :: sigma_alt_sai          ! standard deviation of emission altitude in m
+  REAL, SAVE :: m_aer_emiss_sai        ! emitted sulfur mass in kgS, eg 1e9=1TgS, 1e10=10TgS
+  REAL, SAVE :: altemiss_sai           ! emission altitude in m
+  REAL, SAVE :: sigma_alt_sai          ! standard deviation of emission altitude in m
   !$OMP THREADPRIVATE(m_aer_emiss_sai, altemiss_sai, sigma_alt_sai)
-  INTEGER,SAVE    :: year_emit_sai_start
-  INTEGER,SAVE    :: year_emit_sai_end
-  INTEGER,SAVE    :: mth_emit_sai_start
-  INTEGER,SAVE    :: mth_emit_sai_end
-  INTEGER,SAVE    :: day_emit_sai_start
-  INTEGER,SAVE    :: day_emit_sai_end
+  INTEGER, SAVE :: year_emit_sai_start
+  INTEGER, SAVE :: year_emit_sai_end
+  INTEGER, SAVE :: mth_emit_sai_start
+  INTEGER, SAVE :: mth_emit_sai_end
+  INTEGER, SAVE :: day_emit_sai_start
+  INTEGER, SAVE :: day_emit_sai_end
   !$OMP THREADPRIVATE(year_emit_sai_start, year_emit_sai_end)
   !$OMP THREADPRIVATE(mth_emit_sai_start, mth_emit_sai_end)
   !$OMP THREADPRIVATE(day_emit_sai_start, day_emit_sai_end)
-  REAL,SAVE    :: xlat_sai               ! latitude of SAI in degree
-  REAL,SAVE    :: xlon_sai               ! longitude of SAI in degree
+  REAL, SAVE :: xlat_sai               ! latitude of SAI in degree
+  REAL, SAVE :: xlon_sai               ! longitude of SAI in degree
   !$OMP THREADPRIVATE(xlat_sai, xlon_sai)
-  
+
   !--flag_emit=3 -- SAI
-  REAL,SAVE    :: xlat_max_sai           ! maximum latitude of SAI in degrees
-  REAL,SAVE    :: xlat_min_sai           ! minimum latitude of SAI in degrees
+  REAL, SAVE :: xlat_max_sai           ! maximum latitude of SAI in degrees
+  REAL, SAVE :: xlat_min_sai           ! minimum latitude of SAI in degrees
   !$OMP THREADPRIVATE(xlat_min_sai,xlat_max_sai)
-  
+
   !--flag_emit=4 -- volc species
-  INTEGER,SAVE             :: nSpeciesErupt            ! number of species Repr
-  INTEGER,ALLOCATABLE,SAVE :: id_species(:)            ! indice species Repr
-  REAL,ALLOCATABLE,SAVE    :: m_species_emiss_vol(:,:) ! emitted species 
+  INTEGER, SAVE :: nSpeciesErupt            ! number of species Repr
+  INTEGER, ALLOCATABLE, SAVE :: id_species(:)            ! indice species Repr
+  REAL, ALLOCATABLE, SAVE :: m_species_emiss_vol(:, :) ! emitted species
   !$OMP THREADPRIVATE(nSpeciesErupt,id_species,m_species_emiss_vol)
-  INTEGER,ALLOCATABLE,SAVE :: id_HCl
-  INTEGER,ALLOCATABLE,SAVE :: id_HBr
-  INTEGER,ALLOCATABLE,SAVE :: id_NOx
-  INTEGER,ALLOCATABLE,SAVE :: id_H2O
+  INTEGER, ALLOCATABLE, SAVE :: id_HCl
+  INTEGER, ALLOCATABLE, SAVE :: id_HBr
+  INTEGER, ALLOCATABLE, SAVE :: id_NOx
+  INTEGER, ALLOCATABLE, SAVE :: id_H2O
   !$OMP THREADPRIVATE(id_HCl,id_HBr,id_NOx,id_H2O)
-  REAL,ALLOCATABLE,SAVE    :: m_Chlore_emiss_vol(:)   ! emitted Chlore mass 
-  REAL,ALLOCATABLE,SAVE    :: m_Brome_emiss_vol(:)    ! emitted Brome mass
-  REAL,ALLOCATABLE,SAVE    :: m_NOx_emiss_vol(:)      ! emitted NOx mass
-  REAL,ALLOCATABLE,SAVE    :: m_H2O_emiss_vol(:)      ! emitted H2O mass
-  REAL,ALLOCATABLE,SAVE    :: m_H2O_emiss_vol_daily(:)
+  REAL, ALLOCATABLE, SAVE :: m_Chlore_emiss_vol(:)   ! emitted Chlore mass
+  REAL, ALLOCATABLE, SAVE :: m_Brome_emiss_vol(:)    ! emitted Brome mass
+  REAL, ALLOCATABLE, SAVE :: m_NOx_emiss_vol(:)      ! emitted NOx mass
+  REAL, ALLOCATABLE, SAVE :: m_H2O_emiss_vol(:)      ! emitted H2O mass
+  REAL, ALLOCATABLE, SAVE :: m_H2O_emiss_vol_daily(:)
   !$OMP THREADPRIVATE(m_Chlore_emiss_vol,m_Brome_emiss_vol,m_NOx_emiss_vol,m_H2O_emiss_vol)
   !$OMP THREADPRIVATE(m_H2O_emiss_vol_daily)
-  
+
   !--flag_emit=5 -- Rockets Emitted
-  INTEGER, SAVE            :: ifreqroc        ! frequence (=2 ex: tous les 2 mois)
+  INTEGER, SAVE :: ifreqroc        ! frequence (=2 ex: tous les 2 mois)
   !$OMP THREADPRIVATE(ifreqroc)
-  INTEGER,ALLOCATABLE,SAVE :: day_emit_roc(:) ! day of emission date
+  INTEGER, ALLOCATABLE, SAVE :: day_emit_roc(:) ! day of emission date
   !$OMP THREADPRIVATE(day_emit_roc)
-  
-  REAL,ALLOCATABLE,SAVE    :: RRSI(:) ! radius [cm] for each aerosol size
-  REAL,ALLOCATABLE,SAVE    :: Vbin(:) ! volume [m3] for each aerosol size  
+
+  REAL, ALLOCATABLE, SAVE :: RRSI(:) ! radius [cm] for each aerosol size
+  REAL, ALLOCATABLE, SAVE :: Vbin(:) ! volume [m3] for each aerosol size
   !$OMP THREADPRIVATE(RRSI, Vbin)
-  REAL,SAVE    :: dlat, dlon             ! delta latitude and d longitude of grid in degree
+  REAL, SAVE :: dlat, dlon             ! delta latitude and d longitude of grid in degree
   !$OMP THREADPRIVATE(dlat, dlon)
-  
+
 CONTAINS
-    
+
   SUBROUTINE strataer_init()
-    USE ioipsl_getin_p_mod, ONLY : getin_p
-    USE print_control_mod, ONLY : lunout
-    USE mod_phys_lmdz_para, ONLY : is_master
-    USE infotrac_phy, ONLY: id_OCS_strat,id_SO2_strat,id_H2SO4_strat,nbtr_sulgas,nbtr_bin
-    USE phys_local_var_mod, ONLY : mdw
+    USE ioipsl_getin_p_mod, ONLY: getin_p
+    USE print_control_mod, ONLY: lunout
+    USE mod_phys_lmdz_para, ONLY: is_master
+    USE infotrac_phy, ONLY: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, nbtr_sulgas, nbtr_bin
+    USE phys_local_var_mod, ONLY: mdw
     USE aerophys, ONLY: mdwmin, V_rat
-    USE YOMCST  , ONLY : RPI
-    
+    USE lmdz_yomcst, ONLY: RPI
+
     INTEGER :: it
-    
-    WRITE(lunout,*) 'IN STRATAER_LOCAL_VAR INIT WELCOME!'
-    
+
+    WRITE(lunout, *) 'IN STRATAER_LOCAL_VAR INIT WELCOME!'
+
     !============= Check Sulfur aerosols ID =============
-    WRITE(lunout,*) 'STRATAER_LOCAL_VAR INIT: id_OCS_strat=',id_OCS_strat,' id_SO2_strat=',id_SO2_strat,' id_H2SO4_strat=',id_H2SO4_strat
-    
+    WRITE(lunout, *) 'STRATAER_LOCAL_VAR INIT: id_OCS_strat=', id_OCS_strat, ' id_SO2_strat=', id_SO2_strat, ' id_H2SO4_strat=', id_H2SO4_strat
+
     IF(id_OCS_strat < 0 .OR. id_OCS_strat > nbtr_sulgas) THEN
-       WRITE(lunout,*) 'ERROR : OCS index id_OCS_strat=',id_OCS_strat,' is negative or superior than the total sulfur gases !'
-       CALL abort_physic('strataer_local_var_mod','Wrong OCS index, check your tracer.def file.',1)
+      WRITE(lunout, *) 'ERROR : OCS index id_OCS_strat=', id_OCS_strat, ' is negative or superior than the total sulfur gases !'
+      CALL abort_physic('strataer_local_var_mod', 'Wrong OCS index, check your tracer.def file.', 1)
     ELSEIF(id_SO2_strat < 0 .OR. id_SO2_strat > nbtr_sulgas) THEN
-       WRITE(lunout,*) 'ERROR : SO2 index id_SO2_strat=',id_SO2_strat,' is negative or superior than the total sulfur gases !'
-       CALL abort_physic('strataer_local_var_mod','Wrong SO2 index, check your tracer.def file.',1)
+      WRITE(lunout, *) 'ERROR : SO2 index id_SO2_strat=', id_SO2_strat, ' is negative or superior than the total sulfur gases !'
+      CALL abort_physic('strataer_local_var_mod', 'Wrong SO2 index, check your tracer.def file.', 1)
     ELSEIF(id_H2SO4_strat < 0 .OR. id_H2SO4_strat > nbtr_sulgas) THEN
-       WRITE(lunout,*) 'ERROR : H2SO4 index id_H2SO4_strat=',id_H2SO4_strat,' is negative or superior than the total sulfur gases !'
-       CALL abort_physic('strataer_local_var_mod','Wrong H2SO4 index, check your tracer.def file.',1)
-    ENDIF
-    
+      WRITE(lunout, *) 'ERROR : H2SO4 index id_H2SO4_strat=', id_H2SO4_strat, ' is negative or superior than the total sulfur gases !'
+      CALL abort_physic('strataer_local_var_mod', 'Wrong H2SO4 index, check your tracer.def file.', 1)
+    ENDIF
+
     !============= Init params =============
     flag_emit = 0                   ! Background (default)
@@ -191,94 +191,94 @@
     flag_H2SO4_photolysis = .FALSE. ! H2SO4 photolysis (default: No)
     flag_min_rreduce = .TRUE.       ! Minimum lifetime=1.5 pdt phys (default: Yes)
-    flag_new_strat_compo =.TRUE.    ! H2SO4/H2O weight percent & density routine (default: S. Bekki)
+    flag_new_strat_compo = .TRUE.    ! H2SO4/H2O weight percent & density routine (default: S. Bekki)
     ok_qemiss = .FALSE.             ! H2O emission flag
-    
+
     ! nuc init
     ALPH2SO4 = 0.1
     flag_nuc_rate_box = .FALSE.
-    nuclat_min=0  ; nuclat_max=0
-    nucpres_min=0 ; nucpres_max=0
-    
+    nuclat_min = 0  ; nuclat_max = 0
+    nucpres_min = 0 ; nucpres_max = 0
+
     ! emiss init
     nErupt = 0 ! eruption number
     injdur = 0 ! init injection duration
     nAerErupt = 1 ; nSpeciesErupt = 1
-    ifreqroc=2 ; flh2o=0
-    
+    ifreqroc = 2 ; flh2o = 0
+
     !============= Read params =============
-    CALL getin_p('flag_emit',flag_emit)
-    CALL getin_p('flag_emit_distrib',flag_emit_distrib)
-    CALL getin_p('flag_verbose_strataer',flag_verbose_strataer)
-    CALL getin_p('flag_new_nucl',flag_new_nucl)
-    CALL getin_p('flag_newclim_file',flag_newclim_file)
-    CALL getin_p('flag_H2O2d_nucleation',flag_H2O2d_nucleation)
-    CALL getin_p('flag_OH_reduced',flag_OH_reduced)
-    CALL getin_p('flag_H2SO4_photolysis',flag_H2SO4_photolysis)
-    CALL getin_p('flag_min_rreduce',flag_min_rreduce)
-    CALL getin_p('flag_new_strat_compo',flag_new_strat_compo)
-    CALL getin_p('ok_qemiss',ok_qemiss)
-    
+    CALL getin_p('flag_emit', flag_emit)
+    CALL getin_p('flag_emit_distrib', flag_emit_distrib)
+    CALL getin_p('flag_verbose_strataer', flag_verbose_strataer)
+    CALL getin_p('flag_new_nucl', flag_new_nucl)
+    CALL getin_p('flag_newclim_file', flag_newclim_file)
+    CALL getin_p('flag_H2O2d_nucleation', flag_H2O2d_nucleation)
+    CALL getin_p('flag_OH_reduced', flag_OH_reduced)
+    CALL getin_p('flag_H2SO4_photolysis', flag_H2SO4_photolysis)
+    CALL getin_p('flag_min_rreduce', flag_min_rreduce)
+    CALL getin_p('flag_new_strat_compo', flag_new_strat_compo)
+    CALL getin_p('ok_qemiss', ok_qemiss)
+
     !============= Test flag coherence =============
     IF (.NOT. flag_newclim_file) THEN
-       IF (flag_H2SO4_photolysis .OR. flag_OH_reduced .OR. flag_H2O2d_nucleation) THEN
-          WRITE(lunout,*) 'ERROR : flag_newclim_file=',flag_newclim_file, &
-               ' whereas flag_H2SO4_photolysis=',flag_H2SO4_photolysis,', flag_OH_reduced=',flag_OH_reduced, &
-               ' and flag_H2O2d_nucleation=',flag_H2O2d_nucleation
-          CALL abort_physic('strataer_local_var_mod','Incompatible options in physiq_def file !',1)
-       ENDIF
-       IF(flag_min_rreduce) THEN
-          WRITE(lunout,*) 'Warning : flag_min_rreduce will be ignored with old climato file !'
-       ENDIF
-    ENDIF
-    
+      IF (flag_H2SO4_photolysis .OR. flag_OH_reduced .OR. flag_H2O2d_nucleation) THEN
+        WRITE(lunout, *) 'ERROR : flag_newclim_file=', flag_newclim_file, &
+                ' whereas flag_H2SO4_photolysis=', flag_H2SO4_photolysis, ', flag_OH_reduced=', flag_OH_reduced, &
+                ' and flag_H2O2d_nucleation=', flag_H2O2d_nucleation
+        CALL abort_physic('strataer_local_var_mod', 'Incompatible options in physiq_def file !', 1)
+      ENDIF
+      IF(flag_min_rreduce) THEN
+        WRITE(lunout, *) 'Warning : flag_min_rreduce will be ignored with old climato file !'
+      ENDIF
+    ENDIF
+
     !============= Print params =============
     IF (is_master) THEN
-       WRITE(lunout,*) 'flag_emit = ',flag_emit
-       WRITE(lunout,*) 'IN STRATAER : flag_new_nucl = ',flag_new_nucl
-       WRITE(lunout,*) 'IN STRATAER : flag_newclim_file = ',flag_newclim_file
-       WRITE(lunout,*) 'IN STRATAER : flag_emit_distrib = ',flag_emit_distrib
-       WRITE(lunout,*) 'IN STRATAER : flag_verbose_strataer = ',flag_verbose_strataer
-       IF (flag_emit == 1 .OR. flag_emit == 4) THEN
-          WRITE(lunout,*) 'IN STRATAER : flag_H2O2d_nucleation = ',flag_H2O2d_nucleation
-          WRITE(lunout,*) 'IN STRATAER : flag_OH_reduced = ',flag_OH_reduced
-          WRITE(lunout,*) 'IN STRATAER : flag_H2SO4_photolysis = ',flag_H2SO4_photolysis
-          WRITE(lunout,*) 'IN STRATAER : flag_min_rreduce = ',flag_min_rreduce
-          WRITE(lunout,*) 'IN STRATAER : flag_new_strat_compo = ',flag_new_strat_compo
-          WRITE(lunout,*) 'IN STRATAER : ok_qemiss = ',ok_qemiss
-       ENDIF
+      WRITE(lunout, *) 'flag_emit = ', flag_emit
+      WRITE(lunout, *) 'IN STRATAER : flag_new_nucl = ', flag_new_nucl
+      WRITE(lunout, *) 'IN STRATAER : flag_newclim_file = ', flag_newclim_file
+      WRITE(lunout, *) 'IN STRATAER : flag_emit_distrib = ', flag_emit_distrib
+      WRITE(lunout, *) 'IN STRATAER : flag_verbose_strataer = ', flag_verbose_strataer
+      IF (flag_emit == 1 .OR. flag_emit == 4) THEN
+        WRITE(lunout, *) 'IN STRATAER : flag_H2O2d_nucleation = ', flag_H2O2d_nucleation
+        WRITE(lunout, *) 'IN STRATAER : flag_OH_reduced = ', flag_OH_reduced
+        WRITE(lunout, *) 'IN STRATAER : flag_H2SO4_photolysis = ', flag_H2SO4_photolysis
+        WRITE(lunout, *) 'IN STRATAER : flag_min_rreduce = ', flag_min_rreduce
+        WRITE(lunout, *) 'IN STRATAER : flag_new_strat_compo = ', flag_new_strat_compo
+        WRITE(lunout, *) 'IN STRATAER : ok_qemiss = ', ok_qemiss
+      ENDIF
     ENDIF ! if master
-    
+
     !--initialising dry diameters to geometrically spaced mass/volume (see Jacobson 1994)
-    mdw(1)=mdwmin
+    mdw(1) = mdwmin
     IF (V_rat<1.62) THEN ! compensate for dip in second bin for lower volume ratio
-       mdw(2)=mdw(1)*2.**(1./3.)
-       DO it=3, nbtr_bin
-          mdw(it)=mdw(it-1)*V_rat**(1./3.)
-       ENDDO
+      mdw(2) = mdw(1) * 2.**(1. / 3.)
+      DO it = 3, nbtr_bin
+        mdw(it) = mdw(it - 1) * V_rat**(1. / 3.)
+      ENDDO
     ELSE
-       DO it=2, nbtr_bin
-          mdw(it)=mdw(it-1)*V_rat**(1./3.)
-       ENDDO
-    ENDIF
-    IF (is_master) WRITE(lunout,*) 'init mdw=', mdw
-    
+      DO it = 2, nbtr_bin
+        mdw(it) = mdw(it - 1) * V_rat**(1. / 3.)
+      ENDDO
+    ENDIF
+    IF (is_master) WRITE(lunout, *) 'init mdw=', mdw
+
     !   compute particle radius RRSI [cm] and volume Vbin [m3] from diameter mdw [m]
     ALLOCATE(RRSI(nbtr_bin), Vbin(nbtr_bin))
-    
-    DO it=1,nbtr_bin
-       !     [cm]
-       RRSI(it)=mdw(it)/2.*100.
-       !     [m3]
-       Vbin(it)=4.0*RPI*((mdw(it)/2.)**3)/3.0
+
+    DO it = 1, nbtr_bin
+      !     [cm]
+      RRSI(it) = mdw(it) / 2. * 100.
+      !     [m3]
+      Vbin(it) = 4.0 * RPI * ((mdw(it) / 2.)**3) / 3.0
     ENDDO
-    
+
     IF (is_master) THEN
-       WRITE(lunout,*) 'init RRSI=', RRSI
-       WRITE(lunout,*) 'init Vbin=', Vbin
-    ENDIF
-    
-    WRITE(lunout,*) 'IN STRATAER INIT END'
-    
+      WRITE(lunout, *) 'init RRSI=', RRSI
+      WRITE(lunout, *) 'init Vbin=', Vbin
+    ENDIF
+
+    WRITE(lunout, *) 'IN STRATAER INIT END'
+
   END SUBROUTINE strataer_init
-  
+
 END MODULE strataer_local_var_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratdistrib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratdistrib.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratdistrib.F90	(revision 5098)
@@ -6,5 +6,5 @@
   USE dimphy, ONLY : klon,klev
   USE strataer_local_var_mod
-  USE YOMCST, only : RPI
+  USE lmdz_yomcst, only : RPI
 
   IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratemit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratemit.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratemit.F90	(revision 5098)
@@ -10,5 +10,5 @@
   USE phys_cal_mod
   USE phys_local_var_mod, ONLY: d_q_emiss
-  USE YOMCST, only : RD, RPI, RG
+  USE lmdz_yomcst, only : RD, RPI, RG
   USE geometry_mod, ONLY : cell_area, boundslat
   USE aerophys
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/traccoag_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/traccoag_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/traccoag_mod.F90	(revision 5098)
@@ -24,5 +24,5 @@
     USE sulfate_aer_mod
     USE phys_local_var_mod, ONLY: stratomask
-    USE YOMCST
+    USE lmdz_yomcst
     USE print_control_mod, ONLY: lunout
     USE strataer_local_var_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90	(revision 5098)
@@ -147,7 +147,4 @@
 !
 
-!INCLUDE "YOMCST.h"
-!INCLUDE "clesphys.h"
-
 !*      0.2    declarations of local variables
 !
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/conf_phys_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/conf_phys_m.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/conf_phys_m.F90	(revision 5098)
@@ -11,28 +11,29 @@
 
   SUBROUTINE conf_phys(ok_journe, ok_mensuel, ok_instan, ok_hf, &
-       ok_LES,&
-       callstats,&
-       solarlong0,seuil_inversion, &
-       fact_cldcon, facttemps,ok_newmicro,iflag_radia,&
-       iflag_cld_th, &
-       ratqsbas,ratqshaut,tau_ratqs, &
-       ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat, aerosol_couple, & 
-       chemistry_couple, flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
-       flag_bc_internal_mixture, bl95_b0, bl95_b1,&
-       read_climoz, &
-       alp_offset)
+          ok_LES, &
+          callstats, &
+          solarlong0, seuil_inversion, &
+          fact_cldcon, facttemps, ok_newmicro, iflag_radia, &
+          iflag_cld_th, &
+          ratqsbas, ratqshaut, tau_ratqs, &
+          ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat, aerosol_couple, &
+          chemistry_couple, flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
+          flag_bc_internal_mixture, bl95_b0, bl95_b1, &
+          read_climoz, &
+          alp_offset)
 
     USE IOIPSL
     USE surface_data
     USE phys_cal_mod
-    USE carbon_cycle_mod,  ONLY: carbon_cycle_tr, carbon_cycle_cpl, carbon_cycle_rad, level_coupling_esm
-    USE carbon_cycle_mod,  ONLY: read_fco2_ocean_cor,var_fco2_ocean_cor
-    USE carbon_cycle_mod,  ONLY: read_fco2_land_cor,var_fco2_land_cor
-    USE chemistry_cycle_mod, ONLY: dms_cycle_cpl, n2o_cycle_cpl
-    USE mod_grid_phy_lmdz, ONLY: klon_glo
-    USE print_control_mod, ONLY: lunout
-    use config_ocean_skin_m, only: config_ocean_skin
-    USE phys_state_var_mod, ONLY: phys_tstep
-    USE infotrac_phy, ONLY: type_trac
+    USE carbon_cycle_mod, ONLY : carbon_cycle_tr, carbon_cycle_cpl, carbon_cycle_rad, level_coupling_esm
+    USE carbon_cycle_mod, ONLY : read_fco2_ocean_cor, var_fco2_ocean_cor
+    USE carbon_cycle_mod, ONLY : read_fco2_land_cor, var_fco2_land_cor
+    USE chemistry_cycle_mod, ONLY : dms_cycle_cpl, n2o_cycle_cpl
+    USE mod_grid_phy_lmdz, ONLY : klon_glo
+    USE print_control_mod, ONLY : lunout
+    use config_ocean_skin_m, only : config_ocean_skin
+    USE phys_state_var_mod, ONLY : phys_tstep
+    USE infotrac_phy, ONLY : type_trac
+    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
 
     INCLUDE "conema3.h"
@@ -72,84 +73,83 @@
 
     ! Sortie:
-    LOGICAL              :: ok_newmicro
-    INTEGER              :: iflag_radia
-    LOGICAL              :: ok_journe, ok_mensuel, ok_instan, ok_hf
-    LOGICAL              :: ok_LES
-    LOGICAL              :: callstats
-    LOGICAL              :: ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan
-    LOGICAL              :: aerosol_couple, chemistry_couple
-    INTEGER              :: flag_aerosol
-    INTEGER              :: flag_aerosol_strat
-    INTEGER              :: flag_volc_surfstrat
-    LOGICAL              :: flag_aer_feedback
-    LOGICAL              :: flag_bc_internal_mixture
-    REAL                 :: bl95_b0, bl95_b1
-    REAL                 :: fact_cldcon, facttemps,ratqsbas,ratqshaut,tau_ratqs
-    INTEGER              :: iflag_cld_th
-     
-
-    CHARACTER (len = 6), SAVE  :: type_ocean_omp, version_ocean_omp, ocean_omp
-    CHARACTER (len = 10),SAVE  :: type_veget_omp
-    CHARACTER (len = 8), SAVE  :: aer_type_omp
-    INTEGER, SAVE       :: landice_opt_omp
-    INTEGER, SAVE       :: iflag_tsurf_inlandsis_omp,iflag_temp_inlandsis_omp
-    INTEGER, SAVE       :: iflag_albcalc_omp,iflag_z0m_snow_omp   
-    LOGICAL, SAVE       :: SnoMod_omp,BloMod_omp,ok_outfor_omp,ok_zsn_ii_omp
-    LOGICAL, SAVE       :: discret_xf_omp,opt_runoff_ac_omp  
-    LOGICAL, SAVE       :: is_ok_slush_omp,is_ok_z0h_rn_omp,is_ok_density_kotlyakov_omp
-    REAL, SAVE          :: prescribed_z0m_snow_omp,correc_alb_omp
-    REAL, SAVE          :: buf_sph_pol_omp,buf_siz_pol_omp
-    LOGICAL, SAVE       :: ok_newmicro_omp
-    LOGICAL, SAVE       :: ok_all_xml_omp
-    LOGICAL, SAVE       :: ok_lwoff_omp
-    LOGICAL, SAVE       :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp        
-    LOGICAL, SAVE       :: ok_LES_omp   
-    LOGICAL, SAVE       :: callstats_omp
-    LOGICAL, SAVE       :: ok_ade_omp, ok_aie_omp, ok_alw_omp, ok_cdnc_omp, ok_volcan_omp
-    LOGICAL, SAVE       :: aerosol_couple_omp, chemistry_couple_omp
-    INTEGER, SAVE       :: flag_aerosol_omp
-    INTEGER, SAVE       :: flag_aerosol_strat_omp
-    INTEGER, SAVE       :: flag_volc_surfstrat_omp
-    LOGICAL, SAVE       :: flag_aer_feedback_omp
-    LOGICAL, SAVE       :: flag_bc_internal_mixture_omp
-    REAL,SAVE           :: bl95_b0_omp, bl95_b1_omp
-    REAL,SAVE           :: freq_ISCCP_omp, ecrit_ISCCP_omp
-    REAL,SAVE           :: freq_COSP_omp, freq_AIRS_omp 
-    REAL,SAVE           :: fact_cldcon_omp, facttemps_omp,ratqsbas_omp
-    REAL,SAVE           :: tau_cld_cv_omp, coefw_cld_cv_omp
-    INTEGER, SAVE       :: iflag_cld_cv_omp
-
-    REAL, SAVE          :: ratqshaut_omp
-    REAL, SAVE          :: tau_ratqs_omp
-    REAL, SAVE          :: t_coupl_omp
-    INTEGER, SAVE       :: iflag_radia_omp
-    INTEGER, SAVE       :: iflag_rrtm_omp
-    INTEGER, SAVE       :: iflag_albedo_omp !albedo SB
-    LOGICAL, SAVE       :: ok_chlorophyll_omp ! albedo SB  
-    INTEGER, SAVE       :: NSW_omp
-    INTEGER, SAVE       :: iflag_cld_th_omp, ip_ebil_phy_omp
-    INTEGER, SAVE       :: iflag_ratqs_omp
-
-    REAL, SAVE          :: f_cdrag_ter_omp,f_cdrag_oce_omp
-    REAL, SAVE          :: f_rugoro_omp   , z0min_omp
-    REAL, SAVE          :: z0m_seaice_omp,z0h_seaice_omp
-    REAL, SAVE          :: z0m_landice_omp,z0h_landice_omp
-    REAL, SAVE          :: min_wind_speed_omp,f_gust_wk_omp,f_gust_bl_omp,f_qsat_oce_omp, f_z0qh_oce_omp
-    INTEGER, SAVE       :: iflag_gusts_omp,iflag_z0_oce_omp
+    LOGICAL :: ok_newmicro
+    INTEGER :: iflag_radia
+    LOGICAL :: ok_journe, ok_mensuel, ok_instan, ok_hf
+    LOGICAL :: ok_LES
+    LOGICAL :: callstats
+    LOGICAL :: ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan
+    LOGICAL :: aerosol_couple, chemistry_couple
+    INTEGER :: flag_aerosol
+    INTEGER :: flag_aerosol_strat
+    INTEGER :: flag_volc_surfstrat
+    LOGICAL :: flag_aer_feedback
+    LOGICAL :: flag_bc_internal_mixture
+    REAL :: bl95_b0, bl95_b1
+    REAL :: fact_cldcon, facttemps, ratqsbas, ratqshaut, tau_ratqs
+    INTEGER :: iflag_cld_th
+
+    CHARACTER (len = 6), SAVE :: type_ocean_omp, version_ocean_omp, ocean_omp
+    CHARACTER (len = 10), SAVE :: type_veget_omp
+    CHARACTER (len = 8), SAVE :: aer_type_omp
+    INTEGER, SAVE :: landice_opt_omp
+    INTEGER, SAVE :: iflag_tsurf_inlandsis_omp, iflag_temp_inlandsis_omp
+    INTEGER, SAVE :: iflag_albcalc_omp, iflag_z0m_snow_omp
+    LOGICAL, SAVE :: SnoMod_omp, BloMod_omp, ok_outfor_omp, ok_zsn_ii_omp
+    LOGICAL, SAVE :: discret_xf_omp, opt_runoff_ac_omp
+    LOGICAL, SAVE :: is_ok_slush_omp, is_ok_z0h_rn_omp, is_ok_density_kotlyakov_omp
+    REAL, SAVE :: prescribed_z0m_snow_omp, correc_alb_omp
+    REAL, SAVE :: buf_sph_pol_omp, buf_siz_pol_omp
+    LOGICAL, SAVE :: ok_newmicro_omp
+    LOGICAL, SAVE :: ok_all_xml_omp
+    LOGICAL, SAVE :: ok_lwoff_omp
+    LOGICAL, SAVE :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp
+    LOGICAL, SAVE :: ok_LES_omp
+    LOGICAL, SAVE :: callstats_omp
+    LOGICAL, SAVE :: ok_ade_omp, ok_aie_omp, ok_alw_omp, ok_cdnc_omp, ok_volcan_omp
+    LOGICAL, SAVE :: aerosol_couple_omp, chemistry_couple_omp
+    INTEGER, SAVE :: flag_aerosol_omp
+    INTEGER, SAVE :: flag_aerosol_strat_omp
+    INTEGER, SAVE :: flag_volc_surfstrat_omp
+    LOGICAL, SAVE :: flag_aer_feedback_omp
+    LOGICAL, SAVE :: flag_bc_internal_mixture_omp
+    REAL, SAVE :: bl95_b0_omp, bl95_b1_omp
+    REAL, SAVE :: freq_ISCCP_omp, ecrit_ISCCP_omp
+    REAL, SAVE :: freq_COSP_omp, freq_AIRS_omp
+    REAL, SAVE :: fact_cldcon_omp, facttemps_omp, ratqsbas_omp
+    REAL, SAVE :: tau_cld_cv_omp, coefw_cld_cv_omp
+    INTEGER, SAVE :: iflag_cld_cv_omp
+
+    REAL, SAVE :: ratqshaut_omp
+    REAL, SAVE :: tau_ratqs_omp
+    REAL, SAVE :: t_coupl_omp
+    INTEGER, SAVE :: iflag_radia_omp
+    INTEGER, SAVE :: iflag_rrtm_omp
+    INTEGER, SAVE :: iflag_albedo_omp !albedo SB
+    LOGICAL, SAVE :: ok_chlorophyll_omp ! albedo SB
+    INTEGER, SAVE :: NSW_omp
+    INTEGER, SAVE :: iflag_cld_th_omp, ip_ebil_phy_omp
+    INTEGER, SAVE :: iflag_ratqs_omp
+
+    REAL, SAVE :: f_cdrag_ter_omp, f_cdrag_oce_omp
+    REAL, SAVE :: f_rugoro_omp, z0min_omp
+    REAL, SAVE :: z0m_seaice_omp, z0h_seaice_omp
+    REAL, SAVE :: z0m_landice_omp, z0h_landice_omp
+    REAL, SAVE :: min_wind_speed_omp, f_gust_wk_omp, f_gust_bl_omp, f_qsat_oce_omp, f_z0qh_oce_omp
+    INTEGER, SAVE :: iflag_gusts_omp, iflag_z0_oce_omp
 
     REAL :: seuil_inversion
-    REAL,SAVE :: seuil_inversion_omp
-
-    INTEGER,SAVE :: iflag_thermals_omp,nsplit_thermals_omp
-    REAL,SAVE :: tau_thermals_omp,alp_bl_k_omp
+    REAL, SAVE :: seuil_inversion_omp
+
+    INTEGER, SAVE :: iflag_thermals_omp, nsplit_thermals_omp
+    REAL, SAVE :: tau_thermals_omp, alp_bl_k_omp
     ! nrlmd le 10/04/2012
-    INTEGER,SAVE :: iflag_trig_bl_omp,iflag_clos_bl_omp,iflag_strig_omp
-    INTEGER,SAVE :: tau_trig_shallow_omp,tau_trig_deep_omp
-    REAL,SAVE    :: s_trig_omp,h_trig_omp
+    INTEGER, SAVE :: iflag_trig_bl_omp, iflag_clos_bl_omp, iflag_strig_omp
+    INTEGER, SAVE :: tau_trig_shallow_omp, tau_trig_deep_omp
+    REAL, SAVE :: s_trig_omp, h_trig_omp
     ! fin nrlmd le 10/04/2012
     REAL :: alp_offset
     REAL, SAVE :: alp_offset_omp
-    INTEGER,SAVE :: iflag_coupl_omp,iflag_clos_omp,iflag_wake_omp
-    INTEGER,SAVE :: iflag_cvl_sigd_omp
+    INTEGER, SAVE :: iflag_coupl_omp, iflag_clos_omp, iflag_wake_omp
+    INTEGER, SAVE :: iflag_cvl_sigd_omp
     REAL, SAVE :: coef_clos_ls_omp
     REAL, SAVE :: supcrit1_omp, supcrit2_omp
@@ -159,63 +159,63 @@
     REAL, SAVE :: tmax_fonte_cv_omp
 
-    REAL,SAVE :: R_ecc_omp,R_peri_omp,R_incl_omp,solaire_omp
-    REAL,SAVE :: solaire_omp_init
-    LOGICAL,SAVE :: ok_suntime_rrtm_omp
-    REAL,SAVE :: co2_ppm_omp, RCO2_omp, co2_ppm_per_omp, RCO2_per_omp
-    REAL,SAVE :: co2_ppm0_omp
-    REAL,SAVE :: CH4_ppb_omp, RCH4_omp, CH4_ppb_per_omp, RCH4_per_omp
-    REAL,SAVE :: N2O_ppb_omp, RN2O_omp, N2O_ppb_per_omp, RN2O_per_omp
-    REAL,SAVE :: CFC11_ppt_omp,RCFC11_omp,CFC11_ppt_per_omp,RCFC11_per_omp
-    REAL,SAVE :: CFC12_ppt_omp,RCFC12_omp,CFC12_ppt_per_omp,RCFC12_per_omp
-    REAL,SAVE :: epmax_omp
-    REAL,SAVE :: coef_epmax_cape_omp
-    LOGICAL,SAVE :: ok_adj_ema_omp
-    INTEGER,SAVE :: iflag_clw_omp
-    INTEGER,SAVE :: iflag_ice_thermo_omp
-    LOGICAL,SAVE :: ok_ice_sursat_omp
-    LOGICAL,SAVE :: ok_plane_h2o_omp, ok_plane_contrail_omp
-    REAL,SAVE :: rad_froid_omp, rad_chau1_omp, rad_chau2_omp
-    INTEGER,SAVE :: iflag_sic_omp, iflag_inertie_omp
-    REAL,SAVE :: inertie_sol_omp,inertie_sno_omp,inertie_sic_omp
-    REAL,SAVE :: inertie_lic_omp
-    REAL,SAVE :: qsol0_omp
-    REAL,SAVE :: evap0_omp
-    REAL,SAVE :: albsno0_omp
-    REAL      :: solarlong0
-    REAL,SAVE :: solarlong0_omp
-    INTEGER,SAVE :: top_height_omp,overlap_omp
-    REAL,SAVE :: cdmmax_omp,cdhmax_omp,ksta_omp,ksta_ter_omp,f_ri_cd_min_omp
-    LOGICAL,SAVE :: ok_kzmin_omp
-    REAL, SAVE ::  fmagic_omp, pmagic_omp
-    INTEGER,SAVE :: iflag_pbl_omp,lev_histhf_omp,lev_histday_omp,lev_histmth_omp
-    INTEGER,SAVE :: iflag_pbl_split_omp,iflag_physiq_omp
-!FC
-    INTEGER,SAVE :: ifl_pbltree_omp
-    REAL,SAVE :: Cd_frein_omp
-!FC
-    INTEGER,SAVE :: iflag_order2_sollw_omp
-    INTEGER, SAVE :: lev_histins_omp, lev_histLES_omp 
+    REAL, SAVE :: R_ecc_omp, R_peri_omp, R_incl_omp, solaire_omp
+    REAL, SAVE :: solaire_omp_init
+    LOGICAL, SAVE :: ok_suntime_rrtm_omp
+    REAL, SAVE :: co2_ppm_omp, RCO2_omp, co2_ppm_per_omp, RCO2_per_omp
+    REAL, SAVE :: co2_ppm0_omp
+    REAL, SAVE :: CH4_ppb_omp, RCH4_omp, CH4_ppb_per_omp, RCH4_per_omp
+    REAL, SAVE :: N2O_ppb_omp, RN2O_omp, N2O_ppb_per_omp, RN2O_per_omp
+    REAL, SAVE :: CFC11_ppt_omp, RCFC11_omp, CFC11_ppt_per_omp, RCFC11_per_omp
+    REAL, SAVE :: CFC12_ppt_omp, RCFC12_omp, CFC12_ppt_per_omp, RCFC12_per_omp
+    REAL, SAVE :: epmax_omp
+    REAL, SAVE :: coef_epmax_cape_omp
+    LOGICAL, SAVE :: ok_adj_ema_omp
+    INTEGER, SAVE :: iflag_clw_omp
+    INTEGER, SAVE :: iflag_ice_thermo_omp
+    LOGICAL, SAVE :: ok_ice_sursat_omp
+    LOGICAL, SAVE :: ok_plane_h2o_omp, ok_plane_contrail_omp
+    REAL, SAVE :: rad_froid_omp, rad_chau1_omp, rad_chau2_omp
+    INTEGER, SAVE :: iflag_sic_omp, iflag_inertie_omp
+    REAL, SAVE :: inertie_sol_omp, inertie_sno_omp, inertie_sic_omp
+    REAL, SAVE :: inertie_lic_omp
+    REAL, SAVE :: qsol0_omp
+    REAL, SAVE :: evap0_omp
+    REAL, SAVE :: albsno0_omp
+    REAL :: solarlong0
+    REAL, SAVE :: solarlong0_omp
+    INTEGER, SAVE :: top_height_omp, overlap_omp
+    REAL, SAVE :: cdmmax_omp, cdhmax_omp, ksta_omp, ksta_ter_omp, f_ri_cd_min_omp
+    LOGICAL, SAVE :: ok_kzmin_omp
+    REAL, SAVE :: fmagic_omp, pmagic_omp
+    INTEGER, SAVE :: iflag_pbl_omp, lev_histhf_omp, lev_histday_omp, lev_histmth_omp
+    INTEGER, SAVE :: iflag_pbl_split_omp, iflag_physiq_omp
+    !FC
+    INTEGER, SAVE :: ifl_pbltree_omp
+    REAL, SAVE :: Cd_frein_omp
+    !FC
+    INTEGER, SAVE :: iflag_order2_sollw_omp
+    INTEGER, SAVE :: lev_histins_omp, lev_histLES_omp
     INTEGER, SAVE :: lev_histdayNMC_omp
     INTEGER, SAVE :: levout_histNMC_omp(3)
     LOGICAL, SAVE :: ok_histNMC_omp(3)
-    REAL, SAVE    :: freq_outNMC_omp(3), freq_calNMC_omp(3)
+    REAL, SAVE :: freq_outNMC_omp(3), freq_calNMC_omp(3)
     CHARACTER*4, SAVE :: type_run_omp
     LOGICAL, SAVE :: ok_cosp_omp, ok_airs_omp
-    LOGICAL, SAVE :: ok_mensuelCOSP_omp,ok_journeCOSP_omp,ok_hfCOSP_omp
-    REAL, SAVE    :: lonmin_ins_omp, lonmax_ins_omp, latmin_ins_omp, latmax_ins_omp
-    REAL, SAVE    :: ecrit_hf_omp, ecrit_day_omp, ecrit_mth_omp, ecrit_reg_omp
-    REAL, SAVE    :: ecrit_ins_omp
-    REAL, SAVE    :: ecrit_LES_omp
-    REAL, SAVE    :: ecrit_tra_omp
-    REAL, SAVE    :: cvl_comp_threshold_omp
-    REAL, SAVE    :: cvl_sig2feed_omp
-    REAL, SAVE    :: cvl_corr_omp
+    LOGICAL, SAVE :: ok_mensuelCOSP_omp, ok_journeCOSP_omp, ok_hfCOSP_omp
+    REAL, SAVE :: lonmin_ins_omp, lonmax_ins_omp, latmin_ins_omp, latmax_ins_omp
+    REAL, SAVE :: ecrit_hf_omp, ecrit_day_omp, ecrit_mth_omp, ecrit_reg_omp
+    REAL, SAVE :: ecrit_ins_omp
+    REAL, SAVE :: ecrit_LES_omp
+    REAL, SAVE :: ecrit_tra_omp
+    REAL, SAVE :: cvl_comp_threshold_omp
+    REAL, SAVE :: cvl_sig2feed_omp
+    REAL, SAVE :: cvl_corr_omp
     LOGICAL, SAVE :: ok_lic_melt_omp
     LOGICAL, SAVE :: ok_lic_cond_omp
     !
-    REAL, SAVE    :: zrel_oro_t_omp, zstd_orodr_t_omp
-    REAL, SAVE    :: zpmm_orodr_t_omp, zpmm_orolf_t_omp
+    REAL, SAVE :: zrel_oro_t_omp, zstd_orodr_t_omp
+    REAL, SAVE :: zpmm_orodr_t_omp, zpmm_orolf_t_omp
     INTEGER, SAVE :: iflag_cycle_diurne_omp
-    LOGICAL, SAVE :: soil_model_omp,new_oliq_omp
+    LOGICAL, SAVE :: soil_model_omp, new_oliq_omp
     LOGICAL, SAVE :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp
     INTEGER, SAVE :: nbapp_rad_omp, iflag_con_omp
@@ -223,10 +223,10 @@
     INTEGER, SAVE :: iflag_ener_conserv_omp
     LOGICAL, SAVE :: ok_conserv_q_omp
-    LOGICAL,SAVE  :: ok_strato_omp
-    LOGICAL,SAVE  :: ok_hines_omp, ok_gwd_rando_omp
-    REAL, SAVE    :: gwd_rando_ruwmax_omp, gwd_rando_sat_omp
-    REAL, SAVE    :: gwd_front_ruwmax_omp, gwd_front_sat_omp
-    REAL, SAVE    :: sso_gkdrag_omp,sso_grahil_omp,sso_grcrit_omp
-    REAL, SAVE    :: sso_gfrcri_omp,sso_gkwake_omp,sso_gklift_omp
+    LOGICAL, SAVE :: ok_strato_omp
+    LOGICAL, SAVE :: ok_hines_omp, ok_gwd_rando_omp
+    REAL, SAVE :: gwd_rando_ruwmax_omp, gwd_rando_sat_omp
+    REAL, SAVE :: gwd_front_ruwmax_omp, gwd_front_sat_omp
+    REAL, SAVE :: sso_gkdrag_omp, sso_grahil_omp, sso_grcrit_omp
+    REAL, SAVE :: sso_gfrcri_omp, sso_gkwake_omp, sso_gklift_omp
     LOGICAL, SAVE :: ok_qch4_omp
     LOGICAL, SAVE :: carbon_cycle_tr_omp
@@ -236,7 +236,7 @@
     INTEGER, SAVE :: level_coupling_esm_omp
     LOGICAL, SAVE :: read_fco2_ocean_cor_omp
-    REAL, SAVE    :: var_fco2_ocean_cor_omp
+    REAL, SAVE :: var_fco2_ocean_cor_omp
     LOGICAL, SAVE :: read_fco2_land_cor_omp
-    REAL, SAVE    :: var_fco2_land_cor_omp
+    REAL, SAVE :: var_fco2_land_cor_omp
     LOGICAL, SAVE :: adjust_tropopause_omp
     LOGICAL, SAVE :: ok_daily_climoz_omp
@@ -244,11 +244,10 @@
     LOGICAL, SAVE :: ok_icefra_lscp_omp
     !rajout de choix_bulk et nit_bulk par Olivier Torres
-    INTEGER,SAVE  :: choix_bulk_omp
-    INTEGER,SAVE  :: nit_bulk_omp
-    INTEGER,SAVE  :: kz0_omp
+    INTEGER, SAVE :: choix_bulk_omp
+    INTEGER, SAVE :: nit_bulk_omp
+    INTEGER, SAVE :: kz0_omp
     LOGICAL, SAVE :: ok_bs_omp, ok_rad_bs_omp
 
-
-    INTEGER, INTENT(OUT):: read_climoz ! read ozone climatology, OpenMP shared
+    INTEGER, INTENT(OUT) :: read_climoz ! read ozone climatology, OpenMP shared
     ! Allowed values are 0, 1 and 2
     ! 0: do not read an ozone climatology
@@ -259,5 +258,5 @@
     !-----------------------------------------------------------------
 
-    print*,'CONFPHYS ENTREE'
+    print*, 'CONFPHYS ENTREE'
     !$OMP MASTER 
     !Config Key  = type_ocean 
@@ -285,8 +284,8 @@
     CALL getin('OCEAN', ocean_omp)
     IF (ocean_omp /= 'yyyyyy') THEN
-       WRITE(lunout,*)'ERROR! Old variable name OCEAN used in parmeter file.'
-       WRITE(lunout,*)'Variable OCEAN has been replaced by the variable type_ocean.'
-       WRITE(lunout,*)'You have to update your parameter file physiq.def to succed running'
-       CALL abort_physic('conf_phys','Variable OCEAN no longer existing, use variable name type_ocean',1)
+      WRITE(lunout, *)'ERROR! Old variable name OCEAN used in parmeter file.'
+      WRITE(lunout, *)'Variable OCEAN has been replaced by the variable type_ocean.'
+      WRITE(lunout, *)'You have to update your parameter file physiq.def to succed running'
+      CALL abort_physic('conf_phys', 'Variable OCEAN no longer existing, use variable name type_ocean', 1)
     ENDIF
 
@@ -299,7 +298,7 @@
     CALL getin('t_coupl', t_coupl_omp)
     IF (t_coupl_omp == 0) THEN
-       WRITE(lunout,*)'ERROR! Timestep of coupling between atmosphere and ocean'
-       WRITE(lunout,*)'cannot be zero.'
-       CALL abort_physic('conf_phys','t_coupl = 0.',1)
+      WRITE(lunout, *)'ERROR! Timestep of coupling between atmosphere and ocean'
+      WRITE(lunout, *)'cannot be zero.'
+      CALL abort_physic('conf_phys', 't_coupl = 0.', 1)
     ENDIF
 
@@ -329,5 +328,5 @@
     !Config Help = Type de modele de vegetation utilise
     !
-    type_veget_omp ='orchidee'
+    type_veget_omp = 'orchidee'
     CALL getin('VEGET', type_veget_omp)
     !
@@ -454,5 +453,5 @@
     !Config Desc = correction term for albedo
     !Config Def  = 1.01
-    correc_alb_omp=1.01
+    correc_alb_omp = 1.01
     CALL getin('correc_alb', correc_alb_omp)
 
@@ -462,5 +461,5 @@
     !Config Desc = sphericity of buffer layer in polar regions
     !Config Def  = 99.
-    buf_sph_pol_omp=99.
+    buf_sph_pol_omp = 99.
     CALL getin('buf_sph_pol', buf_sph_pol_omp)
 
@@ -469,9 +468,9 @@
     !Config Desc = grain size of buffer layer in polar regions in e-4m
     !Config Def  = 4.
-    buf_siz_pol_omp=4.
+    buf_siz_pol_omp = 4.
     CALL getin('buf_siz_pol', buf_siz_pol_omp)
 
     !==================================================================
-    
+
     !Config Key  = OK_journe
     !Config Desc = Pour des sorties journalieres 
@@ -561,5 +560,5 @@
     !
     flag_volc_surfstrat_omp = 0 ! NL: SURFSTRAT
-    CALL getin('flag_volc_surfstrat', flag_volc_surfstrat_omp) 
+    CALL getin('flag_volc_surfstrat', flag_volc_surfstrat_omp)
 
     !
@@ -570,5 +569,5 @@
     !
     aerosol_couple_omp = .FALSE.
-    CALL getin('aerosol_couple',aerosol_couple_omp)
+    CALL getin('aerosol_couple', aerosol_couple_omp)
     !
     !Config Key  = chemistry_couple
@@ -578,5 +577,5 @@
     !
     chemistry_couple_omp = .FALSE.
-    CALL getin('chemistry_couple',chemistry_couple_omp)
+    CALL getin('chemistry_couple', chemistry_couple_omp)
     !
     !Config Key  = flag_aerosol
@@ -596,5 +595,5 @@
 
     flag_aerosol_omp = 0
-    CALL getin('flag_aerosol',flag_aerosol_omp)
+    CALL getin('flag_aerosol', flag_aerosol_omp)
 
     !
@@ -607,5 +606,5 @@
     !
     flag_bc_internal_mixture_omp = .FALSE.
-    CALL getin('flag_bc_internal_mixture',flag_bc_internal_mixture_omp)
+    CALL getin('flag_bc_internal_mixture', flag_bc_internal_mixture_omp)
 
     ! 
@@ -615,6 +614,6 @@
     !Config Help = Used in readaerosol.F90 
     ! 
-    aer_type_omp = 'scenario' 
-    CALL getin('aer_type', aer_type_omp) 
+    aer_type_omp = 'scenario'
+    CALL getin('aer_type', aer_type_omp)
 
     !
@@ -681,5 +680,5 @@
     CALL getin('ip_ebil_phy', ip_ebil_phy_omp)
     IF (ip_ebil_phy_omp/=0) THEN
-       CALL abort_physic('conf_phys','ip_ebil_phy_omp doit etre 0 sur cette version',1)
+      CALL abort_physic('conf_phys', 'ip_ebil_phy_omp doit etre 0 sur cette version', 1)
     ENDIF
 
@@ -784,7 +783,7 @@
     !               
     CFC11_ppt_omp = 280.
-    CALL getin('CFC11_ppt',CFC11_ppt_omp)
+    CALL getin('CFC11_ppt', CFC11_ppt_omp)
     !conversion en rapport de mélange massique
-    RCFC11_omp=CFC11_ppt_omp* 1.0E-12 * RMCFC11 / RMD
+    RCFC11_omp = CFC11_ppt_omp * 1.0E-12 * RMCFC11 / RMD
     !
     !Config Key  = RCFC12
@@ -794,5 +793,5 @@
     !               
     CFC12_ppt_omp = 484.
-    CALL getin('CFC12_ppt',CFC12_ppt_omp)
+    CALL getin('CFC12_ppt', CFC12_ppt_omp)
     !conversion en rapport de mélange massique
     RCFC12_omp = CFC12_ppt_omp * 1.0E-12 * RMCFC12 / RMD
@@ -835,7 +834,7 @@
     !               
     CFC11_ppt_per_omp = CFC11_ppt_omp
-    CALL getin('CFC11_ppt_per',CFC11_ppt_per_omp)
+    CALL getin('CFC11_ppt_per', CFC11_ppt_per_omp)
     !conversion en rapport de mélange massique
-    RCFC11_per_omp=CFC11_ppt_per_omp* 1.0E-12 * RMCFC11 / RMD
+    RCFC11_per_omp = CFC11_ppt_per_omp * 1.0E-12 * RMCFC11 / RMD
     !
     !Config Key  = RCFC12_per
@@ -845,5 +844,5 @@
     !               
     CFC12_ppt_per_omp = CFC12_ppt_omp
-    CALL getin('CFC12_ppt_per',CFC12_ppt_per_omp)
+    CALL getin('CFC12_ppt_per', CFC12_ppt_per_omp)
     !conversion en rapport de mélange massique
     RCFC12_per_omp = CFC12_ppt_per_omp * 1.0E-12 * RMCFC12 / RMD
@@ -859,5 +858,5 @@
     !Config         Peut etre util pour accelerer le code !
     iflag_cycle_diurne_omp = 1
-    CALL getin('iflag_cycle_diurne',iflag_cycle_diurne_omp)
+    CALL getin('iflag_cycle_diurne', iflag_cycle_diurne_omp)
 
     !Config  Key  = soil_model
@@ -868,5 +867,5 @@
     !Config         plus de choix ! Ou meme une liste d'options !
     soil_model_omp = .TRUE.
-    CALL getin('soil_model',soil_model_omp)
+    CALL getin('soil_model', soil_model_omp)
 
     !Config  Key  = new_oliq
@@ -876,5 +875,5 @@
     !Config         nouvelle parametrisation de l'eau liquide !
     new_oliq_omp = .TRUE.
-    CALL getin('new_oliq',new_oliq_omp)
+    CALL getin('new_oliq', new_oliq_omp)
 
     !Config  Key  = ok_orodr
@@ -884,5 +883,5 @@
     !Config         
     ok_orodr_omp = .TRUE.
-    CALL getin('ok_orodr',ok_orodr_omp)
+    CALL getin('ok_orodr', ok_orodr_omp)
 
     !Config  Key  =  ok_orolf
@@ -931,5 +930,5 @@
     !Config         idee, pourquoi ne pas mettre toujours a y ???
     ok_limitvrai_omp = .FALSE.
-    CALL getin('ok_limitvrai',ok_limitvrai_omp)
+    CALL getin('ok_limitvrai', ok_limitvrai_omp)
 
     !Config  Key  = nbapp_rad
@@ -939,5 +938,5 @@
     !Config         par jour.
     nbapp_rad_omp = 12
-    CALL getin('nbapp_rad',nbapp_rad_omp)
+    CALL getin('nbapp_rad', nbapp_rad_omp)
 
     !rajout Olivier Torres
@@ -950,5 +949,5 @@
     !Config         3 -> CORE-"mixte" (avec z_0 et C_T^N donnees par Smith 88)
     choix_bulk_omp = 0
-    CALL getin('choix_bulk',choix_bulk_omp)
+    CALL getin('choix_bulk', choix_bulk_omp)
 
     !Config  Key  = nit_bulk
@@ -956,5 +955,5 @@
     !Config  Def  = 5
     nit_bulk_omp = 1
-    CALL getin('nit_bulk',nit_bulk_omp)
+    CALL getin('nit_bulk', nit_bulk_omp)
 
     !Config  Key  = kz0
@@ -965,5 +964,5 @@
     !Config         2 -> Direct computation using the stability functions
     kz0_omp = 0
-    CALL getin('kz0',kz0_omp)
+    CALL getin('kz0', kz0_omp)
 
 
@@ -976,5 +975,5 @@
     !Config         3 pour CCM(NCAR)  
     iflag_con_omp = 2
-    CALL getin('iflag_con',iflag_con_omp)
+    CALL getin('iflag_con', iflag_con_omp)
 
     !Config  Key  = nbapp_cv
@@ -984,5 +983,5 @@
     !Config         par jour. Si =0, appel a chaque pas de temps physique.
     nbapp_cv_omp = 0
-    CALL getin('nbapp_cv',nbapp_cv_omp)
+    CALL getin('nbapp_cv', nbapp_cv_omp)
 
     !Config  Key  = nbapp_wk
@@ -992,5 +991,5 @@
     !Config         par jour. Si =0, appel a chaque pas de temps physique.
     nbapp_wk_omp = 0
-    CALL getin('nbapp_wk',nbapp_wk_omp)
+    CALL getin('nbapp_wk', nbapp_wk_omp)
 
     !Config  Key  = iflag_ener_conserv
@@ -1001,5 +1000,5 @@
     !Config         1  conservation kinetic and enthalpy
     iflag_ener_conserv_omp = -1
-    CALL getin('iflag_ener_conserv',iflag_ener_conserv_omp)
+    CALL getin('iflag_ener_conserv', iflag_ener_conserv_omp)
 
     !Config  Key  = ok_conserv_q
@@ -1010,5 +1009,5 @@
     !Config         n -> conformite avec versions anterieures au 1/4/2014
     ok_conserv_q_omp = .FALSE.
-    CALL getin('ok_conserv_q',ok_conserv_q_omp)
+    CALL getin('ok_conserv_q', ok_conserv_q_omp)
 
     !
@@ -1052,6 +1051,6 @@
     CALL getin('epmax', epmax_omp)
 
-    coef_epmax_cape_omp = 0.0   
-    CALL getin('coef_epmax_cape', coef_epmax_cape_omp)        
+    coef_epmax_cape_omp = 0.0
+    CALL getin('coef_epmax_cape', coef_epmax_cape_omp)
     !
     !Config Key  = ok_adj_ema
@@ -1061,5 +1060,5 @@
     !
     ok_adj_ema_omp = .FALSE.
-    CALL getin('ok_adj_ema',ok_adj_ema_omp)
+    CALL getin('ok_adj_ema', ok_adj_ema_omp)
     !
     !Config Key  = iflag_clw
@@ -1069,6 +1068,6 @@
     !
     iflag_clw_omp = 0
-    CALL getin('iflag_clw',iflag_clw_omp)
-    
+    CALL getin('iflag_clw', iflag_clw_omp)
+
 
     !Config Key  = iflag_ratqs
@@ -1078,5 +1077,5 @@
     !
     iflag_ratqs_omp = 1
-    CALL getin('iflag_ratqs',iflag_ratqs_omp)
+    CALL getin('iflag_ratqs', iflag_ratqs_omp)
 
     !
@@ -1087,5 +1086,5 @@
     !
     iflag_radia_omp = 1
-    CALL getin('iflag_radia',iflag_radia_omp)
+    CALL getin('iflag_radia', iflag_radia_omp)
 
     !
@@ -1096,5 +1095,5 @@
     !
     iflag_rrtm_omp = 0
-    CALL getin('iflag_rrtm',iflag_rrtm_omp)
+    CALL getin('iflag_rrtm', iflag_rrtm_omp)
 
     !
@@ -1105,11 +1104,11 @@
     !
     NSW_omp = 2
-    CALL getin('NSW',NSW_omp)
+    CALL getin('NSW', NSW_omp)
     !albedo SB >>>
     iflag_albedo_omp = 0
-    CALL getin('iflag_albedo',iflag_albedo_omp)
-
-    ok_chlorophyll_omp=.FALSE.
-    CALL getin('ok_chlorophyll',ok_chlorophyll_omp)
+    CALL getin('iflag_albedo', iflag_albedo_omp)
+
+    ok_chlorophyll_omp = .FALSE.
+    CALL getin('ok_chlorophyll', ok_chlorophyll_omp)
     !albedo SB <<<
     !
@@ -1123,7 +1122,7 @@
     ok_suntime_rrtm_omp = .FALSE.
     IF (iflag_rrtm_omp==1) THEN
-      CALL getin('ok_suntime_rrtm',ok_suntime_rrtm_omp)
+      CALL getin('ok_suntime_rrtm', ok_suntime_rrtm_omp)
     ENDIF
-    
+
     !Config Key  = flag_aerosol_strat
     !Config Desc = use stratospheric aerosols 0, 1, 2
@@ -1136,5 +1135,5 @@
     !
     flag_aerosol_strat_omp = 0
-    CALL getin('flag_aerosol_strat',flag_aerosol_strat_omp)
+    CALL getin('flag_aerosol_strat', flag_aerosol_strat_omp)
 
     !Config Key  = flag_aer_feedback
@@ -1145,7 +1144,7 @@
     !Config Help = Used in physiq.F
     !
-    flag_aer_feedback_omp = .TRUE. 
+    flag_aer_feedback_omp = .TRUE.
     IF (iflag_rrtm_omp==1) THEN
-       CALL getin('flag_aer_feedback',flag_aer_feedback_omp)
+      CALL getin('flag_aer_feedback', flag_aer_feedback_omp)
     ENDIF
 
@@ -1159,8 +1158,8 @@
     ! pour assurer une retrocompatiblite.
     ! A abandonner un jour
-    CALL getin('iflag_cldcon',iflag_cld_th_omp)
-    CALL getin('iflag_cld_th',iflag_cld_th_omp)
-    iflag_cld_cv_omp = 0 
-    CALL getin('iflag_cld_cv',iflag_cld_cv_omp)
+    CALL getin('iflag_cldcon', iflag_cld_th_omp)
+    CALL getin('iflag_cld_th', iflag_cld_th_omp)
+    iflag_cld_cv_omp = 0
+    CALL getin('iflag_cld_cv', iflag_cld_cv_omp)
 
     !
@@ -1171,5 +1170,5 @@
     !
     tau_cld_cv_omp = 10.
-    CALL getin('tau_cld_cv',tau_cld_cv_omp)
+    CALL getin('tau_cld_cv', tau_cld_cv_omp)
 
     !
@@ -1180,5 +1179,5 @@
     !
     coefw_cld_cv_omp = 0.1
-    CALL getin('coefw_cld_cv',coefw_cld_cv_omp)
+    CALL getin('coefw_cld_cv', coefw_cld_cv_omp)
 
 
@@ -1192,5 +1191,5 @@
     !
     fact_cldcon_omp = 0.375
-    CALL getin('fact_cldcon',fact_cldcon_omp)
+    CALL getin('fact_cldcon', fact_cldcon_omp)
 
     !
@@ -1201,5 +1200,5 @@
     !
     facttemps_omp = 1.e-4
-    CALL getin('facttemps',facttemps_omp)
+    CALL getin('facttemps', facttemps_omp)
 
     !
@@ -1210,5 +1209,5 @@
     !
     ok_newmicro_omp = .TRUE.
-    CALL getin('ok_newmicro',ok_newmicro_omp)
+    CALL getin('ok_newmicro', ok_newmicro_omp)
     !
     !Config Key  = ratqsbas
@@ -1218,5 +1217,5 @@
     !
     ratqsbas_omp = 0.01
-    CALL getin('ratqsbas',ratqsbas_omp)
+    CALL getin('ratqsbas', ratqsbas_omp)
     !
     !Config Key  = ratqshaut
@@ -1226,5 +1225,5 @@
     !
     ratqshaut_omp = 0.3
-    CALL getin('ratqshaut',ratqshaut_omp)
+    CALL getin('ratqshaut', ratqshaut_omp)
 
     !Config Key  = tau_ratqs
@@ -1234,5 +1233,5 @@
     !
     tau_ratqs_omp = 1800.
-    CALL getin('tau_ratqs',tau_ratqs_omp)
+    CALL getin('tau_ratqs', tau_ratqs_omp)
 
     !
@@ -1246,5 +1245,5 @@
     !
     solarlong0_omp = -999.999
-    CALL getin('solarlong0',solarlong0_omp)
+    CALL getin('solarlong0', solarlong0_omp)
     !
     !-----------------------------------------------------------------------
@@ -1253,9 +1252,9 @@
     ! Default value -1 to activate the full computation
     qsol0_omp = -1.
-    CALL getin('qsol0',qsol0_omp)
+    CALL getin('qsol0', qsol0_omp)
     evap0_omp = -1.
-    CALL getin('evap0',evap0_omp)
+    CALL getin('evap0', evap0_omp)
     albsno0_omp = -1.
-    CALL getin('albsno0',albsno0_omp)
+    CALL getin('albsno0', albsno0_omp)
     !
     !-----------------------------------------------------------------------
@@ -1267,5 +1266,5 @@
     !
     iflag_sic_omp = 0
-    CALL getin('iflag_sic',iflag_sic_omp)
+    CALL getin('iflag_sic', iflag_sic_omp)
     !
     !Config Key  = iflag_inertie
@@ -1275,5 +1274,5 @@
     !
     iflag_inertie_omp = 0
-    CALL getin('iflag_inertie',iflag_inertie_omp)
+    CALL getin('iflag_inertie', iflag_inertie_omp)
     !
     !Config Key  = inertie_sic
@@ -1283,5 +1282,5 @@
     !
     inertie_sic_omp = 2000.
-    CALL getin('inertie_sic',inertie_sic_omp)
+    CALL getin('inertie_sic', inertie_sic_omp)
     !
     !Config Key  = inertie_lic
@@ -1291,5 +1290,5 @@
     !
     inertie_lic_omp = 2000.
-    CALL getin('inertie_lic',inertie_lic_omp)
+    CALL getin('inertie_lic', inertie_lic_omp)
     !
     !Config Key  = inertie_sno
@@ -1299,5 +1298,5 @@
     !
     inertie_sno_omp = 2000.
-    CALL getin('inertie_sno',inertie_sno_omp)
+    CALL getin('inertie_sno', inertie_sno_omp)
     !
     !Config Key  = inertie_sol
@@ -1307,5 +1306,5 @@
     !
     inertie_sol_omp = 2000.
-    CALL getin('inertie_sol',inertie_sol_omp)
+    CALL getin('inertie_sol', inertie_sol_omp)
 
     !
@@ -1316,5 +1315,5 @@
     !
     rad_froid_omp = 35.0
-    CALL getin('rad_froid',rad_froid_omp)
+    CALL getin('rad_froid', rad_froid_omp)
 
     !
@@ -1325,5 +1324,5 @@
     !
     rad_chau1_omp = 13.0
-    CALL getin('rad_chau1',rad_chau1_omp)
+    CALL getin('rad_chau1', rad_chau1_omp)
 
     !
@@ -1334,5 +1333,5 @@
     !
     rad_chau2_omp = 9.0
-    CALL getin('rad_chau2',rad_chau2_omp)
+    CALL getin('rad_chau2', rad_chau2_omp)
 
 
@@ -1344,5 +1343,5 @@
     !
     iflag_ice_thermo_omp = 0
-    CALL getin('iflag_ice_thermo',iflag_ice_thermo_omp)
+    CALL getin('iflag_ice_thermo', iflag_ice_thermo_omp)
 
     !
@@ -1353,5 +1352,5 @@
     !
     ok_ice_sursat_omp = .FALSE.
-    CALL getin('ok_ice_sursat',ok_ice_sursat_omp)
+    CALL getin('ok_ice_sursat', ok_ice_sursat_omp)
 
     !Config Key  = ok_plane_h2o
@@ -1361,5 +1360,5 @@
     !
     ok_plane_h2o_omp = .FALSE.
-    CALL getin('ok_plane_h2o',ok_plane_h2o_omp)
+    CALL getin('ok_plane_h2o', ok_plane_h2o_omp)
 
     !Config Key  = ok_plane_contrail
@@ -1369,5 +1368,5 @@
     !
     ok_plane_contrail_omp = .FALSE.
-    CALL getin('ok_plane_contrail',ok_plane_contrail_omp)
+    CALL getin('ok_plane_contrail', ok_plane_contrail_omp)
 
     !
@@ -1378,5 +1377,5 @@
     !
     top_height_omp = 3
-    CALL getin('top_height',top_height_omp)
+    CALL getin('top_height', top_height_omp)
 
     !
@@ -1387,5 +1386,5 @@
     !
     overlap_omp = 3
-    CALL getin('overlap',overlap_omp)
+    CALL getin('overlap', overlap_omp)
 
     !
@@ -1396,5 +1395,5 @@
     !
     cdmmax_omp = 1.3E-3
-    CALL getin('cdmmax',cdmmax_omp)
+    CALL getin('cdmmax', cdmmax_omp)
 
     !
@@ -1405,5 +1404,5 @@
     !
     cdhmax_omp = 1.1E-3
-    CALL getin('cdhmax',cdhmax_omp)
+    CALL getin('cdhmax', cdhmax_omp)
 
     !261103
@@ -1415,5 +1414,5 @@
     !
     ksta_omp = 1.0e-10
-    CALL getin('ksta',ksta_omp)
+    CALL getin('ksta', ksta_omp)
 
     !
@@ -1424,5 +1423,5 @@
     !
     ksta_ter_omp = 1.0e-10
-    CALL getin('ksta_ter',ksta_ter_omp)
+    CALL getin('ksta_ter', ksta_ter_omp)
 
     !Config Key  = f_ri_cd_min
@@ -1432,5 +1431,5 @@
     !
     f_ri_cd_min_omp = 0.1
-    CALL getin('f_ri_cd_min',f_ri_cd_min_omp)
+    CALL getin('f_ri_cd_min', f_ri_cd_min_omp)
 
     !
@@ -1441,5 +1440,5 @@
     !
     ok_kzmin_omp = .TRUE.
-    CALL getin('ok_kzmin',ok_kzmin_omp)
+    CALL getin('ok_kzmin', ok_kzmin_omp)
 
     !
@@ -1450,5 +1449,5 @@
     !
     fmagic_omp = 1.
-    CALL getin('fmagic',fmagic_omp)
+    CALL getin('fmagic', fmagic_omp)
 
     !
@@ -1459,5 +1458,5 @@
     !
     pmagic_omp = 0.
-    CALL getin('pmagic',pmagic_omp)
+    CALL getin('pmagic', pmagic_omp)
 
 
@@ -1487,10 +1486,10 @@
     !
     iflag_pbl_omp = 1
-    CALL getin('iflag_pbl',iflag_pbl_omp)
+    CALL getin('iflag_pbl', iflag_pbl_omp)
 
     iflag_physiq_omp = 0 ! 0: std, 1: with physiqex output, 2: for physiqex
-    CALL getin('iflag_physiq',iflag_physiq_omp)
-
-!FC
+    CALL getin('iflag_physiq', iflag_physiq_omp)
+
+    !FC
     !Config Key  = ifl_pbltree
     !Config Desc = drag from trees 0 no activated
@@ -1499,6 +1498,6 @@
     !
     ifl_pbltree_omp = 0
-    CALL getin('ifl_pbltree',ifl_pbltree_omp)
-!FC
+    CALL getin('ifl_pbltree', ifl_pbltree_omp)
+    !FC
     !Config Key  = Cd_frein
     !Config Desc = drag from trees 
@@ -1507,5 +1506,5 @@
     !
     Cd_frein_omp = 7.5E-02
-    CALL getin('Cd_frein',Cd_frein_omp)
+    CALL getin('Cd_frein', Cd_frein_omp)
 
     !
@@ -1516,5 +1515,5 @@
     !
     iflag_pbl_split_omp = 0
-    call getin('iflag_pbl_split',iflag_pbl_split_omp)
+    call getin('iflag_pbl_split', iflag_pbl_split_omp)
     !
     !Config Key  = iflag_order2_sollw
@@ -1524,5 +1523,5 @@
     !
     iflag_order2_sollw_omp = 0
-    CALL getin('iflag_order2_sollw',iflag_order2_sollw_omp)
+    CALL getin('iflag_order2_sollw', iflag_order2_sollw_omp)
     !
     !Config Key  = iflag_thermals
@@ -1532,5 +1531,5 @@
     !
     iflag_thermals_omp = 0
-    CALL getin('iflag_thermals',iflag_thermals_omp)
+    CALL getin('iflag_thermals', iflag_thermals_omp)
     !
     !Config Key  = nsplit_thermals
@@ -1540,5 +1539,5 @@
     !
     nsplit_thermals_omp = 1
-    CALL getin('nsplit_thermals',nsplit_thermals_omp)
+    CALL getin('nsplit_thermals', nsplit_thermals_omp)
     !
     !Config Key  = nsplit_thermals
@@ -1547,5 +1546,5 @@
     !Config Help =
     alp_bl_k_omp = 1.
-    CALL getin('alp_bl_k',alp_bl_k_omp)
+    CALL getin('alp_bl_k', alp_bl_k_omp)
 
     ! nrlmd le 10/04/2012
@@ -1557,5 +1556,5 @@
     !
     iflag_trig_bl_omp = 0
-    CALL getin('iflag_trig_bl',iflag_trig_bl_omp)
+    CALL getin('iflag_trig_bl', iflag_trig_bl_omp)
 
     !Config Key  = iflag_strig
@@ -1565,5 +1564,5 @@
     !
     iflag_strig_omp = 0
-    CALL getin('iflag_strig',iflag_strig_omp)
+    CALL getin('iflag_strig', iflag_strig_omp)
 
     !Config Key  = s_trig_bl
@@ -1573,5 +1572,5 @@
     !
     s_trig_omp = 2e7
-    CALL getin('s_trig',s_trig_omp)
+    CALL getin('s_trig', s_trig_omp)
 
     !Config Key  = h_trig
@@ -1581,5 +1580,5 @@
     !
     h_trig_omp = 6000.
-    CALL getin('h_trig',h_trig_omp)
+    CALL getin('h_trig', h_trig_omp)
 
     !Config Key  = tau_trig_shallow
@@ -1589,5 +1588,5 @@
     !
     tau_trig_shallow_omp = 600
-    CALL getin('tau_trig_shallow',tau_trig_shallow_omp)
+    CALL getin('tau_trig_shallow', tau_trig_shallow_omp)
 
     !Config Key  = tau_trig_deep
@@ -1597,5 +1596,5 @@
     !
     tau_trig_deep_omp = 1800
-    CALL getin('tau_trig_deep',tau_trig_deep_omp)
+    CALL getin('tau_trig_deep', tau_trig_deep_omp)
 
     !Config Key  = iflag_clos_bl
@@ -1605,5 +1604,5 @@
     !
     iflag_clos_bl_omp = 0
-    CALL getin('iflag_clos_bl',iflag_clos_bl_omp)
+    CALL getin('iflag_clos_bl', iflag_clos_bl_omp)
 
     ! fin nrlmd le 10/04/2012
@@ -1616,5 +1615,5 @@
     !
     tau_thermals_omp = 0.
-    CALL getin('tau_thermals',tau_thermals_omp)
+    CALL getin('tau_thermals', tau_thermals_omp)
 
     !
@@ -1625,5 +1624,5 @@
     !
     iflag_coupl_omp = 0
-    CALL getin('iflag_coupl',iflag_coupl_omp)
+    CALL getin('iflag_coupl', iflag_coupl_omp)
 
     !
@@ -1634,5 +1633,5 @@
     !
     iflag_clos_omp = 1
-    CALL getin('iflag_clos',iflag_clos_omp)
+    CALL getin('iflag_clos', iflag_clos_omp)
     !
     !Config Key  = coef_clos_ls
@@ -1642,5 +1641,5 @@
     !
     coef_clos_ls_omp = 0.
-    CALL getin('coef_clos_ls',coef_clos_ls_omp)
+    CALL getin('coef_clos_ls', coef_clos_ls_omp)
 
     !
@@ -1651,5 +1650,5 @@
     !
     iflag_cvl_sigd_omp = 0
-    CALL getin('iflag_cvl_sigd',iflag_cvl_sigd_omp)
+    CALL getin('iflag_cvl_sigd', iflag_cvl_sigd_omp)
 
     !Config Key  = iflag_wake
@@ -1659,5 +1658,5 @@
     !
     iflag_wake_omp = 0
-    CALL getin('iflag_wake',iflag_wake_omp)
+    CALL getin('iflag_wake', iflag_wake_omp)
 
     !Config Key  = alp_offset
@@ -1667,5 +1666,5 @@
     !
     alp_offset_omp = 0.
-    CALL getin('alp_offset',alp_offset_omp)
+    CALL getin('alp_offset', alp_offset_omp)
 
     !
@@ -1676,5 +1675,5 @@
     !
     lev_histhf_omp = 1
-    CALL getin('lev_histhf',lev_histhf_omp)
+    CALL getin('lev_histhf', lev_histhf_omp)
 
     !
@@ -1685,5 +1684,5 @@
     !
     lev_histday_omp = 1
-    CALL getin('lev_histday',lev_histday_omp)
+    CALL getin('lev_histday', lev_histday_omp)
 
     !
@@ -1694,5 +1693,5 @@
     !
     lev_histmth_omp = 2
-    CALL getin('lev_histmth',lev_histmth_omp)
+    CALL getin('lev_histmth', lev_histmth_omp)
     !
     !Config Key  = lev_histins
@@ -1702,5 +1701,5 @@
     !
     lev_histins_omp = 1
-    CALL getin('lev_histins',lev_histins_omp)
+    CALL getin('lev_histins', lev_histins_omp)
     !
     !Config Key  = lev_histLES
@@ -1710,5 +1709,5 @@
     !
     lev_histLES_omp = 1
-    CALL getin('lev_histLES',lev_histLES_omp)
+    CALL getin('lev_histLES', lev_histLES_omp)
     ! 
     !Config Key  = lev_histdayNMC
@@ -1718,5 +1717,5 @@
     !
     lev_histdayNMC_omp = 8
-    CALL getin('lev_histdayNMC',lev_histdayNMC_omp)
+    CALL getin('lev_histdayNMC', lev_histdayNMC_omp)
     !
     !Config Key  = levout_histNMC
@@ -1728,5 +1727,5 @@
     levout_histNMC_omp(2) = 5
     levout_histNMC_omp(3) = 5
-    CALL getin('levout_histNMC',levout_histNMC_omp)
+    CALL getin('levout_histNMC', levout_histNMC_omp)
     !
     !histNMC BEG
@@ -1741,5 +1740,5 @@
     ok_histNMC_omp(2) = .FALSE.
     ok_histNMC_omp(3) = .FALSE.
-    CALL getin('ok_histNMC',ok_histNMC_omp)
+    CALL getin('ok_histNMC', ok_histNMC_omp)
     !
     !Config Key  = freq_outNMC
@@ -1752,6 +1751,6 @@
     freq_outNMC_omp(1) = mth_len
     freq_outNMC_omp(2) = 1.
-    freq_outNMC_omp(3) = 1./4.
-    CALL getin('freq_outNMC',freq_outNMC_omp)
+    freq_outNMC_omp(3) = 1. / 4.
+    CALL getin('freq_outNMC', freq_outNMC_omp)
     !
     !Config Key  = freq_calNMC
@@ -1765,5 +1764,5 @@
     freq_calNMC_omp(2) = phys_tstep
     freq_calNMC_omp(3) = phys_tstep
-    CALL getin('freq_calNMC',freq_calNMC_omp)
+    CALL getin('freq_calNMC', freq_calNMC_omp)
     !
     !Config Key  = type_run
@@ -1773,5 +1772,5 @@
     !
     type_run_omp = 'AMIP'
-    CALL getin('type_run',type_run_omp)
+    CALL getin('type_run', type_run_omp)
 
     !
@@ -1782,5 +1781,5 @@
     !
     ok_cosp_omp = .FALSE.
-    CALL getin('ok_cosp',ok_cosp_omp)
+    CALL getin('ok_cosp', ok_cosp_omp)
 
     !
@@ -1791,5 +1790,5 @@
     !
     ok_airs_omp = .FALSE.
-    CALL getin('ok_airs',ok_airs_omp)
+    CALL getin('ok_airs', ok_airs_omp)
 
     !
@@ -1800,5 +1799,5 @@
     !
     ok_mensuelCOSP_omp = .TRUE.
-    CALL getin('ok_mensuelCOSP',ok_mensuelCOSP_omp)
+    CALL getin('ok_mensuelCOSP', ok_mensuelCOSP_omp)
 
     !
@@ -1809,5 +1808,5 @@
     !
     ok_journeCOSP_omp = .TRUE.
-    CALL getin('ok_journeCOSP',ok_journeCOSP_omp)
+    CALL getin('ok_journeCOSP', ok_journeCOSP_omp)
 
     !
@@ -1818,5 +1817,5 @@
     !
     ok_hfCOSP_omp = .FALSE.
-    CALL getin('ok_hfCOSP',ok_hfCOSP_omp)
+    CALL getin('ok_hfCOSP', ok_hfCOSP_omp)
 
     !
@@ -1830,5 +1829,5 @@
     !
     lonmin_ins_omp = 100.
-    CALL getin('lonmin_ins',lonmin_ins_omp)
+    CALL getin('lonmin_ins', lonmin_ins_omp)
     !
     !Config Key  = lonmax_ins
@@ -1838,5 +1837,5 @@
     !
     lonmax_ins_omp = 130.
-    CALL getin('lonmax_ins',lonmax_ins_omp)
+    CALL getin('lonmax_ins', lonmax_ins_omp)
     !
     !Config Key  = latmin_ins
@@ -1846,5 +1845,5 @@
     !
     latmin_ins_omp = -20.
-    CALL getin('latmin_ins',latmin_ins_omp)
+    CALL getin('latmin_ins', latmin_ins_omp)
     !
     !Config Key  = latmax_ins
@@ -1854,5 +1853,5 @@
     !
     latmax_ins_omp = 20.
-    CALL getin('latmax_ins',latmax_ins_omp)
+    CALL getin('latmax_ins', latmax_ins_omp)
     !
     !Config Key  = ecrit_hf
@@ -1861,6 +1860,6 @@
     !Config Help =
     !
-    ecrit_hf_omp = 1./8.
-    CALL getin('ecrit_hf',ecrit_hf_omp)
+    ecrit_hf_omp = 1. / 8.
+    CALL getin('ecrit_hf', ecrit_hf_omp)
     !
     !Config Key  = ecrit_ins
@@ -1869,6 +1868,6 @@
     !Config Help =
     !
-    ecrit_ins_omp = 1./48.
-    CALL getin('ecrit_ins',ecrit_ins_omp)
+    ecrit_ins_omp = 1. / 48.
+    CALL getin('ecrit_ins', ecrit_ins_omp)
     !
     !Config Key  = ecrit_day
@@ -1878,5 +1877,5 @@
     !
     ecrit_day_omp = 1.0
-    CALL getin('ecrit_day',ecrit_day_omp)
+    CALL getin('ecrit_day', ecrit_day_omp)
     !
     !Config Key  = ecrit_mth
@@ -1886,5 +1885,5 @@
     !
     ecrit_mth_omp = 30.
-    CALL getin('ecrit_mth',ecrit_mth_omp)
+    CALL getin('ecrit_mth', ecrit_mth_omp)
     !
     !Config Key  = ecrit_tra
@@ -1894,5 +1893,5 @@
     !
     ecrit_tra_omp = 0.
-    CALL getin('ecrit_tra',ecrit_tra_omp)
+    CALL getin('ecrit_tra', ecrit_tra_omp)
     !
     !Config Key  = ecrit_reg
@@ -1902,30 +1901,30 @@
     !
     ecrit_reg_omp = 0.25   !4 fois par jour
-    CALL getin('ecrit_reg',ecrit_reg_omp)
-    !
-    !
-    print*,'CONFPHYS OOK avant drag_ter'
+    CALL getin('ecrit_reg', ecrit_reg_omp)
+    !
+    !
+    print*, 'CONFPHYS OOK avant drag_ter'
     !
     ! PARAMETRES CDRAG
     !
     f_cdrag_ter_omp = 0.8
-    CALL getin('f_cdrag_ter',f_cdrag_ter_omp)
+    CALL getin('f_cdrag_ter', f_cdrag_ter_omp)
     !
     f_cdrag_oce_omp = 0.8
-    CALL getin('f_cdrag_oce',f_cdrag_oce_omp)
+    CALL getin('f_cdrag_oce', f_cdrag_oce_omp)
     !
 
     ! Gustiness flags
     f_z0qh_oce_omp = 1.
-    CALL getin('f_z0qh_oce',f_z0qh_oce_omp)
+    CALL getin('f_z0qh_oce', f_z0qh_oce_omp)
     !
     f_qsat_oce_omp = 1.
-    CALL getin('f_qsat_oce',f_qsat_oce_omp)
+    CALL getin('f_qsat_oce', f_qsat_oce_omp)
     !
     f_gust_bl_omp = 0.
-    CALL getin('f_gust_bl',f_gust_bl_omp)
+    CALL getin('f_gust_bl', f_gust_bl_omp)
     !
     f_gust_wk_omp = 0.
-    CALL getin('f_gust_wk',f_gust_wk_omp)
+    CALL getin('f_gust_wk', f_gust_wk_omp)
     !
     !Config Key  = iflag_z0_oce
@@ -1934,25 +1933,24 @@
     !Config Help =
     !
-    iflag_z0_oce_omp=0
-    CALL getin('iflag_z0_oce',iflag_z0_oce_omp)
-    !
-    iflag_gusts_omp=0
-    CALL getin('iflag_gusts',iflag_gusts_omp)
+    iflag_z0_oce_omp = 0
+    CALL getin('iflag_z0_oce', iflag_z0_oce_omp)
+    !
+    iflag_gusts_omp = 0
+    CALL getin('iflag_gusts', iflag_gusts_omp)
     !
     min_wind_speed_omp = 1.
-    CALL getin('min_wind_speed',min_wind_speed_omp)
-
-    z0m_seaice_omp = 0.002 ; CALL getin('z0m_seaice',z0m_seaice_omp)
-    z0h_seaice_omp = 0.002 ; CALL getin('z0h_seaice',z0h_seaice_omp)
-
-
-    z0m_landice_omp = 0.001 ; CALL getin('z0m_landice',z0m_landice_omp)
-    z0h_landice_omp = 0.001 ; CALL getin('z0h_landice',z0h_landice_omp)
+    CALL getin('min_wind_speed', min_wind_speed_omp)
+
+    z0m_seaice_omp = 0.002 ; CALL getin('z0m_seaice', z0m_seaice_omp)
+    z0h_seaice_omp = 0.002 ; CALL getin('z0h_seaice', z0h_seaice_omp)
+
+    z0m_landice_omp = 0.001 ; CALL getin('z0m_landice', z0m_landice_omp)
+    z0h_landice_omp = 0.001 ; CALL getin('z0h_landice', z0h_landice_omp)
 
     f_rugoro_omp = 0.
-    CALL getin('f_rugoro',f_rugoro_omp)
+    CALL getin('f_rugoro', f_rugoro_omp)
 
     z0min_omp = 0.000015
-    CALL getin('z0min',z0min_omp)
+    CALL getin('z0min', z0min_omp)
 
 
@@ -1965,5 +1963,5 @@
     !
     supcrit1_omp = .540
-    CALL getin('supcrit1',supcrit1_omp)
+    CALL getin('supcrit1', supcrit1_omp)
 
     !
@@ -1974,5 +1972,5 @@
     !
     supcrit2_omp = .600
-    CALL getin('supcrit2',supcrit2_omp)
+    CALL getin('supcrit2', supcrit2_omp)
 
     !
@@ -1989,7 +1987,7 @@
     !
     iflag_mix_omp = 1
-    CALL getin('iflag_mix',iflag_mix_omp)
-
-!
+    CALL getin('iflag_mix', iflag_mix_omp)
+
+    !
     ! PARAMETERS FOR THE EROSION OF THE ADIABATIC ASCENTS
     ! iflag_mix_adiab: 0=OLD, 
@@ -2003,5 +2001,5 @@
     !
     iflag_mix_adiab_omp = 0
-    CALL getin('iflag_mix_adiab',iflag_mix_adiab_omp)
+    CALL getin('iflag_mix_adiab', iflag_mix_adiab_omp)
 
     !
@@ -2012,5 +2010,5 @@
     !
     scut_omp = 0.95
-    CALL getin('scut',scut_omp)
+    CALL getin('scut', scut_omp)
 
     !
@@ -2021,5 +2019,5 @@
     !
     qqa1_omp = 1.0
-    CALL getin('qqa1',qqa1_omp)
+    CALL getin('qqa1', qqa1_omp)
 
     !
@@ -2030,5 +2028,5 @@
     !
     qqa2_omp = 0.0
-    CALL getin('qqa2',qqa2_omp)
+    CALL getin('qqa2', qqa2_omp)
 
     !
@@ -2039,5 +2037,5 @@
     !
     gammas_omp = 0.05
-    CALL getin('gammas',gammas_omp)
+    CALL getin('gammas', gammas_omp)
 
     !
@@ -2048,5 +2046,5 @@
     !
     Fmax_omp = 0.65
-    CALL getin('Fmax',Fmax_omp)
+    CALL getin('Fmax', Fmax_omp)
 
     !
@@ -2057,5 +2055,5 @@
     !
     tmax_fonte_cv_omp = 275.15
-    CALL getin('tmax_fonte_cv',tmax_fonte_cv_omp)
+    CALL getin('tmax_fonte_cv', tmax_fonte_cv_omp)
 
     !
@@ -2066,5 +2064,5 @@
     !
     alphas_omp = -5.
-    CALL getin('alphas',alphas_omp)
+    CALL getin('alphas', alphas_omp)
 
     !Config key = ok_strato
@@ -2074,6 +2072,6 @@
     !               Et la sponge layer (Runs Stratospheriques)
 
-    ok_strato_omp=.FALSE.
-    CALL getin('ok_strato',ok_strato_omp)
+    ok_strato_omp = .FALSE.
+    CALL getin('ok_strato', ok_strato_omp)
 
     !Config  key = ok_hines
@@ -2082,6 +2080,6 @@
     !Config  Help = Clefs controlant la parametrization de Hines
 
-    ok_hines_omp=.FALSE.
-    CALL getin('ok_hines',ok_hines_omp)
+    ok_hines_omp = .FALSE.
+    CALL getin('ok_hines', ok_hines_omp)
 
     !  Parametres pour les ondes de gravite
@@ -2092,8 +2090,8 @@
     CALL getin('sso_gkdrag', sso_gkdrag_omp)
 
-    sso_grahil_omp=merge(0.1,1.,ok_strato_omp)
+    sso_grahil_omp = merge(0.1, 1., ok_strato_omp)
     CALL getin('sso_grahil', sso_grahil_omp)
 
-    sso_grcrit_omp =merge(1.,0.01,ok_strato_omp)
+    sso_grcrit_omp = merge(1., 0.01, ok_strato_omp)
     CALL getin('sso_grcrit', sso_grcrit_omp)
 
@@ -2104,5 +2102,5 @@
     CALL getin('sso_gkwake', sso_gkwake_omp)
 
-    sso_gklift_omp = merge(0.25,0.50,ok_strato_omp)
+    sso_gklift_omp = merge(0.25, 0.50, ok_strato_omp)
     CALL getin('sso_gklift', sso_gklift_omp)
 
@@ -2110,9 +2108,9 @@
 
     ok_gwd_rando_omp = .FALSE.
-    IF ( klon_glo == 1 ) THEN
-       print*,'La parametrisation des ondes de gravites non orographiques'
-       print*,'ne fonctionne pas en 1D'
+    IF (klon_glo == 1) THEN
+      print*, 'La parametrisation des ondes de gravites non orographiques'
+      print*, 'ne fonctionne pas en 1D'
     ELSE
-       CALL getin('ok_gwd_rando', ok_gwd_rando_omp)
+      CALL getin('ok_gwd_rando', ok_gwd_rando_omp)
     ENDIF
 
@@ -2136,6 +2134,6 @@
     !               de l'humidite due a oxydation+photolyse du methane strato
 
-    ok_qch4_omp=.FALSE.
-    CALL getin('ok_qch4',ok_qch4_omp)
+    ok_qch4_omp = .FALSE.
+    CALL getin('ok_qch4', ok_qch4_omp)
 
     !Config Key  = OK_LES                                               
@@ -2145,6 +2143,6 @@
     !              LES                                                  
     !                                                                   
-    ok_LES_omp = .FALSE.                                              
-    CALL getin('OK_LES', ok_LES_omp)                                  
+    ok_LES_omp = .FALSE.
+    CALL getin('OK_LES', ok_LES_omp)
 
     !Config Key  = callstats                                               
@@ -2154,6 +2152,6 @@
     !              stats                                                  
     !                                                                   
-    callstats_omp = .FALSE.                                              
-    CALL getin('callstats', callstats_omp)                                  
+    callstats_omp = .FALSE.
+    CALL getin('callstats', callstats_omp)
     !
     !Config Key  = ecrit_LES
@@ -2183,5 +2181,5 @@
     !Config Help = .FALSE. ensure much fewer (no calendar dependency)
     !  and lighter monthly climoz files, inetrpolated in time at gcm run time.
-    
+
     ok_new_lscp_omp = .FALSE.
     CALL getin('ok_new_lscp', ok_new_lscp_omp)
@@ -2192,6 +2190,4 @@
     !Config Help = ...
 
-
-
     ok_icefra_lscp_omp = .FALSE.
     CALL getin('ok_icefra_lscp', ok_icefra_lscp_omp)
@@ -2202,6 +2198,4 @@
     !Config Help = ...
 
-
-
     ok_bs_omp = .FALSE.
     CALL getin('ok_bs', ok_bs_omp)
@@ -2212,5 +2206,4 @@
     !Config Help = ...
 
-
     ok_rad_bs_omp = .FALSE.
     CALL getin('ok_rad_bs', ok_rad_bs_omp)
@@ -2221,5 +2214,5 @@
     !Config Help = ...
 
-    ecrit_LES_omp = 1./8.
+    ecrit_LES_omp = 1. / 8.
     CALL getin('ecrit_LES', ecrit_LES_omp)
     !
@@ -2227,24 +2220,24 @@
     CALL getin('read_climoz', read_climoz)
 
-    carbon_cycle_tr_omp=.FALSE.
-    CALL getin('carbon_cycle_tr',carbon_cycle_tr_omp)
-
-    carbon_cycle_cpl_omp=.FALSE.
-    CALL getin('carbon_cycle_cpl',carbon_cycle_cpl_omp)
-
-    carbon_cycle_rad_omp=.FALSE.
-    CALL getin('carbon_cycle_rad',carbon_cycle_rad_omp)
-
-    read_fco2_ocean_cor_omp=.FALSE.
-    CALL getin('read_fco2_ocean_cor',read_fco2_ocean_cor_omp)
-
-    var_fco2_ocean_cor_omp=0. ! default value
-    CALL getin('var_fco2_ocean_cor',var_fco2_ocean_cor_omp)
-
-    read_fco2_land_cor_omp=.FALSE.
-    CALL getin('read_fco2_land_cor',read_fco2_land_cor_omp)
-
-    var_fco2_land_cor_omp=0. ! default value
-    CALL getin('var_fco2_land_cor',var_fco2_land_cor_omp)
+    carbon_cycle_tr_omp = .FALSE.
+    CALL getin('carbon_cycle_tr', carbon_cycle_tr_omp)
+
+    carbon_cycle_cpl_omp = .FALSE.
+    CALL getin('carbon_cycle_cpl', carbon_cycle_cpl_omp)
+
+    carbon_cycle_rad_omp = .FALSE.
+    CALL getin('carbon_cycle_rad', carbon_cycle_rad_omp)
+
+    read_fco2_ocean_cor_omp = .FALSE.
+    CALL getin('read_fco2_ocean_cor', read_fco2_ocean_cor_omp)
+
+    var_fco2_ocean_cor_omp = 0. ! default value
+    CALL getin('var_fco2_ocean_cor', var_fco2_ocean_cor_omp)
+
+    read_fco2_land_cor_omp = .FALSE.
+    CALL getin('read_fco2_land_cor', read_fco2_land_cor_omp)
+
+    var_fco2_land_cor_omp = 0. ! default value
+    CALL getin('var_fco2_land_cor', var_fco2_land_cor_omp)
 
     ! level_coupling_esm : level of coupling of the biogeochemical fields between LMDZ, ORCHIDEE and NEMO
@@ -2258,10 +2251,9 @@
     ! level_coupling_esm = 3  ! Field exchange between LMDZ and ORCHIDEE models
     !                         ! Field exchange between LMDZ and NEMO models
-    level_coupling_esm_omp=0 ! default value
-    CALL getin('level_coupling_esm',level_coupling_esm_omp)
-
-
-    dms_cycle_cpl_omp=.FALSE.
-    CALL getin('transm_dms_oa',dms_cycle_cpl_omp)
+    level_coupling_esm_omp = 0 ! default value
+    CALL getin('level_coupling_esm', level_coupling_esm_omp)
+
+    dms_cycle_cpl_omp = .FALSE.
+    CALL getin('transm_dms_oa', dms_cycle_cpl_omp)
     !
     !Config Key  = dms_cycle_cpl
@@ -2270,6 +2262,6 @@
     !Config Help = can be activated only if lmdz use inca for the atmospheric chemistry 
 
-    n2o_cycle_cpl_omp=.FALSE.
-    CALL getin('transm_n2o_oa',n2o_cycle_cpl_omp)
+    n2o_cycle_cpl_omp = .FALSE.
+    CALL getin('transm_n2o_oa', n2o_cycle_cpl_omp)
     !
     !Config Key  = n2o_cycle_cpl
@@ -2277,6 +2269,6 @@
     !Config Def  = .FALSE.
     !Config Help = can be activated only if lmdz use inca for the atmospheric chemistry 
-    
-    
+
+
     !$OMP END MASTER
     !$OMP BARRIER
@@ -2314,8 +2306,8 @@
     ok_orodr = ok_orodr_omp
     ok_orolf = ok_orolf_omp
-    zrel_oro_t=zrel_oro_t_omp
-    zstd_orodr_t=zstd_orodr_t_omp
-    zpmm_orodr_t=zpmm_orodr_t_omp
-    zpmm_orolf_t=zpmm_orolf_t_omp
+    zrel_oro_t = zrel_oro_t_omp
+    zstd_orodr_t = zstd_orodr_t_omp
+    zpmm_orodr_t = zpmm_orodr_t_omp
+    zpmm_orolf_t = zpmm_orolf_t_omp
     ok_limitvrai = ok_limitvrai_omp
     nbapp_rad = nbapp_rad_omp
@@ -2340,5 +2332,5 @@
     inertie_sno = inertie_sno_omp
     ok_bs = ok_bs_omp
-    ok_rad_bs=ok_rad_bs_omp
+    ok_rad_bs = ok_rad_bs_omp
     rad_froid = rad_froid_omp
     rad_chau1 = rad_chau1_omp
@@ -2361,7 +2353,7 @@
     iflag_physiq = iflag_physiq_omp
     iflag_pbl_split = iflag_pbl_split_omp
-!FC
+    !FC
     ifl_pbltree = ifl_pbltree_omp
-    Cd_frein    =Cd_frein_omp
+    Cd_frein = Cd_frein_omp
     iflag_order2_sollw = iflag_order2_sollw_omp
     lev_histhf = lev_histhf_omp
@@ -2380,8 +2372,8 @@
     t_coupl = t_coupl_omp
 
-    ok_veget=.TRUE.
-    type_veget=type_veget_omp
+    ok_veget = .TRUE.
+    type_veget = type_veget_omp
     IF (type_veget=='n' .or. type_veget=='bucket' .or. type_veget=='betaclim') THEN
-       ok_veget=.FALSE.
+      ok_veget = .FALSE.
     ENDIF
     ! INLANDSIS
@@ -2391,18 +2383,18 @@
     iflag_temp_inlandsis = iflag_temp_inlandsis_omp
     iflag_albcalc = iflag_albcalc_omp
-    SnoMod=SnoMod_omp
-    BloMod=BloMod_omp
-    ok_outfor=ok_outfor_omp
-    is_ok_slush=is_ok_slush_omp
-    opt_runoff_ac=opt_runoff_ac_omp
-    is_ok_z0h_rn=is_ok_z0h_rn_omp
-    is_ok_density_kotlyakov=is_ok_density_kotlyakov_omp
-    prescribed_z0m_snow=prescribed_z0m_snow_omp
-    correc_alb=correc_alb_omp
-    iflag_z0m_snow=iflag_z0m_snow_omp
-    ok_zsn_ii=ok_zsn_ii_omp
-    discret_xf=discret_xf_omp
-    buf_sph_pol=buf_sph_pol_omp
-    buf_siz_pol=buf_siz_pol_omp
+    SnoMod = SnoMod_omp
+    BloMod = BloMod_omp
+    ok_outfor = ok_outfor_omp
+    is_ok_slush = is_ok_slush_omp
+    opt_runoff_ac = opt_runoff_ac_omp
+    is_ok_z0h_rn = is_ok_z0h_rn_omp
+    is_ok_density_kotlyakov = is_ok_density_kotlyakov_omp
+    prescribed_z0m_snow = prescribed_z0m_snow_omp
+    correc_alb = correc_alb_omp
+    iflag_z0m_snow = iflag_z0m_snow_omp
+    ok_zsn_ii = ok_zsn_ii_omp
+    discret_xf = discret_xf_omp
+    buf_sph_pol = buf_sph_pol_omp
+    buf_siz_pol = buf_siz_pol_omp
     !=================================================
     ok_all_xml = ok_all_xml_omp
@@ -2428,5 +2420,5 @@
     flag_aerosol_strat = flag_aerosol_strat_omp
     flag_aer_feedback = flag_aer_feedback_omp
-    flag_bc_internal_mixture=flag_bc_internal_mixture_omp
+    flag_bc_internal_mixture = flag_bc_internal_mixture_omp
     aer_type = aer_type_omp
     bl95_b0 = bl95_b0_omp
@@ -2475,11 +2467,11 @@
     ok_journeCOSP = ok_journeCOSP_omp
     ok_hfCOSP = ok_hfCOSP_omp
-    seuil_inversion=seuil_inversion_omp
+    seuil_inversion = seuil_inversion_omp
     lonmin_ins = lonmin_ins_omp
     lonmax_ins = lonmax_ins_omp
     latmin_ins = latmin_ins_omp
     latmax_ins = latmax_ins_omp
-    ecrit_hf   = ecrit_hf_omp
-    ecrit_ins   = ecrit_ins_omp
+    ecrit_hf = ecrit_hf_omp
+    ecrit_ins = ecrit_ins_omp
     ecrit_day = ecrit_day_omp
     ecrit_mth = ecrit_mth_omp
@@ -2491,23 +2483,23 @@
     ok_lic_melt = ok_lic_melt_omp
     ok_lic_cond = ok_lic_cond_omp
-    f_cdrag_ter=f_cdrag_ter_omp
-    f_cdrag_oce=f_cdrag_oce_omp
-
-    f_gust_wk=f_gust_wk_omp
-    f_gust_bl=f_gust_bl_omp
-    f_qsat_oce=f_qsat_oce_omp
-    f_z0qh_oce=f_z0qh_oce_omp
-    min_wind_speed=min_wind_speed_omp
-    iflag_gusts=iflag_gusts_omp
-    iflag_z0_oce=iflag_z0_oce_omp
-
-    z0m_seaice=z0m_seaice_omp
-    z0h_seaice=z0h_seaice_omp
-    z0m_landice=z0m_landice_omp
-    z0h_landice=z0h_landice_omp
-
-    f_rugoro=f_rugoro_omp
-
-    z0min=z0min_omp
+    f_cdrag_ter = f_cdrag_ter_omp
+    f_cdrag_oce = f_cdrag_oce_omp
+
+    f_gust_wk = f_gust_wk_omp
+    f_gust_bl = f_gust_bl_omp
+    f_qsat_oce = f_qsat_oce_omp
+    f_z0qh_oce = f_z0qh_oce_omp
+    min_wind_speed = min_wind_speed_omp
+    iflag_gusts = iflag_gusts_omp
+    iflag_z0_oce = iflag_z0_oce_omp
+
+    z0m_seaice = z0m_seaice_omp
+    z0h_seaice = z0h_seaice_omp
+    z0m_landice = z0m_landice_omp
+    z0h_landice = z0h_landice_omp
+
+    f_rugoro = f_rugoro_omp
+
+    z0min = z0min_omp
     supcrit1 = supcrit1_omp
     supcrit2 = supcrit2_omp
@@ -2522,10 +2514,10 @@
     alphas = alphas_omp
 
-    gkdrag=sso_gkdrag_omp
-    grahilo=sso_grahil_omp
-    grcrit=sso_grcrit_omp
-    gfrcrit=sso_gfrcri_omp
-    gkwake=sso_gkwake_omp 
-    gklift=sso_gklift_omp 
+    gkdrag = sso_gkdrag_omp
+    grahilo = sso_grahil_omp
+    grcrit = sso_grcrit_omp
+    gfrcrit = sso_gfrcri_omp
+    gkwake = sso_gkwake_omp
+    gklift = sso_gklift_omp
 
     ok_strato = ok_strato_omp
@@ -2547,5 +2539,5 @@
     level_coupling_esm = level_coupling_esm_omp
     ok_new_lscp = ok_new_lscp_omp
-    ok_icefra_lscp=ok_icefra_lscp_omp
+    ok_icefra_lscp = ok_icefra_lscp_omp
     read_fco2_ocean_cor = read_fco2_ocean_cor_omp
     var_fco2_ocean_cor = var_fco2_ocean_cor_omp
@@ -2555,20 +2547,20 @@
     n2o_cycle_cpl = n2o_cycle_cpl_omp
     !rajout Olivier Torres
-    kz0=kz0_omp
+    kz0 = kz0_omp
     choix_bulk = choix_bulk_omp
     nit_bulk = nit_bulk_omp
 
     ! Test of coherence between type_ocean and version_ocean
-    IF (type_ocean=='couple' .AND. (version_ocean/='opa8' .AND. version_ocean/='nemo') ) THEN
-       WRITE(lunout,*)' ERROR version_ocean=',version_ocean,' not valid in coupled configuration'
-       CALL abort_physic('conf_phys','version_ocean not valid',1)
+    IF (type_ocean=='couple' .AND. (version_ocean/='opa8' .AND. version_ocean/='nemo')) THEN
+      WRITE(lunout, *)' ERROR version_ocean=', version_ocean, ' not valid in coupled configuration'
+      CALL abort_physic('conf_phys', 'version_ocean not valid', 1)
     ENDIF
 
     IF (type_ocean=='slab' .AND. version_ocean=='xxxxxx') THEN
-       version_ocean='sicOBS'
+      version_ocean = 'sicOBS'
     ELSE IF (type_ocean=='slab' .AND. version_ocean/='sicOBS' &
-         .AND. version_ocean/='sicINT' .AND. version_ocean/='sicNO') THEN
-       WRITE(lunout,*)' ERROR version_ocean=',version_ocean,' not valid with slab ocean'
-       CALL abort_physic('conf_phys','version_ocean not valid',1)
+            .AND. version_ocean/='sicINT' .AND. version_ocean/='sicNO') THEN
+      WRITE(lunout, *)' ERROR version_ocean=', version_ocean, ' not valid with slab ocean'
+      CALL abort_physic('conf_phys', 'version_ocean not valid', 1)
     ENDIF
 
@@ -2576,344 +2568,344 @@
     IF (iflag_rrtm == 0) THEN
       IF (NSW/=2) THEN
-        WRITE(lunout,*) ' ERROR iflag_rrtm=0 and NSW<>2 not possible'
-        CALL abort_physic('conf_phys','choice NSW not valid',1)
+        WRITE(lunout, *) ' ERROR iflag_rrtm=0 and NSW<>2 not possible'
+        CALL abort_physic('conf_phys', 'choice NSW not valid', 1)
       ENDIF
     ELSE IF (iflag_rrtm == 1) THEN
       IF (NSW/=2.AND.NSW/=4.AND.NSW/=6) THEN
-        WRITE(lunout,*) ' ERROR iflag_rrtm=1 and NSW<>2,4,6 not possible'
-        CALL abort_physic('conf_phys','choice NSW not valid',1)
+        WRITE(lunout, *) ' ERROR iflag_rrtm=1 and NSW<>2,4,6 not possible'
+        CALL abort_physic('conf_phys', 'choice NSW not valid', 1)
       ENDIF
-   ELSE IF (iflag_rrtm == 2) THEN
+    ELSE IF (iflag_rrtm == 2) THEN
       IF (NSW/=2.AND.NSW/=4.AND.NSW/=6) THEN
-        WRITE(lunout,*) ' ERROR iflag_rrtm=1 and NSW<>2,4,6 not possible'
-        CALL abort_physic('conf_phys','choice NSW not valid',1)
+        WRITE(lunout, *) ' ERROR iflag_rrtm=1 and NSW<>2,4,6 not possible'
+        CALL abort_physic('conf_phys', 'choice NSW not valid', 1)
       ENDIF
-    ELSE 
-       WRITE(lunout,*) ' ERROR iflag_rrtm<>0,1'
-       CALL abort_physic('conf_phys','choice iflag_rrtm not valid',1)
+    ELSE
+      WRITE(lunout, *) ' ERROR iflag_rrtm<>0,1'
+      CALL abort_physic('conf_phys', 'choice iflag_rrtm not valid', 1)
     ENDIF
     !--here we test that solaire has not been changed if ok_suntime_rrtm is activated
-!    IF (ok_suntime_rrtm.AND.ABS(solaire-solaire_omp_init).GT.1.E-7) THEN 
-!       WRITE(lunout,*) ' ERROR ok_suntime_rrtm=y and solaire is provided in def file'
-!       CALL abort_physic('conf_phys','ok_suntime_rrtm=y and solaire is provided',1)
-!    ENDIF
-#ifdef CPP_StratAer
-    IF (iflag_rrtm .NE. 1) THEN 
-       WRITE(lunout,*) ' ERROR iflag_rrtm<>1 but StratAer activated'
-       CALL abort_physic('conf_phys','iflag_rrtm not valid for StratAer',1)
-    ENDIF
-    IF (NSW .NE. 6) THEN 
-       WRITE(lunout,*) ' ERROR NSW<>6 but StratAer activated'
-       CALL abort_physic('conf_phys','NSW not valid for StratAer',1)
-    ENDIF
-#endif
+    !    IF (ok_suntime_rrtm.AND.ABS(solaire-solaire_omp_init).GT.1.E-7) THEN
+    !       WRITE(lunout,*) ' ERROR ok_suntime_rrtm=y and solaire is provided in def file'
+    !       CALL abort_physic('conf_phys','ok_suntime_rrtm=y and solaire is provided',1)
+    !    ENDIF
+    IF (CPPKEY_STRATAER) THEN
+      IF (iflag_rrtm /= 1) THEN
+        WRITE(lunout, *) ' ERROR iflag_rrtm<>1 but StratAer activated'
+        CALL abort_physic('conf_phys', 'iflag_rrtm not valid for StratAer', 1)
+      ENDIF
+      IF (NSW /= 6) THEN
+        WRITE(lunout, *) ' ERROR NSW<>6 but StratAer activated'
+        CALL abort_physic('conf_phys', 'NSW not valid for StratAer', 1)
+      ENDIF
+    END IF
 
     !--test on ocean surface albedo
     IF (iflag_albedo<0.OR.iflag_albedo>2) THEN
-       WRITE(lunout,*) ' ERROR iflag_albedo<>0,1'
-       CALL abort_physic('conf_phys','choice iflag_albedo not valid',1)
+      WRITE(lunout, *) ' ERROR iflag_albedo<>0,1'
+      CALL abort_physic('conf_phys', 'choice iflag_albedo not valid', 1)
     ENDIF
 
     ! Flag_aerosol cannot be set to zero if aerosol direct effect (ade) or aerosol indirect effect (aie) are activated
-    IF (ok_ade .OR. ok_aie) THEN 
-       IF ( flag_aerosol == 0 ) THEN
-          CALL abort_physic('conf_phys','flag_aerosol=0 not compatible avec ok_ade ou ok_aie=.TRUE.',1)
-       ENDIF
+    IF (ok_ade .OR. ok_aie) THEN
+      IF (flag_aerosol == 0) THEN
+        CALL abort_physic('conf_phys', 'flag_aerosol=0 not compatible avec ok_ade ou ok_aie=.TRUE.', 1)
+      ENDIF
     ENDIF
 
     ! Flag_aerosol cannot be set to zero if we are in coupled mode for aerosol
-    IF (aerosol_couple .AND. flag_aerosol == 0 ) THEN
-       CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if aerosol_couple=y ', 1)
+    IF (aerosol_couple .AND. flag_aerosol == 0) THEN
+      CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if aerosol_couple=y ', 1)
     ENDIF
 
     ! Read_climoz needs to be set zero if we are in couple mode for chemistry 
     IF (chemistry_couple .AND. read_climoz /= 0) THEN
-       CALL abort_physic('conf_phys', 'read_climoz need to be to zero if chemistry_couple=y ', 1) 
+      CALL abort_physic('conf_phys', 'read_climoz need to be to zero if chemistry_couple=y ', 1)
     ENDIF
 
     ! flag_aerosol need to be different to zero if ok_cdnc is activated
     IF (ok_cdnc .AND. flag_aerosol == 0) THEN
-       CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if ok_cdnc is activated ', 1)
+      CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if ok_cdnc is activated ', 1)
     ENDIF
 
     ! ok_cdnc must be set to y if ok_aie is activated
     IF (ok_aie .AND. .NOT. ok_cdnc) THEN
-       CALL abort_physic('conf_phys', 'ok_cdnc must be set to y if ok_aie is activated',1)
+      CALL abort_physic('conf_phys', 'ok_cdnc must be set to y if ok_aie is activated', 1)
     ENDIF
 
     ! flag_aerosol=7 => MACv2SP climatology 
     IF (flag_aerosol==7.AND. iflag_rrtm/=1) THEN
-       CALL abort_physic('conf_phys', 'flag_aerosol=7 (MACv2SP) can only be activated with RRTM',1)
+      CALL abort_physic('conf_phys', 'flag_aerosol=7 (MACv2SP) can only be activated with RRTM', 1)
     ENDIF
     IF (flag_aerosol==7.AND. NSW/=6) THEN
-       CALL abort_physic('conf_phys', 'flag_aerosol=7 (MACv2SP) can only be activated with NSW=6',1)
+      CALL abort_physic('conf_phys', 'flag_aerosol=7 (MACv2SP) can only be activated with NSW=6', 1)
     ENDIF
 
     ! BC internal mixture is only possible with RRTM & NSW=6 & flag_aerosol=6 or aerosol_couple
     IF (flag_bc_internal_mixture .AND. NSW/=6) THEN
-       CALL abort_physic('conf_phys', 'flag_bc_internal_mixture can only be activated with NSW=6',1)
+      CALL abort_physic('conf_phys', 'flag_bc_internal_mixture can only be activated with NSW=6', 1)
     ENDIF
     IF (flag_bc_internal_mixture .AND. iflag_rrtm/=1) THEN
-       CALL abort_physic('conf_phys', 'flag_bc_internal_mixture can only be activated with RRTM',1)
+      CALL abort_physic('conf_phys', 'flag_bc_internal_mixture can only be activated with RRTM', 1)
     ENDIF
     IF (flag_bc_internal_mixture .AND. flag_aerosol/=6) THEN
-       CALL abort_physic('conf_phys', 'flag_bc_internal_mixture can only be activated with flag_aerosol=6',1)
+      CALL abort_physic('conf_phys', 'flag_bc_internal_mixture can only be activated with flag_aerosol=6', 1)
     ENDIF
 
     ! test sur flag_volc_surfstrat
     IF (flag_volc_surfstrat<0.OR.flag_volc_surfstrat>2) THEN
-       CALL abort_physic('conf_phys', 'flag_volc_surfstrat can only be 0 1 or 2',1)
-    ENDIF 
+      CALL abort_physic('conf_phys', 'flag_volc_surfstrat can only be 0 1 or 2', 1)
+    ENDIF
     IF ((.NOT.ok_volcan.OR..NOT.ok_ade.OR..NOT.ok_aie).AND.flag_volc_surfstrat>0) THEN
-       CALL abort_physic('conf_phys', 'ok_ade, ok_aie, ok_volcan need to be activated if flag_volc_surfstrat is 1 or 2',1)
-    ENDIF 
+      CALL abort_physic('conf_phys', 'ok_ade, ok_aie, ok_volcan need to be activated if flag_volc_surfstrat is 1 or 2', 1)
+    ENDIF
 
     ! Test on carbon cycle
     IF (carbon_cycle_tr .AND. .NOT. carbon_cycle_cpl) THEN
-       CALL abort_physic('conf_phys', 'carbon_cycle_cpl has to be TRUE if carbon_cycle_tr is on',1)
+      CALL abort_physic('conf_phys', 'carbon_cycle_cpl has to be TRUE if carbon_cycle_tr is on', 1)
     ENDIF
     IF (carbon_cycle_rad .AND. .NOT. carbon_cycle_cpl) THEN
-       CALL abort_physic('conf_phys', 'carbon_cycle_cpl has to be TRUE if carbon_cycle_rad is on',1)
+      CALL abort_physic('conf_phys', 'carbon_cycle_cpl has to be TRUE if carbon_cycle_rad is on', 1)
     ENDIF
 
 
     ! Test on chemistry cycle 
-    IF ((type_trac /= "inca" .AND. type_trac /= "inco") .AND. ( dms_cycle_cpl .OR. n2o_cycle_cpl)  ) THEN
-       CALL abort_physic('conf_phys', 'dms_cycle_cpl or n2o_cycle_cpl has to be TRUE only with INCA coupling model',1)
+    IF ((type_trac /= "inca" .AND. type_trac /= "inco") .AND. (dms_cycle_cpl .OR. n2o_cycle_cpl)) THEN
+      CALL abort_physic('conf_phys', 'dms_cycle_cpl or n2o_cycle_cpl has to be TRUE only with INCA coupling model', 1)
     ENDIF
-    
+
     ! ORCHIDEE must be activated for ifl_pbltree=1
     IF (.NOT. ok_veget .AND. ifl_pbltree==1) THEN
-       WRITE(lunout,*)'Warning: ORCHIDEE must be activated for ifl_pbltree=1'
-       WRITE(lunout,*)'ifl_pbltree is now changed to zero'
-       ifl_pbltree=0
+      WRITE(lunout, *)'Warning: ORCHIDEE must be activated for ifl_pbltree=1'
+      WRITE(lunout, *)'ifl_pbltree is now changed to zero'
+      ifl_pbltree = 0
     ENDIF
 
     !$OMP MASTER
 
-    WRITE(lunout,*) ' ##############################################'
-    WRITE(lunout,*) ' Configuration des parametres de la physique: '
-    WRITE(lunout,*) ' Type ocean = ', type_ocean
-    WRITE(lunout,*) ' Version ocean = ', version_ocean
-    WRITE(lunout,*) ' Config veget = ', ok_veget,type_veget
-    WRITE(lunout,*) ' Snow model landice : landice_opt = ', landice_opt
-    WRITE(lunout,*) ' Config xml pour XIOS : ok_all_xml = ', ok_all_xml
-    WRITE(lunout,*) ' Sortie journaliere = ', ok_journe
-    WRITE(lunout,*) ' Sortie haute frequence = ', ok_hf
-    WRITE(lunout,*) ' Sortie mensuelle = ', ok_mensuel
-    WRITE(lunout,*) ' Sortie instantanee = ', ok_instan
-    WRITE(lunout,*) ' Frequence appel simulateur ISCCP, freq_ISCCP =', freq_ISCCP
-    WRITE(lunout,*) ' Frequence appel simulateur ISCCP, ecrit_ISCCP =', ecrit_ISCCP
-    WRITE(lunout,*) ' Frequence appel simulateur COSP, freq_COSP =', freq_COSP
-    WRITE(lunout,*) ' Frequence appel simulateur AIRS, freq_AIRS =', freq_AIRS
-    WRITE(lunout,*) ' Sortie bilan d''energie, ip_ebil_phy =', ip_ebil_phy
-    WRITE(lunout,*) ' Excentricite = ',R_ecc
-    WRITE(lunout,*) ' Equinoxe = ',R_peri
-    WRITE(lunout,*) ' Inclinaison =',R_incl
-    WRITE(lunout,*) ' Constante solaire =',solaire
-    WRITE(lunout,*) ' ok_suntime_rrtm =',ok_suntime_rrtm
-    WRITE(lunout,*) ' co2_ppm =',co2_ppm
-    WRITE(lunout,*) ' co2_ppm0 =',co2_ppm0
-    WRITE(lunout,*) ' RCO2_act = ',RCO2_act
-    WRITE(lunout,*) ' CH4_ppb =',CH4_ppb,' RCH4_act = ',RCH4_act
-    WRITE(lunout,*) ' N2O_ppb =',N2O_ppb,' RN2O_act=  ',RN2O_act
-    WRITE(lunout,*) ' CFC11_ppt=',CFC11_ppt,' RCFC11_act=  ',RCFC11_act
-    WRITE(lunout,*) ' CFC12_ppt=',CFC12_ppt,' RCFC12_act=  ',RCFC12_act
-    WRITE(lunout,*) ' RCO2_per = ',RCO2_per,' RCH4_per = ', RCH4_per
-    WRITE(lunout,*) ' RN2O_per = ',RN2O_per,' RCFC11_per = ', RCFC11_per
-    WRITE(lunout,*) ' RCFC12_per = ',RCFC12_per
-    WRITE(lunout,*) ' cvl_comp_threshold=', cvl_comp_threshold
-    WRITE(lunout,*) ' cvl_sig2feed=', cvl_sig2feed
-    WRITE(lunout,*) ' cvl_corr=', cvl_corr
-    WRITE(lunout,*) ' ok_lic_melt=', ok_lic_melt
-    WRITE(lunout,*) ' ok_lic_cond=', ok_lic_cond
-    WRITE(lunout,*) ' iflag_cycle_diurne=',iflag_cycle_diurne
-    WRITE(lunout,*) ' soil_model=',soil_model
-    WRITE(lunout,*) ' new_oliq=',new_oliq
-    WRITE(lunout,*) ' ok_orodr=',ok_orodr
-    WRITE(lunout,*) ' ok_orolf=',ok_orolf
-    WRITE(lunout,*) ' zrel_oro_t=',zrel_oro_t
-    WRITE(lunout,*) ' zstd_orodr_t=',zstd_orodr_t
-    WRITE(lunout,*) ' zpmm_orodr_t=',zpmm_orodr_t
-    WRITE(lunout,*) ' zpmm_orolf_t=',zpmm_orolf_t
-    WRITE(lunout,*) ' ok_limitvrai=',ok_limitvrai
-    WRITE(lunout,*) ' nbapp_rad=',nbapp_rad
-    WRITE(lunout,*) ' iflag_con=',iflag_con
-    WRITE(lunout,*) ' nbapp_cv=',nbapp_cv
-    WRITE(lunout,*) ' nbapp_wk=',nbapp_wk
-    WRITE(lunout,*) ' iflag_ener_conserv=',iflag_ener_conserv
-    WRITE(lunout,*) ' ok_conserv_q=',ok_conserv_q
-    WRITE(lunout,*) ' epmax = ', epmax
-    WRITE(lunout,*) ' coef_epmax_cape = ', coef_epmax_cape
-    WRITE(lunout,*) ' ok_adj_ema = ', ok_adj_ema
-    WRITE(lunout,*) ' iflag_clw = ', iflag_clw
-    WRITE(lunout,*) ' iflag_cld_th = ', iflag_cld_th
-    WRITE(lunout,*) ' iflag_cld_cv = ', iflag_cld_cv
-    WRITE(lunout,*) ' tau_cld_cv = ', tau_cld_cv
-    WRITE(lunout,*) ' coefw_cld_cv = ', coefw_cld_cv
-    WRITE(lunout,*) ' iflag_radia = ', iflag_radia
-    WRITE(lunout,*) ' iflag_rrtm = ', iflag_rrtm
-    WRITE(lunout,*) ' NSW = ', NSW
-    WRITE(lunout,*) ' iflag_albedo = ', iflag_albedo !albedo SB
-    WRITE(lunout,*) ' ok_chlorophyll =',ok_chlorophyll ! albedo SB
-    WRITE(lunout,*) ' iflag_ratqs = ', iflag_ratqs
-    WRITE(lunout,*) ' seuil_inversion = ', seuil_inversion
-    WRITE(lunout,*) ' fact_cldcon = ', fact_cldcon
-    WRITE(lunout,*) ' facttemps = ', facttemps
-    WRITE(lunout,*) ' ok_newmicro = ',ok_newmicro 
-    WRITE(lunout,*) ' ratqsbas = ',ratqsbas 
-    WRITE(lunout,*) ' ratqshaut = ',ratqshaut 
-    WRITE(lunout,*) ' tau_ratqs = ',tau_ratqs 
-    WRITE(lunout,*) ' top_height = ',top_height 
-    WRITE(lunout,*) ' rad_froid = ',rad_froid
-    WRITE(lunout,*) ' rad_chau1 = ',rad_chau1
-    WRITE(lunout,*) ' rad_chau2 = ',rad_chau2
-    WRITE(lunout,*) ' iflag_ice_thermo = ',iflag_ice_thermo
-    WRITE(lunout,*) ' ok_ice_sursat = ',ok_ice_sursat
-    WRITE(lunout,*) ' ok_plane_h2o = ',ok_plane_h2o
-    WRITE(lunout,*) ' ok_plane_contrail = ',ok_plane_contrail
-    WRITE(lunout,*) ' overlap = ',overlap 
-    WRITE(lunout,*) ' cdmmax = ',cdmmax 
-    WRITE(lunout,*) ' cdhmax = ',cdhmax 
-    WRITE(lunout,*) ' ksta = ',ksta 
-    WRITE(lunout,*) ' ksta_ter = ',ksta_ter 
-    WRITE(lunout,*) ' f_ri_cd_min = ',f_ri_cd_min 
-    WRITE(lunout,*) ' ok_kzmin = ',ok_kzmin 
-    WRITE(lunout,*) ' fmagic = ',fmagic
-    WRITE(lunout,*) ' pmagic = ',pmagic
-    WRITE(lunout,*) ' ok_ade = ',ok_ade
-    WRITE(lunout,*) ' ok_volcan = ',ok_volcan
-    WRITE(lunout,*) ' flag_volc_surfstrat = ',flag_volc_surfstrat
-    WRITE(lunout,*) ' ok_aie = ',ok_aie
-    WRITE(lunout,*) ' ok_alw = ',ok_alw
-    WRITE(lunout,*) ' aerosol_couple = ', aerosol_couple
-    WRITE(lunout,*) ' chemistry_couple = ', chemistry_couple
-    WRITE(lunout,*) ' flag_aerosol = ', flag_aerosol
-    WRITE(lunout,*) ' flag_aerosol_strat= ', flag_aerosol_strat
-    WRITE(lunout,*) ' flag_aer_feedback= ', flag_aer_feedback
-    WRITE(lunout,*) ' aer_type = ',aer_type
-    WRITE(lunout,*) ' bl95_b0 = ',bl95_b0
-    WRITE(lunout,*) ' bl95_b1 = ',bl95_b1
-    WRITE(lunout,*) ' lev_histhf = ',lev_histhf 
-    WRITE(lunout,*) ' lev_histday = ',lev_histday 
-    WRITE(lunout,*) ' lev_histmth = ',lev_histmth 
-    WRITE(lunout,*) ' lev_histins = ',lev_histins
-    WRITE(lunout,*) ' lev_histLES = ',lev_histLES
-    WRITE(lunout,*) ' lev_histdayNMC = ',lev_histdayNMC
-    WRITE(lunout,*) ' levout_histNMC = ',levout_histNMC
-    WRITE(lunout,*) ' ok_histNMC = ',ok_histNMC
-    WRITE(lunout,*) ' freq_outNMC = ',freq_outNMC
-    WRITE(lunout,*) ' freq_calNMC = ',freq_calNMC
-    WRITE(lunout,*) ' iflag_pbl = ', iflag_pbl
-    WRITE(lunout,*) ' iflag_physiq = ', iflag_physiq
-!FC
-    WRITE(lunout,*) ' ifl_pbltree = ', ifl_pbltree
-    WRITE(lunout,*) ' Cd_frein = ', Cd_frein
-    WRITE(lunout,*) ' iflag_pbl_split = ', iflag_pbl_split
-    WRITE(lunout,*) ' iflag_order2_sollw = ', iflag_order2_sollw
-    WRITE(lunout,*) ' iflag_thermals = ', iflag_thermals
-    WRITE(lunout,*) ' iflag_clos = ', iflag_clos
-    WRITE(lunout,*) ' coef_clos_ls = ', coef_clos_ls
-    WRITE(lunout,*) ' type_run = ',type_run 
-    WRITE(lunout,*) ' ok_cosp = ',ok_cosp
-    WRITE(lunout,*) ' ok_airs = ',ok_airs
-
-    WRITE(lunout,*) ' ok_mensuelCOSP = ',ok_mensuelCOSP
-    WRITE(lunout,*) ' ok_journeCOSP = ',ok_journeCOSP
-    WRITE(lunout,*) ' ok_hfCOSP =',ok_hfCOSP
-    WRITE(lunout,*) ' solarlong0 = ', solarlong0
-    WRITE(lunout,*) ' qsol0 = ', qsol0
-    WRITE(lunout,*) ' evap0 = ', evap0
-    WRITE(lunout,*) ' albsno0 = ', albsno0
-    WRITE(lunout,*) ' iflag_sic = ', iflag_sic
-    WRITE(lunout,*) ' iflag_inertie = ', iflag_inertie
-    WRITE(lunout,*) ' inertie_sol = ', inertie_sol
-    WRITE(lunout,*) ' inertie_sic = ', inertie_sic
-    WRITE(lunout,*) ' inertie_lic = ', inertie_lic
-    WRITE(lunout,*) ' inertie_sno = ', inertie_sno
-    WRITE(lunout,*) ' ok_bs = ', ok_bs
-    WRITE(lunout,*) ' ok_rad_bs = ', ok_rad_bs
-    WRITE(lunout,*) ' f_cdrag_ter = ',f_cdrag_ter
-    WRITE(lunout,*) ' f_cdrag_oce = ',f_cdrag_oce
-    WRITE(lunout,*) ' f_rugoro = ',f_rugoro
-    WRITE(lunout,*) ' z0min = ',z0min
-    WRITE(lunout,*) ' supcrit1 = ', supcrit1
-    WRITE(lunout,*) ' supcrit2 = ', supcrit2
-    WRITE(lunout,*) ' iflag_mix = ', iflag_mix
-    WRITE(lunout,*) ' iflag_mix_adiab = ', iflag_mix_adiab
-    WRITE(lunout,*) ' scut = ', scut
-    WRITE(lunout,*) ' qqa1 = ', qqa1
-    WRITE(lunout,*) ' qqa2 = ', qqa2
-    WRITE(lunout,*) ' gammas = ', gammas
-    WRITE(lunout,*) ' Fmax = ', Fmax
-    WRITE(lunout,*) ' tmax_fonte_cv = ', tmax_fonte_cv
-    WRITE(lunout,*) ' alphas = ', alphas
-    WRITE(lunout,*) ' iflag_wake = ', iflag_wake
-    WRITE(lunout,*) ' alp_offset = ', alp_offset
+    WRITE(lunout, *) ' ##############################################'
+    WRITE(lunout, *) ' Configuration des parametres de la physique: '
+    WRITE(lunout, *) ' Type ocean = ', type_ocean
+    WRITE(lunout, *) ' Version ocean = ', version_ocean
+    WRITE(lunout, *) ' Config veget = ', ok_veget, type_veget
+    WRITE(lunout, *) ' Snow model landice : landice_opt = ', landice_opt
+    WRITE(lunout, *) ' Config xml pour XIOS : ok_all_xml = ', ok_all_xml
+    WRITE(lunout, *) ' Sortie journaliere = ', ok_journe
+    WRITE(lunout, *) ' Sortie haute frequence = ', ok_hf
+    WRITE(lunout, *) ' Sortie mensuelle = ', ok_mensuel
+    WRITE(lunout, *) ' Sortie instantanee = ', ok_instan
+    WRITE(lunout, *) ' Frequence appel simulateur ISCCP, freq_ISCCP =', freq_ISCCP
+    WRITE(lunout, *) ' Frequence appel simulateur ISCCP, ecrit_ISCCP =', ecrit_ISCCP
+    WRITE(lunout, *) ' Frequence appel simulateur COSP, freq_COSP =', freq_COSP
+    WRITE(lunout, *) ' Frequence appel simulateur AIRS, freq_AIRS =', freq_AIRS
+    WRITE(lunout, *) ' Sortie bilan d''energie, ip_ebil_phy =', ip_ebil_phy
+    WRITE(lunout, *) ' Excentricite = ', R_ecc
+    WRITE(lunout, *) ' Equinoxe = ', R_peri
+    WRITE(lunout, *) ' Inclinaison =', R_incl
+    WRITE(lunout, *) ' Constante solaire =', solaire
+    WRITE(lunout, *) ' ok_suntime_rrtm =', ok_suntime_rrtm
+    WRITE(lunout, *) ' co2_ppm =', co2_ppm
+    WRITE(lunout, *) ' co2_ppm0 =', co2_ppm0
+    WRITE(lunout, *) ' RCO2_act = ', RCO2_act
+    WRITE(lunout, *) ' CH4_ppb =', CH4_ppb, ' RCH4_act = ', RCH4_act
+    WRITE(lunout, *) ' N2O_ppb =', N2O_ppb, ' RN2O_act=  ', RN2O_act
+    WRITE(lunout, *) ' CFC11_ppt=', CFC11_ppt, ' RCFC11_act=  ', RCFC11_act
+    WRITE(lunout, *) ' CFC12_ppt=', CFC12_ppt, ' RCFC12_act=  ', RCFC12_act
+    WRITE(lunout, *) ' RCO2_per = ', RCO2_per, ' RCH4_per = ', RCH4_per
+    WRITE(lunout, *) ' RN2O_per = ', RN2O_per, ' RCFC11_per = ', RCFC11_per
+    WRITE(lunout, *) ' RCFC12_per = ', RCFC12_per
+    WRITE(lunout, *) ' cvl_comp_threshold=', cvl_comp_threshold
+    WRITE(lunout, *) ' cvl_sig2feed=', cvl_sig2feed
+    WRITE(lunout, *) ' cvl_corr=', cvl_corr
+    WRITE(lunout, *) ' ok_lic_melt=', ok_lic_melt
+    WRITE(lunout, *) ' ok_lic_cond=', ok_lic_cond
+    WRITE(lunout, *) ' iflag_cycle_diurne=', iflag_cycle_diurne
+    WRITE(lunout, *) ' soil_model=', soil_model
+    WRITE(lunout, *) ' new_oliq=', new_oliq
+    WRITE(lunout, *) ' ok_orodr=', ok_orodr
+    WRITE(lunout, *) ' ok_orolf=', ok_orolf
+    WRITE(lunout, *) ' zrel_oro_t=', zrel_oro_t
+    WRITE(lunout, *) ' zstd_orodr_t=', zstd_orodr_t
+    WRITE(lunout, *) ' zpmm_orodr_t=', zpmm_orodr_t
+    WRITE(lunout, *) ' zpmm_orolf_t=', zpmm_orolf_t
+    WRITE(lunout, *) ' ok_limitvrai=', ok_limitvrai
+    WRITE(lunout, *) ' nbapp_rad=', nbapp_rad
+    WRITE(lunout, *) ' iflag_con=', iflag_con
+    WRITE(lunout, *) ' nbapp_cv=', nbapp_cv
+    WRITE(lunout, *) ' nbapp_wk=', nbapp_wk
+    WRITE(lunout, *) ' iflag_ener_conserv=', iflag_ener_conserv
+    WRITE(lunout, *) ' ok_conserv_q=', ok_conserv_q
+    WRITE(lunout, *) ' epmax = ', epmax
+    WRITE(lunout, *) ' coef_epmax_cape = ', coef_epmax_cape
+    WRITE(lunout, *) ' ok_adj_ema = ', ok_adj_ema
+    WRITE(lunout, *) ' iflag_clw = ', iflag_clw
+    WRITE(lunout, *) ' iflag_cld_th = ', iflag_cld_th
+    WRITE(lunout, *) ' iflag_cld_cv = ', iflag_cld_cv
+    WRITE(lunout, *) ' tau_cld_cv = ', tau_cld_cv
+    WRITE(lunout, *) ' coefw_cld_cv = ', coefw_cld_cv
+    WRITE(lunout, *) ' iflag_radia = ', iflag_radia
+    WRITE(lunout, *) ' iflag_rrtm = ', iflag_rrtm
+    WRITE(lunout, *) ' NSW = ', NSW
+    WRITE(lunout, *) ' iflag_albedo = ', iflag_albedo !albedo SB
+    WRITE(lunout, *) ' ok_chlorophyll =', ok_chlorophyll ! albedo SB
+    WRITE(lunout, *) ' iflag_ratqs = ', iflag_ratqs
+    WRITE(lunout, *) ' seuil_inversion = ', seuil_inversion
+    WRITE(lunout, *) ' fact_cldcon = ', fact_cldcon
+    WRITE(lunout, *) ' facttemps = ', facttemps
+    WRITE(lunout, *) ' ok_newmicro = ', ok_newmicro
+    WRITE(lunout, *) ' ratqsbas = ', ratqsbas
+    WRITE(lunout, *) ' ratqshaut = ', ratqshaut
+    WRITE(lunout, *) ' tau_ratqs = ', tau_ratqs
+    WRITE(lunout, *) ' top_height = ', top_height
+    WRITE(lunout, *) ' rad_froid = ', rad_froid
+    WRITE(lunout, *) ' rad_chau1 = ', rad_chau1
+    WRITE(lunout, *) ' rad_chau2 = ', rad_chau2
+    WRITE(lunout, *) ' iflag_ice_thermo = ', iflag_ice_thermo
+    WRITE(lunout, *) ' ok_ice_sursat = ', ok_ice_sursat
+    WRITE(lunout, *) ' ok_plane_h2o = ', ok_plane_h2o
+    WRITE(lunout, *) ' ok_plane_contrail = ', ok_plane_contrail
+    WRITE(lunout, *) ' overlap = ', overlap
+    WRITE(lunout, *) ' cdmmax = ', cdmmax
+    WRITE(lunout, *) ' cdhmax = ', cdhmax
+    WRITE(lunout, *) ' ksta = ', ksta
+    WRITE(lunout, *) ' ksta_ter = ', ksta_ter
+    WRITE(lunout, *) ' f_ri_cd_min = ', f_ri_cd_min
+    WRITE(lunout, *) ' ok_kzmin = ', ok_kzmin
+    WRITE(lunout, *) ' fmagic = ', fmagic
+    WRITE(lunout, *) ' pmagic = ', pmagic
+    WRITE(lunout, *) ' ok_ade = ', ok_ade
+    WRITE(lunout, *) ' ok_volcan = ', ok_volcan
+    WRITE(lunout, *) ' flag_volc_surfstrat = ', flag_volc_surfstrat
+    WRITE(lunout, *) ' ok_aie = ', ok_aie
+    WRITE(lunout, *) ' ok_alw = ', ok_alw
+    WRITE(lunout, *) ' aerosol_couple = ', aerosol_couple
+    WRITE(lunout, *) ' chemistry_couple = ', chemistry_couple
+    WRITE(lunout, *) ' flag_aerosol = ', flag_aerosol
+    WRITE(lunout, *) ' flag_aerosol_strat= ', flag_aerosol_strat
+    WRITE(lunout, *) ' flag_aer_feedback= ', flag_aer_feedback
+    WRITE(lunout, *) ' aer_type = ', aer_type
+    WRITE(lunout, *) ' bl95_b0 = ', bl95_b0
+    WRITE(lunout, *) ' bl95_b1 = ', bl95_b1
+    WRITE(lunout, *) ' lev_histhf = ', lev_histhf
+    WRITE(lunout, *) ' lev_histday = ', lev_histday
+    WRITE(lunout, *) ' lev_histmth = ', lev_histmth
+    WRITE(lunout, *) ' lev_histins = ', lev_histins
+    WRITE(lunout, *) ' lev_histLES = ', lev_histLES
+    WRITE(lunout, *) ' lev_histdayNMC = ', lev_histdayNMC
+    WRITE(lunout, *) ' levout_histNMC = ', levout_histNMC
+    WRITE(lunout, *) ' ok_histNMC = ', ok_histNMC
+    WRITE(lunout, *) ' freq_outNMC = ', freq_outNMC
+    WRITE(lunout, *) ' freq_calNMC = ', freq_calNMC
+    WRITE(lunout, *) ' iflag_pbl = ', iflag_pbl
+    WRITE(lunout, *) ' iflag_physiq = ', iflag_physiq
+    !FC
+    WRITE(lunout, *) ' ifl_pbltree = ', ifl_pbltree
+    WRITE(lunout, *) ' Cd_frein = ', Cd_frein
+    WRITE(lunout, *) ' iflag_pbl_split = ', iflag_pbl_split
+    WRITE(lunout, *) ' iflag_order2_sollw = ', iflag_order2_sollw
+    WRITE(lunout, *) ' iflag_thermals = ', iflag_thermals
+    WRITE(lunout, *) ' iflag_clos = ', iflag_clos
+    WRITE(lunout, *) ' coef_clos_ls = ', coef_clos_ls
+    WRITE(lunout, *) ' type_run = ', type_run
+    WRITE(lunout, *) ' ok_cosp = ', ok_cosp
+    WRITE(lunout, *) ' ok_airs = ', ok_airs
+
+    WRITE(lunout, *) ' ok_mensuelCOSP = ', ok_mensuelCOSP
+    WRITE(lunout, *) ' ok_journeCOSP = ', ok_journeCOSP
+    WRITE(lunout, *) ' ok_hfCOSP =', ok_hfCOSP
+    WRITE(lunout, *) ' solarlong0 = ', solarlong0
+    WRITE(lunout, *) ' qsol0 = ', qsol0
+    WRITE(lunout, *) ' evap0 = ', evap0
+    WRITE(lunout, *) ' albsno0 = ', albsno0
+    WRITE(lunout, *) ' iflag_sic = ', iflag_sic
+    WRITE(lunout, *) ' iflag_inertie = ', iflag_inertie
+    WRITE(lunout, *) ' inertie_sol = ', inertie_sol
+    WRITE(lunout, *) ' inertie_sic = ', inertie_sic
+    WRITE(lunout, *) ' inertie_lic = ', inertie_lic
+    WRITE(lunout, *) ' inertie_sno = ', inertie_sno
+    WRITE(lunout, *) ' ok_bs = ', ok_bs
+    WRITE(lunout, *) ' ok_rad_bs = ', ok_rad_bs
+    WRITE(lunout, *) ' f_cdrag_ter = ', f_cdrag_ter
+    WRITE(lunout, *) ' f_cdrag_oce = ', f_cdrag_oce
+    WRITE(lunout, *) ' f_rugoro = ', f_rugoro
+    WRITE(lunout, *) ' z0min = ', z0min
+    WRITE(lunout, *) ' supcrit1 = ', supcrit1
+    WRITE(lunout, *) ' supcrit2 = ', supcrit2
+    WRITE(lunout, *) ' iflag_mix = ', iflag_mix
+    WRITE(lunout, *) ' iflag_mix_adiab = ', iflag_mix_adiab
+    WRITE(lunout, *) ' scut = ', scut
+    WRITE(lunout, *) ' qqa1 = ', qqa1
+    WRITE(lunout, *) ' qqa2 = ', qqa2
+    WRITE(lunout, *) ' gammas = ', gammas
+    WRITE(lunout, *) ' Fmax = ', Fmax
+    WRITE(lunout, *) ' tmax_fonte_cv = ', tmax_fonte_cv
+    WRITE(lunout, *) ' alphas = ', alphas
+    WRITE(lunout, *) ' iflag_wake = ', iflag_wake
+    WRITE(lunout, *) ' alp_offset = ', alp_offset
     ! nrlmd le 10/04/2012
-    WRITE(lunout,*) ' iflag_trig_bl = ', iflag_trig_bl
-    WRITE(lunout,*) ' iflag_strig = ', iflag_strig
-    WRITE(lunout,*) ' s_trig = ', s_trig
-    WRITE(lunout,*) ' h_trig = ', h_trig
-    WRITE(lunout,*) ' tau_trig_shallow = ', tau_trig_shallow
-    WRITE(lunout,*) ' tau_trig_deep = ', tau_trig_deep
-    WRITE(lunout,*) ' iflag_clos_bl = ', iflag_clos_bl
+    WRITE(lunout, *) ' iflag_trig_bl = ', iflag_trig_bl
+    WRITE(lunout, *) ' iflag_strig = ', iflag_strig
+    WRITE(lunout, *) ' s_trig = ', s_trig
+    WRITE(lunout, *) ' h_trig = ', h_trig
+    WRITE(lunout, *) ' tau_trig_shallow = ', tau_trig_shallow
+    WRITE(lunout, *) ' tau_trig_deep = ', tau_trig_deep
+    WRITE(lunout, *) ' iflag_clos_bl = ', iflag_clos_bl
     ! fin nrlmd le 10/04/2012
 
-    WRITE(lunout,*) ' lonmin lonmax latmin latmax bilKP_ins =',&
-         lonmin_ins, lonmax_ins, latmin_ins, latmax_ins
-    WRITE(lunout,*) ' ecrit_ hf, ins, day, mth, reg, tra, ISCCP, LES',&
-         ecrit_hf, ecrit_ins, ecrit_day, ecrit_mth, ecrit_reg, ecrit_tra, ecrit_ISCCP, ecrit_LES
-
-    WRITE(lunout,*) ' ok_strato = ', ok_strato
-    WRITE(lunout,*) ' ok_hines = ',  ok_hines
-    WRITE(lunout,*) ' ok_gwd_rando = ',  ok_gwd_rando
-    WRITE(lunout,*) ' ok_qch4 = ',  ok_qch4
-    WRITE(lunout,*) ' gwd_rando_ruwmax = ', gwd_rando_ruwmax
-    WRITE(lunout,*) ' gwd_rando_sat = ', gwd_rando_sat
-    WRITE(lunout,*) ' gwd_front_ruwmax = ', gwd_front_ruwmax
-    WRITE(lunout,*) ' gwd_front_sat = ', gwd_front_sat
-    WRITE(lunout,*) ' SSO gkdrag =',gkdrag
-    WRITE(lunout,*) ' SSO grahilo=',grahilo
-    WRITE(lunout,*) ' SSO grcrit=',grcrit
-    WRITE(lunout,*) ' SSO gfrcrit=',gfrcrit
-    WRITE(lunout,*) ' SSO gkwake=',gkwake
-    WRITE(lunout,*) ' SSO gklift=',gklift
-    WRITE(lunout,*) ' adjust_tropopause = ', adjust_tropopause
-    WRITE(lunout,*) ' ok_daily_climoz = ',ok_daily_climoz
-    WRITE(lunout,*) ' ok_new_lscp = ', ok_new_lscp
-    WRITE(lunout,*) ' ok_icefra_lscp = ', ok_icefra_lscp
-    WRITE(lunout,*) ' read_climoz = ', read_climoz
-    WRITE(lunout,*) ' carbon_cycle_tr = ', carbon_cycle_tr
-    WRITE(lunout,*) ' carbon_cycle_cpl = ', carbon_cycle_cpl
-    WRITE(lunout,*) ' carbon_cycle_rad = ', carbon_cycle_rad
-    WRITE(lunout,*) ' level_coupling_esm = ', level_coupling_esm
-    WRITE(lunout,*) ' read_fco2_ocean_cor = ', read_fco2_ocean_cor
-    WRITE(lunout,*) ' var_fco2_ocean_cor = ', var_fco2_ocean_cor
-    WRITE(lunout,*) ' read_fco2_land_cor = ', read_fco2_land_cor
-    WRITE(lunout,*) ' var_fco2_land_cor = ', var_fco2_land_cor
-    WRITE(lunout,*) ' dms_cycle_cpl = ', dms_cycle_cpl
-    WRITE(lunout,*) ' n2o_cycle_cpl = ', n2o_cycle_cpl
-    WRITE(lunout,*) ' iflag_tsurf_inlandsis = ', iflag_tsurf_inlandsis
-    WRITE(lunout,*) ' iflag_temp_inlandsis = ', iflag_temp_inlandsis
-    WRITE(lunout,*) ' iflag_albcalc = ', iflag_albcalc
-    WRITE(lunout,*) ' SnoMod = ', SnoMod
-    WRITE(lunout,*) ' BloMod = ', BloMod
-    WRITE(lunout,*) ' ok_outfor = ', ok_outfor
-    WRITE(lunout,*) ' is_ok_slush = ', is_ok_slush
-    WRITE(lunout,*) ' opt_runoff_ac = ', opt_runoff_ac
-    WRITE(lunout,*) ' is_ok_z0h_rn = ', is_ok_z0h_rn
-    WRITE(lunout,*) ' is_ok_density_kotlyakov = ', is_ok_density_kotlyakov
-    WRITE(lunout,*) ' prescribed_z0m_snow = ', prescribed_z0m_snow
-    WRITE(lunout,*) ' iflag_z0m_snow = ', iflag_z0m_snow
-    WRITE(lunout,*) ' ok_zsn_ii = ', ok_zsn_ii
-    WRITE(lunout,*) ' discret_xf = ', discret_xf
-    WRITE(lunout,*) ' correc_alb= ', correc_alb
-    WRITE(lunout,*) ' buf_sph_pol = ', buf_sph_pol
-    WRITE(lunout,*) ' buf_siz_pol= ', buf_siz_pol
+    WRITE(lunout, *) ' lonmin lonmax latmin latmax bilKP_ins =', &
+            lonmin_ins, lonmax_ins, latmin_ins, latmax_ins
+    WRITE(lunout, *) ' ecrit_ hf, ins, day, mth, reg, tra, ISCCP, LES', &
+            ecrit_hf, ecrit_ins, ecrit_day, ecrit_mth, ecrit_reg, ecrit_tra, ecrit_ISCCP, ecrit_LES
+
+    WRITE(lunout, *) ' ok_strato = ', ok_strato
+    WRITE(lunout, *) ' ok_hines = ', ok_hines
+    WRITE(lunout, *) ' ok_gwd_rando = ', ok_gwd_rando
+    WRITE(lunout, *) ' ok_qch4 = ', ok_qch4
+    WRITE(lunout, *) ' gwd_rando_ruwmax = ', gwd_rando_ruwmax
+    WRITE(lunout, *) ' gwd_rando_sat = ', gwd_rando_sat
+    WRITE(lunout, *) ' gwd_front_ruwmax = ', gwd_front_ruwmax
+    WRITE(lunout, *) ' gwd_front_sat = ', gwd_front_sat
+    WRITE(lunout, *) ' SSO gkdrag =', gkdrag
+    WRITE(lunout, *) ' SSO grahilo=', grahilo
+    WRITE(lunout, *) ' SSO grcrit=', grcrit
+    WRITE(lunout, *) ' SSO gfrcrit=', gfrcrit
+    WRITE(lunout, *) ' SSO gkwake=', gkwake
+    WRITE(lunout, *) ' SSO gklift=', gklift
+    WRITE(lunout, *) ' adjust_tropopause = ', adjust_tropopause
+    WRITE(lunout, *) ' ok_daily_climoz = ', ok_daily_climoz
+    WRITE(lunout, *) ' ok_new_lscp = ', ok_new_lscp
+    WRITE(lunout, *) ' ok_icefra_lscp = ', ok_icefra_lscp
+    WRITE(lunout, *) ' read_climoz = ', read_climoz
+    WRITE(lunout, *) ' carbon_cycle_tr = ', carbon_cycle_tr
+    WRITE(lunout, *) ' carbon_cycle_cpl = ', carbon_cycle_cpl
+    WRITE(lunout, *) ' carbon_cycle_rad = ', carbon_cycle_rad
+    WRITE(lunout, *) ' level_coupling_esm = ', level_coupling_esm
+    WRITE(lunout, *) ' read_fco2_ocean_cor = ', read_fco2_ocean_cor
+    WRITE(lunout, *) ' var_fco2_ocean_cor = ', var_fco2_ocean_cor
+    WRITE(lunout, *) ' read_fco2_land_cor = ', read_fco2_land_cor
+    WRITE(lunout, *) ' var_fco2_land_cor = ', var_fco2_land_cor
+    WRITE(lunout, *) ' dms_cycle_cpl = ', dms_cycle_cpl
+    WRITE(lunout, *) ' n2o_cycle_cpl = ', n2o_cycle_cpl
+    WRITE(lunout, *) ' iflag_tsurf_inlandsis = ', iflag_tsurf_inlandsis
+    WRITE(lunout, *) ' iflag_temp_inlandsis = ', iflag_temp_inlandsis
+    WRITE(lunout, *) ' iflag_albcalc = ', iflag_albcalc
+    WRITE(lunout, *) ' SnoMod = ', SnoMod
+    WRITE(lunout, *) ' BloMod = ', BloMod
+    WRITE(lunout, *) ' ok_outfor = ', ok_outfor
+    WRITE(lunout, *) ' is_ok_slush = ', is_ok_slush
+    WRITE(lunout, *) ' opt_runoff_ac = ', opt_runoff_ac
+    WRITE(lunout, *) ' is_ok_z0h_rn = ', is_ok_z0h_rn
+    WRITE(lunout, *) ' is_ok_density_kotlyakov = ', is_ok_density_kotlyakov
+    WRITE(lunout, *) ' prescribed_z0m_snow = ', prescribed_z0m_snow
+    WRITE(lunout, *) ' iflag_z0m_snow = ', iflag_z0m_snow
+    WRITE(lunout, *) ' ok_zsn_ii = ', ok_zsn_ii
+    WRITE(lunout, *) ' discret_xf = ', discret_xf
+    WRITE(lunout, *) ' correc_alb= ', correc_alb
+    WRITE(lunout, *) ' buf_sph_pol = ', buf_sph_pol
+    WRITE(lunout, *) ' buf_siz_pol= ', buf_siz_pol
     !rajout Olivier Torres
-    write(lunout,*) 'choix_bulk = ', choix_bulk
-    write(lunout,*) 'nit_bulk = ', nit_bulk
-    write(lunout,*) 'kz0 = ', kz0
+    write(lunout, *) 'choix_bulk = ', choix_bulk
+    write(lunout, *) 'nit_bulk = ', nit_bulk
+    write(lunout, *) 'kz0 = ', kz0
 
     !$OMP END MASTER
@@ -2930,5 +2922,5 @@
 
   USE IOIPSL
-  USE print_control_mod, ONLY: lunout
+  USE print_control_mod, ONLY : lunout
   IMPLICIT NONE
   ! Configuration de l'interace atm/surf
@@ -2936,6 +2928,6 @@
   ! tau_calv:    temps de relaxation pour la fonte des glaciers
   !
-  REAL          :: tau_calv
-  REAL, SAVE    :: tau_calv_omp
+  REAL :: tau_calv
+  REAL, SAVE :: tau_calv_omp
   !
   !Config Key  = tau_calv
@@ -2944,16 +2936,16 @@
   !Config Help = 
   !
-  tau_calv_omp = 360.*10.
+  tau_calv_omp = 360. * 10.
   !$OMP MASTER
-  CALL getin('tau_calv',tau_calv_omp)
+  CALL getin('tau_calv', tau_calv_omp)
   !$OMP END MASTER
   !$OMP BARRIER
   !
-  tau_calv=tau_calv_omp
+  tau_calv = tau_calv_omp
   !
   !$OMP MASTER
-  WRITE(lunout,*)' ##############################################'
-  WRITE(lunout,*)' Configuration de l''interface atm/surfaces  : '
-  WRITE(lunout,*)' tau_calv = ',tau_calv
+  WRITE(lunout, *)' ##############################################'
+  WRITE(lunout, *)' Configuration de l''interface atm/surfaces  : '
+  WRITE(lunout, *)' tau_calv = ', tau_calv
   !$OMP END MASTER
   !
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/hgardfou.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/hgardfou.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/hgardfou.F90	(revision 5098)
@@ -41,7 +41,4 @@
       zt(i) = t(i, k)
     END DO
-#ifdef CRAY
-    CALL whenfgt(klon, zt, 1, 370.0, jadrs, jbad)
-#else
     jbad = 0
     DO i = 1, klon
@@ -51,5 +48,4 @@
       END IF
     END DO
-#endif
     IF (jbad>0) THEN
       ok = .FALSE.
@@ -60,7 +56,4 @@
       END DO
     END IF
-#ifdef CRAY
-    CALL whenflt(klon, zt, 1, 100.0, jadrs, jbad)
-#else
     jbad = 0
     DO i = 1, klon
@@ -71,5 +64,4 @@
       END IF
     END DO
-#endif
     IF (jbad>0) THEN
       ok = .FALSE.
@@ -86,7 +78,4 @@
       zt(i) = tsol(i, nsrf)
     END DO
-#ifdef CRAY
-    CALL whenfgt(klon, zt, 1, 370.0, jadrs, jbad)
-#else
     jbad = 0
     DO i = 1, klon
@@ -96,5 +85,4 @@
       END IF
     END DO
-#endif
     IF (jbad>0) THEN
       ok = .FALSE.
@@ -106,7 +94,4 @@
       END DO
     END IF
-#ifdef CRAY
-    CALL whenflt(klon, zt, 1, 100.0, jadrs, jbad)
-#else
     jbad = 0
     DO i = 1, klon
@@ -117,5 +102,4 @@
       END IF
     END DO
-#endif
     IF (jbad>0) THEN
       ok = .FALSE.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90	(revision 5098)
@@ -3,466 +3,459 @@
 MODULE infotrac_phy
 
-   USE       strings_mod, ONLY: msg, fmsg, maxlen, cat, dispTable, int2str, bool2str, strStack, strParse, strIdx
-   USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers, setGeneration, itZonIso, nzone, tran0, isoZone, &
-        delPhase, niso, getKey, isot_type, processIsotopes,  isotope, maxTableWidth, iqIsoPha, nphas, ixIso, isoPhas, &
-        addPhase, iH2O, addKey, isoSelect, testTracersFiles, isoKeys, indexUpdate,  iqWIsoPha, nbIso, ntiso, isoName, isoCheck
-   IMPLICIT NONE
-
-   PRIVATE
-
-   !=== FOR TRACERS:
-   PUBLIC :: init_infotrac_phy                             !--- Initialization of the tracers
-   PUBLIC :: tracers, type_trac                            !--- Full tracers database, tracers type keyword
-   PUBLIC :: nqtot,   nbtr,   nqo,   nqCO2,   nqtottr      !--- Main dimensions
-   PUBLIC :: conv_flg, pbl_flg                             !--- Convection & boundary layer activation keys
-#ifdef CPP_StratAer
-   PUBLIC :: nbtr_bin, nbtr_sulgas                         !--- Number of aerosols bins and sulfur gases for StratAer model
-   PUBLIC :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat
-#endif
-
-   !=== FOR WATER
-   PUBLIC :: ivap, iliq, isol
-   !=== FOR ISOTOPES: General
-   PUBLIC :: isot_type, nbIso                              !--- Derived type, full isotopes families database + nb of families
-   PUBLIC :: isoSelect, ixIso                              !--- Isotopes family selection tool + selected family index
-   !=== FOR ISOTOPES: Specific to water
-   PUBLIC :: iH2O                                          !--- H2O isotopes class index
-   !=== FOR ISOTOPES: Depending on the selected isotopes family
-   PUBLIC :: isotope, isoKeys                              !--- Selected isotopes database + associated keys (cf. getKey)
-   PUBLIC :: isoName, isoZone, isoPhas                     !--- Isotopes and tagging zones names, phases
-   PUBLIC :: niso,    nzone,   nphas,   ntiso              !---  " " numbers + isotopes & tagging tracers number
-   PUBLIC :: itZonIso                                      !--- idx "it" (in "isoName(1:niso)") = function(tagging idx, isotope idx)
-   PUBLIC :: iqIsoPha                                      !--- idx "iq" (in "qx") = function(isotope idx, phase idx) + aliases
-   PUBLIC :: iqWIsoPha                                      !--- Same as iqIsoPha but with normal water phases
-
-   PUBLIC :: isoCheck                                      !--- Run isotopes checking routines
-   !=== FOR BOTH TRACERS AND ISOTOPES
-   PUBLIC :: getKey                                        !--- Get a key from "tracers" or "isotope"
-
-!=== CONVENTIONS FOR TRACERS NUMBERS:
-!  |--------------------+-----------------------+-----------------+---------------+----------------------------|
-!  | water in different |    water tagging      |  water isotopes | other tracers | additional tracers moments |
-!  | phases: H2O_[gls]  |      isotopes         |                 |               |  for higher order schemes  |
-!  |--------------------+-----------------------+-----------------+---------------+----------------------------|
-!  |                    |                       |                 |               |                            |
-!  |<--     nqo      -->|<-- nqo*niso* nzone -->|<-- nqo*niso  -->|<--  nbtr   -->|<--        (nmom)        -->|         
-!  |                    |                                         |                                            |
-!  |                    |<-- nqo*niso*(nzone+1)  =   nqo*ntiso -->|<--    nqtottr = nbtr + nmom             -->|
-!  |                                                                              = nqtot - nqo*(ntiso+1)      |
-!  |                                                                                                           |
-!  |<--                        nqtrue  =  nbtr + nqo*(ntiso+1)                 -->|                            |
-!  |                                                                                                           |
-!  |<--                        nqtot   =  nqtrue + nmom                                                     -->|
-!  |                                                                                                           |
-!  |-----------------------------------------------------------------------------------------------------------|
-!  NOTES FOR THIS TABLE:
-!  * Used "niso", "nzone" and "ntiso" are components of "isotopes(ip)" for water (isotopes(ip)%parent == 'H2O'),
-!    since water is so far the sole tracers family, except passive CO2, removed from the main tracers table.
-!  * For water, "nqo" is equal to the more general field "isotopes(ip)%nphas".
-!  * "niso", "nzone", "ntiso", "nphas" are defined for other isotopic tracers families, if any.
-!
-!=== DERIVED TYPE EMBEDDING MOST OF THE TRACERS-RELATED QUANTITIES (LENGTH: nqtot)
-!    Each entry is accessible using "%" sign.
-!  |-------------+------------------------------------------------------+-------------+------------------------+
-!  |  entry      | Meaning                                              | Former name | Possible values        |
-!  |-------------+------------------------------------------------------+-------------+------------------------+
-!  | name        | Name (short)                                         | tname       |                        |
-!  | gen0Name    | Name of the 1st generation ancestor                  | /           |                        |
-!  | parent      | Name of the parent                                   | /           |                        |
-!  | longName    | Long name (with adv. scheme suffix) for outputs      | ttext       |                        |
-!  | type        | Type (so far: tracer or tag)                         | /           | tracer,tag             |
-!  | phase       | Phases list ("g"as / "l"iquid / "s"olid)             | /           | [g][l][s]              |
-!  | component   | Name(s) of the merged/cumulated section(s)           | /           | coma-separated names   |
-!  | iGeneration | Generation (>=1)                                     | /           |                        |
-!  | iqParent    | Index of the parent tracer                           | iqpere      | 1:nqtot                |
-!  | iqDescen    | Indexes of the childs       (all generations)        | iqfils      | 1:nqtot                |
-!  | nqDescen    | Number of the descendants   (all generations)        | nqdesc      | 1:nqtot                |
-!  | nqChildren  | Number of childs            (1st generation only)    | nqfils      | 1:nqtot                |
-!  | keys        | key/val pairs accessible with "getKey" routine       | /           |                        |
-!  | isAdvected  | advected tracers flag (.TRUE. if iadv >= 0)          | /           | nqtrue  .TRUE. values  |
-!  | isInPhysics | tracers not extracted from the main table in physics | /           | nqtottr .TRUE. values  |
-!  | iso_iGroup  | Isotopes group index in isotopes(:)                  | /           | 1:nbIso                |
-!  | iso_iName   | Isotope  name  index in isotopes(iso_iGroup)%trac(:) | iso_indnum  | 1:niso                 |
-!  | iso_iZone   | Isotope  zone  index in isotopes(iso_iGroup)%zone(:) | zone_num    | 1:nzone                |
-!  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
-!  +-------------+------------------------------------------------------+-------------+------------------------+
-!
-!=== DERIVED TYPE EMBEDDING MOST OF THE ISOTOPES-RELATED QUANTITIES (LENGTH: nbIso, NUMBER OF ISOTOPES FAMILIES)
-!    Each entry is accessible using "%" sign.
-!  |-----------------+--------------------------------------------------+--------------------+-----------------+
-!  |  entry | length | Meaning                                          |    Former name     | Possible values |
-!  |-----------------+--------------------------------------------------+--------------------+-----------------+
-!  | parent          | Parent tracer (isotopes family name)             |                    |                 |
-!  | keys   | niso   | Isotopes keys/values pairs list + number         |                    |                 |
-!  | trac   | ntiso  | Isotopes + tagging tracers list + number         | / | ntraciso       |                 |
-!  | zone   | nzone  | Geographic tagging zones   list + number         | / | ntraceurs_zone |                 |
-!  | phase  | nphas  | Phases                     list + number         |                    | [g][l][s], 1:3  |
-!  | iqIsoPha        | Index in "qx"           = f(name(1:ntiso)),phas) | iqiso              | 1:nqtot         |
-!  | iqWIsoPha       | Index in "qx"           = f(name(1:ntiso)),phas) | iqiso              | 1:nqtot         |
-!  | itZonIso        | Index in "trac(1:ntiso)"= f(zone, name(1:niso))  | index_trac         | 1:ntiso         |
-!  +-----------------+--------------------------------------------------+--------------------+-----------------+
-
-   !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES
-   INTEGER,               SAVE :: nqtot,  &                     !--- Tracers nb in dynamics (incl. higher moments + H2O)
-                                  nbtr,   &                     !--- Tracers nb in physics  (excl. higher moments + H2O)
-                                  nqo,    &                     !--- Number of water phases
-                                  nqtottr, &                    !--- Number of tracers passed to phytrac (TO BE DELETED ?)
-                                  nqCO2                         !--- Number of tracers of CO2  (ThL)
-   CHARACTER(LEN=maxlen), SAVE :: type_trac                     !--- Keyword for tracers type(s)
-!$OMP THREADPRIVATE(nqtot, nbtr, nqo, nqtottr, nqCO2, type_trac)
-
-   !=== INDICES OF WATER
-   INTEGER,               SAVE :: ivap,iliq,isol ! Indices for vap, liq and ice
-!$OMP THREADPRIVATE(ivap,iliq,isol)
-
-   !=== VARIABLES FOR INCA
-   INTEGER,               SAVE, ALLOCATABLE :: conv_flg(:), &   !--- Convection     activation ; needed for INCA        (nbtr)
-                                                pbl_flg(:)      !--- Boundary layer activation ; needed for INCA        (nbtr)
-!$OMP THREADPRIVATE(conv_flg, pbl_flg)
-
-#ifdef CPP_StratAer
+  USE       strings_mod, ONLY : msg, fmsg, maxlen, cat, dispTable, int2str, bool2str, strStack, strParse, strIdx
+  USE readTracFiles_mod, ONLY : trac_type, readTracersFiles, tracers, setGeneration, itZonIso, nzone, tran0, isoZone, &
+          delPhase, niso, getKey, isot_type, processIsotopes, isotope, maxTableWidth, iqIsoPha, nphas, ixIso, isoPhas, &
+          addPhase, iH2O, addKey, isoSelect, testTracersFiles, isoKeys, indexUpdate, iqWIsoPha, nbIso, ntiso, isoName, isoCheck
+  IMPLICIT NONE
+
+  PRIVATE
+
+  !=== FOR TRACERS:
+  PUBLIC :: init_infotrac_phy                             !--- Initialization of the tracers
+  PUBLIC :: tracers, type_trac                            !--- Full tracers database, tracers type keyword
+  PUBLIC :: nqtot, nbtr, nqo, nqCO2, nqtottr      !--- Main dimensions
+  PUBLIC :: conv_flg, pbl_flg                             !--- Convection & boundary layer activation keys
+  PUBLIC :: nbtr_bin, nbtr_sulgas                         !--- Number of aerosols bins and sulfur gases for StratAer model
+  PUBLIC :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat
+
+  !=== FOR WATER
+  PUBLIC :: ivap, iliq, isol
+  !=== FOR ISOTOPES: General
+  PUBLIC :: isot_type, nbIso                              !--- Derived type, full isotopes families database + nb of families
+  PUBLIC :: isoSelect, ixIso                              !--- Isotopes family selection tool + selected family index
+  !=== FOR ISOTOPES: Specific to water
+  PUBLIC :: iH2O                                          !--- H2O isotopes class index
+  !=== FOR ISOTOPES: Depending on the selected isotopes family
+  PUBLIC :: isotope, isoKeys                              !--- Selected isotopes database + associated keys (cf. getKey)
+  PUBLIC :: isoName, isoZone, isoPhas                     !--- Isotopes and tagging zones names, phases
+  PUBLIC :: niso, nzone, nphas, ntiso              !---  " " numbers + isotopes & tagging tracers number
+  PUBLIC :: itZonIso                                      !--- idx "it" (in "isoName(1:niso)") = function(tagging idx, isotope idx)
+  PUBLIC :: iqIsoPha                                      !--- idx "iq" (in "qx") = function(isotope idx, phase idx) + aliases
+  PUBLIC :: iqWIsoPha                                      !--- Same as iqIsoPha but with normal water phases
+
+  PUBLIC :: isoCheck                                      !--- Run isotopes checking routines
+  !=== FOR BOTH TRACERS AND ISOTOPES
+  PUBLIC :: getKey                                        !--- Get a key from "tracers" or "isotope"
+
+  !=== CONVENTIONS FOR TRACERS NUMBERS:
+  !  |--------------------+-----------------------+-----------------+---------------+----------------------------|
+  !  | water in different |    water tagging      |  water isotopes | other tracers | additional tracers moments |
+  !  | phases: H2O_[gls]  |      isotopes         |                 |               |  for higher order schemes  |
+  !  |--------------------+-----------------------+-----------------+---------------+----------------------------|
+  !  |                    |                       |                 |               |                            |
+  !  |<--     nqo      -->|<-- nqo*niso* nzone -->|<-- nqo*niso  -->|<--  nbtr   -->|<--        (nmom)        -->|
+  !  |                    |                                         |                                            |
+  !  |                    |<-- nqo*niso*(nzone+1)  =   nqo*ntiso -->|<--    nqtottr = nbtr + nmom             -->|
+  !  |                                                                              = nqtot - nqo*(ntiso+1)      |
+  !  |                                                                                                           |
+  !  |<--                        nqtrue  =  nbtr + nqo*(ntiso+1)                 -->|                            |
+  !  |                                                                                                           |
+  !  |<--                        nqtot   =  nqtrue + nmom                                                     -->|
+  !  |                                                                                                           |
+  !  |-----------------------------------------------------------------------------------------------------------|
+  !  NOTES FOR THIS TABLE:
+  !  * Used "niso", "nzone" and "ntiso" are components of "isotopes(ip)" for water (isotopes(ip)%parent == 'H2O'),
+  !    since water is so far the sole tracers family, except passive CO2, removed from the main tracers table.
+  !  * For water, "nqo" is equal to the more general field "isotopes(ip)%nphas".
+  !  * "niso", "nzone", "ntiso", "nphas" are defined for other isotopic tracers families, if any.
+  !
+  !=== DERIVED TYPE EMBEDDING MOST OF THE TRACERS-RELATED QUANTITIES (LENGTH: nqtot)
+  !    Each entry is accessible using "%" sign.
+  !  |-------------+------------------------------------------------------+-------------+------------------------+
+  !  |  entry      | Meaning                                              | Former name | Possible values        |
+  !  |-------------+------------------------------------------------------+-------------+------------------------+
+  !  | name        | Name (short)                                         | tname       |                        |
+  !  | gen0Name    | Name of the 1st generation ancestor                  | /           |                        |
+  !  | parent      | Name of the parent                                   | /           |                        |
+  !  | longName    | Long name (with adv. scheme suffix) for outputs      | ttext       |                        |
+  !  | type        | Type (so far: tracer or tag)                         | /           | tracer,tag             |
+  !  | phase       | Phases list ("g"as / "l"iquid / "s"olid)             | /           | [g][l][s]              |
+  !  | component   | Name(s) of the merged/cumulated section(s)           | /           | coma-separated names   |
+  !  | iGeneration | Generation (>=1)                                     | /           |                        |
+  !  | iqParent    | Index of the parent tracer                           | iqpere      | 1:nqtot                |
+  !  | iqDescen    | Indexes of the childs       (all generations)        | iqfils      | 1:nqtot                |
+  !  | nqDescen    | Number of the descendants   (all generations)        | nqdesc      | 1:nqtot                |
+  !  | nqChildren  | Number of childs            (1st generation only)    | nqfils      | 1:nqtot                |
+  !  | keys        | key/val pairs accessible with "getKey" routine       | /           |                        |
+  !  | isAdvected  | advected tracers flag (.TRUE. if iadv >= 0)          | /           | nqtrue  .TRUE. values  |
+  !  | isInPhysics | tracers not extracted from the main table in physics | /           | nqtottr .TRUE. values  |
+  !  | iso_iGroup  | Isotopes group index in isotopes(:)                  | /           | 1:nbIso                |
+  !  | iso_iName   | Isotope  name  index in isotopes(iso_iGroup)%trac(:) | iso_indnum  | 1:niso                 |
+  !  | iso_iZone   | Isotope  zone  index in isotopes(iso_iGroup)%zone(:) | zone_num    | 1:nzone                |
+  !  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
+  !  +-------------+------------------------------------------------------+-------------+------------------------+
+  !
+  !=== DERIVED TYPE EMBEDDING MOST OF THE ISOTOPES-RELATED QUANTITIES (LENGTH: nbIso, NUMBER OF ISOTOPES FAMILIES)
+  !    Each entry is accessible using "%" sign.
+  !  |-----------------+--------------------------------------------------+--------------------+-----------------+
+  !  |  entry | length | Meaning                                          |    Former name     | Possible values |
+  !  |-----------------+--------------------------------------------------+--------------------+-----------------+
+  !  | parent          | Parent tracer (isotopes family name)             |                    |                 |
+  !  | keys   | niso   | Isotopes keys/values pairs list + number         |                    |                 |
+  !  | trac   | ntiso  | Isotopes + tagging tracers list + number         | / | ntraciso       |                 |
+  !  | zone   | nzone  | Geographic tagging zones   list + number         | / | ntraceurs_zone |                 |
+  !  | phase  | nphas  | Phases                     list + number         |                    | [g][l][s], 1:3  |
+  !  | iqIsoPha        | Index in "qx"           = f(name(1:ntiso)),phas) | iqiso              | 1:nqtot         |
+  !  | iqWIsoPha       | Index in "qx"           = f(name(1:ntiso)),phas) | iqiso              | 1:nqtot         |
+  !  | itZonIso        | Index in "trac(1:ntiso)"= f(zone, name(1:niso))  | index_trac         | 1:ntiso         |
+  !  +-----------------+--------------------------------------------------+--------------------+-----------------+
+
+  !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES
+  INTEGER, SAVE :: nqtot, &                     !--- Tracers nb in dynamics (incl. higher moments + H2O)
+          nbtr, &                     !--- Tracers nb in physics  (excl. higher moments + H2O)
+          nqo, &                     !--- Number of water phases
+          nqtottr, &                    !--- Number of tracers passed to phytrac (TO BE DELETED ?)
+          nqCO2                         !--- Number of tracers of CO2  (ThL)
+  CHARACTER(LEN = maxlen), SAVE :: type_trac                     !--- Keyword for tracers type(s)
+  !$OMP THREADPRIVATE(nqtot, nbtr, nqo, nqtottr, nqCO2, type_trac)
+
+  !=== INDICES OF WATER
+  INTEGER, SAVE :: ivap, iliq, isol ! Indices for vap, liq and ice
+  !$OMP THREADPRIVATE(ivap,iliq,isol)
+
+  !=== VARIABLES FOR INCA
+  INTEGER, SAVE, ALLOCATABLE :: conv_flg(:), &   !--- Convection     activation ; needed for INCA        (nbtr)
+          pbl_flg(:)      !--- Boundary layer activation ; needed for INCA        (nbtr)
+  !$OMP THREADPRIVATE(conv_flg, pbl_flg)
+
   !=== SPECIFIC TO STRATOSPHERIC AEROSOLS (CK/OB)
-  INTEGER, SAVE ::  nbtr_bin, nbtr_sulgas         !--- number of aerosols bins and sulfur gases for StratAer model
-!$OMP THREADPRIVATE(nbtr_bin, nbtr_sulgas)
-  INTEGER, SAVE ::  id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat
-!$OMP THREADPRIVATE(id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat)
-#endif
+  INTEGER, SAVE :: nbtr_bin, nbtr_sulgas         !--- number of aerosols bins and sulfur gases for StratAer model
+  !$OMP THREADPRIVATE(nbtr_bin, nbtr_sulgas)
+  INTEGER, SAVE :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat
+  !$OMP THREADPRIVATE(id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat)
 
 CONTAINS
 
-SUBROUTINE init_infotrac_phy
-   USE ioipsl_getin_p_mod, ONLY: getin_p
+  SUBROUTINE init_infotrac_phy
+    USE ioipsl_getin_p_mod, ONLY : getin_p
 #ifdef REPROBUS
    USE CHEM_REP, ONLY: Init_chem_rep_trac
 #endif
-   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
-   IMPLICIT NONE
-!==============================================================================================================================
-!
-!   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
-!   -------
-!
-!   Modifications:
-!   --------------
-!   05/94: F.Forget      Modif special traceur
-!   02/02: M-A Filiberti Lecture de traceur.def
-!   01/22: D. Cugnet     Nouveaux tracer.def et tracer_*.def + encapsulation (types trac_type et isot_type)
-!
-!   Objet:
-!   ------
-!   GCM LMD nouvelle grille
-!
-!==============================================================================================================================
-!   ... modification de l'integration de q ( 26/04/94 ) ....
-!------------------------------------------------------------------------------------------------------------------------------
-! Declarations:
-   INCLUDE "dimensions.h"
-   INCLUDE "iniprint.h"
-
-!------------------------------------------------------------------------------------------------------------------------------
-! Local variables
-   INTEGER, ALLOCATABLE :: hadv(:), vadv(:)                          !--- Horizontal/vertical transport scheme number
-   INTEGER, ALLOCATABLE :: had (:), hadv_inca(:), conv_flg_inca(:), &!--- Variables specific to INCA
-                           vad (:), vadv_inca(:),  pbl_flg_inca(:)
-   CHARACTER(LEN=8), ALLOCATABLE :: solsym_inca(:)                   !--- Tracers names for INCA
-   INTEGER :: nqINCA
-#ifdef CPP_StratAer
-   CHARACTER(LEN=maxlen), ALLOCATABLE :: tnames(:)
-#endif
-   CHARACTER(LEN=2)      ::   suff(9)                                !--- Suffixes for schemes of order 3 or 4 (Prather)
-   CHARACTER(LEN=3)      :: descrq(30)                               !--- Advection scheme description tags
-   CHARACTER(LEN=maxlen) :: msg1, texp, ttp                          !--- String for messages and expanded tracers type
-   INTEGER :: fType                                                  !--- Tracers description file type ; 0: none
-                                                                     !--- 1/2/3: "traceur.def"/"tracer.def"/"tracer_*.def"
-   INTEGER :: nqtrue                                                 !--- Tracers nb from tracer.def (no higher order moments)
-   INTEGER :: iad                                                    !--- Advection scheme number
-   INTEGER :: iq, jq, nt, im, nm, k                                 !--- Indexes and temporary variables
-   LOGICAL :: lerr, lInit
-   TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:)
-   TYPE(trac_type), POINTER             :: t1, t(:)
-   CHARACTER(LEN=maxlen),   ALLOCATABLE :: types_trac(:)  !--- Keyword for tracers type(s), parsed version
-   
-   CHARACTER(LEN=*), PARAMETER :: modname="init_infotrac_phy"
-!------------------------------------------------------------------------------------------------------------------------------
-! Initialization :
-!------------------------------------------------------------------------------------------------------------------------------
-   suff          = ['x ','y ','z ','xx','xy','xz','yy','yz','zz']
-   descrq( 1:30) =  '   '
-   descrq( 1: 2) = ['LMV','BAK']
-   descrq(10:20) = ['VL1','VLP','FH1','FH2','VLH','   ','PPM','PPS','PPP','   ','SLP']
-   descrq(30)    =  'PRA'
-
-   CALL getin_p('type_trac',type_trac)
-
-   lerr=strParse(type_trac, '|', types_trac, n=nt)
-   IF (nt > 1) THEN
+    USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_INCA, CPPKEY_STRATAER
+    IMPLICIT NONE
+    !==============================================================================================================================
+    !
+    !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
+    !   -------
+    !
+    !   Modifications:
+    !   --------------
+    !   05/94: F.Forget      Modif special traceur
+    !   02/02: M-A Filiberti Lecture de traceur.def
+    !   01/22: D. Cugnet     Nouveaux tracer.def et tracer_*.def + encapsulation (types trac_type et isot_type)
+    !
+    !   Objet:
+    !   ------
+    !   GCM LMD nouvelle grille
+    !
+    !==============================================================================================================================
+    !   ... modification de l'integration de q ( 26/04/94 ) ....
+    !------------------------------------------------------------------------------------------------------------------------------
+    ! Declarations:
+    INCLUDE "dimensions.h"
+    INCLUDE "iniprint.h"
+
+    !------------------------------------------------------------------------------------------------------------------------------
+    ! Local variables
+    INTEGER, ALLOCATABLE :: hadv(:), vadv(:)                          !--- Horizontal/vertical transport scheme number
+    INTEGER, ALLOCATABLE :: had (:), hadv_inca(:), conv_flg_inca(:), &!--- Variables specific to INCA
+            vad (:), vadv_inca(:), pbl_flg_inca(:)
+    CHARACTER(LEN = 8), ALLOCATABLE :: solsym_inca(:)                   !--- Tracers names for INCA
+    INTEGER :: nqINCA
+    CHARACTER(LEN = maxlen), ALLOCATABLE :: tnames(:)
+    CHARACTER(LEN = 2) :: suff(9)                                !--- Suffixes for schemes of order 3 or 4 (Prather)
+    CHARACTER(LEN = 3) :: descrq(30)                               !--- Advection scheme description tags
+    CHARACTER(LEN = maxlen) :: msg1, texp, ttp                          !--- String for messages and expanded tracers type
+    INTEGER :: fType                                                  !--- Tracers description file type ; 0: none
+    !--- 1/2/3: "traceur.def"/"tracer.def"/"tracer_*.def"
+    INTEGER :: nqtrue                                                 !--- Tracers nb from tracer.def (no higher order moments)
+    INTEGER :: iad                                                    !--- Advection scheme number
+    INTEGER :: iq, jq, nt, im, nm, k                                 !--- Indexes and temporary variables
+    LOGICAL :: lerr, lInit
+    TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:)
+    TYPE(trac_type), POINTER :: t1, t(:)
+    CHARACTER(LEN = maxlen), ALLOCATABLE :: types_trac(:)  !--- Keyword for tracers type(s), parsed version
+
+    CHARACTER(LEN = *), PARAMETER :: modname = "init_infotrac_phy"
+    !------------------------------------------------------------------------------------------------------------------------------
+    ! Initialization :
+    !------------------------------------------------------------------------------------------------------------------------------
+    suff = ['x ', 'y ', 'z ', 'xx', 'xy', 'xz', 'yy', 'yz', 'zz']
+    descrq(1:30) = '   '
+    descrq(1:2) = ['LMV', 'BAK']
+    descrq(10:20) = ['VL1', 'VLP', 'FH1', 'FH2', 'VLH', '   ', 'PPM', 'PPS', 'PPP', '   ', 'SLP']
+    descrq(30) = 'PRA'
+
+    CALL getin_p('type_trac', type_trac)
+
+    lerr = strParse(type_trac, '|', types_trac, n = nt)
+    IF (nt > 1) THEN
       IF (nt > 2) CALL abort_physic(modname, 'you need to modify type_trac, this version is not supported by lmdz', 1)
-      IF (nt == 2) type_trac=types_trac(2)
-   ENDIF
-
-   
-   CALL msg('type_trac = "'//TRIM(type_trac)//'"', modname)
-   lInit = .NOT.ALLOCATED(tracers)
-
-!##############################################################################################################################
-   IF(lInit) THEN                                                    !=== SKIPED IF ALREADY DONE IN dyn3d_common/infotrac  ####
-!##############################################################################################################################
-   !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
-   msg1 = 'For type_trac = "'//TRIM(type_trac)//'":'
-   SELECT CASE(type_trac)
-      CASE('inca'); CALL msg(TRIM(msg1)//' coupling with INCA chemistry model',        modname)
-      CASE('inco'); CALL msg(TRIM(msg1)//' coupling jointly with INCA and CO2 cycle',  modname)
-      CASE('repr'); CALL msg(TRIM(msg1)//' coupling with REPROBUS chemistry model',    modname)
-      CASE('co2i'); CALL msg(TRIM(msg1)//' you have chosen to run with CO2 cycle',     modname)
-      CASE('coag'); CALL msg(TRIM(msg1)//' tracers are treated for COAGULATION tests', modname)
-      CASE('lmdz'); CALL msg(TRIM(msg1)//' tracers are treated in LMDZ only',          modname)
-      CASE DEFAULT; CALL abort_physic(modname,'type_trac='//TRIM(type_trac)//' not possible yet.',1)
-   END SELECT
-
-   !--- COHERENCE TEST BETWEEN "type_trac" AND PREPROCESSING KEYS
-   SELECT CASE(type_trac)
+      IF (nt == 2) type_trac = types_trac(2)
+    ENDIF
+
+    CALL msg('type_trac = "' // TRIM(type_trac) // '"', modname)
+    lInit = .NOT.ALLOCATED(tracers)
+
+    !##############################################################################################################################
+    IF(lInit) THEN                                                    !=== SKIPED IF ALREADY DONE IN dyn3d_common/infotrac  ####
+      !##############################################################################################################################
+      !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
+      msg1 = 'For type_trac = "' // TRIM(type_trac) // '":'
+      SELECT CASE(type_trac)
+      CASE('inca'); CALL msg(TRIM(msg1) // ' coupling with INCA chemistry model', modname)
+      CASE('inco'); CALL msg(TRIM(msg1) // ' coupling jointly with INCA and CO2 cycle', modname)
+      CASE('repr'); CALL msg(TRIM(msg1) // ' coupling with REPROBUS chemistry model', modname)
+      CASE('co2i'); CALL msg(TRIM(msg1) // ' you have chosen to run with CO2 cycle', modname)
+      CASE('coag'); CALL msg(TRIM(msg1) // ' tracers are treated for COAGULATION tests', modname)
+      CASE('lmdz'); CALL msg(TRIM(msg1) // ' tracers are treated in LMDZ only', modname)
+      CASE DEFAULT; CALL abort_physic(modname, 'type_trac=' // TRIM(type_trac) // ' not possible yet.', 1)
+      END SELECT
+
+      !--- COHERENCE TEST BETWEEN "type_trac" AND PREPROCESSING KEYS
+      SELECT CASE(type_trac)
       CASE('inca', 'inco')
-   IF (CPPKEY_INCA) THEN
-         CALL abort_physic(modname, 'You must add cpp key INCA and compile with INCA code', 1)
-   END IF
+        IF (CPPKEY_INCA) THEN
+          CALL abort_physic(modname, 'You must add cpp key INCA and compile with INCA code', 1)
+        END IF
       CASE('repr')
 #ifndef REPROBUS
-         CALL abort_physic(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)
+        CALL abort_physic(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)
 #endif
       CASE('coag')
-#ifndef CPP_StratAer
-         CALL abort_physic(modname, 'You must add cpp key StratAer and compile with StratAer code', 1)
-#endif
-   END SELECT
-!##############################################################################################################################
-   END IF
-!##############################################################################################################################
-
-   nqCO2 = COUNT( [type_trac == 'inco', type_trac == 'co2i'] )
-
-!==============================================================================================================================
-! 1) Get the numbers of: true (first order only) tracers "nqtrue", water tracers "nqo" (vapor/liquid/solid)
-!==============================================================================================================================
-   texp = type_trac                                                  !=== EXPANDED VERSION OF "type_trac", WITH "|" SEPARATOR
-   IF(texp == 'inco') texp = 'co2i|inca'
-   IF(texp /= 'lmdz') texp = 'lmdz|'//TRIM(texp)
-
-   !=== DETERMINE THE TYPE OF THE INPUT TRACERS DESCRIPTION FILE
-   IF(testTracersFiles(modname, texp, fType, lInit)) CALL abort_physic(modname, 'problem with tracers file(s)',1)
-
-   ttp = type_trac; IF(fType /= 1) ttp = texp
-
-!##############################################################################################################################
-   IF(lInit) THEN
-      IF(readTracersFiles(ttp, lRepr=type_trac=='repr')) CALL abort_physic(modname, 'problem with tracers file(s)',1)
-   ELSE
+        IF (.NOT. CPPKEY_STRATAER) THEN
+          CALL abort_physic(modname, 'You must add cpp key StratAer and compile with StratAer code', 1)
+        END IF
+      END SELECT
+      !##############################################################################################################################
+    END IF
+    !##############################################################################################################################
+
+    nqCO2 = COUNT([type_trac == 'inco', type_trac == 'co2i'])
+
+    !==============================================================================================================================
+    ! 1) Get the numbers of: true (first order only) tracers "nqtrue", water tracers "nqo" (vapor/liquid/solid)
+    !==============================================================================================================================
+    texp = type_trac                                                  !=== EXPANDED VERSION OF "type_trac", WITH "|" SEPARATOR
+    IF(texp == 'inco') texp = 'co2i|inca'
+    IF(texp /= 'lmdz') texp = 'lmdz|' // TRIM(texp)
+
+    !=== DETERMINE THE TYPE OF THE INPUT TRACERS DESCRIPTION FILE
+    IF(testTracersFiles(modname, texp, fType, lInit)) CALL abort_physic(modname, 'problem with tracers file(s)', 1)
+
+    ttp = type_trac; IF(fType /= 1) ttp = texp
+
+    !##############################################################################################################################
+    IF(lInit) THEN
+      IF(readTracersFiles(ttp, lRepr = type_trac=='repr')) CALL abort_physic(modname, 'problem with tracers file(s)', 1)
+    ELSE
       CALL msg('No tracers description file(s) reading needed: already done in the dynamics', modname)
-   END IF
-!##############################################################################################################################
-
-   !---------------------------------------------------------------------------------------------------------------------------
-   IF(fType == 0) CALL abort_physic(modname, 'Missing tracers file: "traceur.def", "tracer.def" or "tracer_<keyword>.def file.',1)
-   !---------------------------------------------------------------------------------------------------------------------------
-   IF(fType == 1 .AND. ANY(['inca','inco']==type_trac) .AND. lInit) THEN  !=== FOUND OLD STYLE INCA "traceur.def"
-   !---------------------------------------------------------------------------------------------------------------------------
-   IF (CPPKEY_INCA) THEN
-      nqo = SIZE(tracers) - nqCO2
-      CALL Init_chem_inca_trac(nqINCA)                               !--- Get nqINCA from INCA
-      nbtr = nqINCA + nqCO2                                          !--- Number of tracers passed to phytrac
-      nqtrue = nbtr + nqo                                            !--- Total number of "true" tracers
-      IF(ALL([2,3] /= nqo)) CALL abort_physic(modname, 'Only 2 or 3 water phases allowed ; found nqo='//TRIM(int2str(nqo)), 1)
-      ALLOCATE(hadv(nqtrue), hadv_inca(nqINCA), conv_flg_inca(nqINCA), solsym_inca(nqINCA))
-      ALLOCATE(vadv(nqtrue), vadv_inca(nqINCA),  pbl_flg_inca(nqINCA))
-      CALL init_transport(solsym_inca, conv_flg_inca, pbl_flg_inca, hadv_inca, vadv_inca)
-      ALLOCATE(ttr(nqtrue))
-      ttr(1:nqo+nqCO2)                  = tracers
-      ttr(1    :      nqo   )%component = 'lmdz'
-      ttr(1+nqo:nqCO2+nqo   )%component = 'co2i'
-      ttr(1+nqo+nqCO2:nqtrue)%component = 'inca'
-      ttr(1+nqo      :nqtrue)%name      = [('CO2     ', k=1, nqCO2), solsym_inca]
-      ttr(1+nqo+nqCO2:nqtrue)%parent    = tran0
-      ttr(1+nqo+nqCO2:nqtrue)%phase     = 'g'
-      lerr = getKey('hadv', had, ky=tracers(:)%keys)
-      lerr = getKey('vadv', vad, ky=tracers(:)%keys)
-      hadv(1:nqo+nqCO2) = had(:); hadv(1+nqo+nqCO2:nqtrue) = hadv_inca
-      vadv(1:nqo+nqCO2) = vad(:); vadv(1+nqo+nqCO2:nqtrue) = vadv_inca
-      CALL MOVE_ALLOC(FROM=ttr, TO=tracers)
-      DO iq = 1, nqtrue
-         t1 => tracers(iq)
-         CALL addKey('name',      t1%name,      t1%keys)
-         CALL addKey('component', t1%component, t1%keys)
-         CALL addKey('parent',    t1%parent,    t1%keys)
-         CALL addKey('phase',     t1%phase,     t1%keys)
-      END DO
-      IF(setGeneration(tracers)) CALL abort_physic(modname,'See below',1) !- SET FIELDS %iGeneration, %gen0Name
-      DEALLOCATE(had, hadv_inca, vad, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca)
-   END IF
-   !---------------------------------------------------------------------------------------------------------------------------
-   ELSE                                                              !=== OTHER CASES (OLD OR NEW FORMAT, NO INCA MODULE)
-   !---------------------------------------------------------------------------------------------------------------------------
-      nqo    =        COUNT(delPhase(tracers(:)%name)     == 'H2O' &
-                               .AND. tracers(:)%component == 'lmdz') !--- Number of water phases
+    END IF
+    !##############################################################################################################################
+
+    !---------------------------------------------------------------------------------------------------------------------------
+    IF(fType == 0) CALL abort_physic(modname, 'Missing tracers file: "traceur.def", "tracer.def" or "tracer_<keyword>.def file.', 1)
+    !---------------------------------------------------------------------------------------------------------------------------
+    IF(fType == 1 .AND. ANY(['inca', 'inco']==type_trac) .AND. lInit) THEN  !=== FOUND OLD STYLE INCA "traceur.def"
+      !---------------------------------------------------------------------------------------------------------------------------
+      IF (CPPKEY_INCA) THEN
+        nqo = SIZE(tracers) - nqCO2
+        CALL Init_chem_inca_trac(nqINCA)                               !--- Get nqINCA from INCA
+        nbtr = nqINCA + nqCO2                                          !--- Number of tracers passed to phytrac
+        nqtrue = nbtr + nqo                                            !--- Total number of "true" tracers
+        IF(ALL([2, 3] /= nqo)) CALL abort_physic(modname, 'Only 2 or 3 water phases allowed ; found nqo=' // TRIM(int2str(nqo)), 1)
+        ALLOCATE(hadv(nqtrue), hadv_inca(nqINCA), conv_flg_inca(nqINCA), solsym_inca(nqINCA))
+        ALLOCATE(vadv(nqtrue), vadv_inca(nqINCA), pbl_flg_inca(nqINCA))
+        CALL init_transport(solsym_inca, conv_flg_inca, pbl_flg_inca, hadv_inca, vadv_inca)
+        ALLOCATE(ttr(nqtrue))
+        ttr(1:nqo + nqCO2) = tracers
+        ttr(1:nqo)%component = 'lmdz'
+        ttr(1 + nqo:nqCO2 + nqo)%component = 'co2i'
+        ttr(1 + nqo + nqCO2:nqtrue)%component = 'inca'
+        ttr(1 + nqo:nqtrue)%name = [('CO2     ', k = 1, nqCO2), solsym_inca]
+        ttr(1 + nqo + nqCO2:nqtrue)%parent = tran0
+        ttr(1 + nqo + nqCO2:nqtrue)%phase = 'g'
+        lerr = getKey('hadv', had, ky = tracers(:)%keys)
+        lerr = getKey('vadv', vad, ky = tracers(:)%keys)
+        hadv(1:nqo + nqCO2) = had(:); hadv(1 + nqo + nqCO2:nqtrue) = hadv_inca
+        vadv(1:nqo + nqCO2) = vad(:); vadv(1 + nqo + nqCO2:nqtrue) = vadv_inca
+        CALL MOVE_ALLOC(FROM = ttr, TO = tracers)
+        DO iq = 1, nqtrue
+          t1 => tracers(iq)
+          CALL addKey('name', t1%name, t1%keys)
+          CALL addKey('component', t1%component, t1%keys)
+          CALL addKey('parent', t1%parent, t1%keys)
+          CALL addKey('phase', t1%phase, t1%keys)
+        END DO
+        IF(setGeneration(tracers)) CALL abort_physic(modname, 'See below', 1) !- SET FIELDS %iGeneration, %gen0Name
+        DEALLOCATE(had, hadv_inca, vad, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca)
+      END IF
+      !---------------------------------------------------------------------------------------------------------------------------
+    ELSE                                                              !=== OTHER CASES (OLD OR NEW FORMAT, NO INCA MODULE)
+      !---------------------------------------------------------------------------------------------------------------------------
+      nqo = COUNT(delPhase(tracers(:)%name)     == 'H2O' &
+              .AND. tracers(:)%component == 'lmdz') !--- Number of water phases
       nqtrue = SIZE(tracers)                                         !--- Total number of "true" tracers
-      nbtr   = nqtrue-COUNT(delPhase(tracers(:)%gen0Name) == 'H2O' &
-                               .AND. tracers(:)%component == 'lmdz') !--- Number of tracers passed to phytrac
-   IF (CPPKEY_INCA) THEN
-      nqINCA = COUNT(tracers(:)%component == 'inca')
-   END IF
-      lerr = getKey('hadv', hadv, ky=tracers(:)%keys)
-      lerr = getKey('vadv', vadv, ky=tracers(:)%keys)
-   !---------------------------------------------------------------------------------------------------------------------------
-   END IF
-   !---------------------------------------------------------------------------------------------------------------------------
-
-   !--- Transfert the number of tracers to Reprobus
+      nbtr = nqtrue - COUNT(delPhase(tracers(:)%gen0Name) == 'H2O' &
+              .AND. tracers(:)%component == 'lmdz') !--- Number of tracers passed to phytrac
+      IF (CPPKEY_INCA) THEN
+        nqINCA = COUNT(tracers(:)%component == 'inca')
+      END IF
+      lerr = getKey('hadv', hadv, ky = tracers(:)%keys)
+      lerr = getKey('vadv', vadv, ky = tracers(:)%keys)
+      !---------------------------------------------------------------------------------------------------------------------------
+    END IF
+    !---------------------------------------------------------------------------------------------------------------------------
+
+    !--- Transfert the number of tracers to Reprobus
 #ifdef REPROBUS
    CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name)
 #endif
 
-!##############################################################################################################################
-   IF(lInit) THEN                                                    !=== SKIPED IF ALREADY DONE IN dyn3d_common/infotrac  ####
-!##############################################################################################################################
-
-!==============================================================================================================================
-! 2) Calculate nqtot, number of tracers needed (greater if advection schemes 20 or 30 have been chosen).
-!==============================================================================================================================
-   DO iq = 1, nqtrue
-      IF( hadv(iq)<20 .OR. (ANY(hadv(iq)==[20,30]) .AND. hadv(iq)==vadv(iq)) ) CYCLE
-      WRITE(msg1,'("The choice hadv=",i0,", vadv=",i0,a)')hadv(iq),vadv(iq),' for "'//TRIM(tracers(iq)%name)//'" is not available'
-      CALL abort_physic(modname, TRIM(msg1), 1)
-   END DO
-   nqtot =    COUNT( hadv< 20 .AND. vadv< 20 ) &                     !--- No additional tracer
-         +  4*COUNT( hadv==20 .AND. vadv==20 ) &                     !--- 3  additional tracers
-         + 10*COUNT( hadv==30 .AND. vadv==30 )                       !--- 9  additional tracers
-
-   !--- More tracers due to the choice of advection scheme => assign total number of tracers
-   IF( nqtot /= nqtrue ) THEN
-      CALL msg('The choice of advection scheme for one or more tracers makes it necessary to add tracers')
-      CALL msg('The number of true tracers is '//TRIM(int2str(nqtrue)))
-      CALL msg('The total number of tracers needed is '//TRIM(int2str(nqtot)))
-   END IF
-
-!==============================================================================================================================
-! 3) Determine the advection scheme ; needed to compute the full tracers list, the long names, nqtot and %isAdvected
-!==============================================================================================================================
-   ALLOCATE(ttr(nqtot))
-   jq = nqtrue+1; tracers(:)%iadv = -1
-   DO iq = 1, nqtrue
-      t1 => tracers(iq)
-
-      !--- VERIFY THE CHOICE OF ADVECTION SCHEME
-      iad = -1
-      IF(hadv(iq)     ==    vadv(iq)    ) iad = hadv(iq)
-      IF(hadv(iq)==10 .AND. vadv(iq)==16) iad = 11
-      WRITE(msg1,'("Bad choice of advection scheme for ",a,": hadv = ",i0,", vadv = ",i0)')TRIM(t1%name), hadv(iq), vadv(iq)
-      IF(iad == -1) CALL abort_physic(modname, msg1, 1)
-
-      !--- SET FIELDS %longName, %isAdvected, %isInPhysics
-      t1%longName   = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad)
-      t1%isAdvected = iad >= 0
-      t1%isInPhysics= delPhase(t1%gen0Name) /= 'H2O' &
-                          .OR. t1%component /= 'lmdz' !=== OTHER EXCEPTIONS TO BE ADDED: CO2i, SURSATURATED WATER CLOUD...
-      ttr(iq)       = t1
-
-      !--- DEFINE THE HIGHER ORDER TRACERS, IF ANY
-      nm = 0
-      IF(iad == 20) nm = 3                                           !--- 2nd order scheme
-      IF(iad == 30) nm = 9                                           !--- 3rd order scheme
-      IF(nm == 0) CYCLE                                              !--- No higher moments
-      ttr(jq+1:jq+nm)             = t1
-      ttr(jq+1:jq+nm)%name        = [(TRIM(t1%name)    //'-'//TRIM(suff(im)), im=1, nm) ]
-      ttr(jq+1:jq+nm)%parent      = [(TRIM(t1%parent)  //'-'//TRIM(suff(im)), im=1, nm) ]
-      ttr(jq+1:jq+nm)%longName    = [(TRIM(t1%longName)//'-'//TRIM(suff(im)), im=1, nm) ]
-      ttr(jq+1:jq+nm)%isAdvected  = [(.FALSE., im=1, nm) ]
-      jq = jq + nm
-   END DO
-   DEALLOCATE(hadv, vadv)
-   CALL MOVE_ALLOC(FROM=ttr, TO=tracers)
-
-   !--- SET FIELDS %iqParent, %nqChildren, %iGeneration, %iqDescen, %nqDescen
-   IF(indexUpdate(tracers)) CALL abort_gcm(modname, 'problem when processing isotopes parameters', 1)
-
-!##############################################################################################################################
-   END IF
-!##############################################################################################################################
-
-!##############################################################################################################################
-   IF(.NOT.lInit) THEN
-!##############################################################################################################################
-     nqtot = SIZE(tracers)
-!##############################################################################################################################
-   ELSE
-!##############################################################################################################################
-
-   !=== READ PHYSICAL PARAMETERS FOR ISOTOPES
-   niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE.
-   IF(processIsotopes()) CALL abort_physic(modname, 'Problem when processing isotopes parameters', 1)
-
-!##############################################################################################################################
-   END IF
-!##############################################################################################################################
-   !--- Convection / boundary layer activation for all tracers
-   IF (.NOT.ALLOCATED(conv_flg)) ALLOCATE(conv_flg(nbtr)); conv_flg(1:nbtr) = 1
-   IF (.NOT.ALLOCATED(pbl_flg)) ALLOCATE( pbl_flg(nbtr));  pbl_flg(1:nbtr) = 1
-
-   !--- Note: nqtottr can differ from nbtr when nmom/=0
-   nqtottr = nqtot - COUNT(delPhase(tracers%gen0Name) == 'H2O' .AND. tracers%component == 'lmdz')
-   IF(COUNT(tracers%iso_iName == 0) - COUNT(delPhase(tracers%name) == 'H2O' .AND. tracers%component == 'lmdz') /= nqtottr) &
-      CALL abort_physic(modname, 'problem with the computation of nqtottr', 1)
-
-   !=== DISPLAY THE RESULTS
-   CALL msg('nqo    = '//TRIM(int2str(nqo)),    modname)
-   CALL msg('nbtr   = '//TRIM(int2str(nbtr)),   modname)
-   CALL msg('nqtrue = '//TRIM(int2str(nqtrue)), modname)
-   CALL msg('nqtot  = '//TRIM(int2str(nqtot)),  modname)
-   CALL msg('niso   = '//TRIM(int2str(niso)),   modname)
-   CALL msg('ntiso  = '//TRIM(int2str(ntiso)),  modname)
-   IF (CPPKEY_INCA) THEN
-      CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
-      CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
-   END IF
-   t => tracers
-   CALL msg('Information stored in infotrac_phy :', modname)
-   IF(dispTable('issssssssiiiiiiii', ['iq  ', 'name', 'lNam', 'g0Nm', 'prnt', 'type', 'phas', 'comp',      &
-                              'isPh', 'iGen', 'iqPr', 'nqDe', 'nqCh', 'iGrp', 'iNam', 'iZon', 'iPha'],     &
-      cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, bool2str(t%isInPhysics)),&
-      cat([(iq, iq=1, nqtot)], t%iGeneration, t%iqParent, t%nqDescen, t%nqChildren, t%iso_iGroup,          &
-                  t%iso_iName, t%iso_iZone, t%iso_iPhase), nColMax=maxTableWidth, nHead=2, sub=modname))   &
-      CALL abort_physic(modname, "problem with the tracers table content", 1)
-   IF(niso > 0) THEN
-      CALL msg('Where, for isotopes family "'//TRIM(isotope%parent)//'":', modname)
-      CALL msg('  isoKeys%name = '//strStack(isoKeys%name), modname)
-      CALL msg('  isoName = '//strStack(isoName),      modname)
-      CALL msg('  isoZone = '//strStack(isoZone),      modname)
-      CALL msg('  isoPhas = '//TRIM(isoPhas),          modname)
-   ELSE
+    !##############################################################################################################################
+    IF(lInit) THEN                                                    !=== SKIPED IF ALREADY DONE IN dyn3d_common/infotrac  ####
+      !##############################################################################################################################
+
+      !==============================================================================================================================
+      ! 2) Calculate nqtot, number of tracers needed (greater if advection schemes 20 or 30 have been chosen).
+      !==============================================================================================================================
+      DO iq = 1, nqtrue
+        IF(hadv(iq)<20 .OR. (ANY(hadv(iq)==[20, 30]) .AND. hadv(iq)==vadv(iq))) CYCLE
+        WRITE(msg1, '("The choice hadv=",i0,", vadv=",i0,a)')hadv(iq), vadv(iq), ' for "' // TRIM(tracers(iq)%name) // '" is not available'
+        CALL abort_physic(modname, TRIM(msg1), 1)
+      END DO
+      nqtot = COUNT(hadv< 20 .AND. vadv< 20) &                     !--- No additional tracer
+              + 4 * COUNT(hadv==20 .AND. vadv==20) &                     !--- 3  additional tracers
+              + 10 * COUNT(hadv==30 .AND. vadv==30)                       !--- 9  additional tracers
+
+      !--- More tracers due to the choice of advection scheme => assign total number of tracers
+      IF(nqtot /= nqtrue) THEN
+        CALL msg('The choice of advection scheme for one or more tracers makes it necessary to add tracers')
+        CALL msg('The number of true tracers is ' // TRIM(int2str(nqtrue)))
+        CALL msg('The total number of tracers needed is ' // TRIM(int2str(nqtot)))
+      END IF
+
+      !==============================================================================================================================
+      ! 3) Determine the advection scheme ; needed to compute the full tracers list, the long names, nqtot and %isAdvected
+      !==============================================================================================================================
+      ALLOCATE(ttr(nqtot))
+      jq = nqtrue + 1; tracers(:)%iadv = -1
+      DO iq = 1, nqtrue
+        t1 => tracers(iq)
+
+        !--- VERIFY THE CHOICE OF ADVECTION SCHEME
+        iad = -1
+        IF(hadv(iq)     ==    vadv(iq)) iad = hadv(iq)
+        IF(hadv(iq)==10 .AND. vadv(iq)==16) iad = 11
+        WRITE(msg1, '("Bad choice of advection scheme for ",a,": hadv = ",i0,", vadv = ",i0)')TRIM(t1%name), hadv(iq), vadv(iq)
+        IF(iad == -1) CALL abort_physic(modname, msg1, 1)
+
+        !--- SET FIELDS %longName, %isAdvected, %isInPhysics
+        t1%longName = t1%name; IF(iad > 0) t1%longName = TRIM(t1%name) // descrq(iad)
+        t1%isAdvected = iad >= 0
+        t1%isInPhysics = delPhase(t1%gen0Name) /= 'H2O' &
+                .OR. t1%component /= 'lmdz' !=== OTHER EXCEPTIONS TO BE ADDED: CO2i, SURSATURATED WATER CLOUD...
+        ttr(iq) = t1
+
+        !--- DEFINE THE HIGHER ORDER TRACERS, IF ANY
+        nm = 0
+        IF(iad == 20) nm = 3                                           !--- 2nd order scheme
+        IF(iad == 30) nm = 9                                           !--- 3rd order scheme
+        IF(nm == 0) CYCLE                                              !--- No higher moments
+        ttr(jq + 1:jq + nm) = t1
+        ttr(jq + 1:jq + nm)%name = [(TRIM(t1%name) // '-' // TRIM(suff(im)), im = 1, nm) ]
+        ttr(jq + 1:jq + nm)%parent = [(TRIM(t1%parent) // '-' // TRIM(suff(im)), im = 1, nm) ]
+        ttr(jq + 1:jq + nm)%longName = [(TRIM(t1%longName) // '-' // TRIM(suff(im)), im = 1, nm) ]
+        ttr(jq + 1:jq + nm)%isAdvected = [(.FALSE., im = 1, nm) ]
+        jq = jq + nm
+      END DO
+      DEALLOCATE(hadv, vadv)
+      CALL MOVE_ALLOC(FROM = ttr, TO = tracers)
+
+      !--- SET FIELDS %iqParent, %nqChildren, %iGeneration, %iqDescen, %nqDescen
+      IF(indexUpdate(tracers)) CALL abort_gcm(modname, 'problem when processing isotopes parameters', 1)
+
+      !##############################################################################################################################
+    END IF
+    !##############################################################################################################################
+
+    !##############################################################################################################################
+    IF(.NOT.lInit) THEN
+      !##############################################################################################################################
+      nqtot = SIZE(tracers)
+      !##############################################################################################################################
+    ELSE
+      !##############################################################################################################################
+
+      !=== READ PHYSICAL PARAMETERS FOR ISOTOPES
+      niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE.
+      IF(processIsotopes()) CALL abort_physic(modname, 'Problem when processing isotopes parameters', 1)
+
+      !##############################################################################################################################
+    END IF
+    !##############################################################################################################################
+    !--- Convection / boundary layer activation for all tracers
+    IF (.NOT.ALLOCATED(conv_flg)) ALLOCATE(conv_flg(nbtr)); conv_flg(1:nbtr) = 1
+    IF (.NOT.ALLOCATED(pbl_flg)) ALLOCATE(pbl_flg(nbtr));  pbl_flg(1:nbtr) = 1
+
+    !--- Note: nqtottr can differ from nbtr when nmom/=0
+    nqtottr = nqtot - COUNT(delPhase(tracers%gen0Name) == 'H2O' .AND. tracers%component == 'lmdz')
+    IF(COUNT(tracers%iso_iName == 0) - COUNT(delPhase(tracers%name) == 'H2O' .AND. tracers%component == 'lmdz') /= nqtottr) &
+            CALL abort_physic(modname, 'problem with the computation of nqtottr', 1)
+
+    !=== DISPLAY THE RESULTS
+    CALL msg('nqo    = ' // TRIM(int2str(nqo)), modname)
+    CALL msg('nbtr   = ' // TRIM(int2str(nbtr)), modname)
+    CALL msg('nqtrue = ' // TRIM(int2str(nqtrue)), modname)
+    CALL msg('nqtot  = ' // TRIM(int2str(nqtot)), modname)
+    CALL msg('niso   = ' // TRIM(int2str(niso)), modname)
+    CALL msg('ntiso  = ' // TRIM(int2str(ntiso)), modname)
+    IF (CPPKEY_INCA) THEN
+      CALL msg('nqCO2  = ' // TRIM(int2str(nqCO2)), modname)
+      CALL msg('nqINCA = ' // TRIM(int2str(nqINCA)), modname)
+    END IF
+    t => tracers
+    CALL msg('Information stored in infotrac_phy :', modname)
+    IF(dispTable('issssssssiiiiiiii', ['iq  ', 'name', 'lNam', 'g0Nm', 'prnt', 'type', 'phas', 'comp', &
+            'isPh', 'iGen', 'iqPr', 'nqDe', 'nqCh', 'iGrp', 'iNam', 'iZon', 'iPha'], &
+            cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, bool2str(t%isInPhysics)), &
+            cat([(iq, iq = 1, nqtot)], t%iGeneration, t%iqParent, t%nqDescen, t%nqChildren, t%iso_iGroup, &
+                    t%iso_iName, t%iso_iZone, t%iso_iPhase), nColMax = maxTableWidth, nHead = 2, sub = modname))   &
+            CALL abort_physic(modname, "problem with the tracers table content", 1)
+    IF(niso > 0) THEN
+      CALL msg('Where, for isotopes family "' // TRIM(isotope%parent) // '":', modname)
+      CALL msg('  isoKeys%name = ' // strStack(isoKeys%name), modname)
+      CALL msg('  isoName = ' // strStack(isoName), modname)
+      CALL msg('  isoZone = ' // strStack(isoZone), modname)
+      CALL msg('  isoPhas = ' // TRIM(isoPhas), modname)
+    ELSE
       CALL msg('No isotopes identified.', modname)
-   END IF
+    END IF
 
 #ifdef ISOVERIF
    CALL msg('iso_iName = '//strStack(int2str(PACK(tracers(:)%iso_iName, MASK=tracers(:)%iso_iGroup==iH2O))), modname)
 #endif
-#ifdef CPP_StratAer
-   IF (type_trac == 'coag') THEN
-      nbtr_bin    = COUNT([(tracers(iq)%name(1:3)=='BIN', iq=1, nqtot)])
-      nbtr_sulgas = COUNT([(tracers(iq)%name(1:3)=='GAS', iq=1, nqtot)])
-      tnames = PACK(tracers(:)%name, MASK=tracers(:)%isInPhysics)
-      id_BIN01_strat = strIdx(tnames, 'BIN01'   )
-      id_OCS_strat   = strIdx(tnames, 'GASOCS'  )
-      id_SO2_strat   = strIdx(tnames, 'GASSO2'  )
-      id_H2SO4_strat = strIdx(tnames, 'GASH2SO4')
-      id_TEST_strat  = strIdx(tnames, 'GASTEST' )
-      CALL msg('nbtr_bin       ='//TRIM(int2str(nbtr_bin      )), modname)
-      CALL msg('nbtr_sulgas    ='//TRIM(int2str(nbtr_sulgas   )), modname)
-      CALL msg('id_BIN01_strat ='//TRIM(int2str(id_BIN01_strat)), modname)
-      CALL msg('id_OCS_strat   ='//TRIM(int2str(id_OCS_strat  )), modname)
-      CALL msg('id_SO2_strat   ='//TRIM(int2str(id_SO2_strat  )), modname)
-      CALL msg('id_H2SO4_strat ='//TRIM(int2str(id_H2SO4_strat)), modname)
-      CALL msg('id_TEST_strat  ='//TRIM(int2str(id_TEST_strat )), modname)
-   END IF
-#endif
-   CALL msg('end', modname)
-
-END SUBROUTINE init_infotrac_phy
+    IF (CPPKEY_STRATAER) THEN
+      IF (type_trac == 'coag') THEN
+        nbtr_bin = COUNT([(tracers(iq)%name(1:3)=='BIN', iq = 1, nqtot)])
+        nbtr_sulgas = COUNT([(tracers(iq)%name(1:3)=='GAS', iq = 1, nqtot)])
+        tnames = PACK(tracers(:)%name, MASK = tracers(:)%isInPhysics)
+        id_BIN01_strat = strIdx(tnames, 'BIN01')
+        id_OCS_strat = strIdx(tnames, 'GASOCS')
+        id_SO2_strat = strIdx(tnames, 'GASSO2')
+        id_H2SO4_strat = strIdx(tnames, 'GASH2SO4')
+        id_TEST_strat = strIdx(tnames, 'GASTEST')
+        CALL msg('nbtr_bin       =' // TRIM(int2str(nbtr_bin)), modname)
+        CALL msg('nbtr_sulgas    =' // TRIM(int2str(nbtr_sulgas)), modname)
+        CALL msg('id_BIN01_strat =' // TRIM(int2str(id_BIN01_strat)), modname)
+        CALL msg('id_OCS_strat   =' // TRIM(int2str(id_OCS_strat)), modname)
+        CALL msg('id_SO2_strat   =' // TRIM(int2str(id_SO2_strat)), modname)
+        CALL msg('id_H2SO4_strat =' // TRIM(int2str(id_H2SO4_strat)), modname)
+        CALL msg('id_TEST_strat  =' // TRIM(int2str(id_TEST_strat)), modname)
+      END IF
+    END IF
+    CALL msg('end', modname)
+
+  END SUBROUTINE init_infotrac_phy
 
 END MODULE infotrac_phy
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ini_csts.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ini_csts.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ini_csts.F90	(revision 5098)
@@ -78,13 +78,7 @@
 !IF (LHOOK) CALL DR_HOOK('INI_CSTS',0,ZHOOK_HANDLE)
 
-!#ifdef SFX_MNH
-!#ifdef MNH_MPI_DOUBLE_PRECISION
 XSURF_TINY    = 1.0e-80
 !#else
-!XSURF_TINY    = TINY    (XSURF_TINY    )
-!#endif
-!#else
 XSURF_TINY    = 1.0e-80
-!#endif
 XSURF_TINY_12 = SQRT    (XSURF_TINY    )
 XSURF_EPSILON = EPSILON (XSURF_EPSILON ) * 10.0
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_yomcst.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_yomcst.f90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_yomcst.f90	(revision 5098)
@@ -0,0 +1,41 @@
+! TODO: REPLACE YOMCST.h ONCE .F -> .f90 !
+
+module lmdz_yomcst
+  ! A1.0 Fundamental constants
+  REAL RPI, RCLUM, RHPLA, RKBOL, RNAVO
+  ! A1.1 Astronomical constants
+  REAL RDAY, REA, REPSM, RSIYEA, RSIDAY, ROMEGA
+  ! A1.1.bis Constantes concernant l'orbite de la Terre:
+  REAL R_ecc, R_peri, R_incl
+  ! A1.2 Geoide
+  REAL RA, RG, R1SA
+  ! A1.3 Radiation
+  !     REAL RSIGMA,RI0
+  REAL RSIGMA
+  ! A1.4 Thermodynamic gas phase
+  REAL RMO3, RMCO2, RMC, RMCH4, RMN2O, RMCFC11, RMCFC12
+  REAL R, RMD, RMV, RD, RV, RCPD, RCPV, RCVD, RCVV
+  REAL RKAPPA, RETV, eps_w
+  ! A1.5,6 Thermodynamic liquid,solid phases
+  REAL RCW, RCS
+  ! A1.7 Thermodynamic transition of phase
+  REAL RLVTT, RLSTT, RLMLT, RTT, RATM
+  ! A1.8 Curve of saturation
+  REAL RESTT, RALPW, RBETW, RGAMW, RALPS, RBETS, RGAMS
+  REAL RALPD, RBETD, RGAMD
+
+  COMMON/YOMCST/RPI, RCLUM, RHPLA, RKBOL, RNAVO                   &
+          , RDAY, REA, REPSM, RSIYEA, RSIDAY, ROMEGA                  &
+          , R_ecc, R_peri, R_incl                                      &
+          , RA, RG, R1SA                                         &
+          , RSIGMA                                                     &
+          , R, RMD, RMV, RD, RV, RCPD                    &
+          , RMO3, RMCO2, RMC, RMCH4, RMN2O, RMCFC11, RMCFC12        &
+          , RCPV, RCVD, RCVV, RKAPPA, RETV, eps_w                    &
+          , RCW, RCS                                                 &
+          , RLVTT, RLSTT, RLMLT, RTT, RATM                           &
+          , RESTT, RALPW, RBETW, RGAMW, RALPS, RBETS, RGAMS            &
+          , RALPD, RBETD, RGAMD
+  !$OMP THREADPRIVATE(/YOMCST/)
+
+end module lmdz_yomcst
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_local_var_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_local_var_mod.F90	(revision 5098)
@@ -2,129 +2,130 @@
 ! $Id$
 !
-      MODULE phys_local_var_mod
-! Variables locales pour effectuer les appels en serie
-!======================================================================
-!
-!
-!======================================================================
-! Declaration des variables
-
-      REAL, SAVE, ALLOCATABLE :: t_seri(:,:), q_seri(:,:)
-      !$OMP THREADPRIVATE(t_seri, q_seri)
-      REAL, SAVE, ALLOCATABLE :: ql_seri(:,:),qs_seri(:,:)
-      !$OMP THREADPRIVATE(ql_seri,qs_seri)
-! SN 15/07/2024 ISO 4D
-      REAL, SAVE, ALLOCATABLE :: qx_seri(:,:,:)
-      !$OMP THREADPRIVATE(qx_seri)
-! SN
-      REAL, SAVE, ALLOCATABLE :: qbs_seri(:,:)
-      !$OMP THREADPRIVATE(qbs_seri)
-      REAL, SAVE, ALLOCATABLE :: u_seri(:,:), v_seri(:,:)
-      !$OMP THREADPRIVATE(u_seri, v_seri)
-      REAL, SAVE, ALLOCATABLE :: rneb_seri(:,:)
-      !$OMP THREADPRIVATE(rneb_seri)
-      REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:,:)
-      !$OMP THREADPRIVATE(d_rneb_dyn)
-      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:),l_mix(:,:,:),wprime(:,:,:)
-      !$OMP THREADPRIVATE(l_mixmin, l_mix, wprime)
-      REAL, SAVE, ALLOCATABLE :: pbl_eps(:,:,:)
-      !$OMP THREADPRIVATE(pbl_eps)
-      REAL, SAVE, ALLOCATABLE :: tke_shear(:,:,:), tke_buoy(:,:,:), tke_trans(:,:,:)
-      !$OMP THREADPRIVATE(tke_shear,tke_buoy,tke_trans)
-      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
-      !$OMP THREADPRIVATE(tr_seri)
-      REAL, SAVE, ALLOCATABLE :: rhcl(:,:)
-      !$OMP THREADPRIVATE(rhcl)
-      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
-      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:,:), d_qs_dyn(:,:), d_qbs_dyn(:,:)
-      !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:), d_qbs_dyn2d(:)
-      !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
-      REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:)
-      !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
-      !$OMP THREADPRIVATE(d_tr_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:),d_q_con_zmasse(:,:)
-      !$OMP THREADPRIVATE(d_t_con,d_q_con,d_q_con_zmasse)
-      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
-      !$OMP THREADPRIVATE(d_u_con,d_v_con)
-      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
-      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
-      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:),d_qi_lsc(:,:)
-      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
-      REAL, SAVE, ALLOCATABLE :: d_t_lwr(:,:),d_t_lw0(:,:),d_t_swr(:,:),d_t_sw0(:,:)
-      !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
-      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
-      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
-      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
-      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
-      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
-      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
-!nrlmd<
-      REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:,:), d_q_ajs_w(:,:)
-      !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
-      REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:,:), d_q_ajs_x(:,:)
-      !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
-!>nrlmd
-      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:),d_ql_eva(:,:),d_qi_eva(:,:)
-      !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
-! SN 15/07/2024 ISO 4D
-      REAL, SAVE, ALLOCATABLE :: d_qx_eva(:,:,:)
-      !$OMP THREADPRIVATE(d_qx_eva)
-! SN
-      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
-      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
-      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
-      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
-      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
-      !$OMP THREADPRIVATE(plul_th,plul_st)
-!tendances dues a oro et lif
-      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
-      !$OMP THREADPRIVATE(d_t_oli)
-      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
-      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
-      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_qbs_vdf(:,:), d_t_diss(:,:)
-      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf, d_qbs_vdf, d_t_diss)
-      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
-      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
-!nrlmd+jyg<
-      REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:,:), d_q_vdf_w(:,:)
-      !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
-      REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:,:), d_q_vdf_x(:,:)
-      !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
-      REAL, SAVE, ALLOCATABLE :: d_t_bsss(:,:), d_q_bsss(:,:), d_qbs_bsss(:,:)
-      !$OMP THREADPRIVATE( d_t_bsss,d_q_bsss, d_qbs_bsss)
-!>nrlmd+jyg
-      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
-      !$OMP THREADPRIVATE(d_t_oro)
-      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
-      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
-      REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:,:)
-      !$OMP THREADPRIVATE(d_t_oro_gw)
-      REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:,:), d_v_oro_gw(:,:)
-      !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
-      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
-      !$OMP THREADPRIVATE(d_t_lif)
-      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
-      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
-! Tendances Ondes de G non oro (runs strato).
-      REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:,:)
-      !$OMP THREADPRIVATE(du_gwd_hines)
-      REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:,:)
-      !$OMP THREADPRIVATE(dv_gwd_hines)
-      REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:,:)
-      !$OMP THREADPRIVATE(dv_gwd_rando)
-      REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:,:)
-      !$OMP THREADPRIVATE(dv_gwd_front)
-      REAL, SAVE, ALLOCATABLE :: east_gwstress(:,:)
-      !$OMP THREADPRIVATE(east_gwstress)
-      REAL, SAVE, ALLOCATABLE :: west_gwstress(:,:)
-      !$OMP THREADPRIVATE(west_gwstress)
-      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
-      !$OMP THREADPRIVATE(d_t_hin)
-! tendance due a l'oxydation du methane
-      REAL, SAVE, ALLOCATABLE :: d_q_ch4(:,:)
-      !$OMP THREADPRIVATE(d_q_ch4)
+MODULE phys_local_var_mod
+  USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_STRATAER
+  ! Variables locales pour effectuer les appels en serie
+  !======================================================================
+  !
+  !
+  !======================================================================
+  ! Declaration des variables
+
+  REAL, SAVE, ALLOCATABLE :: t_seri(:, :), q_seri(:, :)
+  !$OMP THREADPRIVATE(t_seri, q_seri)
+  REAL, SAVE, ALLOCATABLE :: ql_seri(:, :), qs_seri(:, :)
+  !$OMP THREADPRIVATE(ql_seri,qs_seri)
+  ! SN 15/07/2024 ISO 4D
+  REAL, SAVE, ALLOCATABLE :: qx_seri(:, :, :)
+  !$OMP THREADPRIVATE(qx_seri)
+  ! SN
+  REAL, SAVE, ALLOCATABLE :: qbs_seri(:, :)
+  !$OMP THREADPRIVATE(qbs_seri)
+  REAL, SAVE, ALLOCATABLE :: u_seri(:, :), v_seri(:, :)
+  !$OMP THREADPRIVATE(u_seri, v_seri)
+  REAL, SAVE, ALLOCATABLE :: rneb_seri(:, :)
+  !$OMP THREADPRIVATE(rneb_seri)
+  REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:, :)
+  !$OMP THREADPRIVATE(d_rneb_dyn)
+  REAL, SAVE, ALLOCATABLE :: l_mixmin(:, :, :), l_mix(:, :, :), wprime(:, :, :)
+  !$OMP THREADPRIVATE(l_mixmin, l_mix, wprime)
+  REAL, SAVE, ALLOCATABLE :: pbl_eps(:, :, :)
+  !$OMP THREADPRIVATE(pbl_eps)
+  REAL, SAVE, ALLOCATABLE :: tke_shear(:, :, :), tke_buoy(:, :, :), tke_trans(:, :, :)
+  !$OMP THREADPRIVATE(tke_shear,tke_buoy,tke_trans)
+  REAL, SAVE, ALLOCATABLE :: tr_seri(:, :, :)
+  !$OMP THREADPRIVATE(tr_seri)
+  REAL, SAVE, ALLOCATABLE :: rhcl(:, :)
+  !$OMP THREADPRIVATE(rhcl)
+  REAL, SAVE, ALLOCATABLE :: d_t_dyn(:, :), d_q_dyn(:, :)
+  !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:, :), d_qs_dyn(:, :), d_qbs_dyn(:, :)
+  !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:), d_qbs_dyn2d(:)
+  !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
+  REAL, SAVE, ALLOCATABLE :: d_u_dyn(:, :), d_v_dyn(:, :)
+  !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:, :, :)
+  !$OMP THREADPRIVATE(d_tr_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_t_con(:, :), d_q_con(:, :), d_q_con_zmasse(:, :)
+  !$OMP THREADPRIVATE(d_t_con,d_q_con,d_q_con_zmasse)
+  REAL, SAVE, ALLOCATABLE :: d_u_con(:, :), d_v_con(:, :)
+  !$OMP THREADPRIVATE(d_u_con,d_v_con)
+  REAL, SAVE, ALLOCATABLE :: d_t_wake(:, :), d_q_wake(:, :)
+  !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
+  REAL, SAVE, ALLOCATABLE :: d_t_lsc(:, :), d_q_lsc(:, :), d_ql_lsc(:, :), d_qi_lsc(:, :)
+  !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
+  REAL, SAVE, ALLOCATABLE :: d_t_lwr(:, :), d_t_lw0(:, :), d_t_swr(:, :), d_t_sw0(:, :)
+  !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
+  REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:, :), d_q_ajsb(:, :)
+  !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
+  REAL, SAVE, ALLOCATABLE :: d_t_ajs(:, :), d_q_ajs(:, :)
+  !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
+  REAL, SAVE, ALLOCATABLE :: d_u_ajs(:, :), d_v_ajs(:, :)
+  !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
+  !nrlmd<
+  REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:, :), d_q_ajs_w(:, :)
+  !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
+  REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:, :), d_q_ajs_x(:, :)
+  !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
+  !>nrlmd
+  REAL, SAVE, ALLOCATABLE :: d_t_eva(:, :), d_q_eva(:, :), d_ql_eva(:, :), d_qi_eva(:, :)
+  !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
+  ! SN 15/07/2024 ISO 4D
+  REAL, SAVE, ALLOCATABLE :: d_qx_eva(:, :, :)
+  !$OMP THREADPRIVATE(d_qx_eva)
+  ! SN
+  REAL, SAVE, ALLOCATABLE :: d_t_lscst(:, :), d_q_lscst(:, :)
+  !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
+  REAL, SAVE, ALLOCATABLE :: d_t_lscth(:, :), d_q_lscth(:, :)
+  !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
+  REAL, SAVE, ALLOCATABLE :: plul_th(:), plul_st(:)
+  !$OMP THREADPRIVATE(plul_th,plul_st)
+  !tendances dues a oro et lif
+  REAL, SAVE, ALLOCATABLE :: d_t_oli(:, :)
+  !$OMP THREADPRIVATE(d_t_oli)
+  REAL, SAVE, ALLOCATABLE :: d_u_oli(:, :), d_v_oli(:, :)
+  !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
+  REAL, SAVE, ALLOCATABLE :: d_t_vdf(:, :), d_q_vdf(:, :), d_qbs_vdf(:, :), d_t_diss(:, :)
+  !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf, d_qbs_vdf, d_t_diss)
+  REAL, SAVE, ALLOCATABLE :: d_u_vdf(:, :), d_v_vdf(:, :)
+  !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
+  !nrlmd+jyg<
+  REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:, :), d_q_vdf_w(:, :)
+  !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
+  REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:, :), d_q_vdf_x(:, :)
+  !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
+  REAL, SAVE, ALLOCATABLE :: d_t_bsss(:, :), d_q_bsss(:, :), d_qbs_bsss(:, :)
+  !$OMP THREADPRIVATE( d_t_bsss,d_q_bsss, d_qbs_bsss)
+  !>nrlmd+jyg
+  REAL, SAVE, ALLOCATABLE :: d_t_oro(:, :)
+  !$OMP THREADPRIVATE(d_t_oro)
+  REAL, SAVE, ALLOCATABLE :: d_u_oro(:, :), d_v_oro(:, :)
+  !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
+  REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:, :)
+  !$OMP THREADPRIVATE(d_t_oro_gw)
+  REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:, :), d_v_oro_gw(:, :)
+  !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
+  REAL, SAVE, ALLOCATABLE :: d_t_lif(:, :)
+  !$OMP THREADPRIVATE(d_t_lif)
+  REAL, SAVE, ALLOCATABLE :: d_u_lif(:, :), d_v_lif(:, :)
+  !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
+  ! Tendances Ondes de G non oro (runs strato).
+  REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:, :)
+  !$OMP THREADPRIVATE(du_gwd_hines)
+  REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:, :)
+  !$OMP THREADPRIVATE(dv_gwd_hines)
+  REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:, :)
+  !$OMP THREADPRIVATE(dv_gwd_rando)
+  REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:, :)
+  !$OMP THREADPRIVATE(dv_gwd_front)
+  REAL, SAVE, ALLOCATABLE :: east_gwstress(:, :)
+  !$OMP THREADPRIVATE(east_gwstress)
+  REAL, SAVE, ALLOCATABLE :: west_gwstress(:, :)
+  !$OMP THREADPRIVATE(west_gwstress)
+  REAL, SAVE, ALLOCATABLE :: d_t_hin(:, :)
+  !$OMP THREADPRIVATE(d_t_hin)
+  ! tendance due a l'oxydation du methane
+  REAL, SAVE, ALLOCATABLE :: d_q_ch4(:, :)
+  !$OMP THREADPRIVATE(d_q_ch4)
 #ifdef ISO
       REAL, SAVE, ALLOCATABLE :: xt_seri(:,:,:)
@@ -172,191 +173,191 @@
 #endif
 
-! tendance du a la conersion Ec -> E thermique
-      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
-      !$OMP THREADPRIVATE(d_t_ec)
-      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
-      !$OMP THREADPRIVATE(d_ts, d_tr)
-
-! diagnostique pour le rayonnement
-      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
-      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
-      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
-      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
-      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
-      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
-      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
-      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
-      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
-      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
-      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
-      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
-! LW radiation diagnostics CK
-      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
-      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
-      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
-      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
-      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
-      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
-! Special RRTM
-      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
-      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
-      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
-      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
-      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
-      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
-!
-      REAL, SAVE, ALLOCATABLE :: stratomask(:,:) 
-      !$OMP THREADPRIVATE(stratomask) 
-      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:) 
-      !$OMP THREADPRIVATE(tausum_aero) 
-      REAL, SAVE, ALLOCATABLE :: drytausum_aero(:,:) 
-      !$OMP THREADPRIVATE(drytausum_aero) 
-      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:) 
-      !$OMP THREADPRIVATE(tau3d_aero) 
-      REAL, SAVE, ALLOCATABLE :: dNovrN(:) 
-      !$OMP THREADPRIVATE(dNovrN) 
-      REAL, SAVE, ALLOCATABLE :: zfice(:,:)
-      !$OMP THREADPRIVATE(zfice)
-      REAL, SAVE, ALLOCATABLE :: od443aer(:) 
-      !$OMP THREADPRIVATE(od443aer) 
-      REAL, SAVE, ALLOCATABLE :: od550aer(:) 
-      !$OMP THREADPRIVATE(od550aer) 
-      REAL, SAVE, ALLOCATABLE :: dryod550aer(:) 
-      !$OMP THREADPRIVATE(dryod550aer) 
-      REAL, SAVE, ALLOCATABLE :: abs550aer(:) 
-      !$OMP THREADPRIVATE(abs550aer) 
-      REAL, SAVE, ALLOCATABLE :: od865aer(:) 
-      !$OMP THREADPRIVATE(od865aer) 
-      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:) 
-      !$OMP THREADPRIVATE(ec550aer) 
-      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:) 
-      !$OMP THREADPRIVATE(od550lt1aer) 
-      REAL, SAVE, ALLOCATABLE :: sconcso4(:) 
-      !$OMP THREADPRIVATE(sconcso4) 
-      REAL, SAVE, ALLOCATABLE :: sconcno3(:) 
-      !$OMP THREADPRIVATE(sconcno3) 
-      REAL, SAVE, ALLOCATABLE :: sconcoa(:) 
-      !$OMP THREADPRIVATE(sconcoa) 
-      REAL, SAVE, ALLOCATABLE :: sconcbc(:) 
-      !$OMP THREADPRIVATE(sconcbc) 
-      REAL, SAVE, ALLOCATABLE :: sconcss(:) 
-      !$OMP THREADPRIVATE(sconcss) 
-      REAL, SAVE, ALLOCATABLE :: sconcdust(:) 
-      !$OMP THREADPRIVATE(sconcdust) 
-      REAL, SAVE, ALLOCATABLE :: concso4(:,:) 
-      !$OMP THREADPRIVATE(concso4) 
-      REAL, SAVE, ALLOCATABLE :: concno3(:,:) 
-      !$OMP THREADPRIVATE(concno3) 
-      REAL, SAVE, ALLOCATABLE :: concoa(:,:) 
-      !$OMP THREADPRIVATE(concoa) 
-      REAL, SAVE, ALLOCATABLE :: concbc(:,:) 
-      !$OMP THREADPRIVATE(concbc) 
-      REAL, SAVE, ALLOCATABLE :: concss(:,:) 
-      !$OMP THREADPRIVATE(concss) 
-      REAL, SAVE, ALLOCATABLE :: concdust(:,:) 
-      !$OMP THREADPRIVATE(concdust) 
-      REAL, SAVE, ALLOCATABLE :: loadso4(:) 
-      !$OMP THREADPRIVATE(loadso4) 
-      REAL, SAVE, ALLOCATABLE :: loadoa(:) 
-      !$OMP THREADPRIVATE(loadoa) 
-      REAL, SAVE, ALLOCATABLE :: loadbc(:) 
-      !$OMP THREADPRIVATE(loadbc) 
-      REAL, SAVE, ALLOCATABLE :: loadss(:) 
-      !$OMP THREADPRIVATE(loadss) 
-      REAL, SAVE, ALLOCATABLE :: loaddust(:) 
-      !$OMP THREADPRIVATE(loaddust) 
-      REAL, SAVE, ALLOCATABLE :: loadno3(:) 
-      !$OMP THREADPRIVATE(loadno3) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp1(:), load_tmp2(:)
-      !$OMP THREADPRIVATE(load_tmp1, load_tmp2) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp3(:), load_tmp4(:)
-      !$OMP THREADPRIVATE(load_tmp3, load_tmp4) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp5(:), load_tmp6(:)
-      !$OMP THREADPRIVATE(load_tmp5, load_tmp6) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp7(:), load_tmp8(:)
-      !$OMP THREADPRIVATE(load_tmp7, load_tmp8) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp9(:), load_tmp10(:)
-      !$OMP THREADPRIVATE(load_tmp9, load_tmp10) 
-
-!IM ajout variables CFMIP2/CMIP5
-      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
-!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
-      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
-!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
-      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
-!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
-      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:)  
-!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
-      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
-!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
-      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
-!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
-
-! additional LW variables CK
-      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
-!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
-      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
-!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
-      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
-!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
-
-!AI 08 2023 ajout pour Ecrad
-      REAL,ALLOCATABLE,SAVE :: topswad_aero_s2(:), solswad_aero_s2(:)
-!$OMP THREADPRIVATE(topswad_aero_s2, solswad_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topswai_aero_s2(:), solswai_aero_s2(:)
-!$OMP THREADPRIVATE(topswai_aero_s2, solswai_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topswad0_aero_s2(:), solswad0_aero_s2(:)
-!$OMP THREADPRIVATE(topswad0_aero_s2, solswad0_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topsw_aero_s2(:,:), topsw0_aero_s2(:,:)
-!$OMP THREADPRIVATE(topsw_aero_s2, topsw0_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: solsw_aero_s2(:,:), solsw0_aero_s2(:,:)
-!$OMP THREADPRIVATE(solsw_aero_s2, solsw0_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topswcf_aero_s2(:,:), solswcf_aero_s2(:,:)
-!$OMP THREADPRIVATE(topswcf_aero_s2, solswcf_aero_s2)
-! additional LW variables CK
-      REAL,ALLOCATABLE,SAVE :: toplwad_aero_s2(:), sollwad_aero_s2(:)
-!$OMP THREADPRIVATE(toplwad_aero_s2, sollwad_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: toplwai_aero_s2(:), sollwai_aero_s2(:)
-!$OMP THREADPRIVATE(toplwai_aero_s2, sollwai_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: toplwad0_aero_s2(:), sollwad0_aero_s2(:)
-!$OMP THREADPRIVATE(toplwad0_aero_s2, sollwad0_aero_s2)
-
-!Ajout de celles n??cessaires au phys_output_write_mod
-      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
-!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
-      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
-!$OMP THREADPRIVATE(ptstar, pt0, slp)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp 
-!$OMP THREADPRIVATE(sens, flwp, fiwp)
-!!
-!FC 
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxfluxt, zxfluxq
-!$OMP THREADPRIVATE(zxfluxt, zxfluxq)
-!FC
-!!         Wake variables
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: alp_wake
-!$OMP THREADPRIVATE(alp_wake)           
-!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
-      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:)         :: wake_k
-!$OMP THREADPRIVATE(wake_h,wake_k)                       
-    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
-!$OMP THREADPRIVATE(wake_omg)                     
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
-!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk
-!$OMP THREADPRIVATE(d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
-!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
-!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
-!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
-!!!$OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
-!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
-!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
-!!!$OMP THREADPRIVATE(d_s_the, d_dens_the)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
-!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
+  ! tendance du a la conersion Ec -> E thermique
+  REAL, SAVE, ALLOCATABLE :: d_t_ec(:, :)
+  !$OMP THREADPRIVATE(d_t_ec)
+  REAL, SAVE, ALLOCATABLE :: d_ts(:, :), d_tr(:, :, :)
+  !$OMP THREADPRIVATE(d_ts, d_tr)
+
+  ! diagnostique pour le rayonnement
+  REAL, SAVE, ALLOCATABLE :: topswad_aero(:), solswad_aero(:)      ! diag
+  !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
+  REAL, SAVE, ALLOCATABLE :: topswai_aero(:), solswai_aero(:)      ! diag
+  !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
+  REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
+  !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
+  REAL, SAVE, ALLOCATABLE :: topsw_aero(:, :), solsw_aero(:, :)      ! diag
+  !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
+  REAL, SAVE, ALLOCATABLE :: topsw0_aero(:, :), solsw0_aero(:, :)     ! diag
+  !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
+  REAL, SAVE, ALLOCATABLE :: topswcf_aero(:, :), solswcf_aero(:, :)  ! diag
+  !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
+  ! LW radiation diagnostics CK
+  REAL, SAVE, ALLOCATABLE :: toplwad_aero(:), sollwad_aero(:)      ! diag
+  !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
+  REAL, SAVE, ALLOCATABLE :: toplwai_aero(:), sollwai_aero(:)      ! diag
+  !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
+  REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
+  !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
+  ! Special RRTM
+  REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:, :), ZSWFT0_i(:, :)      ! diag
+  !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
+  REAL, SAVE, ALLOCATABLE :: ZFLDN0(:, :), ZFLUP0(:, :)      ! diag
+  !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
+  REAL, SAVE, ALLOCATABLE :: ZFSDN0(:, :), ZFSUP0(:, :)      ! diag
+  !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
+  !
+  REAL, SAVE, ALLOCATABLE :: stratomask(:, :)
+  !$OMP THREADPRIVATE(stratomask)
+  REAL, SAVE, ALLOCATABLE :: tausum_aero(:, :, :)
+  !$OMP THREADPRIVATE(tausum_aero)
+  REAL, SAVE, ALLOCATABLE :: drytausum_aero(:, :)
+  !$OMP THREADPRIVATE(drytausum_aero)
+  REAL, SAVE, ALLOCATABLE :: tau3d_aero(:, :, :, :)
+  !$OMP THREADPRIVATE(tau3d_aero)
+  REAL, SAVE, ALLOCATABLE :: dNovrN(:)
+  !$OMP THREADPRIVATE(dNovrN)
+  REAL, SAVE, ALLOCATABLE :: zfice(:, :)
+  !$OMP THREADPRIVATE(zfice)
+  REAL, SAVE, ALLOCATABLE :: od443aer(:)
+  !$OMP THREADPRIVATE(od443aer)
+  REAL, SAVE, ALLOCATABLE :: od550aer(:)
+  !$OMP THREADPRIVATE(od550aer)
+  REAL, SAVE, ALLOCATABLE :: dryod550aer(:)
+  !$OMP THREADPRIVATE(dryod550aer)
+  REAL, SAVE, ALLOCATABLE :: abs550aer(:)
+  !$OMP THREADPRIVATE(abs550aer)
+  REAL, SAVE, ALLOCATABLE :: od865aer(:)
+  !$OMP THREADPRIVATE(od865aer)
+  REAL, SAVE, ALLOCATABLE :: ec550aer(:, :)
+  !$OMP THREADPRIVATE(ec550aer)
+  REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
+  !$OMP THREADPRIVATE(od550lt1aer)
+  REAL, SAVE, ALLOCATABLE :: sconcso4(:)
+  !$OMP THREADPRIVATE(sconcso4)
+  REAL, SAVE, ALLOCATABLE :: sconcno3(:)
+  !$OMP THREADPRIVATE(sconcno3)
+  REAL, SAVE, ALLOCATABLE :: sconcoa(:)
+  !$OMP THREADPRIVATE(sconcoa)
+  REAL, SAVE, ALLOCATABLE :: sconcbc(:)
+  !$OMP THREADPRIVATE(sconcbc)
+  REAL, SAVE, ALLOCATABLE :: sconcss(:)
+  !$OMP THREADPRIVATE(sconcss)
+  REAL, SAVE, ALLOCATABLE :: sconcdust(:)
+  !$OMP THREADPRIVATE(sconcdust)
+  REAL, SAVE, ALLOCATABLE :: concso4(:, :)
+  !$OMP THREADPRIVATE(concso4)
+  REAL, SAVE, ALLOCATABLE :: concno3(:, :)
+  !$OMP THREADPRIVATE(concno3)
+  REAL, SAVE, ALLOCATABLE :: concoa(:, :)
+  !$OMP THREADPRIVATE(concoa)
+  REAL, SAVE, ALLOCATABLE :: concbc(:, :)
+  !$OMP THREADPRIVATE(concbc)
+  REAL, SAVE, ALLOCATABLE :: concss(:, :)
+  !$OMP THREADPRIVATE(concss)
+  REAL, SAVE, ALLOCATABLE :: concdust(:, :)
+  !$OMP THREADPRIVATE(concdust)
+  REAL, SAVE, ALLOCATABLE :: loadso4(:)
+  !$OMP THREADPRIVATE(loadso4)
+  REAL, SAVE, ALLOCATABLE :: loadoa(:)
+  !$OMP THREADPRIVATE(loadoa)
+  REAL, SAVE, ALLOCATABLE :: loadbc(:)
+  !$OMP THREADPRIVATE(loadbc)
+  REAL, SAVE, ALLOCATABLE :: loadss(:)
+  !$OMP THREADPRIVATE(loadss)
+  REAL, SAVE, ALLOCATABLE :: loaddust(:)
+  !$OMP THREADPRIVATE(loaddust)
+  REAL, SAVE, ALLOCATABLE :: loadno3(:)
+  !$OMP THREADPRIVATE(loadno3)
+  REAL, SAVE, ALLOCATABLE :: load_tmp1(:), load_tmp2(:)
+  !$OMP THREADPRIVATE(load_tmp1, load_tmp2)
+  REAL, SAVE, ALLOCATABLE :: load_tmp3(:), load_tmp4(:)
+  !$OMP THREADPRIVATE(load_tmp3, load_tmp4)
+  REAL, SAVE, ALLOCATABLE :: load_tmp5(:), load_tmp6(:)
+  !$OMP THREADPRIVATE(load_tmp5, load_tmp6)
+  REAL, SAVE, ALLOCATABLE :: load_tmp7(:), load_tmp8(:)
+  !$OMP THREADPRIVATE(load_tmp7, load_tmp8)
+  REAL, SAVE, ALLOCATABLE :: load_tmp9(:), load_tmp10(:)
+  !$OMP THREADPRIVATE(load_tmp9, load_tmp10)
+
+  !IM ajout variables CFMIP2/CMIP5
+  REAL, ALLOCATABLE, SAVE :: topswad_aerop(:), solswad_aerop(:)
+  !$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
+  REAL, ALLOCATABLE, SAVE :: topswai_aerop(:), solswai_aerop(:)
+  !$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
+  REAL, ALLOCATABLE, SAVE :: topswad0_aerop(:), solswad0_aerop(:)
+  !$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
+  REAL, ALLOCATABLE, SAVE :: topsw_aerop(:, :), topsw0_aerop(:, :)
+  !$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
+  REAL, ALLOCATABLE, SAVE :: solsw_aerop(:, :), solsw0_aerop(:, :)
+  !$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
+  REAL, ALLOCATABLE, SAVE :: topswcf_aerop(:, :), solswcf_aerop(:, :)
+  !$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
+
+  ! additional LW variables CK
+  REAL, ALLOCATABLE, SAVE :: toplwad_aerop(:), sollwad_aerop(:)
+  !$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
+  REAL, ALLOCATABLE, SAVE :: toplwai_aerop(:), sollwai_aerop(:)
+  !$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
+  REAL, ALLOCATABLE, SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
+  !$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
+
+  !AI 08 2023 ajout pour Ecrad
+  REAL, ALLOCATABLE, SAVE :: topswad_aero_s2(:), solswad_aero_s2(:)
+  !$OMP THREADPRIVATE(topswad_aero_s2, solswad_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topswai_aero_s2(:), solswai_aero_s2(:)
+  !$OMP THREADPRIVATE(topswai_aero_s2, solswai_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topswad0_aero_s2(:), solswad0_aero_s2(:)
+  !$OMP THREADPRIVATE(topswad0_aero_s2, solswad0_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topsw_aero_s2(:, :), topsw0_aero_s2(:, :)
+  !$OMP THREADPRIVATE(topsw_aero_s2, topsw0_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: solsw_aero_s2(:, :), solsw0_aero_s2(:, :)
+  !$OMP THREADPRIVATE(solsw_aero_s2, solsw0_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topswcf_aero_s2(:, :), solswcf_aero_s2(:, :)
+  !$OMP THREADPRIVATE(topswcf_aero_s2, solswcf_aero_s2)
+  ! additional LW variables CK
+  REAL, ALLOCATABLE, SAVE :: toplwad_aero_s2(:), sollwad_aero_s2(:)
+  !$OMP THREADPRIVATE(toplwad_aero_s2, sollwad_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: toplwai_aero_s2(:), sollwai_aero_s2(:)
+  !$OMP THREADPRIVATE(toplwai_aero_s2, sollwai_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: toplwad0_aero_s2(:), sollwad0_aero_s2(:)
+  !$OMP THREADPRIVATE(toplwad0_aero_s2, sollwad0_aero_s2)
+
+  !Ajout de celles n??cessaires au phys_output_write_mod
+  REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
+  !$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
+  REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
+  !$OMP THREADPRIVATE(ptstar, pt0, slp)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sens, flwp, fiwp
+  !$OMP THREADPRIVATE(sens, flwp, fiwp)
+  !!
+  !FC
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: zxfluxt, zxfluxq
+  !$OMP THREADPRIVATE(zxfluxt, zxfluxq)
+  !FC
+  !!         Wake variables
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_wake
+  !$OMP THREADPRIVATE(alp_wake)
+  !!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: wake_h
+  INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) :: wake_k
+  !$OMP THREADPRIVATE(wake_h,wake_k)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wake_omg
+  !$OMP THREADPRIVATE(wake_omg)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_wk, d_deltaq_wk
+  !$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk
+  !$OMP THREADPRIVATE(d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_wk_gw, d_deltaq_wk_gw
+  !$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_vdf, d_deltaq_vdf
+  !$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
+  !!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
+  !!!$OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_the, d_deltaq_the
+  !$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
+  !!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
+  !!!$OMP THREADPRIVATE(d_s_the, d_dens_the)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d_deltat_ajs_cv, d_deltaq_ajs_cv
+  !$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
 #ifdef ISO
     REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          :: d_deltaxt_wk
@@ -371,43 +372,43 @@
 !$OMP THREADPRIVATE(d_deltaxt_ajs_cv)
 #endif                       
-!!         End of Wake variables
-!!
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
-!$OMP THREADPRIVATE(bils)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
-!$OMP THREADPRIVATE(cdragm, cdragh)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
-!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m)
-!AS: cldhjn, cldljn, cldmjn,cldtjn pas utilisés en tant que variables, juste noms de diagnostics
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
-!$OMP THREADPRIVATE(JrNt)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget
-!$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
-!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
-!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
-!
-!nrlmd+jyg<
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
-!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
-!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
-!>nrlmd+jyg
-!
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
-!$OMP THREADPRIVATE(slab_wfbils)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
-!$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxustartlic, zxrhoslic, zxqsaltlic
-!$OMP THREADPRIVATE(zxustartlic, zxrhoslic, zxqsaltlic)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
-!$OMP THREADPRIVATE(zxfqcalving)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
-!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic
-!$OMP THREADPRIVATE(zxrunofflic)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
-!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
+  !!         End of Wake variables
+  !!
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: bils
+  !$OMP THREADPRIVATE(bils)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cdragm, cdragh
+  !$OMP THREADPRIVATE(cdragm, cdragh)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
+  !$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m)
+  !AS: cldhjn, cldljn, cldmjn,cldtjn pas utilisés en tant que variables, juste noms de diagnostics
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: JrNt
+  !$OMP THREADPRIVATE(JrNt)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget
+  !$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
+  !$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
+  !$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
+  !
+  !nrlmd+jyg<
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_pblh_x, s_pblh_w
+  !$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_lcl_x, s_lcl_w
+  !$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
+  !>nrlmd+jyg
+  !
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: slab_wfbils
+  !$OMP THREADPRIVATE(slab_wfbils)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
+  !$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxustartlic, zxrhoslic, zxqsaltlic
+  !$OMP THREADPRIVATE(zxustartlic, zxrhoslic, zxqsaltlic)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxfqcalving
+  !$OMP THREADPRIVATE(zxfqcalving)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
+  !$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxrunofflic
+  !$OMP THREADPRIVATE(zxrunofflic)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
+  !$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
 #ifdef ISO
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtevap,xtprw
@@ -425,41 +426,41 @@
 !$OMP THREADPRIVATE(xtrain_lsc)
 #endif
-!
-!jyg+nrlmd<
-!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-!                                                                          c
-!       Declarations liees a la couche limite differentiee w-x             c
-!                                                                          c
-!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
-!$OMP THREADPRIVATE(sens_x, sens_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
-!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: delta_qsurf
-!$OMP THREADPRIVATE(delta_qsurf)
-!jyg<
-!!! Entrees supplementaires couche-limite
-!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
-!!!$OMP THREADPRIVATE(t_x, t_w)
-!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
-!!!$OMP THREADPRIVATE(q_x, q_w)
-!>jyg
-!!! Sorties ferret
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
-!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
-!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
-! Variables supplementaires dans physiq.F relative au splitting de la surface
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
-!$OMP THREADPRIVATE(pbl_tke_input)
-! Entree supplementaire Thermiques :
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
-!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
-!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
-!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
-!$OMP THREADPRIVATE(kh, kh_x, kh_w)
+  !
+  !jyg+nrlmd<
+  !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+  !                                                                          c
+  !       Declarations liees a la couche limite differentiee w-x             c
+  !                                                                          c
+  !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sens_x, sens_w
+  !$OMP THREADPRIVATE(sens_x, sens_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
+  !$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: delta_qsurf
+  !$OMP THREADPRIVATE(delta_qsurf)
+  !jyg<
+  !!! Entrees supplementaires couche-limite
+  !!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
+  !!!$OMP THREADPRIVATE(t_x, t_w)
+  !!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
+  !!!$OMP THREADPRIVATE(q_x, q_w)
+  !>jyg
+  !!! Sorties ferret
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dtvdf_x, dtvdf_w
+  !$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dqvdf_x, dqvdf_w
+  !$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
+  ! Variables supplementaires dans physiq.F relative au splitting de la surface
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: pbl_tke_input
+  !$OMP THREADPRIVATE(pbl_tke_input)
+  ! Entree supplementaire Thermiques :
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: t_therm, q_therm, u_therm, v_therm
+  !$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cdragh_x, cdragh_w
+  !$OMP THREADPRIVATE(cdragh_x, cdragh_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cdragm_x, cdragm_w
+  !$OMP THREADPRIVATE(cdragm_x, cdragm_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: kh, kh_x, kh_w
+  !$OMP THREADPRIVATE(kh, kh_x, kh_w)
 #ifdef ISO
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: dxtvdf_x, dxtvdf_w
@@ -468,66 +469,66 @@
 !$OMP THREADPRIVATE(xt_therm)
 #endif
-!!!
-!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
-      !$OMP THREADPRIVATE(ptconv)
-      REAL, SAVE, ALLOCATABLE :: ratqsc(:,:)
-      !$OMP THREADPRIVATE(ratqsc)
-!>jyg+nrlmd
+  !!!
+  !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+  LOGICAL, SAVE, ALLOCATABLE :: ptconv(:, :)
+  !$OMP THREADPRIVATE(ptconv)
+  REAL, SAVE, ALLOCATABLE :: ratqsc(:, :)
+  !$OMP THREADPRIVATE(ratqsc)
+  !>jyg+nrlmd
   !
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
-!$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
-!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
-!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
-!$OMP THREADPRIVATE(weak_inversion)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_conv,alp_bl_det
-!$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
-!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2, strig, zcong, zlcl_th
-!$OMP THREADPRIVATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
-!$OMP THREADPRIVATE(proba_notrig, random_notrig)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils
-!$OMP THREADPRIVATE(fsolsw, wfbils)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap
-!$OMP THREADPRIVATE(wfevap)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
-!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
-!$OMP THREADPRIVATE(dnwd0, omega)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
-!$OMP THREADPRIVATE(epmax_diag)
-!
-!  Deep convective variables used in phytrac
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
-!$OMP THREADPRIVATE(ep)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
-!$OMP THREADPRIVATE(dnwd, upwd)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
-!$OMP THREADPRIVATE(pmflxr, pmflxs)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainS, wdtrainM
-!$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
-!$OMP THREADPRIVATE(da, mp)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
-!$OMP THREADPRIVATE(wght_cvfd)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
-!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
-!$OMP THREADPRIVATE(d1a, dam)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
-!$OMP THREADPRIVATE(ev)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qtaa
-!$OMP THREADPRIVATE(qtaa)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
-!$OMP THREADPRIVATE(clw)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
-!$OMP THREADPRIVATE(eplaMm)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
-!$OMP THREADPRIVATE(sij)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
+  !$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
+  !$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: t2m_min_mon, t2m_max_mon
+  !$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: weak_inversion
+  !$OMP THREADPRIVATE(weak_inversion)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_bl_conv, alp_bl_det
+  !$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_bl_fluct_m, alp_bl_fluct_tke
+  !$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_bl_stat, n2, s2, strig, zcong, zlcl_th
+  !$OMP THREADPRIVATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: proba_notrig, random_notrig
+  !$OMP THREADPRIVATE(proba_notrig, random_notrig)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: fsolsw, wfbils
+  !$OMP THREADPRIVATE(fsolsw, wfbils)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wfevap
+  !$OMP THREADPRIVATE(wfevap)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: t2m, fluxlat, fsollw, evap_pot
+  !$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dnwd0, omega
+  !$OMP THREADPRIVATE(dnwd0, omega)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: epmax_diag ! epmax_cape
+  !$OMP THREADPRIVATE(epmax_diag)
+  !
+  !  Deep convective variables used in phytrac
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ep ! epmax_cape
+  !$OMP THREADPRIVATE(ep)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dnwd, upwd
+  !$OMP THREADPRIVATE(dnwd, upwd)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: pmflxr, pmflxs
+  !$OMP THREADPRIVATE(pmflxr, pmflxs)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wdtrainA, wdtrainS, wdtrainM
+  !$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: da, mp
+  !$OMP THREADPRIVATE(da, mp)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wght_cvfd
+  !$OMP THREADPRIVATE(wght_cvfd)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: phi, phi2, elij, epmlmMm
+  !$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d1a, dam
+  !$OMP THREADPRIVATE(d1a, dam)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ev
+  !$OMP THREADPRIVATE(ev)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: qtaa
+  !$OMP THREADPRIVATE(qtaa)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: clw
+  !$OMP THREADPRIVATE(clw)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: eplaMm
+  !$OMP THREADPRIVATE(eplaMm)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: sij
+  !$OMP THREADPRIVATE(sij)
 #ifdef ISO
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtwdtrainA
@@ -576,51 +577,51 @@
 #endif
 #endif
-!
-!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
-!$OMP THREADPRIVATE(lambda_th)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
-!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: qlth, qith, qsith, wiceth
-!$OMP THREADPRIVATE(qlth, qith, qsith, wiceth)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
-!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
-!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh, zx_rhl, zx_rhi
-!$OMP THREADPRIVATE(zx_rh, zx_rhl, zx_rhi)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca, bsfl
-!$OMP THREADPRIVATE(prfl, psfl, fraca, bsfl)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
-!$OMP THREADPRIVATE(Vprecip, zw2)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
-!$OMP THREADPRIVATE(pmfd, pmfu)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
-!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
-!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
-!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
-
-
-! ug et d'autres encore:
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
-!$OMP THREADPRIVATE(beta_prec)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn,rneblsvol
-!$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: pfraclr,pfracld
-!$OMP THREADPRIVATE(pfraclr,pfracld)
-      REAL, SAVE, ALLOCATABLE :: cldfraliq(:,:)
-!$OMP THREADPRIVATE(cldfraliq)
-      REAL, SAVE, ALLOCATABLE ::mean_icefracturb(:,:)
-!$OMP THREADPRIVATE(mean_icefracturb)
-      REAL, SAVE, ALLOCATABLE :: sigma2_icefracturb(:,:)
-!$OMP THREADPRIVATE(sigma2_icefracturb)
-
-! variables de sorties MM
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
-!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
-!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
+  !
+  !      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: lambda_th
+  !$OMP THREADPRIVATE(lambda_th)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
+  !$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: qlth, qith, qsith, wiceth
+  !$OMP THREADPRIVATE(qlth, qith, qsith, wiceth)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ref_liq, ref_ice, theta, zphi
+  !$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ref_liq_pi, ref_ice_pi
+  !$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: zx_rh, zx_rhl, zx_rhi
+  !$OMP THREADPRIVATE(zx_rh, zx_rhl, zx_rhi)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: prfl, psfl, fraca, bsfl
+  !$OMP THREADPRIVATE(prfl, psfl, fraca, bsfl)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: Vprecip, zw2
+  !$OMP THREADPRIVATE(Vprecip, zw2)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: pmfd, pmfu
+  !$OMP THREADPRIVATE(pmfd, pmfu)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: fluxt, fluxu, fluxv
+  !$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: uwriteSTD, vwriteSTD, wwriteSTD
+  !$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
+  !$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
+
+
+  ! ug et d'autres encore:
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: beta_prec
+  !$OMP THREADPRIVATE(beta_prec)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: rneb, rnebjn, rneblsvol
+  !$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: pfraclr, pfracld
+  !$OMP THREADPRIVATE(pfraclr,pfracld)
+  REAL, SAVE, ALLOCATABLE :: cldfraliq(:, :)
+  !$OMP THREADPRIVATE(cldfraliq)
+  REAL, SAVE, ALLOCATABLE :: mean_icefracturb(:, :)
+  !$OMP THREADPRIVATE(mean_icefracturb)
+  REAL, SAVE, ALLOCATABLE :: sigma2_icefracturb(:, :)
+  !$OMP THREADPRIVATE(sigma2_icefracturb)
+
+  ! variables de sorties MM
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow, snowhgt, qsnow, to_ice
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow, runoff, albsol3_lic
+  !$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
+  !$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
 #ifdef ISO
       REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: zxxtsnow
@@ -632,183 +633,181 @@
 #endif
 
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
-!$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
-
-      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zn2mout
-!$OMP THREADPRIVATE(zn2mout)
-
-      REAL, SAVE, ALLOCATABLE :: qclr(:,:)
-      !$OMP THREADPRIVATE(qclr)
-      REAL, SAVE, ALLOCATABLE :: qcld(:,:)
-      !$OMP THREADPRIVATE(qcld)
-      REAL, SAVE, ALLOCATABLE :: qss(:,:)
-      !$OMP THREADPRIVATE(qss)
-      REAL, SAVE, ALLOCATABLE :: qvc(:,:)
-      !$OMP THREADPRIVATE(qvc)
-      REAL, SAVE, ALLOCATABLE :: rnebclr(:,:)
-      !$OMP THREADPRIVATE(rnebclr)
-      REAL, SAVE, ALLOCATABLE :: rnebss(:,:)
-      !$OMP THREADPRIVATE(rnebss)
-      REAL, SAVE, ALLOCATABLE :: gamma_ss(:,:)
-      !$OMP THREADPRIVATE(gamma_ss)
-      REAL, SAVE, ALLOCATABLE :: N1_ss(:,:)
-      !$OMP THREADPRIVATE(N1_ss)
-      REAL, SAVE, ALLOCATABLE :: N2_ss(:,:)
-      !$OMP THREADPRIVATE(N2_ss)
-      REAL, SAVE, ALLOCATABLE :: drneb_sub(:,:)
-      !$OMP THREADPRIVATE(drneb_sub)
-      REAL, SAVE, ALLOCATABLE :: drneb_con(:,:)
-      !$OMP THREADPRIVATE(drneb_con)
-      REAL, SAVE, ALLOCATABLE :: drneb_tur(:,:)
-      !$OMP THREADPRIVATE(drneb_tur)
-      REAL, SAVE, ALLOCATABLE :: drneb_avi(:,:)
-      !$OMP THREADPRIVATE(drneb_avi)
-      REAL, SAVE, ALLOCATABLE :: zqsatl(:,:)
-      !$OMP THREADPRIVATE(zqsatl)
-      REAL, SAVE, ALLOCATABLE :: zqsats(:,:)
-      !$OMP THREADPRIVATE(zqsats)
-      REAL, SAVE, ALLOCATABLE :: Tcontr(:,:)
-      !$OMP THREADPRIVATE(Tcontr)
-      REAL, SAVE, ALLOCATABLE :: qcontr(:,:)
-      !$OMP THREADPRIVATE(qcontr)
-      REAL, SAVE, ALLOCATABLE :: qcontr2(:,:)
-      !$OMP THREADPRIVATE(qcontr2)
-      REAL, SAVE, ALLOCATABLE :: fcontrN(:,:)
-      !$OMP THREADPRIVATE(fcontrN)
-      REAL, SAVE, ALLOCATABLE :: fcontrP(:,:)
-      !$OMP THREADPRIVATE(fcontrP)
-      REAL, SAVE, ALLOCATABLE :: distcltop(:,:)
-      !$OMP THREADPRIVATE(distcltop)
-      REAL, SAVE, ALLOCATABLE :: temp_cltop(:,:)
-      !$OMP THREADPRIVATE(temp_cltop)
-
-
-!--POPRECIP variables
-      REAL, SAVE, ALLOCATABLE :: qraindiag(:,:)
-      !$OMP THREADPRIVATE(qraindiag)
-      REAL, SAVE, ALLOCATABLE :: qsnowdiag(:,:)
-      !$OMP THREADPRIVATE(qsnowdiag)
-      REAL, SAVE, ALLOCATABLE :: dqreva(:,:)
-      !$OMP THREADPRIVATE(dqreva)
-      REAL, SAVE, ALLOCATABLE :: dqrauto(:,:)
-      !$OMP THREADPRIVATE(dqrauto)
-      REAL, SAVE, ALLOCATABLE :: dqrcol(:,:)
-      !$OMP THREADPRIVATE(dqrcol)
-      REAL, SAVE, ALLOCATABLE :: dqrmelt(:,:)
-      !$OMP THREADPRIVATE(dqrmelt)
-       REAL, SAVE, ALLOCATABLE :: dqrfreez(:,:)
-      !$OMP THREADPRIVATE(dqrfreez)
-      REAL, SAVE, ALLOCATABLE :: dqssub(:,:)
-      !$OMP THREADPRIVATE(dqssub)
-      REAL, SAVE, ALLOCATABLE :: dqsauto(:,:)
-      !$OMP THREADPRIVATE(dqsauto)
-      REAL, SAVE, ALLOCATABLE :: dqsagg(:,:)
-      !$OMP THREADPRIVATE(dqsagg)
-      REAL, SAVE, ALLOCATABLE :: dqsrim(:,:)
-      !$OMP THREADPRIVATE(dqsrim)
-      REAL, SAVE, ALLOCATABLE :: dqsmelt(:,:)
-      !$OMP THREADPRIVATE(dqsmelt)
-      REAL, SAVE, ALLOCATABLE :: dqsfreez(:,:)
-      !$OMP THREADPRIVATE(dqsfreez)
-
-
-      
-
-
-#ifdef CPP_StratAer
-!
-! variables for stratospheric aerosol
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: d_q_emiss
-!$OMP THREADPRIVATE(d_q_emiss)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4
-!$OMP THREADPRIVATE(R2SO4)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: R2SO4B
-!$OMP THREADPRIVATE(R2SO4B)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4
-!$OMP THREADPRIVATE(DENSO4)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: DENSO4B
-!$OMP THREADPRIVATE(DENSO4B)      
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
-!$OMP THREADPRIVATE(f_r_wet)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: f_r_wetB
-!$OMP THREADPRIVATE(f_r_wetB)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer
-!$OMP THREADPRIVATE(decfluxaer)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
-!$OMP THREADPRIVATE(mdw)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime
-!$OMP THREADPRIVATE(OCS_lifetime)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime
-!$OMP THREADPRIVATE(SO2_lifetime)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: H2SO4_lifetime
-!$OMP THREADPRIVATE(H2SO4_lifetime)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: O3_clim
-!$OMP THREADPRIVATE(O3_clim)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin
-!$OMP THREADPRIVATE(alpha_bin)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin
-!$OMP THREADPRIVATE(piz_bin)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin
-!$OMP THREADPRIVATE(cg_bin)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550
-!$OMP THREADPRIVATE(tau_strat_550)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020
-!$OMP THREADPRIVATE(tau_strat_1020)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat
-!$OMP THREADPRIVATE(tausum_strat)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
-!$OMP THREADPRIVATE(surf_PM25_sulf)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer
-!$OMP THREADPRIVATE(vsed_aer)
-!     Sulfate aerosol concentration (dry mixing ratio) (condensed H2SO4 mmr)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sulfmmr
-!$OMP THREADPRIVATE(sulfmmr)
-!     SAD all aerosols (cm2/cm3)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SAD_sulfate
-!$OMP THREADPRIVATE(SAD_sulfate)
-!     sulfate MMR in different modes (based on sulfmmr, it must be dry mmr)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: sulfmmr_mode
-!$OMP THREADPRIVATE(sulfmmr_mode)
-!     particle concentration in different modes (part/m3)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: nd_mode
-!$OMP THREADPRIVATE(nd_mode)
-!
-!---3D budget variables
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_nucl
-!$OMP THREADPRIVATE(budg_3D_nucl)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_cond_evap
-!$OMP THREADPRIVATE(budg_3D_cond_evap)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_ocs_to_so2
-!$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_so2_to_h2so4
-!$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_ocs
-!$OMP THREADPRIVATE(budg_3D_backgr_ocs)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_so2
-!$OMP THREADPRIVATE(budg_3D_backgr_so2)
-!
-!---2D budget variables
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
-!$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
-!$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
-!$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
-!$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
-!$OMP THREADPRIVATE(budg_sed_part)
-#endif
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
+  !$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
+
+  INTEGER, ALLOCATABLE, SAVE, DIMENSION(:, :) :: zn2mout
+  !$OMP THREADPRIVATE(zn2mout)
+
+  REAL, SAVE, ALLOCATABLE :: qclr(:, :)
+  !$OMP THREADPRIVATE(qclr)
+  REAL, SAVE, ALLOCATABLE :: qcld(:, :)
+  !$OMP THREADPRIVATE(qcld)
+  REAL, SAVE, ALLOCATABLE :: qss(:, :)
+  !$OMP THREADPRIVATE(qss)
+  REAL, SAVE, ALLOCATABLE :: qvc(:, :)
+  !$OMP THREADPRIVATE(qvc)
+  REAL, SAVE, ALLOCATABLE :: rnebclr(:, :)
+  !$OMP THREADPRIVATE(rnebclr)
+  REAL, SAVE, ALLOCATABLE :: rnebss(:, :)
+  !$OMP THREADPRIVATE(rnebss)
+  REAL, SAVE, ALLOCATABLE :: gamma_ss(:, :)
+  !$OMP THREADPRIVATE(gamma_ss)
+  REAL, SAVE, ALLOCATABLE :: N1_ss(:, :)
+  !$OMP THREADPRIVATE(N1_ss)
+  REAL, SAVE, ALLOCATABLE :: N2_ss(:, :)
+  !$OMP THREADPRIVATE(N2_ss)
+  REAL, SAVE, ALLOCATABLE :: drneb_sub(:, :)
+  !$OMP THREADPRIVATE(drneb_sub)
+  REAL, SAVE, ALLOCATABLE :: drneb_con(:, :)
+  !$OMP THREADPRIVATE(drneb_con)
+  REAL, SAVE, ALLOCATABLE :: drneb_tur(:, :)
+  !$OMP THREADPRIVATE(drneb_tur)
+  REAL, SAVE, ALLOCATABLE :: drneb_avi(:, :)
+  !$OMP THREADPRIVATE(drneb_avi)
+  REAL, SAVE, ALLOCATABLE :: zqsatl(:, :)
+  !$OMP THREADPRIVATE(zqsatl)
+  REAL, SAVE, ALLOCATABLE :: zqsats(:, :)
+  !$OMP THREADPRIVATE(zqsats)
+  REAL, SAVE, ALLOCATABLE :: Tcontr(:, :)
+  !$OMP THREADPRIVATE(Tcontr)
+  REAL, SAVE, ALLOCATABLE :: qcontr(:, :)
+  !$OMP THREADPRIVATE(qcontr)
+  REAL, SAVE, ALLOCATABLE :: qcontr2(:, :)
+  !$OMP THREADPRIVATE(qcontr2)
+  REAL, SAVE, ALLOCATABLE :: fcontrN(:, :)
+  !$OMP THREADPRIVATE(fcontrN)
+  REAL, SAVE, ALLOCATABLE :: fcontrP(:, :)
+  !$OMP THREADPRIVATE(fcontrP)
+  REAL, SAVE, ALLOCATABLE :: distcltop(:, :)
+  !$OMP THREADPRIVATE(distcltop)
+  REAL, SAVE, ALLOCATABLE :: temp_cltop(:, :)
+  !$OMP THREADPRIVATE(temp_cltop)
+
+
+  !--POPRECIP variables
+  REAL, SAVE, ALLOCATABLE :: qraindiag(:, :)
+  !$OMP THREADPRIVATE(qraindiag)
+  REAL, SAVE, ALLOCATABLE :: qsnowdiag(:, :)
+  !$OMP THREADPRIVATE(qsnowdiag)
+  REAL, SAVE, ALLOCATABLE :: dqreva(:, :)
+  !$OMP THREADPRIVATE(dqreva)
+  REAL, SAVE, ALLOCATABLE :: dqrauto(:, :)
+  !$OMP THREADPRIVATE(dqrauto)
+  REAL, SAVE, ALLOCATABLE :: dqrcol(:, :)
+  !$OMP THREADPRIVATE(dqrcol)
+  REAL, SAVE, ALLOCATABLE :: dqrmelt(:, :)
+  !$OMP THREADPRIVATE(dqrmelt)
+  REAL, SAVE, ALLOCATABLE :: dqrfreez(:, :)
+  !$OMP THREADPRIVATE(dqrfreez)
+  REAL, SAVE, ALLOCATABLE :: dqssub(:, :)
+  !$OMP THREADPRIVATE(dqssub)
+  REAL, SAVE, ALLOCATABLE :: dqsauto(:, :)
+  !$OMP THREADPRIVATE(dqsauto)
+  REAL, SAVE, ALLOCATABLE :: dqsagg(:, :)
+  !$OMP THREADPRIVATE(dqsagg)
+  REAL, SAVE, ALLOCATABLE :: dqsrim(:, :)
+  !$OMP THREADPRIVATE(dqsrim)
+  REAL, SAVE, ALLOCATABLE :: dqsmelt(:, :)
+  !$OMP THREADPRIVATE(dqsmelt)
+  REAL, SAVE, ALLOCATABLE :: dqsfreez(:, :)
+  !$OMP THREADPRIVATE(dqsfreez)
+
+
+
+
+
+  !
+  ! variables for stratospheric aerosol
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d_q_emiss
+  !$OMP THREADPRIVATE(d_q_emiss)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: R2SO4
+  !$OMP THREADPRIVATE(R2SO4)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: R2SO4B
+  !$OMP THREADPRIVATE(R2SO4B)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: DENSO4
+  !$OMP THREADPRIVATE(DENSO4)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: DENSO4B
+  !$OMP THREADPRIVATE(DENSO4B)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: f_r_wet
+  !$OMP THREADPRIVATE(f_r_wet)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: f_r_wetB
+  !$OMP THREADPRIVATE(f_r_wetB)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: decfluxaer
+  !$OMP THREADPRIVATE(decfluxaer)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
+  !$OMP THREADPRIVATE(mdw)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: OCS_lifetime
+  !$OMP THREADPRIVATE(OCS_lifetime)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: SO2_lifetime
+  !$OMP THREADPRIVATE(SO2_lifetime)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: H2SO4_lifetime
+  !$OMP THREADPRIVATE(H2SO4_lifetime)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: O3_clim
+  !$OMP THREADPRIVATE(O3_clim)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: alpha_bin
+  !$OMP THREADPRIVATE(alpha_bin)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: piz_bin
+  !$OMP THREADPRIVATE(piz_bin)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: cg_bin
+  !$OMP THREADPRIVATE(cg_bin)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: tau_strat_550
+  !$OMP THREADPRIVATE(tau_strat_550)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: tau_strat_1020
+  !$OMP THREADPRIVATE(tau_strat_1020)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: tausum_strat
+  !$OMP THREADPRIVATE(tausum_strat)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
+  !$OMP THREADPRIVATE(surf_PM25_sulf)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: vsed_aer
+  !$OMP THREADPRIVATE(vsed_aer)
+  !     Sulfate aerosol concentration (dry mixing ratio) (condensed H2SO4 mmr)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: sulfmmr
+  !$OMP THREADPRIVATE(sulfmmr)
+  !     SAD all aerosols (cm2/cm3)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: SAD_sulfate
+  !$OMP THREADPRIVATE(SAD_sulfate)
+  !     sulfate MMR in different modes (based on sulfmmr, it must be dry mmr)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: sulfmmr_mode
+  !$OMP THREADPRIVATE(sulfmmr_mode)
+  !     particle concentration in different modes (part/m3)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: nd_mode
+  !$OMP THREADPRIVATE(nd_mode)
+  !
+  !---3D budget variables
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_nucl
+  !$OMP THREADPRIVATE(budg_3D_nucl)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_cond_evap
+  !$OMP THREADPRIVATE(budg_3D_cond_evap)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_ocs_to_so2
+  !$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_so2_to_h2so4
+  !$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_backgr_ocs
+  !$OMP THREADPRIVATE(budg_3D_backgr_ocs)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_backgr_so2
+  !$OMP THREADPRIVATE(budg_3D_backgr_so2)
+  !
+  !---2D budget variables
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
+  !$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
+  !$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
+  !$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
+  !$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
+  !$OMP THREADPRIVATE(budg_sed_part)
 #ifdef REPROBUS
       REAL,SAVE,ALLOCATABLE    :: d_q_emiss(:,:)
@@ -818,65 +817,63 @@
 CONTAINS
 
-!======================================================================
-SUBROUTINE phys_local_var_init
-USE dimphy
-USE infotrac_phy, ONLY : nbtr,nqtot
+  !======================================================================
+  SUBROUTINE phys_local_var_init
+    USE dimphy
+    USE infotrac_phy, ONLY : nbtr, nqtot
 #ifdef ISO
 USE infotrac_phy, ONLY : ntraciso=>ntiso,niso
 #endif
-USE aero_mod
-USE indice_sol_mod
-USE phys_output_var_mod
-USE phys_state_var_mod
-#ifdef CPP_StratAer
-USE infotrac_phy, ONLY : nbtr_bin
-#endif
-
-IMPLICIT NONE
-      ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev), qbs_seri(klon,klev))
-! SN 4D ISO
-      ALLOCATE(qx_seri(klon,klev,nqtot))
-! SN
-      ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
-      ALLOCATE(l_mixmin(klon,klev+1,nbsrf),l_mix(klon,klev+1,nbsrf),wprime(klon,klev+1,nbsrf))
-      ALLOCATE(pbl_eps(klon,klev+1,nbsrf+1))
-      ALLOCATE(tke_shear(klon,klev+1,nbsrf), tke_buoy(klon,klev+1,nbsrf), tke_trans(klon,klev+1,nbsrf))
-      pbl_eps(:,:,:)=0.
-      tke_shear(:,:,:)=0.; tke_buoy(:,:,:)=0.; tke_trans(:,:,:)=0.
-      l_mix(:,:,:)=0.;l_mixmin(:,:,:)=0.;wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
-      ALLOCATE(rhcl(klon,klev))
-      ALLOCATE(tr_seri(klon,klev,nbtr))
-      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
-      ALLOCATE(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev), d_qbs_dyn(klon,klev))
-      ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon), d_qbs_dyn2d(klon))
-      ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
-      ALLOCATE(d_tr_dyn(klon,klev,nbtr))                   !RomP
-      ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev),d_q_con_zmasse(klon,klev))
-      ALLOCATE(d_u_con(klon,klev),d_v_con(klon,klev))
-      ALLOCATE(d_t_wake(klon,klev),d_q_wake(klon,klev))
-      ALLOCATE(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
-      ALLOCATE(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
-      ALLOCATE(d_t_swr(klon,klev),d_t_sw0(klon,klev))
-      ALLOCATE(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
-      ALLOCATE(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
-      ALLOCATE(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
-!nrlmd<
-      ALLOCATE(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
-      ALLOCATE(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
-!>nrlmd
-      ALLOCATE(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
-      ALLOCATE(d_t_eva(klon,klev),d_q_eva(klon,klev))
-! SN 4D ISO
-      ALLOCATE(d_qx_eva(klon,klev,nqtot))
-! SN 
-      ALLOCATE(d_ql_eva(klon,klev),d_qi_eva(klon,klev))
-      ALLOCATE(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
-      ALLOCATE(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
-      ALLOCATE(plul_st(klon),plul_th(klon))
-      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
-      ALLOCATE (d_qbs_vdf(klon,klev))
-      ALLOCATE(d_t_bsss(klon,klev),d_q_bsss(klon,klev),d_qbs_bsss(klon,klev))
-      ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
-      ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
+    USE aero_mod
+    USE indice_sol_mod
+    USE phys_output_var_mod
+    USE phys_state_var_mod
+    USE infotrac_phy, ONLY : nbtr_bin
+
+    IMPLICIT NONE
+    ALLOCATE(t_seri(klon, klev), q_seri(klon, klev), ql_seri(klon, klev), qs_seri(klon, klev), qbs_seri(klon, klev))
+    ! SN 4D ISO
+    ALLOCATE(qx_seri(klon, klev, nqtot))
+    ! SN
+    ALLOCATE(u_seri(klon, klev), v_seri(klon, klev))
+    ALLOCATE(l_mixmin(klon, klev + 1, nbsrf), l_mix(klon, klev + 1, nbsrf), wprime(klon, klev + 1, nbsrf))
+    ALLOCATE(pbl_eps(klon, klev + 1, nbsrf + 1))
+    ALLOCATE(tke_shear(klon, klev + 1, nbsrf), tke_buoy(klon, klev + 1, nbsrf), tke_trans(klon, klev + 1, nbsrf))
+    pbl_eps(:, :, :) = 0.
+    tke_shear(:, :, :) = 0.; tke_buoy(:, :, :) = 0.; tke_trans(:, :, :) = 0.
+    l_mix(:, :, :) = 0.;l_mixmin(:, :, :) = 0.;wprime(:, :, :) = 0. ! doit etre initialse car pas toujours remplis
+    ALLOCATE(rhcl(klon, klev))
+    ALLOCATE(tr_seri(klon, klev, nbtr))
+    ALLOCATE(d_t_dyn(klon, klev), d_q_dyn(klon, klev))
+    ALLOCATE(d_ql_dyn(klon, klev), d_qs_dyn(klon, klev), d_qbs_dyn(klon, klev))
+    ALLOCATE(d_q_dyn2d(klon), d_ql_dyn2d(klon), d_qs_dyn2d(klon), d_qbs_dyn2d(klon))
+    ALLOCATE(d_u_dyn(klon, klev), d_v_dyn(klon, klev))
+    ALLOCATE(d_tr_dyn(klon, klev, nbtr))                   !RomP
+    ALLOCATE(d_t_con(klon, klev), d_q_con(klon, klev), d_q_con_zmasse(klon, klev))
+    ALLOCATE(d_u_con(klon, klev), d_v_con(klon, klev))
+    ALLOCATE(d_t_wake(klon, klev), d_q_wake(klon, klev))
+    ALLOCATE(d_t_lsc(klon, klev), d_q_lsc(klon, klev))
+    ALLOCATE(d_t_lwr(klon, klev), d_t_lw0(klon, klev))
+    ALLOCATE(d_t_swr(klon, klev), d_t_sw0(klon, klev))
+    ALLOCATE(d_ql_lsc(klon, klev), d_qi_lsc(klon, klev))
+    ALLOCATE(d_t_ajsb(klon, klev), d_q_ajsb(klon, klev))
+    ALLOCATE(d_t_ajs(klon, klev), d_q_ajs(klon, klev))
+    !nrlmd<
+    ALLOCATE(d_t_ajs_w(klon, klev), d_q_ajs_w(klon, klev))
+    ALLOCATE(d_t_ajs_x(klon, klev), d_q_ajs_x(klon, klev))
+    !>nrlmd
+    ALLOCATE(d_u_ajs(klon, klev), d_v_ajs(klon, klev))
+    ALLOCATE(d_t_eva(klon, klev), d_q_eva(klon, klev))
+    ! SN 4D ISO
+    ALLOCATE(d_qx_eva(klon, klev, nqtot))
+    ! SN
+    ALLOCATE(d_ql_eva(klon, klev), d_qi_eva(klon, klev))
+    ALLOCATE(d_t_lscst(klon, klev), d_q_lscst(klon, klev))
+    ALLOCATE(d_t_lscth(klon, klev), d_q_lscth(klon, klev))
+    ALLOCATE(plul_st(klon), plul_th(klon))
+    ALLOCATE(d_t_vdf(klon, klev), d_q_vdf(klon, klev), d_t_diss(klon, klev))
+    ALLOCATE (d_qbs_vdf(klon, klev))
+    ALLOCATE(d_t_bsss(klon, klev), d_q_bsss(klon, klev), d_qbs_bsss(klon, klev))
+    ALLOCATE(d_t_vdf_w(klon, klev), d_q_vdf_w(klon, klev))
+    ALLOCATE(d_t_vdf_x(klon, klev), d_q_vdf_x(klon, klev))
 #ifdef ISO
       allocate(xt_seri(ntraciso,klon,klev))
@@ -909,121 +906,121 @@
 #endif
 
-      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
-      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
-      ALLOCATE(d_u_oli(klon,klev),d_v_oli(klon,klev))
-      ALLOCATE(d_u_oro(klon,klev),d_v_oro(klon,klev))
-      ALLOCATE(d_u_oro_gw(klon,klev),d_v_oro_gw(klon,klev))
-      ALLOCATE(d_t_oro_gw(klon,klev))
-      ALLOCATE(d_t_lif(klon,klev),d_t_ec(klon,klev))
-      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
-      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
-
-! Special RRTM
-      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
-      ZFLDN0= 0.
-      ALLOCATE(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
-!
-      ALLOCATE(topswad_aero(klon), solswad_aero(klon))
-      ALLOCATE(topswai_aero(klon), solswai_aero(klon))
-      ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
-      ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
-      ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
-      ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
-      ALLOCATE(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
-      ALLOCATE(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
-      ALLOCATE(topswcf_aero(klon,3), solswcf_aero(klon,3))
-      ALLOCATE(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
-      ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
-      ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
-      east_gwstress(:,:)=0 !ym missing init
-      west_gwstress(:,:)=0 !ym missing init
-      ALLOCATE(d_t_hin(klon,klev))
-      ALLOCATE(d_q_ch4(klon,klev))
-      ALLOCATE(stratomask(klon,klev))
-      ALLOCATE(tausum_aero(klon,nwave,naero_tot))
-      ALLOCATE(drytausum_aero(klon,naero_tot))
-      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot)) 
-      ALLOCATE(dNovrN(klon))
-      ALLOCATE(zfice(klon, klev))
-      ALLOCATE(od443aer(klon))
-      ALLOCATE(od550aer(klon))
-      ALLOCATE(od865aer(klon))
-      ALLOCATE(dryod550aer(klon))
-      dryod550aer(:) = 0.
-      ALLOCATE(abs550aer(klon))
-      abs550aer(:) = 0.
-      ALLOCATE(ec550aer(klon,klev))
-      ALLOCATE(od550lt1aer(klon))
-      ALLOCATE(sconcso4(klon))
-      ALLOCATE(sconcno3(klon))
-      ALLOCATE(sconcoa(klon))
-      ALLOCATE(sconcbc(klon))
-      ALLOCATE(sconcss(klon))
-      ALLOCATE(sconcdust(klon))
-      ALLOCATE(concso4(klon,klev))
-      ALLOCATE(concno3(klon,klev))
-      ALLOCATE(concoa(klon,klev))
-      ALLOCATE(concbc(klon,klev))
-      ALLOCATE(concss(klon,klev))
-      ALLOCATE(concdust(klon,klev))
-      ALLOCATE(loadso4(klon))
-      ALLOCATE(loadoa(klon))
-      ALLOCATE(loadbc(klon))
-      ALLOCATE(loadss(klon))
-      ALLOCATE(loaddust(klon))
-      ALLOCATE(loadno3(klon))
-      ALLOCATE(load_tmp1(klon))
-      ALLOCATE(load_tmp2(klon))
-      ALLOCATE(load_tmp3(klon))
-      ALLOCATE(load_tmp4(klon))
-      ALLOCATE(load_tmp5(klon))
-      ALLOCATE(load_tmp6(klon))
-      ALLOCATE(load_tmp7(klon))
-      ALLOCATE(load_tmp8(klon))
-      ALLOCATE(load_tmp9(klon))
-      ALLOCATE(load_tmp10(klon))
-
-!IM ajout variables CFMIP2/CMIP5
-      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
-      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
-      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
-      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
-      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
-      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
-
-! additional LW variables CK
-      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
-      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
-      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
-
-!AI Ajout Ecrad (3Deffect)
-      ALLOCATE(topswad_aero_s2(klon), solswad_aero_s2(klon))
-      ALLOCATE(topswai_aero_s2(klon), solswai_aero_s2(klon))
-      ALLOCATE(topswad0_aero_s2(klon), solswad0_aero_s2(klon))
-      ALLOCATE(topsw_aero_s2(klon,naero_grp), topsw0_aero_s2(klon,naero_grp))
-      ALLOCATE(solsw_aero_s2(klon,naero_grp), solsw0_aero_s2(klon,naero_grp))
-      ALLOCATE(topswcf_aero_s2(klon,naero_grp), solswcf_aero_s2(klon,naero_grp))
-! additional LW variables CK
-      ALLOCATE(toplwad_aero_s2(klon), sollwad_aero_s2(klon))
-      ALLOCATE(toplwai_aero_s2(klon), sollwai_aero_s2(klon))
-      ALLOCATE(toplwad0_aero_s2(klon), sollwad0_aero_s2(klon))
-
-! FH Ajout de celles necessaires au phys_output_write_mod
-
-      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
-      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
-!!
-!!          Wake variables
-      ALLOCATE(alp_wake(klon))
-      ALLOCATE(wake_h(klon),wake_k(klon))
-      ALLOCATE(wake_omg(klon, klev))
-      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
-      ALLOCATE(d_s_wk(klon), d_s_a_wk(klon), d_dens_wk(klon), d_dens_a_wk(klon))
-      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
-      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
-!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
-      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
-!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
-      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
+    ALLOCATE(d_u_vdf(klon, klev), d_v_vdf(klon, klev))
+    ALLOCATE(d_t_oli(klon, klev), d_t_oro(klon, klev))
+    ALLOCATE(d_u_oli(klon, klev), d_v_oli(klon, klev))
+    ALLOCATE(d_u_oro(klon, klev), d_v_oro(klon, klev))
+    ALLOCATE(d_u_oro_gw(klon, klev), d_v_oro_gw(klon, klev))
+    ALLOCATE(d_t_oro_gw(klon, klev))
+    ALLOCATE(d_t_lif(klon, klev), d_t_ec(klon, klev))
+    ALLOCATE(d_u_lif(klon, klev), d_v_lif(klon, klev))
+    ALLOCATE(d_ts(klon, nbsrf), d_tr(klon, klev, nbtr))
+
+    ! Special RRTM
+    ALLOCATE(ZLWFT0_i(klon, klev + 1), ZSWFT0_i(klon, klev + 1), ZFLDN0(klon, klev + 1))
+    ZFLDN0 = 0.
+    ALLOCATE(ZFLUP0(klon, klev + 1), ZFSDN0(klon, klev + 1), ZFSUP0(klon, klev + 1))
+    !
+    ALLOCATE(topswad_aero(klon), solswad_aero(klon))
+    ALLOCATE(topswai_aero(klon), solswai_aero(klon))
+    ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
+    ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
+    ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
+    ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
+    ALLOCATE(topsw_aero(klon, naero_grp), solsw_aero(klon, naero_grp))
+    ALLOCATE(topsw0_aero(klon, naero_grp), solsw0_aero(klon, naero_grp))
+    ALLOCATE(topswcf_aero(klon, 3), solswcf_aero(klon, 3))
+    ALLOCATE(du_gwd_hines(klon, klev), dv_gwd_hines(klon, klev))
+    ALLOCATE(dv_gwd_rando(klon, klev), dv_gwd_front(klon, klev))
+    ALLOCATE(east_gwstress(klon, klev), west_gwstress(klon, klev))
+    east_gwstress(:, :) = 0 !ym missing init
+    west_gwstress(:, :) = 0 !ym missing init
+    ALLOCATE(d_t_hin(klon, klev))
+    ALLOCATE(d_q_ch4(klon, klev))
+    ALLOCATE(stratomask(klon, klev))
+    ALLOCATE(tausum_aero(klon, nwave, naero_tot))
+    ALLOCATE(drytausum_aero(klon, naero_tot))
+    ALLOCATE(tau3d_aero(klon, klev, nwave, naero_tot))
+    ALLOCATE(dNovrN(klon))
+    ALLOCATE(zfice(klon, klev))
+    ALLOCATE(od443aer(klon))
+    ALLOCATE(od550aer(klon))
+    ALLOCATE(od865aer(klon))
+    ALLOCATE(dryod550aer(klon))
+    dryod550aer(:) = 0.
+    ALLOCATE(abs550aer(klon))
+    abs550aer(:) = 0.
+    ALLOCATE(ec550aer(klon, klev))
+    ALLOCATE(od550lt1aer(klon))
+    ALLOCATE(sconcso4(klon))
+    ALLOCATE(sconcno3(klon))
+    ALLOCATE(sconcoa(klon))
+    ALLOCATE(sconcbc(klon))
+    ALLOCATE(sconcss(klon))
+    ALLOCATE(sconcdust(klon))
+    ALLOCATE(concso4(klon, klev))
+    ALLOCATE(concno3(klon, klev))
+    ALLOCATE(concoa(klon, klev))
+    ALLOCATE(concbc(klon, klev))
+    ALLOCATE(concss(klon, klev))
+    ALLOCATE(concdust(klon, klev))
+    ALLOCATE(loadso4(klon))
+    ALLOCATE(loadoa(klon))
+    ALLOCATE(loadbc(klon))
+    ALLOCATE(loadss(klon))
+    ALLOCATE(loaddust(klon))
+    ALLOCATE(loadno3(klon))
+    ALLOCATE(load_tmp1(klon))
+    ALLOCATE(load_tmp2(klon))
+    ALLOCATE(load_tmp3(klon))
+    ALLOCATE(load_tmp4(klon))
+    ALLOCATE(load_tmp5(klon))
+    ALLOCATE(load_tmp6(klon))
+    ALLOCATE(load_tmp7(klon))
+    ALLOCATE(load_tmp8(klon))
+    ALLOCATE(load_tmp9(klon))
+    ALLOCATE(load_tmp10(klon))
+
+    !IM ajout variables CFMIP2/CMIP5
+    ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
+    ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
+    ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
+    ALLOCATE(topsw_aerop(klon, naero_grp), topsw0_aerop(klon, naero_grp))
+    ALLOCATE(solsw_aerop(klon, naero_grp), solsw0_aerop(klon, naero_grp))
+    ALLOCATE(topswcf_aerop(klon, naero_grp), solswcf_aerop(klon, naero_grp))
+
+    ! additional LW variables CK
+    ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
+    ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
+    ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
+
+    !AI Ajout Ecrad (3Deffect)
+    ALLOCATE(topswad_aero_s2(klon), solswad_aero_s2(klon))
+    ALLOCATE(topswai_aero_s2(klon), solswai_aero_s2(klon))
+    ALLOCATE(topswad0_aero_s2(klon), solswad0_aero_s2(klon))
+    ALLOCATE(topsw_aero_s2(klon, naero_grp), topsw0_aero_s2(klon, naero_grp))
+    ALLOCATE(solsw_aero_s2(klon, naero_grp), solsw0_aero_s2(klon, naero_grp))
+    ALLOCATE(topswcf_aero_s2(klon, naero_grp), solswcf_aero_s2(klon, naero_grp))
+    ! additional LW variables CK
+    ALLOCATE(toplwad_aero_s2(klon), sollwad_aero_s2(klon))
+    ALLOCATE(toplwai_aero_s2(klon), sollwai_aero_s2(klon))
+    ALLOCATE(toplwad0_aero_s2(klon), sollwad0_aero_s2(klon))
+
+    ! FH Ajout de celles necessaires au phys_output_write_mod
+
+    ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
+    ALLOCATE(ptstar(klon), pt0(klon), slp(klon))
+    !!
+    !!          Wake variables
+    ALLOCATE(alp_wake(klon))
+    ALLOCATE(wake_h(klon), wake_k(klon))
+    ALLOCATE(wake_omg(klon, klev))
+    ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
+    ALLOCATE(d_s_wk(klon), d_s_a_wk(klon), d_dens_wk(klon), d_dens_a_wk(klon))
+    ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
+    ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
+    !!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
+    ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
+    !!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
+    ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
 #ifdef ISO
       ALLOCATE(d_deltaxt_wk(ntraciso,klon, klev))
@@ -1033,32 +1030,32 @@
       ALLOCATE(d_deltaxt_ajs_cv(ntraciso,klon, klev))
 #endif
-!!         End of wake variables
-!!
-      ALLOCATE(bils(klon))
-      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
-      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
-      ALLOCATE(JrNt(klon))
-      ALLOCATE(dthmin(klon), evap(klon), snowerosion(klon), fder(klon), plcl(klon), plfc(klon))
-      ALLOCATE(prw(klon), prlw(klon), prsw(klon), prbsw(klon), water_budget(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
-      ALLOCATE(s_lcl(klon))
-      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
-!
-!nrlmd+jyg<
-      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
-      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
-!>nrlmd+jyg
-!
-      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
-      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
-      ALLOCATE(uwat(klon), vwat(klon))
-      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
-      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
-      ALLOCATE(zxrunofflic(klon))
-      ALLOCATE(zxustartlic(klon), zxrhoslic(klon), zxqsaltlic(klon))
-      zxustartlic(:)=0. ; zxrhoslic(:)=0. ; zxqsaltlic(:)=0.
-      ALLOCATE(rain_lsc(klon))
-      ALLOCATE(rain_num(klon))
-      ALLOCATE(qlth(klon,klev), qith(klon,klev), qsith(klon,klev), wiceth(klon,klev))
-      !
+    !!         End of wake variables
+    !!
+    ALLOCATE(bils(klon))
+    ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
+    ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
+    ALLOCATE(JrNt(klon))
+    ALLOCATE(dthmin(klon), evap(klon), snowerosion(klon), fder(klon), plcl(klon), plfc(klon))
+    ALLOCATE(prw(klon), prlw(klon), prsw(klon), prbsw(klon), water_budget(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
+    ALLOCATE(s_lcl(klon))
+    ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
+    !
+    !nrlmd+jyg<
+    ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
+    ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
+    !>nrlmd+jyg
+    !
+    ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
+    ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
+    ALLOCATE(uwat(klon), vwat(klon))
+    ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
+    ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
+    ALLOCATE(zxrunofflic(klon))
+    ALLOCATE(zxustartlic(klon), zxrhoslic(klon), zxqsaltlic(klon))
+    zxustartlic(:) = 0. ; zxrhoslic(:) = 0. ; zxqsaltlic(:) = 0.
+    ALLOCATE(rain_lsc(klon))
+    ALLOCATE(rain_num(klon))
+    ALLOCATE(qlth(klon, klev), qith(klon, klev), qsith(klon, klev), wiceth(klon, klev))
+    !
 #ifdef ISO
       ALLOCATE(xtevap(ntraciso,klon))
@@ -1073,80 +1070,82 @@
       runoff_diag(:)=0. ; xtrunoff_diag(:,:)=0. ! because variables are only given values on knon grid points
 #endif
-!
-      ALLOCATE(sens_x(klon), sens_w(klon))
-      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
-      ALLOCATE(delta_qsurf(klon))
-!jyg<
-!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
-!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
-!>jyg
-      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
-      dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
-      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
-      dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
-      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
-      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
-      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
-      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
-      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
+    !
+    ALLOCATE(sens_x(klon), sens_w(klon))
+    ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
+    ALLOCATE(delta_qsurf(klon))
+    !jyg<
+    !!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
+    !!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
+    !>jyg
+    ALLOCATE(dtvdf_x(klon, klev), dtvdf_w(klon, klev))
+    dtvdf_x = 0 ; dtvdf_w = 0 ;
+    !ym missing init
+    ALLOCATE(dqvdf_x(klon, klev), dqvdf_w(klon, klev))
+    dqvdf_x = 0 ; dqvdf_w = 0 ;
+    !ym missing init
+    ALLOCATE(pbl_tke_input(klon, klev + 1, nbsrf))
+    ALLOCATE(t_therm(klon, klev), q_therm(klon, klev), u_therm(klon, klev), v_therm(klon, klev))
+    ALLOCATE(cdragh_x(klon), cdragh_w(klon))
+    ALLOCATE(cdragm_x(klon), cdragm_w(klon))
+    ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
 #ifdef ISO
       ALLOCATE(dxtvdf_x(ntraciso,klon,klev), dxtvdf_w(ntraciso,klon,klev))
       ALLOCATE(xt_therm(ntraciso,klon,klev))
 #endif
-!
-      ALLOCATE(ptconv(klon,klev))
-      ALLOCATE(ratqsc(klon,klev))
-!
-      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
-      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
-      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
-      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
-      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
-      ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
-      alp_bl_conv(:)=0 ;  alp_bl_det(:)=0
-      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
-      alp_bl_fluct_m(:)=0 ; alp_bl_fluct_tke(:)= 0.
-      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon), strig(klon), zcong(klon), zlcl_th(klon))
-      alp_bl_stat(:)=0
-      ALLOCATE(proba_notrig(klon), random_notrig(klon))
-
-      ALLOCATE(dnwd0(klon, klev))
-!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
-      ALLOCATE(omega(klon, klev))
-      ALLOCATE(epmax_diag(klon)) ! epmax_cape
-!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
-      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
-      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
-      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
-      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
-      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
-      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev), zx_rhl(klon,klev), zx_rhi(klon,klev))
-      zx_rhl(:,:)=0.; zx_rhi(:,:)=0. ! because not always defined
-      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
-
-      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
-      ALLOCATE(fsollw(klon, nbsrf))
-      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf))
-      ALLOCATE(wfevap(klon, nbsrf))
-      ALLOCATE(evap_pot(klon, nbsrf))
-! FC 
-      ALLOCATE(zxfluxq(klon,klev),zxfluxt(klon,klev))
-!
-!  Deep convective variables used in phytrac
-      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
-      ALLOCATE(wdtrainA(klon,klev),wdtrainS(klon,klev),wdtrainM(klon,klev))
-      ALLOCATE(dnwd(klon, klev), upwd(klon, klev))
-      ALLOCATE(ep(klon,klev))                          ! epmax_cape
-      ALLOCATE(da(klon,klev), mp(klon,klev))
-      ALLOCATE(phi(klon,klev,klev))
-      ALLOCATE(wght_cvfd(klon,klev))
-      ALLOCATE(phi2(klon,klev,klev))
-      ALLOCATE(d1a(klon,klev), dam(klon,klev))
-      ALLOCATE(ev(klon,klev))
-      ALLOCATE(elij(klon,klev,klev))
-      ALLOCATE(qtaa(klon,klev))
-      ALLOCATE(clw(klon,klev))
-      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev))
-      ALLOCATE(sij(klon,klev,klev))
+    !
+    ALLOCATE(ptconv(klon, klev))
+    ALLOCATE(ratqsc(klon, klev))
+    !
+    ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
+    ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
+    ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
+    ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
+    ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
+    ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
+    alp_bl_conv(:) = 0 ;  alp_bl_det(:) = 0
+    ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
+    alp_bl_fluct_m(:) = 0 ; alp_bl_fluct_tke(:) = 0.
+    ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon), strig(klon), zcong(klon), zlcl_th(klon))
+    alp_bl_stat(:) = 0
+    ALLOCATE(proba_notrig(klon), random_notrig(klon))
+
+    ALLOCATE(dnwd0(klon, klev))
+    !      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
+    ALLOCATE(omega(klon, klev))
+    ALLOCATE(epmax_diag(klon)) ! epmax_cape
+    !      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
+    ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
+    ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
+    ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
+    ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
+    ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
+    ALLOCATE(zphi(klon, klev), zx_rh(klon, klev), zx_rhl(klon, klev), zx_rhi(klon, klev))
+    zx_rhl(:, :) = 0.; zx_rhi(:, :) = 0. ! because not always defined
+    ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
+
+    ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
+    ALLOCATE(fsollw(klon, nbsrf))
+    ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf))
+    ALLOCATE(wfevap(klon, nbsrf))
+    ALLOCATE(evap_pot(klon, nbsrf))
+    ! FC
+    ALLOCATE(zxfluxq(klon, klev), zxfluxt(klon, klev))
+    !
+    !  Deep convective variables used in phytrac
+    ALLOCATE(pmflxr(klon, klev + 1), pmflxs(klon, klev + 1))
+    ALLOCATE(wdtrainA(klon, klev), wdtrainS(klon, klev), wdtrainM(klon, klev))
+    ALLOCATE(dnwd(klon, klev), upwd(klon, klev))
+    ALLOCATE(ep(klon, klev))                          ! epmax_cape
+    ALLOCATE(da(klon, klev), mp(klon, klev))
+    ALLOCATE(phi(klon, klev, klev))
+    ALLOCATE(wght_cvfd(klon, klev))
+    ALLOCATE(phi2(klon, klev, klev))
+    ALLOCATE(d1a(klon, klev), dam(klon, klev))
+    ALLOCATE(ev(klon, klev))
+    ALLOCATE(elij(klon, klev, klev))
+    ALLOCATE(qtaa(klon, klev))
+    ALLOCATE(clw(klon, klev))
+    ALLOCATE(epmlmMm(klon, klev, klev), eplaMm(klon, klev))
+    ALLOCATE(sij(klon, klev, klev))
 #ifdef ISO
       ALLOCATE(xtwdtrainA(ntraciso,klon,klev))
@@ -1173,31 +1172,30 @@
 #endif
 
-      ALLOCATE(prfl(klon, klev+1))
-      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
-      ALLOCATE(bsfl(klon,klev+1))
-      ALLOCATE(zw2(klon, klev+1))
-
-      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
-      ALLOCATE(fluxt(klon, klev, nbsrf))
-
-      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
-      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
-      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
-      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
-
-! ug et d'autres encore:
-      ALLOCATE(beta_prec(klon,klev))
-      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
-      ALLOCATE(pfraclr(klon,klev),pfracld(klon,klev))
-      pfraclr(:,:)=0. ; pfracld(:,:)=0. ! because not always defined
-      ALLOCATE(cldfraliq(klon,klev))
-      ALLOCATE(sigma2_icefracturb(klon,klev))
-      ALLOCATE(mean_icefracturb(klon,klev))
-      ALLOCATE(distcltop(klon,klev))
-      ALLOCATE(temp_cltop(klon,klev))
-
-
-      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
-      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
+    ALLOCATE(prfl(klon, klev + 1))
+    ALLOCATE(psfl(klon, klev + 1), fraca(klon, klev + 1), Vprecip(klon, klev + 1))
+    ALLOCATE(bsfl(klon, klev + 1))
+    ALLOCATE(zw2(klon, klev + 1))
+
+    ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
+    ALLOCATE(fluxt(klon, klev, nbsrf))
+
+    ALLOCATE(uwriteSTD(klon, nlevSTD, nfiles), vwriteSTD(klon, nlevSTD, nfiles))
+    ALLOCATE(wwriteSTD(klon, nlevSTD, nfiles), phiwriteSTD(klon, nlevSTD, nfiles))
+    ALLOCATE(qwriteSTD(klon, nlevSTD, nfiles), twriteSTD(klon, nlevSTD, nfiles))
+    ALLOCATE(rhwriteSTD(klon, nlevSTD, nfiles))
+
+    ! ug et d'autres encore:
+    ALLOCATE(beta_prec(klon, klev))
+    ALLOCATE(rneb(klon, klev), rnebjn(klon, klev), rneblsvol(klon, klev))
+    ALLOCATE(pfraclr(klon, klev), pfracld(klon, klev))
+    pfraclr(:, :) = 0. ; pfracld(:, :) = 0. ! because not always defined
+    ALLOCATE(cldfraliq(klon, klev))
+    ALLOCATE(sigma2_icefracturb(klon, klev))
+    ALLOCATE(mean_icefracturb(klon, klev))
+    ALLOCATE(distcltop(klon, klev))
+    ALLOCATE(temp_cltop(klon, klev))
+
+    ALLOCATE (zxsnow(klon), snowhgt(klon), qsnow(klon), to_ice(klon))
+    ALLOCATE (sissnow(klon), runoff(klon), albsol3_lic(klon))
 #ifdef ISO
       ALLOCATE (zxxtsnow(niso,klon))
@@ -1206,52 +1204,52 @@
 #endif
 
-      ALLOCATE (p_tropopause(klon))
-      ALLOCATE (z_tropopause(klon))
-      ALLOCATE (t_tropopause(klon))
-
-      ALLOCATE(zn2mout(klon,6))
-
-! Supersaturation
-      ALLOCATE(rneb_seri(klon,klev))
-      ALLOCATE(d_rneb_dyn(klon,klev))
-      ALLOCATE(qclr(klon,klev), qcld(klon,klev), qss(klon,klev), qvc(klon,klev))
-      ALLOCATE(rnebclr(klon,klev), rnebss(klon,klev), gamma_ss(klon,klev))
-      ALLOCATE(N1_ss(klon,klev), N2_ss(klon,klev))
-      ALLOCATE(drneb_sub(klon,klev), drneb_con(klon,klev), drneb_tur(klon,klev), drneb_avi(klon,klev))
-      ALLOCATE(zqsatl(klon,klev), zqsats(klon,klev))
-      ALLOCATE(Tcontr(klon,klev), qcontr(klon,klev), qcontr2(klon,klev), fcontrN(klon,klev), fcontrP(klon,klev))
-
-!--POPRECIP variables
-      ALLOCATE(qraindiag(klon,klev), qsnowdiag(klon,klev))
-      ALLOCATE(dqreva(klon,klev), dqssub(klon,klev))
-      ALLOCATE(dqrauto(klon,klev), dqrcol(klon,klev), dqrmelt(klon,klev), dqrfreez(klon,klev))
-      ALLOCATE(dqsauto(klon,klev), dqsagg(klon,klev), dqsrim(klon,klev), dqsmelt(klon,klev), dqsfreez(klon,klev))
-
-#ifdef CPP_StratAer
-      ALLOCATE (d_q_emiss(klon,klev))
-      ALLOCATE (R2SO4(klon,klev))
-      ALLOCATE (R2SO4B(klon,klev,nbtr_bin))
-      ALLOCATE (DENSO4(klon,klev))
-      ALLOCATE (DENSO4B(klon,klev,nbtr_bin))
-      ALLOCATE (f_r_wet(klon,klev))
-      ALLOCATE (f_r_wetB(klon,klev,nbtr_bin))
-      ALLOCATE (decfluxaer(klon,nbtr))
+    ALLOCATE (p_tropopause(klon))
+    ALLOCATE (z_tropopause(klon))
+    ALLOCATE (t_tropopause(klon))
+
+    ALLOCATE(zn2mout(klon, 6))
+
+    ! Supersaturation
+    ALLOCATE(rneb_seri(klon, klev))
+    ALLOCATE(d_rneb_dyn(klon, klev))
+    ALLOCATE(qclr(klon, klev), qcld(klon, klev), qss(klon, klev), qvc(klon, klev))
+    ALLOCATE(rnebclr(klon, klev), rnebss(klon, klev), gamma_ss(klon, klev))
+    ALLOCATE(N1_ss(klon, klev), N2_ss(klon, klev))
+    ALLOCATE(drneb_sub(klon, klev), drneb_con(klon, klev), drneb_tur(klon, klev), drneb_avi(klon, klev))
+    ALLOCATE(zqsatl(klon, klev), zqsats(klon, klev))
+    ALLOCATE(Tcontr(klon, klev), qcontr(klon, klev), qcontr2(klon, klev), fcontrN(klon, klev), fcontrP(klon, klev))
+
+    !--POPRECIP variables
+    ALLOCATE(qraindiag(klon, klev), qsnowdiag(klon, klev))
+    ALLOCATE(dqreva(klon, klev), dqssub(klon, klev))
+    ALLOCATE(dqrauto(klon, klev), dqrcol(klon, klev), dqrmelt(klon, klev), dqrfreez(klon, klev))
+    ALLOCATE(dqsauto(klon, klev), dqsagg(klon, klev), dqsrim(klon, klev), dqsmelt(klon, klev), dqsfreez(klon, klev))
+
+    IF (CPPKEY_STRATAER) THEN
+      ALLOCATE (d_q_emiss(klon, klev))
+      ALLOCATE (R2SO4(klon, klev))
+      ALLOCATE (R2SO4B(klon, klev, nbtr_bin))
+      ALLOCATE (DENSO4(klon, klev))
+      ALLOCATE (DENSO4B(klon, klev, nbtr_bin))
+      ALLOCATE (f_r_wet(klon, klev))
+      ALLOCATE (f_r_wetB(klon, klev, nbtr_bin))
+      ALLOCATE (decfluxaer(klon, nbtr))
       ALLOCATE (mdw(nbtr))
-      ALLOCATE (budg_3D_nucl(klon,klev))
-      ALLOCATE (budg_3D_cond_evap(klon,klev))
-      ALLOCATE (budg_3D_ocs_to_so2(klon,klev))
-      ALLOCATE (budg_3D_so2_to_h2so4(klon,klev))
-      ALLOCATE (budg_3D_backgr_ocs(klon,klev))
-      ALLOCATE (budg_3D_backgr_so2(klon,klev))
-      ALLOCATE (OCS_lifetime(klon,klev))
-      ALLOCATE (SO2_lifetime(klon,klev))
-      ALLOCATE (H2SO4_lifetime(klon,klev))
-      ALLOCATE (O3_clim(klon,klev))
-      ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
-      ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
-      ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
-      ALLOCATE (tau_strat_550(klon,klev))
-      ALLOCATE (tau_strat_1020(klon,klev))
-      ALLOCATE (tausum_strat(klon,3))
+      ALLOCATE (budg_3D_nucl(klon, klev))
+      ALLOCATE (budg_3D_cond_evap(klon, klev))
+      ALLOCATE (budg_3D_ocs_to_so2(klon, klev))
+      ALLOCATE (budg_3D_so2_to_h2so4(klon, klev))
+      ALLOCATE (budg_3D_backgr_ocs(klon, klev))
+      ALLOCATE (budg_3D_backgr_so2(klon, klev))
+      ALLOCATE (OCS_lifetime(klon, klev))
+      ALLOCATE (SO2_lifetime(klon, klev))
+      ALLOCATE (H2SO4_lifetime(klon, klev))
+      ALLOCATE (O3_clim(klon, klev))
+      ALLOCATE (alpha_bin(nbands_sw_rrtm + nbands_lw_rrtm + nwave, nbtr))
+      ALLOCATE (piz_bin(nbands_sw_rrtm + nbands_lw_rrtm + nwave, nbtr))
+      ALLOCATE (cg_bin(nbands_sw_rrtm + nbands_lw_rrtm + nwave, nbtr))
+      ALLOCATE (tau_strat_550(klon, klev))
+      ALLOCATE (tau_strat_1020(klon, klev))
+      ALLOCATE (tausum_strat(klon, 3))
       ALLOCATE (budg_dep_dry_ocs(klon))
       ALLOCATE (budg_dep_wet_ocs(klon))
@@ -1271,58 +1269,58 @@
       ALLOCATE (budg_sed_part(klon))
       ALLOCATE (surf_PM25_sulf(klon))
-      ALLOCATE (vsed_aer(klon,klev))
-      ALLOCATE (sulfmmr(klon,klev))
-      ALLOCATE (SAD_sulfate(klon,klev))
-      ALLOCATE (sulfmmr_mode(klon,klev,nbtr_bin))
-      ALLOCATE (nd_mode(klon,klev,nbtr_bin))
-#endif
-
-END SUBROUTINE phys_local_var_init
-
-!======================================================================
-SUBROUTINE phys_local_var_end
-USE dimphy
-USE indice_sol_mod
-IMPLICIT NONE
-      DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri, qbs_seri)
-! SN 4D ISO
-      DEALLOCATE(qx_seri)
-! SN
-      DEALLOCATE(u_seri,v_seri)
-      DEALLOCATE(l_mixmin,l_mix,wprime)
-      DEALLOCATE(tke_shear,tke_buoy,tke_trans)
-      DEALLOCATE(pbl_eps)
-      DEALLOCATE(rhcl)
-      DEALLOCATE(tr_seri)
-      DEALLOCATE(d_t_dyn,d_q_dyn)
-      DEALLOCATE(d_ql_dyn,d_qs_dyn, d_qbs_dyn)
-      DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d, d_qbs_dyn2d)
-      DEALLOCATE(d_u_dyn,d_v_dyn)
-      DEALLOCATE(d_tr_dyn)                      !RomP
-      DEALLOCATE(d_t_con,d_q_con,d_q_con_zmasse)
-      DEALLOCATE(d_u_con,d_v_con)
-      DEALLOCATE(d_t_wake,d_q_wake)
-      DEALLOCATE(d_t_lsc,d_q_lsc)
-      DEALLOCATE(d_t_lwr,d_t_lw0)
-      DEALLOCATE(d_t_swr,d_t_sw0)
-      DEALLOCATE(d_ql_lsc,d_qi_lsc)
-      DEALLOCATE(d_t_ajsb,d_q_ajsb)
-      DEALLOCATE(d_t_ajs,d_q_ajs)
-!nrlmd<
-      DEALLOCATE(d_t_ajs_w,d_q_ajs_w)
-      DEALLOCATE(d_t_ajs_x,d_q_ajs_x)
-!>nrlmd
-      DEALLOCATE(d_u_ajs,d_v_ajs)
-      DEALLOCATE(d_t_eva,d_q_eva)
-! SN 4D ISO
-      DEALLOCATE(d_qx_eva)
-! SN
-      DEALLOCATE(d_ql_eva,d_qi_eva)
-      DEALLOCATE(d_t_lscst,d_q_lscst)
-      DEALLOCATE(d_t_lscth,d_q_lscth)
-      DEALLOCATE(plul_st,plul_th)
-      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
-      DEALLOCATE(d_qbs_vdf)
-      DEALLOCATE(d_t_bsss,d_q_bsss,d_qbs_bsss)
+      ALLOCATE (vsed_aer(klon, klev))
+      ALLOCATE (sulfmmr(klon, klev))
+      ALLOCATE (SAD_sulfate(klon, klev))
+      ALLOCATE (sulfmmr_mode(klon, klev, nbtr_bin))
+      ALLOCATE (nd_mode(klon, klev, nbtr_bin))
+    END IF
+
+  END SUBROUTINE phys_local_var_init
+
+  !======================================================================
+  SUBROUTINE phys_local_var_end
+    USE dimphy
+    USE indice_sol_mod
+    IMPLICIT NONE
+    DEALLOCATE(t_seri, q_seri, ql_seri, qs_seri, qbs_seri)
+    ! SN 4D ISO
+    DEALLOCATE(qx_seri)
+    ! SN
+    DEALLOCATE(u_seri, v_seri)
+    DEALLOCATE(l_mixmin, l_mix, wprime)
+    DEALLOCATE(tke_shear, tke_buoy, tke_trans)
+    DEALLOCATE(pbl_eps)
+    DEALLOCATE(rhcl)
+    DEALLOCATE(tr_seri)
+    DEALLOCATE(d_t_dyn, d_q_dyn)
+    DEALLOCATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
+    DEALLOCATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
+    DEALLOCATE(d_u_dyn, d_v_dyn)
+    DEALLOCATE(d_tr_dyn)                      !RomP
+    DEALLOCATE(d_t_con, d_q_con, d_q_con_zmasse)
+    DEALLOCATE(d_u_con, d_v_con)
+    DEALLOCATE(d_t_wake, d_q_wake)
+    DEALLOCATE(d_t_lsc, d_q_lsc)
+    DEALLOCATE(d_t_lwr, d_t_lw0)
+    DEALLOCATE(d_t_swr, d_t_sw0)
+    DEALLOCATE(d_ql_lsc, d_qi_lsc)
+    DEALLOCATE(d_t_ajsb, d_q_ajsb)
+    DEALLOCATE(d_t_ajs, d_q_ajs)
+    !nrlmd<
+    DEALLOCATE(d_t_ajs_w, d_q_ajs_w)
+    DEALLOCATE(d_t_ajs_x, d_q_ajs_x)
+    !>nrlmd
+    DEALLOCATE(d_u_ajs, d_v_ajs)
+    DEALLOCATE(d_t_eva, d_q_eva)
+    ! SN 4D ISO
+    DEALLOCATE(d_qx_eva)
+    ! SN
+    DEALLOCATE(d_ql_eva, d_qi_eva)
+    DEALLOCATE(d_t_lscst, d_q_lscst)
+    DEALLOCATE(d_t_lscth, d_q_lscth)
+    DEALLOCATE(plul_st, plul_th)
+    DEALLOCATE(d_t_vdf, d_q_vdf, d_t_diss)
+    DEALLOCATE(d_qbs_vdf)
+    DEALLOCATE(d_t_bsss, d_q_bsss, d_qbs_bsss)
 #ifdef ISO
       deallocate(xt_seri,xtl_seri,xts_seri,xtbs_seri)
@@ -1347,107 +1345,107 @@
 #endif
 
-      DEALLOCATE(d_u_vdf,d_v_vdf)
-      DEALLOCATE(d_t_oli,d_t_oro)
-      DEALLOCATE(d_u_oli,d_v_oli)
-      DEALLOCATE(d_u_oro,d_v_oro)
-      DEALLOCATE(d_t_oro_gw)
-      DEALLOCATE(d_u_oro_gw,d_v_oro_gw)
-      DEALLOCATE(d_t_lif,d_t_ec)
-      DEALLOCATE(d_u_lif,d_v_lif)
-      DEALLOCATE(d_ts, d_tr)
-      DEALLOCATE(topswad_aero,solswad_aero)
-      DEALLOCATE(topswai_aero,solswai_aero)
-      DEALLOCATE(topswad0_aero,solswad0_aero)
-      DEALLOCATE(toplwad_aero,sollwad_aero)
-      DEALLOCATE(toplwai_aero,sollwai_aero)
-      DEALLOCATE(toplwad0_aero,sollwad0_aero)
-      DEALLOCATE(topsw_aero,solsw_aero)
-      DEALLOCATE(topsw0_aero,solsw0_aero)
-      DEALLOCATE(topswcf_aero,solswcf_aero)
-      DEALLOCATE(stratomask) 
-      DEALLOCATE(tausum_aero) 
-      DEALLOCATE(drytausum_aero) 
-      DEALLOCATE(tau3d_aero) 
-      DEALLOCATE(dNovrN)
-      DEALLOCATE(zfice)
-      DEALLOCATE(od443aer)
-      DEALLOCATE(od550aer)
-      DEALLOCATE(od865aer)
-      DEALLOCATE(dryod550aer)
-      DEALLOCATE(abs550aer)
-      DEALLOCATE(ec550aer)
-      DEALLOCATE(od550lt1aer)
-      DEALLOCATE(sconcso4) 
-      DEALLOCATE(sconcno3) 
-      DEALLOCATE(sconcoa) 
-      DEALLOCATE(sconcbc) 
-      DEALLOCATE(sconcss) 
-      DEALLOCATE(sconcdust) 
-      DEALLOCATE(concso4) 
-      DEALLOCATE(concno3) 
-      DEALLOCATE(concoa) 
-      DEALLOCATE(concbc) 
-      DEALLOCATE(concss) 
-      DEALLOCATE(concdust) 
-      DEALLOCATE(loadso4) 
-      DEALLOCATE(loadoa) 
-      DEALLOCATE(loadbc) 
-      DEALLOCATE(loadss) 
-      DEALLOCATE(loaddust) 
-      DEALLOCATE(loadno3) 
-      DEALLOCATE(load_tmp1)
-      DEALLOCATE(load_tmp2)
-      DEALLOCATE(load_tmp3)
-      DEALLOCATE(load_tmp4)
-      DEALLOCATE(load_tmp5)
-      DEALLOCATE(load_tmp6)
-      DEALLOCATE(load_tmp7)
-      DEALLOCATE(load_tmp8)
-      DEALLOCATE(load_tmp9)
-      DEALLOCATE(load_tmp10)
-      DEALLOCATE(du_gwd_hines,dv_gwd_hines,d_t_hin)
-      DEALLOCATE(d_q_ch4)
-      DEALLOCATE(dv_gwd_rando,dv_gwd_front)
-      DEALLOCATE(east_gwstress,west_gwstress)
-
-!IM ajout variables CFMIP2/CMIP5
-      DEALLOCATE(topswad_aerop, solswad_aerop)
-      DEALLOCATE(topswai_aerop, solswai_aerop)
-      DEALLOCATE(topswad0_aerop, solswad0_aerop)
-      DEALLOCATE(topsw_aerop, topsw0_aerop)
-      DEALLOCATE(solsw_aerop, solsw0_aerop)
-      DEALLOCATE(topswcf_aerop, solswcf_aerop)
-!CK LW diagnostics
-      DEALLOCATE(toplwad_aerop, sollwad_aerop)
-      DEALLOCATE(toplwai_aerop, sollwai_aerop)
-      DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
-
-!AI Ajout pour Ecrad (3Deffect)
-      DEALLOCATE(topswad_aero_s2, solswad_aero_s2)
-      DEALLOCATE(topswai_aero_s2, solswai_aero_s2)
-      DEALLOCATE(topswad0_aero_s2, solswad0_aero_s2)
-      DEALLOCATE(topsw_aero_s2, topsw0_aero_s2)
-      DEALLOCATE(solsw_aero_s2, solsw0_aero_s2)
-      DEALLOCATE(topswcf_aero_s2, solswcf_aero_s2)
-!CK LW diagnostics
-      DEALLOCATE(toplwad_aero_s2, sollwad_aero_s2)
-      DEALLOCATE(toplwai_aero_s2, sollwai_aero_s2)
-      DEALLOCATE(toplwad0_aero_s2, sollwad0_aero_s2)      
-
-! FH Ajout de celles necessaires au phys_output_write_mod
-      DEALLOCATE(tal1, pal1, pab1, pab2)
-      DEALLOCATE(ptstar, pt0, slp)
-!
-      DEALLOCATE(alp_wake)
-      DEALLOCATE(wake_h,wake_k)
-      DEALLOCATE(wake_omg)
-      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
-      DEALLOCATE(d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
-      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
-      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
-!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
-      DEALLOCATE(d_deltat_the, d_deltaq_the)
-!!      DEALLOCATE( d_s_the, d_dens_the)
-      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
+    DEALLOCATE(d_u_vdf, d_v_vdf)
+    DEALLOCATE(d_t_oli, d_t_oro)
+    DEALLOCATE(d_u_oli, d_v_oli)
+    DEALLOCATE(d_u_oro, d_v_oro)
+    DEALLOCATE(d_t_oro_gw)
+    DEALLOCATE(d_u_oro_gw, d_v_oro_gw)
+    DEALLOCATE(d_t_lif, d_t_ec)
+    DEALLOCATE(d_u_lif, d_v_lif)
+    DEALLOCATE(d_ts, d_tr)
+    DEALLOCATE(topswad_aero, solswad_aero)
+    DEALLOCATE(topswai_aero, solswai_aero)
+    DEALLOCATE(topswad0_aero, solswad0_aero)
+    DEALLOCATE(toplwad_aero, sollwad_aero)
+    DEALLOCATE(toplwai_aero, sollwai_aero)
+    DEALLOCATE(toplwad0_aero, sollwad0_aero)
+    DEALLOCATE(topsw_aero, solsw_aero)
+    DEALLOCATE(topsw0_aero, solsw0_aero)
+    DEALLOCATE(topswcf_aero, solswcf_aero)
+    DEALLOCATE(stratomask)
+    DEALLOCATE(tausum_aero)
+    DEALLOCATE(drytausum_aero)
+    DEALLOCATE(tau3d_aero)
+    DEALLOCATE(dNovrN)
+    DEALLOCATE(zfice)
+    DEALLOCATE(od443aer)
+    DEALLOCATE(od550aer)
+    DEALLOCATE(od865aer)
+    DEALLOCATE(dryod550aer)
+    DEALLOCATE(abs550aer)
+    DEALLOCATE(ec550aer)
+    DEALLOCATE(od550lt1aer)
+    DEALLOCATE(sconcso4)
+    DEALLOCATE(sconcno3)
+    DEALLOCATE(sconcoa)
+    DEALLOCATE(sconcbc)
+    DEALLOCATE(sconcss)
+    DEALLOCATE(sconcdust)
+    DEALLOCATE(concso4)
+    DEALLOCATE(concno3)
+    DEALLOCATE(concoa)
+    DEALLOCATE(concbc)
+    DEALLOCATE(concss)
+    DEALLOCATE(concdust)
+    DEALLOCATE(loadso4)
+    DEALLOCATE(loadoa)
+    DEALLOCATE(loadbc)
+    DEALLOCATE(loadss)
+    DEALLOCATE(loaddust)
+    DEALLOCATE(loadno3)
+    DEALLOCATE(load_tmp1)
+    DEALLOCATE(load_tmp2)
+    DEALLOCATE(load_tmp3)
+    DEALLOCATE(load_tmp4)
+    DEALLOCATE(load_tmp5)
+    DEALLOCATE(load_tmp6)
+    DEALLOCATE(load_tmp7)
+    DEALLOCATE(load_tmp8)
+    DEALLOCATE(load_tmp9)
+    DEALLOCATE(load_tmp10)
+    DEALLOCATE(du_gwd_hines, dv_gwd_hines, d_t_hin)
+    DEALLOCATE(d_q_ch4)
+    DEALLOCATE(dv_gwd_rando, dv_gwd_front)
+    DEALLOCATE(east_gwstress, west_gwstress)
+
+    !IM ajout variables CFMIP2/CMIP5
+    DEALLOCATE(topswad_aerop, solswad_aerop)
+    DEALLOCATE(topswai_aerop, solswai_aerop)
+    DEALLOCATE(topswad0_aerop, solswad0_aerop)
+    DEALLOCATE(topsw_aerop, topsw0_aerop)
+    DEALLOCATE(solsw_aerop, solsw0_aerop)
+    DEALLOCATE(topswcf_aerop, solswcf_aerop)
+    !CK LW diagnostics
+    DEALLOCATE(toplwad_aerop, sollwad_aerop)
+    DEALLOCATE(toplwai_aerop, sollwai_aerop)
+    DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
+
+    !AI Ajout pour Ecrad (3Deffect)
+    DEALLOCATE(topswad_aero_s2, solswad_aero_s2)
+    DEALLOCATE(topswai_aero_s2, solswai_aero_s2)
+    DEALLOCATE(topswad0_aero_s2, solswad0_aero_s2)
+    DEALLOCATE(topsw_aero_s2, topsw0_aero_s2)
+    DEALLOCATE(solsw_aero_s2, solsw0_aero_s2)
+    DEALLOCATE(topswcf_aero_s2, solswcf_aero_s2)
+    !CK LW diagnostics
+    DEALLOCATE(toplwad_aero_s2, sollwad_aero_s2)
+    DEALLOCATE(toplwai_aero_s2, sollwai_aero_s2)
+    DEALLOCATE(toplwad0_aero_s2, sollwad0_aero_s2)
+
+    ! FH Ajout de celles necessaires au phys_output_write_mod
+    DEALLOCATE(tal1, pal1, pab1, pab2)
+    DEALLOCATE(ptstar, pt0, slp)
+    !
+    DEALLOCATE(alp_wake)
+    DEALLOCATE(wake_h, wake_k)
+    DEALLOCATE(wake_omg)
+    DEALLOCATE(d_deltat_wk, d_deltaq_wk)
+    DEALLOCATE(d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
+    DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
+    DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
+    !!      DEALLOCATE( d_s_vdf, d_dens_vdf)
+    DEALLOCATE(d_deltat_the, d_deltaq_the)
+    !!      DEALLOCATE( d_s_the, d_dens_the)
+    DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
 #ifdef ISO
       DEALLOCATE(d_deltaxt_wk)
@@ -1456,43 +1454,43 @@
       DEALLOCATE(d_deltaxt_vdf)
 #endif
-!
-      DEALLOCATE(bils)
-      DEALLOCATE(cdragm, cdragh, cldh, cldl)
-      DEALLOCATE(cldm, cldq, cldt, qsat2m)
-      DEALLOCATE(JrNt)
-      DEALLOCATE(dthmin, evap, snowerosion, fder, plcl, plfc)
-      DEALLOCATE(prw, prlw, prsw, prbsw, water_budget, zustar, zu10m, zv10m, rh2m, s_lcl)
-      DEALLOCATE(s_pblh, s_pblt, s_therm)
-!
-!nrlmd+jyg<
-      DEALLOCATE(s_pblh_x, s_pblh_w)
-      DEALLOCATE(s_lcl_x, s_lcl_w)
-!>nrlmd+jyg
-!
-      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
-      DEALLOCATE(uq, ve, vq, zxffonte)
-      DEALLOCATE(uwat, vwat)
-      DEALLOCATE(zxfqcalving, zxfluxlat)
-      DEALLOCATE(zxrunofflic)
-      DEALLOCATE(zxustartlic, zxrhoslic, zxqsaltlic)
-      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
-      DEALLOCATE(rain_lsc)
-      DEALLOCATE(rain_num)
-      DEALLOCATE(qlth, qith, qsith, wiceth)
-!
-      DEALLOCATE(sens_x, sens_w)
-      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
-      DEALLOCATE(delta_qsurf)
-!jyg<
-!!      DEALLOCATE(t_x, t_w)
-!!      DEALLOCATE(q_x, q_w)
-!>jyg
-      DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
-      DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
-      DEALLOCATE(pbl_tke_input)
-      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
-      DEALLOCATE(cdragh_x, cdragh_w)
-      DEALLOCATE(cdragm_x, cdragm_w)
-      DEALLOCATE(kh, kh_x, kh_w)
+    !
+    DEALLOCATE(bils)
+    DEALLOCATE(cdragm, cdragh, cldh, cldl)
+    DEALLOCATE(cldm, cldq, cldt, qsat2m)
+    DEALLOCATE(JrNt)
+    DEALLOCATE(dthmin, evap, snowerosion, fder, plcl, plfc)
+    DEALLOCATE(prw, prlw, prsw, prbsw, water_budget, zustar, zu10m, zv10m, rh2m, s_lcl)
+    DEALLOCATE(s_pblh, s_pblt, s_therm)
+    !
+    !nrlmd+jyg<
+    DEALLOCATE(s_pblh_x, s_pblh_w)
+    DEALLOCATE(s_lcl_x, s_lcl_w)
+    !>nrlmd+jyg
+    !
+    DEALLOCATE(slab_wfbils, tpot, tpote, ue)
+    DEALLOCATE(uq, ve, vq, zxffonte)
+    DEALLOCATE(uwat, vwat)
+    DEALLOCATE(zxfqcalving, zxfluxlat)
+    DEALLOCATE(zxrunofflic)
+    DEALLOCATE(zxustartlic, zxrhoslic, zxqsaltlic)
+    DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
+    DEALLOCATE(rain_lsc)
+    DEALLOCATE(rain_num)
+    DEALLOCATE(qlth, qith, qsith, wiceth)
+    !
+    DEALLOCATE(sens_x, sens_w)
+    DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
+    DEALLOCATE(delta_qsurf)
+    !jyg<
+    !!      DEALLOCATE(t_x, t_w)
+    !!      DEALLOCATE(q_x, q_w)
+    !>jyg
+    DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
+    DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
+    DEALLOCATE(pbl_tke_input)
+    DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
+    DEALLOCATE(cdragh_x, cdragh_w)
+    DEALLOCATE(cdragm_x, cdragm_w)
+    DEALLOCATE(kh, kh_x, kh_w)
 #ifdef ISO
       DEALLOCATE(xtevap,xtprw)
@@ -1505,53 +1503,53 @@
       DEALLOCATE(h1_diag,runoff_diag,xtrunoff_diag)
 #endif
-!
-      DEALLOCATE(ptconv)
-      DEALLOCATE(ratqsc)
-!
-      DEALLOCATE(wbeff, convoccur, zmax_th)
-      DEALLOCATE(zq2m, zt2m, weak_inversion)
-      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
-      DEALLOCATE(t2m_min_mon, t2m_max_mon)
-      DEALLOCATE(sens, flwp, fiwp)
-      DEALLOCATE(alp_bl_conv,alp_bl_det)
-      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
-      DEALLOCATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
-      DEALLOCATE(proba_notrig, random_notrig)
-!FC
-      DEALLOCATE(zxfluxq,zxfluxt)
-
-      DEALLOCATE(dnwd0)
-!      DEALLOCATE(upwd, omega, coefh)
-      DEALLOCATE(omega)
-      DEALLOCATE(epmax_diag)
-!      DEALLOCATE(coefm, lambda_th, cldemi)
-      DEALLOCATE(lambda_th, cldemi)
-      DEALLOCATE(cldfra, cldtau, fiwc)
-      DEALLOCATE(fl, re, flwc)
-      DEALLOCATE(ref_liq, ref_ice, theta)
-      DEALLOCATE(ref_liq_pi, ref_ice_pi)
-      DEALLOCATE(zphi, zx_rh, zx_rhl, zx_rhi)
-      DEALLOCATE(pmfd, pmfu)
-
-      DEALLOCATE(t2m, fluxlat)
-      DEALLOCATE(fsollw, evap_pot)
-      DEALLOCATE(fsolsw, wfbils)
-      DEALLOCATE(wfevap)
-
-      DEALLOCATE(pmflxr, pmflxs)
-      DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
-      DEALLOCATE(upwd, dnwd)
-      DEALLOCATE(ep)
-      DEALLOCATE(da, mp)
-      DEALLOCATE(phi)
-      DEALLOCATE(wght_cvfd)
-      DEALLOCATE(phi2)
-      DEALLOCATE(d1a, dam)
-      DEALLOCATE(ev)
-      DEALLOCATE(elij)
-      DEALLOCATE(qtaa)
-      DEALLOCATE(clw)
-      DEALLOCATE(epmlmMm, eplaMm)
-      DEALLOCATE(sij)
+    !
+    DEALLOCATE(ptconv)
+    DEALLOCATE(ratqsc)
+    !
+    DEALLOCATE(wbeff, convoccur, zmax_th)
+    DEALLOCATE(zq2m, zt2m, weak_inversion)
+    DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
+    DEALLOCATE(t2m_min_mon, t2m_max_mon)
+    DEALLOCATE(sens, flwp, fiwp)
+    DEALLOCATE(alp_bl_conv, alp_bl_det)
+    DEALLOCATE(alp_bl_fluct_m, alp_bl_fluct_tke)
+    DEALLOCATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
+    DEALLOCATE(proba_notrig, random_notrig)
+    !FC
+    DEALLOCATE(zxfluxq, zxfluxt)
+
+    DEALLOCATE(dnwd0)
+    !      DEALLOCATE(upwd, omega, coefh)
+    DEALLOCATE(omega)
+    DEALLOCATE(epmax_diag)
+    !      DEALLOCATE(coefm, lambda_th, cldemi)
+    DEALLOCATE(lambda_th, cldemi)
+    DEALLOCATE(cldfra, cldtau, fiwc)
+    DEALLOCATE(fl, re, flwc)
+    DEALLOCATE(ref_liq, ref_ice, theta)
+    DEALLOCATE(ref_liq_pi, ref_ice_pi)
+    DEALLOCATE(zphi, zx_rh, zx_rhl, zx_rhi)
+    DEALLOCATE(pmfd, pmfu)
+
+    DEALLOCATE(t2m, fluxlat)
+    DEALLOCATE(fsollw, evap_pot)
+    DEALLOCATE(fsolsw, wfbils)
+    DEALLOCATE(wfevap)
+
+    DEALLOCATE(pmflxr, pmflxs)
+    DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
+    DEALLOCATE(upwd, dnwd)
+    DEALLOCATE(ep)
+    DEALLOCATE(da, mp)
+    DEALLOCATE(phi)
+    DEALLOCATE(wght_cvfd)
+    DEALLOCATE(phi2)
+    DEALLOCATE(d1a, dam)
+    DEALLOCATE(ev)
+    DEALLOCATE(elij)
+    DEALLOCATE(qtaa)
+    DEALLOCATE(clw)
+    DEALLOCATE(epmlmMm, eplaMm)
+    DEALLOCATE(sij)
 #ifdef ISO
       DEALLOCATE(xtwdtrainA)
@@ -1579,51 +1577,51 @@
 
 
-      DEALLOCATE(prfl, psfl, bsfl, fraca, Vprecip)
-      DEALLOCATE(zw2)
-
-      DEALLOCATE(fluxu, fluxv)
-      DEALLOCATE(fluxt)
-
-      DEALLOCATE(uwriteSTD, vwriteSTD)
-      DEALLOCATE(wwriteSTD, phiwriteSTD)
-      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
-
-! ug et d'autres encore:
-      DEALLOCATE(beta_prec)
-      DEALLOCATE(rneb)
-      DEALLOCATE(pfraclr,pfracld)
-      DEALLOCATE(cldfraliq)
-      DEALLOCATE(sigma2_icefracturb)
-      DEALLOCATE(mean_icefracturb)
-      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
-      DEALLOCATE(distcltop)
-      DEALLOCATE(temp_cltop)
+    DEALLOCATE(prfl, psfl, bsfl, fraca, Vprecip)
+    DEALLOCATE(zw2)
+
+    DEALLOCATE(fluxu, fluxv)
+    DEALLOCATE(fluxt)
+
+    DEALLOCATE(uwriteSTD, vwriteSTD)
+    DEALLOCATE(wwriteSTD, phiwriteSTD)
+    DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
+
+    ! ug et d'autres encore:
+    DEALLOCATE(beta_prec)
+    DEALLOCATE(rneb)
+    DEALLOCATE(pfraclr, pfracld)
+    DEALLOCATE(cldfraliq)
+    DEALLOCATE(sigma2_icefracturb)
+    DEALLOCATE(mean_icefracturb)
+    DEALLOCATE (zxsnow, snowhgt, qsnow, to_ice, sissnow, runoff, albsol3_lic)
+    DEALLOCATE(distcltop)
+    DEALLOCATE(temp_cltop)
 #ifdef ISO
       DEALLOCATE (zxxtsnow,xtVprecip,xtVprecipi,pxtrfl,pxtsfl)
 #endif
 
-      DEALLOCATE (p_tropopause)
-      DEALLOCATE (z_tropopause)
-      DEALLOCATE (t_tropopause)
-      DEALLOCATE(zn2mout)
-
-! Supersaturation
-      DEALLOCATE(rneb_seri)
-      DEALLOCATE(d_rneb_dyn)
-      DEALLOCATE(qclr, qcld, qss, qvc)
-      DEALLOCATE(rnebclr, rnebss, gamma_ss)
-      DEALLOCATE(N1_ss, N2_ss)
-      DEALLOCATE(drneb_sub, drneb_con, drneb_tur, drneb_avi)
-      DEALLOCATE(zqsatl, zqsats)
-      DEALLOCATE(Tcontr, qcontr, qcontr2, fcontrN, fcontrP)
-
-!--POPRECIP variables
-      DEALLOCATE(qraindiag, qsnowdiag)
-      DEALLOCATE(dqreva, dqssub)
-      DEALLOCATE(dqrauto, dqrcol, dqrmelt, dqrfreez)
-      DEALLOCATE(dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
-
-#ifdef CPP_StratAer
-! variables for strat. aerosol CK
+    DEALLOCATE (p_tropopause)
+    DEALLOCATE (z_tropopause)
+    DEALLOCATE (t_tropopause)
+    DEALLOCATE(zn2mout)
+
+    ! Supersaturation
+    DEALLOCATE(rneb_seri)
+    DEALLOCATE(d_rneb_dyn)
+    DEALLOCATE(qclr, qcld, qss, qvc)
+    DEALLOCATE(rnebclr, rnebss, gamma_ss)
+    DEALLOCATE(N1_ss, N2_ss)
+    DEALLOCATE(drneb_sub, drneb_con, drneb_tur, drneb_avi)
+    DEALLOCATE(zqsatl, zqsats)
+    DEALLOCATE(Tcontr, qcontr, qcontr2, fcontrN, fcontrP)
+
+    !--POPRECIP variables
+    DEALLOCATE(qraindiag, qsnowdiag)
+    DEALLOCATE(dqreva, dqssub)
+    DEALLOCATE(dqrauto, dqrcol, dqrmelt, dqrfreez)
+    DEALLOCATE(dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
+
+    IF (CPPKEY_STRATAER) THEN
+      ! variables for strat. aerosol CK
       DEALLOCATE (d_q_emiss)
       DEALLOCATE (R2SO4, R2SO4B)
@@ -1670,7 +1668,7 @@
       DEALLOCATE (budg_h2so4_to_part)
       DEALLOCATE (budg_sed_part)
-#endif
-
-END SUBROUTINE phys_local_var_end
+    END IF
+
+  END SUBROUTINE phys_local_var_end
 
 END MODULE phys_local_var_mod 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_ctrlout_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 5098)
@@ -1440,5 +1440,4 @@
     'flx_co2_land_cor', 'correction of the CO2 flux from the land', 'kg CO2 m-2 s-1', (/ ('', i=1, 10) /))
 
-#ifdef CPP_StratAer
 !--extinction coefficient
   TYPE(ctrl_out), SAVE :: o_ext_strat_550 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
@@ -1517,5 +1516,4 @@
   TYPE(ctrl_out), SAVE :: o_surf_PM25_sulf = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
     'surf_PM25_sulf', 'Sulfate PM2.5 concentration at the surface', 'ug/m3', (/ ('', i=1, 10) /))
-#endif
 
 !!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90	(revision 5098)
@@ -49,7 +49,5 @@
     ! ug Pour les sorties XIOS
     USE wxios
-#ifdef CPP_StratAer
    USE infotrac_phy, ONLY: nbtr_bin
-#endif
 #ifdef ISO
     USE isotopes_mod, ONLY: isoName,iso_HTO
@@ -58,4 +56,5 @@
 #endif
 #endif
+    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
 
     IMPLICIT NONE
@@ -171,7 +170,7 @@
     ALLOCATE(o_dtr_sscav(nqtot),o_dtr_sat(nqtot),o_dtr_uscav(nqtot))
     ALLOCATE(o_dtr_dry(nqtot),o_dtr_vdf(nqtot))
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
     ALLOCATE(o_nd_mode(nbtr_bin),o_sulfmmr_mode(nbtr_bin))
-#endif
+END IF
 #ifdef ISO
     ALLOCATE(o_xtprecip(ntraciso))
@@ -233,9 +232,5 @@
     clef_files(8) = ok_histNMC(2)
     clef_files(9) = ok_histNMC(3)
-#ifdef CPP_StratAer
-    clef_files(10)= .TRUE.
-#else
-    clef_files(10)= .FALSE.
-#endif
+    clef_files(10)= CPPKEY_STRATAER
 
     !sortir des fichiers "stations" si clef_stations(:)=.TRUE.
@@ -545,5 +540,5 @@
             tnam = 'cum'//TRIM(tracers(iq)%name); o_trac_cum(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])
             
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
             if(tracers(iq)%name(1:3)=='BIN') then
                itrb = itrb + 1
@@ -554,5 +549,5 @@
                tnam = TRIM(tracers(iq)%name)//'_sulfmmr_mode';o_sulfmmr_mode  (itrb) = ctrl_out(flag, tnam, lnam, "kg(H2SO4)/kg(air)", [('',i=1,nfiles)])
             endif
-#endif
+END IF
          ENDDO
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5098)
@@ -244,5 +244,4 @@
 #endif
 
-#ifdef CPP_StratAer
     USE infotrac_phy, ONLY: nbtr_bin
     USE phys_output_ctrlout_mod, ONLY:  & 
@@ -259,5 +258,4 @@
          o_vsed_aer, o_tau_strat_1020, o_ext_strat_1020, o_f_r_wet, &
          o_SAD_sulfate, o_sulfmmr, o_nd_mode, o_sulfmmr_mode
-#endif
 
     USE ice_sursat_mod, ONLY: flight_m, flight_h2o
@@ -402,6 +400,5 @@
     USE phys_output_var_mod, ONLY: scdnc, cldncl, reffclwtop, lcc, reffclws, &
          reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra
-    
-#ifdef CPP_StratAer 
+
     USE phys_local_var_mod, ONLY:  &
          budg_3D_nucl, budg_3D_cond_evap, budg_3D_ocs_to_so2, budg_3D_so2_to_h2so4, &
@@ -417,5 +414,5 @@
          vsed_aer, tau_strat_1020, f_r_wet, &
          SAD_sulfate, sulfmmr, nd_mode, sulfmmr_mode
-#endif
+    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
 
     USE carbon_cycle_mod, ONLY: fco2_ff, fco2_bb, fco2_land, fco2_ocean
@@ -526,8 +523,6 @@
     REAL, DIMENSION(klon,klev) :: coefh_stok 
     
-#ifdef CPP_StratAer 
     LOGICAL, PARAMETER :: debug_strataer=.FALSE.
     CHARACTER(LEN=maxlen) :: unt
-#endif
     REAL,DIMENSION(klon,klev) :: z, dz
     REAL,DIMENSION(klon)      :: zrho, zt
@@ -1808,5 +1803,5 @@
 ! end add ThL
 
-#ifdef CPP_StratAer
+IF (CPPKEy_STRATAER) THEN
        IF (type_trac=='coag') THEN
           CALL histwrite_phy(o_R2SO4, R2SO4)
@@ -1850,5 +1845,5 @@
           ENDDO !--itr
        ENDIF
-#endif
+END IF
        !NL
        IF (ok_volcan .AND. ok_ade) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5098)
@@ -94,4 +94,16 @@
     USE phys_output_var_mod, ONLY : cloud_cover_sw, cloud_cover_sw_s2
 
+    USE geometry_mod,      ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
+    USE time_phylmdz_mod,  ONLY: ndays
+    USE infotrac_phy,      ONLY: nqCO2
+
+    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
+    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
+
+
+    USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize, xios_get_field_attr, &
+            xios_field_is_active, xios_context, xios_set_current_context
+    USE wxios, ONLY: missing_val, using_xios
+    USE paramLMDZ_phy_mod
 
     !USE cmp_seri_mod
@@ -110,8 +122,4 @@
 #endif
 
-
-    USE geometry_mod,      ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
-    USE time_phylmdz_mod,  ONLY: ndays
-    USE infotrac_phy,      ONLY: nqCO2
 #ifdef REPROBUS
     USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
@@ -120,7 +128,4 @@
     USE strataer_emiss_mod, ONLY: strataer_emiss_init
 #endif
-    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
-    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
-
 
 #ifdef CPP_RRTM
@@ -129,20 +134,9 @@
 #endif
 
-
-#ifdef CPP_StratAer
     USE phys_local_var_mod, ONLY: d_q_emiss
     USE strataer_local_var_mod
     USE strataer_nuc_mod, ONLY: strataer_nuc_init
     USE strataer_emiss_mod, ONLY: strataer_emiss_init
-#endif
-
-    USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize
-    USE lmdz_xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context
-    USE lmdz_xios, ONLY: xios_set_current_context
-    USE wxios, ONLY: missing_val, using_xios
-
-#ifndef CPP_XIOS
-    USE paramLMDZ_phy_mod
-#endif
+    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
 !
 !
@@ -363,5 +357,5 @@
        reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra
        USE output_physiqex_mod, ONLY: output_physiqex
-    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
+        USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
 
 
@@ -1764,7 +1758,7 @@
        WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3)
 
-#ifndef CPP_XIOS
+      IF (.NOT. using_xios) THEN
        CALL ini_paramLMDZ_phy(phys_tstep,nid_ctesGCM)
-#endif
+      END IF
 
 #endif
@@ -1891,9 +1885,9 @@
 #endif
 
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
        CALL strataer_init
        CALL strataer_nuc_init
        CALL strataer_emiss_init
-#endif
+END IF
 
 #ifdef CPP_Dust
@@ -4346,5 +4340,5 @@
           ELSE
 #ifdef CPP_RRTM
-#ifndef CPP_StratAer
+IF (.NOT. CPPKEY_STRATAER) THEN
           !--prescribed strat aerosols 
           !--only in the case of non-interactive strat aerosols
@@ -4357,5 +4351,5 @@
              CALL abort_physic(modname,abort_message,1)
             ENDIF
-#endif
+END IF
 #else
              abort_message='You should compile with -rrtm if running ' &
@@ -4369,10 +4363,10 @@
 !
 #ifdef CPP_RRTM
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
        !--compute stratospheric mask
        CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
        !--interactive strat aerosols
        CALL calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
-#endif
+END IF
 #endif
        !--fin STRAT AEROSOL
@@ -4987,10 +4981,10 @@
     IF (ok_qch4) THEN
 !      d_q_ch4: H2O source from CH4 in MMR/s (mass mixing ratio/s or kg H2O/kg air/s)
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
        CALL stratH2O_methox(debut,paprs,d_q_ch4)
-#else
+ELSE
 !      ECMWF routine METHOX
        CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay)
-#endif
+END IF
        ! add humidity tendency due to methane
        d_q_ch4_dtime(:,:) = d_q_ch4(:,:)*phys_tstep
@@ -5001,5 +4995,5 @@
     !
     !
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
     IF (ok_qemiss) THEN
        flh2o=1
@@ -5044,5 +5038,5 @@
        END SELECT ! emission scenario (flag_emit)
     ENDIF
-#endif
+END IF
 
 !===============================================================
@@ -5419,5 +5413,5 @@
     ENDDO
 
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
     IF (ok_qemiss) THEN
        DO k = 1, klev
@@ -5425,5 +5419,5 @@
        ENDDO
     ENDIF
-#endif
+END IF
     IF (ok_qch4) THEN
        DO k = 1, klev
@@ -5726,7 +5720,7 @@
 #endif
 
-#ifndef CPP_XIOS
+    IF (.NOT. using_xios) THEN
       CALL write_paramLMDZ_phy(itap,nid_ctesGCM,ok_sync)
-#endif
+    END IF
 
 #endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phytrac_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phytrac_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phytrac_mod.F90	(revision 5098)
@@ -1,53 +1,53 @@
 !$Id$
 MODULE phytrac_mod
-!=================================================================================
-! Interface between the LMDZ physical package and tracer computation.
-! Chemistry modules (INCA, Reprobus or the more specific traclmdz routine)
-! are called from phytrac.
-!
-!======================================================================
-! Auteur(s) FH
-! Objet: Moniteur general des tendances traceurs
-!
-! iflag_vdf_trac : Options for activating transport by vertical diffusion :
-!     1. notmal
-!     0. emission is injected in the first layer only, without diffusion
-!    -1  no emission & no diffusion
-! Modification 2013/07/22 : transformed into a module to pass tendencies to
-!     physics outputs. Additional keys for controling activation of sub processes.
-! Modification R. Pilon 10 octobre 2012 large scale scavenging incloud_scav + bc_scav
-! Modification R. Pilon 01 janvier 2012 transport+scavenging KE scheme : cvltr
-!=================================================================================
-
-!
-! Tracer tendencies, for outputs
-!-------------------------------
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cl  ! Td couche limite/traceur
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_dec                            !RomP
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv  ! Td convection/traceur
-! RomP >>>
-  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_trsp
-  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 dans pluie,air descente insaturee
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPa,qMel
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qTrdi,dtrcvMA ! conc traceur descente air insaturee et td convective MA
-! RomP <<<
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_th  ! Td thermique
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_lessi_impa ! Td du lessivage par impaction
-  REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_lessi_nucl ! Td du lessivage par nucleation
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE   :: qPrls      !jyg: concentration tra dans pluie LS a la surf.
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE   :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-  REAL,DIMENSION(:,:),ALLOCATABLE,SAVE   :: flux_tr_dry ! depot sec/traceur (surface),ALLOCATABLE,SAVE    jyg
-
-!$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_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
+  !=================================================================================
+  ! Interface between the LMDZ physical package and tracer computation.
+  ! Chemistry modules (INCA, Reprobus or the more specific traclmdz routine)
+  ! are called from phytrac.
+  !
+  !======================================================================
+  ! Auteur(s) FH
+  ! Objet: Moniteur general des tendances traceurs
+  !
+  ! iflag_vdf_trac : Options for activating transport by vertical diffusion :
+  !     1. notmal
+  !     0. emission is injected in the first layer only, without diffusion
+  !    -1  no emission & no diffusion
+  ! Modification 2013/07/22 : transformed into a module to pass tendencies to
+  !     physics outputs. Additional keys for controling activation of sub processes.
+  ! Modification R. Pilon 10 octobre 2012 large scale scavenging incloud_scav + bc_scav
+  ! Modification R. Pilon 01 janvier 2012 transport+scavenging KE scheme : cvltr
+  !=================================================================================
+
+  !
+  ! Tracer tendencies, for outputs
+  !-------------------------------
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl  ! Td couche limite/traceur
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dec                            !RomP
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv  ! Td convection/traceur
+  ! RomP >>>
+  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_trsp
+  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 dans pluie,air descente insaturee
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPa, qMel
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qTrdi, dtrcvMA ! conc traceur descente air insaturee et td convective MA
+  ! RomP <<<
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th  ! Td thermique
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_impa ! Td du lessivage par impaction
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_nucl ! Td du lessivage par nucleation
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: qPrls      !jyg: concentration tra dans pluie LS a la surf.
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dry ! Td depot sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: flux_tr_dry ! depot sec/traceur (surface),ALLOCATABLE,SAVE    jyg
+
+  !$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_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
 
 CONTAINS
@@ -56,60 +56,60 @@
 
     USE dimphy
-    USE infotrac_phy, ONLY: nbtr, type_trac
-    USE tracco2i_mod, ONLY: tracco2i_init
-    
+    USE infotrac_phy, ONLY : nbtr, type_trac
+    USE tracco2i_mod, ONLY : tracco2i_init
+
     IMPLICIT NONE
 
-    ALLOCATE(d_tr_cl(klon,klev,nbtr),d_tr_dry(klon,nbtr))
-    ALLOCATE(flux_tr_dry(klon,nbtr),d_tr_dec(klon,klev,nbtr),d_tr_cv(klon,klev,nbtr))
-    ALLOCATE(d_tr_insc(klon,klev,nbtr),d_tr_bcscav(klon,klev,nbtr))
-    ALLOCATE(d_tr_evapls(klon,klev,nbtr),d_tr_ls(klon,klev,nbtr))
-    ALLOCATE(qPrls(klon,nbtr),d_tr_trsp(klon,klev,nbtr))
-    ALLOCATE(d_tr_sscav(klon,klev,nbtr),d_tr_sat(klon,klev,nbtr))
-    ALLOCATE(d_tr_uscav(klon,klev,nbtr),qPr(klon,klev,nbtr),qDi(klon,klev,nbtr))
-    ALLOCATE(qPa(klon,klev,nbtr),qMel(klon,klev,nbtr))
-    ALLOCATE(qTrdi(klon,klev,nbtr),dtrcvMA(klon,klev,nbtr))
-    ALLOCATE(d_tr_th(klon,klev,nbtr))
-    ALLOCATE(d_tr_lessi_impa(klon,klev,nbtr),d_tr_lessi_nucl(klon,klev,nbtr))
+    ALLOCATE(d_tr_cl(klon, klev, nbtr), d_tr_dry(klon, nbtr))
+    ALLOCATE(flux_tr_dry(klon, nbtr), d_tr_dec(klon, klev, nbtr), d_tr_cv(klon, klev, nbtr))
+    ALLOCATE(d_tr_insc(klon, klev, nbtr), d_tr_bcscav(klon, klev, nbtr))
+    ALLOCATE(d_tr_evapls(klon, klev, nbtr), d_tr_ls(klon, klev, nbtr))
+    ALLOCATE(qPrls(klon, nbtr), d_tr_trsp(klon, klev, nbtr))
+    ALLOCATE(d_tr_sscav(klon, klev, nbtr), d_tr_sat(klon, klev, nbtr))
+    ALLOCATE(d_tr_uscav(klon, klev, nbtr), qPr(klon, klev, nbtr), qDi(klon, klev, nbtr))
+    ALLOCATE(qPa(klon, klev, nbtr), qMel(klon, klev, nbtr))
+    ALLOCATE(qTrdi(klon, klev, nbtr), dtrcvMA(klon, klev, nbtr))
+    ALLOCATE(d_tr_th(klon, klev, nbtr))
+    ALLOCATE(d_tr_lessi_impa(klon, klev, nbtr), d_tr_lessi_nucl(klon, klev, nbtr))
 
     !===============================================================================
     !    -- Do specific treatment according to chemestry model or local LMDZ tracers
-    !      
+    !
     !===============================================================================
     !   -- CO2 interactif --
-    IF (ANY(type_trac == ['co2i','inco'])) CALL tracco2i_init()
-
-       !   -- type_trac == 'co2i' ! PC 
-       !   -- CO2 interactif --
-       !   -- source is updated with FF and BB emissions 
-       !   -- and net fluxes from ocean and orchidee 
-       !   -- sign convention : positive into the atmosphere
+    IF (ANY(type_trac == ['co2i', 'inco'])) CALL tracco2i_init()
+
+    !   -- type_trac == 'co2i' ! PC
+    !   -- CO2 interactif --
+    !   -- source is updated with FF and BB emissions
+    !   -- and net fluxes from ocean and orchidee
+    !   -- sign convention : positive into the atmosphere
 
   END SUBROUTINE phytrac_init
 
-  SUBROUTINE phytrac(                                 &
-       nstep,     julien,   gmtime,   debutphy,       &
-       lafin,     pdtphys,  u, v,     t_seri,         &
-       paprs,     pplay,    pmfu,     pmfd,           &
-       pen_u,     pde_u,    pen_d,    pde_d,          &
-       cdragh,    coefh,    fm_therm, entr_therm,     &
-       yu1,       yv1,      ftsol,    pctsrf,         &
-       ustar,     u10m,      v10m,                    &
-       wstar,     ale_bl,      ale_wake,              &
-       xlat,      xlon,                               &
-       frac_impa,frac_nucl,beta_fisrt,beta_v1,        &
-       presnivs,  pphis,    pphi,     albsol,         &
-       sh,        ch, rh,   cldfra,   rneb,           &
-       diafra,    cldliq,   itop_con, ibas_con,       &
-       pmflxr,    pmflxs,   prfl,     psfl,           &
-       da,        phi,      mp,       upwd,           &
-       phi2,      d1a,      dam,      sij, wght_cvfd, &   ! RomP +RL
-       wdtrainA,  wdtrainM, sigd,     clw, elij,      &   ! RomP 
-       evap,      ep,       epmlmMm,  eplaMm,         &   ! RomP
-       dnwd,      aerosol_couple,     flxmass_w,      &
-       tau_aero,  piz_aero,  cg_aero, ccm,            &
-       rfname,                                        &
-       d_tr_dyn,                                      &   ! RomP
-       tr_seri, init_source)         
+  SUBROUTINE phytrac(&
+          nstep, julien, gmtime, debutphy, &
+          lafin, pdtphys, u, v, t_seri, &
+          paprs, pplay, pmfu, pmfd, &
+          pen_u, pde_u, pen_d, pde_d, &
+          cdragh, coefh, fm_therm, entr_therm, &
+          yu1, yv1, ftsol, pctsrf, &
+          ustar, u10m, v10m, &
+          wstar, ale_bl, ale_wake, &
+          xlat, xlon, &
+          frac_impa, frac_nucl, beta_fisrt, beta_v1, &
+          presnivs, pphis, pphi, albsol, &
+          sh, ch, rh, cldfra, rneb, &
+          diafra, cldliq, itop_con, ibas_con, &
+          pmflxr, pmflxs, prfl, psfl, &
+          da, phi, mp, upwd, &
+          phi2, d1a, dam, sij, wght_cvfd, &   ! RomP +RL
+          wdtrainA, wdtrainM, sigd, clw, elij, &   ! RomP
+          evap, ep, epmlmMm, eplaMm, &   ! RomP
+          dnwd, aerosol_couple, flxmass_w, &
+          tau_aero, piz_aero, cg_aero, ccm, &
+          rfname, &
+          d_tr_dyn, &   ! RomP
+          tr_seri, init_source)
     !
     !======================================================================
@@ -123,6 +123,6 @@
     USE phys_cal_mod, only : hour
     USE dimphy
-    USE infotrac_phy, ONLY: nbtr, nqCO2, type_trac, conv_flg, pbl_flg
-    USE strings_mod,  ONLY: int2str
+    USE infotrac_phy, ONLY : nbtr, nqCO2, type_trac, conv_flg, pbl_flg
+    USE strings_mod, ONLY : int2str
     USE mod_grid_phy_lmdz
     USE mod_phys_lmdz_para
@@ -132,6 +132,6 @@
     USE tracreprobus_mod
     USE indice_sol_mod
-    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
-    USE print_control_mod, ONLY: lunout
+    USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
+    USE print_control_mod, ONLY : lunout
     USE aero_mod, ONLY : naero_grp
     USE lmdz_thermcell_dq, ONLY : thermcell_dq
@@ -139,19 +139,18 @@
     USE tracco2i_mod
 
-#ifdef CPP_StratAer
     USE traccoag_mod
-    USE phys_local_var_mod, ONLY: mdw
-    USE phys_local_var_mod, ONLY: budg_dep_dry_ocs,   budg_dep_wet_ocs
-    USE phys_local_var_mod, ONLY: budg_dep_dry_so2,   budg_dep_wet_so2
-    USE phys_local_var_mod, ONLY: budg_dep_dry_h2so4, budg_dep_wet_h2so4
-    USE phys_local_var_mod, ONLY: budg_dep_dry_part,  budg_dep_wet_part
-    USE infotrac_phy, ONLY: nbtr_sulgas, id_OCS_strat, id_SO2_strat, id_H2SO4_strat
+    USE phys_local_var_mod, ONLY : mdw
+    USE phys_local_var_mod, ONLY : budg_dep_dry_ocs, budg_dep_wet_ocs
+    USE phys_local_var_mod, ONLY : budg_dep_dry_so2, budg_dep_wet_so2
+    USE phys_local_var_mod, ONLY : budg_dep_dry_h2so4, budg_dep_wet_h2so4
+    USE phys_local_var_mod, ONLY : budg_dep_dry_part, budg_dep_wet_part
+    USE infotrac_phy, ONLY : nbtr_sulgas, id_OCS_strat, id_SO2_strat, id_H2SO4_strat
     USE strataer_nuc_mod, ONLY : tracstrataer_init
     USE aerophys
-#endif
+    USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_STRATAER
+    USE lmdz_yomcst
 
     IMPLICIT NONE
 
-    INCLUDE "YOMCST.h"
     INCLUDE "clesphys.h"
     !==========================================================================
@@ -162,104 +161,104 @@
     !----------------
     !Configuration grille,temps:
-    INTEGER,INTENT(IN) :: nstep      ! Appel physique
-    INTEGER,INTENT(IN) :: julien     ! Jour julien
-    REAL,INTENT(IN)    :: gmtime     ! Heure courante
-    REAL,INTENT(IN)    :: pdtphys    ! Pas d'integration pour la physique (seconde)
-    LOGICAL,INTENT(IN) :: debutphy   ! le flag de l'initialisation de la physique
-    LOGICAL,INTENT(IN) :: lafin      ! le flag de la fin de la physique
-
-    REAL,DIMENSION(klon),INTENT(IN) :: xlat    ! latitudes pour chaque point 
-    REAL,DIMENSION(klon),INTENT(IN) :: xlon    ! longitudes pour chaque point 
-    !
-    !Physique: 
+    INTEGER, INTENT(IN) :: nstep      ! Appel physique
+    INTEGER, INTENT(IN) :: julien     ! Jour julien
+    REAL, INTENT(IN) :: gmtime     ! Heure courante
+    REAL, INTENT(IN) :: pdtphys    ! Pas d'integration pour la physique (seconde)
+    LOGICAL, INTENT(IN) :: debutphy   ! le flag de l'initialisation de la physique
+    LOGICAL, INTENT(IN) :: lafin      ! le flag de la fin de la physique
+
+    REAL, DIMENSION(klon), INTENT(IN) :: xlat    ! latitudes pour chaque point
+    REAL, DIMENSION(klon), INTENT(IN) :: xlon    ! longitudes pour chaque point
+    !
+    !Physique:
     !--------
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: t_seri  ! Temperature
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: u       ! variable not used 
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: v       ! variable not used 
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: sh      ! humidite specifique
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: rh      ! humidite relative
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: ch      ! eau liquide (+ glace si le traceur existe) 
-    REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs   ! pression pour chaque inter-couche (en Pa)
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay   ! pression pour le mileu de chaque couche (en Pa)
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: pphi    ! geopotentiel
-    REAL,DIMENSION(klon),INTENT(IN)        :: pphis
-    REAL,DIMENSION(klev),INTENT(IN)        :: presnivs 
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: cldliq  ! eau condensee totale
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: cldfra  ! fraction nuageuse (tous les nuages)
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: diafra  ! fraction nuageuse (convection ou stratus artificiels)
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb    ! fraction nuageuse (grande echelle)
-    !
-    REAL                                   :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
-    REAL,DIMENSION(klon,klev),INTENT(IN)   :: beta_fisrt ! taux de conversion de l'eau cond (de fisrtilp)
-    REAL,DIMENSION(klon,klev),INTENT(out)  :: beta_v1    ! -- (originale version)
-
-    !
-    INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
-    INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
-    REAL,DIMENSION(klon),INTENT(IN)        :: albsol  ! albedo surface
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: t_seri  ! Temperature
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: u       ! variable not used
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: v       ! variable not used
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: sh      ! humidite specifique
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: rh      ! humidite relative
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: ch      ! eau liquide (+ glace si le traceur existe)
+    REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs   ! pression pour chaque inter-couche (en Pa)
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay   ! pression pour le mileu de chaque couche (en Pa)
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pphi    ! geopotentiel
+    REAL, DIMENSION(klon), INTENT(IN) :: pphis
+    REAL, DIMENSION(klev), INTENT(IN) :: presnivs
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: cldliq  ! eau condensee totale
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: cldfra  ! fraction nuageuse (tous les nuages)
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: diafra  ! fraction nuageuse (convection ou stratus artificiels)
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb    ! fraction nuageuse (grande echelle)
+    !
+    REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: beta_fisrt ! taux de conversion de l'eau cond (de fisrtilp)
+    REAL, DIMENSION(klon, klev), INTENT(out) :: beta_v1    ! -- (originale version)
+
+    !
+    INTEGER, DIMENSION(klon), INTENT(IN) :: itop_con
+    INTEGER, DIMENSION(klon), INTENT(IN) :: ibas_con
+    REAL, DIMENSION(klon), INTENT(IN) :: albsol  ! albedo surface
     !
     !Dynamique
     !--------
-    REAL,DIMENSION(klon,klev,nbtr),INTENT(IN)    :: d_tr_dyn
+    REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: d_tr_dyn
     !
     !Convection:
     !----------
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfu  ! flux de masse dans le panache montant
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfd  ! flux de masse dans le panache descendant
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: pen_u ! flux entraine dans le panache montant
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: pde_u ! flux detraine dans le panache montant
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: pen_d ! flux entraine dans le panache descendant
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: pde_d ! flux detraine dans le panache descendant
-
-    !...Tiedke     
-    REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: pmflxr, pmflxs ! Flux precipitant de pluie, neige aux interfaces [convection]
-    REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: prfl, psfl ! Flux precipitant de pluie, neige aux interfaces [large-scale]
-
-    LOGICAL,INTENT(IN)                       :: aerosol_couple
-    REAL,DIMENSION(klon,klev),INTENT(IN)     :: flxmass_w
-    REAL,DIMENSION(klon,klev,naero_grp,2),INTENT(IN) :: tau_aero
-    REAL,DIMENSION(klon,klev,naero_grp,2),INTENT(IN) :: piz_aero
-    REAL,DIMENSION(klon,klev,naero_grp,2),INTENT(IN) :: cg_aero
-    CHARACTER(len=4),DIMENSION(naero_grp),INTENT(IN) :: rfname 
-    REAL,DIMENSION(klon,klev,2),INTENT(IN)   :: ccm 
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pmfu  ! flux de masse dans le panache montant
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pmfd  ! flux de masse dans le panache descendant
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pen_u ! flux entraine dans le panache montant
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pde_u ! flux detraine dans le panache montant
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pen_d ! flux entraine dans le panache descendant
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: pde_d ! flux detraine dans le panache descendant
+
+    !...Tiedke
+    REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: pmflxr, pmflxs ! Flux precipitant de pluie, neige aux interfaces [convection]
+    REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: prfl, psfl ! Flux precipitant de pluie, neige aux interfaces [large-scale]
+
+    LOGICAL, INTENT(IN) :: aerosol_couple
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: flxmass_w
+    REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: tau_aero
+    REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: piz_aero
+    REAL, DIMENSION(klon, klev, naero_grp, 2), INTENT(IN) :: cg_aero
+    CHARACTER(len = 4), DIMENSION(naero_grp), INTENT(IN) :: rfname
+    REAL, DIMENSION(klon, klev, 2), INTENT(IN) :: ccm
     !... K.Emanuel
-    REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
-    REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: da
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi
     ! RomP >>>
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
-    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
-    !
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
-    REAL,DIMENSION(klon),INTENT(IN)           :: sigd
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: d1a, dam
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi2
+    !
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainA
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainM
+    REAL, DIMENSION(klon), INTENT(IN) :: sigd
     ! ---- RomP flux entraine, detraine et precipitant kerry Emanuel
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: evap
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
-    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: wght_cvfd          !RL
-    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: elij
-    REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: epmlmMm
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: eplaMm
-    REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: evap
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: ep
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: sij
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wght_cvfd          !RL
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: elij
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: epmlmMm
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: eplaMm
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: clw
     ! RomP <<<
     !
-    REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
-    REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated updraft mass flux
-    REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated downdraft mass flux
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: mp
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: upwd      ! saturated updraft mass flux
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: dnwd      ! saturated downdraft mass flux
     !
     !Thermiques:
     !----------
-    REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-    REAL,DIMENSION(klon,klev),INTENT(INOUT)     :: entr_therm
+    REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: fm_therm
+    REAL, DIMENSION(klon, klev), INTENT(INOUT) :: entr_therm
     !
     !Couche limite:
     !--------------
     !
-    REAL,DIMENSION(:),INTENT(IN)   :: cdragh          ! (klon) coeff drag pour T et Q
-    REAL,DIMENSION(:,:),INTENT(IN) :: coefh           ! (klon,klev) coeff melange CL (m**2/s)
-    REAL,DIMENSION(:),INTENT(IN)   :: ustar,u10m,v10m ! (klon) u* & vent a 10m (m/s)
-    REAL,DIMENSION(:),INTENT(IN)   :: wstar,ale_bl,ale_wake ! (klon) w* and Avail. Lifting Ener.
-    REAL,DIMENSION(:),INTENT(IN)   :: yu1             ! (klon) vents au premier niveau
-    REAL,DIMENSION(:),INTENT(IN)   :: yv1             ! (klon) vents au premier niveau
+    REAL, DIMENSION(:), INTENT(IN) :: cdragh          ! (klon) coeff drag pour T et Q
+    REAL, DIMENSION(:, :), INTENT(IN) :: coefh           ! (klon,klev) coeff melange CL (m**2/s)
+    REAL, DIMENSION(:), INTENT(IN) :: ustar, u10m, v10m ! (klon) u* & vent a 10m (m/s)
+    REAL, DIMENSION(:), INTENT(IN) :: wstar, ale_bl, ale_wake ! (klon) w* and Avail. Lifting Ener.
+    REAL, DIMENSION(:), INTENT(IN) :: yu1             ! (klon) vents au premier niveau
+    REAL, DIMENSION(:), INTENT(IN) :: yv1             ! (klon) vents au premier niveau
     !
     !Lessivage:
@@ -270,26 +269,24 @@
     REAL, DIMENSION(:), ALLOCATABLE, SAVE :: coefcoli
     LOGICAL, DIMENSION(:), ALLOCATABLE, SAVE :: flag_cvltr
-!$OMP THREADPRIVATE(ccntrAA,ccntrENV,coefcoli,flag_cvltr)
-    REAL, DIMENSION(klon,klev) :: ccntrAA_3d
-    REAL, DIMENSION(klon,klev) :: ccntrENV_3d
-    REAL, DIMENSION(klon,klev) :: coefcoli_3d
+    !$OMP THREADPRIVATE(ccntrAA,ccntrENV,coefcoli,flag_cvltr)
+    REAL, DIMENSION(klon, klev) :: ccntrAA_3d
+    REAL, DIMENSION(klon, klev) :: ccntrENV_3d
+    REAL, DIMENSION(klon, klev) :: coefcoli_3d
     !
     ! pour le ON-LINE
     !
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: frac_impa ! fraction d'aerosols non impactes
-    REAL,DIMENSION(klon,klev),INTENT(IN) :: frac_nucl ! fraction d'aerosols non nuclees
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: frac_impa ! fraction d'aerosols non impactes
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: frac_nucl ! fraction d'aerosols non nuclees
 
     ! Arguments necessaires pour les sources et puits de traceur:
-    REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: ftsol  ! Temperature du sol (surf)(Kelvin)
-    REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf ! Pourcentage de sol (nature du sol)
-
-#ifdef CPP_StratAer
-    REAL,DIMENSION(klon)           :: v_dep_dry !dry deposition velocity of stratospheric sulfate in m/s
-#endif
+    REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: ftsol  ! Temperature du sol (surf)(Kelvin)
+    REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: pctsrf ! Pourcentage de sol (nature du sol)
+
+    REAL, DIMENSION(klon) :: v_dep_dry !dry deposition velocity of stratospheric sulfate in m/s
     ! Output argument
     !----------------
-    REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA]
-    REAL,DIMENSION(klon,klev)                    :: sourceBE 
-    REAL,DIMENSION(klon,nbtr), INTENT(IN) :: init_source
+    REAL, DIMENSION(klon, klev, nbtr), INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA]
+    REAL, DIMENSION(klon, klev) :: sourceBE
+    REAL, DIMENSION(klon, nbtr), INTENT(IN) :: init_source
 
     !=======================================================================================
@@ -303,64 +300,64 @@
     !--------------------------------------------
     !
-    REAL,DIMENSION(:,:),ALLOCATABLE,SAVE :: source  ! a voir lorsque le flux de surface est prescrit
-!$OMP THREADPRIVATE(source)
+    REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: source  ! a voir lorsque le flux de surface est prescrit
+    !$OMP THREADPRIVATE(source)
 
     !
     !Entrees/Sorties:
     !---------------
-    INTEGER                   :: iiq, ierr
-    INTEGER                   :: nhori, nvert
-    REAL                      :: zsto, zout, zjulian
-    INTEGER,SAVE              :: nid_tra     ! pointe vers le fichier histrac.nc         
-!$OMP THREADPRIVATE(nid_tra)
-    REAL,DIMENSION(klon)      :: zx_tmp_fi2d ! variable temporaire grille physique
-    INTEGER                   :: itau_w      ! pas de temps ecriture = nstep + itau_phy
-    LOGICAL,PARAMETER         :: ok_sync=.TRUE.
+    INTEGER :: iiq, ierr
+    INTEGER :: nhori, nvert
+    REAL :: zsto, zout, zjulian
+    INTEGER, SAVE :: nid_tra     ! pointe vers le fichier histrac.nc
+    !$OMP THREADPRIVATE(nid_tra)
+    REAL, DIMENSION(klon) :: zx_tmp_fi2d ! variable temporaire grille physique
+    INTEGER :: itau_w      ! pas de temps ecriture = nstep + itau_phy
+    LOGICAL, PARAMETER :: ok_sync = .TRUE.
     !
     ! Nature du traceur
     !------------------
-    LOGICAL,DIMENSION(:),ALLOCATABLE,SAVE :: aerosol  ! aerosol(it) = true  => aerosol => lessivage
-!$OMP THREADPRIVATE(aerosol)                        ! aerosol(it) = false => gaz
-    REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
+    LOGICAL, DIMENSION(:), ALLOCATABLE, SAVE :: aerosol  ! aerosol(it) = true  => aerosol => lessivage
+    !$OMP THREADPRIVATE(aerosol)                        ! aerosol(it) = false => gaz
+    REAL, DIMENSION(klon, klev) :: delp     ! epaisseur de couche (Pa)
     !
     ! Tendances de traceurs (Td) et flux de traceurs:
     !------------------------
-    REAL,DIMENSION(klon,klev)      :: d_tr     ! Td dans l'atmosphere
-    REAL,DIMENSION(klon,klev)      :: Mint
-    REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
-    REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
-    REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
+    REAL, DIMENSION(klon, klev) :: d_tr     ! Td dans l'atmosphere
+    REAL, DIMENSION(klon, klev) :: Mint
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfd1a
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfdam
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfphi2
     ! Physique
-    !---------- 
-    REAL,DIMENSION(klon,klev,nbtr) :: flestottr ! flux de lessivage dans chaque couche 
-    REAL,DIMENSION(klon,klev)      :: zmasse    ! densite atmospherique Kg/m2
-    REAL,DIMENSION(klon,klev)      :: ztra_th
+    !----------
+    REAL, DIMENSION(klon, klev, nbtr) :: flestottr ! flux de lessivage dans chaque couche
+    REAL, DIMENSION(klon, klev) :: zmasse    ! densite atmospherique Kg/m2
+    REAL, DIMENSION(klon, klev) :: ztra_th
     !PhH
-    REAL,DIMENSION(klon,klev)      :: zrho
-    REAL,DIMENSION(klon,klev)      :: zdz
-    REAL                           :: evaplsc,dx,beta ! variable pour lessivage Genthon
-    REAL,DIMENSION(klon)           :: his_dh          ! ---
+    REAL, DIMENSION(klon, klev) :: zrho
+    REAL, DIMENSION(klon, klev) :: zdz
+    REAL :: evaplsc, dx, beta ! variable pour lessivage Genthon
+    REAL, DIMENSION(klon) :: his_dh          ! ---
     ! in-cloud scav variables
-    REAL           :: ql_incloud_ref     ! ref value of in-cloud condensed water content
+    REAL :: ql_incloud_ref     ! ref value of in-cloud condensed water content
 
     !Controles:
     !---------
-    INTEGER,SAVE :: iflag_vdf_trac,iflag_con_trac,iflag_the_trac
-    INTEGER,SAVE  :: iflag_con_trac_omp, iflag_vdf_trac_omp,iflag_the_trac_omp
-!$OMP THREADPRIVATE(iflag_vdf_trac,iflag_con_trac,iflag_the_trac)
-
-    LOGICAL,SAVE :: lessivage
-!$OMP THREADPRIVATE(lessivage)
+    INTEGER, SAVE :: iflag_vdf_trac, iflag_con_trac, iflag_the_trac
+    INTEGER, SAVE :: iflag_con_trac_omp, iflag_vdf_trac_omp, iflag_the_trac_omp
+    !$OMP THREADPRIVATE(iflag_vdf_trac,iflag_con_trac,iflag_the_trac)
+
+    LOGICAL, SAVE :: lessivage
+    !$OMP THREADPRIVATE(lessivage)
 
     !RomP >>>
-    INTEGER,SAVE  :: iflag_lscav_omp,iflag_lscav
-    REAL, SAVE ::   ccntrAA_in,ccntrAA_omp
-    REAL, SAVE ::   ccntrENV_in,ccntrENV_omp
-    REAL, SAVE ::   coefcoli_in,coefcoli_omp
-
-    LOGICAL,SAVE  :: convscav_omp,convscav
-!$OMP THREADPRIVATE(iflag_lscav)
-!$OMP THREADPRIVATE(ccntrAA_in,ccntrENV_in,coefcoli_in)
-!$OMP THREADPRIVATE(convscav)
+    INTEGER, SAVE :: iflag_lscav_omp, iflag_lscav
+    REAL, SAVE :: ccntrAA_in, ccntrAA_omp
+    REAL, SAVE :: ccntrENV_in, ccntrENV_omp
+    REAL, SAVE :: coefcoli_in, coefcoli_omp
+
+    LOGICAL, SAVE :: convscav_omp, convscav
+    !$OMP THREADPRIVATE(iflag_lscav)
+    !$OMP THREADPRIVATE(ccntrAA_in,ccntrENV_in,coefcoli_in)
+    !$OMP THREADPRIVATE(convscav)
     !RomP <<<
     !######################################################################
@@ -368,308 +365,302 @@
     !######################################################################
 
-    DO k=1,klev
-       DO i=1,klon
-          sourceBE(i,k)=0.
-          Mint(i,k)=0.
-          zrho(i,k)=0.
-          zdz(i,k)=0.
-       ENDDO
+    DO k = 1, klev
+      DO i = 1, klon
+        sourceBE(i, k) = 0.
+        Mint(i, k) = 0.
+        zrho(i, k) = 0.
+        zdz(i, k) = 0.
+      ENDDO
     ENDDO
 
-    DO it=1, nbtr
-       DO k=1,klev
-          DO i=1,klon
-             d_tr_insc(i,k,it)=0.
-             d_tr_bcscav(i,k,it)=0.
-             d_tr_evapls(i,k,it)=0.
-             d_tr_ls(i,k,it)=0.
-             d_tr_cv(i,k,it)=0.
-             d_tr_cl(i,k,it)=0.
-             d_tr_trsp(i,k,it)=0.
-             d_tr_sscav(i,k,it)=0.
-             d_tr_sat(i,k,it)=0.
-             d_tr_uscav(i,k,it)=0.
-             d_tr_lessi_impa(i,k,it)=0.
-             d_tr_lessi_nucl(i,k,it)=0.
-             qDi(i,k,it)=0.
-             qPr(i,k,it)=0.
-             qPa(i,k,it)=0.
-             qMel(i,k,it)=0.
-             qTrdi(i,k,it)=0.
-             dtrcvMA(i,k,it)=0.
-             zmfd1a(i,k,it)=0.
-             zmfdam(i,k,it)=0.
-             zmfphi2(i,k,it)=0.
-          ENDDO
-       ENDDO
+    DO it = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_insc(i, k, it) = 0.
+          d_tr_bcscav(i, k, it) = 0.
+          d_tr_evapls(i, k, it) = 0.
+          d_tr_ls(i, k, it) = 0.
+          d_tr_cv(i, k, it) = 0.
+          d_tr_cl(i, k, it) = 0.
+          d_tr_trsp(i, k, it) = 0.
+          d_tr_sscav(i, k, it) = 0.
+          d_tr_sat(i, k, it) = 0.
+          d_tr_uscav(i, k, it) = 0.
+          d_tr_lessi_impa(i, k, it) = 0.
+          d_tr_lessi_nucl(i, k, it) = 0.
+          qDi(i, k, it) = 0.
+          qPr(i, k, it) = 0.
+          qPa(i, k, it) = 0.
+          qMel(i, k, it) = 0.
+          qTrdi(i, k, it) = 0.
+          dtrcvMA(i, k, it) = 0.
+          zmfd1a(i, k, it) = 0.
+          zmfdam(i, k, it) = 0.
+          zmfphi2(i, k, it) = 0.
+        ENDDO
+      ENDDO
     ENDDO
 
-    DO it=1, nbtr
-       DO i=1,klon
-          d_tr_dry(i,it)=0.
-          flux_tr_dry(i,it)=0.
-       ENDDO
+    DO it = 1, nbtr
+      DO i = 1, klon
+        d_tr_dry(i, it) = 0.
+        flux_tr_dry(i, it) = 0.
+      ENDDO
     ENDDO
 
     DO k = 1, klev
-       DO i = 1, klon
-          delp(i,k) = paprs(i,k)-paprs(i,k+1)
-       ENDDO
+      DO i = 1, klon
+        delp(i, k) = paprs(i, k) - paprs(i, k + 1)
+      ENDDO
     ENDDO
 
     IF (debutphy) THEN
-       !!jyg
-!$OMP BARRIER
-       ecrit_tra=86400. ! frequence de stokage en dur
-       ! obsolete car remplace par des ecritures dans phys_output_write
-       !RomP >>>
-       !
-       !Config Key  = convscav
-       !Config Desc = Convective scavenging switch: 0=off, 1=on.
-       !Config Def  = .FALSE.
-       !Config Help = 
-       !
-!$OMP MASTER
-       convscav_omp=.FALSE.
-       call getin('convscav', convscav_omp)
-       iflag_vdf_trac_omp=1
-       call getin('iflag_vdf_trac', iflag_vdf_trac_omp)
-       iflag_con_trac_omp=1
-       call getin('iflag_con_trac', iflag_con_trac_omp)
-       iflag_the_trac_omp=1
-       call getin('iflag_the_trac', iflag_the_trac_omp)
-!$OMP END MASTER
-!$OMP BARRIER
-       convscav=convscav_omp
-       iflag_vdf_trac=iflag_vdf_trac_omp
-       iflag_con_trac=iflag_con_trac_omp
-       iflag_the_trac=iflag_the_trac_omp
-       write(lunout,*) 'phytrac passage dans routine conv avec lessivage', convscav
-       !
-       !Config Key  = iflag_lscav
-       !Config Desc = Large scale scavenging parametrization: 0=none, 1=old(Genthon92),
-       !              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
-       !Config Def  = 1
-       !Config Help = 
-       !
-!$OMP MASTER
-       iflag_lscav_omp=1
-       call getin('iflag_lscav', iflag_lscav_omp)
-       ccntrAA_omp=1
-       ccntrENV_omp=1.
-       coefcoli_omp=0.001
-       call getin('ccntrAA', ccntrAA_omp)
-       call getin('ccntrENV', ccntrENV_omp)
-       call getin('coefcoli', coefcoli_omp)
-!$OMP END MASTER
-!$OMP BARRIER
-       iflag_lscav=iflag_lscav_omp
-       ccntrAA_in=ccntrAA_omp
-       ccntrENV_in=ccntrENV_omp
-       coefcoli_in=coefcoli_omp
-       !
-       SELECT CASE(iflag_lscav)
-       CASE(0)
-          WRITE(lunout,*)  'Large scale scavenging: none'
-       CASE(1)
-          WRITE(lunout,*)  'Large scale scavenging: C. Genthon, Tellus(1992), 44B, 371-389'
-       CASE(2)
-          WRITE(lunout,*)  'Large scale scavenging: C. Genthon, modified P. Heinrich'
-       CASE(3)
-          WRITE(lunout,*)  'Large scale scavenging: M. Shekkar Reddy and O. Boucher, JGR(2004), 109, D14202'
-       CASE(4)
-          WRITE(lunout,*)  'Large scale scavenging: Reddy and Boucher, modified R. Pilon'
-       END SELECT
-       !RomP <<<
-       WRITE(*,*) 'FIRST TIME IN PHYTRAC : pdtphys(sec) = ',pdtphys,'ecrit_tra (sec) = ',ecrit_tra
-       ALLOCATE( source(klon,nbtr), stat=ierr)
-       IF (ierr /= 0) CALL abort_physic('phytrac', 'pb in allocation 1',1)
-
-       ALLOCATE( aerosol(nbtr), stat=ierr)
-       IF (ierr /= 0) CALL abort_physic('phytrac', 'pb in allocation 2',1)
-
-
-       ! Initialize module for specific tracers
-       IF (type_trac == 'inca') THEN
-          source(:,:)=init_source(:,:)
-          CALL tracinca_init(aerosol,lessivage)
-       ELSE IF (type_trac == 'repr') THEN
-          source(:,:)=0.
-       ELSE IF (type_trac == 'co2i') THEN
-          source(:,:)=0.
-          lessivage  = .FALSE.
-          aerosol(:) = .FALSE.
-          pbl_flg(:) = 1
-          iflag_the_trac= 1
-          iflag_vdf_trac= 1
-          iflag_con_trac= 1
-       ELSE IF (type_trac == 'inco') THEN
-          source(:,1:nqCO2) = 0.                          ! from CO2i ModThL
-          source(:,nqCO2+1:nbtr)=init_source(:,:)         ! from INCA ModThL
-          aerosol(1:nqCO2) = .FALSE.                      ! from CO2i ModThL
-          CALL tracinca_init(aerosol(nqCO2+1:nbtr),lessivage)     ! from INCA ModThL
-          pbl_flg(1:nqCO2) = 1                            ! From CO2i ModThL
-          iflag_the_trac = 1                              ! From CO2i
-          iflag_vdf_trac = 1                              ! From CO2i
-          iflag_con_trac = 1                              ! From CO2i
-#ifdef CPP_StratAer
-       ELSE IF (type_trac == 'coag') THEN
-          source(:,:)=0.
-          CALL tracstrataer_init(aerosol,lessivage)       ! init aerosols and lessivage param
-#endif
-       ELSE IF (type_trac == 'lmdz') THEN
-          CALL traclmdz_init(pctsrf,xlat,xlon,ftsol,tr_seri,t_seri,pplay,sh,pdtphys,aerosol,lessivage)
-       ENDIF
-
-       !
-       !--initialising coefficients for scavenging in the case of NP
-       !
-       ALLOCATE(flag_cvltr(nbtr))
-       IF (iflag_con==3) THEN
-          !
-          ALLOCATE(ccntrAA(nbtr))
-          ALLOCATE(ccntrENV(nbtr))
-          ALLOCATE(coefcoli(nbtr))
-          !
-          DO it=1, nbtr
-             IF (type_trac == 'repr') THEN
-                 flag_cvltr(it)=.FALSE.
-             ELSE IF (type_trac == 'inca') THEN
-!                IF ((it.EQ.id_Rn222) .OR. ((it.GE.id_SO2) .AND. (it.LE.id_NH3)) ) THEN 
-!                   !--gas-phase species
-!                   flag_cvltr(it)=.FALSE.
-!
-!                ELSEIF ( (it.GE.id_CIDUSTM) .AND. (it.LE.id_AIN) ) THEN
-!                   !--insoluble aerosol species
-!                   flag_cvltr(it)=.TRUE.
-!                   ccntrAA(it)=0.7
-!                   ccntrENV(it)=0.7
-!                   coefcoli(it)=0.001
-!                ELSEIF ( (it.EQ.id_Pb210) .OR. ((it.GE.id_CSSSM) .AND. (it.LE.id_SSN))) THEN
-!                   !--soluble aerosol species
-!                   flag_cvltr(it)=.TRUE.
-!                   ccntrAA(it)=0.9
-!                   ccntrENV(it)=0.9 
-!                   coefcoli(it)=0.001
-!                ELSE 
-!                   WRITE(lunout,*) 'pb it=', it
-!                   CALL abort_physic('phytrac','pb it scavenging',1)
-!                ENDIF
-                !--test OB 
-                !--for now we do not scavenge in cvltr
-                flag_cvltr(it)=.FALSE.
-             ELSE IF (type_trac == 'co2i') THEN
-                !--co2 tracers are not scavenged
-                flag_cvltr(it)=.FALSE.
-             ELSE IF (type_trac == 'inco') THEN     ! Add ThL
-                flag_cvltr(it)=.FALSE.
-#ifdef CPP_StratAer
-             ELSE IF (type_trac == 'coag') THEN
-                IF (convscav.and.aerosol(it)) THEN
-                   flag_cvltr(it)=.TRUE.
-                   ccntrAA(it) =ccntrAA_in    
-                   ccntrENV(it)=ccntrENV_in
-                   coefcoli(it)=coefcoli_in
-                ELSE
-                   flag_cvltr(it)=.FALSE.
-                ENDIF
-#endif
-             ELSE IF (type_trac == 'lmdz') THEN
-                IF (convscav.and.aerosol(it)) THEN
-                   flag_cvltr(it)=.TRUE.
-                   ccntrAA(it) =ccntrAA_in    !--a modifier par JYG a lire depuis fichier 
-                   ccntrENV(it)=ccntrENV_in
-                   coefcoli(it)=coefcoli_in
-                ELSE 
-                   flag_cvltr(it)=.FALSE.
-                ENDIF
-             ENDIF
-          ENDDO
-          !
-       ELSE ! iflag_con .ne. 3 
-          flag_cvltr(:) = .FALSE. 
-       ENDIF
-       !
-       ! print out all tracer flags 
-       !
-       WRITE(lunout,*) 'print out all tracer flags'
-       WRITE(lunout,*) 'type_trac      =', type_trac
-       WRITE(lunout,*) 'config_inca    =', config_inca
-       WRITE(lunout,*) 'iflag_con_trac =', iflag_con_trac
-       WRITE(lunout,*) 'iflag_con      =', iflag_con
-       WRITE(lunout,*) 'convscav       =', convscav
-       WRITE(lunout,*) 'iflag_lscav    =', iflag_lscav
-       WRITE(lunout,*) 'aerosol        =', aerosol
-       WRITE(lunout,*) 'iflag_the_trac =', iflag_the_trac
-       WRITE(lunout,*) 'iflag_thermals =', iflag_thermals
-       WRITE(lunout,*) 'iflag_vdf_trac =', iflag_vdf_trac
-       WRITE(lunout,*) 'pbl_flg        =', pbl_flg
-       WRITE(lunout,*) 'lessivage      =', lessivage
-       write(lunout,*)  'flag_cvltr    = ', flag_cvltr
-
-       IF (lessivage .AND. ANY(type_trac == ['inca','inco'])) &
-          CALL abort_physic('phytrac', 'lessivage=T config_inca=inca impossible',1)
-       !
+      !!jyg
+      !$OMP BARRIER
+      ecrit_tra = 86400. ! frequence de stokage en dur
+      ! obsolete car remplace par des ecritures dans phys_output_write
+      !RomP >>>
+      !
+      !Config Key  = convscav
+      !Config Desc = Convective scavenging switch: 0=off, 1=on.
+      !Config Def  = .FALSE.
+      !Config Help =
+      !
+      !$OMP MASTER
+      convscav_omp = .FALSE.
+      call getin('convscav', convscav_omp)
+      iflag_vdf_trac_omp = 1
+      call getin('iflag_vdf_trac', iflag_vdf_trac_omp)
+      iflag_con_trac_omp = 1
+      call getin('iflag_con_trac', iflag_con_trac_omp)
+      iflag_the_trac_omp = 1
+      call getin('iflag_the_trac', iflag_the_trac_omp)
+      !$OMP END MASTER
+      !$OMP BARRIER
+      convscav = convscav_omp
+      iflag_vdf_trac = iflag_vdf_trac_omp
+      iflag_con_trac = iflag_con_trac_omp
+      iflag_the_trac = iflag_the_trac_omp
+      write(lunout, *) 'phytrac passage dans routine conv avec lessivage', convscav
+      !
+      !Config Key  = iflag_lscav
+      !Config Desc = Large scale scavenging parametrization: 0=none, 1=old(Genthon92),
+      !              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
+      !Config Def  = 1
+      !Config Help =
+      !
+      !$OMP MASTER
+      iflag_lscav_omp = 1
+      call getin('iflag_lscav', iflag_lscav_omp)
+      ccntrAA_omp = 1
+      ccntrENV_omp = 1.
+      coefcoli_omp = 0.001
+      call getin('ccntrAA', ccntrAA_omp)
+      call getin('ccntrENV', ccntrENV_omp)
+      call getin('coefcoli', coefcoli_omp)
+      !$OMP END MASTER
+      !$OMP BARRIER
+      iflag_lscav = iflag_lscav_omp
+      ccntrAA_in = ccntrAA_omp
+      ccntrENV_in = ccntrENV_omp
+      coefcoli_in = coefcoli_omp
+      !
+      SELECT CASE(iflag_lscav)
+      CASE(0)
+        WRITE(lunout, *)  'Large scale scavenging: none'
+      CASE(1)
+        WRITE(lunout, *)  'Large scale scavenging: C. Genthon, Tellus(1992), 44B, 371-389'
+      CASE(2)
+        WRITE(lunout, *)  'Large scale scavenging: C. Genthon, modified P. Heinrich'
+      CASE(3)
+        WRITE(lunout, *)  'Large scale scavenging: M. Shekkar Reddy and O. Boucher, JGR(2004), 109, D14202'
+      CASE(4)
+        WRITE(lunout, *)  'Large scale scavenging: Reddy and Boucher, modified R. Pilon'
+      END SELECT
+      !RomP <<<
+      WRITE(*, *) 'FIRST TIME IN PHYTRAC : pdtphys(sec) = ', pdtphys, 'ecrit_tra (sec) = ', ecrit_tra
+      ALLOCATE(source(klon, nbtr), stat = ierr)
+      IF (ierr /= 0) CALL abort_physic('phytrac', 'pb in allocation 1', 1)
+
+      ALLOCATE(aerosol(nbtr), stat = ierr)
+      IF (ierr /= 0) CALL abort_physic('phytrac', 'pb in allocation 2', 1)
+
+
+      ! Initialize module for specific tracers
+      IF (type_trac == 'inca') THEN
+        source(:, :) = init_source(:, :)
+        CALL tracinca_init(aerosol, lessivage)
+      ELSE IF (type_trac == 'repr') THEN
+        source(:, :) = 0.
+      ELSE IF (type_trac == 'co2i') THEN
+        source(:, :) = 0.
+        lessivage = .FALSE.
+        aerosol(:) = .FALSE.
+        pbl_flg(:) = 1
+        iflag_the_trac = 1
+        iflag_vdf_trac = 1
+        iflag_con_trac = 1
+      ELSE IF (type_trac == 'inco') THEN
+        source(:, 1:nqCO2) = 0.                          ! from CO2i ModThL
+        source(:, nqCO2 + 1:nbtr) = init_source(:, :)         ! from INCA ModThL
+        aerosol(1:nqCO2) = .FALSE.                      ! from CO2i ModThL
+        CALL tracinca_init(aerosol(nqCO2 + 1:nbtr), lessivage)     ! from INCA ModThL
+        pbl_flg(1:nqCO2) = 1                            ! From CO2i ModThL
+        iflag_the_trac = 1                              ! From CO2i
+        iflag_vdf_trac = 1                              ! From CO2i
+        iflag_con_trac = 1                              ! From CO2i
+      ELSE IF (type_trac == 'coag' .AND. CPPKEY_STRATAER) THEN
+        source(:, :) = 0.
+        CALL tracstrataer_init(aerosol, lessivage)       ! init aerosols and lessivage param
+      ELSE IF (type_trac == 'lmdz') THEN
+        CALL traclmdz_init(pctsrf, xlat, xlon, ftsol, tr_seri, t_seri, pplay, sh, pdtphys, aerosol, lessivage)
+      ENDIF
+
+      !
+      !--initialising coefficients for scavenging in the case of NP
+      !
+      ALLOCATE(flag_cvltr(nbtr))
+      IF (iflag_con==3) THEN
+        !
+        ALLOCATE(ccntrAA(nbtr))
+        ALLOCATE(ccntrENV(nbtr))
+        ALLOCATE(coefcoli(nbtr))
+        !
+        DO it = 1, nbtr
+          IF (type_trac == 'repr') THEN
+            flag_cvltr(it) = .FALSE.
+          ELSE IF (type_trac == 'inca') THEN
+            !                IF ((it.EQ.id_Rn222) .OR. ((it.GE.id_SO2) .AND. (it.LE.id_NH3)) ) THEN
+            !                   !--gas-phase species
+            !                   flag_cvltr(it)=.FALSE.
+            !
+            !                ELSEIF ( (it.GE.id_CIDUSTM) .AND. (it.LE.id_AIN) ) THEN
+            !                   !--insoluble aerosol species
+            !                   flag_cvltr(it)=.TRUE.
+            !                   ccntrAA(it)=0.7
+            !                   ccntrENV(it)=0.7
+            !                   coefcoli(it)=0.001
+            !                ELSEIF ( (it.EQ.id_Pb210) .OR. ((it.GE.id_CSSSM) .AND. (it.LE.id_SSN))) THEN
+            !                   !--soluble aerosol species
+            !                   flag_cvltr(it)=.TRUE.
+            !                   ccntrAA(it)=0.9
+            !                   ccntrENV(it)=0.9
+            !                   coefcoli(it)=0.001
+            !                ELSE
+            !                   WRITE(lunout,*) 'pb it=', it
+            !                   CALL abort_physic('phytrac','pb it scavenging',1)
+            !                ENDIF
+            !--test OB
+            !--for now we do not scavenge in cvltr
+            flag_cvltr(it) = .FALSE.
+          ELSE IF (type_trac == 'co2i') THEN
+            !--co2 tracers are not scavenged
+            flag_cvltr(it) = .FALSE.
+          ELSE IF (type_trac == 'inco') THEN     ! Add ThL
+            flag_cvltr(it) = .FALSE.
+          ELSE IF (type_trac == 'coag' .AND. CPPKEY_STRATAER) THEN
+            IF (convscav.and.aerosol(it)) THEN
+              flag_cvltr(it) = .TRUE.
+              ccntrAA(it) = ccntrAA_in
+              ccntrENV(it) = ccntrENV_in
+              coefcoli(it) = coefcoli_in
+            ELSE
+              flag_cvltr(it) = .FALSE.
+            ENDIF
+          ELSE IF (type_trac == 'lmdz') THEN
+            IF (convscav.and.aerosol(it)) THEN
+              flag_cvltr(it) = .TRUE.
+              ccntrAA(it) = ccntrAA_in    !--a modifier par JYG a lire depuis fichier
+              ccntrENV(it) = ccntrENV_in
+              coefcoli(it) = coefcoli_in
+            ELSE
+              flag_cvltr(it) = .FALSE.
+            ENDIF
+          ENDIF
+        ENDDO
+        !
+      ELSE ! iflag_con .ne. 3
+        flag_cvltr(:) = .FALSE.
+      ENDIF
+      !
+      ! print out all tracer flags
+      !
+      WRITE(lunout, *) 'print out all tracer flags'
+      WRITE(lunout, *) 'type_trac      =', type_trac
+      WRITE(lunout, *) 'config_inca    =', config_inca
+      WRITE(lunout, *) 'iflag_con_trac =', iflag_con_trac
+      WRITE(lunout, *) 'iflag_con      =', iflag_con
+      WRITE(lunout, *) 'convscav       =', convscav
+      WRITE(lunout, *) 'iflag_lscav    =', iflag_lscav
+      WRITE(lunout, *) 'aerosol        =', aerosol
+      WRITE(lunout, *) 'iflag_the_trac =', iflag_the_trac
+      WRITE(lunout, *) 'iflag_thermals =', iflag_thermals
+      WRITE(lunout, *) 'iflag_vdf_trac =', iflag_vdf_trac
+      WRITE(lunout, *) 'pbl_flg        =', pbl_flg
+      WRITE(lunout, *) 'lessivage      =', lessivage
+      write(lunout, *)  'flag_cvltr    = ', flag_cvltr
+
+      IF (lessivage .AND. ANY(type_trac == ['inca', 'inco'])) &
+              CALL abort_physic('phytrac', 'lessivage=T config_inca=inca impossible', 1)
+      !
     ENDIF ! of IF (debutphy)
     !############################################ END INITIALIZATION #######
 
-    DO k=1,klev
-       DO i=1,klon
-          zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/rg
-       ENDDO
+    DO k = 1, klev
+      DO i = 1, klon
+        zmasse(i, k) = (paprs(i, k) - paprs(i, k + 1)) / rg
+      ENDDO
     ENDDO
     !
     IF (id_be > 0) THEN
-       DO k=1,klev
-          DO i=1,klon
-             sourceBE(i,k)=srcbe(i,k)       !RomP  -> pour sortie histrac
-          ENDDO
-       ENDDO
+      DO k = 1, klev
+        DO i = 1, klon
+          sourceBE(i, k) = srcbe(i, k)       !RomP  -> pour sortie histrac
+        ENDDO
+      ENDDO
     ENDIF
 
     !===============================================================================
     !    -- Do specific treatment according to chemestry model or local LMDZ tracers
-    !      
+    !
     !===============================================================================
     IF (type_trac == 'inca') THEN
-       !    -- CHIMIE INCA  config_inca = aero or chem --
-       ! Appel fait en fin de phytrac pour avoir les emissions modifiees par 
-       ! la couche limite et la convection avant le calcul de la chimie 
+      !    -- CHIMIE INCA  config_inca = aero or chem --
+      ! Appel fait en fin de phytrac pour avoir les emissions modifiees par
+      ! la couche limite et la convection avant le calcul de la chimie
 
     ELSE IF (type_trac == 'repr') THEN
-       !   -- CHIMIE REPROBUS --
-       CALL tracreprobus(pdtphys, gmtime, debutphy, julien, &
-            presnivs, xlat, xlon, pphis, pphi, &
-            t_seri, pplay, paprs, sh , &
-            tr_seri)
+      !   -- CHIMIE REPROBUS --
+      CALL tracreprobus(pdtphys, gmtime, debutphy, julien, &
+              presnivs, xlat, xlon, pphis, pphi, &
+              t_seri, pplay, paprs, sh, &
+              tr_seri)
 
     ELSE IF (type_trac == 'co2i') THEN
-       !   -- CO2 interactif --
-       !   -- source is updated with FF and BB emissions 
-       !   -- and net fluxes from ocean and orchidee 
-       !   -- sign convention : positive into the atmosphere
-
-       CALL tracco2i(pdtphys, debutphy, &
-            xlat, xlon, pphis, pphi, &
-            t_seri, pplay, paprs, tr_seri, source)
+      !   -- CO2 interactif --
+      !   -- source is updated with FF and BB emissions
+      !   -- and net fluxes from ocean and orchidee
+      !   -- sign convention : positive into the atmosphere
+
+      CALL tracco2i(pdtphys, debutphy, &
+              xlat, xlon, pphis, pphi, &
+              t_seri, pplay, paprs, tr_seri, source)
     ELSE IF (type_trac == 'inco') THEN      ! Add ThL
-       CALL tracco2i(pdtphys, debutphy, &
-            xlat, xlon, pphis, pphi, &
-            t_seri, pplay, paprs, tr_seri, source)
-
-#ifdef CPP_StratAer
-    ELSE IF (type_trac == 'coag') THEN
-       !   --STRATOSPHERIC AER IN THE STRAT --
-       CALL traccoag(pdtphys, gmtime, debutphy, julien, &
-            presnivs, xlat, xlon, pphis, pphi, &
-            t_seri, pplay, paprs, sh, rh , &
-            tr_seri)
-#endif
+      CALL tracco2i(pdtphys, debutphy, &
+              xlat, xlon, pphis, pphi, &
+              t_seri, pplay, paprs, tr_seri, source)
+
+    ELSE IF (type_trac == 'coag' .AND. CPPKEY_STRATAER) THEN
+      !   --STRATOSPHERIC AER IN THE STRAT --
+      CALL traccoag(pdtphys, gmtime, debutphy, julien, &
+              presnivs, xlat, xlon, pphis, pphi, &
+              t_seri, pplay, paprs, sh, rh, &
+              tr_seri)
     ELSE IF (type_trac == 'lmdz') THEN
-       !    -- Traitement des traceurs avec traclmdz
-       CALL traclmdz(nstep, julien, gmtime, pdtphys, t_seri, paprs, pplay, &
-            cdragh,  coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon,iflag_vdf_trac>=0,sh, &
-            rh, pphi, ustar, wstar, ale_bl, ale_wake,  u10m, v10m, &
-            tr_seri, source, d_tr_cl,d_tr_dec, zmasse)               !RomP
+      !    -- Traitement des traceurs avec traclmdz
+      CALL traclmdz(nstep, julien, gmtime, pdtphys, t_seri, paprs, pplay, &
+              cdragh, coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon, iflag_vdf_trac>=0, sh, &
+              rh, pphi, ustar, wstar, ale_bl, ale_wake, u10m, v10m, &
+              tr_seri, source, d_tr_cl, d_tr_dec, zmasse)               !RomP
     ENDIF
     !======================================================================
@@ -679,96 +670,95 @@
     IF (iflag_con_trac==1) THEN
 
-       DO it=1, nbtr
-          IF ( conv_flg(it) == 0 ) CYCLE
-          IF (iflag_con<2) THEN
-             !--pas de transport convectif
-             d_tr_cv(:,:,it)=0.
-
-          ELSE IF (iflag_con==2) THEN
-             !--ancien transport convectif de Tiedtke
-
-             CALL nflxtr(pdtphys, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
-                  pplay, paprs, tr_seri(:,:,it), d_tr_cv(:,:,it))
-          ELSE   
-             !--nouveau transport convectif de Emanuel
-
-             IF (flag_cvltr(it)) THEN
-                !--nouveau transport convectif de Emanuel avec lessivage convectif
-                !
-                !
-                ccntrAA_3d(:,:) =ccntrAA(it)
-                ccntrENV_3d(:,:)=ccntrENV(it)
-                coefcoli_3d(:,:)=coefcoli(it)
-
-                !--beware this interface is a bit weird because it is called for each tracer 
-                !--with the full array tr_seri even if only item it is processed
-
-                CALL cvltr_scav(pdtphys, da, phi,phi2,d1a,dam, mp,ep,         &
-                     sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,              &     
-                     pmflxr,pmflxs,evap,t_seri,wdtrainA,wdtrainM,             &   
-                     paprs,it,tr_seri,upwd,dnwd,itop_con,ibas_con,            &
-                     ccntrAA_3d,ccntrENV_3d,coefcoli_3d,                      &
-                     d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr,&
-                     qPa,qMel,qTrdi,dtrcvMA,Mint,                             &
-                     zmfd1a,zmfphi2,zmfdam)
-
-
-             ELSE  !---flag_cvltr(it).EQ.FALSE
-                !--nouveau transport convectif de Emanuel mais pas de lessivage convectif
-
-                !--beware this interface is a bit weird because it is called for each tracer 
-                !--with the full array tr_seri even if only item it is processed
-                !
-                CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,pplay, &  !jyg
-                     tr_seri,upwd,dnwd,d_tr_cv)                                !jyg
-
-             ENDIF
-
-          ENDIF !--iflag
-
-          !--on ajoute les tendances
-
-          DO k = 1, klev
-             DO i = 1, klon        
-                tr_seri(i,k,it) = tr_seri(i,k,it) + d_tr_cv(i,k,it)
-             ENDDO
+      DO it = 1, nbtr
+        IF (conv_flg(it) == 0) CYCLE
+        IF (iflag_con<2) THEN
+          !--pas de transport convectif
+          d_tr_cv(:, :, it) = 0.
+
+        ELSE IF (iflag_con==2) THEN
+          !--ancien transport convectif de Tiedtke
+
+          CALL nflxtr(pdtphys, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
+                  pplay, paprs, tr_seri(:, :, it), d_tr_cv(:, :, it))
+        ELSE
+          !--nouveau transport convectif de Emanuel
+
+          IF (flag_cvltr(it)) THEN
+            !--nouveau transport convectif de Emanuel avec lessivage convectif
+            !
+            !
+            ccntrAA_3d(:, :) = ccntrAA(it)
+            ccntrENV_3d(:, :) = ccntrENV(it)
+            coefcoli_3d(:, :) = coefcoli(it)
+
+            !--beware this interface is a bit weird because it is called for each tracer
+            !--with the full array tr_seri even if only item it is processed
+
+            CALL cvltr_scav(pdtphys, da, phi, phi2, d1a, dam, mp, ep, &
+                    sigd, sij, wght_cvfd, clw, elij, epmlmMm, eplaMm, &
+                    pmflxr, pmflxs, evap, t_seri, wdtrainA, wdtrainM, &
+                    paprs, it, tr_seri, upwd, dnwd, itop_con, ibas_con, &
+                    ccntrAA_3d, ccntrENV_3d, coefcoli_3d, &
+                    d_tr_cv, d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav, qDi, qPr, &
+                    qPa, qMel, qTrdi, dtrcvMA, Mint, &
+                    zmfd1a, zmfphi2, zmfdam)
+
+          ELSE  !---flag_cvltr(it).EQ.FALSE
+            !--nouveau transport convectif de Emanuel mais pas de lessivage convectif
+
+            !--beware this interface is a bit weird because it is called for each tracer
+            !--with the full array tr_seri even if only item it is processed
+            !
+            CALL cvltr_noscav(it, pdtphys, da, phi, mp, wght_cvfd, paprs, pplay, &  !jyg
+                    tr_seri, upwd, dnwd, d_tr_cv)                                !jyg
+
+          ENDIF
+
+        ENDIF !--iflag
+
+        !--on ajoute les tendances
+
+        DO k = 1, klev
+          DO i = 1, klon
+            tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_cv(i, k, it)
           ENDDO
-
-          CALL minmaxqfi(tr_seri(:,:,it),0.,1.e33,'convection it = '//TRIM(int2str(it)))
-
-       ENDDO ! nbtr
-
-#ifdef CPP_StratAer
-       IF (type_trac=='coag') THEN
-         ! initialize wet deposition flux of sulfur
-         budg_dep_wet_ocs(:)=0.0
-         budg_dep_wet_so2(:)=0.0
-         budg_dep_wet_h2so4(:)=0.0
-         budg_dep_wet_part(:)=0.0
-         ! compute wet deposition flux of sulfur (sum over gases and particles)
-         ! and convert to kg(S)/m2/s
-         DO i = 1, klon
-         DO k = 1, klev
-         DO it = 1, nbtr
-         !do not include SO2 because most of it comes trom the troposphere
-           IF (it==id_OCS_strat) THEN
-             budg_dep_wet_ocs(i)=budg_dep_wet_ocs(i)+d_tr_cv(i,k,it)*(mSatom/mOCSmol) &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-           ELSEIF (it==id_SO2_strat) THEN
-             budg_dep_wet_so2(i)=budg_dep_wet_so2(i)+d_tr_cv(i,k,it)*(mSatom/mSO2mol) &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-           ELSEIF (it==id_H2SO4_strat) THEN
-             budg_dep_wet_h2so4(i)=budg_dep_wet_h2so4(i)+d_tr_cv(i,k,it)*(mSatom/mH2SO4mol) &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-           ELSEIF (it.GT.nbtr_sulgas) THEN
-             budg_dep_wet_part(i)=budg_dep_wet_part(i)+d_tr_cv(i,k,it)*(mSatom/mH2SO4mol)  &
-   *dens_aer_dry*4./3.*RPI*(mdw(it-nbtr_sulgas)/2.)**3 &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-           ENDIF
-         ENDDO
-         ENDDO
-         ENDDO
-       ENDIF
-#endif
+        ENDDO
+
+        CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, 'convection it = ' // TRIM(int2str(it)))
+
+      ENDDO ! nbtr
+
+      IF (CPPKEY_STRATAER) THEN
+        IF (type_trac=='coag') THEN
+          ! initialize wet deposition flux of sulfur
+          budg_dep_wet_ocs(:) = 0.0
+          budg_dep_wet_so2(:) = 0.0
+          budg_dep_wet_h2so4(:) = 0.0
+          budg_dep_wet_part(:) = 0.0
+          ! compute wet deposition flux of sulfur (sum over gases and particles)
+          ! and convert to kg(S)/m2/s
+          DO i = 1, klon
+            DO k = 1, klev
+              DO it = 1, nbtr
+                !do not include SO2 because most of it comes trom the troposphere
+                IF (it==id_OCS_strat) THEN
+                  budg_dep_wet_ocs(i) = budg_dep_wet_ocs(i) + d_tr_cv(i, k, it) * (mSatom / mOCSmol) &
+                          * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                ELSEIF (it==id_SO2_strat) THEN
+                  budg_dep_wet_so2(i) = budg_dep_wet_so2(i) + d_tr_cv(i, k, it) * (mSatom / mSO2mol) &
+                          * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                ELSEIF (it==id_H2SO4_strat) THEN
+                  budg_dep_wet_h2so4(i) = budg_dep_wet_h2so4(i) + d_tr_cv(i, k, it) * (mSatom / mH2SO4mol) &
+                          * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                ELSEIF (it>nbtr_sulgas) THEN
+                  budg_dep_wet_part(i) = budg_dep_wet_part(i) + d_tr_cv(i, k, it) * (mSatom / mH2SO4mol)  &
+                          * dens_aer_dry * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 &
+                          * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                ENDIF
+              ENDDO
+            ENDDO
+          ENDDO
+        ENDIF
+      END IF
 
     ENDIF ! convection
@@ -778,35 +768,35 @@
     !======================================================================
 
-    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.)
-! the next safeguard causes some problem for stratospheric aerosol tracers (particle number)
-! and there is little justification for it so it is commented out (4 December 2017) by OB
-! if reinstated please keep the ifndef CPP_StratAer
-!#ifndef CPP_StratAer
-!             tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
-!#endif
+    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.)
+          ! the next safeguard causes some problem for stratospheric aerosol tracers (particle number)
+          ! and there is little justification for it so it is commented out (4 December 2017) by OB
+          ! if reinstated please keep the ifndef CPP_StratAer
+          !#ifndef CPP_StratAer
+          !             tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
+          !#endif
+        ENDDO
+      ENDDO
+    ENDDO
+
+    IF (iflag_thermals>0.AND.iflag_the_trac>0) THEN
+
+      DO it = 1, nbtr
+
+        CALL thermcell_dq(klon, klev, 1, pdtphys, fm_therm, entr_therm, &
+                zmasse, tr_seri(1:klon, 1:klev, it), &
+                d_tr_th(1:klon, 1:klev, it), ztra_th, 0)
+
+        DO k = 1, klev
+          DO i = 1, klon
+            d_tr_th(i, k, it) = pdtphys * d_tr_th(i, k, it)
+            tr_seri(i, k, it) = MAX(tr_seri(i, k, it) + d_tr_th(i, k, it), 0.)
           ENDDO
-       ENDDO
-    ENDDO
-
-    IF (iflag_thermals>0.AND.iflag_the_trac>0) THEN
-
-       DO it=1, nbtr
-
-          CALL thermcell_dq(klon,klev,1,pdtphys,fm_therm,entr_therm, &
-               zmasse,tr_seri(1:klon,1:klev,it),        &
-               d_tr_th(1:klon,1:klev,it),ztra_th,0 )
-
-          DO k=1,klev
-             DO i=1,klon
-                d_tr_th(i,k,it)=pdtphys*d_tr_th(i,k,it)
-                tr_seri(i,k,it)=MAX(tr_seri(i,k,it)+d_tr_th(i,k,it),0.)
-             ENDDO
-          ENDDO
-
-       ENDDO ! it
+        ENDDO
+
+      ENDDO ! it
 
     ENDIF ! Thermiques
@@ -818,82 +808,82 @@
     IF (iflag_vdf_trac==1) THEN
 
-       !  Injection during BL mixing
-       !
-#ifdef CPP_StratAer
-       IF (type_trac=='coag') THEN
-
-         ! initialize dry deposition flux of sulfur
-         budg_dep_dry_ocs(:)=0.0
-         budg_dep_dry_so2(:)=0.0
-         budg_dep_dry_h2so4(:)=0.0
-         budg_dep_dry_part(:)=0.0
-
-         ! compute dry deposition velocity as function of surface type (numbers
-         ! from IPSL note 23, 2002)
-         v_dep_dry(:) =  pctsrf(:,is_ter) * 2.5e-3 &
-   + pctsrf(:,is_oce) * 0.5e-3 &
-   + pctsrf(:,is_lic) * 2.5e-3 &
-   + pctsrf(:,is_sic) * 2.5e-3
-
-         ! compute surface dry deposition flux
-         zrho(:,1)=pplay(:,1)/t_seri(:,1)/RD
-
-         DO it=1, nbtr
-          source(:,it) = - v_dep_dry(:) * tr_seri(:,1,it) * zrho(:,1)
-         ENDDO
-
-       ENDIF
-#endif
-
-       DO it=1, nbtr
+      !  Injection during BL mixing
+      !
+      IF (CPPKEY_STRATAER) THEN
+        IF (type_trac=='coag') THEN
+
+          ! initialize dry deposition flux of sulfur
+          budg_dep_dry_ocs(:) = 0.0
+          budg_dep_dry_so2(:) = 0.0
+          budg_dep_dry_h2so4(:) = 0.0
+          budg_dep_dry_part(:) = 0.0
+
+          ! compute dry deposition velocity as function of surface type (numbers
+          ! from IPSL note 23, 2002)
+          v_dep_dry(:) = pctsrf(:, is_ter) * 2.5e-3 &
+                  + pctsrf(:, is_oce) * 0.5e-3 &
+                  + pctsrf(:, is_lic) * 2.5e-3 &
+                  + pctsrf(:, is_sic) * 2.5e-3
+
+          ! compute surface dry deposition flux
+          zrho(:, 1) = pplay(:, 1) / t_seri(:, 1) / RD
+
+          DO it = 1, nbtr
+            source(:, it) = - v_dep_dry(:) * tr_seri(:, 1, it) * zrho(:, 1)
+          ENDDO
+
+        ENDIF
+      END IF
+
+      DO it = 1, nbtr
+        !
+        IF (pbl_flg(it) /= 0) THEN
           !
-          IF (pbl_flg(it) /= 0) THEN
-             !
-             CALL cltrac(pdtphys, coefh,t_seri,       &
-                  tr_seri(:,:,it), source(:,it),      &
-                  paprs, pplay, delp,                 &
-                  d_tr_cl(:,:,it),d_tr_dry(:,it),flux_tr_dry(:,it))
-             !
-             tr_seri(:,:,it)=tr_seri(:,:,it)+d_tr_cl(:,:,it)
-             !
-#ifdef CPP_StratAer
-             IF (type_trac=='coag') THEN
-               ! compute dry deposition flux of sulfur (sum over gases and particles)
-               IF (it==id_OCS_strat) THEN
-                 budg_dep_dry_ocs(:)=budg_dep_dry_ocs(:)-source(:,it)*(mSatom/mOCSmol)
-               ELSEIF (it==id_SO2_strat) THEN
-                 budg_dep_dry_so2(:)=budg_dep_dry_so2(:)-source(:,it)*(mSatom/mSO2mol)
-               ELSEIF (it==id_H2SO4_strat) THEN
-                 budg_dep_dry_h2so4(:)=budg_dep_dry_h2so4(:)-source(:,it)*(mSatom/mH2SO4mol)
-               ELSEIF (it.GT.nbtr_sulgas) THEN
-                 budg_dep_dry_part(:)=budg_dep_dry_part(:)-source(:,it)*(mSatom/mH2SO4mol)*dens_aer_dry &
-   *4./3.*RPI*(mdw(it-nbtr_sulgas)/2.)**3
-               ENDIF
-             ENDIF
-#endif
-             !
-          ENDIF
+          CALL cltrac(pdtphys, coefh, t_seri, &
+                  tr_seri(:, :, it), source(:, it), &
+                  paprs, pplay, delp, &
+                  d_tr_cl(:, :, it), d_tr_dry(:, it), flux_tr_dry(:, it))
           !
-       ENDDO
-       !
+          tr_seri(:, :, it) = tr_seri(:, :, it) + d_tr_cl(:, :, it)
+          !
+          IF (CPPKEY_STRATAER) THEN
+            IF (type_trac=='coag') THEN
+              ! compute dry deposition flux of sulfur (sum over gases and particles)
+              IF (it==id_OCS_strat) THEN
+                budg_dep_dry_ocs(:) = budg_dep_dry_ocs(:) - source(:, it) * (mSatom / mOCSmol)
+              ELSEIF (it==id_SO2_strat) THEN
+                budg_dep_dry_so2(:) = budg_dep_dry_so2(:) - source(:, it) * (mSatom / mSO2mol)
+              ELSEIF (it==id_H2SO4_strat) THEN
+                budg_dep_dry_h2so4(:) = budg_dep_dry_h2so4(:) - source(:, it) * (mSatom / mH2SO4mol)
+              ELSEIF (it>nbtr_sulgas) THEN
+                budg_dep_dry_part(:) = budg_dep_dry_part(:) - source(:, it) * (mSatom / mH2SO4mol) * dens_aer_dry &
+                        * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3
+              ENDIF
+            ENDIF
+          END IF
+          !
+        ENDIF
+        !
+      ENDDO
+      !
     ELSE IF (iflag_vdf_trac==0) THEN
-       !
-       !   Injection of source in the first model layer
-       !
-       DO it=1,nbtr
-          d_tr_cl(:,1,it)=source(:,it)*RG/delp(:,1)*pdtphys
-          tr_seri(:,1,it)=tr_seri(:,1,it)+d_tr_cl(:,1,it)
-       ENDDO
-       d_tr_cl(:,2:klev,1:nbtr)=0.
-       !
+      !
+      !   Injection of source in the first model layer
+      !
+      DO it = 1, nbtr
+        d_tr_cl(:, 1, it) = source(:, it) * RG / delp(:, 1) * pdtphys
+        tr_seri(:, 1, it) = tr_seri(:, 1, it) + d_tr_cl(:, 1, it)
+      ENDDO
+      d_tr_cl(:, 2:klev, 1:nbtr) = 0.
+      !
     ELSE IF (iflag_vdf_trac==-1) THEN
-       !
-       ! Nothing happens
-       d_tr_cl=0.
-       !
+      !
+      ! Nothing happens
+      d_tr_cl = 0.
+      !
     ELSE
-       !
-       CALL abort_physic('iflag_vdf_trac', 'cas non prevu',1)
-       !
+      !
+      CALL abort_physic('iflag_vdf_trac', 'cas non prevu', 1)
+      !
     ENDIF ! couche limite
 
@@ -905,191 +895,191 @@
     IF (lessivage) THEN
 
-       ql_incloud_ref = 10.e-4
-       ql_incloud_ref =  5.e-4
-
-
-       ! calcul du contenu en eau liquide au sein du nuage
-       ql_incl = ql_incloud_ref
-       ! choix du lessivage
-       !
-       IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN
-          ! ********  Olivier Boucher version (3) possibly with modified ql_incl (4)
-          !
-          DO it = 1, nbtr
-
-             IF (aerosol(it)) THEN
-             !  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,aerosol,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)
+      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 == 3 .OR. iflag_lscav == 4) THEN
+        ! ********  Olivier Boucher version (3) possibly with modified ql_incl (4)
+        !
+        DO it = 1, nbtr
+
+          IF (aerosol(it)) THEN
+            !  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, aerosol, ql_incl, prfl, psfl, rneb, beta_fisrt, &
+                    beta_v1, pplay, paprs, t_seri, tr_seri, d_tr_insc, d_tr_bcscav, d_tr_evapls, qPrls)
+
+            !large scale scavenging tendency
+            DO k = 1, klev
+              DO i = 1, klon
+                d_tr_ls(i, k, it) = d_tr_insc(i, k, it) + d_tr_bcscav(i, k, it) + d_tr_evapls(i, k, it)
+                tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_ls(i, k, it)
+              ENDDO
+            ENDDO
+            CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, 'lsc scav it = ' // TRIM(int2str(it)))
+          ENDIF
+
+        ENDDO  !tr
+
+        IF (CPPKEY_STRATAER) THEN
+          IF (type_trac=='coag') THEN
+            ! compute wet deposition flux of sulfur (sum over gases and
+            ! particles) and convert to kg(S)/m2/s
+            ! adding contribution of d_tr_ls to d_tr_cv (above)
+            DO i = 1, klon
+              DO k = 1, klev
+                DO it = 1, nbtr
+                  IF (it==id_OCS_strat) THEN
+                    budg_dep_wet_ocs(i) = budg_dep_wet_ocs(i) + d_tr_ls(i, k, it) * (mSatom / mOCSmol) &
+                            * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                  ELSEIF (it==id_SO2_strat) THEN
+                    budg_dep_wet_so2(i) = budg_dep_wet_so2(i) + d_tr_ls(i, k, it) * (mSatom / mSO2mol) &
+                            * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                  ELSEIF (it==id_H2SO4_strat) THEN
+                    budg_dep_wet_h2so4(i) = budg_dep_wet_h2so4(i) + d_tr_ls(i, k, it) * (mSatom / mH2SO4mol) &
+                            * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                  ELSEIF (it>nbtr_sulgas) THEN
+                    budg_dep_wet_part(i) = budg_dep_wet_part(i) + d_tr_ls(i, k, it) * (mSatom / mH2SO4mol)  &
+                            * dens_aer_dry * 4. / 3. * RPI * (mdw(it - nbtr_sulgas) / 2.)**3 &
+                            * (paprs(i, k) - paprs(i, k + 1)) / RG / pdtphys
+                  ENDIF
                 ENDDO
-             ENDDO
-             CALL minmaxqfi(tr_seri(:,:,it),0.,1.e33,'lsc scav it = '//TRIM(int2str(it)))
-             ENDIF
-
-          ENDDO  !tr
-
-#ifdef CPP_StratAer
-         IF (type_trac=='coag') THEN
-           ! compute wet deposition flux of sulfur (sum over gases and
-           ! particles) and convert to kg(S)/m2/s
-           ! adding contribution of d_tr_ls to d_tr_cv (above)
-           DO i = 1, klon
-           DO k = 1, klev
-           DO it = 1, nbtr
-             IF (it==id_OCS_strat) THEN
-               budg_dep_wet_ocs(i)=budg_dep_wet_ocs(i)+d_tr_ls(i,k,it)*(mSatom/mOCSmol) &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-             ELSEIF (it==id_SO2_strat) THEN
-               budg_dep_wet_so2(i)=budg_dep_wet_so2(i)+d_tr_ls(i,k,it)*(mSatom/mSO2mol) &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-             ELSEIF (it==id_H2SO4_strat) THEN
-               budg_dep_wet_h2so4(i)=budg_dep_wet_h2so4(i)+d_tr_ls(i,k,it)*(mSatom/mH2SO4mol) &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-             ELSEIF (it.GT.nbtr_sulgas) THEN
-               budg_dep_wet_part(i)=budg_dep_wet_part(i)+d_tr_ls(i,k,it)*(mSatom/mH2SO4mol)  &
-   *dens_aer_dry*4./3.*RPI*(mdw(it-nbtr_sulgas)/2.)**3 &
-   *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
-             ENDIF
-           ENDDO
-           ENDDO
-           ENDDO
-         ENDIF
-#endif
-
-       ELSE IF (iflag_lscav == 2) THEN ! frac_impa, frac_nucl
-          ! *********   modified  old version
-
-          d_tr_lessi_nucl(:,:,:) = 0. 
-          d_tr_lessi_impa(:,:,:) = 0.
-          flestottr(:,:,:) = 0. 
-          ! Tendance des aerosols nuclees et impactes 
-          DO it = 1, nbtr
-             IF (aerosol(it)) THEN
-                his_dh(:)=0.
-                DO k = 1, klev
-                   DO i = 1, klon
-                      !PhH
-                      zrho(i,k)=pplay(i,k)/t_seri(i,k)/RD
-                      zdz(i,k)=(paprs(i,k)-paprs(i,k+1))/zrho(i,k)/RG
-                      !
-                   ENDDO
-                ENDDO
-
-                DO k=klev-1, 1, -1
-                   DO i=1, klon
-                      !             d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.)
-                      dx=d_tr_ls(i,k,it)
-                      his_dh(i)=his_dh(i)-dx*zrho(i,k)*zdz(i,k)/pdtphys !  kg/m2/s
-                      evaplsc = prfl(i,k) - prfl(i,k+1) + psfl(i,k) - psfl(i,k+1)
-                      ! Evaporation Partielle -> Liberation Partielle 0.5*evap
-                      IF ( evaplsc <0..and.abs(prfl(i,k+1)+psfl(i,k+1))>1.e-10) THEN
-                         evaplsc = (-evaplsc)/(prfl(i,k+1)+psfl(i,k+1))
-                         ! evaplsc est donc positif, his_dh(i) est positif
-                         !--------------  
-                         d_tr_evapls(i,k,it)=0.5*evaplsc*(d_tr_lessi_nucl(i,k+1,it) &
-                              +d_tr_lessi_impa(i,k+1,it))
-                         !-------------   d_tr_evapls(i,k,it)=-0.5*evaplsc*(d_tr_lsc(i,k+1,it))
-                         beta=0.5*evaplsc
-                         if ((prfl(i,k)+psfl(i,k))<1.e-10) THEN
-                            beta=1.0*evaplsc
-                         endif
-                         dx=beta*his_dh(i)/zrho(i,k)/zdz(i,k)*pdtphys
-                         his_dh(i)=(1.-beta)*his_dh(i)   ! tracer from
-                         d_tr_evapls(i,k,it)=dx
-                      ENDIF
-                      d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.) &
-                           +d_tr_evapls(i,k,it)
-
-                      !--------------
-                      d_tr_lessi_nucl(i,k,it) = d_tr_lessi_nucl(i,k,it) +    &
-                           ( 1 - frac_nucl(i,k) )*tr_seri(i,k,it)
-                      d_tr_lessi_impa(i,k,it) = d_tr_lessi_impa(i,k,it) +    &
-                           ( 1 - frac_impa(i,k) )*tr_seri(i,k,it)
-                      !
-                      ! Flux lessivage total 
-                      flestottr(i,k,it) = flestottr(i,k,it) -   &
-                           ( d_tr_lessi_nucl(i,k,it)   +        &
-                           d_tr_lessi_impa(i,k,it) ) *          &
-                           ( paprs(i,k)-paprs(i,k+1) ) /        &
-                           (RG * pdtphys)
-                      !! Mise a jour des traceurs due a l'impaction,nucleation 
-                      !                 tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k)
-                      !!  calcul de la tendance liee au lessivage stratiforme
-                      !                 d_tr_ls(i,k,it)=tr_seri(i,k,it)*&
-                      !                                (1.-1./(frac_impa(i,k)*frac_nucl(i,k)))
-                      !--------------
-                   ENDDO
-                ENDDO
-             ENDIF
-          ENDDO
-          ! *********   end modified old version
-
-       ELSE IF (iflag_lscav == 1) THEN ! frac_impa, frac_nucl
-          ! *********    old version
-
-          d_tr_lessi_nucl(:,:,:) = 0. 
-          d_tr_lessi_impa(:,:,:) = 0.
-          flestottr(:,:,:) = 0. 
-          !=========================
-          ! LESSIVAGE LARGE SCALE : 
-          !=========================
-
-          ! Tendance des aerosols nuclees et impactes 
-          ! -----------------------------------------
-          DO it = 1, nbtr
-             IF (aerosol(it)) THEN
-                DO k = 1, klev
-                   DO i = 1, klon
-                      d_tr_lessi_nucl(i,k,it) = d_tr_lessi_nucl(i,k,it) +    &
-                           ( 1 - frac_nucl(i,k) )*tr_seri(i,k,it)
-                      d_tr_lessi_impa(i,k,it) = d_tr_lessi_impa(i,k,it) +    &
-                           ( 1 - frac_impa(i,k) )*tr_seri(i,k,it)
-
-                      !
-                      ! Flux lessivage total 
-                      ! ------------------------------------------------------------
-                      flestottr(i,k,it) = flestottr(i,k,it) -   &
-                           ( d_tr_lessi_nucl(i,k,it)   +        &
-                           d_tr_lessi_impa(i,k,it) ) *          &
-                           ( paprs(i,k)-paprs(i,k+1) ) /        &
-                           (RG * pdtphys)
-                      !
-                      ! Mise a jour des traceurs due a l'impaction,nucleation 
-                      ! ----------------------------------------------------------------------
-                      tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k)
-                   ENDDO
-                ENDDO
-             ENDIF
-          ENDDO
-
-          ! *********   end old version
-       ENDIF  !  iflag_lscav  .EQ. 1, 2, 3 or 4
-       !
+              ENDDO
+            ENDDO
+          ENDIF
+        END IF
+
+      ELSE IF (iflag_lscav == 2) THEN ! frac_impa, frac_nucl
+        ! *********   modified  old version
+
+        d_tr_lessi_nucl(:, :, :) = 0.
+        d_tr_lessi_impa(:, :, :) = 0.
+        flestottr(:, :, :) = 0.
+        ! Tendance des aerosols nuclees et impactes
+        DO it = 1, nbtr
+          IF (aerosol(it)) THEN
+            his_dh(:) = 0.
+            DO k = 1, klev
+              DO i = 1, klon
+                !PhH
+                zrho(i, k) = pplay(i, k) / t_seri(i, k) / RD
+                zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG
+                !
+              ENDDO
+            ENDDO
+
+            DO k = klev - 1, 1, -1
+              DO i = 1, klon
+                !             d_tr_ls(i,k,it)=tr_seri(i,k,it)*(frac_impa(i,k)*frac_nucl(i,k)-1.)
+                dx = d_tr_ls(i, k, it)
+                his_dh(i) = his_dh(i) - dx * zrho(i, k) * zdz(i, k) / pdtphys !  kg/m2/s
+                evaplsc = prfl(i, k) - prfl(i, k + 1) + psfl(i, k) - psfl(i, k + 1)
+                ! Evaporation Partielle -> Liberation Partielle 0.5*evap
+                IF (evaplsc <0..and.abs(prfl(i, k + 1) + psfl(i, k + 1))>1.e-10) THEN
+                  evaplsc = (-evaplsc) / (prfl(i, k + 1) + psfl(i, k + 1))
+                  ! evaplsc est donc positif, his_dh(i) est positif
+                  !--------------
+                  d_tr_evapls(i, k, it) = 0.5 * evaplsc * (d_tr_lessi_nucl(i, k + 1, it) &
+                          + d_tr_lessi_impa(i, k + 1, it))
+                  !-------------   d_tr_evapls(i,k,it)=-0.5*evaplsc*(d_tr_lsc(i,k+1,it))
+                  beta = 0.5 * evaplsc
+                  if ((prfl(i, k) + psfl(i, k))<1.e-10) THEN
+                    beta = 1.0 * evaplsc
+                  endif
+                  dx = beta * his_dh(i) / zrho(i, k) / zdz(i, k) * pdtphys
+                  his_dh(i) = (1. - beta) * his_dh(i)   ! tracer from
+                  d_tr_evapls(i, k, it) = dx
+                ENDIF
+                d_tr_ls(i, k, it) = tr_seri(i, k, it) * (frac_impa(i, k) * frac_nucl(i, k) - 1.) &
+                        + d_tr_evapls(i, k, it)
+
+                !--------------
+                d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + &
+                        (1 - frac_nucl(i, k)) * tr_seri(i, k, it)
+                d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + &
+                        (1 - frac_impa(i, k)) * tr_seri(i, k, it)
+                !
+                ! Flux lessivage total
+                flestottr(i, k, it) = flestottr(i, k, it) - &
+                        (d_tr_lessi_nucl(i, k, it) + &
+                                d_tr_lessi_impa(i, k, it)) * &
+                                (paprs(i, k) - paprs(i, k + 1)) / &
+                                (RG * pdtphys)
+                !! Mise a jour des traceurs due a l'impaction,nucleation
+                !                 tr_seri(i,k,it)=tr_seri(i,k,it)*frac_impa(i,k)*frac_nucl(i,k)
+                !!  calcul de la tendance liee au lessivage stratiforme
+                !                 d_tr_ls(i,k,it)=tr_seri(i,k,it)*&
+                !                                (1.-1./(frac_impa(i,k)*frac_nucl(i,k)))
+                !--------------
+              ENDDO
+            ENDDO
+          ENDIF
+        ENDDO
+        ! *********   end modified old version
+
+      ELSE IF (iflag_lscav == 1) THEN ! frac_impa, frac_nucl
+        ! *********    old version
+
+        d_tr_lessi_nucl(:, :, :) = 0.
+        d_tr_lessi_impa(:, :, :) = 0.
+        flestottr(:, :, :) = 0.
+        !=========================
+        ! LESSIVAGE LARGE SCALE :
+        !=========================
+
+        ! Tendance des aerosols nuclees et impactes
+        ! -----------------------------------------
+        DO it = 1, nbtr
+          IF (aerosol(it)) THEN
+            DO k = 1, klev
+              DO i = 1, klon
+                d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + &
+                        (1 - frac_nucl(i, k)) * tr_seri(i, k, it)
+                d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + &
+                        (1 - frac_impa(i, k)) * tr_seri(i, k, it)
+
+                !
+                ! Flux lessivage total
+                ! ------------------------------------------------------------
+                flestottr(i, k, it) = flestottr(i, k, it) - &
+                        (d_tr_lessi_nucl(i, k, it) + &
+                                d_tr_lessi_impa(i, k, it)) * &
+                                (paprs(i, k) - paprs(i, k + 1)) / &
+                                (RG * pdtphys)
+                !
+                ! Mise a jour des traceurs due a l'impaction,nucleation
+                ! ----------------------------------------------------------------------
+                tr_seri(i, k, it) = tr_seri(i, k, it) * frac_impa(i, k) * frac_nucl(i, k)
+              ENDDO
+            ENDDO
+          ENDIF
+        ENDDO
+
+        ! *********   end old version
+      ENDIF  !  iflag_lscav  .EQ. 1, 2, 3 or 4
+      !
     ENDIF !  lessivage
 
 
     !    -- CHIMIE INCA  config_inca = aero or chem --
-    IF (ANY(type_trac == ['inca','inco'])) THEN  ! ModThL
-
-       CALL tracinca(&
-            nstep,    julien,   gmtime,         lafin,     &
-            pdtphys,  t_seri,   paprs,          pplay,     &
-            pmfu,     upwd,     ftsol,  pctsrf, pphis,     &
-            pphi,     albsol,   sh,    ch,     rh,        &
-            cldfra,   rneb,     diafra,         cldliq,    &
-            itop_con, ibas_con, pmflxr,         pmflxs,    &
-            prfl,     psfl,     aerosol_couple, flxmass_w, &
-            tau_aero, piz_aero, cg_aero,        ccm,       &
-            rfname,                                        &
-            tr_seri(:,:,1+nqCO2:nbtr),  source(:,1+nqCO2:nbtr))  ! ModThL  
+    IF (ANY(type_trac == ['inca', 'inco'])) THEN  ! ModThL
+
+      CALL tracinca(&
+              nstep, julien, gmtime, lafin, &
+              pdtphys, t_seri, paprs, pplay, &
+              pmfu, upwd, ftsol, pctsrf, pphis, &
+              pphi, albsol, sh, ch, rh, &
+              cldfra, rneb, diafra, cldliq, &
+              itop_con, ibas_con, pmflxr, pmflxs, &
+              prfl, psfl, aerosol_couple, flxmass_w, &
+              tau_aero, piz_aero, cg_aero, ccm, &
+              rfname, &
+              tr_seri(:, :, 1 + nqCO2:nbtr), source(:, 1 + nqCO2:nbtr))  ! ModThL
     ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_mod.F90	(revision 5098)
@@ -144,8 +144,8 @@
 !$OMP THREADPRIVATE(ok_prod_nucl_tritium)
    INTEGER, PARAMETER :: nessai = 486
-   INTEGER, DIMENSION(nessai), SAVE :: &
+   INTEGER, DIMENSION(nessai) :: &
                     day_nucl, month_nucl, year_nucl
 !$OMP THREADPRIVATE(day_nucl, month_nucl, year_nucl)
-   REAL,    DIMENSION(nessai), SAVE :: &
+   REAL,    DIMENSION(nessai) :: &
                     lat_nucl, lon_nucl, zmin_nucl, zmax_nucl, HTO_nucl
 !$OMP THREADPRIVATE(lat_nucl, lon_nucl, zmin_nucl, zmax_nucl, HTO_nucl)
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90	(revision 5098)
@@ -17,4 +17,6 @@
 &       bidouille_anti_divergence, &
 &       iso_eau,iso_HDO,iso_O18
+USE lmdz_yomcst
+
 #ifdef ISOVERIF
 !USE isotopes_verif_mod, ONLY: errmax,errmaxrel
@@ -28,6 +30,4 @@
 #endif
 implicit none
-
-#include "YOMCST.h"       
 
 ! inputs
@@ -12962,5 +12962,6 @@
 &       bidouille_anti_divergence, ridicule,ridicule_snow, &
 &       tcorr,toce,alpha_liq_sol
-    USE indice_sol_mod    
+    USE indice_sol_mod
+    USE lmdz_yomcst
 #ifdef ISOVERIF
 !    USE isotopes_verif_mod, ONLY: errmax,errmaxrel,errmax_sol,deltalim_snow
@@ -12978,5 +12979,4 @@
 #include "YOETHF.h" 
 #include "FCTTRE.h"   
-#include "YOMCST.h"
 !#include "dimensions.h"
 !#include "paramet.h"
@@ -13534,4 +13534,5 @@
 &       rh_cste_surf_cond,Rdefault,T_cste_surf_cond,iso_O17,iso_O18, &
 &       ridicule_evap,tnat
+    USE lmdz_yomcst
 #ifdef ISOVERIF
 !    USE isotopes_verif_mod, ONLY: deltaDfaible, faible_evap,errmax,errmaxrel
@@ -13546,6 +13547,5 @@
 #include "YOETHF.h"         
 #include "FCTTRE.h"   
-#include "YOMCST.h"
-        
+
         ! inputs
         integer, intent(in) :: klon,knon ! dimensions
@@ -14447,4 +14447,5 @@
 &       ridicule_evap
 USE fonte_neige_mod, ONLY: gestion_neige_besoin_varglob_fonte_neige
+USE lmdz_yomcst
 #ifdef ISOVERIF
 !USE isotopes_verif_mod, ONLY: errmax,errmaxrel,errmax_sol,deltalim_snow, &
@@ -14460,8 +14461,5 @@
 
 #include "YOETHF.h" 
-#include "FCTTRE.h"   
-#include "YOMCST.h"
-!#include "dimensions.h"
-!#include "paramet.h"
+#include "FCTTRE.h"
         
         ! inputs
@@ -16634,10 +16632,9 @@
         USE geometry_mod, only: latitude_deg,longitude_deg, & ! en degré, remplace rlat et rlon
                    latitude,longitude ! en radian, remplace rlatd et rlond
+        USE lmdz_yomcst
 #ifdef ISOVERIF
         USE isotopes_verif_mod
 #endif
       implicit none
-
-#include "YOMCST.h"
 
 ! input
@@ -18232,4 +18229,5 @@
         USE dimphy, only: klon,klev
         use geometry_mod, only: latitude_deg,longitude_deg
+        USE lmdz_yomcst
 #ifdef ISOVERIF
         USE isotopes_verif_mod
@@ -18237,5 +18235,4 @@
       implicit none
 
-#include "YOMCST.h"
 #include "dimensions.h"
 ! pour avoir iim et jjm
@@ -18375,10 +18372,9 @@
         use geometry_mod, only: cell_area
         use dimphy, only: klon,klev
+        USE lmdz_yomcst
 #ifdef ISOVERIF
         USE isotopes_verif_mod
 #endif
       implicit none
-
-#include "YOMCST.h"
 
 !     Arguments
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_yomcst.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_yomcst.f90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_yomcst.f90	(revision 5098)
@@ -0,0 +1,1 @@
+link ../phylmd/lmdz_yomcst.f90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_local_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_local_var_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_local_var_mod.F90	(revision 5098)
@@ -2,125 +2,126 @@
 ! $Id: phys_local_var_mod.F90 3888 2021-05-05 10:50:37Z jyg $
 !
-      MODULE phys_local_var_mod
-! Variables locales pour effectuer les appels en serie
-!======================================================================
-!
-!
-!======================================================================
-! Declaration des variables
-
-      REAL, SAVE, ALLOCATABLE :: t_seri(:,:), q_seri(:,:)
-      !$OMP THREADPRIVATE(t_seri, q_seri)
-      REAL, SAVE, ALLOCATABLE :: ql_seri(:,:),qs_seri(:,:)
-      !$OMP THREADPRIVATE(ql_seri,qs_seri)
-      REAL, SAVE, ALLOCATABLE :: qx_seri(:,:,:)
-      !$OMP THREADPRIVATE(qx_seri)
-      REAL, SAVE, ALLOCATABLE :: qbs_seri(:,:)
-      !$OMP THREADPRIVATE(qbs_seri)
-      REAL, SAVE, ALLOCATABLE :: u_seri(:,:), v_seri(:,:)
-      !$OMP THREADPRIVATE(u_seri, v_seri)
-      REAL, SAVE, ALLOCATABLE :: rneb_seri(:,:)
-      !$OMP THREADPRIVATE(rneb_seri)
-      REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:,:)
-      !$OMP THREADPRIVATE(d_rneb_dyn)
-      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:),l_mix(:,:,:),wprime(:,:,:)
-      !$OMP THREADPRIVATE(l_mixmin, l_mix, wprime)
-      REAL, SAVE, ALLOCATABLE :: pbl_eps(:,:,:)
-      !$OMP THREADPRIVATE(pbl_eps)
-      REAL, SAVE, ALLOCATABLE :: tke_shear(:,:,:), tke_buoy(:,:,:), tke_trans(:,:,:)
-      !$OMP THREADPRIVATE(tke_shear,tke_buoy,tke_trans)
-      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
-      !$OMP THREADPRIVATE(tr_seri)
-      REAL, SAVE, ALLOCATABLE :: rhcl(:,:)
-      !$OMP THREADPRIVATE(rhcl)
-      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
-      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:,:), d_qs_dyn(:,:), d_qbs_dyn(:,:)
-      !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:), d_qbs_dyn2d(:)
-      !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
-      REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:)
-      !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
-      !$OMP THREADPRIVATE(d_tr_dyn)
-      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:),d_q_con_zmasse(:,:)
-      !$OMP THREADPRIVATE(d_t_con,d_q_con,d_q_con_zmasse)
-      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
-      !$OMP THREADPRIVATE(d_u_con,d_v_con)
-      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
-      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
-      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:),d_qi_lsc(:,:)
-      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
-      REAL, SAVE, ALLOCATABLE :: d_t_lwr(:,:),d_t_lw0(:,:),d_t_swr(:,:),d_t_sw0(:,:)
-      !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
-      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
-      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
-      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
-      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
-      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
-      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
-!nrlmd<
-      REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:,:), d_q_ajs_w(:,:)
-      !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
-      REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:,:), d_q_ajs_x(:,:)
-      !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
-!>nrlmd
-      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:),d_ql_eva(:,:),d_qi_eva(:,:)
-      !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
-      REAL, SAVE, ALLOCATABLE :: d_qx_eva(:,:,:)
-      !$OMP THREADPRIVATE(d_qx_eva)
-      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
-      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
-      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
-      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
-      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
-      !$OMP THREADPRIVATE(plul_th,plul_st)
-!tendances dues a oro et lif
-      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
-      !$OMP THREADPRIVATE(d_t_oli)
-      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
-      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
-      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_qbs_vdf(:,:), d_t_diss(:,:)
-      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf, d_qbs_vdf, d_t_diss)
-      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
-      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
-!nrlmd+jyg<
-      REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:,:), d_q_vdf_w(:,:)
-      !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
-      REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:,:), d_q_vdf_x(:,:)
-      !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
-      REAL, SAVE, ALLOCATABLE :: d_t_bsss(:,:), d_q_bsss(:,:), d_qbs_bsss(:,:)
-      !$OMP THREADPRIVATE( d_t_bsss,d_q_bsss, d_qbs_bsss)
-!>nrlmd+jyg
-      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
-      !$OMP THREADPRIVATE(d_t_oro)
-      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
-      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
-      REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:,:)
-      !$OMP THREADPRIVATE(d_t_oro_gw)
-      REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:,:), d_v_oro_gw(:,:)
-      !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
-      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
-      !$OMP THREADPRIVATE(d_t_lif)
-      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
-      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
-! Tendances Ondes de G non oro (runs strato).
-      REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:,:)
-      !$OMP THREADPRIVATE(du_gwd_hines)
-      REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:,:)
-      !$OMP THREADPRIVATE(dv_gwd_hines)
-      REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:,:)
-      !$OMP THREADPRIVATE(dv_gwd_rando)
-      REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:,:)
-      !$OMP THREADPRIVATE(dv_gwd_front)
-      REAL, SAVE, ALLOCATABLE :: east_gwstress(:,:)
-      !$OMP THREADPRIVATE(east_gwstress)
-      REAL, SAVE, ALLOCATABLE :: west_gwstress(:,:)
-      !$OMP THREADPRIVATE(west_gwstress)
-      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
-      !$OMP THREADPRIVATE(d_t_hin)
-! tendance due a l'oxydation du methane
-      REAL, SAVE, ALLOCATABLE :: d_q_ch4(:,:)
-      !$OMP THREADPRIVATE(d_q_ch4)
+MODULE phys_local_var_mod
+  USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_STRATAER
+  ! Variables locales pour effectuer les appels en serie
+  !======================================================================
+  !
+  !
+  !======================================================================
+  ! Declaration des variables
+
+  REAL, SAVE, ALLOCATABLE :: t_seri(:, :), q_seri(:, :)
+  !$OMP THREADPRIVATE(t_seri, q_seri)
+  REAL, SAVE, ALLOCATABLE :: ql_serf_r_wetbi(:, :), qs_seri(:, :)
+  !$OMP THREADPRIVATE(ql_seri,qs_seri)
+  REAL, SAVE, ALLOCATABLE :: qx_seri(:, :, :)
+  !$OMP THREADPRIVATE(qx_seri)
+  REAL, SAVE, ALLOCATABLE :: qbs_seri(:, :)
+  !$OMP THREADPRIVATE(qbs_seri)
+  REAL, SAVE, ALLOCATABLE :: u_seri(:, :), v_seri(:, :)
+  !$OMP THREADPRIVATE(u_seri, v_seri)
+  REAL, SAVE, ALLOCATABLE :: rneb_seri(:, :)
+  !$OMP THREADPRIVATE(rneb_seri)
+  REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:, :)
+  !$OMP THREADPRIVATE(d_rneb_dyn)
+  REAL, SAVE, ALLOCATABLE :: l_mixmin(:, :, :), l_mix(:, :, :), wprime(:, :, :)
+  !$OMP THREADPRIVATE(l_mixmin, l_mix, wprime)
+  REAL, SAVE, ALLOCATABLE :: pbl_eps(:, :, :)
+  !$OMP THREADPRIVATE(pbl_eps)
+  REAL, SAVE, ALLOCATABLE :: tke_shear(:, :, :), tke_buoy(:, :, :), tke_trans(:, :, :)
+  !$OMP THREADPRIVATE(tke_shear,tke_buoy,tke_trans)
+  REAL, SAVE, ALLOCATABLE :: tr_seri(:, :, :)
+  !$OMP THREADPRIVATE(tr_seri)
+  REAL, SAVE, ALLOCATABLE :: rhcl(:, :)
+  !$OMP THREADPRIVATE(rhcl)
+  REAL, SAVE, ALLOCATABLE :: d_t_dyn(:, :), d_q_dyn(:, :)
+  !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:, :), d_qs_dyn(:, :), d_qbs_dyn(:, :)
+  !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:), d_qbs_dyn2d(:)
+  !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
+  REAL, SAVE, ALLOCATABLE :: d_u_dyn(:, :), d_v_dyn(:, :)
+  !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:, :, :)
+  !$OMP THREADPRIVATE(d_tr_dyn)
+  REAL, SAVE, ALLOCATABLE :: d_t_con(:, :), d_q_con(:, :), d_q_con_zmasse(:, :)
+  !$OMP THREADPRIVATE(d_t_con,d_q_con,d_q_con_zmasse)
+  REAL, SAVE, ALLOCATABLE :: d_u_con(:, :), d_v_con(:, :)
+  !$OMP THREADPRIVATE(d_u_con,d_v_con)
+  REAL, SAVE, ALLOCATABLE :: d_t_wake(:, :), d_q_wake(:, :)
+  !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
+  REAL, SAVE, ALLOCATABLE :: d_t_lsc(:, :), d_q_lsc(:, :), d_ql_lsc(:, :), d_qi_lsc(:, :)
+  !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
+  REAL, SAVE, ALLOCATABLE :: d_t_lwr(:, :), d_t_lw0(:, :), d_t_swr(:, :), d_t_sw0(:, :)
+  !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
+  REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:, :), d_q_ajsb(:, :)
+  !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
+  REAL, SAVE, ALLOCATABLE :: d_t_ajs(:, :), d_q_ajs(:, :)
+  !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
+  REAL, SAVE, ALLOCATABLE :: d_u_ajs(:, :), d_v_ajs(:, :)
+  !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
+  !nrlmd<
+  REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:, :), d_q_ajs_w(:, :)
+  !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
+  REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:, :), d_q_ajs_x(:, :)
+  !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
+  !>nrlmd
+  REAL, SAVE, ALLOCATABLE :: d_t_eva(:, :), d_q_eva(:, :), d_ql_eva(:, :), d_qi_eva(:, :)
+  !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
+  REAL, SAVE, ALLOCATABLE :: d_qx_eva(:, :, :)
+  !$OMP THREADPRIVATE(d_qx_eva)
+  REAL, SAVE, ALLOCATABLE :: d_t_lscst(:, :), d_q_lscst(:, :)
+  !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
+  REAL, SAVE, ALLOCATABLE :: d_t_lscth(:, :), d_q_lscth(:, :)
+  !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
+  REAL, SAVE, ALLOCATABLE :: plul_th(:), plul_st(:)
+  !$OMP THREADPRIVATE(plul_th,plul_st)
+  !tendances dues a oro et lif
+  REAL, SAVE, ALLOCATABLE :: d_t_oli(:, :)
+  !$OMP THREADPRIVATE(d_t_oli)
+  REAL, SAVE, ALLOCATABLE :: d_u_oli(:, :), d_v_oli(:, :)
+  !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
+  REAL, SAVE, ALLOCATABLE :: d_t_vdf(:, :), d_q_vdf(:, :), d_qbs_vdf(:, :), d_t_diss(:, :)
+  !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf, d_qbs_vdf, d_t_diss)
+  REAL, SAVE, ALLOCATABLE :: d_u_vdf(:, :), d_v_vdf(:, :)
+  !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
+  !nrlmd+jyg<
+  REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:, :), d_q_vdf_w(:, :)
+  !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
+  REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:, :), d_q_vdf_x(:, :)
+  !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
+  REAL, SAVE, ALLOCATABLE :: d_t_bsss(:, :), d_q_bsss(:, :), d_qbs_bsss(:, :)
+  !$OMP THREADPRIVATE( d_t_bsss,d_q_bsss, d_qbs_bsss)
+  !>nrlmd+jyg
+  REAL, SAVE, ALLOCATABLE :: d_t_oro(:, :)
+  !$OMP THREADPRIVATE(d_t_oro)
+  REAL, SAVE, ALLOCATABLE :: d_u_oro(:, :), d_v_oro(:, :)
+  !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
+  REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:, :)
+  !$OMP THREADPRIVATE(d_t_oro_gw)
+  REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:, :), d_v_oro_gw(:, :)
+  !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
+  REAL, SAVE, ALLOCATABLE :: d_t_lif(:, :)
+  !$OMP THREADPRIVATE(d_t_lif)
+  REAL, SAVE, ALLOCATABLE :: d_u_lif(:, :), d_v_lif(:, :)
+  !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
+  ! Tendances Ondes de G non oro (runs strato).
+  REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:, :)
+  !$OMP THREADPRIVATE(du_gwd_hines)
+  REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:, :)
+  !$OMP THREADPRIVATE(dv_gwd_hines)
+  REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:, :)
+  !$OMP THREADPRIVATE(dv_gwd_rando)
+  REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:, :)
+  !$OMP THREADPRIVATE(dv_gwd_front)
+  REAL, SAVE, ALLOCATABLE :: east_gwstress(:, :)
+  !$OMP THREADPRIVATE(east_gwstress)
+  REAL, SAVE, ALLOCATABLE :: west_gwstress(:, :)
+  !$OMP THREADPRIVATE(west_gwstress)
+  REAL, SAVE, ALLOCATABLE :: d_t_hin(:, :)
+  !$OMP THREADPRIVATE(d_t_hin)
+  ! tendance due a l'oxydation du methane
+  REAL, SAVE, ALLOCATABLE :: d_q_ch4(:, :)
+  !$OMP THREADPRIVATE(d_q_ch4)
 #ifdef ISO
       REAL, SAVE, ALLOCATABLE :: xt_seri(:,:,:)
@@ -168,194 +169,194 @@
 #endif
 
-! tendance du a la conersion Ec -> E thermique
-      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
-      !$OMP THREADPRIVATE(d_t_ec)
-      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
-      !$OMP THREADPRIVATE(d_ts, d_tr)
-
-! aerosols
-      REAL, SAVE, ALLOCATABLE :: m_allaer (:,:,:)
-      !$OMP THREADPRIVATE(m_allaer)
-! diagnostique pour le rayonnement
-      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
-      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
-      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
-      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
-      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
-      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
-      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
-      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
-      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
-      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
-      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
-      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
-! LW radiation diagnostics CK
-      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
-      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
-      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
-      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
-      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
-      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
-! Special RRTM
-      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
-      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
-      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
-      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
-      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
-      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
-!
-      REAL, SAVE, ALLOCATABLE :: stratomask(:,:) 
-      !$OMP THREADPRIVATE(stratomask) 
-      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:) 
-      !$OMP THREADPRIVATE(tausum_aero) 
-      REAL, SAVE, ALLOCATABLE :: drytausum_aero(:,:) 
-      !$OMP THREADPRIVATE(drytausum_aero) 
-      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:) 
-      !$OMP THREADPRIVATE(tau3d_aero) 
-      REAL, SAVE, ALLOCATABLE :: dNovrN(:) 
-      !$OMP THREADPRIVATE(dNovrN) 
-      REAL, SAVE, ALLOCATABLE :: zfice(:,:)
-      !$OMP THREADPRIVATE(zfice)
-      REAL, SAVE, ALLOCATABLE :: od443aer(:) 
-      !$OMP THREADPRIVATE(od443aer) 
-      REAL, SAVE, ALLOCATABLE :: od550aer(:) 
-      !$OMP THREADPRIVATE(od550aer) 
-      REAL, SAVE, ALLOCATABLE :: dryod550aer(:) 
-      !$OMP THREADPRIVATE(dryod550aer) 
-      REAL, SAVE, ALLOCATABLE :: abs550aer(:) 
-      !$OMP THREADPRIVATE(abs550aer) 
-      REAL, SAVE, ALLOCATABLE :: od865aer(:) 
-      !$OMP THREADPRIVATE(od865aer) 
-      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:) 
-      !$OMP THREADPRIVATE(ec550aer) 
-      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:) 
-      !$OMP THREADPRIVATE(od550lt1aer) 
-      REAL, SAVE, ALLOCATABLE :: sconcso4(:) 
-      !$OMP THREADPRIVATE(sconcso4) 
-      REAL, SAVE, ALLOCATABLE :: sconcno3(:) 
-      !$OMP THREADPRIVATE(sconcno3) 
-      REAL, SAVE, ALLOCATABLE :: sconcoa(:) 
-      !$OMP THREADPRIVATE(sconcoa) 
-      REAL, SAVE, ALLOCATABLE :: sconcbc(:) 
-      !$OMP THREADPRIVATE(sconcbc) 
-      REAL, SAVE, ALLOCATABLE :: sconcss(:) 
-      !$OMP THREADPRIVATE(sconcss) 
-      REAL, SAVE, ALLOCATABLE :: sconcdust(:) 
-      !$OMP THREADPRIVATE(sconcdust) 
-      REAL, SAVE, ALLOCATABLE :: concso4(:,:) 
-      !$OMP THREADPRIVATE(concso4) 
-      REAL, SAVE, ALLOCATABLE :: concno3(:,:) 
-      !$OMP THREADPRIVATE(concno3) 
-      REAL, SAVE, ALLOCATABLE :: concoa(:,:) 
-      !$OMP THREADPRIVATE(concoa) 
-      REAL, SAVE, ALLOCATABLE :: concbc(:,:) 
-      !$OMP THREADPRIVATE(concbc) 
-      REAL, SAVE, ALLOCATABLE :: concss(:,:) 
-      !$OMP THREADPRIVATE(concss) 
-      REAL, SAVE, ALLOCATABLE :: concdust(:,:) 
-      !$OMP THREADPRIVATE(concdust) 
-      REAL, SAVE, ALLOCATABLE :: loadso4(:) 
-      !$OMP THREADPRIVATE(loadso4) 
-      REAL, SAVE, ALLOCATABLE :: loadoa(:) 
-      !$OMP THREADPRIVATE(loadoa) 
-      REAL, SAVE, ALLOCATABLE :: loadbc(:) 
-      !$OMP THREADPRIVATE(loadbc) 
-      REAL, SAVE, ALLOCATABLE :: loadss(:) 
-      !$OMP THREADPRIVATE(loadss) 
-      REAL, SAVE, ALLOCATABLE :: loaddust(:) 
-      !$OMP THREADPRIVATE(loaddust) 
-      REAL, SAVE, ALLOCATABLE :: loadno3(:) 
-      !$OMP THREADPRIVATE(loadno3) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp1(:), load_tmp2(:)
-      !$OMP THREADPRIVATE(load_tmp1, load_tmp2) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp3(:), load_tmp4(:)
-      !$OMP THREADPRIVATE(load_tmp3, load_tmp4) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp5(:), load_tmp6(:)
-      !$OMP THREADPRIVATE(load_tmp5, load_tmp6) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp7(:), load_tmp8(:)
-      !$OMP THREADPRIVATE(load_tmp7, load_tmp8) 
-      REAL, SAVE, ALLOCATABLE :: load_tmp9(:), load_tmp10(:)
-      !$OMP THREADPRIVATE(load_tmp9, load_tmp10) 
-
-!IM ajout variables CFMIP2/CMIP5
-      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
-!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
-      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
-!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
-      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
-!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
-      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:)  
-!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
-      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
-!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
-      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
-!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
-
-! additional LW variables CK
-      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
-!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
-      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
-!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
-      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
-!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
-
-!AI 08 2023 ajout pour Ecrad
-      REAL,ALLOCATABLE,SAVE :: topswad_aero_s2(:), solswad_aero_s2(:)
-!$OMP THREADPRIVATE(topswad_aero_s2, solswad_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topswai_aero_s2(:), solswai_aero_s2(:)
-!$OMP THREADPRIVATE(topswai_aero_s2, solswai_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topswad0_aero_s2(:), solswad0_aero_s2(:)
-!$OMP THREADPRIVATE(topswad0_aero_s2, solswad0_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topsw_aero_s2(:,:), topsw0_aero_s2(:,:)
-!$OMP THREADPRIVATE(topsw_aero_s2, topsw0_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: solsw_aero_s2(:,:), solsw0_aero_s2(:,:)
-!$OMP THREADPRIVATE(solsw_aero_s2, solsw0_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: topswcf_aero_s2(:,:), solswcf_aero_s2(:,:)
-!$OMP THREADPRIVATE(topswcf_aero_s2, solswcf_aero_s2)
-! additional LW variables CK
-      REAL,ALLOCATABLE,SAVE :: toplwad_aero_s2(:), sollwad_aero_s2(:)
-!$OMP THREADPRIVATE(toplwad_aero_s2, sollwad_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: toplwai_aero_s2(:), sollwai_aero_s2(:)
-!$OMP THREADPRIVATE(toplwai_aero_s2, sollwai_aero_s2)
-      REAL,ALLOCATABLE,SAVE :: toplwad0_aero_s2(:), sollwad0_aero_s2(:)
-!$OMP THREADPRIVATE(toplwad0_aero_s2, sollwad0_aero_s2)
-
-!Ajout de celles n??cessaires au phys_output_write_mod
-      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
-!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
-      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
-!$OMP THREADPRIVATE(ptstar, pt0, slp)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp 
-!$OMP THREADPRIVATE(sens, flwp, fiwp)
-!!
-!FC 
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxfluxt, zxfluxq
-!$OMP THREADPRIVATE(zxfluxt, zxfluxq)
-!FC
-!!         Wake variables
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: alp_wake
-!$OMP THREADPRIVATE(alp_wake)           
-!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
-      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:)         :: wake_k
-!$OMP THREADPRIVATE(wake_h,wake_k)                       
-    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
-!$OMP THREADPRIVATE(wake_omg)                     
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
-!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_a_wk, d_dens_wk
-!$OMP THREADPRIVATE(d_s_wk, d_dens_a_wk, d_dens_wk)
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
-!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
-!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
-!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
-!!!$OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
-    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
-!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
-!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
-!!!$OMP THREADPRIVATE(d_s_the, d_dens_the)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
-!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)                       
+  ! tendance du a la conersion Ec -> E thermique
+  REAL, SAVE, ALLOCATABLE :: d_t_ec(:, :)
+  !$OMP THREADPRIVATE(d_t_ec)
+  REAL, SAVE, ALLOCATABLE :: d_ts(:, :), d_tr(:, :, :)
+  !$OMP THREADPRIVATE(d_ts, d_tr)
+
+  ! aerosols
+  REAL, SAVE, ALLOCATABLE :: m_allaer (:, :, :)
+  !$OMP THREADPRIVATE(m_allaer)
+  ! diagnostique pour le rayonnement
+  REAL, SAVE, ALLOCATABLE :: topswad_aero(:), solswad_aero(:)      ! diag
+  !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
+  REAL, SAVE, ALLOCATABLE :: topswai_aero(:), solswai_aero(:)      ! diag
+  !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
+  REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
+  !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
+  REAL, SAVE, ALLOCATABLE :: topsw_aero(:, :), solsw_aero(:, :)      ! diag
+  !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
+  REAL, SAVE, ALLOCATABLE :: topsw0_aero(:, :), solsw0_aero(:, :)     ! diag
+  !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
+  REAL, SAVE, ALLOCATABLE :: topswcf_aero(:, :), solswcf_aero(:, :)  ! diag
+  !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
+  ! LW radiation diagnostics CK
+  REAL, SAVE, ALLOCATABLE :: toplwad_aero(:), sollwad_aero(:)      ! diag
+  !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
+  REAL, SAVE, ALLOCATABLE :: toplwai_aero(:), sollwai_aero(:)      ! diag
+  !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
+  REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
+  !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
+  ! Special RRTM
+  REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:, :), ZSWFT0_i(:, :)      ! diag
+  !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
+  REAL, SAVE, ALLOCATABLE :: ZFLDN0(:, :), ZFLUP0(:, :)      ! diag
+  !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
+  REAL, SAVE, ALLOCATABLE :: ZFSDN0(:, :), ZFSUP0(:, :)      ! diag
+  !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
+  !
+  REAL, SAVE, ALLOCATABLE :: stratomask(:, :)
+  !$OMP THREADPRIVATE(stratomask)
+  REAL, SAVE, ALLOCATABLE :: tausum_aero(:, :, :)
+  !$OMP THREADPRIVATE(tausum_aero)
+  REAL, SAVE, ALLOCATABLE :: drytausum_aero(:, :)
+  !$OMP THREADPRIVATE(drytausum_aero)
+  REAL, SAVE, ALLOCATABLE :: tau3d_aero(:, :, :, :)
+  !$OMP THREADPRIVATE(tau3d_aero)
+  REAL, SAVE, ALLOCATABLE :: dNovrN(:)
+  !$OMP THREADPRIVATE(dNovrN)
+  REAL, SAVE, ALLOCATABLE :: zfice(:, :)
+  !$OMP THREADPRIVATE(zfice)
+  REAL, SAVE, ALLOCATABLE :: od443aer(:)
+  !$OMP THREADPRIVATE(od443aer)
+  REAL, SAVE, ALLOCATABLE :: od550aer(:)
+  !$OMP THREADPRIVATE(od550aer)
+  REAL, SAVE, ALLOCATABLE :: dryod550aer(:)
+  !$OMP THREADPRIVATE(dryod550aer)
+  REAL, SAVE, ALLOCATABLE :: abs550aer(:)
+  !$OMP THREADPRIVATE(abs550aer)
+  REAL, SAVE, ALLOCATABLE :: od865aer(:)
+  !$OMP THREADPRIVATE(od865aer)
+  REAL, SAVE, ALLOCATABLE :: ec550aer(:, :)
+  !$OMP THREADPRIVATE(ec550aer)
+  REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
+  !$OMP THREADPRIVATE(od550lt1aer)
+  REAL, SAVE, ALLOCATABLE :: sconcso4(:)
+  !$OMP THREADPRIVATE(sconcso4)
+  REAL, SAVE, ALLOCATABLE :: sconcno3(:)
+  !$OMP THREADPRIVATE(sconcno3)
+  REAL, SAVE, ALLOCATABLE :: sconcoa(:)
+  !$OMP THREADPRIVATE(sconcoa)
+  REAL, SAVE, ALLOCATABLE :: sconcbc(:)
+  !$OMP THREADPRIVATE(sconcbc)
+  REAL, SAVE, ALLOCATABLE :: sconcss(:)
+  !$OMP THREADPRIVATE(sconcss)
+  REAL, SAVE, ALLOCATABLE :: sconcdust(:)
+  !$OMP THREADPRIVATE(sconcdust)
+  REAL, SAVE, ALLOCATABLE :: concso4(:, :)
+  !$OMP THREADPRIVATE(concso4)
+  REAL, SAVE, ALLOCATABLE :: concno3(:, :)
+  !$OMP THREADPRIVATE(concno3)
+  REAL, SAVE, ALLOCATABLE :: concoa(:, :)
+  !$OMP THREADPRIVATE(concoa)
+  REAL, SAVE, ALLOCATABLE :: concbc(:, :)
+  !$OMP THREADPRIVATE(concbc)
+  REAL, SAVE, ALLOCATABLE :: concss(:, :)
+  !$OMP THREADPRIVATE(concss)
+  REAL, SAVE, ALLOCATABLE :: concdust(:, :)
+  !$OMP THREADPRIVATE(concdust)
+  REAL, SAVE, ALLOCATABLE :: loadso4(:)
+  !$OMP THREADPRIVATE(loadso4)
+  REAL, SAVE, ALLOCATABLE :: loadoa(:)
+  !$OMP THREADPRIVATE(loadoa)
+  REAL, SAVE, ALLOCATABLE :: loadbc(:)
+  !$OMP THREADPRIVATE(loadbc)
+  REAL, SAVE, ALLOCATABLE :: loadss(:)
+  !$OMP THREADPRIVATE(loadss)
+  REAL, SAVE, ALLOCATABLE :: loaddust(:)
+  !$OMP THREADPRIVATE(loaddust)
+  REAL, SAVE, ALLOCATABLE :: loadno3(:)
+  !$OMP THREADPRIVATE(loadno3)
+  REAL, SAVE, ALLOCATABLE :: load_tmp1(:), load_tmp2(:)
+  !$OMP THREADPRIVATE(load_tmp1, load_tmp2)
+  REAL, SAVE, ALLOCATABLE :: load_tmp3(:), load_tmp4(:)
+  !$OMP THREADPRIVATE(load_tmp3, load_tmp4)
+  REAL, SAVE, ALLOCATABLE :: load_tmp5(:), load_tmp6(:)
+  !$OMP THREADPRIVATE(load_tmp5, load_tmp6)
+  REAL, SAVE, ALLOCATABLE :: load_tmp7(:), load_tmp8(:)
+  !$OMP THREADPRIVATE(load_tmp7, load_tmp8)
+  REAL, SAVE, ALLOCATABLE :: load_tmp9(:), load_tmp10(:)
+  !$OMP THREADPRIVATE(load_tmp9, load_tmp10)
+
+  !IM ajout variables CFMIP2/CMIP5
+  REAL, ALLOCATABLE, SAVE :: topswad_aerop(:), solswad_aerop(:)
+  !$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
+  REAL, ALLOCATABLE, SAVE :: topswai_aerop(:), solswai_aerop(:)
+  !$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
+  REAL, ALLOCATABLE, SAVE :: topswad0_aerop(:), solswad0_aerop(:)
+  !$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
+  REAL, ALLOCATABLE, SAVE :: topsw_aerop(:, :), topsw0_aerop(:, :)
+  !$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
+  REAL, ALLOCATABLE, SAVE :: solsw_aerop(:, :), solsw0_aerop(:, :)
+  !$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
+  REAL, ALLOCATABLE, SAVE :: topswcf_aerop(:, :), solswcf_aerop(:, :)
+  !$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
+
+  ! additional LW variables CK
+  REAL, ALLOCATABLE, SAVE :: toplwad_aerop(:), sollwad_aerop(:)
+  !$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
+  REAL, ALLOCATABLE, SAVE :: toplwai_aerop(:), sollwai_aerop(:)
+  !$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
+  REAL, ALLOCATABLE, SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
+  !$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
+
+  !AI 08 2023 ajout pour Ecrad
+  REAL, ALLOCATABLE, SAVE :: topswad_aero_s2(:), solswad_aero_s2(:)
+  !$OMP THREADPRIVATE(topswad_aero_s2, solswad_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topswai_aero_s2(:), solswai_aero_s2(:)
+  !$OMP THREADPRIVATE(topswai_aero_s2, solswai_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topswad0_aero_s2(:), solswad0_aero_s2(:)
+  !$OMP THREADPRIVATE(topswad0_aero_s2, solswad0_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topsw_aero_s2(:, :), topsw0_aero_s2(:, :)
+  !$OMP THREADPRIVATE(topsw_aero_s2, topsw0_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: solsw_aero_s2(:, :), solsw0_aero_s2(:, :)
+  !$OMP THREADPRIVATE(solsw_aero_s2, solsw0_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: topswcf_aero_s2(:, :), solswcf_aero_s2(:, :)
+  !$OMP THREADPRIVATE(topswcf_aero_s2, solswcf_aero_s2)
+  ! additional LW variables CK
+  REAL, ALLOCATABLE, SAVE :: toplwad_aero_s2(:), sollwad_aero_s2(:)
+  !$OMP THREADPRIVATE(toplwad_aero_s2, sollwad_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: toplwai_aero_s2(:), sollwai_aero_s2(:)
+  !$OMP THREADPRIVATE(toplwai_aero_s2, sollwai_aero_s2)
+  REAL, ALLOCATABLE, SAVE :: toplwad0_aero_s2(:), sollwad0_aero_s2(:)
+  !$OMP THREADPRIVATE(toplwad0_aero_s2, sollwad0_aero_s2)
+
+  !Ajout de celles n??cessaires au phys_output_write_mod
+  REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
+  !$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
+  REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
+  !$OMP THREADPRIVATE(ptstar, pt0, slp)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sens, flwp, fiwp
+  !$OMP THREADPRIVATE(sens, flwp, fiwp)
+  !!
+  !FC
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: zxfluxt, zxfluxq
+  !$OMP THREADPRIVATE(zxfluxt, zxfluxq)
+  !FC
+  !!         Wake variables
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_wake
+  !$OMP THREADPRIVATE(alp_wake)
+  !!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: wake_h
+  INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) :: wake_k
+  !$OMP THREADPRIVATE(wake_h,wake_k)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wake_omg
+  !$OMP THREADPRIVATE(wake_omg)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_wk, d_deltaq_wk
+  !$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: d_s_wk, d_dens_a_wk, d_dens_wk
+  !$OMP THREADPRIVATE(d_s_wk, d_dens_a_wk, d_dens_wk)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_wk_gw, d_deltaq_wk_gw
+  !$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_vdf, d_deltaq_vdf
+  !$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
+  !!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
+  !!!$OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
+  REAL, SAVE, ALLOCATABLE, DIMENSION(:, :) :: d_deltat_the, d_deltaq_the
+  !$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
+  !!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
+  !!!$OMP THREADPRIVATE(d_s_the, d_dens_the)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d_deltat_ajs_cv, d_deltaq_ajs_cv
+  !$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
 #ifdef ISO
     REAL, SAVE, ALLOCATABLE,DIMENSION(:,:,:)          :: d_deltaxt_wk
@@ -370,43 +371,43 @@
 !$OMP THREADPRIVATE(d_deltaxt_ajs_cv)
 #endif                       
-!!         End of Wake variables
-!!
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
-!$OMP THREADPRIVATE(bils)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
-!$OMP THREADPRIVATE(cdragm, cdragh)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
-!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m)
-!AS: cldhjn, cldljn, cldmjn,cldtjn pas utilisés en tant que variables, juste noms de diagnostics
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
-!$OMP THREADPRIVATE(JrNt)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget
-!$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
-!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
-!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
-!
-!nrlmd+jyg<
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
-!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
-!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
-!>nrlmd+jyg
-!
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
-!$OMP THREADPRIVATE(slab_wfbils)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
-!$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxustartlic, zxrhoslic, zxqsaltlic
-!$OMP THREADPRIVATE(zxustartlic, zxrhoslic, zxqsaltlic)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
-!$OMP THREADPRIVATE(zxfqcalving)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
-!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic
-!$OMP THREADPRIVATE(zxrunofflic)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
-!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
+  !!         End of Wake variables
+  !!
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: bils
+  !$OMP THREADPRIVATE(bils)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cdragm, cdragh
+  !$OMP THREADPRIVATE(cdragm, cdragh)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
+  !$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m)
+  !AS: cldhjn, cldljn, cldmjn,cldtjn pas utilisés en tant que variables, juste noms de diagnostics
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: JrNt
+  !$OMP THREADPRIVATE(JrNt)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget
+  !$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw, water_budget)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
+  !$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
+  !$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
+  !
+  !nrlmd+jyg<
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_pblh_x, s_pblh_w
+  !$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_lcl_x, s_lcl_w
+  !$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
+  !>nrlmd+jyg
+  !
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: slab_wfbils
+  !$OMP THREADPRIVATE(slab_wfbils)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
+  !$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxustartlic, zxrhoslic, zxqsaltlic
+  !$OMP THREADPRIVATE(zxustartlic, zxrhoslic, zxqsaltlic)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxfqcalving
+  !$OMP THREADPRIVATE(zxfqcalving)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
+  !$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxrunofflic
+  !$OMP THREADPRIVATE(zxrunofflic)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
+  !$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
 #ifdef ISO
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: xtevap,xtprw
@@ -424,41 +425,41 @@
 !$OMP THREADPRIVATE(xtrain_lsc)
 #endif
-!
-!jyg+nrlmd<
-!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-!                                                                          c
-!       Declarations liees a la couche limite differentiee w-x             c
-!                                                                          c
-!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
-!$OMP THREADPRIVATE(sens_x, sens_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
-!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: delta_qsurf
-!$OMP THREADPRIVATE(delta_qsurf)
-!jyg<
-!!! Entrees supplementaires couche-limite
-!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
-!!!$OMP THREADPRIVATE(t_x, t_w)
-!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
-!!!$OMP THREADPRIVATE(q_x, q_w)
-!>jyg
-!!! Sorties ferret
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
-!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
-!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
-! Variables supplementaires dans physiq.F relative au splitting de la surface
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
-!$OMP THREADPRIVATE(pbl_tke_input)
-! Entree supplementaire Thermiques :
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
-!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
-!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
-!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
-!$OMP THREADPRIVATE(kh, kh_x, kh_w)
+  !
+  !jyg+nrlmd<
+  !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+  !                                                                          c
+  !       Declarations liees a la couche limite differentiee w-x             c
+  !                                                                          c
+  !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sens_x, sens_w
+  !$OMP THREADPRIVATE(sens_x, sens_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
+  !$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: delta_qsurf
+  !$OMP THREADPRIVATE(delta_qsurf)
+  !jyg<
+  !!! Entrees supplementaires couche-limite
+  !!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
+  !!!$OMP THREADPRIVATE(t_x, t_w)
+  !!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
+  !!!$OMP THREADPRIVATE(q_x, q_w)
+  !>jyg
+  !!! Sorties ferret
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dtvdf_x, dtvdf_w
+  !$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dqvdf_x, dqvdf_w
+  !$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
+  ! Variables supplementaires dans physiq.F relative au splitting de la surface
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: pbl_tke_input
+  !$OMP THREADPRIVATE(pbl_tke_input)
+  ! Entree supplementaire Thermiques :
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: t_therm, q_therm, u_therm, v_therm
+  !$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cdragh_x, cdragh_w
+  !$OMP THREADPRIVATE(cdragh_x, cdragh_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cdragm_x, cdragm_w
+  !$OMP THREADPRIVATE(cdragm_x, cdragm_w)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: kh, kh_x, kh_w
+  !$OMP THREADPRIVATE(kh, kh_x, kh_w)
 #ifdef ISO
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: dxtvdf_x, dxtvdf_w
@@ -467,66 +468,66 @@
 !$OMP THREADPRIVATE(xt_therm)
 #endif
-!!!
-!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
-      !$OMP THREADPRIVATE(ptconv)
-      REAL, SAVE, ALLOCATABLE :: ratqsc(:,:)
-      !$OMP THREADPRIVATE(ratqsc)
-!>jyg+nrlmd
+  !!!
+  !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+  LOGICAL, SAVE, ALLOCATABLE :: ptconv(:, :)
+  !$OMP THREADPRIVATE(ptconv)
+  REAL, SAVE, ALLOCATABLE :: ratqsc(:, :)
+  !$OMP THREADPRIVATE(ratqsc)
+  !>jyg+nrlmd
   !
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
-!$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
-!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
-!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
-!$OMP THREADPRIVATE(weak_inversion)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_conv,alp_bl_det
-!$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
-!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2, strig, zcong, zlcl_th
-!$OMP THREADPRIVATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
-!$OMP THREADPRIVATE(proba_notrig, random_notrig)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils
-!$OMP THREADPRIVATE(fsolsw, wfbils)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap
-!$OMP THREADPRIVATE(wfevap)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
-!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
-!$OMP THREADPRIVATE(dnwd0, omega)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
-!$OMP THREADPRIVATE(epmax_diag)
-!
-!  Deep convective variables used in phytrac
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
-!$OMP THREADPRIVATE(ep)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
-!$OMP THREADPRIVATE(dnwd, upwd)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
-!$OMP THREADPRIVATE(pmflxr, pmflxs)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainS, wdtrainM
-!$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
-!$OMP THREADPRIVATE(da, mp)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
-!$OMP THREADPRIVATE(wght_cvfd)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
-!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
-!$OMP THREADPRIVATE(d1a, dam)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
-!$OMP THREADPRIVATE(ev)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qtaa
-!$OMP THREADPRIVATE(qtaa)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
-!$OMP THREADPRIVATE(clw)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
-!$OMP THREADPRIVATE(eplaMm)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
-!$OMP THREADPRIVATE(sij)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
+  !$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
+  !$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: t2m_min_mon, t2m_max_mon
+  !$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: weak_inversion
+  !$OMP THREADPRIVATE(weak_inversion)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_bl_conv, alp_bl_det
+  !$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_bl_fluct_m, alp_bl_fluct_tke
+  !$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: alp_bl_stat, n2, s2, strig, zcong, zlcl_th
+  !$OMP THREADPRIVATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: proba_notrig, random_notrig
+  !$OMP THREADPRIVATE(proba_notrig, random_notrig)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: fsolsw, wfbils
+  !$OMP THREADPRIVATE(fsolsw, wfbils)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wfevap
+  !$OMP THREADPRIVATE(wfevap)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: t2m, fluxlat, fsollw, evap_pot
+  !$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dnwd0, omega
+  !$OMP THREADPRIVATE(dnwd0, omega)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: epmax_diag ! epmax_cape
+  !$OMP THREADPRIVATE(epmax_diag)
+  !
+  !  Deep convective variables used in phytrac
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ep ! epmax_cape
+  !$OMP THREADPRIVATE(ep)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: dnwd, upwd
+  !$OMP THREADPRIVATE(dnwd, upwd)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: pmflxr, pmflxs
+  !$OMP THREADPRIVATE(pmflxr, pmflxs)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wdtrainA, wdtrainS, wdtrainM
+  !$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: da, mp
+  !$OMP THREADPRIVATE(da, mp)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: wght_cvfd
+  !$OMP THREADPRIVATE(wght_cvfd)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: phi, phi2, elij, epmlmMm
+  !$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d1a, dam
+  !$OMP THREADPRIVATE(d1a, dam)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ev
+  !$OMP THREADPRIVATE(ev)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: qtaa
+  !$OMP THREADPRIVATE(qtaa)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: clw
+  !$OMP THREADPRIVATE(clw)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: eplaMm
+  !$OMP THREADPRIVATE(eplaMm)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: sij
+  !$OMP THREADPRIVATE(sij)
 #ifdef ISO
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:)  :: xtwdtrainA
@@ -575,51 +576,51 @@
 #endif
 #endif
-!
-!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
-!$OMP THREADPRIVATE(lambda_th)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
-!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: qlth, qith, qsith, wiceth
-!$OMP THREADPRIVATE(qlth, qith, qsith, wiceth)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
-!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
-!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh, zx_rhl, zx_rhi
-!$OMP THREADPRIVATE(zx_rh, zx_rhl, zx_rhi)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca, bsfl
-!$OMP THREADPRIVATE(prfl, psfl, fraca, bsfl)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
-!$OMP THREADPRIVATE(Vprecip, zw2)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
-!$OMP THREADPRIVATE(pmfd, pmfu)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
-!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
-!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
-!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
-
-
-! ug et d'autres encore:
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
-!$OMP THREADPRIVATE(beta_prec)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn,rneblsvol
-!$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: pfraclr,pfracld
-!$OMP THREADPRIVATE(pfraclr,pfracld)
-      REAL, SAVE, ALLOCATABLE :: cldfraliq(:,:)
-!$OMP THREADPRIVATE(cldfraliq)
-      REAL, SAVE, ALLOCATABLE ::mean_icefracturb(:,:)
-!$OMP THREADPRIVATE(mean_icefracturb)
-      REAL, SAVE, ALLOCATABLE :: sigma2_icefracturb(:,:)
-!$OMP THREADPRIVATE(sigma2_icefracturb)
-
-! variables de sorties MM
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
-!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
-!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
+  !
+  !      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: lambda_th
+  !$OMP THREADPRIVATE(lambda_th)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
+  !$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: qlth, qith, qsith, wiceth
+  !$OMP THREADPRIVATE(qlth, qith, qsith, wiceth)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ref_liq, ref_ice, theta, zphi
+  !$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ref_liq_pi, ref_ice_pi
+  !$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: zx_rh, zx_rhl, zx_rhi
+  !$OMP THREADPRIVATE(zx_rh, zx_rhl, zx_rhi)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: prfl, psfl, fraca, bsfl
+  !$OMP THREADPRIVATE(prfl, psfl, fraca, bsfl)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: Vprecip, zw2
+  !$OMP THREADPRIVATE(Vprecip, zw2)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: pmfd, pmfu
+  !$OMP THREADPRIVATE(pmfd, pmfu)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: fluxt, fluxu, fluxv
+  !$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: uwriteSTD, vwriteSTD, wwriteSTD
+  !$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
+  !$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
+
+
+  ! ug et d'autres encore:
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: beta_prec
+  !$OMP THREADPRIVATE(beta_prec)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: rneb, rnebjn, rneblsvol
+  !$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: pfraclr, pfracld
+  !$OMP THREADPRIVATE(pfraclr,pfracld)
+  REAL, SAVE, ALLOCATABLE :: cldfraliq(:, :)
+  !$OMP THREADPRIVATE(cldfraliq)
+  REAL, SAVE, ALLOCATABLE :: mean_icefracturb(:, :)
+  !$OMP THREADPRIVATE(mean_icefracturb)
+  REAL, SAVE, ALLOCATABLE :: sigma2_icefracturb(:, :)
+  !$OMP THREADPRIVATE(sigma2_icefracturb)
+
+  ! variables de sorties MM
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow, snowhgt, qsnow, to_ice
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow, runoff, albsol3_lic
+  !$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
+  !$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
 #ifdef ISO
       REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: zxxtsnow
@@ -631,165 +632,165 @@
 #endif
 
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
-!$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
-
-      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zn2mout
-!$OMP THREADPRIVATE(zn2mout)
-
-      REAL, SAVE, ALLOCATABLE :: qclr(:,:)
-      !$OMP THREADPRIVATE(qclr)
-      REAL, SAVE, ALLOCATABLE :: qcld(:,:)
-      !$OMP THREADPRIVATE(qcld)
-      REAL, SAVE, ALLOCATABLE :: qss(:,:)
-      !$OMP THREADPRIVATE(qss)
-      REAL, SAVE, ALLOCATABLE :: qvc(:,:)
-      !$OMP THREADPRIVATE(qvc)
-      REAL, SAVE, ALLOCATABLE :: rnebclr(:,:)
-      !$OMP THREADPRIVATE(rnebclr)
-      REAL, SAVE, ALLOCATABLE :: rnebss(:,:)
-      !$OMP THREADPRIVATE(rnebss)
-      REAL, SAVE, ALLOCATABLE :: gamma_ss(:,:)
-      !$OMP THREADPRIVATE(gamma_ss)
-      REAL, SAVE, ALLOCATABLE :: N1_ss(:,:)
-      !$OMP THREADPRIVATE(N1_ss)
-      REAL, SAVE, ALLOCATABLE :: N2_ss(:,:)
-      !$OMP THREADPRIVATE(N2_ss)
-      REAL, SAVE, ALLOCATABLE :: drneb_sub(:,:)
-      !$OMP THREADPRIVATE(drneb_sub)
-      REAL, SAVE, ALLOCATABLE :: drneb_con(:,:)
-      !$OMP THREADPRIVATE(drneb_con)
-      REAL, SAVE, ALLOCATABLE :: drneb_tur(:,:)
-      !$OMP THREADPRIVATE(drneb_tur)
-      REAL, SAVE, ALLOCATABLE :: drneb_avi(:,:)
-      !$OMP THREADPRIVATE(drneb_avi)
-      REAL, SAVE, ALLOCATABLE :: zqsatl(:,:)
-      !$OMP THREADPRIVATE(zqsatl)
-      REAL, SAVE, ALLOCATABLE :: zqsats(:,:)
-      !$OMP THREADPRIVATE(zqsats)
-      REAL, SAVE, ALLOCATABLE :: Tcontr(:,:)
-      !$OMP THREADPRIVATE(Tcontr)
-      REAL, SAVE, ALLOCATABLE :: qcontr(:,:)
-      !$OMP THREADPRIVATE(qcontr)
-      REAL, SAVE, ALLOCATABLE :: qcontr2(:,:)
-      !$OMP THREADPRIVATE(qcontr2)
-      REAL, SAVE, ALLOCATABLE :: fcontrN(:,:)
-      !$OMP THREADPRIVATE(fcontrN)
-      REAL, SAVE, ALLOCATABLE :: fcontrP(:,:)
-      !$OMP THREADPRIVATE(fcontrP)
-      REAL, SAVE, ALLOCATABLE :: distcltop(:,:)
-      !$OMP THREADPRIVATE(distcltop)
-      REAL, SAVE, ALLOCATABLE :: temp_cltop(:,:)
-      !$OMP THREADPRIVATE(temp_cltop)
-
-
-!--POPRECIP variables
-      REAL, SAVE, ALLOCATABLE :: qraindiag(:,:)
-      !$OMP THREADPRIVATE(qraindiag)
-      REAL, SAVE, ALLOCATABLE :: qsnowdiag(:,:)
-      !$OMP THREADPRIVATE(qsnowdiag)
-      REAL, SAVE, ALLOCATABLE :: dqreva(:,:)
-      !$OMP THREADPRIVATE(dqreva)
-      REAL, SAVE, ALLOCATABLE :: dqrauto(:,:)
-      !$OMP THREADPRIVATE(dqrauto)
-      REAL, SAVE, ALLOCATABLE :: dqrcol(:,:)
-      !$OMP THREADPRIVATE(dqrcol)
-      REAL, SAVE, ALLOCATABLE :: dqrmelt(:,:)
-      !$OMP THREADPRIVATE(dqrmelt)
-       REAL, SAVE, ALLOCATABLE :: dqrfreez(:,:)
-      !$OMP THREADPRIVATE(dqrfreez)
-      REAL, SAVE, ALLOCATABLE :: dqssub(:,:)
-      !$OMP THREADPRIVATE(dqssub)
-      REAL, SAVE, ALLOCATABLE :: dqsauto(:,:)
-      !$OMP THREADPRIVATE(dqsauto)
-      REAL, SAVE, ALLOCATABLE :: dqsagg(:,:)
-      !$OMP THREADPRIVATE(dqsagg)
-      REAL, SAVE, ALLOCATABLE :: dqsrim(:,:)
-      !$OMP THREADPRIVATE(dqsrim)
-      REAL, SAVE, ALLOCATABLE :: dqsmelt(:,:)
-      !$OMP THREADPRIVATE(dqsmelt)
-      REAL, SAVE, ALLOCATABLE :: dqsfreez(:,:)
-      !$OMP THREADPRIVATE(dqsfreez)
-
-
-      
-
-
-#ifdef CPP_StratAer
-!
-! variables for stratospheric aerosol
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: d_q_emiss
-!$OMP THREADPRIVATE(d_q_emiss)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4
-!$OMP THREADPRIVATE(R2SO4)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4
-!$OMP THREADPRIVATE(DENSO4)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
-!$OMP THREADPRIVATE(f_r_wet)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer
-!$OMP THREADPRIVATE(decfluxaer)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
-!$OMP THREADPRIVATE(mdw)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime
-!$OMP THREADPRIVATE(OCS_lifetime)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime
-!$OMP THREADPRIVATE(SO2_lifetime)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: H2SO4_lifetime
-!$OMP THREADPRIVATE(H2SO4_lifetime)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: O3_clim
-!$OMP THREADPRIVATE(O3_clim)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin
-!$OMP THREADPRIVATE(alpha_bin)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin
-!$OMP THREADPRIVATE(piz_bin)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin
-!$OMP THREADPRIVATE(cg_bin)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550
-!$OMP THREADPRIVATE(tau_strat_550)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020
-!$OMP THREADPRIVATE(tau_strat_1020)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat
-!$OMP THREADPRIVATE(tausum_strat)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
-!$OMP THREADPRIVATE(surf_PM25_sulf)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer
-!$OMP THREADPRIVATE(vsed_aer)
-!
-!---3D budget variables
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_nucl
-!$OMP THREADPRIVATE(budg_3D_nucl)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_cond_evap
-!$OMP THREADPRIVATE(budg_3D_cond_evap)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_ocs_to_so2
-!$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_so2_to_h2so4
-!$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_ocs
-!$OMP THREADPRIVATE(budg_3D_backgr_ocs)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_so2
-!$OMP THREADPRIVATE(budg_3D_backgr_so2)
-!
-!---2D budget variables
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
-!$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
-!$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
-!$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
-!$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
-      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
-!$OMP THREADPRIVATE(budg_sed_part)
-#endif
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
+  !$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
+
+  INTEGER, ALLOCATABLE, SAVE, DIMENSION(:, :) :: zn2mout
+  !$OMP THREADPRIVATE(zn2mout)
+
+  REAL, SAVE, ALLOCATABLE :: qclr(:, :)
+  !$OMP THREADPRIVATE(qclr)
+  REAL, SAVE, ALLOCATABLE :: qcld(:, :)
+  !$OMP THREADPRIVATE(qcld)
+  REAL, SAVE, ALLOCATABLE :: qss(:, :)
+  !$OMP THREADPRIVATE(qss)
+  REAL, SAVE, ALLOCATABLE :: qvc(:, :)
+  !$OMP THREADPRIVATE(qvc)
+  REAL, SAVE, ALLOCATABLE :: rnebclr(:, :)
+  !$OMP THREADPRIVATE(rnebclr)
+  REAL, SAVE, ALLOCATABLE :: rnebss(:, :)
+  !$OMP THREADPRIVATE(rnebss)
+  REAL, SAVE, ALLOCATABLE :: gamma_ss(:, :)
+  !$OMP THREADPRIVATE(gamma_ss)
+  REAL, SAVE, ALLOCATABLE :: N1_ss(:, :)
+  !$OMP THREADPRIVATE(N1_ss)
+  REAL, SAVE, ALLOCATABLE :: N2_ss(:, :)
+  !$OMP THREADPRIVATE(N2_ss)
+  REAL, SAVE, ALLOCATABLE :: drneb_sub(:, :)
+  !$OMP THREADPRIVATE(drneb_sub)
+  REAL, SAVE, ALLOCATABLE :: drneb_con(:, :)
+  !$OMP THREADPRIVATE(drneb_con)
+  REAL, SAVE, ALLOCATABLE :: drneb_tur(:, :)
+  !$OMP THREADPRIVATE(drneb_tur)
+  REAL, SAVE, ALLOCATABLE :: drneb_avi(:, :)
+  !$OMP THREADPRIVATE(drneb_avi)
+  REAL, SAVE, ALLOCATABLE :: zqsatl(:, :)
+  !$OMP THREADPRIVATE(zqsatl)
+  REAL, SAVE, ALLOCATABLE :: zqsats(:, :)
+  !$OMP THREADPRIVATE(zqsats)
+  REAL, SAVE, ALLOCATABLE :: Tcontr(:, :)
+  !$OMP THREADPRIVATE(Tcontr)
+  REAL, SAVE, ALLOCATABLE :: qcontr(:, :)
+  !$OMP THREADPRIVATE(qcontr)
+  REAL, SAVE, ALLOCATABLE :: qcontr2(:, :)
+  !$OMP THREADPRIVATE(qcontr2)
+  REAL, SAVE, ALLOCATABLE :: fcontrN(:, :)
+  !$OMP THREADPRIVATE(fcontrN)
+  REAL, SAVE, ALLOCATABLE :: fcontrP(:, :)
+  !$OMP THREADPRIVATE(fcontrP)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: DENSO4B
+  !$OMP THREADPRIVATE(DENSO4B)
+  REAL, SAVE, ALLOCATABLE :: distcltop(:, :)
+  !$OMP THREADPRIVATE(distcltop)
+  REAL, SAVE, ALLOCATABLE :: temp_cltop(:, :)
+  !$OMP THREADPRIVATE(temp_cltop)
+
+
+  !--POPRECIP variables
+  REAL, SAVE, ALLOCATABLE :: qraindiag(:, :)
+  !$OMP THREADPRIVATE(qraindiag)
+  REAL, SAVE, ALLOCATABLE :: qsnowdiag(:, :)
+  !$OMP THREADPRIVATE(qsnowdiag)
+  REAL, SAVE, ALLOCATABLE :: dqreva(:, :)
+  !$OMP THREADPRIVATE(dqreva)
+  REAL, SAVE, ALLOCATABLE :: dqrauto(:, :)
+  !$OMP THREADPRIVATE(dqrauto)
+  REAL, SAVE, ALLOCATABLE :: dqrcol(:, :)
+  !$OMP THREADPRIVATE(dqrcol)
+  REAL, SAVE, ALLOCATABLE :: dqrmelt(:, :)
+  !$OMP THREADPRIVATE(dqrmelt)
+  REAL, SAVE, ALLOCATABLE :: dqrfreez(:, :)
+  !$OMP THREADPRIVATE(dqrfreez)
+  REAL, SAVE, ALLOCATABLE :: dqssub(:, :)
+  !$OMP THREADPRIVATE(dqssub)
+  REAL, SAVE, ALLOCATABLE :: dqsauto(:, :)
+  !$OMP THREADPRIVATE(dqsauto)
+  REAL, SAVE, ALLOCATABLE :: dqsagg(:, :)
+  !$OMP THREADPRIVATE(dqsagg)
+  REAL, SAVE, ALLOCATABLE :: dqsrim(:, :)
+  !$OMP THREADPRIVATE(dqsrim)
+  REAL, SAVE, ALLOCATABLE :: dqsmelt(:, :)
+  !$OMP THREADPRIVATE(dqsmelt)
+  REAL, SAVE, ALLOCATABLE :: dqsfreez(:, :)
+  !$OMP THREADPRIVATE(dqsfreez)
+
+
+
+
+
+  !
+  ! variables for stratospheric aerosol
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d_q_emiss
+  !$OMP THREADPRIVATE(d_q_emiss)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: R2SO4
+  !$OMP THREADPRIVATE(R2SO4)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: DENSO4
+  !$OMP THREADPRIVATE(DENSO4)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: f_r_wet
+  !$OMP THREADPRIVATE(f_r_wet)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: decfluxaer
+  !$OMP THREADPRIVATE(decfluxaer)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
+  !$OMP THREADPRIVATE(mdw)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: OCS_lifetime
+  !$OMP THREADPRIVATE(OCS_lifetime)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: SO2_lifetime
+  !$OMP THREADPRIVATE(SO2_lifetime)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: H2SO4_lifetime
+  !$OMP THREADPRIVATE(H2SO4_lifetime)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: O3_clim
+  !$OMP THREADPRIVATE(O3_clim)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: alpha_bin
+  !$OMP THREADPRIVATE(alpha_bin)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: piz_bin
+  !$OMP THREADPRIVATE(piz_bin)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: cg_bin
+  !$OMP THREADPRIVATE(cg_bin)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: tau_strat_550
+  !$OMP THREADPRIVATE(tau_strat_550)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: tau_strat_1020
+  !$OMP THREADPRIVATE(tau_strat_1020)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: tausum_strat
+  !$OMP THREADPRIVATE(tausum_strat)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
+  !$OMP THREADPRIVATE(surf_PM25_sulf)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: vsed_aer
+  !$OMP THREADPRIVATE(vsed_aer)
+  !
+  !---3D budget variables
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_nucl
+  !$OMP THREADPRIVATE(budg_3D_nucl)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_cond_evap
+  !$OMP THREADPRIVATE(budg_3D_cond_evap)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_ocs_to_so2
+  !$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_so2_to_h2so4
+  !$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_backgr_ocs
+  !$OMP THREADPRIVATE(budg_3D_backgr_ocs)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_backgr_so2
+  !$OMP THREADPRIVATE(budg_3D_backgr_so2)
+  !
+  !---2D budget variables
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
+  !$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
+  !$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
+  !$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
+  !$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
+  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
+  !$OMP THREADPRIVATE(budg_sed_part)
 #ifdef REPROBUS
       REAL,SAVE,ALLOCATABLE    :: d_q_emiss(:,:)
@@ -799,58 +800,58 @@
 CONTAINS
 
-!======================================================================
-SUBROUTINE phys_local_var_init
-USE dimphy
-USE infotrac_phy, ONLY : nbtr,nqtot
+  !======================================================================
+  SUBROUTINE phys_local_var_init
+    USE dimphy
+    USE infotrac_phy, ONLY : nbtr, nqtot
 #ifdef ISO
 USE infotrac_phy, ONLY : ntraciso=>ntiso,niso
 #endif
-USE aero_mod
-USE indice_sol_mod
-USE phys_output_var_mod
-USE phys_state_var_mod
-
-IMPLICIT NONE
-      ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev), qbs_seri(klon,klev))
-      ALLOCATE(qx_seri(klon,klev,nqtot))
-      ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
-      ALLOCATE(l_mixmin(klon,klev+1,nbsrf),l_mix(klon,klev+1,nbsrf),wprime(klon,klev+1,nbsrf))
-      ALLOCATE(pbl_eps(klon,klev+1,nbsrf+1))
-      ALLOCATE(tke_shear(klon,klev+1,nbsrf), tke_buoy(klon,klev+1,nbsrf), tke_trans(klon,klev+1,nbsrf))
-      pbl_eps(:,:,:)=0.
-      tke_shear(:,:,:)=0.; tke_buoy(:,:,:)=0.; tke_trans(:,:,:)=0.
-      l_mix(:,:,:)=0.;l_mixmin(:,:,:)=0.;wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
-      ALLOCATE(rhcl(klon,klev))
-      ALLOCATE(tr_seri(klon,klev,nbtr))
-      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
-      ALLOCATE(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev), d_qbs_dyn(klon,klev))
-      ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon), d_qbs_dyn2d(klon))
-      ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
-      ALLOCATE(d_tr_dyn(klon,klev,nbtr))                   !RomP
-      ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev),d_q_con_zmasse(klon,klev))
-      ALLOCATE(d_u_con(klon,klev),d_v_con(klon,klev))
-      ALLOCATE(d_t_wake(klon,klev),d_q_wake(klon,klev))
-      ALLOCATE(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
-      ALLOCATE(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
-      ALLOCATE(d_t_swr(klon,klev),d_t_sw0(klon,klev))
-      ALLOCATE(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
-      ALLOCATE(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
-      ALLOCATE(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
-!nrlmd<
-      ALLOCATE(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
-      ALLOCATE(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
-!>nrlmd
-      ALLOCATE(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
-      ALLOCATE(d_t_eva(klon,klev),d_q_eva(klon,klev))
-      ALLOCATE(d_qx_eva(klon,klev,nqtot))
-      ALLOCATE(d_ql_eva(klon,klev),d_qi_eva(klon,klev))
-      ALLOCATE(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
-      ALLOCATE(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
-      ALLOCATE(plul_st(klon),plul_th(klon))
-      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
-      ALLOCATE (d_qbs_vdf(klon,klev))
-      ALLOCATE(d_t_bsss(klon,klev),d_q_bsss(klon,klev),d_qbs_bsss(klon,klev))
-      ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
-      ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
+    USE aero_mod
+    USE indice_sol_mod
+    USE phys_output_var_mod
+    USE phys_state_var_mod
+
+    IMPLICIT NONE
+    ALLOCATE(t_seri(klon, klev), q_seri(klon, klev), ql_seri(klon, klev), qs_seri(klon, klev), qbs_seri(klon, klev))
+    ALLOCATE(qx_seri(klon, klev, nqtot))
+    ALLOCATE(u_seri(klon, klev), v_seri(klon, klev))
+    ALLOCATE(l_mixmin(klon, klev + 1, nbsrf), l_mix(klon, klev + 1, nbsrf), wprime(klon, klev + 1, nbsrf))
+    ALLOCATE(pbl_eps(klon, klev + 1, nbsrf + 1))
+    ALLOCATE(tke_shear(klon, klev + 1, nbsrf), tke_buoy(klon, klev + 1, nbsrf), tke_trans(klon, klev + 1, nbsrf))
+    pbl_eps(:, :, :) = 0.
+    tke_shear(:, :, :) = 0.; tke_buoy(:, :, :) = 0.; tke_trans(:, :, :) = 0.
+    l_mix(:, :, :) = 0.;l_mixmin(:, :, :) = 0.;wprime(:, :, :) = 0. ! doit etre initialse car pas toujours remplis
+    ALLOCATE(rhcl(klon, klev))
+    ALLOCATE(tr_seri(klon, klev, nbtr))
+    ALLOCATE(d_t_dyn(klon, klev), d_q_dyn(klon, klev))
+    ALLOCATE(d_ql_dyn(klon, klev), d_qs_dyn(klon, klev), d_qbs_dyn(klon, klev))
+    ALLOCATE(d_q_dyn2d(klon), d_ql_dyn2d(klon), d_qs_dyn2d(klon), d_qbs_dyn2d(klon))
+    ALLOCATE(d_u_dyn(klon, klev), d_v_dyn(klon, klev))
+    ALLOCATE(d_tr_dyn(klon, klev, nbtr))                   !RomP
+    ALLOCATE(d_t_con(klon, klev), d_q_con(klon, klev), d_q_con_zmasse(klon, klev))
+    ALLOCATE(d_u_con(klon, klev), d_v_con(klon, klev))
+    ALLOCATE(d_t_wake(klon, klev), d_q_wake(klon, klev))
+    ALLOCATE(d_t_lsc(klon, klev), d_q_lsc(klon, klev))
+    ALLOCATE(d_t_lwr(klon, klev), d_t_lw0(klon, klev))
+    ALLOCATE(d_t_swr(klon, klev), d_t_sw0(klon, klev))
+    ALLOCATE(d_ql_lsc(klon, klev), d_qi_lsc(klon, klev))
+    ALLOCATE(d_t_ajsb(klon, klev), d_q_ajsb(klon, klev))
+    ALLOCATE(d_t_ajs(klon, klev), d_q_ajs(klon, klev))
+    !nrlmd<
+    ALLOCATE(d_t_ajs_w(klon, klev), d_q_ajs_w(klon, klev))
+    ALLOCATE(d_t_ajs_x(klon, klev), d_q_ajs_x(klon, klev))
+    !>nrlmd
+    ALLOCATE(d_u_ajs(klon, klev), d_v_ajs(klon, klev))
+    ALLOCATE(d_t_eva(klon, klev), d_q_eva(klon, klev))
+    ALLOCATE(d_qx_eva(klon, klev, nqtot))
+    ALLOCATE(d_ql_eva(klon, klev), d_qi_eva(klon, klev))
+    ALLOCATE(d_t_lscst(klon, klev), d_q_lscst(klon, klev))
+    ALLOCATE(d_t_lscth(klon, klev), d_q_lscth(klon, klev))
+    ALLOCATE(plul_st(klon), plul_th(klon))
+    ALLOCATE(d_t_vdf(klon, klev), d_q_vdf(klon, klev), d_t_diss(klon, klev))
+    ALLOCATE (d_qbs_vdf(klon, klev))
+    ALLOCATE(d_t_bsss(klon, klev), d_q_bsss(klon, klev), d_qbs_bsss(klon, klev))
+    ALLOCATE(d_t_vdf_w(klon, klev), d_q_vdf_w(klon, klev))
+    ALLOCATE(d_t_vdf_x(klon, klev), d_q_vdf_x(klon, klev))
 #ifdef ISO
       allocate(xt_seri(ntraciso,klon,klev))
@@ -883,123 +884,123 @@
 #endif
 
-      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
-      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
-      ALLOCATE(d_u_oli(klon,klev),d_v_oli(klon,klev))
-      ALLOCATE(d_u_oro(klon,klev),d_v_oro(klon,klev))
-      ALLOCATE(d_u_oro_gw(klon,klev),d_v_oro_gw(klon,klev))
-      ALLOCATE(d_t_oro_gw(klon,klev))
-      ALLOCATE(d_t_lif(klon,klev),d_t_ec(klon,klev))
-      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
-      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
-
-! aerosols
-      ALLOCATE(m_allaer(klon,klev,naero_tot))
-! Special RRTM
-      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
-      ZFLDN0= 0.
-      ALLOCATE(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
-!
-      ALLOCATE(topswad_aero(klon), solswad_aero(klon))
-      ALLOCATE(topswai_aero(klon), solswai_aero(klon))
-      ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
-      ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
-      ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
-      ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
-      ALLOCATE(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
-      ALLOCATE(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
-      ALLOCATE(topswcf_aero(klon,3), solswcf_aero(klon,3))
-      ALLOCATE(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
-      ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
-      ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
-      east_gwstress(:,:)=0 !ym missing init
-      west_gwstress(:,:)=0 !ym missing init
-      ALLOCATE(d_t_hin(klon,klev))
-      ALLOCATE(d_q_ch4(klon,klev))
-      ALLOCATE(stratomask(klon,klev))
-      ALLOCATE(tausum_aero(klon,nwave,naero_tot))
-      ALLOCATE(drytausum_aero(klon,naero_tot))
-      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot)) 
-      ALLOCATE(dNovrN(klon))
-      ALLOCATE(zfice(klon, klev))
-      ALLOCATE(od443aer(klon))
-      ALLOCATE(od550aer(klon))
-      ALLOCATE(od865aer(klon))
-      ALLOCATE(dryod550aer(klon))
-      dryod550aer(:) = 0.
-      ALLOCATE(abs550aer(klon))
-      abs550aer(:) = 0.
-      ALLOCATE(ec550aer(klon,klev))
-      ALLOCATE(od550lt1aer(klon))
-      ALLOCATE(sconcso4(klon))
-      ALLOCATE(sconcno3(klon))
-      ALLOCATE(sconcoa(klon))
-      ALLOCATE(sconcbc(klon))
-      ALLOCATE(sconcss(klon))
-      ALLOCATE(sconcdust(klon))
-      ALLOCATE(concso4(klon,klev))
-      ALLOCATE(concno3(klon,klev))
-      ALLOCATE(concoa(klon,klev))
-      ALLOCATE(concbc(klon,klev))
-      ALLOCATE(concss(klon,klev))
-      ALLOCATE(concdust(klon,klev))
-      ALLOCATE(loadso4(klon))
-      ALLOCATE(loadoa(klon))
-      ALLOCATE(loadbc(klon))
-      ALLOCATE(loadss(klon))
-      ALLOCATE(loaddust(klon))
-      ALLOCATE(loadno3(klon))
-      ALLOCATE(load_tmp1(klon))
-      ALLOCATE(load_tmp2(klon))
-      ALLOCATE(load_tmp3(klon))
-      ALLOCATE(load_tmp4(klon))
-      ALLOCATE(load_tmp5(klon))
-      ALLOCATE(load_tmp6(klon))
-      ALLOCATE(load_tmp7(klon))
-      ALLOCATE(load_tmp8(klon))
-      ALLOCATE(load_tmp9(klon))
-      ALLOCATE(load_tmp10(klon))
-
-!IM ajout variables CFMIP2/CMIP5
-      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
-      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
-      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
-      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
-      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
-      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
-
-! additional LW variables CK
-      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
-      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
-      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
-
-!AI Ajout Ecrad (3Deffect)
-      ALLOCATE(topswad_aero_s2(klon), solswad_aero_s2(klon))
-      ALLOCATE(topswai_aero_s2(klon), solswai_aero_s2(klon))
-      ALLOCATE(topswad0_aero_s2(klon), solswad0_aero_s2(klon))
-      ALLOCATE(topsw_aero_s2(klon,naero_grp), topsw0_aero_s2(klon,naero_grp))
-      ALLOCATE(solsw_aero_s2(klon,naero_grp), solsw0_aero_s2(klon,naero_grp))
-      ALLOCATE(topswcf_aero_s2(klon,naero_grp), solswcf_aero_s2(klon,naero_grp))
-! additional LW variables CK
-      ALLOCATE(toplwad_aero_s2(klon), sollwad_aero_s2(klon))
-      ALLOCATE(toplwai_aero_s2(klon), sollwai_aero_s2(klon))
-      ALLOCATE(toplwad0_aero_s2(klon), sollwad0_aero_s2(klon))
-
-! FH Ajout de celles necessaires au phys_output_write_mod
-
-      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
-      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
-!!
-!!          Wake variables
-      ALLOCATE(alp_wake(klon))
-      ALLOCATE(wake_h(klon),wake_k(klon))
-      ALLOCATE(wake_omg(klon, klev))
-      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
-      ALLOCATE(d_s_wk(klon), d_dens_a_wk(klon), d_dens_wk(klon))
-      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
-      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
-!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
-      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
-!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
-      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
+    ALLOCATE(d_u_vdf(klon, klev), d_v_vdf(klon, klev))
+    ALLOCATE(d_t_oli(klon, klev), d_t_oro(klon, klev))
+    ALLOCATE(d_u_oli(klon, klev), d_v_oli(klon, klev))
+    ALLOCATE(d_u_oro(klon, klev), d_v_oro(klon, klev))
+    ALLOCATE(d_u_oro_gw(klon, klev), d_v_oro_gw(klon, klev))
+    ALLOCATE(d_t_oro_gw(klon, klev))
+    ALLOCATE(d_t_lif(klon, klev), d_t_ec(klon, klev))
+    ALLOCATE(d_u_lif(klon, klev), d_v_lif(klon, klev))
+    ALLOCATE(d_ts(klon, nbsrf), d_tr(klon, klev, nbtr))
+
+    ! aerosols
+    ALLOCATE(m_allaer(klon, klev, naero_tot))
+    ! Special RRTM
+    ALLOCATE(ZLWFT0_i(klon, klev + 1), ZSWFT0_i(klon, klev + 1), ZFLDN0(klon, klev + 1))
+    ZFLDN0 = 0.
+    ALLOCATE(ZFLUP0(klon, klev + 1), ZFSDN0(klon, klev + 1), ZFSUP0(klon, klev + 1))
+    !
+    ALLOCATE(topswad_aero(klon), solswad_aero(klon))
+    ALLOCATE(topswai_aero(klon), solswai_aero(klon))
+    ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
+    ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
+    ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
+    ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
+    ALLOCATE(topsw_aero(klon, naero_grp), solsw_aero(klon, naero_grp))
+    ALLOCATE(topsw0_aero(klon, naero_grp), solsw0_aero(klon, naero_grp))
+    ALLOCATE(topswcf_aero(klon, 3), solswcf_aero(klon, 3))
+    ALLOCATE(du_gwd_hines(klon, klev), dv_gwd_hines(klon, klev))
+    ALLOCATE(dv_gwd_rando(klon, klev), dv_gwd_front(klon, klev))
+    ALLOCATE(east_gwstress(klon, klev), west_gwstress(klon, klev))
+    east_gwstress(:, :) = 0 !ym missing init
+    west_gwstress(:, :) = 0 !ym missing init
+    ALLOCATE(d_t_hin(klon, klev))
+    ALLOCATE(d_q_ch4(klon, klev))
+    ALLOCATE(stratomask(klon, klev))
+    ALLOCATE(tausum_aero(klon, nwave, naero_tot))
+    ALLOCATE(drytausum_aero(klon, naero_tot))
+    ALLOCATE(tau3d_aero(klon, klev, nwave, naero_tot))
+    ALLOCATE(dNovrN(klon))
+    ALLOCATE(zfice(klon, klev))
+    ALLOCATE(od443aer(klon))
+    ALLOCATE(od550aer(klon))
+    ALLOCATE(od865aer(klon))
+    ALLOCATE(dryod550aer(klon))
+    dryod550aer(:) = 0.
+    ALLOCATE(abs550aer(klon))
+    abs550aer(:) = 0.
+    ALLOCATE(ec550aer(klon, klev))
+    ALLOCATE(od550lt1aer(klon))
+    ALLOCATE(sconcso4(klon))
+    ALLOCATE(sconcno3(klon))
+    ALLOCATE(sconcoa(klon))
+    ALLOCATE(sconcbc(klon))
+    ALLOCATE(sconcss(klon))
+    ALLOCATE(sconcdust(klon))
+    ALLOCATE(concso4(klon, klev))
+    ALLOCATE(concno3(klon, klev))
+    ALLOCATE(concoa(klon, klev))
+    ALLOCATE(concbc(klon, klev))
+    ALLOCATE(concss(klon, klev))
+    ALLOCATE(concdust(klon, klev))
+    ALLOCATE(loadso4(klon))
+    ALLOCATE(loadoa(klon))
+    ALLOCATE(loadbc(klon))
+    ALLOCATE(loadss(klon))
+    ALLOCATE(loaddust(klon))
+    ALLOCATE(loadno3(klon))
+    ALLOCATE(load_tmp1(klon))
+    ALLOCATE(load_tmp2(klon))
+    ALLOCATE(load_tmp3(klon))
+    ALLOCATE(load_tmp4(klon))
+    ALLOCATE(load_tmp5(klon))
+    ALLOCATE(load_tmp6(klon))
+    ALLOCATE(load_tmp7(klon))
+    ALLOCATE(load_tmp8(klon))
+    ALLOCATE(load_tmp9(klon))
+    ALLOCATE(load_tmp10(klon))
+
+    !IM ajout variables CFMIP2/CMIP5
+    ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
+    ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
+    ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
+    ALLOCATE(topsw_aerop(klon, naero_grp), topsw0_aerop(klon, naero_grp))
+    ALLOCATE(solsw_aerop(klon, naero_grp), solsw0_aerop(klon, naero_grp))
+    ALLOCATE(topswcf_aerop(klon, naero_grp), solswcf_aerop(klon, naero_grp))
+
+    ! additional LW variables CK
+    ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
+    ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
+    ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
+
+    !AI Ajout Ecrad (3Deffect)
+    ALLOCATE(topswad_aero_s2(klon), solswad_aero_s2(klon))
+    ALLOCATE(topswai_aero_s2(klon), solswai_aero_s2(klon))
+    ALLOCATE(topswad0_aero_s2(klon), solswad0_aero_s2(klon))
+    ALLOCATE(topsw_aero_s2(klon, naero_grp), topsw0_aero_s2(klon, naero_grp))
+    ALLOCATE(solsw_aero_s2(klon, naero_grp), solsw0_aero_s2(klon, naero_grp))
+    ALLOCATE(topswcf_aero_s2(klon, naero_grp), solswcf_aero_s2(klon, naero_grp))
+    ! additional LW variables CK
+    ALLOCATE(toplwad_aero_s2(klon), sollwad_aero_s2(klon))
+    ALLOCATE(toplwai_aero_s2(klon), sollwai_aero_s2(klon))
+    ALLOCATE(toplwad0_aero_s2(klon), sollwad0_aero_s2(klon))
+
+    ! FH Ajout de celles necessaires au phys_output_write_mod
+
+    ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
+    ALLOCATE(ptstar(klon), pt0(klon), slp(klon))
+    !!
+    !!          Wake variables
+    ALLOCATE(alp_wake(klon))
+    ALLOCATE(wake_h(klon), wake_k(klon))
+    ALLOCATE(wake_omg(klon, klev))
+    ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
+    ALLOCATE(d_s_wk(klon), d_dens_a_wk(klon), d_dens_wk(klon))
+    ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
+    ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
+    !!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
+    ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
+    !!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
+    ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
 #ifdef ISO
       ALLOCATE(d_deltaxt_wk(ntraciso,klon, klev))
@@ -1009,32 +1010,32 @@
       ALLOCATE(d_deltaxt_ajs_cv(ntraciso,klon, klev))
 #endif
-!!         End of wake variables
-!!
-      ALLOCATE(bils(klon))
-      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
-      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
-      ALLOCATE(JrNt(klon))
-      ALLOCATE(dthmin(klon), evap(klon), snowerosion(klon), fder(klon), plcl(klon), plfc(klon))
-      ALLOCATE(prw(klon), prlw(klon), prsw(klon), prbsw(klon), water_budget(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
-      ALLOCATE(s_lcl(klon))
-      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
-!
-!nrlmd+jyg<
-      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
-      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
-!>nrlmd+jyg
-!
-      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
-      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
-      ALLOCATE(uwat(klon), vwat(klon))
-      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
-      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
-      ALLOCATE(zxrunofflic(klon))
-      ALLOCATE(zxustartlic(klon), zxrhoslic(klon), zxqsaltlic(klon))
-      zxustartlic(:)=0. ; zxrhoslic(:)=0. ; zxqsaltlic(:)=0.
-      ALLOCATE(rain_lsc(klon))
-      ALLOCATE(rain_num(klon))
-      ALLOCATE(qlth(klon,klev), qith(klon,klev), qsith(klon,klev), wiceth(klon,klev))
-      !
+    !!         End of wake variables
+    !!
+    ALLOCATE(bils(klon))
+    ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
+    ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
+    ALLOCATE(JrNt(klon))
+    ALLOCATE(dthmin(klon), evap(klon), snowerosion(klon), fder(klon), plcl(klon), plfc(klon))
+    ALLOCATE(prw(klon), prlw(klon), prsw(klon), prbsw(klon), water_budget(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
+    ALLOCATE(s_lcl(klon))
+    ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
+    !
+    !nrlmd+jyg<
+    ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
+    ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
+    !>nrlmd+jyg
+    !
+    ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
+    ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
+    ALLOCATE(uwat(klon), vwat(klon))
+    ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
+    ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
+    ALLOCATE(zxrunofflic(klon))
+    ALLOCATE(zxustartlic(klon), zxrhoslic(klon), zxqsaltlic(klon))
+    zxustartlic(:) = 0. ; zxrhoslic(:) = 0. ; zxqsaltlic(:) = 0.
+    ALLOCATE(rain_lsc(klon))
+    ALLOCATE(rain_num(klon))
+    ALLOCATE(qlth(klon, klev), qith(klon, klev), qsith(klon, klev), wiceth(klon, klev))
+    !
 #ifdef ISO
       ALLOCATE(xtevap(ntraciso,klon))
@@ -1049,81 +1050,83 @@
       runoff_diag(:)=0. ; xtrunoff_diag(:,:)=0. ! because variables are only given values on knon grid points
 #endif
-!
-      ALLOCATE(sens_x(klon), sens_w(klon))
-      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
-      ALLOCATE(delta_qsurf(klon))
-!jyg<
-!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
-!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
-!>jyg
-      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
-      dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
-      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
-      dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
-      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
-      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
-      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
-      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
-      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
+    !
+    ALLOCATE(sens_x(klon), sens_w(klon))
+    ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
+    ALLOCATE(delta_qsurf(klon))
+    !jyg<
+    !!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
+    !!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
+    !>jyg
+    ALLOCATE(dtvdf_x(klon, klev), dtvdf_w(klon, klev))
+    dtvdf_x = 0 ; dtvdf_w = 0 ;
+    !ym missing init
+    ALLOCATE(dqvdf_x(klon, klev), dqvdf_w(klon, klev))
+    dqvdf_x = 0 ; dqvdf_w = 0 ;
+    !ym missing init
+    ALLOCATE(pbl_tke_input(klon, klev + 1, nbsrf))
+    ALLOCATE(t_therm(klon, klev), q_therm(klon, klev), u_therm(klon, klev), v_therm(klon, klev))
+    ALLOCATE(cdragh_x(klon), cdragh_w(klon))
+    ALLOCATE(cdragm_x(klon), cdragm_w(klon))
+    ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
 #ifdef ISO
       ALLOCATE(dxtvdf_x(ntraciso,klon,klev), dxtvdf_w(ntraciso,klon,klev))
       ALLOCATE(xt_therm(ntraciso,klon,klev))
 #endif
-!
-      ALLOCATE(ptconv(klon,klev))
-      ALLOCATE(ratqsc(klon,klev))
-!
-      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
-      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
-      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
-      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
-      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
-      ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
-      alp_bl_conv(:)=0 ;  alp_bl_det(:)=0
-      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
-      alp_bl_fluct_m(:)=0 ; alp_bl_fluct_tke(:)= 0.
-      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon), strig(klon), zcong(klon), zlcl_th(klon))
-      alp_bl_stat(:)=0
-      ALLOCATE(proba_notrig(klon), random_notrig(klon))
-
-      ALLOCATE(dnwd0(klon, klev))
-!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
-      ALLOCATE(omega(klon, klev))
-      ALLOCATE(epmax_diag(klon)) ! epmax_cape
-!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
-      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
-      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
-      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
-      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
-      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
-      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev), zx_rhl(klon,klev), zx_rhi(klon,klev))
-      zx_rhl(:,:)=0.; zx_rhi(:,:)=0. ! because not always defined
-      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
-
-      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
-      ALLOCATE(fsollw(klon, nbsrf))
-      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf))
-      ALLOCATE(wfevap(klon, nbsrf))
-      ALLOCATE(evap_pot(klon, nbsrf))
-! FC 
-      ALLOCATE(zxfluxq(klon,klev),zxfluxt(klon,klev))
-!
-!
-!  Deep convective variables used in phytrac
-      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
-      ALLOCATE(wdtrainA(klon,klev),wdtrainS(klon,klev),wdtrainM(klon,klev))
-      ALLOCATE(dnwd(klon, klev), upwd(klon, klev))
-      ALLOCATE(ep(klon,klev))                          ! epmax_cape
-      ALLOCATE(da(klon,klev), mp(klon,klev))
-      ALLOCATE(phi(klon,klev,klev))
-      ALLOCATE(wght_cvfd(klon,klev))
-      ALLOCATE(phi2(klon,klev,klev))
-      ALLOCATE(d1a(klon,klev), dam(klon,klev))
-      ALLOCATE(ev(klon,klev))
-      ALLOCATE(elij(klon,klev,klev))
-      ALLOCATE(qtaa(klon,klev))
-      ALLOCATE(clw(klon,klev))
-      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev))
-      ALLOCATE(sij(klon,klev,klev))
+    !
+    ALLOCATE(ptconv(klon, klev))
+    ALLOCATE(ratqsc(klon, klev))
+    !
+    ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
+    ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
+    ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
+    ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
+    ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
+    ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
+    alp_bl_conv(:) = 0 ;  alp_bl_det(:) = 0
+    ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
+    alp_bl_fluct_m(:) = 0 ; alp_bl_fluct_tke(:) = 0.
+    ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon), strig(klon), zcong(klon), zlcl_th(klon))
+    alp_bl_stat(:) = 0
+    ALLOCATE(proba_notrig(klon), random_notrig(klon))
+
+    ALLOCATE(dnwd0(klon, klev))
+    !      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
+    ALLOCATE(omega(klon, klev))
+    ALLOCATE(epmax_diag(klon)) ! epmax_cape
+    !      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
+    ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
+    ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
+    ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
+    ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
+    ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
+    ALLOCATE(zphi(klon, klev), zx_rh(klon, klev), zx_rhl(klon, klev), zx_rhi(klon, klev))
+    zx_rhl(:, :) = 0.; zx_rhi(:, :) = 0. ! because not always defined
+    ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
+
+    ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
+    ALLOCATE(fsollw(klon, nbsrf))
+    ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf))
+    ALLOCATE(wfevap(klon, nbsrf))
+    ALLOCATE(evap_pot(klon, nbsrf))
+    ! FC
+    ALLOCATE(zxfluxq(klon, klev), zxfluxt(klon, klev))
+    !
+    !
+    !  Deep convective variables used in phytrac
+    ALLOCATE(pmflxr(klon, klev + 1), pmflxs(klon, klev + 1))
+    ALLOCATE(wdtrainA(klon, klev), wdtrainS(klon, klev), wdtrainM(klon, klev))
+    ALLOCATE(dnwd(klon, klev), upwd(klon, klev))
+    ALLOCATE(ep(klon, klev))                          ! epmax_cape
+    ALLOCATE(da(klon, klev), mp(klon, klev))
+    ALLOCATE(phi(klon, klev, klev))
+    ALLOCATE(wght_cvfd(klon, klev))
+    ALLOCATE(phi2(klon, klev, klev))
+    ALLOCATE(d1a(klon, klev), dam(klon, klev))
+    ALLOCATE(ev(klon, klev))
+    ALLOCATE(elij(klon, klev, klev))
+    ALLOCATE(qtaa(klon, klev))
+    ALLOCATE(clw(klon, klev))
+    ALLOCATE(epmlmMm(klon, klev, klev), eplaMm(klon, klev))
+    ALLOCATE(sij(klon, klev, klev))
 #ifdef ISO
       ALLOCATE(xtwdtrainA(ntraciso,klon,klev))
@@ -1150,30 +1153,30 @@
 #endif
 
-      ALLOCATE(prfl(klon, klev+1))
-      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
-      ALLOCATE(bsfl(klon,klev+1))
-      ALLOCATE(zw2(klon, klev+1))
-
-      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
-      ALLOCATE(fluxt(klon, klev, nbsrf))
-
-      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
-      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
-      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
-      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
-
-! ug et d'autres encore:
-      ALLOCATE(beta_prec(klon,klev))
-      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
-      ALLOCATE(pfraclr(klon,klev),pfracld(klon,klev))
-      pfraclr(:,:)=0. ; pfracld(:,:)=0. ! because not always defined
-      ALLOCATE(cldfraliq(klon,klev))
-      ALLOCATE(sigma2_icefracturb(klon,klev))
-      ALLOCATE(mean_icefracturb(klon,klev))
-      ALLOCATE(distcltop(klon,klev))
-      ALLOCATE(temp_cltop(klon,klev))
-
-      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
-      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
+    ALLOCATE(prfl(klon, klev + 1))
+    ALLOCATE(psfl(klon, klev + 1), fraca(klon, klev + 1), Vprecip(klon, klev + 1))
+    ALLOCATE(bsfl(klon, klev + 1))
+    ALLOCATE(zw2(klon, klev + 1))
+
+    ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
+    ALLOCATE(fluxt(klon, klev, nbsrf))
+
+    ALLOCATE(uwriteSTD(klon, nlevSTD, nfiles), vwriteSTD(klon, nlevSTD, nfiles))
+    ALLOCATE(wwriteSTD(klon, nlevSTD, nfiles), phiwriteSTD(klon, nlevSTD, nfiles))
+    ALLOCATE(qwriteSTD(klon, nlevSTD, nfiles), twriteSTD(klon, nlevSTD, nfiles))
+    ALLOCATE(rhwriteSTD(klon, nlevSTD, nfiles))
+
+    ! ug et d'autres encore:
+    ALLOCATE(beta_prec(klon, klev))
+    ALLOCATE(rneb(klon, klev), rnebjn(klon, klev), rneblsvol(klon, klev))
+    ALLOCATE(pfraclr(klon, klev), pfracld(klon, klev))
+    pfraclr(:, :) = 0. ; pfracld(:, :) = 0. ! because not always defined
+    ALLOCATE(cldfraliq(klon, klev))
+    ALLOCATE(sigma2_icefracturb(klon, klev))
+    ALLOCATE(mean_icefracturb(klon, klev))
+    ALLOCATE(distcltop(klon, klev))
+    ALLOCATE(temp_cltop(klon, klev))
+
+    ALLOCATE (zxsnow(klon), snowhgt(klon), qsnow(klon), to_ice(klon))
+    ALLOCATE (sissnow(klon), runoff(klon), albsol3_lic(klon))
 #ifdef ISO
       ALLOCATE (zxxtsnow(niso,klon))
@@ -1182,49 +1185,49 @@
 #endif
 
-      ALLOCATE (p_tropopause(klon))
-      ALLOCATE (z_tropopause(klon))
-      ALLOCATE (t_tropopause(klon))
-
-      ALLOCATE(zn2mout(klon,6))
-
-! Supersaturation
-      ALLOCATE(rneb_seri(klon,klev))
-      ALLOCATE(d_rneb_dyn(klon,klev))
-      ALLOCATE(qclr(klon,klev), qcld(klon,klev), qss(klon,klev), qvc(klon,klev))
-      ALLOCATE(rnebclr(klon,klev), rnebss(klon,klev), gamma_ss(klon,klev))
-      ALLOCATE(N1_ss(klon,klev), N2_ss(klon,klev))
-      ALLOCATE(drneb_sub(klon,klev), drneb_con(klon,klev), drneb_tur(klon,klev), drneb_avi(klon,klev))
-      ALLOCATE(zqsatl(klon,klev), zqsats(klon,klev))
-      ALLOCATE(Tcontr(klon,klev), qcontr(klon,klev), qcontr2(klon,klev), fcontrN(klon,klev), fcontrP(klon,klev))
-
-!--POPRECIP variables
-      ALLOCATE(qraindiag(klon,klev), qsnowdiag(klon,klev))
-      ALLOCATE(dqreva(klon,klev), dqssub(klon,klev))
-      ALLOCATE(dqrauto(klon,klev), dqrcol(klon,klev), dqrmelt(klon,klev), dqrfreez(klon,klev))
-      ALLOCATE(dqsauto(klon,klev), dqsagg(klon,klev), dqsrim(klon,klev), dqsmelt(klon,klev), dqsfreez(klon,klev))
-
-#ifdef CPP_StratAer
-      ALLOCATE (d_q_emiss(klon,klev))
-      ALLOCATE (R2SO4(klon,klev))
-      ALLOCATE (DENSO4(klon,klev))
-      ALLOCATE (f_r_wet(klon,klev))
-      ALLOCATE (decfluxaer(klon,nbtr))
+    ALLOCATE (p_tropopause(klon))
+    ALLOCATE (z_tropopause(klon))
+    ALLOCATE (t_tropopause(klon))
+
+    ALLOCATE(zn2mout(klon, 6))
+
+    ! Supersaturation
+    ALLOCATE(rneb_seri(klon, klev))
+    ALLOCATE(d_rneb_dyn(klon, klev))
+    ALLOCATE(qclr(klon, klev), qcld(klon, klev), qss(klon, klev), qvc(klon, klev))
+    ALLOCATE(rnebclr(klon, klev), rnebss(klon, klev), gamma_ss(klon, klev))
+    ALLOCATE(N1_ss(klon, klev), N2_ss(klon, klev))
+    ALLOCATE(drneb_sub(klon, klev), drneb_con(klon, klev), drneb_tur(klon, klev), drneb_avi(klon, klev))
+    ALLOCATE(zqsatl(klon, klev), zqsats(klon, klev))
+    ALLOCATE(Tcontr(klon, klev), qcontr(klon, klev), qcontr2(klon, klev), fcontrN(klon, klev), fcontrP(klon, klev))
+
+    !--POPRECIP variables
+    ALLOCATE(qraindiag(klon, klev), qsnowdiag(klon, klev))
+    ALLOCATE(dqreva(klon, klev), dqssub(klon, klev))
+    ALLOCATE(dqrauto(klon, klev), dqrcol(klon, klev), dqrmelt(klon, klev), dqrfreez(klon, klev))
+    ALLOCATE(dqsauto(klon, klev), dqsagg(klon, klev), dqsrim(klon, klev), dqsmelt(klon, klev), dqsfreez(klon, klev))
+
+    IF (CPPKEY_STRATAER) THEN
+      ALLOCATE (d_q_emiss(klon, klev))
+      ALLOCATE (R2SO4(klon, klev))
+      ALLOCATE (DENSO4(klon, klev))
+      ALLOCATE (f_r_wet(klon, klev))
+      ALLOCATE (decfluxaer(klon, nbtr))
       ALLOCATE (mdw(nbtr))
-      ALLOCATE (budg_3D_nucl(klon,klev))
-      ALLOCATE (budg_3D_cond_evap(klon,klev))
-      ALLOCATE (budg_3D_ocs_to_so2(klon,klev))
-      ALLOCATE (budg_3D_so2_to_h2so4(klon,klev))
-      ALLOCATE (budg_3D_backgr_ocs(klon,klev))
-      ALLOCATE (budg_3D_backgr_so2(klon,klev))
-      ALLOCATE (OCS_lifetime(klon,klev))
-      ALLOCATE (SO2_lifetime(klon,klev))
-      ALLOCATE (H2SO4_lifetime(klon,klev))
-      ALLOCATE (O3_clim(klon,klev))
-      ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
-      ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
-      ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
-      ALLOCATE (tau_strat_550(klon,klev))
-      ALLOCATE (tau_strat_1020(klon,klev))
-      ALLOCATE (tausum_strat(klon,3))
+      ALLOCATE (budg_3D_nucl(klon, klev))
+      ALLOCATE (budg_3D_cond_evap(klon, klev))
+      ALLOCATE (budg_3D_ocs_to_so2(klon, klev))
+      ALLOCATE (budg_3D_so2_to_h2so4(klon, klev))
+      ALLOCATE (budg_3D_backgr_ocs(klon, klev))
+      ALLOCATE (budg_3D_backgr_so2(klon, klev))
+      ALLOCATE (OCS_lifetime(klon, klev))
+      ALLOCATE (SO2_lifetime(klon, klev))
+      ALLOCATE (H2SO4_lifetime(klon, klev))
+      ALLOCATE (O3_clim(klon, klev))
+      ALLOCATE (alpha_bin(nbands_sw_rrtm + nbands_lw_rrtm + nwave, nbtr))
+      ALLOCATE (piz_bin(nbands_sw_rrtm + nbands_lw_rrtm + nwave, nbtr))
+      ALLOCATE (cg_bin(nbands_sw_rrtm + nbands_lw_rrtm + nwave, nbtr))
+      ALLOCATE (tau_strat_550(klon, klev))
+      ALLOCATE (tau_strat_1020(klon, klev))
+      ALLOCATE (tausum_strat(klon, 3))
       ALLOCATE (budg_dep_dry_ocs(klon))
       ALLOCATE (budg_dep_wet_ocs(klon))
@@ -1244,49 +1247,49 @@
       ALLOCATE (budg_sed_part(klon))
       ALLOCATE (surf_PM25_sulf(klon))
-      ALLOCATE (vsed_aer(klon,klev))
-#endif
-
-END SUBROUTINE phys_local_var_init
-
-!======================================================================
-SUBROUTINE phys_local_var_end
-USE dimphy
-USE indice_sol_mod
-IMPLICIT NONE
-      DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri, qbs_seri,qx_seri)
-      DEALLOCATE(u_seri,v_seri)
-      DEALLOCATE(l_mixmin,l_mix,wprime)
-      DEALLOCATE(tke_shear,tke_buoy,tke_trans)
-      DEALLOCATE(pbl_eps)
-      DEALLOCATE(rhcl)
-      DEALLOCATE(tr_seri)
-      DEALLOCATE(d_t_dyn,d_q_dyn)
-      DEALLOCATE(d_ql_dyn,d_qs_dyn, d_qbs_dyn)
-      DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d, d_qbs_dyn2d)
-      DEALLOCATE(d_u_dyn,d_v_dyn)
-      DEALLOCATE(d_tr_dyn)                      !RomP
-      DEALLOCATE(d_t_con,d_q_con,d_q_con_zmasse)
-      DEALLOCATE(d_u_con,d_v_con)
-      DEALLOCATE(d_t_wake,d_q_wake)
-      DEALLOCATE(d_t_lsc,d_q_lsc)
-      DEALLOCATE(d_t_lwr,d_t_lw0)
-      DEALLOCATE(d_t_swr,d_t_sw0)
-      DEALLOCATE(d_ql_lsc,d_qi_lsc)
-      DEALLOCATE(d_t_ajsb,d_q_ajsb)
-      DEALLOCATE(d_t_ajs,d_q_ajs)
-!nrlmd<
-      DEALLOCATE(d_t_ajs_w,d_q_ajs_w)
-      DEALLOCATE(d_t_ajs_x,d_q_ajs_x)
-!>nrlmd
-      DEALLOCATE(d_u_ajs,d_v_ajs)
-      DEALLOCATE(d_t_eva,d_q_eva)
-      DEALLOCATE(d_qx_eva)
-      DEALLOCATE(d_ql_eva,d_qi_eva)
-      DEALLOCATE(d_t_lscst,d_q_lscst)
-      DEALLOCATE(d_t_lscth,d_q_lscth)
-      DEALLOCATE(plul_st,plul_th)
-      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
-      DEALLOCATE(d_qbs_vdf)
-      DEALLOCATE(d_t_bsss,d_q_bsss,d_qbs_bsss)
+      ALLOCATE (vsed_aer(klon, klev))
+    END IF
+
+  END SUBROUTINE phys_local_var_init
+
+  !======================================================================
+  SUBROUTINE phys_local_var_end
+    USE dimphy
+    USE indice_sol_mod
+    IMPLICIT NONE
+    DEALLOCATE(t_seri, q_seri, ql_seri, qs_seri, qbs_seri, qx_seri)
+    DEALLOCATE(u_seri, v_seri)
+    DEALLOCATE(l_mixmin, l_mix, wprime)
+    DEALLOCATE(tke_shear, tke_buoy, tke_trans)
+    DEALLOCATE(pbl_eps)
+    DEALLOCATE(rhcl)
+    DEALLOCATE(tr_seri)
+    DEALLOCATE(d_t_dyn, d_q_dyn)
+    DEALLOCATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
+    DEALLOCATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
+    DEALLOCATE(d_u_dyn, d_v_dyn)
+    DEALLOCATE(d_tr_dyn)                      !RomP
+    DEALLOCATE(d_t_con, d_q_con, d_q_con_zmasse)
+    DEALLOCATE(d_u_con, d_v_con)
+    DEALLOCATE(d_t_wake, d_q_wake)
+    DEALLOCATE(d_t_lsc, d_q_lsc)
+    DEALLOCATE(d_t_lwr, d_t_lw0)
+    DEALLOCATE(d_t_swr, d_t_sw0)
+    DEALLOCATE(d_ql_lsc, d_qi_lsc)
+    DEALLOCATE(d_t_ajsb, d_q_ajsb)
+    DEALLOCATE(d_t_ajs, d_q_ajs)
+    !nrlmd<
+    DEALLOCATE(d_t_ajs_w, d_q_ajs_w)
+    DEALLOCATE(d_t_ajs_x, d_q_ajs_x)
+    !>nrlmd
+    DEALLOCATE(d_u_ajs, d_v_ajs)
+    DEALLOCATE(d_t_eva, d_q_eva)
+    DEALLOCATE(d_qx_eva)
+    DEALLOCATE(d_ql_eva, d_qi_eva)
+    DEALLOCATE(d_t_lscst, d_q_lscst)
+    DEALLOCATE(d_t_lscth, d_q_lscth)
+    DEALLOCATE(plul_st, plul_th)
+    DEALLOCATE(d_t_vdf, d_q_vdf, d_t_diss)
+    DEALLOCATE(d_qbs_vdf)
+    DEALLOCATE(d_t_bsss, d_q_bsss, d_qbs_bsss)
 #ifdef ISO
       deallocate(xt_seri,xtl_seri,xts_seri,xtbs_seri)
@@ -1311,109 +1314,109 @@
 #endif
 
-      DEALLOCATE(d_u_vdf,d_v_vdf)
-      DEALLOCATE(d_t_oli,d_t_oro)
-      DEALLOCATE(d_u_oli,d_v_oli)
-      DEALLOCATE(d_u_oro,d_v_oro)
-      DEALLOCATE(d_t_oro_gw)
-      DEALLOCATE(d_u_oro_gw,d_v_oro_gw)
-      DEALLOCATE(d_t_lif,d_t_ec)
-      DEALLOCATE(d_u_lif,d_v_lif)
-      DEALLOCATE(d_ts, d_tr)
-      DEALLOCATE(topswad_aero,solswad_aero)
-      DEALLOCATE(topswai_aero,solswai_aero)
-      DEALLOCATE(topswad0_aero,solswad0_aero)
-      DEALLOCATE(toplwad_aero,sollwad_aero)
-      DEALLOCATE(toplwai_aero,sollwai_aero)
-      DEALLOCATE(toplwad0_aero,sollwad0_aero)
-      DEALLOCATE(topsw_aero,solsw_aero)
-      DEALLOCATE(topsw0_aero,solsw0_aero)
-      DEALLOCATE(topswcf_aero,solswcf_aero)
-      DEALLOCATE(stratomask) 
-      DEALLOCATE(tausum_aero) 
-      DEALLOCATE(drytausum_aero) 
-      DEALLOCATE(tau3d_aero) 
-      DEALLOCATE(dNovrN)
-      DEALLOCATE(zfice)
-      DEALLOCATE(od443aer)
-      DEALLOCATE(od550aer)
-      DEALLOCATE(od865aer)
-      DEALLOCATE(dryod550aer)
-      DEALLOCATE(abs550aer)
-      DEALLOCATE(ec550aer)
-      DEALLOCATE(od550lt1aer)
-      DEALLOCATE(sconcso4) 
-      DEALLOCATE(sconcno3) 
-      DEALLOCATE(sconcoa) 
-      DEALLOCATE(sconcbc) 
-      DEALLOCATE(sconcss) 
-      DEALLOCATE(sconcdust) 
-      DEALLOCATE(concso4) 
-      DEALLOCATE(concno3) 
-      DEALLOCATE(concoa) 
-      DEALLOCATE(concbc) 
-      DEALLOCATE(concss) 
-      DEALLOCATE(concdust) 
-      DEALLOCATE(loadso4) 
-      DEALLOCATE(loadoa) 
-      DEALLOCATE(loadbc) 
-      DEALLOCATE(loadss) 
-      DEALLOCATE(loaddust) 
-      DEALLOCATE(loadno3) 
-      DEALLOCATE(load_tmp1)
-      DEALLOCATE(load_tmp2)
-      DEALLOCATE(load_tmp3)
-      DEALLOCATE(load_tmp4)
-      DEALLOCATE(load_tmp5)
-      DEALLOCATE(load_tmp6)
-      DEALLOCATE(load_tmp7)
-      DEALLOCATE(load_tmp8)
-      DEALLOCATE(load_tmp9)
-      DEALLOCATE(load_tmp10)
-      DEALLOCATE(du_gwd_hines,dv_gwd_hines,d_t_hin)
-      DEALLOCATE(d_q_ch4)
-      DEALLOCATE(dv_gwd_rando,dv_gwd_front)
-      DEALLOCATE(east_gwstress,west_gwstress)
-
-!IM ajout variables CFMIP2/CMIP5
-      DEALLOCATE(topswad_aerop, solswad_aerop)
-      DEALLOCATE(topswai_aerop, solswai_aerop)
-      DEALLOCATE(topswad0_aerop, solswad0_aerop)
-      DEALLOCATE(topsw_aerop, topsw0_aerop)
-      DEALLOCATE(solsw_aerop, solsw0_aerop)
-      DEALLOCATE(topswcf_aerop, solswcf_aerop)
-!AI Aerosols
-      DEALLOCATE(m_allaer)
-!CK LW diagnostics
-      DEALLOCATE(toplwad_aerop, sollwad_aerop)
-      DEALLOCATE(toplwai_aerop, sollwai_aerop)
-      DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
-
-!AI Ajout pour Ecrad (3Deffect)
-      DEALLOCATE(topswad_aero_s2, solswad_aero_s2)
-      DEALLOCATE(topswai_aero_s2, solswai_aero_s2)
-      DEALLOCATE(topswad0_aero_s2, solswad0_aero_s2)
-      DEALLOCATE(topsw_aero_s2, topsw0_aero_s2)
-      DEALLOCATE(solsw_aero_s2, solsw0_aero_s2)
-      DEALLOCATE(topswcf_aero_s2, solswcf_aero_s2)
-!CK LW diagnostics
-      DEALLOCATE(toplwad_aero_s2, sollwad_aero_s2)
-      DEALLOCATE(toplwai_aero_s2, sollwai_aero_s2)
-      DEALLOCATE(toplwad0_aero_s2, sollwad0_aero_s2)      
-
-! FH Ajout de celles necessaires au phys_output_write_mod
-      DEALLOCATE(tal1, pal1, pab1, pab2)
-      DEALLOCATE(ptstar, pt0, slp)
-!
-      DEALLOCATE(alp_wake)
-      DEALLOCATE(wake_h,wake_k)
-      DEALLOCATE(wake_omg)
-      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
-      DEALLOCATE(d_s_wk, d_dens_a_wk, d_dens_wk)
-      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
-      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
-!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
-      DEALLOCATE(d_deltat_the, d_deltaq_the)
-!!      DEALLOCATE( d_s_the, d_dens_the)
-      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
+    DEALLOCATE(d_u_vdf, d_v_vdf)
+    DEALLOCATE(d_t_oli, d_t_oro)
+    DEALLOCATE(d_u_oli, d_v_oli)
+    DEALLOCATE(d_u_oro, d_v_oro)
+    DEALLOCATE(d_t_oro_gw)
+    DEALLOCATE(d_u_oro_gw, d_v_oro_gw)
+    DEALLOCATE(d_t_lif, d_t_ec)
+    DEALLOCATE(d_u_lif, d_v_lif)
+    DEALLOCATE(d_ts, d_tr)
+    DEALLOCATE(topswad_aero, solswad_aero)
+    DEALLOCATE(topswai_aero, solswai_aero)
+    DEALLOCATE(topswad0_aero, solswad0_aero)
+    DEALLOCATE(toplwad_aero, sollwad_aero)
+    DEALLOCATE(toplwai_aero, sollwai_aero)
+    DEALLOCATE(toplwad0_aero, sollwad0_aero)
+    DEALLOCATE(topsw_aero, solsw_aero)
+    DEALLOCATE(topsw0_aero, solsw0_aero)
+    DEALLOCATE(topswcf_aero, solswcf_aero)
+    DEALLOCATE(stratomask)
+    DEALLOCATE(tausum_aero)
+    DEALLOCATE(drytausum_aero)
+    DEALLOCATE(tau3d_aero)
+    DEALLOCATE(dNovrN)
+    DEALLOCATE(zfice)
+    DEALLOCATE(od443aer)
+    DEALLOCATE(od550aer)
+    DEALLOCATE(od865aer)
+    DEALLOCATE(dryod550aer)
+    DEALLOCATE(abs550aer)
+    DEALLOCATE(ec550aer)
+    DEALLOCATE(od550lt1aer)
+    DEALLOCATE(sconcso4)
+    DEALLOCATE(sconcno3)
+    DEALLOCATE(sconcoa)
+    DEALLOCATE(sconcbc)
+    DEALLOCATE(sconcss)
+    DEALLOCATE(sconcdust)
+    DEALLOCATE(concso4)
+    DEALLOCATE(concno3)
+    DEALLOCATE(concoa)
+    DEALLOCATE(concbc)
+    DEALLOCATE(concss)
+    DEALLOCATE(concdust)
+    DEALLOCATE(loadso4)
+    DEALLOCATE(loadoa)
+    DEALLOCATE(loadbc)
+    DEALLOCATE(loadss)
+    DEALLOCATE(loaddust)
+    DEALLOCATE(loadno3)
+    DEALLOCATE(load_tmp1)
+    DEALLOCATE(load_tmp2)
+    DEALLOCATE(load_tmp3)
+    DEALLOCATE(load_tmp4)
+    DEALLOCATE(load_tmp5)
+    DEALLOCATE(load_tmp6)
+    DEALLOCATE(load_tmp7)
+    DEALLOCATE(load_tmp8)
+    DEALLOCATE(load_tmp9)
+    DEALLOCATE(load_tmp10)
+    DEALLOCATE(du_gwd_hines, dv_gwd_hines, d_t_hin)
+    DEALLOCATE(d_q_ch4)
+    DEALLOCATE(dv_gwd_rando, dv_gwd_front)
+    DEALLOCATE(east_gwstress, west_gwstress)
+
+    !IM ajout variables CFMIP2/CMIP5
+    DEALLOCATE(topswad_aerop, solswad_aerop)
+    DEALLOCATE(topswai_aerop, solswai_aerop)
+    DEALLOCATE(topswad0_aerop, solswad0_aerop)
+    DEALLOCATE(topsw_aerop, topsw0_aerop)
+    DEALLOCATE(solsw_aerop, solsw0_aerop)
+    DEALLOCATE(topswcf_aerop, solswcf_aerop)
+    !AI Aerosols
+    DEALLOCATE(m_allaer)
+    !CK LW diagnostics
+    DEALLOCATE(toplwad_aerop, sollwad_aerop)
+    DEALLOCATE(toplwai_aerop, sollwai_aerop)
+    DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
+
+    !AI Ajout pour Ecrad (3Deffect)
+    DEALLOCATE(topswad_aero_s2, solswad_aero_s2)
+    DEALLOCATE(topswai_aero_s2, solswai_aero_s2)
+    DEALLOCATE(topswad0_aero_s2, solswad0_aero_s2)
+    DEALLOCATE(topsw_aero_s2, topsw0_aero_s2)
+    DEALLOCATE(solsw_aero_s2, solsw0_aero_s2)
+    DEALLOCATE(topswcf_aero_s2, solswcf_aero_s2)
+    !CK LW diagnostics
+    DEALLOCATE(toplwad_aero_s2, sollwad_aero_s2)
+    DEALLOCATE(toplwai_aero_s2, sollwai_aero_s2)
+    DEALLOCATE(toplwad0_aero_s2, sollwad0_aero_s2)
+
+    ! FH Ajout de celles necessaires au phys_output_write_mod
+    DEALLOCATE(tal1, pal1, pab1, pab2)
+    DEALLOCATE(ptstar, pt0, slp)
+    !
+    DEALLOCATE(alp_wake)
+    DEALLOCATE(wake_h, wake_k)
+    DEALLOCATE(wake_omg)
+    DEALLOCATE(d_deltat_wk, d_deltaq_wk)
+    DEALLOCATE(d_s_wk, d_dens_a_wk, d_dens_wk)
+    DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
+    DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
+    !!      DEALLOCATE( d_s_vdf, d_dens_vdf)
+    DEALLOCATE(d_deltat_the, d_deltaq_the)
+    !!      DEALLOCATE( d_s_the, d_dens_the)
+    DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
 #ifdef ISO
       DEALLOCATE(d_deltaxt_wk)
@@ -1422,43 +1425,43 @@
       DEALLOCATE(d_deltaxt_vdf)
 #endif
-!
-      DEALLOCATE(bils)
-      DEALLOCATE(cdragm, cdragh, cldh, cldl)
-      DEALLOCATE(cldm, cldq, cldt, qsat2m)
-      DEALLOCATE(JrNt)
-      DEALLOCATE(dthmin, evap, snowerosion, fder, plcl, plfc)
-      DEALLOCATE(prw, prlw, prsw, prbsw, water_budget, zustar, zu10m, zv10m, rh2m, s_lcl)
-      DEALLOCATE(s_pblh, s_pblt, s_therm)
-!
-!nrlmd+jyg<
-      DEALLOCATE(s_pblh_x, s_pblh_w)
-      DEALLOCATE(s_lcl_x, s_lcl_w)
-!>nrlmd+jyg
-!
-      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
-      DEALLOCATE(uq, ve, vq, zxffonte)
-      DEALLOCATE(uwat, vwat)
-      DEALLOCATE(zxfqcalving, zxfluxlat)
-      DEALLOCATE(zxrunofflic)
-      DEALLOCATE(zxustartlic, zxrhoslic, zxqsaltlic)
-      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
-      DEALLOCATE(rain_lsc)
-      DEALLOCATE(rain_num)
-      DEALLOCATE(qlth, qith, qsith, wiceth)
-!
-      DEALLOCATE(sens_x, sens_w)
-      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
-      DEALLOCATE(delta_qsurf)
-!jyg<
-!!      DEALLOCATE(t_x, t_w)
-!!      DEALLOCATE(q_x, q_w)
-!>jyg
-      DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
-      DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
-      DEALLOCATE(pbl_tke_input)
-      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
-      DEALLOCATE(cdragh_x, cdragh_w)
-      DEALLOCATE(cdragm_x, cdragm_w)
-      DEALLOCATE(kh, kh_x, kh_w)
+    !
+    DEALLOCATE(bils)
+    DEALLOCATE(cdragm, cdragh, cldh, cldl)
+    DEALLOCATE(cldm, cldq, cldt, qsat2m)
+    DEALLOCATE(JrNt)
+    DEALLOCATE(dthmin, evap, snowerosion, fder, plcl, plfc)
+    DEALLOCATE(prw, prlw, prsw, prbsw, water_budget, zustar, zu10m, zv10m, rh2m, s_lcl)
+    DEALLOCATE(s_pblh, s_pblt, s_therm)
+    !
+    !nrlmd+jyg<
+    DEALLOCATE(s_pblh_x, s_pblh_w)
+    DEALLOCATE(s_lcl_x, s_lcl_w)
+    !>nrlmd+jyg
+    !
+    DEALLOCATE(slab_wfbils, tpot, tpote, ue)
+    DEALLOCATE(uq, ve, vq, zxffonte)
+    DEALLOCATE(uwat, vwat)
+    DEALLOCATE(zxfqcalving, zxfluxlat)
+    DEALLOCATE(zxrunofflic)
+    DEALLOCATE(zxustartlic, zxrhoslic, zxqsaltlic)
+    DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
+    DEALLOCATE(rain_lsc)
+    DEALLOCATE(rain_num)
+    DEALLOCATE(qlth, qith, qsith, wiceth)
+    !
+    DEALLOCATE(sens_x, sens_w)
+    DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
+    DEALLOCATE(delta_qsurf)
+    !jyg<
+    !!      DEALLOCATE(t_x, t_w)
+    !!      DEALLOCATE(q_x, q_w)
+    !>jyg
+    DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
+    DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
+    DEALLOCATE(pbl_tke_input)
+    DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
+    DEALLOCATE(cdragh_x, cdragh_w)
+    DEALLOCATE(cdragm_x, cdragm_w)
+    DEALLOCATE(kh, kh_x, kh_w)
 #ifdef ISO
       DEALLOCATE(xtevap,xtprw)
@@ -1471,53 +1474,53 @@
       DEALLOCATE(h1_diag,runoff_diag,xtrunoff_diag)
 #endif
-!
-      DEALLOCATE(ptconv)
-      DEALLOCATE(ratqsc)
-!
-      DEALLOCATE(wbeff, convoccur, zmax_th)
-      DEALLOCATE(zq2m, zt2m, weak_inversion)
-      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
-      DEALLOCATE(t2m_min_mon, t2m_max_mon)
-      DEALLOCATE(sens, flwp, fiwp)
-      DEALLOCATE(alp_bl_conv,alp_bl_det)
-      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
-      DEALLOCATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
-      DEALLOCATE(proba_notrig, random_notrig)
-!FC
-      DEALLOCATE(zxfluxq,zxfluxt)
-
-      DEALLOCATE(dnwd0)
-!      DEALLOCATE(upwd, omega, coefh)
-      DEALLOCATE(omega)
-      DEALLOCATE(epmax_diag)
-!      DEALLOCATE(coefm, lambda_th, cldemi)
-      DEALLOCATE(lambda_th, cldemi)
-      DEALLOCATE(cldfra, cldtau, fiwc)
-      DEALLOCATE(fl, re, flwc)
-      DEALLOCATE(ref_liq, ref_ice, theta)
-      DEALLOCATE(ref_liq_pi, ref_ice_pi)
-      DEALLOCATE(zphi, zx_rh, zx_rhl, zx_rhi)
-      DEALLOCATE(pmfd, pmfu)
-
-      DEALLOCATE(t2m, fluxlat)
-      DEALLOCATE(fsollw, evap_pot)
-      DEALLOCATE(fsolsw, wfbils)
-      DEALLOCATE(wfevap)
-
-      DEALLOCATE(pmflxr, pmflxs)
-      DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
-      DEALLOCATE(upwd, dnwd)
-      DEALLOCATE(ep)
-      DEALLOCATE(da, mp)
-      DEALLOCATE(phi)
-      DEALLOCATE(wght_cvfd)
-      DEALLOCATE(phi2)
-      DEALLOCATE(d1a, dam)
-      DEALLOCATE(ev)
-      DEALLOCATE(elij)
-      DEALLOCATE(qtaa)
-      DEALLOCATE(clw)
-      DEALLOCATE(epmlmMm, eplaMm)
-      DEALLOCATE(sij)
+    !
+    DEALLOCATE(ptconv)
+    DEALLOCATE(ratqsc)
+    !
+    DEALLOCATE(wbeff, convoccur, zmax_th)
+    DEALLOCATE(zq2m, zt2m, weak_inversion)
+    DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
+    DEALLOCATE(t2m_min_mon, t2m_max_mon)
+    DEALLOCATE(sens, flwp, fiwp)
+    DEALLOCATE(alp_bl_conv, alp_bl_det)
+    DEALLOCATE(alp_bl_fluct_m, alp_bl_fluct_tke)
+    DEALLOCATE(alp_bl_stat, n2, s2, strig, zcong, zlcl_th)
+    DEALLOCATE(proba_notrig, random_notrig)
+    !FC
+    DEALLOCATE(zxfluxq, zxfluxt)
+
+    DEALLOCATE(dnwd0)
+    !      DEALLOCATE(upwd, omega, coefh)
+    DEALLOCATE(omega)
+    DEALLOCATE(epmax_diag)
+    !      DEALLOCATE(coefm, lambda_th, cldemi)
+    DEALLOCATE(lambda_th, cldemi)
+    DEALLOCATE(cldfra, cldtau, fiwc)
+    DEALLOCATE(fl, re, flwc)
+    DEALLOCATE(ref_liq, ref_ice, theta)
+    DEALLOCATE(ref_liq_pi, ref_ice_pi)
+    DEALLOCATE(zphi, zx_rh, zx_rhl, zx_rhi)
+    DEALLOCATE(pmfd, pmfu)
+
+    DEALLOCATE(t2m, fluxlat)
+    DEALLOCATE(fsollw, evap_pot)
+    DEALLOCATE(fsolsw, wfbils)
+    DEALLOCATE(wfevap)
+
+    DEALLOCATE(pmflxr, pmflxs)
+    DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
+    DEALLOCATE(upwd, dnwd)
+    DEALLOCATE(ep)
+    DEALLOCATE(da, mp)
+    DEALLOCATE(phi)
+    DEALLOCATE(wght_cvfd)
+    DEALLOCATE(phi2)
+    DEALLOCATE(d1a, dam)
+    DEALLOCATE(ev)
+    DEALLOCATE(elij)
+    DEALLOCATE(qtaa)
+    DEALLOCATE(clw)
+    DEALLOCATE(epmlmMm, eplaMm)
+    DEALLOCATE(sij)
 #ifdef ISO
       DEALLOCATE(xtwdtrainA)
@@ -1545,51 +1548,51 @@
 
 
-      DEALLOCATE(prfl, psfl, bsfl, fraca, Vprecip)
-      DEALLOCATE(zw2)
-
-      DEALLOCATE(fluxu, fluxv)
-      DEALLOCATE(fluxt)
-
-      DEALLOCATE(uwriteSTD, vwriteSTD)
-      DEALLOCATE(wwriteSTD, phiwriteSTD)
-      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
-
-! ug et d'autres encore:
-      DEALLOCATE(beta_prec)
-      DEALLOCATE(rneb)
-      DEALLOCATE(pfraclr,pfracld)
-      DEALLOCATE(cldfraliq)
-      DEALLOCATE(sigma2_icefracturb)
-      DEALLOCATE(mean_icefracturb)
-      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
-      DEALLOCATE(distcltop)
-      DEALLOCATE(temp_cltop)
+    DEALLOCATE(prfl, psfl, bsfl, fraca, Vprecip)
+    DEALLOCATE(zw2)
+
+    DEALLOCATE(fluxu, fluxv)
+    DEALLOCATE(fluxt)
+
+    DEALLOCATE(uwriteSTD, vwriteSTD)
+    DEALLOCATE(wwriteSTD, phiwriteSTD)
+    DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
+
+    ! ug et d'autres encore:
+    DEALLOCATE(beta_prec)
+    DEALLOCATE(rneb)
+    DEALLOCATE(pfraclr, pfracld)
+    DEALLOCATE(cldfraliq)
+    DEALLOCATE(sigma2_icefracturb)
+    DEALLOCATE(mean_icefracturb)
+    DEALLOCATE (zxsnow, snowhgt, qsnow, to_ice, sissnow, runoff, albsol3_lic)
+    DEALLOCATE(distcltop)
+    DEALLOCATE(temp_cltop)
 #ifdef ISO
       DEALLOCATE (zxxtsnow,xtVprecip,xtVprecipi,pxtrfl,pxtsfl)
 #endif
 
-      DEALLOCATE (p_tropopause)
-      DEALLOCATE (z_tropopause)
-      DEALLOCATE (t_tropopause)
-      DEALLOCATE(zn2mout)
-
-! Supersaturation
-      DEALLOCATE(rneb_seri)
-      DEALLOCATE(d_rneb_dyn)
-      DEALLOCATE(qclr, qcld, qss, qvc)
-      DEALLOCATE(rnebclr, rnebss, gamma_ss)
-      DEALLOCATE(N1_ss, N2_ss)
-      DEALLOCATE(drneb_sub, drneb_con, drneb_tur, drneb_avi)
-      DEALLOCATE(zqsatl, zqsats)
-      DEALLOCATE(Tcontr, qcontr, qcontr2, fcontrN, fcontrP)
-
-!--POPRECIP variables
-      DEALLOCATE(qraindiag, qsnowdiag)
-      DEALLOCATE(dqreva, dqssub)
-      DEALLOCATE(dqrauto, dqrcol, dqrmelt, dqrfreez)
-      DEALLOCATE(dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
-
-#ifdef CPP_StratAer
-! variables for strat. aerosol CK
+    DEALLOCATE (p_tropopause)
+    DEALLOCATE (z_tropopause)
+    DEALLOCATE (t_tropopause)
+    DEALLOCATE(zn2mout)
+
+    ! Supersaturation
+    DEALLOCATE(rneb_seri)
+    DEALLOCATE(d_rneb_dyn)
+    DEALLOCATE(qclr, qcld, qss, qvc)
+    DEALLOCATE(rnebclr, rnebss, gamma_ss)
+    DEALLOCATE(N1_ss, N2_ss)
+    DEALLOCATE(drneb_sub, drneb_con, drneb_tur, drneb_avi)
+    DEALLOCATE(zqsatl, zqsats)
+    DEALLOCATE(Tcontr, qcontr, qcontr2, fcontrN, fcontrP)
+
+    !--POPRECIP variables
+    DEALLOCATE(qraindiag, qsnowdiag)
+    DEALLOCATE(dqreva, dqssub)
+    DEALLOCATE(dqrauto, dqrcol, dqrmelt, dqrfreez)
+    DEALLOCATE(dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
+
+    IF (CPPKEY_STRATAER) THEN
+      ! variables for strat. aerosol CK
       DEALLOCATE (d_q_emiss)
       DEALLOCATE (R2SO4)
@@ -1632,7 +1635,7 @@
       DEALLOCATE (budg_h2so4_to_part)
       DEALLOCATE (budg_sed_part)
-#endif
-
-END SUBROUTINE phys_local_var_end
+    END IF
+
+  END SUBROUTINE phys_local_var_end
 
 END MODULE phys_local_var_mod 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_ctrlout_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_ctrlout_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_ctrlout_mod.F90	(revision 5098)
@@ -1440,5 +1440,4 @@
     'flx_co2_land_cor', 'correction of the CO2 flux from the land', 'kg CO2 m-2 s-1', (/ ('', i=1, 10) /))
 
-#ifdef CPP_StratAer
 !--extinction coefficient
   TYPE(ctrl_out), SAVE :: o_ext_strat_550 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
@@ -1511,5 +1510,4 @@
   TYPE(ctrl_out), SAVE :: o_surf_PM25_sulf = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
     'surf_PM25_sulf', 'Sulfate PM2.5 concentration at the surface', 'ug/m3', (/ ('', i=1, 10) /))
-#endif
 
 !!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_mod.F90	(revision 5098)
@@ -7,4 +7,5 @@
   USE phys_output_write_mod, ONLY : phys_output_write
   REAL, DIMENSION(nfiles),SAVE :: ecrit_files
+  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
 
 ! Abderrahmane 12 2007
@@ -228,9 +229,5 @@
     clef_files(8) = ok_histNMC(2)
     clef_files(9) = ok_histNMC(3)
-#ifdef CPP_StratAer
-    clef_files(10)= .TRUE.
-#else
-    clef_files(10)= .FALSE.
-#endif
+    clef_files(10)= CPPKEY_StratAer
 
     !sortir des fichiers "stations" si clef_stations(:)=.TRUE.
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5095)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5098)
@@ -95,4 +95,16 @@
     USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
 
+    USE geometry_mod,      ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
+    USE time_phylmdz_mod,  ONLY: ndays
+    USE infotrac_phy,      ONLY: nqCO2
+
+    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
+    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
+
+    USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize, xios_get_field_attr, &
+            xios_field_is_active, xios_context, xios_set_current_context
+    USE wxios, ONLY: missing_val, using_xios
+    USE paramLMDZ_phy_mod
+
 
     !USE cmp_seri_mod
@@ -111,8 +123,4 @@
 #endif
 
-
-    USE geometry_mod,      ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
-    USE time_phylmdz_mod,  ONLY: ndays
-    USE infotrac_phy,      ONLY: nqCO2
 #ifdef REPROBUS
     USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
@@ -121,7 +129,4 @@
     USE strataer_emiss_mod, ONLY: strataer_emiss_init
 #endif
-    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
-    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
-
 
 #ifdef CPP_RRTM
@@ -131,20 +136,8 @@
 
 
-#ifdef CPP_StratAer
     USE phys_local_var_mod, ONLY: d_q_emiss
     USE strataer_local_var_mod
     USE strataer_nuc_mod, ONLY: strataer_nuc_init
     USE strataer_emiss_mod, ONLY: strataer_emiss_init
-#endif
-
-    USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize
-    USE lmdz_xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context
-    USE lmdz_xios, ONLY: xios_set_current_context
-    USE wxios, ONLY: missing_val, using_xios
-
-#ifndef CPP_XIOS
-    USE paramLMDZ_phy_mod
-#endif
-
 
 #ifdef ISO
@@ -1510,9 +1503,9 @@
 #endif
 
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATAER) THEN
        CALL strataer_init
        CALL strataer_nuc_init
        CALL strataer_emiss_init
-#endif
+END IF
 
        print*, '================================================='
@@ -1928,7 +1921,7 @@
        WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3)
 
-#ifndef CPP_XIOS
+    IF (.NOT. using_xios) THEN
        CALL ini_paramLMDZ_phy(phys_tstep,nid_ctesGCM)
-#endif
+END IF
 
 #endif
@@ -5800,5 +5793,5 @@
           ELSE
 #ifdef CPP_RRTM
-#ifndef CPP_StratAer
+IF (.NOT. CPPKEY_STRATAER) THEN
           !--prescribed strat aerosols 
           !--only in the case of non-interactive strat aerosols
@@ -5811,5 +5804,5 @@
              CALL abort_physic(modname,abort_message,1)
             ENDIF
-#endif
+END IF
 #else
              abort_message='You should compile with -rrtm if running ' &
@@ -5823,10 +5816,10 @@
 !
 #ifdef CPP_RRTM
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATER) THEN
        !--compute stratospheric mask
        CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
        !--interactive strat aerosols
        CALL calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
-#endif
+END IF
 #endif
        !--fin STRAT AEROSOL
@@ -6470,10 +6463,10 @@
     IF (ok_qch4) THEN
 !      d_q_ch4: H2O source from CH4 in MMR/s (mass mixing ratio/s or kg H2O/kg air/s)
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATER) THEN
        CALL stratH2O_methox(debut,paprs,d_q_ch4)
-#else
+ELSE
 !      ECMWF routine METHOX
        CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay)
-#endif
+END IF
        ! add humidity tendency due to methane
        d_q_ch4_dtime(:,:) = d_q_ch4(:,:)*phys_tstep
@@ -6494,5 +6487,5 @@
     !
     !
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATER) THEN
     IF (ok_qemiss) THEN
        flh2o=1
@@ -6537,5 +6530,5 @@
        END SELECT ! emission scenario (flag_emit)
     ENDIF
-#endif
+END IF
 
 !===============================================================
@@ -6997,5 +6990,5 @@
     ENDDO
 
-#ifdef CPP_StratAer
+IF (CPPKEY_STRATER) THEN
     IF (ok_qemiss) THEN
        DO k = 1, klev
@@ -7003,5 +6996,5 @@
        ENDDO
     ENDIF
-#endif
+END IF
     IF (ok_qch4) THEN
        DO k = 1, klev
@@ -7334,7 +7327,7 @@
 #endif
 
-#ifndef CPP_XIOS
+    IF (.NOT. using_xios) THEN
       CALL write_paramLMDZ_phy(itap,nid_ctesGCM,ok_sync)
-#endif
+END IF
 
 #endif
