Index: LMDZ4/trunk/libf/phylmd/phys_output_mod.F90
===================================================================
--- LMDZ4/trunk/libf/phylmd/phys_output_mod.F90	(revision 1390)
+++ LMDZ4/trunk/libf/phylmd/phys_output_mod.F90	(revision 1398)
@@ -233,11 +233,12 @@
   type(ctrl_out),save :: o_s_pblt       = ctrl_out((/ 1, 10, 10, 10, 10 /),'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, 10 /),'s_cteiCL')
   type(ctrl_out),save :: o_s_therm      = ctrl_out((/ 1, 10, 10, 10, 10 /),'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')
+!IM : Les champs suivants (s_capCL, s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F
+! 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, 10 /),'s_cteiCL')
+! 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')
@@ -292,10 +293,10 @@
                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'q10') /)
 
-  type(ctrl_out),save,dimension(6) :: o_phiSTDlevs   = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'phi850'), &
-                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'phi700'), &
-                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'phi500'), &
-                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'phi200'), &
-                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'phi50'), & 
-                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'phi10') /)
+  type(ctrl_out),save,dimension(6) :: o_zSTDlevs   = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'z850'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'z700'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'z500'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'z200'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'z50'), & 
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'z10') /)
 
 
@@ -453,7 +454,7 @@
                                                      ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_sic') /) 
 
-  type(ctrl_out),save,dimension(4) :: o_ages_srf     = (/ ctrl_out((/ 3, 10, 10, 10, 10 /),'ages_ter'), &
+  type(ctrl_out),save,dimension(4) :: o_ages_srf     = (/ ctrl_out((/ 10, 10, 10, 10, 10 /),'ages_ter'), &
                                                      ctrl_out((/ 3, 10, 10, 10, 10 /),'ages_lic'), &
-                                                     ctrl_out((/ 3, 10, 10, 10, 10 /),'ages_oce'), &
+                                                     ctrl_out((/ 10, 10, 10, 10, 10 /),'ages_oce'), &
                                                      ctrl_out((/ 3, 10, 10, 10, 10 /),'ages_sic') /)
 
@@ -463,6 +464,6 @@
                                                      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_alb1         = ctrl_out((/ 3, 10, 10, 10, 10 /),'alb1')
+  type(ctrl_out),save :: o_alb2       = ctrl_out((/ 3, 10, 10, 10, 10 /),'alb2')
 
   type(ctrl_out),save :: o_clwcon       = ctrl_out((/ 4, 10, 10, 10, 10 /),'clwcon')
@@ -746,5 +747,5 @@
       CALL histvert(nid_files(iff), "presnivs", "Vertical levels", "mb", &
            levmax(iff) - levmin(iff) + 1, &
-           presnivs(levmin(iff):levmax(iff))/100., nvertm(iff))
+           presnivs(levmin(iff):levmax(iff))/100., nvertm(iff),"down")
 
 !!!!!!!!!!!!! Traitement des champs 3D pour histhf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -890,10 +891,11 @@
    type_ecri(:) = type_ecri_files(:)
   endif
- CALL histdef2d(iff,o_albe_srf(nsrf)%flag,o_albe_srf(nsrf)%name,"Albedo surf. "//clnsurf(nsrf),"-")
- CALL histdef2d(iff,o_rugs_srf(nsrf)%flag,o_rugs_srf(nsrf)%name,"Latent heat flux "//clnsurf(nsrf),"W/m2")
+ CALL histdef2d(iff,o_albe_srf(nsrf)%flag,o_albe_srf(nsrf)%name,"Albedo VIS surf. "//clnsurf(nsrf),"-")
+ CALL histdef2d(iff,o_rugs_srf(nsrf)%flag,o_rugs_srf(nsrf)%name,"Surface roughness "//clnsurf(nsrf),"m")
  CALL histdef2d(iff,o_ages_srf(nsrf)%flag,o_ages_srf(nsrf)%name,"Snow age", "day")
 END DO
 
 IF (new_aod .AND. (.NOT. aerosol_couple)) THEN
+ IF (ok_ade.OR.ok_aie) THEN
 
   CALL histdef2d(iff,o_od550aer%flag,o_od550aer%name, "Total aerosol optical depth at 550nm", "-")
@@ -922,4 +924,5 @@
   CALL histdef2d(iff,o_tausumaero(naero)%flag,o_tausumaero(naero)%name,"Aerosol Optical depth at 550 nm "//name_aero(naero),"1")
   END DO
+ ENDIF
 ENDIF
 
@@ -966,6 +969,6 @@
 
 
- CALL histdef2d(iff,o_albs%flag,o_albs%name, "Surface albedo", "-")
- CALL histdef2d(iff,o_albslw%flag,o_albslw%name, "Surface albedo LW", "-")
+ CALL histdef2d(iff,o_alb1%flag,o_alb1%name, "Surface VIS albedo", "-")
+ CALL histdef2d(iff,o_alb2%flag,o_alb2%name, "Surface Near IR albedo", "-")
  CALL histdef2d(iff,o_cdrm%flag,o_cdrm%name, "Momentum drag coef.", "-")
  CALL histdef2d(iff,o_cdrh%flag,o_cdrh%name, "Heat drag coef.", "-" )
@@ -984,6 +987,6 @@
      IF(iflag_con.GE.3) THEN ! sb
  CALL histdef2d(iff,o_cape%flag,o_cape%name, "Conv avlbl pot ener", "J/kg")
- CALL histdef2d(iff,o_pbase%flag,o_pbase%name, "Cld base pressure", "mb")
- CALL histdef2d(iff,o_ptop%flag,o_ptop%name, "Cld top pressure", "mb")
+ CALL histdef2d(iff,o_pbase%flag,o_pbase%name, "Cld base pressure", "Pa")
+ CALL histdef2d(iff,o_ptop%flag,o_ptop%name, "Cld top pressure", "Pa")
  CALL histdef2d(iff,o_fbase%flag,o_fbase%name, "Cld base mass flux", "kg/m2/s")
  CALL histdef2d(iff,o_prw%flag,o_prw%name, "Precipitable water", "kg/m2")
@@ -1012,11 +1015,12 @@
  CALL histdef2d(iff,o_s_pblt%flag,o_s_pblt%name, "t at Boundary Layer Height", "K")
  CALL histdef2d(iff,o_s_lcl%flag,o_s_lcl%name, "Condensation level", "m")
- CALL histdef2d(iff,o_s_capCL%flag,o_s_capCL%name, "Conv avlbl pot enerfor ABL", "J/m2" )
- CALL histdef2d(iff,o_s_oliqCL%flag,o_s_oliqCL%name, "Liq Water in BL", "kg/m2")
- CALL histdef2d(iff,o_s_cteiCL%flag,o_s_cteiCL%name, "Instability criteria(ABL)", "K")
  CALL histdef2d(iff,o_s_therm%flag,o_s_therm%name, "Exces du thermique", "K")
- CALL histdef2d(iff,o_s_trmb1%flag,o_s_trmb1%name, "deep_cape(HBTM2)", "J/m2")
- CALL histdef2d(iff,o_s_trmb2%flag,o_s_trmb2%name, "inhibition (HBTM2)", "J/m2")
- CALL histdef2d(iff,o_s_trmb3%flag,o_s_trmb3%name, "Point Omega (HBTM2)", "m")
+!IM : Les champs suivants (s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F
+!CALL histdef2d(iff,o_s_capCL%flag,o_s_capCL%name, "Conv avlbl pot enerfor ABL", "J/m2" )
+!CALL histdef2d(iff,o_s_oliqCL%flag,o_s_oliqCL%name, "Liq Water in BL", "kg/m2")
+!CALL histdef2d(iff,o_s_cteiCL%flag,o_s_cteiCL%name, "Instability criteria(ABL)", "K")
+!CALL histdef2d(iff,o_s_trmb1%flag,o_s_trmb1%name, "deep_cape(HBTM2)", "J/m2")
+!CALL histdef2d(iff,o_s_trmb2%flag,o_s_trmb2%name, "inhibition (HBTM2)", "J/m2")
+!CALL histdef2d(iff,o_s_trmb3%flag,o_s_trmb3%name, "Point Omega (HBTM2)", "m")
 
 ! Champs interpolles sur des niveaux de pression
@@ -1040,5 +1044,5 @@
  CALL histdef2d(iff,o_vSTDlevs(ilev)%flag,o_vSTDlevs(ilev)%name,"Meridional wind "//bb2//"mb", "m/s")
  CALL histdef2d(iff,o_wSTDlevs(ilev)%flag,o_wSTDlevs(ilev)%name,"Vertical wind "//bb2//"mb", "Pa/s")
- CALL histdef2d(iff,o_phiSTDlevs(ilev)%flag,o_phiSTDlevs(ilev)%name,"Geopotential "//bb2//"mb", "m")
+ CALL histdef2d(iff,o_zSTDlevs(ilev)%flag,o_zSTDlevs(ilev)%name,"Geopotential height "//bb2//"mb", "m")
  CALL histdef2d(iff,o_qSTDlevs(ilev)%flag,o_qSTDlevs(ilev)%name,"Specific humidity "//bb2//"mb", "kg/kg" )
  CALL histdef2d(iff,o_tSTDlevs(ilev)%flag,o_tSTDlevs(ilev)%name,"Temperature "//bb2//"mb", "K")
@@ -1097,6 +1101,6 @@
  CALL histdef3d(iff,o_temp%flag,o_temp%name, "Air temperature", "K" )
  CALL histdef3d(iff,o_theta%flag,o_theta%name, "Potential air temperature", "K" )
- CALL histdef3d(iff,o_ovap%flag,o_ovap%name, "Specific humidity + dqphy", "kg/kg" )
- CALL histdef3d(iff,o_ovapinit%flag,o_ovapinit%name, "Specific humidity", "kg/kg" )
+ CALL histdef3d(iff,o_ovap%flag,o_ovap%name, "Specific humidity", "kg/kg" )
+ CALL histdef3d(iff,o_ovapinit%flag,o_ovapinit%name, "Specific humidity (begin of timestep)", "kg/kg" )
  CALL histdef3d(iff,o_geop%flag,o_geop%name, "Geopotential height", "m2/s2")
  CALL histdef3d(iff,o_vitu%flag,o_vitu%name, "Zonal wind", "m/s" )
@@ -1195,8 +1199,9 @@
  CALL histdef3d(iff,o_a_th%flag,o_a_th%name, "Thermal plume fraction", "")
  CALL histdef3d(iff,o_d_th%flag,o_d_th%name, "Thermal plume detrainment", "K/s")
-endif !iflag_thermals.gt.1
+!IM endif !iflag_thermals.gt.1
  CALL histdef2d(iff,o_f0_th%flag,o_f0_th%name, "Thermal closure mass flux", "K/s")
  CALL histdef2d(iff,o_zmax_th%flag,o_zmax_th%name, "Thermal plume height", "K/s")
  CALL histdef3d(iff,o_dqthe%flag,o_dqthe%name, "Dry adjust. dQ", "(kg/kg)/s")
+endif !iflag_thermals.gt.1
  CALL histdef3d(iff,o_dtajs%flag,o_dtajs%name, "Dry adjust. dT", "K/s")
  CALL histdef3d(iff,o_dqajs%flag,o_dqajs%name, "Dry adjust. dQ", "(kg/kg)/s")
