Index: trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90	(revision 2523)
+++ trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90	(revision 2534)
@@ -21,8 +21,8 @@
 ! Objet: Lecture de l'etat initial pour la physique
 !======================================================================
-#include "netcdf.inc"
-#include "dimsoil.h"
-#include "clesphys.h"
-#include "tabcontrol.h"
+!include "netcdf.inc"
+include "dimsoil.h"
+include "clesphys.h"
+include "tabcontrol.h"
 !======================================================================
 
@@ -351,4 +351,18 @@
 ENDIF
 
+IF (startphy_file) THEN
+  ! Load Q2 the TKE at interlayer:
+  CALL get_field("Q2",q2,found)
+  IF (.not.found) THEN
+    PRINT*, 'phyetat0: Le champ <Q2> est absent'
+    PRINT*, 'mis a zero'
+    q2(:,:)=0.
+  ENDIF
+ELSE
+  ! Dummy initialization
+  q2(:,:)=0
+ENDIF ! of IF (startphy_file)
+PRINT*,'Turbulent Kinetic Energy', minval(q2), maxval(q2)
+
 ! close file
 IF (startphy_file) call close_startphy
Index: trunk/LMDZ.VENUS/libf/phyvenus/phyredem.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/phyredem.F90	(revision 2523)
+++ trunk/LMDZ.VENUS/libf/phyvenus/phyredem.F90	(revision 2534)
@@ -19,8 +19,8 @@
 ! Objet: Lecture de l'etat initial pour la physique
 !======================================================================
-#include "netcdf.inc"
-#include "dimsoil.h"
-#include "clesphys.h"
-#include "tabcontrol.h"
+!include "netcdf.inc"
+include "dimsoil.h"
+include "clesphys.h"
+include "tabcontrol.h"
 !======================================================================
 
@@ -95,4 +95,5 @@
       CALL put_field("ZPIC","zpic Orographie sous-maille",zpic)
       CALL put_field("ZVAL","zval Orographie sous-maille",zval)
+      CALL put_field("Q2","Turbulent Kinetic Energy",q2)
 
       CALL put_field("TANCIEN","T Previous iteration",t_ancien)
Index: trunk/LMDZ.VENUS/libf/phyvenus/phys_state_var_mod.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/phys_state_var_mod.F90	(revision 2523)
+++ trunk/LMDZ.VENUS/libf/phyvenus/phys_state_var_mod.F90	(revision 2534)
@@ -16,9 +16,9 @@
 !!$OMP THREADPRIVATE(dtime)
 
-      REAL, ALLOCATABLE, SAVE :: ftsol(:)
+      REAL, ALLOCATABLE, SAVE :: ftsol(:) ! surface temperature (K)
 !$OMP THREADPRIVATE(ftsol)
-      REAL, ALLOCATABLE, SAVE :: ftsoil(:,:)
+      REAL, ALLOCATABLE, SAVE :: ftsoil(:,:) ! soil temperatures (K)
 !$OMP THREADPRIVATE(ftsoil)
-      REAL, ALLOCATABLE, SAVE :: falbe(:)
+      REAL, ALLOCATABLE, SAVE :: falbe(:) ! surface albedo
 !$OMP THREADPRIVATE(falbe)
 
@@ -122,5 +122,5 @@
 
 IMPLICIT NONE
-#include "dimsoil.h"
+include "dimsoil.h"
 
       integer :: nqmax
@@ -170,13 +170,8 @@
       ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
       ALLOCATE(dlw(klon), fder(klon))
-      allocate(sens(klon))      
-      allocate(q2(klon,klev+1))
-      allocate(l0(klon))
-      allocate(wstar(klon))
-      allocate(yustar(klon))
-      allocate(tstar(klon))
-      allocate(hfmax_th(klon))
-      allocate(zmax_th(klon))
-
+
+      ! allocate turb_mod module variables
+      CALL ini_turb_mod(klon,klev)
+      
 END SUBROUTINE phys_state_var_init
 
@@ -214,12 +209,8 @@
       deallocate(topsw0,toplw0,solsw0,sollw0)
       deallocate(dlw, fder)
-      deallocate(sens)
-      deallocate(q2)
-      deallocate(l0)
-      deallocate(wstar)
-      deallocate(yustar)
-      deallocate(tstar)
-      deallocate(hfmax_th)
-      deallocate(zmax_th)
+
+      ! deallocate turb_mod module variables
+      CALL end_turb_mod
+
 END SUBROUTINE phys_state_var_end
 
Index: trunk/LMDZ.VENUS/libf/phyvenus/radlwsw.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/radlwsw.F	(revision 2523)
+++ trunk/LMDZ.VENUS/libf/phyvenus/radlwsw.F	(revision 2534)
@@ -28,24 +28,31 @@
 
 c======================================================================
-      use dimphy
+      use dimphy, only: klon,klev
       USE geometry_mod, ONLY: latitude_deg
       USE phys_state_var_mod, only: heat,cool,radsol,
      .      topsw,toplw,solsw,sollw,sollwdown,lwnet,swnet
       use write_field_phy
+
+#ifdef CPP_XIOS      
+      use xios_output_mod, only: send_xios_field
+#endif
+
       IMPLICIT none
-#include "YOMCST.h"
-#include "clesphys.h" 
-#include "comcstVE.h"
-#include "nlteparams.h"
+      include "YOMCST.h"
+      include "clesphys.h" 
+      include "comcstVE.h"
+      include "nlteparams.h"
 
 !===========
 ! Arguments
 !===========
-      real rmu0(klon), fract(klon), dist
-
-      REAL zzlev(klon,klev+1)
-      real paprs(klon,klev+1), pplay(klon,klev)
-      real tsol(klon)
-      real t(klon,klev)
+      real,intent(in) :: dist ! planet-Sun distance 
+      real,intent(in) :: rmu0(klon) ! cosine of zenital angle
+      real,intent(in) :: fract(klon) ! normalized fraction of sunlight illumination
+      REAL,intent(in) :: zzlev(klon,klev+1) ! altitude of the layer boundaries (m)
+      real,intent(in) :: paprs(klon,klev+1) ! inter-layer pressure (Pa)
+      real,intent(in) :: pplay(klon,klev) ! mid-layer pressure  (Pa)
+      real,intent(in) :: tsol(klon) ! surface temperature (K)
+      real,intent(in) :: t(klon,klev) ! atmospheric temperature (K)
 
 !===========
@@ -83,7 +90,5 @@
 	real	factlat, k1, k2, k3, k4
 c --------------------------------------
-      logical firstcall
-      data    firstcall/.true./
-      save    firstcall
+      logical,save :: firstcall=.true.
       
 cERROR		! For checking if the file it's being read
@@ -663,4 +668,4 @@
 
       firstcall = .false.
-      RETURN
+
       END
Index: trunk/LMDZ.VENUS/libf/phyvenus/turb_mod.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/turb_mod.F90	(revision 2523)
+++ trunk/LMDZ.VENUS/libf/phyvenus/turb_mod.F90	(revision 2534)
@@ -4,5 +4,5 @@
   REAL,SAVE,ALLOCATABLE :: q2(:,:)    ! Turbulent Kinetic Energy
   REAL,SAVE,ALLOCATABLE :: sens(:)
-  REAL,allocatable,SAVE :: l0(:)
+  REAL,allocatable,SAVE :: l0(:)      ! Characteristic mixing length
   REAL,SAVE,ALLOCATABLE :: yustar(:)
   REAL,SAVE,ALLOCATABLE :: wstar(:)
@@ -15,22 +15,40 @@
       ! mostly for LES use. default is FALSE (for GCM and mesoscale)
 
-!contains
+contains
 
-!  subroutine ini_turb_mod(ngrid,nlayer)
+  subroutine ini_turb_mod(ngrid,nlayer)
 
-!  implicit none
-!  integer,intent(in) :: ngrid ! number of atmospheric columns
-!  integer,intent(in) :: nlayer ! number of atmospheric layers
+  implicit none
+  integer,intent(in) :: ngrid ! number of atmospheric columns
+  integer,intent(in) :: nlayer ! number of atmospheric layers
 
-!    allocate(q2(ngrid,nlayer+1))
-!    allocate(l0(ngrid))
-!    allocate(wstar(ngrid))
-!   allocate(ustar(ngrid))
-!   allocate(tstar(ngrid))
-!   allocate(hfmax_th(ngrid))
-!   allocate(zmax_th(ngrid))
+    allocate(q2(ngrid,nlayer+1))
+    allocate(sens(ngrid))
+    allocate(l0(ngrid))
+    allocate(wstar(ngrid))
+    allocate(yustar(ngrid))
+    allocate(tstar(ngrid))
+    allocate(hfmax_th(ngrid))
+    allocate(zmax_th(ngrid))
 !   allocate(sensibFlux(ngrid))
 
-!  end subroutine ini_turb_mod
+  end subroutine ini_turb_mod
+
+  subroutine end_turb_mod
+
+  implicit none
+
+    if (allocated(q2)) deallocate(q2)
+    if (allocated(sens)) deallocate(sens)
+    if (allocated(l0)) deallocate(l0)
+    if (allocated(wstar)) deallocate(wstar)
+    if (allocated(yustar)) deallocate(yustar)
+    if (allocated(tstar)) deallocate(tstar)
+    if (allocated(hfmax_th)) deallocate(hfmax_th)
+    if (allocated(zmax_th)) deallocate(zmax_th)
+!    if (allocated(sensibFlux)) deallocate(sensibFlux)
+
+  end subroutine end_turb_mod
+
 
 end module turb_mod
Index: trunk/LMDZ.VENUS/libf/phyvenus/yamada4.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/yamada4.F	(revision 2523)
+++ trunk/LMDZ.VENUS/libf/phyvenus/yamada4.F	(revision 2534)
@@ -90,7 +90,8 @@
       integer iter
 
-      real ric,rifc,b1,kap
-      save ric,rifc,b1,kap
-      data ric,rifc,b1,kap/0.195,0.191,16.6,0.4/
+      real,save :: ric=0.195
+      real,save :: rifc=0.191
+      real,save :: b1=16.6
+      real,save :: kap=0.4
 
       real frif,falpha,fsm
@@ -118,6 +119,6 @@
 
       if (first) then
-        IF (.not.ALLOCATED(l0)) allocate(l0(klon))
-        IF (.not.ALLOCATED(q2)) allocate(q2(klon,klevp1))
+!        IF (.not.ALLOCATED(l0)) allocate(l0(klon))
+!        IF (.not.ALLOCATED(q2)) allocate(q2(klon,klevp1))
 
 c (surtout pour k=1, à cause diagnostiques...)
