Index: LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 3124)
+++ LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 3134)
@@ -392,10 +392,35 @@
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
 !$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd, dnwd0, upwd, omega
-!$OMP THREADPRIVATE(dnwd, dnwd0, upwd, omega)
+      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
+!$OMP THREADPRIVATE(dnwd0, omega)
       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
 !$OMP THREADPRIVATE(epmax_diag)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ep ! epmax_cape
+!
+!  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, wdtrainM
+!$OMP THREADPRIVATE(wdtrainA, 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(:,:)  :: clw
+!$OMP THREADPRIVATE(clw)
+      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
+!$OMP THREADPRIVATE(eplaMm)
+      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
+!$OMP THREADPRIVATE(sij)
+!
 !      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
@@ -409,6 +434,6 @@
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh
 !$OMP THREADPRIVATE(zx_rh)
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmflxr, pmflxs, prfl, psfl, fraca
-!$OMP THREADPRIVATE(pmflxr, pmflxs, prfl, psfl, fraca)
+      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca
+!$OMP THREADPRIVATE(prfl, psfl, fraca)
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
 !$OMP THREADPRIVATE(Vprecip, zw2)
@@ -423,6 +448,4 @@
 
 ! ug et d'autres encore:
-      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wdtrainA, wdtrainM
-!$OMP THREADPRIVATE(wdtrainA, wdtrainM)
       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
 !$OMP THREADPRIVATE(beta_prec)
@@ -719,9 +742,8 @@
       ALLOCATE(proba_notrig(klon), random_notrig(klon))
 
-      ALLOCATE(dnwd(klon, klev), dnwd0(klon, klev))
+      ALLOCATE(dnwd0(klon, klev))
 !      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
-      ALLOCATE(upwd(klon, klev), omega(klon, klev))
+      ALLOCATE(omega(klon, klev))
       ALLOCATE(epmax_diag(klon)) ! epmax_cape
-      ALLOCATE(ep(klon,klev)) ! epmax_cape
 !      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
       ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
@@ -738,6 +760,22 @@
       ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
       ALLOCATE(evap_pot(klon, nbsrf))
-
-      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1), prfl(klon, klev+1))
+!
+!  Deep convective variables used in phytrac
+      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
+      ALLOCATE(wdtrainA(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(clw(klon,klev) )
+      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev) )
+      ALLOCATE(sij(klon,klev,klev) )
+
+      ALLOCATE(prfl(klon, klev+1))
       ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
       ALLOCATE(zw2(klon, klev+1))
@@ -752,5 +790,4 @@
 
 ! ug et d'autres encore:
-      ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
       ALLOCATE(beta_prec(klon,klev))
       ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
@@ -996,9 +1033,8 @@
       DEALLOCATE(proba_notrig, random_notrig)
 
-      DEALLOCATE(dnwd, dnwd0)
+      DEALLOCATE(dnwd0)
 !      DEALLOCATE(upwd, omega, coefh)
-      DEALLOCATE(upwd, omega)
+      DEALLOCATE(omega)
       DEALLOCATE(epmax_diag)
-      DEALLOCATE(ep)
 !      DEALLOCATE(coefm, lambda_th, cldemi)
       DEALLOCATE(lambda_th, cldemi)
@@ -1015,6 +1051,21 @@
       DEALLOCATE(wfevap,wfrain,wfsnow)
 
-      DEALLOCATE(pmflxr, pmflxs, prfl)
-      DEALLOCATE(psfl, fraca, Vprecip)
+      DEALLOCATE(pmflxr, pmflxs)
+      DEALLOCATE(wdtrainA, wdtrainM)
+      DEALLOCATE(upwd, dnwd)
+      DEALLOCATE(ep)
+      DEALLOCATE(da, mp )
+      DEALLOCATE(phi )
+      DEALLOCATE(wght_cvfd )
+      DEALLOCATE(phi2 )
+      DEALLOCATE(d1a, dam)
+      DEALLOCATE(ev )
+      DEALLOCATE(elij )
+      DEALLOCATE(clw )
+      DEALLOCATE(epmlmMm, eplaMm )
+      DEALLOCATE(sij )
+
+
+      DEALLOCATE(prfl, psfl, fraca, Vprecip)
       DEALLOCATE(zw2)
 
@@ -1027,5 +1078,4 @@
 
 ! ug et d'autres encore:
-      DEALLOCATE(wdtrainA, wdtrainM)
       DEALLOCATE(beta_prec)
       DEALLOCATE(rneb)
