Index: LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 2146)
+++ LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 2159)
@@ -41,4 +41,10 @@
       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(:,:)
       !$OMP THREADPRIVATE(d_t_eva,d_q_eva)
@@ -58,4 +64,10 @@
       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)
+!>nrlmd+jyg
       REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
       !$OMP THREADPRIVATE(d_t_oro)
@@ -216,5 +228,5 @@
 !$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
 
-!Ajout de celles nécessaires au phys_output_write_mod
+!Ajout de celles nÃ©cessaires au phys_output_write_mod
       REAL, SAVE, ALLOCATABLE :: slp(:)
 !$OMP THREADPRIVATE(slp)
@@ -237,4 +249,12 @@
       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)
@@ -247,4 +267,43 @@
       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc
 !$OMP THREADPRIVATE(zxqsurf, rain_lsc)
+!
+!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)
+! Entrées supplémentaires 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)
+! 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)
+      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: undi_tke, wake_tke
+!$OMP THREADPRIVATE(undi_tke, wake_tke)
+! Variables supplémentaires 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
+!$OMP THREADPRIVATE(t_therm, q_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)
+!!!
+!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+!>jyg+nrlmd
+  !
       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wake_h, wbeff, zmax_th, zq2m, zt2m
 !$OMP THREADPRIVATE(wake_h, wbeff, zmax_th, zq2m, zt2m)
@@ -335,4 +394,8 @@
       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))
@@ -341,4 +404,8 @@
       allocate(plul_st(klon),plul_th(klon))
       allocate(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
+!nrlmd+jyg<
+      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))
+!>nrlmd+jyg
       allocate(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
       allocate(d_t_oli(klon,klev),d_t_oro(klon,klev))
@@ -380,9 +447,9 @@
       allocate(lcc3dcon(klon, klev))
       allocate(lcc3dstra(klon, klev))
-      allocate(od550aer(klon))	 
-      allocate(od865aer(klon))	 
-      allocate(absvisaer(klon))	 
+      allocate(od550aer(klon))
+      allocate(od865aer(klon))
+      allocate(absvisaer(klon))
       allocate(ec550aer(klon,klev))
-      allocate(od550lt1aer(klon))	 	 
+      allocate(od550lt1aer(klon))
       allocate(sconcso4(klon))
       allocate(sconcno3(klon))
@@ -423,5 +490,5 @@
       ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
 
-! FH Ajout de celles nécessaires au phys_output_write_mod
+! FH Ajout de celles nÃ©cessaires au phys_output_write_mod
 
       ALLOCATE(slp(klon))
@@ -435,9 +502,30 @@
       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(zxfqcalving(klon), zxfluxlat(klon), zxrugs(klon))
       ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
-      ALLOCATE(rain_lsc(klon), wake_h(klon), wbeff(klon), zmax_th(klon))
+      ALLOCATE(rain_lsc(klon))
+!
+      ALLOCATE(sens_x(klon), sens_w(klon))
+      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
+      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
+      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
+      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
+      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
+      ALLOCATE(undi_tke(klon,klev), wake_tke(klon,klev))
+      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
+      ALLOCATE(t_therm(klon,klev), q_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(wake_h(klon), wbeff(klon), zmax_th(klon))
       ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
       ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
@@ -510,4 +598,8 @@
       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)
@@ -516,4 +608,8 @@
       deallocate(plul_st,plul_th)
       deallocate(d_t_vdf,d_q_vdf,d_t_diss)
+!nrlmd+jyg<
+      deallocate(d_t_vdf_w,d_q_vdf_w)
+      deallocate(d_t_vdf_x,d_q_vdf_x)
+!>nrlmd+jyg
       deallocate(d_u_vdf,d_v_vdf)
       deallocate(d_t_oli,d_t_oro)
@@ -546,5 +642,5 @@
       deallocate(lcc3dcon)
       deallocate(lcc3dstra)
-      deallocate(od550aer)	 
+      deallocate(od550aer)
       deallocate(od865aer)
       deallocate(absvisaer)
@@ -591,5 +687,5 @@
       deallocate(toplwad0_aerop, sollwad0_aerop)
 
-! FH Ajout de celles nécessaires au phys_output_write_mod
+! FH Ajout de celles nÃ©cessaires au phys_output_write_mod
       DEALLOCATE(slp)
       DEALLOCATE(ale_wake, alp_wake, bils)
@@ -600,9 +696,30 @@
       DEALLOCATE(prw, 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(zxfqcalving, zxfluxlat, zxrugs)
       DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
-      DEALLOCATE(rain_lsc, wake_h, wbeff, zmax_th)
+      DEALLOCATE(rain_lsc)
+!
+      DEALLOCATE(sens_x, sens_w)
+      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
+      DEALLOCATE(t_x, t_w)
+      DEALLOCATE(q_x, q_w)
+      DEALLOCATE(dtvdf_x, dtvdf_w)
+      DEALLOCATE(dqvdf_x, dqvdf_w)
+      DEALLOCATE(undi_tke, wake_tke)
+      DEALLOCATE(pbl_tke_input)
+      DEALLOCATE(t_therm, q_therm)
+      DEALLOCATE(cdragh_x, cdragh_w)
+      DEALLOCATE(cdragm_x, cdragm_w)
+      DEALLOCATE(kh, kh_x, kh_w)
+!
+      DEALLOCATE(wake_h, wbeff, zmax_th)
       DEALLOCATE(zq2m, zt2m, weak_inversion)
       DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
