Index: /LMDZ4/trunk/libf/phylmd/concvl.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/concvl.F	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/concvl.F	(revision 1334)
@@ -1,6 +1,2 @@
-
-!
-! $Header$
-!
       SUBROUTINE concvl (iflag_con,iflag_clos,
      .             dtime,paprs,pplay,
@@ -89,5 +85,8 @@
        REAL em_ph(klon,klev+1),em_p(klon,klev)
        REAL upwd(klon,klev),dnwd(klon,klev),dnwdbis(klon,klev)
-       REAL Ma(klon,klev), mip(klon,klev),Vprecip(klon,klev)
+
+!!       REAL Ma(klon,klev), mip(klon,klev),Vprecip(klon,klev)     !jyg
+       REAL Ma(klon,klev), mip(klon,klev),Vprecip(klon,klev+1)     !jyg
+
        real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
        REAL cape(klon),cin(klon),tvp(klon,klev)
@@ -254,4 +253,5 @@
          DO i=1,klon
          em_ph(i,k) = paprs(i,k) / 100.0
+         pmflxr(i,k)=0.
          pmflxs(i,k)=0.
       ENDDO
@@ -336,5 +336,6 @@
      $              em_p,em_ph,iflag,
      $              d_t,d_q,d_u,d_v,d_tra,rain,
-     $              pmflxr,cbmf,work1,work2,
+!!     $              pmflxr,cbmf,work1,work2,           !jyg
+     $              Vprecip,cbmf,work1,work2,            !jyg
      $              kbas,ktop,
      $              dtime,Ma,upwd,dnwd,dnwdbis,qcondc,wd,cape,
@@ -390,4 +391,15 @@
         ENDDO
       ENDDO
+c                                                  !jyg
+c--Separation neige/pluie (pour diagnostics)       !jyg
+      DO k = 1, klev                               !jyg
+      DO i = 1, klon                               !jyg
+       IF (t1(i,k).LT.RTT) THEN                    !jyg
+         pmflxs(i,k)=Vprecip(i,k)                  !jyg
+       ELSE                                        !jyg
+         pmflxr(i,k)=Vprecip(i,k)                  !jyg
+       ENDIF                                       !jyg
+      ENDDO                                        !jyg
+      ENDDO                                        !jyg
 c
 cc      IF (if_ebil.ge.2) THEN
Index: /LMDZ4/trunk/libf/phylmd/cv3_routines.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/cv3_routines.F	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/cv3_routines.F	(revision 1334)
@@ -2319,5 +2319,5 @@
       real upwd(nloc,nd), dnwd(nloc,nd), ma(nloc,nd)
       real dnwd0(nloc,nd), mip(nloc,nd)
-      real Vprecip(nloc,nd)
+      real Vprecip(nloc,nd+1)
       real tls(nloc,nd), tps(nloc,nd)
       real qcondc(nloc,nd)                               ! cld
@@ -2355,5 +2355,5 @@
       do il=1,ncum
        precip(il)=0.0
-c       Vprecip(il,nd+1)=0.0
+       Vprecip(il,nd+1)=0.0
        wd(il)=0.0     ! gust
       enddo
Index: /LMDZ4/trunk/libf/phylmd/cv3a_uncompress.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/cv3a_uncompress.F	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/cv3a_uncompress.F	(revision 1334)
@@ -39,5 +39,5 @@
       real ft(nloc,nd), fq(nloc,nd), fu(nloc,nd), fv(nloc,nd)
       real ftra(nloc,nd,ntra)
-      real Ma(nloc,nd),mip(nloc,nd),Vprecip(nloc,nd)
+      real Ma(nloc,nd),mip(nloc,nd),Vprecip(nloc,nd+1)
       real upwd(nloc,nd),dnwd(nloc,nd),dnwd0(nloc,nd)
       real qcondc(nloc,nd)
@@ -55,5 +55,5 @@
       real ft1(len,nd), fq1(len,nd), fu1(len,nd), fv1(len,nd)
       real ftra1(len,nd,ntra)
-      real Ma1(len,nd),mip1(len,nd),Vprecip1(len,nd)
+      real Ma1(len,nd),mip1(len,nd),Vprecip1(len,nd+1)
       real upwd1(len,nd),dnwd1(len,nd),dnwd01(len,nd)
       real qcondc1(len,nd)
Index: /LMDZ4/trunk/libf/phylmd/cva_driver.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/cva_driver.F	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/cva_driver.F	(revision 1334)
@@ -151,5 +151,6 @@
       real Ma1(len,nd)
       real mip1(len,nd)
-      real Vprecip1(len,nd)
+!      real Vprecip1(len,nd) Correction abderr le 23 03 10
+      real Vprecip1(len,nd+1)
       real upwd1(len,nd)
       real dnwd1(len,nd)
@@ -404,5 +405,6 @@
       real tps(nloc,klev), qprime(nloc), tprime(nloc)
       real precip(nloc)
-      real Vprecip(nloc,klev)
+!      real Vprecip(nloc,klev)
+      real Vprecip(nloc,klev+1)
       real tra(nloc,klev,ntra), trap(nloc,klev,ntra)
       real ftra(nloc,klev,ntra), traent(nloc,klev,klev,ntra)
@@ -488,5 +490,6 @@
       call  zilch(Ma1     ,nword2)
       call  zilch(mip1    ,nword2)
-      call  zilch(Vprecip1,nword2)
+!      call  zilch(Vprecip1,nword2)
+      Vprecip1=0.
       call  zilch(upwd1   ,nword2)
       call  zilch(dnwd1   ,nword2)
Index: /LMDZ4/trunk/libf/phylmd/newmicro.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/newmicro.F	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/newmicro.F	(revision 1334)
@@ -131,4 +131,8 @@
       xflwc = 0.d0
       xfiwc = 0.d0
+
+! Initialisation 
+      reliq=0.
+      reice=0.
 
       DO k = 1, klev
Index: /LMDZ4/trunk/libf/phylmd/phys_output_mod.F90
===================================================================
--- /LMDZ4/trunk/libf/phylmd/phys_output_mod.F90	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/phys_output_mod.F90	(revision 1334)
@@ -1,3 +1,2 @@
-!
 ! $Id$
 !
@@ -54,6 +53,6 @@
 
 !!! 1D
-  type(ctrl_out),save :: o_phis         = ctrl_out((/ 1, 1, 10, 1, 1 /), 'phis') 
-  type(ctrl_out),save :: o_aire         = ctrl_out((/ 1, 1, 10,  1, 1 /),'aire')
+  type(ctrl_out),save :: o_phis         = ctrl_out((/ 1, 1, 10, 5, 1 /), 'phis') 
+  type(ctrl_out),save :: o_aire         = ctrl_out((/ 1, 1, 10,  10, 1 /),'aire')
   type(ctrl_out),save :: o_contfracATM  = ctrl_out((/ 10, 1,  1, 10, 10 /),'contfracATM')
   type(ctrl_out),save :: o_contfracOR   = ctrl_out((/ 10, 1,  1, 10, 10 /),'contfracOR')
@@ -61,8 +60,8 @@
   
 !!! 2D
-  type(ctrl_out),save :: o_flat         = ctrl_out((/ 10, 1, 10, 10, 1 /),'flat')
+  type(ctrl_out),save :: o_flat         = ctrl_out((/ 5, 1, 10, 5, 1 /),'flat')
   type(ctrl_out),save :: o_slp          = ctrl_out((/ 1, 1, 1, 10, 1 /),'slp')
-  type(ctrl_out),save :: o_tsol         = ctrl_out((/ 1, 1, 1, 1, 1 /),'tsol')
-  type(ctrl_out),save :: o_t2m          = ctrl_out((/ 1, 1, 1, 1, 1 /),'t2m')
+  type(ctrl_out),save :: o_tsol         = ctrl_out((/ 1, 1, 1, 5, 1 /),'tsol')
+  type(ctrl_out),save :: o_t2m          = ctrl_out((/ 1, 1, 1, 5, 1 /),'t2m')
   type(ctrl_out),save :: o_t2m_min      = ctrl_out((/ 1, 1, 10, 10, 10 /),'t2m_min')
   type(ctrl_out),save :: o_t2m_max      = ctrl_out((/ 1, 1, 10, 10, 10 /),'t2m_max')
@@ -75,8 +74,8 @@
   type(ctrl_out),save :: o_wind10max    = ctrl_out((/ 10, 1, 10, 10, 10 /),'wind10max')
   type(ctrl_out),save :: o_sicf         = ctrl_out((/ 1, 1, 10, 10, 10 /),'sicf')
-  type(ctrl_out),save :: o_q2m          = ctrl_out((/ 1, 1, 1, 1, 1 /),'q2m')
-  type(ctrl_out),save :: o_u10m         = ctrl_out((/ 1, 1, 1, 1, 1 /),'u10m')
-  type(ctrl_out),save :: o_v10m         = ctrl_out((/ 1, 1, 1, 1, 1 /),'v10m')
-  type(ctrl_out),save :: o_psol         = ctrl_out((/ 1, 1, 1, 1, 1 /),'psol')
+  type(ctrl_out),save :: o_q2m          = ctrl_out((/ 1, 1, 1, 5, 1 /),'q2m')
+  type(ctrl_out),save :: o_u10m         = ctrl_out((/ 1, 1, 1, 5, 1 /),'u10m')
+  type(ctrl_out),save :: o_v10m         = ctrl_out((/ 1, 1, 1, 5, 1 /),'v10m')
+  type(ctrl_out),save :: o_psol         = ctrl_out((/ 1, 1, 1, 5, 1 /),'psol')
   type(ctrl_out),save :: o_qsurf        = ctrl_out((/ 1, 10, 10, 10, 10 /),'qsurf')
 
@@ -91,16 +90,23 @@
                                               ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_sic') /)
 
-  type(ctrl_out),save :: o_qsol         = ctrl_out((/ 1, 10, 10, 1, 1 /),'qsol')
+  type(ctrl_out),save :: o_qsol         = ctrl_out((/ 1, 10, 10, 10, 10 /),'qsol')
 
   type(ctrl_out),save :: o_ndayrain     = ctrl_out((/ 1, 10, 10, 10, 10 /),'ndayrain')
-  type(ctrl_out),save :: o_precip       = ctrl_out((/ 1, 1, 1, 1, 1 /),'precip')
-  type(ctrl_out),save :: o_plul         = ctrl_out((/ 1, 1, 1, 1, 10 /),'plul')
-
-  type(ctrl_out),save :: o_pluc         = ctrl_out((/ 1, 1, 1, 1, 10 /),'pluc')
-  type(ctrl_out),save :: o_snow         = ctrl_out((/ 1, 1, 10, 1, 10 /),'snow') 
-  type(ctrl_out),save :: o_evap         = ctrl_out((/ 1, 1, 10, 1, 10 /),'evap')
+  type(ctrl_out),save :: o_precip       = ctrl_out((/ 1, 1, 1, 5, 10 /),'precip')
+  type(ctrl_out),save :: o_plul         = ctrl_out((/ 1, 1, 1, 10, 10 /),'plul')
+
+  type(ctrl_out),save :: o_pluc         = ctrl_out((/ 1, 1, 1, 5, 10 /),'pluc')
+  type(ctrl_out),save :: o_snow         = ctrl_out((/ 1, 1, 10, 5, 10 /),'snow') 
+  type(ctrl_out),save :: o_evap         = ctrl_out((/ 1, 1, 10, 10, 10 /),'evap')
+  type(ctrl_out),save,dimension(4) :: o_evap_srf     = (/ ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_ter'), &
+                                           ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_lic'), &
+                                           ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_oce'), &
+                                           ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_sic') /)
+  type(ctrl_out),save :: o_msnow       = ctrl_out((/ 1, 10, 10, 10, 10 /),'msnow')
+  type(ctrl_out),save :: o_fsnow       = ctrl_out((/ 1, 10, 10, 10, 10 /),'fsnow')
+
   type(ctrl_out),save :: o_tops         = ctrl_out((/ 1, 1, 10, 10, 10 /),'tops')
   type(ctrl_out),save :: o_tops0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'tops0')
-  type(ctrl_out),save :: o_topl         = ctrl_out((/ 1, 1, 10, 1, 10 /),'topl')
+  type(ctrl_out),save :: o_topl         = ctrl_out((/ 1, 1, 10, 5, 10 /),'topl')
   type(ctrl_out),save :: o_topl0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'topl0')
   type(ctrl_out),save :: o_SWupTOA      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupTOA')
@@ -108,4 +114,6 @@
   type(ctrl_out),save :: o_SWdnTOA      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnTOA')
   type(ctrl_out),save :: o_SWdnTOAclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnTOAclr')
+  type(ctrl_out),save :: o_nettop       = ctrl_out((/ 1, 4, 10, 10, 10 /),'nettop')
+
   type(ctrl_out),save :: o_SWup200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'SWup200')
   type(ctrl_out),save :: o_SWup200clr   = ctrl_out((/ 10, 1, 10, 10, 10 /),'SWup200clr')
@@ -123,49 +131,51 @@
   type(ctrl_out),save :: o_LWdn200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWdn200')
   type(ctrl_out),save :: o_LWdn200clr   = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWdn200clr')
-  type(ctrl_out),save :: o_sols         = ctrl_out((/ 1, 1, 10, 1, 10 /),'sols')
+  type(ctrl_out),save :: o_sols         = ctrl_out((/ 1, 1, 10, 10, 10 /),'sols')
   type(ctrl_out),save :: o_sols0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'sols0')
-  type(ctrl_out),save :: o_soll         = ctrl_out((/ 1, 1, 10, 1, 10 /),'soll')
+  type(ctrl_out),save :: o_soll         = ctrl_out((/ 1, 1, 10, 10, 10 /),'soll')
   type(ctrl_out),save :: o_soll0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'soll0')
   type(ctrl_out),save :: o_radsol       = ctrl_out((/ 1, 1, 10, 10, 10 /),'radsol')
-  type(ctrl_out),save :: o_SWupSFC      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupSFC')
+  type(ctrl_out),save :: o_SWupSFC      = ctrl_out((/ 1, 4, 10, 5, 10 /),'SWupSFC')
   type(ctrl_out),save :: o_SWupSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupSFCclr')
-  type(ctrl_out),save :: o_SWdnSFC      = ctrl_out((/ 1, 1, 10, 10, 10 /),'SWdnSFC') 
-  type(ctrl_out),save :: o_SWdnSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnSFCclr')
+  type(ctrl_out),save :: o_SWdnSFC      = ctrl_out((/ 1, 1, 10, 5, 10 /),'SWdnSFC') 
+  type(ctrl_out),save :: o_SWdnSFCclr   = ctrl_out((/ 1, 4, 10, 5, 10 /),'SWdnSFCclr')
   type(ctrl_out),save :: o_LWupSFC      = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupSFC')
-  type(ctrl_out),save :: o_LWupSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupSFCclr')
-  type(ctrl_out),save :: o_LWdnSFC      = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnSFC')
-  type(ctrl_out),save :: o_LWdnSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnSFCclr')
-  type(ctrl_out),save :: o_bils         = ctrl_out((/ 1, 2, 10, 1, 10 /),'bils')
-  type(ctrl_out),save :: o_sens         = ctrl_out((/ 1, 1, 10, 1, 1 /),'sens')
-  type(ctrl_out),save :: o_fder         = ctrl_out((/ 1, 2, 10, 1, 10 /),'fder')
+  type(ctrl_out),save :: o_LWupSFCclr   = ctrl_out((/ 1, 4, 10, 5, 10 /),'LWupSFCclr')
+  type(ctrl_out),save :: o_LWdnSFC      = ctrl_out((/ 1, 4, 10, 5, 10 /),'LWdnSFC')
+  type(ctrl_out),save :: o_LWdnSFCclr   = ctrl_out((/ 1, 4, 10, 5, 10 /),'LWdnSFCclr')
+  type(ctrl_out),save :: o_bils         = ctrl_out((/ 1, 2, 10, 5, 10 /),'bils')
+  type(ctrl_out),save :: o_sens         = ctrl_out((/ 1, 1, 10, 5, 10 /),'sens')
+  type(ctrl_out),save :: o_fder         = ctrl_out((/ 1, 2, 10, 10, 10 /),'fder')
   type(ctrl_out),save :: o_ffonte       = ctrl_out((/ 1, 10, 10, 10, 10 /),'ffonte')
   type(ctrl_out),save :: o_fqcalving    = ctrl_out((/ 1, 10, 10, 10, 10 /),'fqcalving')
   type(ctrl_out),save :: o_fqfonte      = ctrl_out((/ 1, 10, 10, 10, 10 /),'fqfonte')
 
-  type(ctrl_out),save,dimension(4) :: o_taux_srf     = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'taux_ter'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'taux_lic'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'taux_oce'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'taux_sic') /)
-
-  type(ctrl_out),save,dimension(4) :: o_tauy_srf     = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'tauy_ter'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'tauy_lic'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'tauy_oce'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'tauy_sic') /)
-
-
-  type(ctrl_out),save,dimension(4) :: o_pourc_srf    = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'pourc_ter'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'pourc_lic'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'pourc_oce'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'pourc_sic') /)     
-
-  type(ctrl_out),save,dimension(4) :: o_fract_srf    = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'fract_ter'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'fract_lic'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'fract_oce'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'fract_sic') /)
-
-  type(ctrl_out),save,dimension(4) :: o_tsol_srf     = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'tsol_ter'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'tsol_lic'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'tsol_oce'), &
-                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'tsol_sic') /)
+  type(ctrl_out),save :: o_taux         = ctrl_out((/ 1, 10, 10, 10, 10 /),'taux')
+  type(ctrl_out),save :: o_tauy         = ctrl_out((/ 1, 10, 10, 10, 10 /),'tauy')
+  type(ctrl_out),save,dimension(4) :: o_taux_srf     = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_ter'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_lic'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_oce'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_sic') /)
+
+  type(ctrl_out),save,dimension(4) :: o_tauy_srf     = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_ter'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_lic'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_oce'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_sic') /)
+
+
+  type(ctrl_out),save,dimension(4) :: o_pourc_srf    = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_ter'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_lic'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_oce'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_sic') /)     
+
+  type(ctrl_out),save,dimension(4) :: o_fract_srf    = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_ter'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_lic'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_oce'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_sic') /)
+
+  type(ctrl_out),save,dimension(4) :: o_tsol_srf     = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_ter'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_lic'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_oce'), &
+                                                 ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_sic') /)
 
   type(ctrl_out),save,dimension(4) :: o_sens_srf     = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_ter'), &
@@ -200,10 +210,10 @@
 
 
-  type(ctrl_out),save :: o_cdrm         = ctrl_out((/ 1, 10, 10, 1, 10 /),'cdrm')
+  type(ctrl_out),save :: o_cdrm         = ctrl_out((/ 1, 10, 10, 10, 10 /),'cdrm')
   type(ctrl_out),save :: o_cdrh         = ctrl_out((/ 1, 10, 10, 1, 10 /),'cdrh')
   type(ctrl_out),save :: o_cldl         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldl')
   type(ctrl_out),save :: o_cldm         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldm')
   type(ctrl_out),save :: o_cldh         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldh')
-  type(ctrl_out),save :: o_cldt         = ctrl_out((/ 1, 1, 2, 10, 10 /),'cldt')
+  type(ctrl_out),save :: o_cldt         = ctrl_out((/ 1, 1, 2, 5, 10 /),'cldt')
   type(ctrl_out),save :: o_cldq         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldq')
   type(ctrl_out),save :: o_lwp          = ctrl_out((/ 1, 5, 10, 10, 10 /),'lwp')
@@ -215,31 +225,31 @@
  
   type(ctrl_out),save :: o_cape         = ctrl_out((/ 1, 10, 10, 10, 10 /),'cape')
-  type(ctrl_out),save :: o_pbase        = ctrl_out((/ 1, 10, 10, 10, 10 /),'pbase')
-  type(ctrl_out),save :: o_ptop         = ctrl_out((/ 1, 4, 10, 10, 10 /),'ptop')
+  type(ctrl_out),save :: o_pbase        = ctrl_out((/ 1, 5, 10, 10, 10 /),'pbase')
+  type(ctrl_out),save :: o_ptop         = ctrl_out((/ 1, 5, 10, 10, 10 /),'ptop')
   type(ctrl_out),save :: o_fbase        = ctrl_out((/ 1, 10, 10, 10, 10 /),'fbase')
   type(ctrl_out),save :: o_prw          = ctrl_out((/ 1, 1, 10, 10, 10 /),'prw')
 
-  type(ctrl_out),save :: o_s_pblh       = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_pblh')
-  type(ctrl_out),save :: o_s_pblt       = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_pblt')
-  type(ctrl_out),save :: o_s_lcl        = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_lcl')
-  type(ctrl_out),save :: o_s_capCL      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_capCL')
-  type(ctrl_out),save :: o_s_oliqCL     = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_oliqCL')
-  type(ctrl_out),save :: o_s_cteiCL     = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_cteiCL')
-  type(ctrl_out),save :: o_s_therm      = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_therm')
-  type(ctrl_out),save :: o_s_trmb1      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_trmb1')
-  type(ctrl_out),save :: o_s_trmb2      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_trmb2')
-  type(ctrl_out),save :: o_s_trmb3      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_trmb3')
+  type(ctrl_out),save :: o_s_pblh       = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_pblh')
+  type(ctrl_out),save :: o_s_pblt       = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_pblt')
+  type(ctrl_out),save :: o_s_lcl        = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_lcl')
+  type(ctrl_out),save :: o_s_capCL      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_capCL')
+  type(ctrl_out),save :: o_s_oliqCL     = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_oliqCL')
+  type(ctrl_out),save :: o_s_cteiCL     = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_cteiCL')
+  type(ctrl_out),save :: o_s_therm      = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_therm')
+  type(ctrl_out),save :: o_s_trmb1      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_trmb1')
+  type(ctrl_out),save :: o_s_trmb2      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_trmb2')
+  type(ctrl_out),save :: o_s_trmb3      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_trmb3')
 
   type(ctrl_out),save :: o_slab_bils    = ctrl_out((/ 1, 1, 10, 10, 10 /),'slab_bils_oce')
 
-  type(ctrl_out),save :: o_ale_bl       = ctrl_out((/ 1, 1, 1, 1, 10 /),'ale_bl')
-  type(ctrl_out),save :: o_alp_bl       = ctrl_out((/ 1, 1, 1, 1, 10 /),'alp_bl')
-  type(ctrl_out),save :: o_ale_wk       = ctrl_out((/ 1, 1, 1, 1, 10 /),'ale_wk')
-  type(ctrl_out),save :: o_alp_wk       = ctrl_out((/ 1, 1, 1, 1, 10 /),'alp_wk')
-
-  type(ctrl_out),save :: o_ale          = ctrl_out((/ 1, 1, 1, 1, 10 /),'ale')
-  type(ctrl_out),save :: o_alp          = ctrl_out((/ 1, 1, 1, 1, 10 /),'alp')
-  type(ctrl_out),save :: o_cin          = ctrl_out((/ 1, 1, 1, 1, 10 /),'cin')
-  type(ctrl_out),save :: o_wape         = ctrl_out((/ 1, 1, 1, 1, 10 /),'wape')
+  type(ctrl_out),save :: o_ale_bl       = ctrl_out((/ 1, 1, 1, 10, 10 /),'ale_bl')
+  type(ctrl_out),save :: o_alp_bl       = ctrl_out((/ 1, 1, 1, 10, 10 /),'alp_bl')
+  type(ctrl_out),save :: o_ale_wk       = ctrl_out((/ 1, 1, 1, 10, 10 /),'ale_wk')
+  type(ctrl_out),save :: o_alp_wk       = ctrl_out((/ 1, 1, 1, 10, 10 /),'alp_wk')
+
+  type(ctrl_out),save :: o_ale          = ctrl_out((/ 1, 1, 1, 10, 10 /),'ale')
+  type(ctrl_out),save :: o_alp          = ctrl_out((/ 1, 1, 1, 10, 10 /),'alp')
+  type(ctrl_out),save :: o_cin          = ctrl_out((/ 1, 1, 1, 10, 10 /),'cin')
+  type(ctrl_out),save :: o_wape         = ctrl_out((/ 1, 1, 1, 10, 10 /),'wape')
 
 
@@ -306,5 +316,7 @@
   type(ctrl_out),save :: o_cldtau       = ctrl_out((/ 10, 5, 10, 10, 10 /),'cldtau')                     
   type(ctrl_out),save :: o_cldemi       = ctrl_out((/ 10, 5, 10, 10, 10 /),'cldemi')
-  type(ctrl_out),save :: o_rh2m         = ctrl_out((/ 10, 5, 10, 10, 10 /),'rh2m')
+  type(ctrl_out),save :: o_rh2m         = ctrl_out((/ 5, 5, 10, 10, 10 /),'rh2m')
+  type(ctrl_out),save :: o_rh2m_min     = ctrl_out((/ 10, 5, 10, 10, 10 /),'rh2m_min')
+  type(ctrl_out),save :: o_rh2m_max     = ctrl_out((/ 10, 5, 10, 10, 10 /),'rh2m_max')
   type(ctrl_out),save :: o_qsat2m       = ctrl_out((/ 10, 5, 10, 10, 10 /),'qsat2m')
   type(ctrl_out),save :: o_tpot         = ctrl_out((/ 10, 5, 10, 10, 10 /),'tpot')
@@ -331,11 +343,11 @@
   type(ctrl_out),save :: o_snowl        = ctrl_out((/ 10, 1, 10, 10, 10 /),'snowl')
   type(ctrl_out),save :: o_cape_max     = ctrl_out((/ 10, 1, 10, 10, 10 /),'cape_max')
-  type(ctrl_out),save :: o_solldown     = ctrl_out((/ 10, 1, 10, 1, 10 /),'solldown')
-
-  type(ctrl_out),save :: o_dtsvdfo      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdfo')
-  type(ctrl_out),save :: o_dtsvdft      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdft')
-  type(ctrl_out),save :: o_dtsvdfg      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdfg')
-  type(ctrl_out),save :: o_dtsvdfi      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdfi')
-  type(ctrl_out),save :: o_rugs         = ctrl_out((/ 10, 10, 10, 1, 1 /),'rugs')
+  type(ctrl_out),save :: o_solldown     = ctrl_out((/ 10, 1, 10, 10, 10 /),'solldown')
+
+  type(ctrl_out),save :: o_dtsvdfo      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdfo')
+  type(ctrl_out),save :: o_dtsvdft      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdft')
+  type(ctrl_out),save :: o_dtsvdfg      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdfg')
+  type(ctrl_out),save :: o_dtsvdfi      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdfi')
+  type(ctrl_out),save :: o_rugs         = ctrl_out((/ 10, 10, 10, 10, 10 /),'rugs')
 
   type(ctrl_out),save :: o_topswad      = ctrl_out((/ 2, 10, 10, 10, 10 /),'topswad')
@@ -376,17 +388,18 @@
   type(ctrl_out),save :: o_lwcon        = ctrl_out((/ 2, 5, 10, 10, 1 /),'lwcon')
   type(ctrl_out),save :: o_iwcon        = ctrl_out((/ 2, 5, 10, 10, 10 /),'iwcon')
-  type(ctrl_out),save :: o_temp         = ctrl_out((/ 2, 3, 4, 1, 1 /),'temp')
-  type(ctrl_out),save :: o_theta        = ctrl_out((/ 2, 3, 4, 1, 1 /),'theta')
-  type(ctrl_out),save :: o_ovap         = ctrl_out((/ 2, 3, 4, 1, 1 /),'ovap')
-  type(ctrl_out),save :: o_ovapinit         = ctrl_out((/ 2, 3, 4, 1, 1 /),'ovapinit')
+  type(ctrl_out),save :: o_temp         = ctrl_out((/ 2, 3, 4, 10, 1 /),'temp')
+  type(ctrl_out),save :: o_theta        = ctrl_out((/ 2, 3, 4, 10, 1 /),'theta')
+  type(ctrl_out),save :: o_ovap         = ctrl_out((/ 2, 3, 4, 10, 1 /),'ovap')
+  type(ctrl_out),save :: o_ovapinit         = ctrl_out((/ 2, 3, 10, 10, 1 /),'ovapinit')
   type(ctrl_out),save :: o_wvapp        = ctrl_out((/ 2, 10, 10, 10, 10 /),'wvapp')
-  type(ctrl_out),save :: o_geop         = ctrl_out((/ 2, 3, 10, 1, 1 /),'geop')
-  type(ctrl_out),save :: o_vitu         = ctrl_out((/ 2, 3, 4, 1, 1 /),'vitu')
-  type(ctrl_out),save :: o_vitv         = ctrl_out((/ 2, 3, 4, 1, 1 /),'vitv')
-  type(ctrl_out),save :: o_vitw         = ctrl_out((/ 2, 3, 10, 10, 1 /),'vitw')
-  type(ctrl_out),save :: o_pres         = ctrl_out((/ 2, 3, 10, 1, 1 /),'pres')
+  type(ctrl_out),save :: o_geop         = ctrl_out((/ 2, 3, 10, 10, 1 /),'geop')
+  type(ctrl_out),save :: o_vitu         = ctrl_out((/ 2, 3, 4, 5, 1 /),'vitu')
+  type(ctrl_out),save :: o_vitv         = ctrl_out((/ 2, 3, 4, 5, 1 /),'vitv')
+  type(ctrl_out),save :: o_vitw         = ctrl_out((/ 2, 3, 10, 5, 1 /),'vitw')
+  type(ctrl_out),save :: o_pres         = ctrl_out((/ 2, 3, 10, 10, 1 /),'pres')
+  type(ctrl_out),save :: o_paprs        = ctrl_out((/ 2, 3, 10, 10, 1 /),'paprs')
   type(ctrl_out),save :: o_rneb         = ctrl_out((/ 2, 5, 10, 10, 1 /),'rneb')
   type(ctrl_out),save :: o_rnebcon      = ctrl_out((/ 2, 5, 10, 10, 1 /),'rnebcon')
-  type(ctrl_out),save :: o_rhum         = ctrl_out((/ 2, 10, 10, 10, 10 /),'rhum')
+  type(ctrl_out),save :: o_rhum         = ctrl_out((/ 2, 5, 10, 10, 10 /),'rhum')
   type(ctrl_out),save :: o_ozone        = ctrl_out((/ 2, 10, 10, 10, 10 /),'ozone')
   type(ctrl_out),save :: o_ozone_light        = ctrl_out((/ 2, 10, 10, 10, 10 /),'ozone_daylight')
@@ -412,11 +425,11 @@
                                                      ctrl_out((/ 3, 10, 10, 10, 10 /),'ages_sic') /)
 
-  type(ctrl_out),save,dimension(4) :: o_rugs_srf     = (/ ctrl_out((/ 3, 4, 10, 1, 10 /),'rugs_ter'), &
-                                                     ctrl_out((/ 3, 4, 10, 1, 10 /),'rugs_lic'), &
-                                                     ctrl_out((/ 3, 4, 10, 1, 10 /),'rugs_oce'), &
-                                                     ctrl_out((/ 3, 4, 10, 1, 10 /),'rugs_sic') /)
-
-  type(ctrl_out),save :: o_albs         = ctrl_out((/ 3, 10, 10, 1, 10 /),'albs')
-  type(ctrl_out),save :: o_albslw       = ctrl_out((/ 3, 10, 10, 1, 10 /),'albslw')
+  type(ctrl_out),save,dimension(4) :: o_rugs_srf     = (/ ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_ter'), &
+                                                     ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_lic'), &
+                                                     ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_oce'), &
+                                                     ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_sic') /)
+
+  type(ctrl_out),save :: o_albs         = ctrl_out((/ 3, 10, 10, 10, 10 /),'albs')
+  type(ctrl_out),save :: o_albslw       = ctrl_out((/ 3, 10, 10, 10, 10 /),'albslw')
 
   type(ctrl_out),save :: o_clwcon       = ctrl_out((/ 4, 10, 10, 10, 10 /),'clwcon')
@@ -424,4 +437,6 @@
   type(ctrl_out),save :: o_dnwd         = ctrl_out((/ 4, 10, 10, 10, 10 /),'dnwd')
   type(ctrl_out),save :: o_dnwd0        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dnwd0')
+  type(ctrl_out),save :: o_mc           = ctrl_out((/ 4, 10, 10, 10, 10 /),'mc')
+  type(ctrl_out),save :: o_ftime_con    = ctrl_out((/ 4, 10, 10, 10, 10 /),'ftime_con')
   type(ctrl_out),save :: o_dtdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dtdyn')
   type(ctrl_out),save :: o_dqdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dqdyn')
@@ -444,6 +459,6 @@
   type(ctrl_out),save :: o_dtlschr      = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlschr')
   type(ctrl_out),save :: o_dqlsc        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqlsc')
-  type(ctrl_out),save :: o_dtvdf        = ctrl_out((/ 4, 10, 10, 1, 10 /),'dtvdf')
-  type(ctrl_out),save :: o_dqvdf        = ctrl_out((/ 4, 10, 10, 1, 10 /),'dqvdf')
+  type(ctrl_out),save :: o_dtvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtvdf')
+  type(ctrl_out),save :: o_dqvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqvdf')
   type(ctrl_out),save :: o_dteva        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dteva')
   type(ctrl_out),save :: o_dqeva        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqeva')
@@ -455,4 +470,5 @@
   type(ctrl_out),save :: o_w_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'w_th')
   type(ctrl_out),save :: o_lambda_th    = ctrl_out((/ 10, 10, 10, 10, 10 /),'lambda_th')
+  type(ctrl_out),save :: o_ftime_th     = ctrl_out((/ 10, 10, 10, 10, 10 /),'ftime_th')
   type(ctrl_out),save :: o_q_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'q_th')
   type(ctrl_out),save :: o_a_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'a_th')
@@ -772,4 +788,6 @@
  CALL histdef2d(iff,o_pluc%flag,o_pluc%name, "Convective Precip.", "kg/(s*m2)")
  CALL histdef2d(iff,o_snow%flag,o_snow%name, "Snow fall", "kg/(s*m2)" )
+ CALL histdef2d(iff,o_msnow%flag,o_msnow%name, "Surface snow amount", "kg/m2" )
+ CALL histdef2d(iff,o_fsnow%flag,o_fsnow%name, "Surface snow area fraction", "-" )
  CALL histdef2d(iff,o_evap%flag,o_evap%name, "Evaporat", "kg/(s*m2)" ) 
  CALL histdef2d(iff,o_tops%flag,o_tops%name, "Solar rad. at TOA", "W/m2") 
@@ -781,4 +799,5 @@
  CALL histdef2d(iff,o_SWdnTOA%flag,o_SWdnTOA%name, "SWdn at TOA", "W/m2" )
  CALL histdef2d(iff,o_SWdnTOAclr%flag,o_SWdnTOAclr%name, "SWdn clear sky at TOA", "W/m2") 
+ CALL histdef2d(iff,o_nettop%flag,o_nettop%name, "Net dn radiatif flux at TOA", "W/m2")
  CALL histdef2d(iff,o_SWup200%flag,o_SWup200%name, "SWup at 200mb", "W/m2" ) 
  CALL histdef2d(iff,o_SWup200clr%flag,o_SWup200clr%name, "SWup clear sky at 200mb", "W/m2")
@@ -809,4 +828,7 @@
  CALL histdef2d(iff,o_fqfonte%flag,o_fqfonte%name, "Land ice melt", "kg/m2/s") 
 
+ CALL histdef2d(iff,o_taux%flag,o_taux%name, "Zonal wind stress","Pa")
+ CALL histdef2d(iff,o_tauy%flag,o_tauy%name, "Meridional wind stress","Pa")
+
      DO nsrf = 1, nbsrf
  CALL histdef2d(iff,o_pourc_srf(nsrf)%flag,o_pourc_srf(nsrf)%name,"% "//clnsurf(nsrf),"%")
@@ -816,4 +838,5 @@
  CALL histdef2d(iff,o_tsol_srf(nsrf)%flag,o_tsol_srf(nsrf)%name,"Temperature "//clnsurf(nsrf),"K")
  CALL histdef2d(iff,o_u10m_srf(nsrf)%flag,o_u10m_srf(nsrf)%name,"Vent Zonal 10m "//clnsurf(nsrf),"m/s")
+ CALL histdef2d(iff,o_evap_srf(nsrf)%flag,o_evap_srf(nsrf)%name,"evaporation at surface "//clnsurf(nsrf),"kg/(s*m2)")
  CALL histdef2d(iff,o_v10m_srf(nsrf)%flag,o_v10m_srf(nsrf)%name,"Vent meredien 10m "//clnsurf(nsrf),"m/s")
  CALL histdef2d(iff,o_t2m_srf(nsrf)%flag,o_t2m_srf(nsrf)%name,"Temp 2m "//clnsurf(nsrf),"K")
@@ -909,4 +932,12 @@
  CALL histdef3d(iff,o_dnwd%flag,o_dnwd%name, "saturated downdraft", "kg/m2/s")
  CALL histdef3d(iff,o_dnwd0%flag,o_dnwd0%name, "unsat. downdraft", "kg/m2/s")
+ CALL histdef3d(iff,o_mc%flag,o_mc%name, "Convective mass flux", "kg/m2/s")
+   type_ecri(1) = 'inst(X)'
+   type_ecri(2) = 'inst(X)'
+   type_ecri(3) = 'inst(X)'
+   type_ecri(4) = 'inst(X)'
+   type_ecri(5) = 'inst(X)'
+ CALL histdef2d(iff,o_ftime_con%flag,o_ftime_con%name, "Fraction of time convection Occurs", " ")
+   type_ecri(:) = type_ecri_files(:)
      ENDIF !iflag_con .GE. 3
 
@@ -965,4 +996,17 @@
  CALL histdef2d(iff,o_dthmin%flag,o_dthmin%name, "dTheta mini", "K/m")
  CALL histdef2d(iff,o_rh2m%flag,o_rh2m%name, "Relative humidity at 2m", "%" )
+   type_ecri(1) = 't_min(X)'
+   type_ecri(2) = 't_min(X)'
+   type_ecri(3) = 't_min(X)'
+   type_ecri(4) = 't_min(X)'
+   type_ecri(5) = 't_min(X)'
+ CALL histdef2d(iff,o_rh2m_min%flag,o_rh2m_min%name, "Min Relative humidity at 2m", "%" )
+   type_ecri(1) = 't_max(X)'
+   type_ecri(2) = 't_max(X)'
+   type_ecri(3) = 't_max(X)'
+   type_ecri(4) = 't_max(X)'
+   type_ecri(5) = 't_max(X)'
+ CALL histdef2d(iff,o_rh2m_max%flag,o_rh2m_max%name, "Max Relative humidity at 2m", "%" )
+   type_ecri(:) = type_ecri_files(:)
  CALL histdef2d(iff,o_qsat2m%flag,o_qsat2m%name, "Saturant humidity at 2m", "%")
  CALL histdef2d(iff,o_tpot%flag,o_tpot%name, "Surface air potential temperature", "K")
@@ -992,4 +1036,5 @@
  CALL histdef3d(iff,o_vitw%flag,o_vitw%name, "Vertical wind", "Pa/s" )
  CALL histdef3d(iff,o_pres%flag,o_pres%name, "Air pressure", "Pa" )
+ CALL histdef3d(iff,o_paprs%flag,o_paprs%name, "Air pressure Inter-Couches", "Pa" )
  CALL histdef3d(iff,o_rneb%flag,o_rneb%name, "Cloud fraction", "-")
  CALL histdef3d(iff,o_rnebcon%flag,o_rnebcon%name, "Convective Cloud Fraction", "-")
@@ -1078,4 +1123,5 @@
  CALL histdef3d(iff,o_w_th%flag,o_w_th%name,"Thermal plume vertical velocity","m/s")
  CALL histdef3d(iff,o_lambda_th%flag,o_lambda_th%name,"Thermal plume vertical velocity","m/s")
+ CALL histdef2d(iff,o_ftime_th%flag,o_ftime_th%name,"Fraction of time Shallow convection occurs"," ")
  CALL histdef3d(iff,o_q_th%flag,o_q_th%name, "Thermal plume total humidity", "kg/kg")
  CALL histdef3d(iff,o_a_th%flag,o_a_th%name, "Thermal plume fraction", "")
Index: /LMDZ4/trunk/libf/phylmd/phys_output_write.h
===================================================================
--- /LMDZ4/trunk/libf/phylmd/phys_output_write.h	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/phys_output_write.h	(revision 1334)
@@ -146,4 +146,12 @@
        ENDIF
 
+       IF (o_msnow%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_msnow%name,itau_w,snow_o)
+       ENDIF
+
+       IF (o_fsnow%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_fsnow%name,itau_w,zfra_o)
+       ENDIF
+
        IF (o_evap%flag(iff)<=lev_files(iff)) THEN
       CALL histwrite_phy(nid_files(iff),o_evap%name,itau_w,evap)
@@ -190,4 +198,10 @@
        ENDIF
 
+       IF (o_nettop%flag(iff)<=lev_files(iff)) THEN
+      zx_tmp_fi2d(:) = topsw(:)-toplw(:)
+      CALL histwrite_phy(nid_files(iff),
+     $                  o_nettop%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
        IF (o_SWup200%flag(iff)<=lev_files(iff)) THEN
       CALL histwrite_phy(nid_files(iff),o_SWup200%name,itau_w,SWup200)
@@ -319,4 +333,22 @@
        CALL histwrite_phy(nid_files(iff),
      $                   o_fqfonte%name,itau_w,zxfqfonte)
+       ENDIF
+
+       IF (o_taux%flag(iff)<=lev_files(iff)) THEN
+         zx_tmp_fi2d=0.
+         do nsrf=1,nbsrf
+          zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+pctsrf(:,nsrf)*fluxu(:,1,nsrf)
+         enddo
+         CALL histwrite_phy(nid_files(iff),
+     $                   o_taux%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_tauy%flag(iff)<=lev_files(iff)) THEN
+         zx_tmp_fi2d=0.
+         do nsrf=1,nbsrf
+          zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+pctsrf(:,nsrf)*fluxv(:,1,nsrf)
+         enddo
+         CALL histwrite_phy(nid_files(iff),
+     $                   o_tauy%name,itau_w,zx_tmp_fi2d)
        ENDIF
 
@@ -377,4 +409,10 @@
       ENDIF
 
+      IF (o_evap_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
+      zx_tmp_fi2d(1 : klon) = fevap(1 : klon, nsrf)
+      CALL histwrite_phy(nid_files(iff),o_evap_srf(nsrf)%name,
+     $           itau_w,zx_tmp_fi2d)
+      ENDIF
+
        IF (o_sens_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
@@ -497,5 +535,5 @@
 
         IF (o_pbase%flag(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),o_pbase%name,itau_w,pbase)
+      CALL histwrite_phy(nid_files(iff),o_pbase%name,itau_w,ema_pcb)
         ENDIF
 
@@ -532,4 +570,19 @@
        ENDIF
 
+       IF (o_ftime_con%flag(iff)<=lev_files(iff)) THEN
+        zx_tmp_fi2d=float(itau_con)/float(itap)
+      CALL histwrite_phy(nid_files(iff),o_ftime_con%name,
+     s                   itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_mc%flag(iff)<=lev_files(iff)) THEN
+        if(iflag_thermals.gt.1)then
+         zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm
+        else
+         zx_tmp_fi3d=dnwd+dnwd0+upwd
+        endif 
+      CALL histwrite_phy(nid_files(iff),o_mc%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+      
       ENDIF !iflag_con .GE. 3
 
@@ -780,4 +833,21 @@
       ENDIF
 
+      IF (o_rh2m_min%flag(iff)<=lev_files(iff)) THEN
+      DO i=1, klon
+       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
+      ENDDO
+      CALL histwrite_phy(nid_files(iff),o_rh2m_min%name,
+     s               itau_w,zx_tmp_fi2d)
+      ENDIF
+
+      IF (o_rh2m_max%flag(iff)<=lev_files(iff)) THEN
+      DO i=1, klon
+       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
+      ENDDO
+      CALL histwrite_phy(nid_files(iff),o_rh2m_max%name,
+     s              itau_w,zx_tmp_fi2d)
+      ENDIF
+
+
       IF (o_qsat2m%flag(iff)<=lev_files(iff)) THEN
       CALL histwrite_phy(nid_files(iff),o_qsat2m%name,itau_w,qsat2m)
@@ -1000,4 +1070,9 @@
         IF (o_pres%flag(iff)<=lev_files(iff)) THEN
       CALL histwrite_phy(nid_files(iff),o_pres%name,itau_w,pplay)
+        ENDIF
+
+        IF (o_paprs%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_paprs%name,
+     s                    itau_w,paprs(:,1:klev))
         ENDIF
 
@@ -1180,4 +1255,11 @@
 
        IF (iflag_thermals.gt.1) THEN
+        IF (o_ftime_th%flag(iff)<=lev_files(iff)) THEN
+! Pour l instant 0 a y reflichir pour les thermiques
+         zx_tmp_fi2d=0. 
+        CALL histwrite_phy(nid_files(iff),o_ftime_th%name,
+     s                     itau_w,zx_tmp_fi2d)
+        ENDIF
+
         IF (o_f_th%flag(iff)<=lev_files(iff)) THEN
         CALL histwrite_phy(nid_files(iff),o_f_th%name,itau_w,fm_therm)
@@ -1209,5 +1291,5 @@
        ENDIF
 
-       ENDIF !iflag_thermals
+      ENDIF !iflag_thermals
 
        IF (o_f0_th%flag(iff)<=lev_files(iff)) THEN
Index: /LMDZ4/trunk/libf/phylmd/physiq.F
===================================================================
--- /LMDZ4/trunk/libf/phylmd/physiq.F	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/physiq.F	(revision 1334)
@@ -1,4 +1,3 @@
 ! $Id$
-!
 c#define IO_DEBUG
 
@@ -29,4 +28,5 @@
       USE phys_local_var_mod ! Variables internes non sauvegardees de la physique
       USE phys_state_var_mod ! Variables sauvegardees de la physique
+      USE phys_output_var_mod ! Variables pour les ecritures des sorties
       USE fonte_neige_mod, ONLY  : fonte_neige_get_vars
       USE phys_output_mod
@@ -837,4 +837,5 @@
       REAL rflag(klon)          ! flag fonctionnement de convect
       INTEGER iflagctrl(klon)          ! flag fonctionnement de convect
+
 c -- convect43:
       INTEGER ntra              ! nb traceurs pour convect4.3
@@ -1189,4 +1190,5 @@
      .     iflag_coupl,iflag_clos,iflag_wake, read_climoz)
       call phys_state_var_init(read_climoz)
+      call phys_output_var_init
       print*, '================================================='
 
@@ -1202,4 +1204,5 @@
 c         pmflxr=0.
 c         pmflxs=0.
+          itau_con=0
 	first=.false.
 
@@ -2096,4 +2099,8 @@
               pmfu(:,:)=upwd(:,:)+dnwd(:,:)
 
+              do i = 1, klon
+                if (iflagctrl(i).le.1) itau_con(i)=itau_con(i)+1
+              enddo
+
           ELSE ! ok_cvl
 c MAF conema3 ne contient pas les traceurs
@@ -2136,8 +2143,7 @@
 
           DO i = 1, klon
-            ema_pcb(i)  = pbase(i)
+            ema_pcb(i)  = paprs(i,ibas_con(i))
           ENDDO
           DO i = 1, klon
-
 ! L'idicage de itop_con peut cacher un pb potentiel
 ! FH sous la dictee de JYG, CR
@@ -3210,4 +3216,5 @@
      $                   pmflxr(:,1:klev),pmflxs(:,1:klev),
      $                   mr_ozone,cldtau, cldemi)
+
 !     L          calipso2D,calipso3D,cfadlidar,parasolrefl,atb,betamol,
 !     L          cfaddbze,clcalipso2,dbze,cltlidarradar,
@@ -3430,4 +3437,5 @@
 cIM global posePB#include "write_bilKP_ave.h"
 c
+
 c Sauvegarder les valeurs de t et q a la fin de la physique:
 c
Index: /LMDZ4/trunk/libf/phylmd/surf_landice_mod.F90
===================================================================
--- /LMDZ4/trunk/libf/phylmd/surf_landice_mod.F90	(revision 1333)
+++ /LMDZ4/trunk/libf/phylmd/surf_landice_mod.F90	(revision 1334)
@@ -24,4 +24,5 @@
     USE cpl_mod,          ONLY : cpl_send_landice_fields
     USE calcul_fluxs_mod
+    USE phys_output_var_mod
 
     INCLUDE "indicesol.h"
@@ -74,4 +75,5 @@
     REAL, DIMENSION(klon)    :: radsol
     REAL, DIMENSION(klon)    :: u0, v0, u1_lay, v1_lay
+    INTEGER                  :: i,j
 
 ! End definition
@@ -174,5 +176,13 @@
        CALL cpl_send_landice_fields(itime, knon, knindex, run_off_lic)
     ENDIF
-
+  
+!****************************************************************************************
+       snow_o=0.
+       zfra_o = 0.
+       DO j = 1, knon
+           i = knindex(j)
+           snow_o(i) = snow(j) 
+           zfra_o(i) = zfra(j)
+       ENDDO
 
   END SUBROUTINE surf_landice
