Index: LMDZ4/trunk/libf/phylmd/phys_output_mod.F90
===================================================================
--- LMDZ4/trunk/libf/phylmd/phys_output_mod.F90	(revision 944)
+++ LMDZ4/trunk/libf/phylmd/phys_output_mod.F90	(revision 945)
@@ -162,4 +162,9 @@
   integer, dimension(nfiles) , save :: flag_slab_bils    = (/ 1, 1, 10, 10 /)
 
+  integer, dimension(nfiles) , save :: flag_ale_bl    = (/ 1, 1, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_alp_bl    = (/ 1, 1, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_ale_wk    = (/ 1, 1, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_alp_wk    = (/ 1, 1, 10, 10 /)
+
 ! Champs interpolles sur des niveaux de pression ??? a faire correctement
 ! if=1 on ecrit u v w phi sur 850 700 500 200 au niv 1
@@ -221,4 +226,5 @@
   integer, dimension(nfiles) , save :: flag_iwcon        = (/ 2, 5, 10, 10 /)
   integer, dimension(nfiles) , save :: flag_temp         = (/ 2, 3, 4, 1 /)
+  integer, dimension(nfiles) , save :: flag_theta         = (/ 2, 3, 4, 1 /)
   integer, dimension(nfiles) , save :: flag_ovap         = (/ 2, 3, 4, 10 /)
   integer, dimension(nfiles) , save :: flag_wvapp        = (/ 2, 10, 10, 10 /)
@@ -257,4 +263,6 @@
   integer, dimension(nfiles) , save :: flag_ducon        = (/ 4, 10, 10, 10 /)
   integer, dimension(nfiles) , save :: flag_dqcon        = (/ 4, 5, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_dtwak        = (/ 4, 5, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_dqwak        = (/ 4, 5, 10, 10 /)
   integer, dimension(nfiles) , save :: flag_dtlsc        = (/ 4, 10, 10, 10 /)
   integer, dimension(nfiles) , save :: flag_dtlschr      = (/ 4, 10, 10, 10 /)
@@ -267,4 +275,9 @@
   integer, dimension(nfiles) , save :: flag_ratqs        = (/ 4, 10, 10, 10 /)
   integer, dimension(nfiles) , save :: flag_dtthe        = (/ 4, 10, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_f_th        = (/ 4, 10, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_e_th        = (/ 4, 10, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_d_th        = (/ 4, 10, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_f0_th        = (/ 4, 10, 10, 10 /)
+  integer, dimension(nfiles) , save :: flag_zmax_th        = (/ 4, 10, 10, 10 /)
   integer, dimension(nfiles) , save :: flag_dqthe        = (/ 4, 10, 10, 10 /)
   integer, dimension(nfiles) , save :: flag_dtajs        = (/ 4, 10, 10, 10 /)
@@ -585,4 +598,9 @@
      ENDIF
 
+ CALL histdef2d(iff,flag_ale_bl,"ale_bl","ALE BL","m2/s2") 
+ CALL histdef2d(iff,flag_alp_bl,"alp_bl","ALP BL","m2/s2") 
+ CALL histdef2d(iff,flag_ale_wk,"ale_wk","ALE WK","m2/s2") 
+ CALL histdef2d(iff,flag_alp_wk,"alp_wk","ALP WK","m2/s2") 
+
  CALL histdef2d(iff,flag_weakinv, "weakinv","Weak inversion", "-")
  CALL histdef2d(iff,flag_dthmin,"dthmin","dTheta mini", "K/m")
@@ -608,4 +626,5 @@
  CALL histdef3d(iff,flag_iwcon,"iwcon","Cloud ice water content","kg/kg")
  CALL histdef3d(iff,flag_temp,"temp","Air temperature","K" )
+ CALL histdef3d(iff,flag_theta,"theta","Potential air temperature","K" )
  CALL histdef3d(iff,flag_ovap,"ovap","Specific humidity","kg/kg" )
  CALL histdef3d(iff,flag_geop,"geop","Geopotential height","m2/s2")
@@ -645,4 +664,6 @@
  CALL histdef3d(iff,flag_ducon,"ducon","Convection du","m/s2")
  CALL histdef3d(iff,flag_dqcon,"dqcon","Convection dQ", "(kg/kg)/s")
+ CALL histdef3d(iff,flag_dtwak,"dtwak","Wake dT","K/s")
+ CALL histdef3d(iff,flag_dqwak,"dqwak","Wake dQ","(kg/kg)/s")
  CALL histdef3d(iff,flag_dtlsc,"dtlsc","Condensation dT", "K/s")
  CALL histdef3d(iff,flag_dtlschr,"dtlschr","Large-scale condensational heating rate","K/s")
@@ -655,4 +676,9 @@
  CALL histdef3d(iff,flag_ratqs,"ratqs", "RATQS"," ")
  CALL histdef3d(iff,flag_dtthe,"dtthe","Dry adjust. dT", "K/s")
+ CALL histdef3d(iff,flag_f_th,"f_th","Thermal plume mass flux", "K/s")
+ CALL histdef3d(iff,flag_e_th,"e_th","Thermal plume entrainment", "K/s")
+ CALL histdef3d(iff,flag_d_th,"d_th","Thermal plume detrainment", "K/s")
+ CALL histdef2d(iff,flag_d_th,"f0_th","Thermal closure mass flux", "K/s")
+ CALL histdef2d(iff,flag_d_th,"zmax_th","Thermal plume height", "K/s")
  CALL histdef3d(iff,flag_dqthe,"dqthe","Dry adjust. dQ","(kg/kg)/s")
  CALL histdef3d(iff,flag_dtajs,"dtajs","Dry adjust. dT", "K/s")
Index: LMDZ4/trunk/libf/phylmd/phys_output_write.h
===================================================================
--- LMDZ4/trunk/libf/phylmd/phys_output_write.h	(revision 944)
+++ LMDZ4/trunk/libf/phylmd/phys_output_write.h	(revision 945)
@@ -652,4 +652,17 @@
       ENDIF
 
+      IF (flag_ale_bl(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"ale_bl",itau_w,ale_bl)
+      ENDIF
+      IF (flag_alp_bl(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"alp_bl",itau_w,alp_bl)
+      ENDIF
+      IF (flag_ale_wk(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"ale_wk",itau_w,ale_wake)
+      ENDIF
+      IF (flag_alp_wk(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"alp_wk",itau_w,alp_wake)
+      ENDIF
+
       ELSE IF (OCEAN.EQ.'slab  ') THEN
 
@@ -801,4 +814,8 @@
        IF (flag_temp(iff)<=lev_files(iff)) THEN
       CALL histwrite_phy(nid_files(iff),"temp",itau_w,t_seri)
+       ENDIF
+
+       IF (flag_theta(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"theta",itau_w,theta)
        ENDIF
 
@@ -955,4 +972,14 @@
        ENDIF
 
+       IF (flag_dtwak(iff)<=lev_files(iff)) THEN
+      zx_tmp_fi3d(1:klon,1:klev)=d_t_wake(1:klon,1:klev)/pdtphys
+      CALL histwrite_phy(nid_files(iff),"dtwak",itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (flag_dqwak(iff)<=lev_files(iff)) THEN
+      zx_tmp_fi3d(1:klon,1:klev)=d_q_wake(1:klon,1:klev)/pdtphys
+      CALL histwrite_phy(nid_files(iff),"dqwak",itau_w,zx_tmp_fi3d)
+       ENDIF
+
        IF (flag_dtlsc(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_t_lsc(1:klon,1:klev)/pdtphys
@@ -1004,4 +1031,24 @@
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ajs(1:klon,1:klev)/pdtphys
       CALL histwrite_phy(nid_files(iff),"dtthe",itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (flag_f_th(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"f_th",itau_w,fm_therm)
+       ENDIF
+
+       IF (flag_e_th(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"e_th",itau_w,entr_therm)
+       ENDIF
+
+       IF (flag_d_th(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"d_th",itau_w,detr_therm)
+       ENDIF
+
+       IF (flag_f0_th(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"f0_th",itau_w,f0)
+       ENDIF
+
+       IF (flag_f0_th(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),"zmax_th",itau_w,zmax0)
        ENDIF
 
