Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_mod.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_mod.F90	(revision 1082)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_mod.F90	(revision 1083)
@@ -12,5 +12,6 @@
   IMPLICIT NONE
 
-  private histdef2d, histdef3d
+  private histdef2d, histdef3d, conf_physoutputs
+
 
    integer, parameter                           :: nfiles = 5
@@ -27,5 +28,5 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !! Definition pour chaque variable du niveau d ecriture dans chaque fichier
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/ histmth, histday, histhf, histins /)!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/ histmth, histday, histhf, histins /),'!!!!!!!!!!!!
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
@@ -33,138 +34,199 @@
   integer, private:: levmax(nfiles)
 
+  TYPE ctrl_out
+   integer,dimension(5) :: flag
+   character(len=20)     :: name
+  END TYPE ctrl_out
+
+
 !!! 1D
-  integer, dimension(nfiles) , save :: flag_phis         = (/ 1, 1, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_aire         = (/ 1, 1, 10,  1, 1 /)
-  integer, dimension(nfiles) , save :: flag_contfracATM  = (/ 10, 1,  1, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_contfracOR   = (/ 10, 1,  1, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_aireTER      = (/ 10, 10, 1, 10, 10 /)
+  type(ctrl_out) :: o_phis         = ctrl_out((/ 1, 1, 10, 1, 1 /), 'phis') 
+  type(ctrl_out) :: o_aire         = ctrl_out((/ 1, 1, 10,  1, 1 /),'aire')
+  type(ctrl_out) :: o_contfracATM  = ctrl_out((/ 10, 1,  1, 10, 10 /),'contfracATM')
+  type(ctrl_out) :: o_contfracOR   = ctrl_out((/ 10, 1,  1, 10, 10 /),'contfracOR')
+  type(ctrl_out) :: o_aireTER      = ctrl_out((/ 10, 10, 1, 10, 10 /),'aireTER')
   
 !!! 2D
-  integer, dimension(nfiles) , save :: flag_flat         = (/ 10, 1, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_slp          = (/ 1, 1, 1, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_tsol         = (/ 1, 1, 1, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_t2m          = (/ 1, 1, 1, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_t2m_min      = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_t2m_max      = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_t2m_sol      = (/ 10, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wind10m      = (/ 1, 1, 1, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wind10max    = (/ 10, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_sicf         = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_q2m          = (/ 1, 1, 1, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_u10m         = (/ 1, 1, 1, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_v10m         = (/ 1, 1, 1, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_psol         = (/ 1, 1, 1, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_qsurf        = (/ 1, 10, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_u10m_sol     = (/ 10, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_v10m_sol     = (/ 10, 4, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_qsol         = (/ 1, 10, 10, 1, 1 /)
-
-  integer, dimension(nfiles),save   :: flag_ndayrain     = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles),save   :: flag_precip       = (/ 1, 1, 1, 1, 1 /)
-  integer,  dimension(nfiles), save :: flag_plul         = (/ 1, 1, 1, 1, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_pluc         = (/ 1, 1, 1, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_snow         = (/ 1, 1, 10, 1, 10 /) 
-  integer, dimension(nfiles) , save :: flag_evap         = (/ 1, 1, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_tops         = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tops0        = (/ 1, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_topl         = (/ 1, 1, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_topl0        = (/ 1, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWupTOA      = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWupTOAclr   = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWdnTOA      = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWdnTOAclr   = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWup200      = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWup200clr   = (/ 10, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWdn200      = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWdn200clr   = (/ 10, 1, 10, 10, 10 /)
+  type(ctrl_out) :: o_flat         = ctrl_out((/ 10, 1, 10, 10, 1 /),'flat')
+  type(ctrl_out) :: o_slp          = ctrl_out((/ 1, 1, 1, 10, 1 /),'slp')
+  type(ctrl_out) :: o_tsol         = ctrl_out((/ 1, 1, 1, 1, 1 /),'tsol')
+  type(ctrl_out) :: o_t2m          = ctrl_out((/ 1, 1, 1, 1, 1 /),'t2m')
+  type(ctrl_out) :: o_t2m_min      = ctrl_out((/ 1, 1, 10, 10, 10 /),'t2m_min')
+  type(ctrl_out) :: o_t2m_max      = ctrl_out((/ 1, 1, 10, 10, 10 /),'t2m_max')
+  type(ctrl_out),dimension(4) :: o_t2m_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_ter'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_lic'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_oce'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_sic') /)
+
+  type(ctrl_out) :: o_wind10m      = ctrl_out((/ 1, 1, 1, 10, 10 /),'wind10m')
+  type(ctrl_out) :: o_wind10max    = ctrl_out((/ 10, 1, 10, 10, 10 /),'wind10max')
+  type(ctrl_out) :: o_sicf         = ctrl_out((/ 1, 1, 10, 10, 10 /),'sicf')
+  type(ctrl_out) :: o_q2m          = ctrl_out((/ 1, 1, 1, 1, 1 /),'q2m')
+  type(ctrl_out) :: o_u10m         = ctrl_out((/ 1, 1, 1, 1, 1 /),'u10m')
+  type(ctrl_out) :: o_v10m         = ctrl_out((/ 1, 1, 1, 1, 1 /),'v10m')
+  type(ctrl_out) :: o_psol         = ctrl_out((/ 1, 1, 1, 1, 1 /),'psol')
+  type(ctrl_out) :: o_qsurf        = ctrl_out((/ 1, 10, 10, 10, 10 /),'qsurf')
+
+  type(ctrl_out),dimension(4) :: o_u10m_srf     = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_ter'), &
+                                              ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_lic'), &
+                                              ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_oce'), &
+                                              ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_sic') /)
+
+  type(ctrl_out),dimension(4) :: o_v10m_srf     = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_ter'), &
+                                              ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_lic'), &
+                                              ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_oce'), &
+                                              ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_sic') /)
+
+  type(ctrl_out) :: o_qsol         = ctrl_out((/ 1, 10, 10, 1, 1 /),'qsol')
+
+  type(ctrl_out) :: o_ndayrain     = ctrl_out((/ 1, 10, 10, 10, 10 /),'ndayrain')
+  type(ctrl_out) :: o_precip       = ctrl_out((/ 1, 1, 1, 1, 1 /),'precip')
+  type(ctrl_out) :: o_plul         = ctrl_out((/ 1, 1, 1, 1, 10 /),'plul')
+
+  type(ctrl_out) :: o_pluc         = ctrl_out((/ 1, 1, 1, 1, 10 /),'pluc')
+  type(ctrl_out) :: o_snow         = ctrl_out((/ 1, 1, 10, 1, 10 /),'snow') 
+  type(ctrl_out) :: o_evap         = ctrl_out((/ 1, 1, 10, 1, 10 /),'evap')
+  type(ctrl_out) :: o_tops         = ctrl_out((/ 1, 1, 10, 10, 10 /),'tops')
+  type(ctrl_out) :: o_tops0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'tops0')
+  type(ctrl_out) :: o_topl         = ctrl_out((/ 1, 1, 10, 1, 10 /),'topl')
+  type(ctrl_out) :: o_topl0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'topl0')
+  type(ctrl_out) :: o_SWupTOA      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupTOA')
+  type(ctrl_out) :: o_SWupTOAclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupTOAclr')
+  type(ctrl_out) :: o_SWdnTOA      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnTOA')
+  type(ctrl_out) :: o_SWdnTOAclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnTOAclr')
+  type(ctrl_out) :: o_SWup200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'SWup200')
+  type(ctrl_out) :: o_SWup200clr   = ctrl_out((/ 10, 1, 10, 10, 10 /),'SWup200clr')
+  type(ctrl_out) :: o_SWdn200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'SWdn200')
+  type(ctrl_out) :: o_SWdn200clr   = ctrl_out((/ 10, 1, 10, 10, 10 /),'SWdn200clr')
 
 ! arajouter
-!  integer, dimension(nfiles) , save :: flag_LWupTOA     = (/ 1, 4, 10, 10, 10 /)
-!  integer, dimension(nfiles) , save :: flag_LWupTOAclr  = (/ 1, 4, 10, 10, 10 /)
-!  integer, dimension(nfiles) , save :: flag_LWdnTOA     = (/ 1, 4, 10, 10, 10 /)
-!  integer, dimension(nfiles) , save :: flag_LWdnTOAclr  = (/ 1, 4, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_LWup200      = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWup200clr   = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWdn200      = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWdn200clr   = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_sols         = (/ 1, 1, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_sols0        = (/ 1, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_soll         = (/ 1, 1, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_soll0        = (/ 1, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_radsol       = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWupSFC      = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWupSFCclr   = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWdnSFC      = (/ 1, 1, 10, 10, 10 /) 
-  integer, dimension(nfiles) , save :: flag_SWdnSFCclr   = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWupSFC      = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWupSFCclr   = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWdnSFC      = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWdnSFCclr   = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_bils         = (/ 1, 2, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_sens         = (/ 1, 1, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_fder         = (/ 1, 2, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_ffonte       = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_fqcalving    = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_fqfonte      = (/ 1, 10, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_taux_sol     = (/ 1, 4, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_tauy_sol     = (/ 1, 4, 10, 1, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_pourc_sol    = (/ 1, 4, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_fract_sol    = (/ 1, 4, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_tsol_sol     = (/ 1, 4, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_sens_sol     = (/ 1, 4, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_lat_sol      = (/ 1, 4, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_flw_sol      = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_fsw_sol      = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wbils_sol    = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wbilo_sol    = (/ 1, 10, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_cdrm         = (/ 1, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_cdrh         = (/ 1, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_cldl         = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_cldm         = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_cldh         = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_cldt         = (/ 1, 1, 2, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_cldq         = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_lwp          = (/ 1, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_iwp          = (/ 1, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ue           = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ve           = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_uq           = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_vq           = (/ 1, 10, 10, 10, 10 /)
+!  type(ctrl_out) :: o_LWupTOA     = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupTOA')
+!  type(ctrl_out) :: o_LWupTOAclr  = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupTOAclr')
+!  type(ctrl_out) :: o_LWdnTOA     = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnTOA')
+!  type(ctrl_out) :: o_LWdnTOAclr  = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnTOAclr')
+
+  type(ctrl_out) :: o_LWup200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWup200')
+  type(ctrl_out) :: o_LWup200clr   = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWup200clr')
+  type(ctrl_out) :: o_LWdn200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWdn200')
+  type(ctrl_out) :: o_LWdn200clr   = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWdn200clr')
+  type(ctrl_out) :: o_sols         = ctrl_out((/ 1, 1, 10, 1, 10 /),'sols')
+  type(ctrl_out) :: o_sols0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'sols0')
+  type(ctrl_out) :: o_soll         = ctrl_out((/ 1, 1, 10, 1, 10 /),'soll')
+  type(ctrl_out) :: o_soll0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'soll0')
+  type(ctrl_out) :: o_radsol       = ctrl_out((/ 1, 1, 10, 10, 10 /),'radsol')
+  type(ctrl_out) :: o_SWupSFC      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupSFC')
+  type(ctrl_out) :: o_SWupSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupSFCclr')
+  type(ctrl_out) :: o_SWdnSFC      = ctrl_out((/ 1, 1, 10, 10, 10 /),'SWdnSFC') 
+  type(ctrl_out) :: o_SWdnSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnSFCclr')
+  type(ctrl_out) :: o_LWupSFC      = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupSFC')
+  type(ctrl_out) :: o_LWupSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupSFCclr')
+  type(ctrl_out) :: o_LWdnSFC      = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnSFC')
+  type(ctrl_out) :: o_LWdnSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnSFCclr')
+  type(ctrl_out) :: o_bils         = ctrl_out((/ 1, 2, 10, 1, 10 /),'bils')
+  type(ctrl_out) :: o_sens         = ctrl_out((/ 1, 1, 10, 1, 1 /),'sens')
+  type(ctrl_out) :: o_fder         = ctrl_out((/ 1, 2, 10, 1, 10 /),'fder')
+  type(ctrl_out) :: o_ffonte       = ctrl_out((/ 1, 10, 10, 10, 10 /),'ffonte')
+  type(ctrl_out) :: o_fqcalving    = ctrl_out((/ 1, 10, 10, 10, 10 /),'fqcalving')
+  type(ctrl_out) :: o_fqfonte      = ctrl_out((/ 1, 10, 10, 10, 10 /),'fqfonte')
+
+  type(ctrl_out),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),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),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),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),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),dimension(4) :: o_sens_srf     = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_ter'), &
+                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_lic'), &
+                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_oce'), &
+                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_sic') /)
+
+  type(ctrl_out),dimension(4) :: o_lat_srf      = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_ter'), &
+                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_lic'), &
+                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_oce'), &
+                                                 ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_sic') /)
+
+  type(ctrl_out),dimension(4) :: o_flw_srf      = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_ter'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_lic'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_oce'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_sic') /)
+                                                 
+  type(ctrl_out),dimension(4) :: o_fsw_srf      = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_ter'), &
+                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_lic'), &
+                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_oce'), &
+                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_sic') /)
+
+  type(ctrl_out),dimension(4) :: o_wbils_srf    = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_ter'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_lic'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_oce'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_sic') /)
+
+  type(ctrl_out),dimension(4) :: o_wbilo_srf    = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_ter'), &
+                                                     ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_lic'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_oce'), &
+                                                 ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_sic') /)
+
+
+  type(ctrl_out) :: o_cdrm         = ctrl_out((/ 1, 10, 10, 1, 10 /),'cdrm')
+  type(ctrl_out) :: o_cdrh         = ctrl_out((/ 1, 10, 10, 1, 10 /),'cdrh')
+  type(ctrl_out) :: o_cldl         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldl')
+  type(ctrl_out) :: o_cldm         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldm')
+  type(ctrl_out) :: o_cldh         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldh')
+  type(ctrl_out) :: o_cldt         = ctrl_out((/ 1, 1, 2, 10, 10 /),'cldt')
+  type(ctrl_out) :: o_cldq         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldq')
+  type(ctrl_out) :: o_lwp          = ctrl_out((/ 1, 5, 10, 10, 10 /),'lwp')
+  type(ctrl_out) :: o_iwp          = ctrl_out((/ 1, 5, 10, 10, 10 /),'iwp')
+  type(ctrl_out) :: o_ue           = ctrl_out((/ 1, 10, 10, 10, 10 /),'ue')
+  type(ctrl_out) :: o_ve           = ctrl_out((/ 1, 10, 10, 10, 10 /),'ve')
+  type(ctrl_out) :: o_uq           = ctrl_out((/ 1, 10, 10, 10, 10 /),'uq')
+  type(ctrl_out) :: o_vq           = ctrl_out((/ 1, 10, 10, 10, 10 /),'vq')
  
-  integer, dimension(nfiles) , save :: flag_cape         = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_pbase        = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ptop         = (/ 1, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_fbase        = (/ 1, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_prw          = (/ 1, 1, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_s_pblh       = (/ 1, 10, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_s_pblt       = (/ 1, 10, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_s_lcl       = (/ 1, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_s_capCL      = (/ 1, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_s_oliqCL    = (/ 1, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_s_cteiCL     = (/ 1, 10, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_s_therm      = (/ 1, 10, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_s_trmb1      = (/ 1, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_s_trmb2      = (/ 1, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_s_trmb3      = (/ 1, 10, 10, 1, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_slab_bils    = (/ 1, 1, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_ale_bl    = (/ 1, 1, 1, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_alp_bl    = (/ 1, 1, 1, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_ale_wk    = (/ 1, 1, 1, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_alp_wk    = (/ 1, 1, 1, 1, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_ale       = (/ 1, 1, 1, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_alp       = (/ 1, 1, 1, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_cin       = (/ 1, 1, 1, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_wape       = (/ 1, 1, 1, 1, 10 /)
+  type(ctrl_out) :: o_cape         = ctrl_out((/ 1, 10, 10, 10, 10 /),'cape')
+  type(ctrl_out) :: o_pbase        = ctrl_out((/ 1, 10, 10, 10, 10 /),'pbase')
+  type(ctrl_out) :: o_ptop         = ctrl_out((/ 1, 4, 10, 10, 10 /),'ptop')
+  type(ctrl_out) :: o_fbase        = ctrl_out((/ 1, 10, 10, 10, 10 /),'fbase')
+  type(ctrl_out) :: o_prw          = ctrl_out((/ 1, 1, 10, 10, 10 /),'prw')
+
+  type(ctrl_out) :: o_s_pblh       = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_pblh')
+  type(ctrl_out) :: o_s_pblt       = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_pblt')
+  type(ctrl_out) :: o_s_lcl        = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_lcl')
+  type(ctrl_out) :: o_s_capCL      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_capCL')
+  type(ctrl_out) :: o_s_oliqCL     = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_oliqCL')
+  type(ctrl_out) :: o_s_cteiCL     = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_cteiCL')
+  type(ctrl_out) :: o_s_therm      = ctrl_out((/ 1, 10, 10, 1, 1 /),'s_therm')
+  type(ctrl_out) :: o_s_trmb1      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_trmb1')
+  type(ctrl_out) :: o_s_trmb2      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_trmb2')
+  type(ctrl_out) :: o_s_trmb3      = ctrl_out((/ 1, 10, 10, 1, 10 /),'s_trmb3')
+
+  type(ctrl_out) :: o_slab_bils    = ctrl_out((/ 1, 1, 10, 10, 10 /),'slab_bils_oce')
+
+  type(ctrl_out) :: o_ale_bl       = ctrl_out((/ 1, 1, 1, 1, 10 /),'ale_bl')
+  type(ctrl_out) :: o_alp_bl       = ctrl_out((/ 1, 1, 1, 1, 10 /),'alp_bl')
+  type(ctrl_out) :: o_ale_wk       = ctrl_out((/ 1, 1, 1, 1, 10 /),'ale_wk')
+  type(ctrl_out) :: o_alp_wk       = ctrl_out((/ 1, 1, 1, 1, 10 /),'alp_wk')
+
+  type(ctrl_out) :: o_ale          = ctrl_out((/ 1, 1, 1, 1, 10 /),'ale')
+  type(ctrl_out) :: o_alp          = ctrl_out((/ 1, 1, 1, 1, 10 /),'alp')
+  type(ctrl_out) :: o_cin          = ctrl_out((/ 1, 1, 1, 1, 10 /),'cin')
+  type(ctrl_out) :: o_wape         = ctrl_out((/ 1, 1, 1, 1, 10 /),'wape')
 
 
@@ -177,131 +239,184 @@
 !      on ecrit ph  a 500   au niv 3
 
-  integer, dimension(nfiles) , save :: flag_ulevsSTD     = (/ 1, 1, 3, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_vlevsSTD     = (/ 1, 1, 3, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wlevsSTD     = (/ 1, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tlevsSTD     = (/ 10, 10, 3, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_qlevsSTD     = (/ 10, 10, 3, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_philevsSTD   = (/ 1, 1, 1, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_t_oce_sic    = (/ 1, 10, 10, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_weakinv      = (/ 10, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dthmin       = (/ 10, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_u10_sol      = (/ 10, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_v10_sol      = (/ 10, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_cldtau       = (/ 10, 5, 10, 10, 10 /)                     
-  integer, dimension(nfiles) , save :: flag_cldemi       = (/ 10, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_rh2m         = (/ 10, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_qsat2m       = (/ 10, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tpot         = (/ 10, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tpote        = (/ 10, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tke          = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tke_max      = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tke_sol      = (/ 10, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_tke_max_sol  = (/ 10, 4, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_kz           = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_kz_max       = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWnetOR      = (/ 10, 10, 2, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_SWdownOR     = (/ 10, 10, 2, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_LWdownOR     = (/ 10, 10, 2, 10, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_snowl         = (/ 10, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_cape_max      = (/ 10, 1, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_solldown      = (/ 10, 1, 10, 1, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_dtsvdfo       = (/ 10, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtsvdft       = (/ 10, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtsvdfg       = (/ 10, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtsvdfi       = (/ 10, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_rugs          = (/ 10, 10, 10, 1, 1 /)
+                                              
+  type(ctrl_out),dimension(4) :: o_uSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'u850'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'u700'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'u500'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'u200') /) 
+
+  type(ctrl_out),dimension(4) :: o_vSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'v850'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'v700'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'v500'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'v200') /)
+
+  type(ctrl_out),dimension(4) :: o_wSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'w850'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'w700'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'w500'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'w200') /)
+
+  type(ctrl_out),dimension(4) :: o_tSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'t850'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'t700'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'t500'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'t200') /)
+
+  type(ctrl_out),dimension(4) :: o_qSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'q850'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'q700'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'q500'), &
+                                                     ctrl_out((/ 1, 1, 3, 10, 10 /),'q200') /)
+
+  type(ctrl_out),dimension(4) :: 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') /)
+
+
+  type(ctrl_out) :: o_t_oce_sic    = ctrl_out((/ 1, 10, 10, 10, 10 /),'t_oce_sic')
+
+  type(ctrl_out) :: o_weakinv      = ctrl_out((/ 10, 1, 10, 10, 10 /),'weakinv')
+  type(ctrl_out) :: o_dthmin       = ctrl_out((/ 10, 1, 10, 10, 10 /),'dthmin')
+  type(ctrl_out),dimension(4) :: o_u10_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_ter'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_lic'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_oce'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_sic') /)
+
+  type(ctrl_out),dimension(4) :: o_v10_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_ter'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_lic'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_oce'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_sic') /)
+  type(ctrl_out) :: o_cldtau       = ctrl_out((/ 10, 5, 10, 10, 10 /),'cldtau')                     
+  type(ctrl_out) :: o_cldemi       = ctrl_out((/ 10, 5, 10, 10, 10 /),'cldemi')
+  type(ctrl_out) :: o_rh2m         = ctrl_out((/ 10, 5, 10, 10, 10 /),'rh2m')
+  type(ctrl_out) :: o_qsat2m       = ctrl_out((/ 10, 5, 10, 10, 10 /),'qsat2m')
+  type(ctrl_out) :: o_tpot         = ctrl_out((/ 10, 5, 10, 10, 10 /),'tpot')
+  type(ctrl_out) :: o_tpote        = ctrl_out((/ 10, 5, 10, 10, 10 /),'tpote')
+  type(ctrl_out) :: o_tke          = ctrl_out((/ 4, 10, 10, 10, 10 /),'tke ')
+  type(ctrl_out) :: o_tke_max      = ctrl_out((/ 4, 10, 10, 10, 10 /),'tke_max')
+  type(ctrl_out),dimension(4) :: o_tke_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_ter'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_lic'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_oce'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_sic') /)
+
+  type(ctrl_out),dimension(4) :: o_tke_max_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_ter'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_lic'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_oce'), &
+                                                 ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_sic') /)
+
+  type(ctrl_out) :: o_kz           = ctrl_out((/ 4, 10, 10, 10, 10 /),'kz')
+  type(ctrl_out) :: o_kz_max       = ctrl_out((/ 4, 10, 10, 10, 10 /),'kz_max')
+  type(ctrl_out) :: o_SWnetOR      = ctrl_out((/ 10, 10, 2, 10, 10 /),'SWnetOR')
+  type(ctrl_out) :: o_SWdownOR     = ctrl_out((/ 10, 10, 2, 10, 10 /),'SWdownOR')
+  type(ctrl_out) :: o_LWdownOR     = ctrl_out((/ 10, 10, 2, 10, 10 /),'LWdownOR')
+
+  type(ctrl_out) :: o_snowl        = ctrl_out((/ 10, 1, 10, 10, 10 /),'snowl')
+  type(ctrl_out) :: o_cape_max     = ctrl_out((/ 10, 1, 10, 10, 10 /),'cape_max')
+  type(ctrl_out) :: o_solldown     = ctrl_out((/ 10, 1, 10, 1, 10 /),'solldown')
+
+  type(ctrl_out) :: o_dtsvdfo      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdfo')
+  type(ctrl_out) :: o_dtsvdft      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdft')
+  type(ctrl_out) :: o_dtsvdfg      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdfg')
+  type(ctrl_out) :: o_dtsvdfi      = ctrl_out((/ 10, 10, 10, 1, 10 /),'dtsvdfi')
+  type(ctrl_out) :: o_rugs         = ctrl_out((/ 10, 10, 10, 1, 1 /),'rugs')
 
 !!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
-  integer, dimension(nfiles) , save :: flag_lwcon        = (/ 2, 5, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_iwcon        = (/ 2, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_temp         = (/ 2, 3, 4, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_theta         = (/ 2, 3, 4, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_ovap         = (/ 2, 3, 4, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_wvapp        = (/ 2, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_geop         = (/ 2, 3, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_vitu         = (/ 2, 3, 4, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_vitv         = (/ 2, 3, 4, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_vitw         = (/ 2, 3, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_pres         = (/ 2, 3, 10, 1, 1 /)
-  integer, dimension(nfiles) , save :: flag_rneb         = (/ 2, 5, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_rnebcon      = (/ 2, 5, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_rhum         = (/ 2, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ozone        = (/ 2, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_upwd         = (/ 2, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtphy        = (/ 2, 10, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_dqphy        = (/ 2, 10, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_pr_con_l     = (/ 2, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_pr_con_i     = (/ 2, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_pr_lsc_l     = (/ 2, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_pr_lsc_i     = (/ 2, 10, 10, 10, 10 /)
+  type(ctrl_out) :: o_lwcon        = ctrl_out((/ 2, 5, 10, 10, 1 /),'lwcon')
+  type(ctrl_out) :: o_iwcon        = ctrl_out((/ 2, 5, 10, 10, 10 /),'iwcon')
+  type(ctrl_out) :: o_temp         = ctrl_out((/ 2, 3, 4, 1, 1 /),'temp')
+  type(ctrl_out) :: o_theta        = ctrl_out((/ 2, 3, 4, 1, 1 /),'theta')
+  type(ctrl_out) :: o_ovap         = ctrl_out((/ 2, 3, 4, 1, 1 /),'ovap')
+  type(ctrl_out) :: o_wvapp        = ctrl_out((/ 2, 10, 10, 10, 10 /),'wvapp')
+  type(ctrl_out) :: o_geop         = ctrl_out((/ 2, 3, 10, 1, 1 /),'geop')
+  type(ctrl_out) :: o_vitu         = ctrl_out((/ 2, 3, 4, 1, 1 /),'vitu')
+  type(ctrl_out) :: o_vitv         = ctrl_out((/ 2, 3, 4, 1, 1 /),'vitv')
+  type(ctrl_out) :: o_vitw         = ctrl_out((/ 2, 3, 10, 10, 1 /),'vitw')
+  type(ctrl_out) :: o_pres         = ctrl_out((/ 2, 3, 10, 1, 1 /),'pres')
+  type(ctrl_out) :: o_rneb         = ctrl_out((/ 2, 5, 10, 10, 1 /),'rneb')
+  type(ctrl_out) :: o_rnebcon      = ctrl_out((/ 2, 5, 10, 10, 1 /),'rnebcon')
+  type(ctrl_out) :: o_rhum         = ctrl_out((/ 2, 10, 10, 10, 10 /),'rhum')
+  type(ctrl_out) :: o_ozone        = ctrl_out((/ 2, 10, 10, 10, 10 /),'ozone')
+  type(ctrl_out) :: o_upwd         = ctrl_out((/ 2, 10, 10, 10, 10 /),'upwd')
+  type(ctrl_out) :: o_dtphy        = ctrl_out((/ 2, 10, 10, 10, 1 /),'dtphy')
+  type(ctrl_out) :: o_dqphy        = ctrl_out((/ 2, 10, 10, 10, 1 /),'dqphy')
+  type(ctrl_out) :: o_pr_con_l     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_con_l')
+  type(ctrl_out) :: o_pr_con_i     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_con_i')
+  type(ctrl_out) :: o_pr_lsc_l     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_lsc_l')
+  type(ctrl_out) :: o_pr_lsc_i     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_lsc_i')
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-  integer, dimension(nfiles) , save :: flag_albe_sol     = (/ 3, 4, 10, 1, 10 /) 
-  integer, dimension(nfiles) , save :: flag_ages_sol     = (/ 3, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_rugs_sol     = (/ 3, 4, 10, 1, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_albs         = (/ 3, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_albslw       = (/ 3, 10, 10, 1, 10 /)
-
-  integer, dimension(nfiles) , save :: flag_clwcon       = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_Ma           = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dnwd         = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dnwd0        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtdyn        = (/ 4, 10, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_dqdyn        = (/ 4, 10, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_dudyn        = (/ 4, 10, 10, 10, 1 /) !AXC
-  integer, dimension(nfiles) , save :: flag_dvdyn        = (/ 4, 10, 10, 10, 1 /) !AXC
-  integer, dimension(nfiles) , save :: flag_dtcon        = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ducon        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dqcon        = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtwak        = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dqwak        = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wake_h       = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wake_s       = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wake_deltat  = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wake_deltaq  = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_wake_omg     = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_Vprecip      = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ftd          = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_fqd          = (/ 4, 5, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtlsc        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtlschr      = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dqlsc        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtvdf        = (/ 4, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_dqvdf        = (/ 4, 10, 10, 1, 10 /)
-  integer, dimension(nfiles) , save :: flag_dteva        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dqeva        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ptconv       = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_ratqs        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtthe        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_f_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_e_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_w_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_lambda_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_q_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_a_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_d_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_f0_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_zmax_th        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dqthe        = (/ 4, 10, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_dtajs        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dqajs        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtswr        = (/ 4, 10, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_dtsw0        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtlwr        = (/ 4, 10, 10, 10, 1 /)
-  integer, dimension(nfiles) , save :: flag_dtlw0        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dtec         = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_duvdf        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dvvdf        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_duoro        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dvoro        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dulif        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_dvlif        = (/ 4, 10, 10, 10, 10 /)
-  integer, dimension(nfiles) , save :: flag_trac         = (/ 4, 10, 10, 10, 10 /)
-
+  type(ctrl_out),dimension(4) :: o_albe_srf     = (/ ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_ter'), &
+                                                 ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_lic'), &
+                                                 ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_oce'), &
+                                                 ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_sic') /) 
+
+  type(ctrl_out),dimension(4) :: o_ages_srf     = (/ ctrl_out((/ 3, 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((/ 3, 10, 10, 10, 10 /),'ages_sic') /)
+
+  type(ctrl_out),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) :: o_albs         = ctrl_out((/ 3, 10, 10, 1, 10 /),'albs')
+  type(ctrl_out) :: o_albslw       = ctrl_out((/ 3, 10, 10, 1, 10 /),'albslw')
+
+  type(ctrl_out) :: o_clwcon       = ctrl_out((/ 4, 10, 10, 10, 10 /),'clwcon')
+  type(ctrl_out) :: o_Ma           = ctrl_out((/ 4, 10, 10, 10, 10 /),'Ma')
+  type(ctrl_out) :: o_dnwd         = ctrl_out((/ 4, 10, 10, 10, 10 /),'dnwd')
+  type(ctrl_out) :: o_dnwd0        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dnwd0')
+  type(ctrl_out) :: o_dtdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dtdyn')
+  type(ctrl_out) :: o_dqdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dqdyn')
+  type(ctrl_out) :: o_dudyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dudyn')  !AXC
+  type(ctrl_out) :: o_dvdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dvdyn')  !AXC
+  type(ctrl_out) :: o_dtcon        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dtcon')
+  type(ctrl_out) :: o_ducon        = ctrl_out((/ 4, 10, 10, 10, 10 /),'ducon')
+  type(ctrl_out) :: o_dqcon        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dqcon')
+  type(ctrl_out) :: o_dtwak        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dtwak')
+  type(ctrl_out) :: o_dqwak        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dqwak')
+  type(ctrl_out) :: o_wake_h       = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_h')
+  type(ctrl_out) :: o_wake_s       = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_s')
+  type(ctrl_out) :: o_wake_deltat  = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_deltat')
+  type(ctrl_out) :: o_wake_deltaq  = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_deltaq')
+  type(ctrl_out) :: o_wake_omg     = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_omg')
+  type(ctrl_out) :: o_Vprecip      = ctrl_out((/ 10, 10, 10, 10, 10 /),'Vprecip')
+  type(ctrl_out) :: o_ftd          = ctrl_out((/ 4, 5, 10, 10, 10 /),'ftd')
+  type(ctrl_out) :: o_fqd          = ctrl_out((/ 4, 5, 10, 10, 10 /),'fqd')
+  type(ctrl_out) :: o_dtlsc        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlsc')
+  type(ctrl_out) :: o_dtlschr      = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlschr')
+  type(ctrl_out) :: o_dqlsc        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqlsc')
+  type(ctrl_out) :: o_dtvdf        = ctrl_out((/ 4, 10, 10, 1, 10 /),'dtvdf')
+  type(ctrl_out) :: o_dqvdf        = ctrl_out((/ 4, 10, 10, 1, 10 /),'dqvdf')
+  type(ctrl_out) :: o_dteva        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dteva')
+  type(ctrl_out) :: o_dqeva        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqeva')
+  type(ctrl_out) :: o_ptconv       = ctrl_out((/ 4, 10, 10, 10, 10 /),'ptconv')
+  type(ctrl_out) :: o_ratqs        = ctrl_out((/ 4, 10, 10, 10, 10 /),'ratqs')
+  type(ctrl_out) :: o_dtthe        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtthe')
+  type(ctrl_out) :: o_f_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'f_th')
+  type(ctrl_out) :: o_e_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'e_th')
+  type(ctrl_out) :: o_w_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'w_th')
+  type(ctrl_out) :: o_lambda_th    = ctrl_out((/ 4, 10, 10, 10, 10 /),'lambda_th')
+  type(ctrl_out) :: o_q_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'q_th')
+  type(ctrl_out) :: o_a_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'a_th')
+  type(ctrl_out) :: o_d_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'d_th')
+  type(ctrl_out) :: o_f0_th        = ctrl_out((/ 4, 10, 10, 10, 10 /),'f0_th')
+  type(ctrl_out) :: o_zmax_th      = ctrl_out((/ 4, 10, 10, 10, 10 /),'zmax_th')
+  type(ctrl_out) :: o_dqthe        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dqthe')
+  type(ctrl_out) :: o_dtajs        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtajs')
+  type(ctrl_out) :: o_dqajs        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqajs')
+  type(ctrl_out) :: o_dtswr        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dtswr')
+  type(ctrl_out) :: o_dtsw0        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtsw0')
+  type(ctrl_out) :: o_dtlwr        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dtlwr')
+  type(ctrl_out) :: o_dtlw0        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlw0')
+  type(ctrl_out) :: o_dtec         = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtec')
+  type(ctrl_out) :: o_duvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'duvdf')
+  type(ctrl_out) :: o_dvvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dvvdf')
+  type(ctrl_out) :: o_duoro        = ctrl_out((/ 4, 10, 10, 10, 10 /),'duoro')
+  type(ctrl_out) :: o_dvoro        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dvoro')
+  type(ctrl_out) :: o_dulif        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dulif')
+  type(ctrl_out) :: o_dvlif        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dvlif')
+
+! Attention a refaire correctement
+  type(ctrl_out),dimension(2) :: o_trac         = (/ ctrl_out((/ 4, 10, 10, 10, 10 /),'trac01'), &
+                                                     ctrl_out((/ 4, 10, 10, 10, 10 /),'trac02') /)
     CONTAINS
 
@@ -338,5 +453,5 @@
   real, dimension(klev)                 :: presnivs
   character(len=4), dimension(nlevSTD)  :: clevSTD
-  integer                               :: nsrf, k, iq, iiq, iff, i, j
+  integer                               :: nsrf, k, iq, iiq, iff, i, j, ilev
   logical                               :: ok_veget
   integer                               :: iflag_pbl
@@ -355,5 +470,5 @@
 !                 entre [lonmin_reg,lonmax_reg] et [latmin_reg,latmax_reg]
 
-  logical, dimension(nfiles), save  :: ok_reglim         = (/ .false., .false., .false., .false., .true. /) 
+  logical, dimension(nfiles), save  :: ok_reglim         = (/ .false., .false., .false., .false., .true. /)
   real, dimension(nfiles), save     :: lonmin_reg        = (/ 0., -45., 0., 0., -162. /)
   real, dimension(nfiles), save     :: lonmax_reg        = (/ 90., 45., 90., 90., -144. /)
@@ -456,17 +571,17 @@
 !     &                     nhorim, nid_hf3d)
 
-!         CALL histvert(nid_hf3d,"presnivs", &
-!     &                 "Vertical levels","mb", &
+!         CALL histvert(nid_hf3d, "presnivs", &
+!     &                 "Vertical levels", "mb", &
 !     &                 klev, presnivs/100., nvertm)
 !          ENDIF
 
 !!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- CALL histdef2d(iff,flag_phis,"phis","Surface geop.height","m2/s2") 
+ CALL histdef2d(iff,o_phis%flag,o_phis%name,"Surface geop.height", "m2/s2") 
    type_ecri(1) = 'once'
    type_ecri(2) = 'once'
    type_ecri(3) = 'once'
    type_ecri(4) = 'once'
- CALL histdef2d(iff,flag_aire,"aire","Grid area","-")
- CALL histdef2d(iff,flag_contfracATM,"contfracATM","% sfce ter+lic","-")
+ CALL histdef2d(iff,o_aire%flag,o_aire%name,"Grid area", "-")
+ CALL histdef2d(iff,o_contfracATM%flag,o_contfracATM%name,"% sfce ter+lic", "-")
    type_ecri(1) = 'ave(X)'
    type_ecri(2) = 'ave(X)'
@@ -475,125 +590,125 @@
 
 !!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- CALL histdef2d(iff,flag_contfracOR,"contfracOR","% sfce terre OR","-" )
- CALL histdef2d(iff,flag_aireTER,"aireTER","Grid area CONT","-" )
- CALL histdef2d(iff,flag_flat,"flat","Latent heat flux","W/m2")
- CALL histdef2d(iff,flag_slp,"slp","Sea Level Pressure", "Pa" )
- CALL histdef2d(iff,flag_tsol,"tsol","Surface Temperature", "K")
- CALL histdef2d( iff,flag_t2m,"t2m","Temperature 2m", "K" )
- CALL histdef2d(iff,flag_t2m_min,"t2m_min","Temp 2m min", "K" )
- CALL histdef2d(iff,flag_t2m_max,"t2m_max", "Temp 2m max", "K" )
- CALL histdef2d(iff,flag_wind10m,"wind10m","10-m wind speed","m/s")
- CALL histdef2d(iff,flag_wind10max,"wind10max","10m wind speed max","m/s")
- CALL histdef2d(iff,flag_sicf,"sicf","Sea-ice fraction", "-" )
- CALL histdef2d(iff,flag_q2m,"q2m","Specific humidity 2m", "kg/kg")
- CALL histdef2d(iff,flag_u10m,"u10m","Vent zonal 10m", "m/s" )
- CALL histdef2d(iff,flag_v10m,"v10m","Vent meridien 10m", "m/s")
- CALL histdef2d(iff,flag_psol,"psol","Surface Pressure","Pa" ) 
- CALL histdef2d(iff,flag_qsurf,"qsurf","Surface Air humidity", "kg/kg")
+ CALL histdef2d(iff,o_contfracOR%flag,o_contfracOR%name,"% sfce terre OR", "-" )
+ CALL histdef2d(iff,o_aireTER%flag,o_aireTER%name,"Grid area CONT", "-" )
+ CALL histdef2d(iff,o_flat%flag,o_flat%name, "Latent heat flux", "W/m2")
+ CALL histdef2d(iff,o_slp%flag,o_slp%name, "Sea Level Pressure", "Pa" )
+ CALL histdef2d(iff,o_tsol%flag,o_tsol%name, "Surface Temperature", "K")
+ CALL histdef2d(iff,o_t2m%flag,o_t2m%name, "Temperature 2m", "K" )
+ CALL histdef2d(iff,o_t2m_min%flag,o_t2m_min%name, "Temp 2m min", "K" )
+ CALL histdef2d(iff,o_t2m_max%flag,o_t2m_max%name, "Temp 2m max", "K" )
+ CALL histdef2d(iff,o_wind10m%flag,o_wind10m%name, "10-m wind speed", "m/s")
+ CALL histdef2d(iff,o_wind10max%flag,o_wind10max%name, "10m wind speed max", "m/s")
+ CALL histdef2d(iff,o_sicf%flag,o_sicf%name, "Sea-ice fraction", "-" )
+ CALL histdef2d(iff,o_q2m%flag,o_q2m%name, "Specific humidity 2m", "kg/kg")
+ CALL histdef2d(iff,o_u10m%flag,o_u10m%name, "Vent zonal 10m", "m/s" )
+ CALL histdef2d(iff,o_v10m%flag,o_v10m%name, "Vent meridien 10m", "m/s")
+ CALL histdef2d(iff,o_psol%flag,o_psol%name, "Surface Pressure", "Pa" ) 
+ CALL histdef2d(iff,o_qsurf%flag,o_qsurf%name, "Surface Air humidity", "kg/kg")
 
   if (.not. ok_veget) then
- CALL histdef2d(iff,flag_qsol,"qsol","Soil watter content", "mm" )
+ CALL histdef2d(iff,o_qsol%flag,o_qsol%name, "Soil watter content", "mm" )
   endif
 
- CALL histdef2d(iff,flag_ndayrain,"ndayrain","Number of dayrain(liq+sol)","-")
- CALL histdef2d(iff,flag_precip,"precip","Precip Totale liq+sol","kg/(s*m2)" )
- CALL histdef2d(iff,flag_plul,"plul","Large-scale Precip.","kg/(s*m2)") 
- CALL histdef2d(iff,flag_pluc,"pluc","Convective Precip.","kg/(s*m2)")
- CALL histdef2d(iff,flag_snow,"snow","Snow fall","kg/(s*m2)" )
- CALL histdef2d(iff,flag_evap,"evap","Evaporat", "kg/(s*m2)" ) 
- CALL histdef2d(iff,flag_tops,"tops","Solar rad. at TOA","W/m2") 
- CALL histdef2d(iff,flag_tops0,"tops0","CS Solar rad. at TOA", "W/m2")
- CALL histdef2d(iff,flag_topl,"topl","IR rad. at TOA", "W/m2" )
- CALL histdef2d(iff,flag_topl0,"topl0", "IR rad. at TOA","W/m2")
- CALL histdef2d(iff,flag_SWupTOA,"SWupTOA","SWup at TOA","W/m2") 
- CALL histdef2d(iff,flag_SWupTOAclr,"SWupTOAclr","SWup clear sky at TOA","W/m2")
- CALL histdef2d(iff,flag_SWdnTOA, "SWdnTOA","SWdn at TOA","W/m2" )
- CALL histdef2d(iff,flag_SWdnTOAclr,"SWdnTOAclr","SWdn clear sky at TOA","W/m2") 
- CALL histdef2d(iff,flag_SWup200,"SWup200","SWup at 200mb","W/m2" ) 
- CALL histdef2d(iff,flag_SWup200clr,"SWup200clr","SWup clear sky at 200mb","W/m2")
- CALL histdef2d(iff,flag_SWdn200,"SWdn200","SWdn at 200mb","W/m2" )
- CALL histdef2d(iff,flag_SWdn200clr,"SWdn200clr","SWdn clear sky at 200mb","W/m2")
- CALL histdef2d(iff,flag_LWup200,"LWup200","LWup at 200mb","W/m2") 
- CALL histdef2d(iff,flag_LWup200clr, "LWup200clr","LWup clear sky at 200mb","W/m2")
- CALL histdef2d(iff,flag_LWdn200,"LWdn200","LWdn at 200mb","W/m2") 
- CALL histdef2d(iff,flag_LWdn200clr, "LWdn200clr","LWdn clear sky at 200mb","W/m2")
- CALL histdef2d(iff,flag_sols,"sols","Solar rad. at surf.","W/m2")
- CALL histdef2d(iff,flag_sols0,"sols0","Solar rad. at surf.","W/m2")
- CALL histdef2d(iff,flag_soll,"soll","IR rad. at surface","W/m2")  
- CALL histdef2d(iff,flag_radsol,"radsol","Rayonnement au sol","W/m2")
- CALL histdef2d(iff,flag_soll0,"soll0","IR rad. at surface","W/m2") 
- CALL histdef2d(iff,flag_SWupSFC,"SWupSFC","SWup at surface","W/m2")
- CALL histdef2d(iff,flag_SWupSFCclr,"SWupSFCclr","SWup clear sky at surface","W/m2")
- CALL histdef2d(iff,flag_SWdnSFC,"SWdnSFC","SWdn at surface","W/m2")
- CALL histdef2d(iff,flag_SWdnSFCclr,"SWdnSFCclr","SWdn clear sky at surface","W/m2")
- CALL histdef2d(iff,flag_LWupSFC,"LWupSFC","Upwd. IR rad. at surface","W/m2")
- CALL histdef2d(iff,flag_LWdnSFC,"LWdnSFC","Down. IR rad. at surface","W/m2")
- CALL histdef2d(iff,flag_LWupSFCclr,"LWupSFCclr","CS Upwd. IR rad. at surface","W/m2")
- CALL histdef2d(iff,flag_LWdnSFCclr,"LWdnSFCclr","Down. CS IR rad. at surface","W/m2")
- CALL histdef2d(iff,flag_bils,"bils","Surf. total heat flux","W/m2")
- CALL histdef2d(iff,flag_sens,"sens","Sensible heat flux","W/m2")
- CALL histdef2d(iff,flag_fder,"fder","Heat flux derivation","W/m2")
- CALL histdef2d(iff,flag_ffonte,"ffonte","Thermal flux for snow melting","W/m2")
- CALL histdef2d(iff,flag_fqcalving,"fqcalving","Ice Calving","kg/m2/s") 
- CALL histdef2d(iff,flag_fqfonte,"fqfonte","Land ice melt","kg/m2/s") 
+ CALL histdef2d(iff,o_ndayrain%flag,o_ndayrain%name, "Number of dayrain(liq+sol)", "-")
+ CALL histdef2d(iff,o_precip%flag,o_precip%name, "Precip Totale liq+sol", "kg/(s*m2)" )
+ CALL histdef2d(iff,o_plul%flag,o_plul%name, "Large-scale Precip.", "kg/(s*m2)") 
+ 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_evap%flag,o_evap%name, "Evaporat", "kg/(s*m2)" ) 
+ CALL histdef2d(iff,o_tops%flag,o_tops%name, "Solar rad. at TOA", "W/m2") 
+ CALL histdef2d(iff,o_tops0%flag,o_tops0%name, "CS Solar rad. at TOA", "W/m2")
+ CALL histdef2d(iff,o_topl%flag,o_topl%name, "IR rad. at TOA", "W/m2" )
+ CALL histdef2d(iff,o_topl0%flag,o_topl0%name, "IR rad. at TOA", "W/m2")
+ CALL histdef2d(iff,o_SWupTOA%flag,o_SWupTOA%name, "SWup at TOA", "W/m2") 
+ CALL histdef2d(iff,o_SWupTOAclr%flag,o_SWupTOAclr%name, "SWup clear sky at TOA", "W/m2")
+ 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_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")
+ CALL histdef2d(iff,o_SWdn200%flag,o_SWdn200%name, "SWdn at 200mb", "W/m2" )
+ CALL histdef2d(iff,o_SWdn200clr%flag,o_SWdn200clr%name, "SWdn clear sky at 200mb", "W/m2")
+ CALL histdef2d(iff,o_LWup200%flag,o_LWup200%name, "LWup at 200mb", "W/m2") 
+ CALL histdef2d(iff,o_LWup200clr%flag,o_LWup200clr%name, "LWup clear sky at 200mb", "W/m2")
+ CALL histdef2d(iff,o_LWdn200%flag,o_LWdn200%name, "LWdn at 200mb", "W/m2") 
+ CALL histdef2d(iff,o_LWdn200clr%flag,o_LWdn200clr%name, "LWdn clear sky at 200mb", "W/m2")
+ CALL histdef2d(iff,o_sols%flag,o_sols%name, "Solar rad. at surf.", "W/m2")
+ CALL histdef2d(iff,o_sols0%flag,o_sols0%name, "Solar rad. at surf.", "W/m2")
+ CALL histdef2d(iff,o_soll%flag,o_soll%name, "IR rad. at surface", "W/m2")  
+ CALL histdef2d(iff,o_radsol%flag,o_radsol%name, "Rayonnement au sol", "W/m2")
+ CALL histdef2d(iff,o_soll0%flag,o_soll0%name, "IR rad. at surface", "W/m2") 
+ CALL histdef2d(iff,o_SWupSFC%flag,o_SWupSFC%name, "SWup at surface", "W/m2")
+ CALL histdef2d(iff,o_SWupSFCclr%flag,o_SWupSFCclr%name, "SWup clear sky at surface", "W/m2")
+ CALL histdef2d(iff,o_SWdnSFC%flag,o_SWdnSFC%name, "SWdn at surface", "W/m2")
+ CALL histdef2d(iff,o_SWdnSFCclr%flag,o_SWdnSFCclr%name, "SWdn clear sky at surface", "W/m2")
+ CALL histdef2d(iff,o_LWupSFC%flag,o_LWupSFC%name, "Upwd. IR rad. at surface", "W/m2")
+ CALL histdef2d(iff,o_LWdnSFC%flag,o_LWdnSFC%name, "Down. IR rad. at surface", "W/m2")
+ CALL histdef2d(iff,o_LWupSFCclr%flag,o_LWupSFCclr%name, "CS Upwd. IR rad. at surface", "W/m2")
+ CALL histdef2d(iff,o_LWdnSFCclr%flag,o_LWdnSFCclr%name, "Down. CS IR rad. at surface", "W/m2")
+ CALL histdef2d(iff,o_bils%flag,o_bils%name, "Surf. total heat flux", "W/m2")
+ CALL histdef2d(iff,o_sens%flag,o_sens%name, "Sensible heat flux", "W/m2")
+ CALL histdef2d(iff,o_fder%flag,o_fder%name, "Heat flux derivation", "W/m2")
+ CALL histdef2d(iff,o_ffonte%flag,o_ffonte%name, "Thermal flux for snow melting", "W/m2")
+ CALL histdef2d(iff,o_fqcalving%flag,o_fqcalving%name, "Ice Calving", "kg/m2/s") 
+ CALL histdef2d(iff,o_fqfonte%flag,o_fqfonte%name, "Land ice melt", "kg/m2/s") 
 
      DO nsrf = 1, nbsrf
- CALL histdef2d(iff,flag_pourc_sol,"pourc_"//clnsurf(nsrf),"% "//clnsurf(nsrf),"%")
- CALL histdef2d(iff,flag_fract_sol,"fract_"//clnsurf(nsrf),"Fraction "//clnsurf(nsrf),"1")
- CALL histdef2d(iff,flag_taux_sol,"taux_"//clnsurf(nsrf),"Zonal wind stress"//clnsurf(nsrf),"Pa")
- CALL histdef2d(iff,flag_tauy_sol,"tauy_"//clnsurf(nsrf),"Meridional wind stress "//clnsurf(nsrf),"Pa")
- CALL histdef2d(iff,flag_tsol_sol,"tsol_"//clnsurf(nsrf),"Temperature "//clnsurf(nsrf),"K")
- CALL histdef2d(iff,flag_u10m_sol,"u10m_"//clnsurf(nsrf),"Vent Zonal 10m "//clnsurf(nsrf),"m/s")
- CALL histdef2d(iff,flag_v10m_sol,"v10m_"//clnsurf(nsrf),"Vent meredien 10m "//clnsurf(nsrf),"m/s")
- CALL histdef2d(iff,flag_t2m_sol,"t2m_"//clnsurf(nsrf),"Temp 2m "//clnsurf(nsrf),"K")
- CALL histdef2d(iff,flag_sens_sol,"sens_"//clnsurf(nsrf),"Sensible heat flux "//clnsurf(nsrf),"W/m2")
- CALL histdef2d(iff,flag_lat_sol,"lat_"//clnsurf(nsrf),"Latent heat flux "//clnsurf(nsrf),"W/m2")
- CALL histdef2d(iff,flag_flw_sol,"flw_"//clnsurf(nsrf),"LW "//clnsurf(nsrf),"W/m2")
- CALL histdef2d(iff,flag_fsw_sol,"fsw_"//clnsurf(nsrf),"SW "//clnsurf(nsrf),"W/m2")
- CALL histdef2d(iff,flag_wbils_sol,"wbils_"//clnsurf(nsrf),"Bilan sol "//clnsurf(nsrf),"W/m2" )
- CALL histdef2d(iff,flag_wbilo_sol,"wbilo_"//clnsurf(nsrf),"Bilan eau "//clnsurf(nsrf),"kg/(m2*s)")
+ CALL histdef2d(iff,o_pourc_srf(nsrf)%flag,o_pourc_srf(nsrf)%name,"% "//clnsurf(nsrf),"%")
+ CALL histdef2d(iff,o_fract_srf(nsrf)%flag,o_fract_srf(nsrf)%name,"Fraction "//clnsurf(nsrf),"1")
+ CALL histdef2d(iff,o_taux_srf(nsrf)%flag,o_taux_srf(nsrf)%name,"Zonal wind stress"//clnsurf(nsrf),"Pa")
+ CALL histdef2d(iff,o_tauy_srf(nsrf)%flag,o_tauy_srf(nsrf)%name,"Meridional wind stress "//clnsurf(nsrf),"Pa")
+ 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_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")
+ CALL histdef2d(iff,o_sens_srf(nsrf)%flag,o_sens_srf(nsrf)%name,"Sensible heat flux "//clnsurf(nsrf),"W/m2")
+ CALL histdef2d(iff,o_lat_srf(nsrf)%flag,o_lat_srf(nsrf)%name,"Latent heat flux "//clnsurf(nsrf),"W/m2")
+ CALL histdef2d(iff,o_flw_srf(nsrf)%flag,o_flw_srf(nsrf)%name,"LW "//clnsurf(nsrf),"W/m2")
+ CALL histdef2d(iff,o_fsw_srf(nsrf)%flag,o_fsw_srf(nsrf)%name,"SW "//clnsurf(nsrf),"W/m2")
+ CALL histdef2d(iff,o_wbils_srf(nsrf)%flag,o_wbils_srf(nsrf)%name,"Bilan sol "//clnsurf(nsrf),"W/m2" )
+ CALL histdef2d(iff,o_wbilo_srf(nsrf)%flag,o_wbilo_srf(nsrf)%name,"Bilan eau "//clnsurf(nsrf),"kg/(m2*s)")
   if (iflag_pbl>1 .and. lev_files(iff).gt.10 ) then
- CALL histdef2d(iff,flag_tke_sol,"tke_"//clnsurf(nsrf),"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
- CALL histdef2d(iff,flag_tke_max_sol,"tke_max_"//clnsurf(nsrf),"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
+ CALL histdef2d(iff,o_tke_srf(nsrf)%flag,o_tke_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
+ CALL histdef2d(iff,o_tke_max_srf(nsrf)%flag,o_tke_max_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
   endif
- CALL histdef2d(iff,flag_albe_sol, "albe_"//clnsurf(nsrf),"Albedo surf. "//clnsurf(nsrf),"-")
- CALL histdef2d(iff,flag_rugs_sol,"rugs_"//clnsurf(nsrf),"Latent heat flux "//clnsurf(nsrf),"W/m2")
- CALL histdef2d(iff,flag_ages_sol,"ages_"//clnsurf(nsrf),"Snow age","day")
+ 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_ages_srf(nsrf)%flag,o_ages_srf(nsrf)%name,"Snow age", "day")
      END DO
 
- CALL histdef2d(iff,flag_albs,"albs","Surface albedo","-")
- CALL histdef2d(iff,flag_albslw,"albslw","Surface albedo LW","-")
- CALL histdef2d(iff,flag_cdrm,"cdrm","Momentum drag coef.", "-")
- CALL histdef2d(iff,flag_cdrh,"cdrh","Heat drag coef.", "-" )
- CALL histdef2d(iff,flag_cldl,"cldl","Low-level cloudiness", "-")
- CALL histdef2d(iff,flag_cldm,"cldm","Mid-level cloudiness", "-")
- CALL histdef2d(iff,flag_cldh,"cldh","High-level cloudiness", "-")
- CALL histdef2d(iff,flag_cldt,"cldt","Total cloudiness","%")
- CALL histdef2d(iff,flag_cldq,"cldq","Cloud liquid water path","kg/m2")
- CALL histdef2d(iff,flag_lwp,"lwp","Cloud water path","kg/m2")
- CALL histdef2d(iff,flag_iwp,"iwp","Cloud ice water path","kg/m2" )
- CALL histdef2d(iff,flag_ue,"ue","Zonal energy transport","-")
- CALL histdef2d(iff,flag_ve,"ve","Merid energy transport", "-")
- CALL histdef2d(iff,flag_uq,"uq","Zonal humidity transport", "-")
- CALL histdef2d(iff,flag_vq,"vq","Merid humidity transport", "-")
+ 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_cdrm%flag,o_cdrm%name, "Momentum drag coef.", "-")
+ CALL histdef2d(iff,o_cdrh%flag,o_cdrh%name, "Heat drag coef.", "-" )
+ CALL histdef2d(iff,o_cldl%flag,o_cldl%name, "Low-level cloudiness", "-")
+ CALL histdef2d(iff,o_cldm%flag,o_cldm%name, "Mid-level cloudiness", "-")
+ CALL histdef2d(iff,o_cldh%flag,o_cldh%name, "High-level cloudiness", "-")
+ CALL histdef2d(iff,o_cldt%flag,o_cldt%name, "Total cloudiness", "%")
+ CALL histdef2d(iff,o_cldq%flag,o_cldq%name, "Cloud liquid water path", "kg/m2")
+ CALL histdef2d(iff,o_lwp%flag,o_lwp%name, "Cloud water path", "kg/m2")
+ CALL histdef2d(iff,o_iwp%flag,o_iwp%name, "Cloud ice water path", "kg/m2" )
+ CALL histdef2d(iff,o_ue%flag,o_ue%name, "Zonal energy transport", "-")
+ CALL histdef2d(iff,o_ve%flag,o_ve%name, "Merid energy transport", "-")
+ CALL histdef2d(iff,o_uq%flag,o_uq%name, "Zonal humidity transport", "-")
+ CALL histdef2d(iff,o_vq%flag,o_vq%name, "Merid humidity transport", "-")
 
      IF(iflag_con.GE.3) THEN ! sb
- CALL histdef2d(iff,flag_cape,"cape","Conv avlbl pot ener","J/kg")
- CALL histdef2d(iff,flag_pbase,"pbase","Cld base pressure", "mb")
- CALL histdef2d(iff,flag_ptop,"ptop","Cld top pressure", "mb")
- CALL histdef2d(iff,flag_fbase,"fbase","Cld base mass flux","kg/m2/s")
- CALL histdef2d(iff,flag_prw,"prw","Precipitable water","kg/m2")
+ 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_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")
      ENDIF !iflag_con .GE. 3
 
- CALL histdef2d(iff,flag_s_pblh,"s_pblh","Boundary Layer Height","m")
- CALL histdef2d(iff,flag_s_pblt,"s_pblt","t at Boundary Layer Height","K")
- CALL histdef2d(iff,flag_s_lcl,"s_lcl","Condensation level","m")
- CALL histdef2d(iff,flag_s_capCL,"s_capCL","Conv avlbl pot enerfor ABL", "J/m2" )
- CALL histdef2d(iff,flag_s_oliqCL,"s_oliqCL","Liq Water in BL","kg/m2")
- CALL histdef2d(iff,flag_s_cteiCL,"s_cteiCL","Instability criteria(ABL)","K")
- CALL histdef2d(iff,flag_s_therm,"s_therm","Exces du thermique", "K")
- CALL histdef2d(iff,flag_s_trmb1,"s_trmb1","deep_cape(HBTM2)","J/m2")
- CALL histdef2d(iff,flag_s_trmb2,"s_trmb2","inhibition (HBTM2)","J/m2")
- CALL histdef2d(iff,flag_s_trmb3,"s_trmb3","Point Omega (HBTM2)","m")
+ CALL histdef2d(iff,o_s_pblh%flag,o_s_pblh%name, "Boundary Layer Height", "m")
+ 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")
 
 ! Champs interpolles sur des niveaux de pression
@@ -609,15 +724,21 @@
    type_ecri(3) = 'inst(X)'
    type_ecri(4) = 'inst(X)'
+
+! Attention a reverifier
+
+        ilev=0        
         DO k=1, nlevSTD
      IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
-     IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
+!     IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
      IF(bb2.EQ."850".OR.bb2.EQ."700".OR.bb2.EQ."500".OR.bb2.EQ."200")THEN
- CALL histdef2d(iff,flag_ulevsSTD,"u"//bb2,"Zonal wind "//bb2//"mb","m/s")
- CALL histdef2d(iff,flag_vlevsSTD,"v"//bb2,"Meridional wind "//bb2//"mb","m/s")
- CALL histdef2d(iff,flag_wlevsSTD,"w"//bb2,"Vertical wind "//bb2//"mb","m/s")
- CALL histdef2d(iff,flag_philevsSTD,"phi"//bb2,"Geopotential "//bb2//"mb","m")
- CALL histdef2d(iff,flag_qlevsSTD,"q"//bb2,"Specific humidity "//bb2//"mb","kg/kg" )
- CALL histdef2d(iff,flag_tlevsSTD,"t"//bb2,"Temperature "//bb2//"mb","K")
-     ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
+      ilev=ilev+1
+      print*,'ilev bb2 flag name ',ilev,bb2,o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name
+ CALL histdef2d(iff,o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name,"Zonal wind "//bb2//"mb", "m/s")
+ 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_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")
+     ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR."500".OR.bb2.EQ."200")
        ENDDO
    zstophym(iff) = dtime
@@ -627,152 +748,154 @@
    type_ecri(4) = 'inst(X)'
 
- CALL histdef2d(iff,flag_t_oce_sic,"t_oce_sic","Temp mixte oce-sic","K")
+ CALL histdef2d(iff,o_t_oce_sic%flag,o_t_oce_sic%name, "Temp mixte oce-sic", "K")
 
  IF (ocean=='slab') & 
-      CALL histdef2d(iff,flag_slab_bils, "slab_wbils_oce","Bilan au sol sur ocean slab", "W/m2")
+     CALL histdef2d(iff,o_slab_bils%flag, o_slab_bils%name,"Bilan au sol sur ocean slab", "W/m2")
 
  IF (iflag_con.GE.3) THEN
- 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_ale,"ale","ALE","m2/s2")
- CALL histdef2d(iff,flag_alp,"alp","ALP","W/m2")
- CALL histdef2d(iff,flag_cin,"cin","Convective INhibition","m2/s2")
- CALL histdef2d(iff,flag_wape,"WAPE","WAPE","m2/s2")
+ CALL histdef2d(iff,o_ale_bl%flag,o_ale_bl%name, "ALE BL", "m2/s2") 
+ CALL histdef2d(iff,o_alp_bl%flag,o_alp_bl%name, "ALP BL", "m2/s2") 
+ CALL histdef2d(iff,o_ale_wk%flag,o_ale_wk%name, "ALE WK", "m2/s2") 
+ CALL histdef2d(iff,o_alp_wk%flag,o_alp_wk%name, "ALP WK", "m2/s2") 
+
+ CALL histdef2d(iff,o_ale%flag,o_ale%name, "ALE", "m2/s2")
+ CALL histdef2d(iff,o_alp%flag,o_alp%name, "ALP", "W/m2")
+ CALL histdef2d(iff,o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2")
+ CALL histdef2d(iff,o_wape%flag,o_WAPE%name, "WAPE", "m2/s2")
  ENDIF !(iflag_con.GE.3)
 
- CALL histdef2d(iff,flag_weakinv, "weakinv","Weak inversion", "-")
- CALL histdef2d(iff,flag_dthmin,"dthmin","dTheta mini", "K/m")
- CALL histdef2d(iff,flag_rh2m,"rh2m","Relative humidity at 2m", "%" )
- CALL histdef2d(iff,flag_qsat2m,"qsat2m","Saturant humidity at 2m", "%")
- CALL histdef2d(iff,flag_tpot,"tpot","Surface air potential temperature","K")
- CALL histdef2d(iff,flag_tpote,"tpote","Surface air equivalent potential temperature","K")
- CALL histdef2d(iff,flag_SWnetOR,"SWnetOR","Sfce net SW radiation OR", "W/m2")
- CALL histdef2d(iff,flag_SWdownOR,"SWdownOR","Sfce incident SW radiation OR","W/m2")
- CALL histdef2d(iff,flag_LWdownOR,"LWdownOR","Sfce incident LW radiation OR","W/m2")
- CALL histdef2d(iff,flag_snowl,"snowl","Solid Large-scale Precip.","kg/(m2*s)")
+ CALL histdef2d(iff,o_weakinv%flag,o_weakinv%name, "Weak inversion", "-")
+ 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", "%" )
+ 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")
+ CALL histdef2d(iff,o_tpote%flag,o_tpote%name, "Surface air equivalent potential temperature", "K")
+ CALL histdef2d(iff,o_SWnetOR%flag,o_SWnetOR%name, "Sfce net SW radiation OR", "W/m2")
+ CALL histdef2d(iff,o_SWdownOR%flag,o_SWdownOR%name, "Sfce incident SW radiation OR", "W/m2")
+ CALL histdef2d(iff,o_LWdownOR%flag,o_LWdownOR%name, "Sfce incident LW radiation OR", "W/m2")
+ CALL histdef2d(iff,o_snowl%flag,o_snowl%name, "Solid Large-scale Precip.", "kg/(m2*s)")
  IF (iflag_con.GE.3) THEN
- CALL histdef2d(iff,flag_cape_max,"cape_max","CAPE max.", "J/kg")
+ CALL histdef2d(iff,o_cape_max%flag,o_cape_max%name, "CAPE max.", "J/kg")
  ENDIF !(iflag_con.GE.3) 
- CALL histdef2d(iff,flag_solldown,"solldown","Down. IR rad. at surface","W/m2")
- CALL histdef2d(iff,flag_dtsvdfo,"dtsvdfo","Boundary-layer dTs(o)","K/s")
- CALL histdef2d(iff,flag_dtsvdft,"dtsvdft","Boundary-layer dTs(t)","K/s")
- CALL histdef2d(iff,flag_dtsvdfg,"dtsvdfg","Boundary-layer dTs(g)","K/s")
- CALL histdef2d(iff,flag_dtsvdfi,"dtsvdfi","Boundary-layer dTs(g)","K/s")
- CALL histdef2d(iff,flag_rugs,"rugs","rugosity", "-" )
+ CALL histdef2d(iff,o_solldown%flag,o_solldown%name, "Down. IR rad. at surface", "W/m2")
+ CALL histdef2d(iff,o_dtsvdfo%flag,o_dtsvdfo%name, "Boundary-layer dTs(o)", "K/s")
+ CALL histdef2d(iff,o_dtsvdft%flag,o_dtsvdft%name, "Boundary-layer dTs(t)", "K/s")
+ CALL histdef2d(iff,o_dtsvdfg%flag,o_dtsvdfg%name, "Boundary-layer dTs(g)", "K/s")
+ CALL histdef2d(iff,o_dtsvdfi%flag,o_dtsvdfi%name, "Boundary-layer dTs(g)", "K/s")
+ CALL histdef2d(iff,o_rugs%flag,o_rugs%name, "rugosity", "-" )
 
 ! Champs 3D:
- CALL histdef3d(iff,flag_lwcon,"lwcon","Cloud liquid water content","kg/kg")
- 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")
- CALL histdef3d(iff,flag_vitu,"vitu","Zonal wind", "m/s" )
- CALL histdef3d(iff,flag_vitv,"vitv","Meridional wind","m/s" )
- CALL histdef3d(iff,flag_vitw,"vitw","Vertical wind","Pa/s" )
- CALL histdef3d(iff,flag_pres,"pres","Air pressure", "Pa" )
- CALL histdef3d(iff,flag_rneb,"rneb","Cloud fraction","-")
- CALL histdef3d(iff,flag_rnebcon,"rnebcon","Convective Cloud Fraction","-")
- CALL histdef3d(iff,flag_rhum,"rhum","Relative humidity","-")
- CALL histdef3d(iff,flag_ozone,"ozone","Ozone concentration", "ppmv")
+ CALL histdef3d(iff,o_lwcon%flag,o_lwcon%name, "Cloud liquid water content", "kg/kg")
+ CALL histdef3d(iff,o_iwcon%flag,o_iwcon%name, "Cloud ice water content", "kg/kg")
+ 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", "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" )
+ CALL histdef3d(iff,o_vitv%flag,o_vitv%name, "Meridional wind", "m/s" )
+ 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_rneb%flag,o_rneb%name, "Cloud fraction", "-")
+ CALL histdef3d(iff,o_rnebcon%flag,o_rnebcon%name, "Convective Cloud Fraction", "-")
+ CALL histdef3d(iff,o_rhum%flag,o_rhum%name, "Relative humidity", "-")
+ CALL histdef3d(iff,o_ozone%flag,o_ozone%name, "Ozone concentration", "ppmv")
  IF(iflag_con.GE.3) THEN
-  CALL histdef3d(iff,flag_upwd,"upwd","saturated updraft", "kg/m2/s")
+  CALL histdef3d(iff,o_upwd%flag,o_upwd%name, "saturated updraft", "kg/m2/s")
  ENDIF !iflag_con.GE.3
- CALL histdef3d(iff,flag_dtphy,"dtphy","Physics dT","K/s")
- CALL histdef3d(iff,flag_dqphy,"dqphy","Physics dQ", "(kg/kg)/s")
- CALL histdef3d(iff,flag_cldtau,"cldtau","Cloud optical thickness","1")
- CALL histdef3d(iff,flag_cldemi,"cldemi","Cloud optical emissivity","1")
+ CALL histdef3d(iff,o_dtphy%flag,o_dtphy%name, "Physics dT", "K/s")
+ CALL histdef3d(iff,o_dqphy%flag,o_dqphy%name, "Physics dQ", "(kg/kg)/s")
+ CALL histdef3d(iff,o_cldtau%flag,o_cldtau%name, "Cloud optical thickness", "1")
+ CALL histdef3d(iff,o_cldemi%flag,o_cldemi%name, "Cloud optical emissivity", "1")
 !IM: bug ?? dimensionnement variables (klon,klev+1) pmflxr, pmflxs, prfl, psfl
-! CALL histdef3d(iff,flag_pr_con_l,"pmflxr","Convective precipitation lic"," ")
-! CALL histdef3d(iff,flag_pr_con_i,"pmflxs","Convective precipitation ice"," ")
-! CALL histdef3d(iff,flag_pr_lsc_l,"prfl","Large scale precipitation lic"," ")
-! CALL histdef3d(iff,flag_pr_lsc_i,"psfl","Large scale precipitation ice"," ")
+! CALL histdef3d(iff,o_pr_con_l%flag,o_pmflxr%name, "Convective precipitation lic", " ")
+! CALL histdef3d(iff,o_pr_con_i%flag,o_pmflxs%name, "Convective precipitation ice", " ")
+! CALL histdef3d(iff,o_pr_lsc_l%flag,o_prfl%name, "Large scale precipitation lic", " ")
+! CALL histdef3d(iff,o_pr_lsc_i%flag,o_psfl%name, "Large scale precipitation ice", " ")
 
 !FH Sorties pour la couche limite
      if (iflag_pbl>1) then
- CALL histdef3d(iff,flag_tke,"tke","TKE","m2/s2")
- CALL histdef3d(iff,flag_tke_max,"tke_max","TKE max","m2/s2")
+ CALL histdef3d(iff,o_tke%flag,o_tke%name, "TKE", "m2/s2")
+ CALL histdef3d(iff,o_tke_max%flag,o_tke_max%name, "TKE max", "m2/s2")
      endif
 
- CALL histdef3d(iff,flag_kz,"kz","Kz melange","m2/s")
- CALL histdef3d(iff,flag_kz_max,"kz_max","Kz melange max","m2/s" )
- CALL histdef3d(iff,flag_clwcon,"clwcon","Convective Cloud Liquid water content", "kg/kg") 
+ CALL histdef3d(iff,o_kz%flag,o_kz%name, "Kz melange", "m2/s")
+ CALL histdef3d(iff,o_kz_max%flag,o_kz_max%name, "Kz melange max", "m2/s" )
+ CALL histdef3d(iff,o_clwcon%flag,o_clwcon%name, "Convective Cloud Liquid water content", "kg/kg") 
  IF(iflag_con.GE.3) THEN
- CALL histdef3d(iff,flag_Ma,"Ma","undilute adiab updraft","kg/m2/s")
- CALL histdef3d(iff,flag_dnwd,"dnwd","saturated downdraft","kg/m2/s")
- CALL histdef3d(iff,flag_dnwd0,"dnwd0","unsat. downdraft", "kg/m2/s")
+ CALL histdef3d(iff,o_Ma%flag,o_Ma%name, "undilute adiab updraft", "kg/m2/s")
+ 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")
  ENDIF !(iflag_con.GE.3) 
- CALL histdef3d(iff,flag_dtdyn,"dtdyn","Dynamics dT","K/s")
- CALL histdef3d(iff,flag_dqdyn,"dqdyn","Dynamics dQ", "(kg/kg)/s")
- CALL histdef3d(iff,flag_dudyn,"dudyn","Dynamics dU","m/s2")
- CALL histdef3d(iff,flag_dvdyn,"dvdyn","Dynamics dV","m/s2")
- CALL histdef3d(iff,flag_dtcon,"dtcon","Convection dT","K/s")
- CALL histdef3d(iff,flag_ducon,"ducon","Convection du","m/s2")
- CALL histdef3d(iff,flag_dqcon,"dqcon","Convection dQ", "(kg/kg)/s")
- IF(iflag_con.GE.3) THEN
+ CALL histdef3d(iff,o_dtdyn%flag,o_dtdyn%name, "Dynamics dT", "K/s")
+ CALL histdef3d(iff,o_dqdyn%flag,o_dqdyn%name, "Dynamics dQ", "(kg/kg)/s")
+ CALL histdef3d(iff,o_dudyn%flag,o_dudyn%name, "Dynamics dU", "m/s2")
+ CALL histdef3d(iff,o_dvdyn%flag,o_dvdyn%name, "Dynamics dV", "m/s2")
+ CALL histdef3d(iff,o_dtcon%flag,o_dtcon%name, "Convection dT", "K/s")
+ CALL histdef3d(iff,o_ducon%flag,o_ducon%name, "Convection du", "m/s2")
+ CALL histdef3d(iff,o_dqcon%flag,o_dqcon%name, "Convection dQ", "(kg/kg)/s")
+ IF(iflag_con.EQ.3) THEN
  IF (iflag_wake == 1) THEN
-   CALL histdef2d(iff,flag_wake_h,"wake_h","wake_h", "-")
-   CALL histdef2d(iff,flag_wake_s,"wake_s","wake_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_wake_deltat,"wake_deltat","wake_deltat", " ")
-   CALL histdef3d(iff,flag_wake_deltaq,"wake_deltaq","wake_deltaq", " ")
-   CALL histdef3d(iff,flag_wake_omg,"wake_omg","wake_omg", " ")
+   CALL histdef2d(iff,o_wake_h%flag,o_wake_h%name, "wake_h", "-")
+   CALL histdef2d(iff,o_wake_s%flag,o_wake_s%name, "wake_s", "-")
+   CALL histdef3d(iff,o_dtwak%flag,o_dtwak%name, "Wake dT", "K/s")
+   CALL histdef3d(iff,o_dqwak%flag,o_dqwak%name, "Wake dQ", "(kg/kg)/s")
+   CALL histdef3d(iff,o_wake_deltat%flag,o_wake_deltat%name, "wake_deltat", " ")
+   CALL histdef3d(iff,o_wake_deltaq%flag,o_wake_deltaq%name, "wake_deltaq", " ")
+   CALL histdef3d(iff,o_wake_omg%flag,o_wake_omg%name, "wake_omg", " ")
  ENDIF
-   CALL histdef3d(iff,flag_Vprecip,"Vprecip","precipitation vertical profile","-")
-   CALL histdef3d(iff,flag_ftd,"ftd","tend temp due aux descentes precip","-")
-   CALL histdef3d(iff,flag_fqd,"fqd","tend vap eau due aux descentes precip","-")
- ENDIF !(iflag_con.GE.3)
-
- CALL histdef3d(iff,flag_dtlsc,"dtlsc","Condensation dT", "K/s")
- CALL histdef3d(iff,flag_dtlschr,"dtlschr","Large-scale condensational heating rate","K/s")
- CALL histdef3d(iff,flag_dqlsc,"dqlsc","Condensation dQ","(kg/kg)/s")
- CALL histdef3d(iff,flag_dtvdf,"dtvdf","Boundary-layer dT", "K/s")
- CALL histdef3d(iff,flag_dqvdf,"dqvdf","Boundary-layer dQ","(kg/kg)/s") 
- CALL histdef3d(iff,flag_dteva,"dteva","Reevaporation dT", "K/s")
- CALL histdef3d(iff,flag_dqeva,"dqeva","Reevaporation dQ","(kg/kg)/s")
- CALL histdef3d(iff,flag_ptconv,"ptconv","POINTS CONVECTIFS"," ")
- CALL histdef3d(iff,flag_ratqs,"ratqs", "RATQS"," ")
- CALL histdef3d(iff,flag_dtthe,"dtthe","Dry adjust. dT", "K/s")
+   CALL histdef3d(iff,o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-")
+   CALL histdef3d(iff,o_ftd%flag,o_ftd%name, "tend temp due aux descentes precip", "-")
+   CALL histdef3d(iff,o_fqd%flag,o_fqd%name,"tend vap eau due aux descentes precip", "-")
+ ENDIF !(iflag_con.EQ.3)
+
+ CALL histdef3d(iff,o_dtlsc%flag,o_dtlsc%name, "Condensation dT", "K/s")
+ CALL histdef3d(iff,o_dtlschr%flag,o_dtlschr%name,"Large-scale condensational heating rate","K/s")
+ CALL histdef3d(iff,o_dqlsc%flag,o_dqlsc%name, "Condensation dQ", "(kg/kg)/s")
+ CALL histdef3d(iff,o_dtvdf%flag,o_dtvdf%name, "Boundary-layer dT", "K/s")
+ CALL histdef3d(iff,o_dqvdf%flag,o_dqvdf%name, "Boundary-layer dQ", "(kg/kg)/s") 
+ CALL histdef3d(iff,o_dteva%flag,o_dteva%name, "Reevaporation dT", "K/s")
+ CALL histdef3d(iff,o_dqeva%flag,o_dqeva%name, "Reevaporation dQ", "(kg/kg)/s")
+ CALL histdef3d(iff,o_ptconv%flag,o_ptconv%name, "POINTS CONVECTIFS", " ")
+ CALL histdef3d(iff,o_ratqs%flag,o_ratqs%name, "RATQS", " ")
+ CALL histdef3d(iff,o_dtthe%flag,o_dtthe%name, "Dry adjust. dT", "K/s")
 
 if(iflag_thermals.gt.1) THEN
- 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_w_th,"w_th","Thermal plume vertical velocity", "m/s")
- CALL histdef3d(iff,flag_lambda_th,"lambda_th","Thermal plume vertical velocity", "m/s")
- CALL histdef3d(iff,flag_q_th,"q_th","Thermal plume total humidity", "kg/kg")
- CALL histdef3d(iff,flag_a_th,"a_th","Thermal plume fraction", "")
- CALL histdef3d(iff,flag_d_th,"d_th","Thermal plume detrainment", "K/s")
+ CALL histdef3d(iff,o_f_th%flag,o_f_th%name, "Thermal plume mass flux", "K/s")
+ CALL histdef3d(iff,o_e_th%flag,o_e_th%name,"Thermal plume entrainment","K/s")
+ 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 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", "")
+ CALL histdef3d(iff,o_d_th%flag,o_d_th%name, "Thermal plume detrainment", "K/s")
 endif !iflag_thermals.gt.1
- CALL histdef2d(iff,flag_f0_th,"f0_th","Thermal closure mass flux", "K/s")
- CALL histdef2d(iff,flag_zmax_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")
- CALL histdef3d(iff,flag_dqajs,"dqajs","Dry adjust. dQ","(kg/kg)/s")
- CALL histdef3d(iff,flag_dtswr,"dtswr","SW radiation dT","K/s")
- CALL histdef3d(iff,flag_dtsw0,"dtsw0","CS SW radiation dT","K/s")
- CALL histdef3d(iff,flag_dtlwr,"dtlwr","LW radiation dT","K/s")
- CALL histdef3d(iff,flag_dtlw0,"dtlw0", "CS LW radiation dT","K/s")
- CALL histdef3d(iff,flag_dtec,"dtec","Cinetic dissip dT","K/s")
- CALL histdef3d(iff,flag_duvdf,"duvdf","Boundary-layer dU","m/s2")
- CALL histdef3d(iff,flag_dvvdf,"dvvdf","Boundary-layer dV", "m/s2")
+ 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")
+ 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")
+ CALL histdef3d(iff,o_dtswr%flag,o_dtswr%name, "SW radiation dT", "K/s")
+ CALL histdef3d(iff,o_dtsw0%flag,o_dtsw0%name, "CS SW radiation dT", "K/s")
+ CALL histdef3d(iff,o_dtlwr%flag,o_dtlwr%name, "LW radiation dT", "K/s")
+ CALL histdef3d(iff,o_dtlw0%flag,o_dtlw0%name, "CS LW radiation dT", "K/s")
+ CALL histdef3d(iff,o_dtec%flag,o_dtec%name, "Cinetic dissip dT", "K/s")
+ CALL histdef3d(iff,o_duvdf%flag,o_duvdf%name, "Boundary-layer dU", "m/s2")
+ CALL histdef3d(iff,o_dvvdf%flag,o_dvvdf%name, "Boundary-layer dV", "m/s2")
 
      IF (ok_orodr) THEN
- CALL histdef3d(iff,flag_duoro,"duoro","Orography dU","m/s2")
- CALL histdef3d(iff,flag_dvoro,"dvoro","Orography dV", "m/s2")
+ CALL histdef3d(iff,o_duoro%flag,o_duoro%name, "Orography dU", "m/s2")
+ CALL histdef3d(iff,o_dvoro%flag,o_dvoro%name, "Orography dV", "m/s2")
      ENDIF
 
      IF (ok_orolf) THEN
- CALL histdef3d(iff,flag_dulif,"dulif","Orography dU","m/s2")
- CALL histdef3d(iff,flag_dvlif,"dvlif","Orography dV", "m/s2")
+ CALL histdef3d(iff,o_dulif%flag,o_dulif%name, "Orography dU", "m/s2")
+ CALL histdef3d(iff,o_dvlif%flag,o_dvlif%name, "Orography dV", "m/s2")
      ENDIF
 
       if (nqmax>=3) THEN
-    DO iq=3,nqmax
+!Attention    DO iq=3,nqmax
+    DO iq=3,4  
        iiq=niadv(iq)
- CALL histdef3d ( iff, flag_trac, tnom(iq),ttext(iiq), "-" )
+! CALL histdef3d (iff, o_trac%flag,'o_'//tnom(iq)%name,ttext(iiq), "-" )
+  CALL histdef3d (iff, o_trac(iq-2)%flag,o_trac(iq-2)%name,ttext(iiq), "-" )
     ENDDO
       endif
@@ -804,7 +927,11 @@
        integer                          :: iff
        integer, dimension(nfiles)       :: flag_var
-       character(len=*)                 :: nomvar
+       character(len=20)                 :: nomvar
        character(len=*)                 :: titrevar
        character(len=*)                 :: unitvar
+
+       if (iff.eq.1) then
+   call conf_physoutputs(nomvar,flag_var)
+       endif
        
        if ( flag_var(iff)<=lev_files(iff) ) then
@@ -831,7 +958,11 @@
        integer                          :: iff
        integer, dimension(nfiles)       :: flag_var
-       character(len=*)                 :: nomvar
+       character(len=20)                 :: nomvar
        character(len=*)                 :: titrevar
        character(len=*)                 :: unitvar
+
+       if (iff.eq.1) then
+   call conf_physoutputs(nomvar,flag_var)
+       endif
 
        if ( flag_var(iff)<=lev_files(iff) ) then
@@ -843,4 +974,26 @@
       end subroutine histdef3d
 
+      SUBROUTINE conf_physoutputs(nam_var,flag_var)
+       use ioipsl
+
+       IMPLICIT NONE
+
+       character(len=20)                :: nam_var
+       integer, dimension(nfiles)      :: flag_var
+       integer, dimension(nfiles),save :: flag_var_omp
+       character(len=20),save           :: nam_var_omp
+
+        flag_var_omp = flag_var
+        nam_var_omp = nam_var
+        print*,'Avant getin: nam_var flag_var ',nam_var,flag_var(:)
+        call getin('flag_'//nam_var,flag_var_omp)
+        flag_var = flag_var_omp
+        call getin('name_'//nam_var,nam_var_omp)
+        nam_var=nam_var_omp
+        
+        print*,'Apres getin: nam_var flag_var ',nam_var,flag_var(:)
+
+      END SUBROUTINE conf_physoutputs
+
 END MODULE phys_output_mod
 
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_write.h
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_write.h	(revision 1082)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_write.h	(revision 1083)
@@ -8,426 +8,425 @@
 
 !!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       IF (flag_phis(iff)<=lev_files(iff)) THEN 
+       IF (o_phis%flag(iff)<=lev_files(iff)) THEN 
          CALL histwrite_phy(nid_files(iff),
-     $                      "phis",itau_w,pphis)
-       ENDIF
-
-       IF (flag_aire(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"aire",itau_w,airephy)
-       ENDIF
-
-       IF (flag_pourc_sol(iff)<=lev_files(iff)) THEN
-      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_ter)* 100.
-      CALL histwrite_phy(nid_files(iff),
-     $                   "pourc_"//clnsurf(is_ter),itau_w,
-     $                   zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_fract_sol(iff)<=lev_files(iff)) THEN
-      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_ter)
-      CALL histwrite_phy(nid_files(iff),
-     $               "fract_"//clnsurf(is_ter),itau_w,
-     $               zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_contfracATM(iff)<=lev_files(iff)) THEN
+     $                      o_phis%name,itau_w,pphis)
+       ENDIF
+
+       IF (o_aire%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_aire%name,itau_w,airephy)
+       ENDIF
+
+       IF (o_contfracATM%flag(iff)<=lev_files(iff)) THEN
       DO i=1, klon
        zx_tmp_fi2d(i)=pctsrf(i,is_ter)+pctsrf(i,is_lic)
       ENDDO
       CALL histwrite_phy(nid_files(iff),
-     $                   "contfracATM",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_contfracOR(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"contfracOR",itau_w,
+     $             o_contfracATM%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_contfracOR%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_contfracOR%name,itau_w,
      $                   pctsrf(:,is_ter))
        ENDIF
 
-       IF (flag_aireTER(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),
-     $                  "aireTER",itau_w,paire_ter)
+       IF (o_aireTER%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     $                  o_aireTER%name,itau_w,paire_ter)
        ENDIF
 
 !!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-       IF (flag_flat(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"flat",itau_w,zxfluxlat)
-       ENDIF
-
-       IF (flag_slp(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"slp",itau_w,slp)
-       ENDIF
-
-       IF (flag_tsol(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"tsol",itau_w,zxtsol)
-       ENDIF
-
-       IF (flag_t2m(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"t2m",itau_w,zt2m)
-       ENDIF
-
-       IF (flag_t2m_min(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"t2m_min",itau_w,zt2m)
-       ENDIF
-
-       IF (flag_t2m_max(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"t2m_max",itau_w,zt2m)
-       ENDIF
-
-       IF (flag_wind10m(iff)<=lev_files(iff)) THEN
+       IF (o_flat%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_flat%name,itau_w,zxfluxlat)
+       ENDIF
+
+       IF (o_slp%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_slp%name,itau_w,slp)
+       ENDIF
+
+       IF (o_tsol%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_tsol%name,itau_w,zxtsol)
+       ENDIF
+
+       IF (o_t2m%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_t2m%name,itau_w,zt2m)
+       ENDIF
+
+       IF (o_t2m_min%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_t2m_min%name,itau_w,zt2m)
+       ENDIF
+
+       IF (o_t2m_max%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_t2m_max%name,itau_w,zt2m)
+       ENDIF
+
+       IF (o_wind10m%flag(iff)<=lev_files(iff)) THEN
       DO i=1, klon
        zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
       ENDDO
-      CALL histwrite_phy(nid_files(iff),"wind10m",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_wind10max(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                  o_wind10m%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_wind10max%flag(iff)<=lev_files(iff)) THEN
       DO i=1, klon
        zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
       ENDDO
-      CALL histwrite_phy(nid_files(iff),"wind10max", 
+      CALL histwrite_phy(nid_files(iff),o_wind10max%name, 
      $                   itau_w,zx_tmp_fi2d)
        ENDIF
 
-       IF (flag_sicf(iff)<=lev_files(iff)) THEN
+       IF (o_sicf%flag(iff)<=lev_files(iff)) THEN
       DO i = 1, klon
          zx_tmp_fi2d(i) = pctsrf(i,is_sic)
       ENDDO
-      CALL histwrite_phy(nid_files(iff),"sicf",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_q2m(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"q2m",itau_w,zq2m)
-       ENDIF
-
-       IF (flag_u10m(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"u10m",itau_w,zu10m)
-       ENDIF
-
-       IF (flag_v10m(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"v10m",itau_w,zv10m)
-       ENDIF
-
-       IF (flag_psol(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     $                   o_sicf%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_q2m%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_q2m%name,itau_w,zq2m)
+       ENDIF
+
+       IF (o_u10m%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_u10m%name,itau_w,zu10m)
+       ENDIF
+
+       IF (o_v10m%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_v10m%name,itau_w,zv10m)
+       ENDIF
+
+       IF (o_psol%flag(iff)<=lev_files(iff)) THEN
       DO i = 1, klon
          zx_tmp_fi2d(i) = paprs(i,1)
       ENDDO
-      CALL histwrite_phy(nid_files(iff),"psol",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_qsurf(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"qsurf",itau_w,zxqsurf)
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_psol%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_qsurf%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_qsurf%name,itau_w,zxqsurf)
        ENDIF
 
        if (.not. ok_veget) then
-         IF (flag_qsol(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),"qsol",itau_w,qsol)
+         IF (o_qsol%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),o_qsol%name,itau_w,qsol)
          ENDIF
        endif
 
-      IF (flag_precip(iff)<=lev_files(iff)) THEN
+      IF (o_precip%flag(iff)<=lev_files(iff)) THEN
        DO i = 1, klon
          zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i)
        ENDDO
-      CALL histwrite_phy(nid_files(iff),"precip",itau_w,zx_tmp_fi2d)
-      ENDIF
-
-       IF (flag_ndayrain(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"ndayrain",itau_w,nday_rain)
-       ENDIF
-
-      IF (flag_plul(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_precip%name,
+     s                   itau_w,zx_tmp_fi2d)
+      ENDIF
+
+       IF (o_ndayrain%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ndayrain%name,
+     s                   itau_w,nday_rain)
+       ENDIF
+
+      IF (o_plul%flag(iff)<=lev_files(iff)) THEN
        DO i = 1, klon
          zx_tmp_fi2d(i) = rain_lsc(i) + snow_lsc(i)
        ENDDO
-      CALL histwrite_phy(nid_files(iff),"plul",itau_w,zx_tmp_fi2d)
-      ENDIF
-
-      IF (flag_pluc(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_plul%name,itau_w,zx_tmp_fi2d)
+      ENDIF
+
+      IF (o_pluc%flag(iff)<=lev_files(iff)) THEN
       DO i = 1, klon
          zx_tmp_fi2d(i) = rain_con(i) + snow_con(i)
       ENDDO
-      CALL histwrite_phy(nid_files(iff),"pluc",itau_w,zx_tmp_fi2d)
-      ENDIF
-
-       IF (flag_snow(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"snow",itau_w,snow_fall)
-       ENDIF
-
-       IF (flag_evap(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"evap",itau_w,evap)
-       ENDIF
-
-       IF (flag_tops(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"tops",itau_w,topsw)
-       ENDIF
-
-       IF (flag_tops0(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"tops0",itau_w,topsw0)
-       ENDIF
-
-       IF (flag_topl(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"topl",itau_w,toplw)
-       ENDIF
-
-       IF (flag_topl0(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"topl0",itau_w,toplw0)
-       ENDIF
-
-       IF (flag_SWupTOA(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_pluc%name,itau_w,zx_tmp_fi2d)
+      ENDIF
+
+       IF (o_snow%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_snow%name,itau_w,snow_fall)
+       ENDIF
+
+       IF (o_evap%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_evap%name,itau_w,evap)
+       ENDIF
+
+       IF (o_tops%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_tops%name,itau_w,topsw)
+       ENDIF
+
+       IF (o_tops0%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_tops0%name,itau_w,topsw0)
+       ENDIF
+
+       IF (o_topl%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_topl%name,itau_w,toplw)
+       ENDIF
+
+       IF (o_topl0%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_topl0%name,itau_w,toplw0)
+       ENDIF
+
+       IF (o_SWupTOA%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, klevp1 )
-      CALL histwrite_phy(nid_files(iff), "SWupTOA",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_SWupTOAclr(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_SWupTOA%name,
+     s                     itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_SWupTOAclr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, klevp1 )
       CALL histwrite_phy(nid_files(iff), 
-     $                  "SWupTOAclr",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_SWdnTOA(iff)<=lev_files(iff)) THEN
+     $                  o_SWupTOAclr%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_SWdnTOA%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, klevp1 )
-      CALL histwrite_phy(nid_files(iff), "SWdnTOA",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_SWdnTOAclr(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                  o_SWdnTOA%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_SWdnTOAclr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, klevp1 )
       CALL histwrite_phy(nid_files(iff), 
-     $                  "SWdnTOAclr",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_SWup200(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"SWup200",itau_w,SWup200)
-       ENDIF
-
-       IF (flag_SWup200clr(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"SWup200clr",itau_w,SWup200clr)
-       ENDIF
-
-       IF (flag_SWdn200(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"SWdn200",itau_w,SWdn200)
-       ENDIF
-
-       IF (flag_SWdn200clr(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"SWdn200clr",itau_w,SWdn200clr)
-       ENDIF
-
-       IF (flag_LWup200(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"LWup200",itau_w,LWup200)
-       ENDIF
-
-       IF (flag_LWup200clr(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"LWup200clr",itau_w,LWup200clr)
-       ENDIF
-
-       IF (flag_LWdn200(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"LWdn200",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_LWdn200clr(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"LWdn200clr",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_sols(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"sols",itau_w,solsw)
-       ENDIF
-
-       IF (flag_sols0(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"sols0",itau_w,solsw0)
-       ENDIF
-
-       IF (flag_soll(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"soll",itau_w,sollw)
-       ENDIF
-
-       IF (flag_radsol(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"radsol",itau_w,radsol)
-       ENDIF
-
-       IF (flag_soll0(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"soll0",itau_w,sollw0)
-       ENDIF
-
-       IF (flag_SWupSFC(iff)<=lev_files(iff)) THEN
+     $                  o_SWdnTOAclr%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)
+       ENDIF
+
+       IF (o_SWup200clr%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_SWup200clr%name,itau_w,SWup200clr)
+       ENDIF
+
+       IF (o_SWdn200%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_SWdn200%name,itau_w,SWdn200)
+       ENDIF
+
+       IF (o_SWdn200clr%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                o_SWdn200clr%name,itau_w,SWdn200clr)
+       ENDIF
+
+       IF (o_LWup200%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_LWup200%name,itau_w,LWup200)
+       ENDIF
+
+       IF (o_LWup200clr%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_LWup200clr%name,itau_w,LWup200clr)
+       ENDIF
+
+       IF (o_LWdn200%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_LWdn200%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_LWdn200clr%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                  o_LWdn200clr%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_sols%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_sols%name,itau_w,solsw)
+       ENDIF
+
+       IF (o_sols0%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_sols0%name,itau_w,solsw0)
+       ENDIF
+
+       IF (o_soll%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_soll%name,itau_w,sollw)
+       ENDIF
+
+       IF (o_radsol%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_radsol%name,itau_w,radsol)
+       ENDIF
+
+       IF (o_soll0%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_soll0%name,itau_w,sollw0)
+       ENDIF
+
+       IF (o_SWupSFC%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, 1 )
-      CALL histwrite_phy(nid_files(iff), "SWupSFC",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_SWupSFCclr(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s               o_SWupSFC%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_SWupSFCclr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, 1 )
       CALL histwrite_phy(nid_files(iff), 
-     $                   "SWupSFCclr",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_SWdnSFC(iff)<=lev_files(iff)) THEN
+     $                   o_SWupSFCclr%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_SWdnSFC%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, 1 )
       CALL histwrite_phy(nid_files(iff), 
-     $                   "SWdnSFC",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_SWdnSFCclr(iff)<=lev_files(iff)) THEN
+     $                   o_SWdnSFC%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_SWdnSFCclr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, 1 )
       CALL histwrite_phy(nid_files(iff), 
-     $                  "SWdnSFCclr",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_LWupSFC(iff)<=lev_files(iff)) THEN
+     $                  o_SWdnSFCclr%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_LWupSFC%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1:klon)=sollwdown(1:klon)-sollw(1:klon)
       CALL histwrite_phy(nid_files(iff),
-     $                    "LWupSFC",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_LWdnSFC(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),
-     $                   "LWdnSFC",itau_w,sollwdown)
+     $                    o_LWupSFC%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_LWdnSFC%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     $                   o_LWdnSFC%name,itau_w,sollwdown)
        ENDIF
 
        sollwdownclr(1:klon) = -1.*lwdn0(1:klon,1)
-       IF (flag_LWupSFCclr(iff)<=lev_files(iff)) THEN
+       IF (o_LWupSFCclr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1:klon)=sollwdownclr(1:klon)-sollw0(1:klon)
       CALL histwrite_phy(nid_files(iff),
-     $                   "LWupSFCclr",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_LWdnSFCclr(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),
-     $                   "LWdnSFCclr",itau_w,sollwdownclr)
-       ENDIF
-
-       IF (flag_bils(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"bils",itau_w,bils)
-       ENDIF
-
-       IF (flag_sens(iff)<=lev_files(iff)) THEN
+     $                   o_LWupSFCclr%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_LWdnSFCclr%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     $                   o_LWdnSFCclr%name,itau_w,sollwdownclr)
+       ENDIF
+
+       IF (o_bils%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_bils%name,itau_w,bils)
+       ENDIF
+
+       IF (o_sens%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1:klon)=-1*sens(1:klon)
-      CALL histwrite_phy(nid_files(iff),"sens",itau_w,zx_tmp_fi2d)
-       ENDIF
-
-       IF (flag_fder(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"fder",itau_w,fder)
-       ENDIF
-
-       IF (flag_ffonte(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"ffonte",itau_w,zxffonte)
-       ENDIF
-
-       IF (flag_fqcalving(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_sens%name,itau_w,zx_tmp_fi2d)
+       ENDIF
+
+       IF (o_fder%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_fder%name,itau_w,fder)
+       ENDIF
+
+       IF (o_ffonte%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_ffonte%name,itau_w,zxffonte)
+       ENDIF
+
+       IF (o_fqcalving%flag(iff)<=lev_files(iff)) THEN
        CALL histwrite_phy(nid_files(iff),
-     $                    "fqcalving",itau_w,zxfqcalving)
-       ENDIF
-
-       IF (flag_fqfonte(iff)<=lev_files(iff)) THEN
+     $                    o_fqcalving%name,itau_w,zxfqcalving)
+       ENDIF
+
+       IF (o_fqfonte%flag(iff)<=lev_files(iff)) THEN
        CALL histwrite_phy(nid_files(iff),
-     $                    "fqfonte",itau_w,zxfqfonte)
+     $                   o_fqfonte%name,itau_w,zxfqfonte)
        ENDIF
 
          DO nsrf = 1, nbsrf
-           IF(nsrf.GE.2) THEN
-            IF (flag_pourc_sol(iff)<=lev_files(iff)) THEN
+!           IF(nsrf.GE.2) THEN
+            IF (o_pourc_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
             zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)*100.
             CALL histwrite_phy(nid_files(iff),
-     $                     "pourc_"//clnsurf(nsrf),itau_w,
+     $                     o_pourc_srf(nsrf)%name,itau_w,
      $                     zx_tmp_fi2d)
             ENDIF
 
-          IF (flag_fract_sol(iff)<=lev_files(iff)) THEN
+          IF (o_fract_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
           zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
           CALL histwrite_phy(nid_files(iff),
-     $                    "fract_"//clnsurf(nsrf),itau_w,
+     $                  o_fract_srf(nsrf)%name,itau_w,
+     $                  zx_tmp_fi2d)
+          ENDIF
+!         ENDIF !nsrf.GT.2
+
+        IF (o_taux_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
+        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
+        CALL histwrite_phy(nid_files(iff),
+     $                     o_taux_srf(nsrf)%name,itau_w,
+     $                     zx_tmp_fi2d)
+        ENDIF
+
+        IF (o_tauy_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN           
+        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
+        CALL histwrite_phy(nid_files(iff),
+     $                    o_tauy_srf(nsrf)%name,itau_w,
+     $                    zx_tmp_fi2d)
+        ENDIF
+
+        IF (o_tsol_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
+        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
+        CALL histwrite_phy(nid_files(iff),
+     $                   o_tsol_srf(nsrf)%name,itau_w,
      $      zx_tmp_fi2d)
-          ENDIF
-         ENDIF !nsrf.GT.2
-
-        IF (flag_taux_sol(iff)<=lev_files(iff)) THEN
-        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
-        CALL histwrite_phy(nid_files(iff),
-     $                     "taux_"//clnsurf(nsrf),itau_w,
-     $      zx_tmp_fi2d)
-        ENDIF
-
-        IF (flag_tauy_sol(iff)<=lev_files(iff)) THEN           
-        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
-        CALL histwrite_phy(nid_files(iff),
-     $                    "tauy_"//clnsurf(nsrf),itau_w,
-     $      zx_tmp_fi2d)
-        ENDIF
-
-        IF (flag_tsol_sol(iff)<=lev_files(iff)) THEN
-        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
-        CALL histwrite_phy(nid_files(iff),
-     $                   "tsol_"//clnsurf(nsrf),itau_w,
-     $      zx_tmp_fi2d)
-        ENDIF
-
-      IF (flag_u10m_sol(iff)<=lev_files(iff)) THEN
+        ENDIF
+
+      IF (o_u10m_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = u10m(1 : klon, nsrf)
-      CALL histwrite_phy(nid_files(iff),"u10m_"//clnsurf(nsrf),
+      CALL histwrite_phy(nid_files(iff),o_u10m_srf(nsrf)%name,
      $                 itau_w,zx_tmp_fi2d)
       ENDIF
 
-      IF (flag_v10m_sol(iff)<=lev_files(iff)) THEN
+      IF (o_v10m_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = v10m(1 : klon, nsrf)
-      CALL histwrite_phy(nid_files(iff),"v10m_"//clnsurf(nsrf),
+      CALL histwrite_phy(nid_files(iff),o_v10m_srf(nsrf)%name,
      $              itau_w,zx_tmp_fi2d)
       ENDIF
  
-      IF (flag_t2m_sol(iff)<=lev_files(iff)) THEN
+      IF (o_t2m_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = t2m(1 : klon, nsrf)
-      CALL histwrite_phy(nid_files(iff),"t2m_"//clnsurf(nsrf),
+      CALL histwrite_phy(nid_files(iff),o_t2m_srf(nsrf)%name,
      $           itau_w,zx_tmp_fi2d)
       ENDIF
 
-       IF (flag_sens_sol(iff)<=lev_files(iff)) THEN
+       IF (o_sens_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
        CALL histwrite_phy(nid_files(iff),
-     $                     "sens_"//clnsurf(nsrf),itau_w,
+     $                    o_sens_srf(nsrf)%name,itau_w,
      $      zx_tmp_fi2d)
        ENDIF
 
-        IF (flag_lat_sol(iff)<=lev_files(iff)) THEN
+        IF (o_lat_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
         zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
         CALL histwrite_phy(nid_files(iff),
-     $                 "lat_"//clnsurf(nsrf),itau_w,
+     $                 o_lat_srf(nsrf)%name,itau_w,
      $                                   zx_tmp_fi2d)
           ENDIF
 
-        IF (flag_flw_sol(iff)<=lev_files(iff)) THEN
+        IF (o_flw_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
         zx_tmp_fi2d(1 : klon) = fsollw( 1 : klon, nsrf)
         CALL histwrite_phy(nid_files(iff),
-     $                     "flw_"//clnsurf(nsrf),itau_w,
+     $                     o_flw_srf(nsrf)%name,itau_w,
      $      zx_tmp_fi2d)
         ENDIF
 
-        IF (flag_fsw_sol(iff)<=lev_files(iff)) THEN
+        IF (o_fsw_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
         zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, nsrf)
         CALL histwrite_phy(nid_files(iff),
-     $                     "fsw_"//clnsurf(nsrf),itau_w,
+     $                   o_fsw_srf(nsrf)%name,itau_w,
      $      zx_tmp_fi2d)
         ENDIF
 
-        IF (flag_wbils_sol(iff)<=lev_files(iff)) THEN
+        IF (o_wbils_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
         zx_tmp_fi2d(1 : klon) = wfbils( 1 : klon, nsrf)
         CALL histwrite_phy(nid_files(iff),
-     $                     "wbils_"//clnsurf(nsrf),itau_w,
+     $                   o_wbils_srf(nsrf)%name,itau_w,
      $      zx_tmp_fi2d)
         ENDIF
 
-        IF (flag_wbilo_sol(iff)<=lev_files(iff)) THEN
+        IF (o_wbilo_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
         zx_tmp_fi2d(1 : klon) = wfbilo( 1 : klon, nsrf)
         CALL histwrite_phy(nid_files(iff),
-     $                    "wbilo_"//clnsurf(nsrf),itau_w,
+     $                    o_wbilo_srf(nsrf)%name,itau_w,
      $      zx_tmp_fi2d)
         ENDIF
 
        if (iflag_pbl>1 .and. lev_histday.gt.10 ) then
-        IF (flag_tke_sol(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),
-     $                    "tke_"//clnsurf(nsrf),itau_w,
-     $      pbl_tke(:,1:klev,nsrf))
-       ENDIF
-
-        IF (flag_tke_max_sol(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),
-     $                    "tke_max_"//clnsurf(nsrf),itau_w,
+        IF (o_tke_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),
+     $                   o_tke_srf(nsrf)%name,itau_w,
+     $                    pbl_tke(:,1:klev,nsrf))
+       ENDIF
+
+        IF (o_tke_max_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),
+     $                    o_tke_max_srf(nsrf)%name,itau_w,
      $      pbl_tke(:,1:klev,nsrf))
         ENDIF
@@ -435,119 +434,121 @@
       ENDDO
 
-        IF (flag_cdrm(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cdrm",itau_w,cdragm)
-        ENDIF
-
-        IF (flag_cdrh(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cdrh",itau_w,cdragh)
-        ENDIF
-
-        IF (flag_cldl(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cldl",itau_w,cldl)
-        ENDIF
-
-        IF (flag_cldm(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cldm",itau_w,cldm)
-        ENDIF
-
-        IF (flag_cldh(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cldh",itau_w,cldh)
-        ENDIF
-
-        IF (flag_cldt(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cldt", 
+        IF (o_cdrm%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cdrm%name,itau_w,cdragm)
+        ENDIF
+
+        IF (o_cdrh%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cdrh%name,itau_w,cdragh)
+        ENDIF
+
+        IF (o_cldl%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cldl%name,itau_w,cldl)
+        ENDIF
+
+        IF (o_cldm%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cldm%name,itau_w,cldm)
+        ENDIF
+
+        IF (o_cldh%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cldh%name,itau_w,cldh)
+        ENDIF
+
+        IF (o_cldt%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cldt%name, 
      &                   itau_w,cldt*100)
         ENDIF
 
-        IF (flag_cldq(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cldq",itau_w,cldq)
-        ENDIF
-
-        IF (flag_lwp(iff)<=lev_files(iff)) THEN
+        IF (o_cldq%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cldq%name,itau_w,cldq)
+        ENDIF
+
+        IF (o_lwp%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1:klon) = flwp(1:klon)
-      CALL histwrite_phy(nid_files(iff),"lwp",itau_w,zx_tmp_fi2d)
-        ENDIF
-
-        IF (flag_iwp(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_lwp%name,itau_w,zx_tmp_fi2d)
+        ENDIF
+
+        IF (o_iwp%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1:klon) = fiwp(1:klon)
-      CALL histwrite_phy(nid_files(iff),"iwp",itau_w,zx_tmp_fi2d)
-        ENDIF
-
-        IF (flag_ue(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"ue",itau_w,ue)
-        ENDIF
-
-        IF (flag_ve(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"ve",itau_w,ve)
-        ENDIF
-
-        IF (flag_uq(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"uq",itau_w,uq)
-        ENDIF
-
-        IF (flag_vq(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"vq",itau_w,vq)
+      CALL histwrite_phy(nid_files(iff),
+     s                    o_iwp%name,itau_w,zx_tmp_fi2d)
+        ENDIF
+
+        IF (o_ue%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ue%name,itau_w,ue)
+        ENDIF
+
+        IF (o_ve%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ve%name,itau_w,ve)
+        ENDIF
+
+        IF (o_uq%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_uq%name,itau_w,uq)
+        ENDIF
+
+        IF (o_vq%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_vq%name,itau_w,vq)
         ENDIF
 
       IF(iflag_con.GE.3) THEN ! sb
-        IF (flag_cape(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cape",itau_w,cape)
-        ENDIF
-
-        IF (flag_pbase(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"pbase",itau_w,pbase)
-        ENDIF
-
-        IF (flag_ptop(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"ptop",itau_w,ema_pct)
-        ENDIF
-
-        IF (flag_fbase(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"fbase",itau_w,ema_cbmf)
-        ENDIF
-
-        IF (flag_prw(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"prw",itau_w,prw)
+        IF (o_cape%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cape%name,itau_w,cape)
+        ENDIF
+
+        IF (o_pbase%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_pbase%name,itau_w,pbase)
+        ENDIF
+
+        IF (o_ptop%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ptop%name,itau_w,ema_pct)
+        ENDIF
+
+        IF (o_fbase%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_fbase%name,itau_w,ema_cbmf)
+        ENDIF
+
+        IF (o_prw%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_prw%name,itau_w,prw)
         ENDIF
       ENDIF !iflag_con .GE. 3
 
-        IF (flag_s_pblh(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_pblh",itau_w,s_pblh)
-        ENDIF
-
-        IF (flag_s_pblt(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_pblt",itau_w,s_pblt)
-        ENDIF
-
-        IF (flag_s_lcl(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_lcl",itau_w,s_lcl)
-        ENDIF
-
-        IF (flag_s_capCL(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_capCL",itau_w,s_capCL)
-        ENDIF
-
-        IF (flag_s_oliqCL(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_oliqCL",itau_w,s_oliqCL)
-        ENDIF
-
-        IF (flag_s_cteiCL(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_cteiCL",itau_w,s_cteiCL)
-        ENDIF
-
-        IF (flag_s_therm(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_therm",itau_w,s_therm)
-        ENDIF
-
-        IF (flag_s_trmb1(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_trmb1",itau_w,s_trmb1)
-        ENDIF
-
-        IF (flag_s_trmb2(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_trmb2",itau_w,s_trmb2)
-        ENDIF
-
-        IF (flag_s_trmb3(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"s_trmb3",itau_w,s_trmb3)
+        IF (o_s_pblh%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_pblh%name,itau_w,s_pblh)
+        ENDIF
+
+        IF (o_s_pblt%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_pblt%name,itau_w,s_pblt)
+        ENDIF
+
+        IF (o_s_lcl%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_lcl%name,itau_w,s_lcl)
+        ENDIF
+
+        IF (o_s_capCL%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_capCL%name,itau_w,s_capCL)
+        ENDIF
+
+        IF (o_s_oliqCL%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_oliqCL%name,itau_w,s_oliqCL)
+        ENDIF
+
+        IF (o_s_cteiCL%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_cteiCL%name,itau_w,s_cteiCL)
+        ENDIF
+
+        IF (o_s_therm%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_therm%name,itau_w,s_therm)
+        ENDIF
+
+        IF (o_s_trmb1%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_trmb1%name,itau_w,s_trmb1)
+        ENDIF
+
+        IF (o_s_trmb2%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_trmb2%name,itau_w,s_trmb2)
+        ENDIF
+
+        IF (o_s_trmb3%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_s_trmb3%name,itau_w,s_trmb3)
         ENDIF
 
@@ -559,4 +560,5 @@
 !      on ecrit u v t q a 850 700 500 200 au niv 3
 
+        ll=0
         DO k=1, nlevSTD
          IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
@@ -566,33 +568,33 @@
 
 ! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       IF (flag_ulevsSTD(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"u"//bb2,
-     & itau_w,uwriteSTD(:,k,iff))
-       ENDIF
-
-       IF (flag_vlevsSTD(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"v"//bb2,  
-     & itau_w,vwriteSTD(:,k,iff))
-       ENDIF
-
-       IF (flag_wlevsSTD(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"w"//bb2,
-     & itau_w,wwriteSTD(:,k,iff))
-       ENDIF
-
-       IF (flag_philevsSTD(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),
-     $                  "phi"//bb2,
+          ll=ll+1
+       IF (o_uSTDlevs(ll)%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_uSTDlevs(ll)%name,
+     &                    itau_w,uwriteSTD(:,k,iff))
+       ENDIF
+
+       IF (o_vSTDlevs(ll)%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_vSTDlevs(ll)%name,  
+     &                   itau_w,vwriteSTD(:,k,iff))
+       ENDIF
+
+       IF (o_wSTDlevs(ll)%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_wSTDlevs(ll)%name,
+     &                    itau_w,wwriteSTD(:,k,iff))
+       ENDIF
+
+       IF (o_phiSTDlevs(ll)%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_phiSTDlevs(ll)%name,
      &               itau_w,phiwriteSTD(:,k,iff))
        ENDIF
 
-       IF (flag_qlevsSTD(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"q"//bb2,
-     & itau_w, qwriteSTD(:,k,iff))
-       ENDIF
-
-       IF (flag_tlevsSTD(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"t"//bb2,
-     & itau_w, twriteSTD(:,k,iff))
+       IF (o_qSTDlevs(ll)%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_qSTDlevs(ll)%name,
+     &                   itau_w, qwriteSTD(:,k,iff))
+       ENDIF
+
+       IF (o_tSTDlevs(ll)%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_tSTDlevs(ll)%name,
+     &                   itau_w, twriteSTD(:,k,iff))
        ENDIF
 
@@ -600,5 +602,5 @@
        ENDDO
 
-      IF (flag_t_oce_sic(iff)<=lev_files(iff)) THEN
+      IF (o_t_oce_sic%flag(iff)<=lev_files(iff)) THEN
       DO i=1, klon
        IF (pctsrf(i,is_oce).GT.epsfra.OR.
@@ -611,5 +613,6 @@
        ENDIF
       ENDDO
-      CALL histwrite_phy(nid_files(iff),"t_oce_sic",itau_w,zx_tmp_fi2d)
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_t_oce_sic%name,itau_w,zx_tmp_fi2d)
       ENDIF
 
@@ -618,231 +621,241 @@
       IF (iflag_con.GE.3) THEN
       IF (iflag_coupl.EQ.1) THEN
-       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)
+       IF (o_ale_bl%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_ale_bl%name,itau_w,ale_bl)
+       ENDIF
+       IF (o_alp_bl%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_alp_bl%name,itau_w,alp_bl)
        ENDIF
       ENDIF !iflag_coupl.EQ.1
-
+      ENDIF !(iflag_con.GE.3)
+      IF (iflag_con.EQ.3) THEN
       IF (iflag_wake.EQ.1) THEN
-       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
-
-       IF (flag_ale(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"ale",itau_w,ale)
-       ENDIF
-       IF (flag_alp(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"alp",itau_w,alp)
-       ENDIF
-       IF (flag_cin(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"cin",itau_w,cin)
-       ENDIF
-       IF (flag_wape(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"WAPE",itau_w,wake_pe)
-       ENDIF
-       IF (flag_wake_h(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"wake_h",itau_w,wake_h)
-       ENDIF
-
-       IF (flag_wake_s(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"wake_s",itau_w,wake_s)
-       ENDIF
-
-        IF (flag_wake_deltat(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"wake_deltat",
+       IF (o_ale_wk%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_ale_wk%name,itau_w,ale_wake)
+       ENDIF
+       IF (o_alp_wk%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_alp_wk%name,itau_w,alp_wake)
+       ENDIF
+
+       IF (o_ale%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_ale%name,itau_w,ale)
+       ENDIF
+       IF (o_alp%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_alp%name,itau_w,alp)
+       ENDIF
+       IF (o_cin%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_cin%name,itau_w,cin)
+       ENDIF
+       IF (o_wape%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_WAPE%name,itau_w,wake_pe)
+       ENDIF
+       IF (o_wake_h%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_wake_h%name,itau_w,wake_h)
+       ENDIF
+
+       IF (o_wake_s%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_wake_s%name,itau_w,wake_s)
+       ENDIF
+
+        IF (o_wake_deltat%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_wake_deltat%name,
      $                     itau_w,wake_deltat)
         ENDIF
 
-        IF (flag_wake_deltaq(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"wake_deltaq",
+        IF (o_wake_deltaq%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_wake_deltaq%name,
      $                    itau_w,wake_deltaq)
         ENDIF
 
-        IF (flag_wake_omg(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"wake_omg",itau_w,wake_omg)
-        ENDIF
-      ENDIF
-
-        IF (flag_Vprecip(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"Vprecip",itau_w,Vprecip)
-        ENDIF
-
-        IF (flag_ftd(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"ftd",itau_w,ftd)
-        ENDIF
-
-        IF (flag_fqd(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"fqd",itau_w,fqd)
-        ENDIF
-
-      ENDIF !(iflag_con.GE.3) 
+        IF (o_wake_omg%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),
+     s                    o_wake_omg%name,itau_w,wake_omg)
+        ENDIF
+      ENDIF
+
+        IF (o_Vprecip%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_Vprecip%name,itau_w,Vprecip)
+        ENDIF
+
+        IF (o_ftd%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_ftd%name,itau_w,ftd)
+        ENDIF
+
+        IF (o_fqd%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_fqd%name,itau_w,fqd)
+        ENDIF
+
+      ENDIF !(iflag_con.EQ.3) 
  
       ELSE IF (type_ocean=='slab  ') THEN
 
-      IF ( flag_slab_bils(iff)<=lev_files(iff)) 
+      IF ( o_slab_bils%flag(iff)<=lev_files(iff)) 
      $     CALL histwrite_phy(
-     $     nid_files(iff),"slab_wbils_oce",itau_w,slab_wfbils)
+     $     nid_files(iff),o_slab_bils%name,itau_w,slab_wfbils)
 
       ENDIF !type_ocean == force/slab
 
-      IF (flag_weakinv(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"weakinv",itau_w,weak_inversion)
-      ENDIF
-
-      IF (flag_dthmin(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dthmin",itau_w,dthmin)
-      ENDIF
-
-       IF (flag_cldtau(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"cldtau",itau_w,cldtau)
-       ENDIF
-
-       IF (flag_cldemi(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"cldemi",itau_w,cldemi)
-       ENDIF
-
-!      IF (flag_pr_con_l(iff)<=lev_files(iff)) THEN
-!      CALL histwrite_phy(nid_files(iff),"pmflxr",itau_w,pmflxr)
+      IF (o_weakinv%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                  o_weakinv%name,itau_w,weak_inversion)
+      ENDIF
+
+      IF (o_dthmin%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dthmin%name,itau_w,dthmin)
+      ENDIF
+
+       IF (o_cldtau%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_cldtau%name,itau_w,cldtau)
+       ENDIF
+
+       IF (o_cldemi%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_cldemi%name,itau_w,cldemi)
+       ENDIF
+
+!      IF (o_pr_con_l%flag(iff)<=lev_files(iff)) THEN
+!      CALL histwrite_phy(nid_files(iff),o_pmflxr%name,itau_w,pmflxr)
 !      ENDIF
 
-!      IF (flag_pr_con_i(iff)<=lev_files(iff)) THEN
-!      CALL histwrite_phy(nid_files(iff),"pmflxs",itau_w,pmflxs)
+!      IF (o_pr_con_i%flag(iff)<=lev_files(iff)) THEN
+!      CALL histwrite_phy(nid_files(iff),o_pmflxs%name,itau_w,pmflxs)
 !      ENDIF
 
-!      IF (flag_pr_lsc_l(iff)<=lev_files(iff)) THEN
-!      CALL histwrite_phy(nid_files(iff),"prfl",itau_w,prfl)
+!      IF (o_pr_lsc_l%flag(iff)<=lev_files(iff)) THEN
+!      CALL histwrite_phy(nid_files(iff),o_prfl%name,itau_w,prfl)
 !      ENDIF
 
-!      IF (flag_pr_lsc_i(iff)<=lev_files(iff)) THEN
-!      CALL histwrite_phy(nid_files(iff),"psfl",itau_w,psfl)
+!      IF (o_pr_lsc_i%flag(iff)<=lev_files(iff)) THEN
+!      CALL histwrite_phy(nid_files(iff),o_psfl%name,itau_w,psfl)
 !      ENDIF
 
-      IF (flag_rh2m(iff)<=lev_files(iff)) THEN
+      IF (o_rh2m%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),"rh2m",itau_w,zx_tmp_fi2d)
-      ENDIF
-
-      IF (flag_qsat2m(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"qsat2m",itau_w,qsat2m)
-      ENDIF
-
-      IF (flag_tpot(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"tpot",itau_w,tpot)
-      ENDIF
-
-       IF (flag_tpote(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"tpote",itau_w,tpote)
-       ENDIF
-
-      IF (flag_SWnetOR(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_rh2m%name,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)
+      ENDIF
+
+      IF (o_tpot%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_tpot%name,itau_w,tpot)
+      ENDIF
+
+       IF (o_tpote%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_tpote%name,itau_w,tpote)
+       ENDIF
+
+      IF (o_SWnetOR%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
-      CALL histwrite_phy(nid_files(iff),"SWnetOR",itau_w, zx_tmp_fi2d)
-      ENDIF
-
-      IF (flag_SWdownOR(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_SWnetOR%name,itau_w, zx_tmp_fi2d)
+      ENDIF
+
+      IF (o_SWdownOR%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
-      CALL histwrite_phy(nid_files(iff),"SWdownOR",itau_w, zx_tmp_fi2d)
-      ENDIF
-
-      IF (flag_LWdownOR(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"LWdownOR",itau_w,sollwdown)
-      ENDIF
-
-      IF (flag_snowl(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"snowl",itau_w,snow_lsc)
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_SWdownOR%name,itau_w, zx_tmp_fi2d)
+      ENDIF
+
+      IF (o_LWdownOR%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                  o_LWdownOR%name,itau_w,sollwdown)
+      ENDIF
+
+      IF (o_snowl%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_snowl%name,itau_w,snow_lsc)
       ENDIF
 
       IF (iflag_con.GE.3) THEN
-      IF (flag_cape_max(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"cape_max",itau_w,cape)
+      IF (o_cape_max%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_cape_max%name,itau_w,cape)
       ENDIF
       ENDIF !(iflag_con.GE.3)
 
-      IF (flag_solldown(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"solldown",itau_w,sollwdown)
-      ENDIF
-
-      IF (flag_dtsvdfo(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dtsvdfo",itau_w,d_ts(:,is_oce))
-      ENDIF
-
-      IF (flag_dtsvdft(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dtsvdft",itau_w,d_ts(:,is_ter))
-      ENDIF
-
-       IF (flag_dtsvdfg(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),
-     $                     "dtsvdfg",itau_w, d_ts(:,is_lic))
-       ENDIF
-
-       IF (flag_dtsvdfi(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dtsvdfi",itau_w,d_ts(:,is_sic))
-       ENDIF
-
-       IF (flag_rugs(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"rugs",itau_w,zxrugs)
+      IF (o_solldown%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_solldown%name,itau_w,sollwdown)
+      ENDIF
+
+      IF (o_dtsvdfo%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                 o_dtsvdfo%name,itau_w,d_ts(:,is_oce))
+      ENDIF
+
+      IF (o_dtsvdft%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_dtsvdft%name,itau_w,d_ts(:,is_ter))
+      ENDIF
+
+       IF (o_dtsvdfg%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),
+     $                   o_dtsvdfg%name,itau_w, d_ts(:,is_lic))
+       ENDIF
+
+       IF (o_dtsvdfi%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_dtsvdfi%name,itau_w,d_ts(:,is_sic))
+       ENDIF
+
+       IF (o_rugs%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_rugs%name,itau_w,zxrugs)
        ENDIF
 
 ! Champs 3D:
-       IF (flag_lwcon(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"lwcon",itau_w,flwc)
-       ENDIF
-
-       IF (flag_iwcon(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"iwcon",itau_w,fiwc)
-       ENDIF
-
-       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
-
-       IF (flag_ovap(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"ovap",itau_w,qx(:,:,ivap))
-       ENDIF
-
-       IF (flag_geop(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"geop",itau_w,zphi)
-       ENDIF
-
-       IF (flag_vitu(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"vitu",itau_w,u_seri)
-       ENDIF
-
-       IF (flag_vitv(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"vitv",itau_w,v_seri)
-       ENDIF
-
-       IF (flag_vitw(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"vitw",itau_w,omega)
-       ENDIF
-
-        IF (flag_pres(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"pres",itau_w,pplay)
-        ENDIF
-
-       IF (flag_rneb(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"rneb",itau_w,cldfra)
-       ENDIF
-
-       IF (flag_rnebcon(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"rnebcon",itau_w,rnebcon)
-       ENDIF
-
-       IF (flag_rhum(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"rhum",itau_w,zx_rh)
-       ENDIF
-
-      IF (flag_ozone(iff)<=lev_files(iff)) THEN
+       IF (o_lwcon%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_lwcon%name,itau_w,flwc)
+       ENDIF
+
+       IF (o_iwcon%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_iwcon%name,itau_w,fiwc)
+       ENDIF
+
+       IF (o_temp%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_temp%name,itau_w,t_seri)
+       ENDIF
+
+       IF (o_theta%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_theta%name,itau_w,theta)
+       ENDIF
+
+       IF (o_ovap%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ovap%name,itau_w,qx(:,:,ivap))
+       ENDIF
+
+       IF (o_geop%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_geop%name,itau_w,zphi)
+       ENDIF
+
+       IF (o_vitu%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_vitu%name,itau_w,u_seri)
+       ENDIF
+
+       IF (o_vitv%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_vitv%name,itau_w,v_seri)
+       ENDIF
+
+       IF (o_vitw%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_vitw%name,itau_w,omega)
+       ENDIF
+
+        IF (o_pres%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_pres%name,itau_w,pplay)
+        ENDIF
+
+       IF (o_rneb%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_rneb%name,itau_w,cldfra)
+       ENDIF
+
+       IF (o_rnebcon%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_rnebcon%name,itau_w,rnebcon)
+       ENDIF
+
+       IF (o_rhum%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_rhum%name,itau_w,zx_rh)
+       ENDIF
+
+      IF (o_ozone%flag(iff)<=lev_files(iff)) THEN
       DO k=1, klev
        DO i=1, klon
@@ -852,47 +865,51 @@
        ENDDO !i
       ENDDO !k
-      CALL histwrite_phy(nid_files(iff),"ozone",itau_w,zx_tmp_fi3d)
+      CALL histwrite_phy(nid_files(iff),o_ozone%name,itau_w,zx_tmp_fi3d)
       ENDIF
 
       IF(iflag_con.GE.3) THEN
-       IF (flag_upwd(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"upwd",itau_w,upwd)
+       IF (o_upwd%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_upwd%name,itau_w,upwd)
        ENDIF
       ENDIF !(iflag_con.GE.3)
 
-       IF (flag_dtphy(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dtphy",itau_w,d_t)
-       ENDIF
-
-       IF (flag_dqphy(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dqphy",itau_w, d_qx(:,:,ivap))
+       IF (o_dtphy%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtphy%name,itau_w,d_t)
+       ENDIF
+
+       IF (o_dqphy%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                  o_dqphy%name,itau_w, d_qx(:,:,ivap))
        ENDIF
 
         DO nsrf=1, nbsrf
-        IF (flag_albe_sol(iff)<=lev_files(iff)) THEN 
+        IF (o_albe_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN 
         zx_tmp_fi2d(1 : klon) = falb1( 1 : klon, nsrf)
-        CALL histwrite_phy(nid_files(iff),"albe_"//clnsurf(nsrf),itau_w,
+        CALL histwrite_phy(nid_files(iff),
+     s                    o_albe_srf(nsrf)%name,itau_w,
+     $                     zx_tmp_fi2d)
+        ENDIF
+
+        IF (o_rugs_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN  
+        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
+        CALL histwrite_phy(nid_files(iff),
+     s                     o_rugs_srf(nsrf)%name,itau_w,
      $      zx_tmp_fi2d)
         ENDIF
 
-        IF (flag_rugs_sol(iff)<=lev_files(iff)) THEN  
-        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
-        CALL histwrite_phy(nid_files(iff),"rugs_"//clnsurf(nsrf),itau_w,
-     $      zx_tmp_fi2d)
-        ENDIF
-
-        IF (flag_ages_sol(iff)<=lev_files(iff)) THEN
+        IF (o_ages_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN
         zx_tmp_fi2d(1 : klon) = agesno( 1 : klon, nsrf)
-        CALL histwrite_phy(nid_files(iff),"ages_"//clnsurf(nsrf),itau_w
+        CALL histwrite_phy(nid_files(iff),
+     s                     o_ages_srf(nsrf)%name,itau_w
      $    ,zx_tmp_fi2d)
         ENDIF
         ENDDO !nsrf=1, nbsrf
 
-       IF (flag_albs(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"albs",itau_w,albsol1)
-       ENDIF
-
-       IF (flag_albslw(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"albslw",itau_w,albsol2)
+       IF (o_albs%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_albs%name,itau_w,albsol1)
+       ENDIF
+
+       IF (o_albslw%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_albslw%name,itau_w,albsol2)
        ENDIF
 
@@ -906,263 +923,265 @@
          enddo
       enddo
-       IF (flag_tke(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"tke",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_tke_max(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"tke_max",itau_w,zx_tmp_fi3d)
+       IF (o_tke%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_tke%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_tke_max%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_tke_max%name,itau_w,zx_tmp_fi3d)
        ENDIF
       endif
 
-       IF (flag_kz(iff)<=lev_files(iff)) THEN
-      ! combinaision de cdrag et le coef melange dans la meme variable
-      zx_tmp_fi3d(:,1)     = cdragh(:) 
-      zx_tmp_fi3d(:,2:klev)= coefh(:,2:klev)
-      CALL histwrite_phy(nid_files(iff),"kz",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_kz_max(iff)<=lev_files(iff)) THEN
-      ! combinaision de cdrag et le coef melange dans la meme variable
-      zx_tmp_fi3d(:,1)     = cdragh(:)
-      zx_tmp_fi3d(:,2:klev)= coefh(:,2:klev)
-      CALL histwrite_phy(nid_files(iff),"kz_max",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_clwcon(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"clwcon",itau_w,clwcon0)
+       IF (o_kz%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_kz%name,itau_w,coefh)
+       ENDIF
+
+       IF (o_kz_max%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_kz_max%name,itau_w,coefh)
+       ENDIF
+
+       IF (o_clwcon%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_clwcon%name,itau_w,clwcon0)
        ENDIF
 
       IF(iflag_con.GE.3) THEN
-       IF (flag_Ma(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"Ma",itau_w,Ma)
-       ENDIF
-
-       IF (flag_dnwd(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dnwd",itau_w,dnwd)
-       ENDIF
-
-       IF (flag_dnwd0(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dnwd0",itau_w,dnwd0)
+       IF (o_Ma%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_Ma%name,itau_w,Ma)
+       ENDIF
+
+       IF (o_dnwd%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dnwd%name,itau_w,dnwd)
+       ENDIF
+
+       IF (o_dnwd0%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dnwd0%name,itau_w,dnwd0)
        ENDIF
       ENDIF !(iflag_con.GE.3)
 
-       IF (flag_dtdyn(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dtdyn",itau_w,d_t_dyn)
-       ENDIF
-
-       IF (flag_dqdyn(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dqdyn",itau_w,d_q_dyn)
-       ENDIF
-
-       IF (flag_dudyn(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"dudyn",itau_w,d_u_dyn)
+       IF (o_dtdyn%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtdyn%name,itau_w,d_t_dyn)
+       ENDIF
+
+       IF (o_dqdyn%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dqdyn%name,itau_w,d_q_dyn)
+       ENDIF
+
+       IF (o_dudyn%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dudyn%name,itau_w,d_u_dyn)
        ENDIF                                                    
 
-       IF (flag_dvdyn(iff)<=lev_files(iff)) THEN                 
-      CALL histwrite_phy(nid_files(iff),"dvdyn",itau_w,d_v_dyn)  
+       IF (o_dvdyn%flag(iff)<=lev_files(iff)) THEN                 
+      CALL histwrite_phy(nid_files(iff),o_dvdyn%name,itau_w,d_v_dyn)  
        ENDIF                                                     
 
-       IF (flag_dtcon(iff)<=lev_files(iff)) THEN
+       IF (o_dtcon%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dtcon",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_ducon(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtcon%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_ducon%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_u_con(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"ducon",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dqcon(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ducon%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dqcon%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dqcon",itau_w,zx_tmp_fi3d)
+      CALL histwrite_phy(nid_files(iff),o_dqcon%name,itau_w,zx_tmp_fi3d)
        ENDIF
 
       IF(iflag_con.GE.3) THEN
        IF (iflag_wake == 1) THEN
-         IF (flag_dtwak(iff)<=lev_files(iff)) THEN
-           zx_tmp_fi3d(1:klon,1:klev)=d_t_wake(1:klon,1:klev)           &
+         IF (o_dtwak%flag(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)
+           CALL histwrite_phy(nid_files(iff),
+     &                       o_dtwak%name,itau_w,zx_tmp_fi3d)
          ENDIF
 
-        IF (flag_dqwak(iff)<=lev_files(iff)) THEN
+        IF (o_dqwak%flag(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)
+        CALL histwrite_phy(nid_files(iff),
+     &                     o_dqwak%name,itau_w,zx_tmp_fi3d)
         ENDIF
        ENDIF
       ENDIF !(iflag_con.GE.3) 
 
-       IF (flag_dtlsc(iff)<=lev_files(iff)) THEN
+       IF (o_dtlsc%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_t_lsc(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dtlsc",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtlschr(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtlsc%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtlschr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon, 1:klev)=(d_t_lsc(1:klon,1:klev)+
      $                           d_t_eva(1:klon,1:klev))/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dtlschr",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dqlsc(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),
+     s                   o_dtlschr%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dqlsc%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dqlsc",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtvdf(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dqlsc%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtvdf%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dtvdf",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dqvdf(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtvdf%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dqvdf%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dqvdf",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dteva(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dqvdf%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dteva%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_t_eva(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dteva",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dqeva(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dteva%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dqeva%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_q_eva(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dqeva",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_ptconv(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dqeva%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_ptconv%flag(iff)<=lev_files(iff)) THEN
       zpt_conv = 0.
       where (ptconv) zpt_conv = 1.
-      CALL histwrite_phy(nid_files(iff),"ptconv",itau_w,zpt_conv)
-       ENDIF
-
-       IF (flag_ratqs(iff)<=lev_files(iff)) THEN
-      CALL histwrite_phy(nid_files(iff),"ratqs",itau_w,ratqs)
-       ENDIF
-
-       IF (flag_dtthe(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ptconv%name,itau_w,zpt_conv)
+       ENDIF
+
+       IF (o_ratqs%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_ratqs%name,itau_w,ratqs)
+       ENDIF
+
+       IF (o_dtthe%flag(iff)<=lev_files(iff)) THEN
       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)
+      CALL histwrite_phy(nid_files(iff),o_dtthe%name,itau_w,zx_tmp_fi3d)
        ENDIF
 
        IF (iflag_thermals.gt.1) THEN
-        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_w_th(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),"w_th",itau_w,zw2)
-        ENDIF
-
-        IF (flag_q_th(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),"q_th",itau_w,zqasc)
-        ENDIF
-
-        IF (flag_lambda_th(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),"lambda_th",itau_w,lambda_th)
-        ENDIF
-
-        IF (flag_a_th(iff)<=lev_files(iff)) THEN
-        CALL histwrite_phy(nid_files(iff),"a_th",itau_w,fraca)
-        ENDIF
-
-       IF (flag_d_th(iff)<=lev_files(iff)) THEN
-       CALL histwrite_phy(nid_files(iff),"d_th",itau_w,detr_therm)
+        IF (o_f_th%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),o_f_th%name,itau_w,fm_therm)
+        ENDIF
+
+        IF (o_e_th%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),o_e_th%name,itau_w,entr_therm)
+        ENDIF
+
+        IF (o_w_th%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),o_w_th%name,itau_w,zw2)
+        ENDIF
+
+        IF (o_q_th%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),o_q_th%name,itau_w,zqasc)
+        ENDIF
+
+        IF (o_lambda_th%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),
+     s                     o_lambda_th%name,itau_w,lambda_th)
+        ENDIF
+
+        IF (o_a_th%flag(iff)<=lev_files(iff)) THEN
+        CALL histwrite_phy(nid_files(iff),o_a_th%name,itau_w,fraca)
+        ENDIF
+
+       IF (o_d_th%flag(iff)<=lev_files(iff)) THEN
+       CALL histwrite_phy(nid_files(iff),o_d_th%name,itau_w,detr_therm)
        ENDIF
 
        ENDIF !iflag_thermals
 
-       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
-
-       IF (flag_dqthe(iff)<=lev_files(iff)) THEN
+       IF (o_f0_th%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_f0_th%name,itau_w,f0)
+       ENDIF
+
+       IF (o_f0_th%flag(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_zmax_th%name,itau_w,zmax0)
+       ENDIF
+
+       IF (o_dqthe%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_q_ajs(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dqthe",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtajs(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dqthe%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtajs%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dtajs",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dqajs(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtajs%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dqajs%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dqajs",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtswr(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dqajs%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtswr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY
-      CALL histwrite_phy(nid_files(iff),"dtswr",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtsw0(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtswr%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtsw0%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=heat0(1:klon,1:klev)/RDAY
-      CALL histwrite_phy(nid_files(iff),"dtsw0",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtlwr(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtsw0%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtlwr%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
-      CALL histwrite_phy(nid_files(iff),"dtlwr",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtlw0(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtlwr%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtlw0%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=-1.*cool0(1:klon,1:klev)/RDAY
-      CALL histwrite_phy(nid_files(iff),"dtlw0",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dtec(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtlw0%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dtec%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
-      CALL histwrite_phy(nid_files(iff),"dtec",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_duvdf(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dtec%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_duvdf%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"duvdf",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-       IF (flag_dvvdf(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_duvdf%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+       IF (o_dvvdf%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dvvdf",itau_w,zx_tmp_fi3d)
+      CALL histwrite_phy(nid_files(iff),o_dvvdf%name,itau_w,zx_tmp_fi3d)
        ENDIF
 
        IF (ok_orodr) THEN
-      IF (flag_duoro(iff)<=lev_files(iff)) THEN 
+      IF (o_duoro%flag(iff)<=lev_files(iff)) THEN 
       zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"duoro",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-      IF (flag_dvoro(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_duoro%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+      IF (o_dvoro%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dvoro",itau_w,zx_tmp_fi3d)
+      CALL histwrite_phy(nid_files(iff),o_dvoro%name,itau_w,zx_tmp_fi3d)
       ENDIF
        ENDIF
 
         IF (ok_orolf) THEN
-       IF (flag_dulif(iff)<=lev_files(iff)) THEN
+       IF (o_dulif%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dulif",itau_w,zx_tmp_fi3d)
-       ENDIF
-
-        IF (flag_dvlif(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dulif%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+
+        IF (o_dvlif%flag(iff)<=lev_files(iff)) THEN
       zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys
-      CALL histwrite_phy(nid_files(iff),"dvlif",itau_w,zx_tmp_fi3d)
-       ENDIF
-        ENDIF
-
-       IF (flag_trac(iff)<=lev_files(iff)) THEN
+      CALL histwrite_phy(nid_files(iff),o_dvlif%name,itau_w,zx_tmp_fi3d)
+       ENDIF
+        ENDIF
+
+!       IF (o_trac%flag(iff)<=lev_files(iff)) THEN
          if (nqmax.GE.3) THEN
-           DO iq=3,nqmax
-         CALL histwrite_phy(nid_files(iff),tnom(iq),itau_w,qx(:,:,iq))
+!           DO iq=3,nqmax
+           DO iq=3,4
+       IF (o_trac(iq-2)%flag(iff)<=lev_files(iff)) THEN
+         CALL histwrite_phy(nid_files(iff),
+     s                  o_trac(iq-2)%name,itau_w,qx(:,:,iq))
+       ENDIF
            ENDDO
-          endif
-
-       ENDIF
+         endif
+
       if (ok_sync) then
 c$OMP MASTER
Index: /LMDZ4/branches/LMDZ4-dev/outputs.def
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/outputs.def	(revision 1083)
+++ /LMDZ4/branches/LMDZ4-dev/outputs.def	(revision 1083)
@@ -0,0 +1,791 @@
+######## Abderrahmane le 20 11 08 ########################
+# Niveaux de sorties et nom pour chaque variable dans les#
+# fichiers histmth histday histhf histins histLES        #
+##########################################################
+# Surface geop.height
+flag_phis         =  1, 1, 10, 1, 1    
+name_phis         =  phis
+# Grid area
+flag_aire         =  1, 1, 10,  1, 1    
+name_aire         =  aire
+# Surfac ter+lic
+flag_contfracATM  =  10, 1,  1, 10, 10    
+name_contfracATM  =  contfracATM
+# Surface terre OR  
+flag_contfracOR   =  10, 1,  1, 10, 10    
+name_contfracOR   =  contfracOR
+# Grid area CONT
+flag_aireTER      =  10, 10, 1, 10, 10    
+name_aireTER      =  aireTER
+# Latent heat flux
+flag_flat         =  10, 1, 10, 10, 1    
+name_flat         =  flat
+# Sea Level Pressure
+flag_slp          =  1, 1, 1, 10, 1    
+name_slp          =  slp
+# Surface Temperature
+flag_tsol         =  1, 1, 1, 1, 1    
+name_tsol         =  tsol
+# Temperature 2m
+flag_t2m          =  1, 1, 1, 1, 1    
+name_t2m          =  t2m
+# Temperature min 2m
+flag_t2m_min      =  1, 1, 10, 10, 10    
+name_t2m_min      =  t2m_min
+# Temperature max 2m
+flag_t2m_max      =  1, 1, 10, 10, 10    
+name_t2m_max      =  t2m_max
+# Temperature ter lic oce sic at 2m
+flag_t2m_ter      =  10, 4, 10, 10, 10    
+name_t2m_ter      =  t2m_ter 
+flag_t2m_lic      =  10, 4, 10, 10, 10    
+name_t2m_lic      =  t2m_lic
+flag_t2m_oce      =  10, 4, 10, 10, 10    
+name_t2m_oce      =  t2m_oce
+flag_t2m_sic      =  10, 4, 10, 10, 10    
+name_t2m_sic      =  t2m_sic 
+# 10-m wind speed
+flag_wind10m      =  1, 1, 1, 10, 10    
+name_wind10m      =  wind10m
+# 10-m wind speed max
+flag_wind10max    =  10, 1, 10, 10, 10    
+name_wind10max    =  wind10max
+# Sea-ice fraction
+flag_sicf         =  1, 1, 10, 10, 10    
+name_sicf         =  sicf
+# Specific humidity 2m
+flag_q2m          =  1, 1, 1, 1, 1    
+name_q2m          =  q2m
+# 10m zonal wind
+flag_u10m         =  1, 1, 1, 1, 1    
+name_u10m         =  u10m
+# 10m meridional wind
+flag_v10m         =  1, 1, 1, 1, 1    
+name_v10m         =  v10m
+# Surface Pressure
+flag_psol         =  1, 1, 1, 1, 1    
+name_psol         =  psol
+# Surface Air humidity
+flag_qsurf        =  1, 10, 10, 10, 10    
+name_qsurf        =  qsurf
+# 10m zonal wind (ter lic oce sic)
+flag_u10m_ter     =  10, 4, 10, 10, 10    
+name_u10m_ter     =  u10m_ter
+flag_u10m_lic     =  10, 4, 10, 10, 10    
+name_u10m_lic     =  u10m_lic
+flag_u10m_oce     =  10, 4, 10, 10, 10    
+name_u10m_oce     =  u10m_oce
+flag_u10m_sic     =  10, 4, 10, 10, 10    
+name_u10m_sic     =  u10m_sic
+# 10m meridien  wind (ter oce ice lic)
+flag_v10m_ter     =  10, 4, 10, 10, 10    
+name_v10m_ter     =  v10m_ter
+flag_v10m_lic     =  10, 4, 10, 10, 10    
+name_v10m_lic     =  v10m_lic
+flag_v10m_oce     =  10, 4, 10, 10, 10    
+name_v10m_oce     =  v10m_oce
+flag_v10m_sic     =  10, 4, 10, 10, 10    
+name_v10m_sic     =  v10m_sic
+# Soil watter content
+flag_qsol         =  1, 10, 10, 1, 1    
+name_qsol         =  qsol
+# Number of dayrain(liq+sol)
+flag_ndayrain     =  1, 10, 10, 10, 10    
+name_ndayrain     =  ndayrain
+# Precip Totale liq+sol
+flag_precip       =  1, 1, 1, 1, 1    
+name_precip       =  precip
+# Large-scale Precip
+flag_plul         =  1, 1, 1, 1, 10    
+name_plul         =  plul 
+# Convective Precip
+flag_pluc         =  1, 1, 1, 1, 10    
+name_pluc         =  pluc
+# Snow fall
+flag_snow         =  1, 1, 10, 1, 10    
+name_snow         =  snow
+# Evaporation
+flag_evap         =  1, 1, 10, 1, 10    
+name_evap         =  evap
+# Solar rad. at TOA
+flag_tops         =  1, 1, 10, 10, 10    
+name_tops         =  tops
+# CS Solar rad. at TOA
+flag_tops0        =  1, 5, 10, 10, 10    
+name_tops0        =  tops0
+# IR rad. at TOA
+flag_topl         =  1, 1, 10, 1, 10    
+name_topl         =  topl
+# CR IR rad. at TOA
+flag_topl0        =  1, 5, 10, 10, 10    
+name_topl0        =  topl0
+# SWup at TOA
+flag_SWupTOA      =  1, 4, 10, 10, 10    
+name_SWupTOA      =  SWupTOA
+# CR SWup at TOA
+flag_SWupTOAclr   =  1, 4, 10, 10, 10    
+name_SWupTOAclr   =  SWupTOAclr
+# SWdn at TOA
+flag_SWdnTOA      =  1, 4, 10, 10, 10    
+name_SWdnTOA      =  SWdnTOA
+# CR SWdn at TOA
+flag_SWdnTOAclr   =  1, 4, 10, 10, 10    
+name_SWdnTOAclr   =  SWdnTOAclr
+# SWup at 200hPa
+flag_SWup200      =  1, 10, 10, 10, 10    
+name_SWup200      =  SWup200
+# CR SWup at 200hPa
+flag_SWup200clr   =  10, 1, 10, 10, 10    
+name_SWup200clr   =  SWup200clr
+# SWdn at 200hPa
+flag_SWdn200      =  1, 10, 10, 10, 10    
+name_SWdn200      =  SWdn200
+# CR SWdn at 200hPa
+flag_SWdn200clr   =  10, 1, 10, 10, 10    
+name_SWdn200clr   =  SWdn200clr
+# LWup at 200mb
+flag_LWup200      =  1, 10, 10, 10, 10    
+name_LWup200      =  LWup200
+# CR LWup at 200mb
+flag_LWup200clr   =  1, 10, 10, 10, 10    
+name_LWup200clr   =  LWup200clr
+# LWdn at 200mb
+flag_LWdn200      =  1, 10, 10, 10, 10    
+name_LWdn200      =  LWdn200
+# CR LWdn at 200mb
+flag_LWdn200clr   =  1, 10, 10, 10, 10    
+name_LWdn200clr   =  LWdn200clr
+# Solar rad. at surf
+flag_sols         =  1, 1, 10, 1, 10    
+name_sols         =  sols
+# CR Solar rad. at surf
+flag_sols0        =  1, 5, 10, 10, 10    
+name_sols0        =  sols0
+# IR rad. at surface
+flag_soll         =  1, 1, 10, 1, 10    
+name_soll         =  soll
+# CR IR rad. at surface
+flag_soll0        =  1, 5, 10, 10, 10    
+name_soll0        =  soll0
+# Rayonnement au sol
+flag_radsol       =  1, 1, 10, 10, 10    
+name_radsol       =  radsol
+# SWup at surface
+flag_SWupSFC      =  1, 4, 10, 10, 10    
+name_SWupSFC      =  SWupSFC
+# CR SWup at surface
+flag_SWupSFCclr   =  1, 4, 10, 10, 10    
+name_SWupSFCclr   =  SWupSFCclr
+# SWdn at surface
+flag_SWdnSFC      =  1, 1, 10, 10, 10    
+name_SWdnSFC      =  SWdnSFC
+# CR at surface
+flag_SWdnSFCclr   =  1, 4, 10, 10, 10    
+name_SWdnSFCclr   =  SWdnSFCclr
+# LWup at surface
+flag_LWupSFC      =  1, 4, 10, 10, 10    
+name_LWupSFC      =  LWupSFC
+# CR LWup at surface
+flag_LWupSFCclr   =  1, 4, 10, 10, 10    
+name_LWupSFCclr   =  LWupSFCclr
+# LWdn  at surface
+flag_LWdnSFC      =  1, 4, 10, 10, 10    
+name_LWdnSFC      =  LWdnSFC
+# CR LWdn  at surface
+flag_LWdnSFCclr   =  1, 4, 10, 10, 10    
+name_LWdnSFCclr   =  LWdnSFCclr
+# Surf. total heat flux
+flag_bils         =  1, 2, 10, 1, 10    
+name_bils         =  bils
+# Sensible heat flux
+flag_sens         =  1, 1, 10, 1, 1    
+name_sens         =  sens
+# Heat flux derivation
+flag_fder         =  1, 2, 10, 1, 10    
+name_fder         =  fder
+# Thermal flux for snow melting
+flag_ffonte       =  1, 10, 10, 10, 10    
+name_ffonte       =  ffonte
+# Ice Calving
+flag_fqcalving    =  1, 10, 10, 10, 10    
+name_fqcalving    =  fqcalving
+# Land ice melt
+flag_fqfonte      =  1, 10, 10, 10, 10    
+name_fqfonte      =  fqfonte
+# Zonal wind stress (ter ice liq oce)
+flag_taux_ter     =  1, 4, 10, 1, 10    
+name_taux_ter     =  taux_ter
+flag_taux_lic     =  1, 4, 10, 1, 10    
+name_taux_lic     =  taux_lic                                          
+flag_taux_oce     =  1, 4, 10, 1, 10    
+name_taux_oce     =  taux_oce
+flag_taux_sic     =  1, 4, 10, 1, 10    
+name_taux_sic     =  taux_sic
+# Meridien wind stress (ter ice liq oce)
+flag_tauy_ter     =  1, 4, 10, 1, 10    
+name_tauy_ter     =  tauy_ter
+flag_tauy_lic     =  1, 4, 10, 1, 10    
+name_tauy_lic     =  tauy_lic
+flag_tauy_oce     =  1, 4, 10, 1, 10    
+name_tauy_oce     =  tauy_oce
+flag_tauy_sic     =  1, 4, 10, 1, 10    
+name_tauy_sic     =  tauy_sic
+# % surface (ter ice liq oce)
+flag_pourc_ter    =  1, 4, 10, 1, 10    
+name_pourc_ter    =  pourc_ter  
+flag_pourc_lic    =  1, 4, 10, 1, 10    
+name_pourc_lic    =  pourc_lic
+flag_pourc_oce    =  1, 4, 10, 1, 10    
+name_pourc_oce    =  pourc_oce
+flag_pourc_sic    =  1, 4, 10, 1, 10    
+name_pourc_sic    =  pourc_sic
+# Fraction (ter ice liq oce)
+flag_fract_ter    =  1, 4, 10, 1, 10    
+name_fract_ter    =  fract_ter
+flag_fract_lic    =  1, 4, 10, 1, 10    
+name_fract_lic    =  fract_lic
+flag_fract_oce     =  1, 4, 10, 1, 10    
+name_fract_oce    =  fract_oce
+flag_fract_sic    =  1, 4, 10, 1, 10    
+name_fract_sic    =  fract_sic
+# Surface temperature (ter ice liq oce)
+flag_tsol_ter     =  1, 4, 10, 1, 10    
+name_tsol_ter     =  tsol_ter
+flag_tsol_lic     =  1, 4, 10, 1, 10    
+name_tsol_lic     =  tsol_lic
+flag_tsol_oce     =  1, 4, 10, 1, 10    
+name_tsol_oce     =  tsol_oce
+flag_tsol_sic     =  1, 4, 10, 1, 10    
+name_tsol_sic     =  tsol_sic
+# Sensible heat flux (ter ice liq oce)
+flag_sens_ter     =  1, 4, 10, 1, 10    
+name_sens_ter     =  sens_ter
+flag_sens_lic     =  1, 4, 10, 1, 10    
+name_sens_lic     =  sens_lic
+flag_sens_oce     =  1, 4, 10, 1, 10    
+name_sens_oce     =  sens_oce
+flag_sens_sic     =  1, 4, 10, 1, 10    
+name_sens_sic     =  sens_sic
+# Latent heat flux (ter ice liq oce)
+flag_lat_ter      =  1, 4, 10, 1, 10    
+name_lat_ter      =  lat_ter 
+flag_lat_lic      =  1, 4, 10, 1, 10    
+name_lat_lic      =  lat_lic
+flag_lat_oce      =  1, 4, 10, 1, 10    
+name_lat_oce      =  lat_oce
+flag_lat_sic      =  1, 4, 10, 1, 10    
+name_lat_sic      =  lat_sic 
+# LW (ter ice liq oce)
+flag_flw_ter      =  1, 10, 10, 10, 10    
+name_flw_ter      =  flw_ter
+flag_flw_lic      =  1, 10, 10, 10, 10    
+name_flw_lic      =  flw_lic
+flag_flw_oce      =  1, 10, 10, 10, 10    
+name_flw_oce      =  flw_oce
+flag_flw_sic      =  1, 10, 10, 10, 10    
+name_flw_sic      =  flw_sic
+# SW (ter ice liq oce)
+flag_fsw_ter      =  1, 10, 10, 10, 10    
+name_fsw_ter      =  fsw_ter
+flag_fsw_lic      =  1, 10, 10, 10, 10    
+name_fsw_lic      =  fsw_lic
+flag_fsw_oce      =  1, 10, 10, 10, 10    
+name_fsw_oce      =  fsw_oce
+flag_fsw_sic      =  1, 10, 10, 10, 10    
+name_fsw_sic      =  fsw_sic
+# Bilan sol (ter ice liq oce)
+flag_wbils_ter    =  1, 10, 10, 10, 10    
+name_wbils_ter    =  wbils_ter
+flag_wbils_lic    =  1, 10, 10, 10, 10    
+name_wbils_lic    =  wbils_lic
+flag_wbils_oce    =  1, 10, 10, 10, 10    
+name_wbils_oce    =  wbils_oce
+flag_wbils_sic   =  1, 10, 10, 10, 10    
+name_wbils_sic    =  wbils_sic 
+# Bilan eau (ter ice liq oce)
+flag_wbilo_ter    =  1, 10, 10, 10, 10    
+name_wbilo_ter    =  wbilo_ter
+flag_wbilo_lic    =  1, 10, 10, 10, 10    
+name_wbilo_lic    =  wbilo_lic
+flag_wbilo_oce    =  1, 10, 10, 10, 10    
+name_wbilo_oce    =  wbilo_oce
+flag_wbilo_sic    =  1, 10, 10, 10, 10    
+name_wbilo_sic    =  wbilo_sic
+# Momentum drag coef
+flag_cdrm         =  1, 10, 10, 1, 10    
+name_cdrm         =  cdrm
+# Heat drag coef
+flag_cdrh         =  1, 10, 10, 1, 10    
+name_cdrh         =  cdrh 
+# Low-level cloudiness
+flag_cldl         =  1, 1, 10, 10, 10    
+name_cldl         =  cldl
+# Mid-level cloudiness
+flag_cldm         =  1, 1, 10, 10, 10    
+name_cldm         =  cldm
+# High-level cloudiness
+flag_cldh         =  1, 1, 10, 10, 10    
+name_cldh         =  cldh
+# Total cloudiness
+flag_cldt         =  1, 1, 2, 10, 10    
+name_cldt         =  cldt
+# Cloud liquid water path
+flag_cldq         =  1, 1, 10, 10, 10    
+name_cldq         =  cldq
+# Cloud water path
+flag_lwp          =  1, 5, 10, 10, 10    
+name_lwp          =  lwp
+# Cloud ice water path
+flag_iwp          =  1, 5, 10, 10, 10    
+name_iwp          =  iwp
+# Zonal energy transport
+flag_ue           =  1, 10, 10, 10, 10    
+name_ue           =  ue
+# Merid energy transport
+flag_ve           =  1, 10, 10, 10, 10    
+name_ve           =  ve
+# Zonal humidity transport
+flag_uq           =  1, 10, 10, 10, 10    
+name_uq           =  uq
+# Merid humidity transport
+flag_vq           =  1, 10, 10, 10, 10    
+name_vq           =  vq
+# Conv avlbl pot ener
+flag_cape         =  1, 10, 10, 10, 10    
+name_cape         =  cape
+# Cld base pressure
+flag_pbase        =  1, 10, 10, 10, 10    
+name_pbase        =  pbase
+# Cld top pressure
+flag_ptop         =  1, 4, 10, 10, 10    
+name_ptop         =  ptop
+# Cld base mass flux
+flag_fbase        =  1, 10, 10, 10, 10    
+name_fbase        =  fbase
+# Precipitable water
+flag_prw          =  1, 1, 10, 10, 10    
+name_prw          =  prw
+# Boundary Layer Height
+flag_s_pblh       =  1, 10, 10, 1, 1    
+name_s_pblh       =  pblh
+# t at Boundary Layer Height
+flag_s_pblt       =  1, 10, 10, 1, 1    
+name_s_pblt       =  pblt
+# Condensation level
+flag_s_lcl        =  1, 10, 10, 1, 10    
+name_s_lcl        =  lcl
+# Conv avlbl pot enerfor ABL
+flag_s_capCL      =  1, 10, 10, 1, 10    
+name_s_capCL      =  capCL
+# Liq Water in BL
+flag_s_oliqCL     =  1, 10, 10, 1, 10    
+name_s_oliqCL     =  oliqCL
+# Instability criteria(ABL)
+flag_s_cteiCL     =  1, 10, 10, 1, 1    
+name_s_cteiCL     =  cteiCL
+# Exces du thermique
+flag_s_therm      =  1, 10, 10, 1, 1    
+name_s_therm      =  therm
+# deep_cape(HBTM2)
+flag_s_trmb1      =  1, 10, 10, 1, 10    
+name_s_trmb1      =  trmb1
+# inhibition (HBTM2)
+flag_s_trmb2      =  1, 10, 10, 1, 10    
+name_s_trmb2      =  trmb2
+# Point Omega (HBTM2)
+flag_s_trmb3      =  1, 10, 10, 1, 10    
+name_s_trmb3      =  trmb3
+# Bilan au sol sur ocean slab
+flag_slab_bils    =  1, 1, 10, 10, 10    
+name_slab_bils    =  slab_bils 
+# ALE BL
+flag_ale_bl       =  1, 1, 1, 1, 10    
+name_ale_bl       =  ale_bl 
+# alp_bl
+flag_alp_bl       =  1, 1, 1, 1, 10    
+name_alp_bl       =  alp_bl
+# ale_wk
+flag_ale_wk       =  1, 1, 1, 1, 10    
+name_ale_wk       =  ale_wk
+# alp_wk
+flag_alp_wk       =  1, 1, 1, 1, 10    
+name_alp_wk       =  alp_wk
+# ale
+flag_ale          =  1, 1, 1, 1, 10    
+name_ale          =  ale
+# alp
+flag_alp          =  1, 1, 1, 1, 10    
+name_alp          =  alp
+# Convective INhibition
+flag_cin          =  1, 1, 1, 1, 10    
+name_cin          =  cin
+# WAPE
+flag_wape         =  1, 1, 1, 1, 10    
+name_wape         =  wape
+# u, v w t q et phi aux niveaux 200, 500, 700 et 850 hPa
+flag_u850         =  1, 1, 3, 10, 10    
+name_u850         =  u850 
+flag_u700         =  1, 1, 3, 10, 10    
+name_u700         =  u700
+flag_u500         =  1, 1, 3, 10, 10    
+name_u500         =  u500
+flag_u200         =  1, 1, 3, 10, 10    
+name_u200         =  u200
+flag_v850         =  1, 1, 3, 10, 10    
+name_v850         =  v850 
+flag_v700         =  1, 1, 3, 10, 10    
+name_v700         =  v700
+flag_v500         =  1, 1, 3, 10, 10    
+name_v500         =  v500
+flag_v200         =  1, 1, 3, 10, 10    
+name_v200         =  v200
+flag_w850         =  1, 1, 3, 10, 10    
+name_w850         =  w850
+flag_w700         =  1, 1, 3, 10, 10    
+name_w700         =  w700
+flag_w500         =  1, 1, 3, 10, 10    
+name_w500         =  w500
+flag_w200         =  1, 1, 3, 10, 10    
+name_w200         =  w200
+flag_t850         =  1, 1, 3, 10, 10    
+name_t850         =  t850
+flag_t700         =  1, 1, 3, 10, 10    
+name_t700         =  t700
+flag_t500         =  1, 1, 3, 10, 10    
+name_t500         =  t500
+flag_t200         =  1, 1, 3, 10, 10    
+name_t200         =  t200
+flag_q850         =  1, 1, 3, 10, 10    
+name_q850         =  q850
+flag_q700         =  1, 1, 3, 10, 10    
+name_q700         =  q700
+flag_q500         =  1, 1, 3, 10, 10    
+name_q500         =  q500
+flag_q200         =  1, 1, 3, 10, 10    
+name_q200         =  q200
+flag_phi850       =  1, 1, 3, 10, 10    
+name_phi850       =  phi850 
+flag_phi700       =  1, 1, 3, 10, 10    
+name_phi700       =  phi700
+flag_phi500       =  1, 1, 3, 10, 10    
+name_phi500       =  phi500
+flag_phi200       =  1, 1, 3, 10, 10    
+name_phi200       =  phi200
+# Temp mixte oce-sic
+flag_t_oce_sic    =  1, 10, 10, 10, 10    
+name_t_oce_sic    =  t_oce_sic
+# Weak inversion
+flag_weakinv      =  10, 1, 10, 10, 10    
+name_weakinv      =  weakinv
+# dTheta mini
+flag_dthmin       =  10, 1, 10, 10, 10    
+name_dthmin       =  dthmin
+# 10m zonal and meriden wind (ter sic lic oce)
+flag_u10_ter      =  10, 4, 10, 10, 10    
+name_u10_ter      =  u10_ter 
+flag_u10_lic      =  10, 4, 10, 10, 10    
+name_u10_lic      =  u10_lic
+flag_u10_oce      =  10, 4, 10, 10, 10    
+name_u10_oce      =  u10_oce
+flag_u10_sic      =  10, 4, 10, 10, 10    
+name_u10_sic      =  u10_sic 
+flag_v10_ter      =  10, 4, 10, 10, 10    
+name_v10_ter      =  v10_ter
+flag_v10_lic      =  10, 4, 10, 10, 10    
+name_v10_lic      =  v10_lic
+flag_v10_oce      =  10, 4, 10, 10, 10    
+name_v10_oce      =  v10_oce
+flag_v10_sic      =  10, 4, 10, 10, 10    
+name_v10_sic      =  v10_sic
+# Cloud optical thickness
+flag_cldtau       =  10, 5, 10, 10, 10    
+name_cldtau       =  cldtau
+# Cloud optical emissivity
+flag_cldemi       =  10, 5, 10, 10, 10    
+name_cldemi       =  cldemi
+# Relative humidity at 2m
+flag_rh2m         =  10, 5, 10, 10, 10    
+name_rh2m         =  rh2m
+# Saturant humidity at 2m
+flag_qsat2m       =  10, 5, 10, 10, 10    
+name_qsat2m       =  qsat2m
+# Surface air potential temperature
+flag_tpot         =  10, 5, 10, 10, 10    
+name_tpot         =  tpot
+# Surface air equivalent potential temperature
+flag_tpote        =  10, 5, 10, 10, 10    
+name_tpote        =  tpote
+# TKE, tke max and tke (ter sic lic oce)
+flag_tke          =  4, 10, 10, 10, 10    
+name_tke          =  tke
+flag_tke_max      =  4, 10, 10, 10, 10    
+name_tke_max      =  tke_max
+flag_tke_ter      =  10, 4, 10, 10, 10    
+name_tke_ter      =  tke_ter 
+flag_tke_lic      =  10, 4, 10, 10, 10    
+name_tke_lic      =  tke_lic
+flag_tke_oce      =  10, 4, 10, 10, 10    
+name_tke_oce      =  tke_oce
+flag_tke_sic      =  10, 4, 10, 10, 10    
+name_tke_sic      =  tke_sic
+flag_tke_max_ter  =  10, 4, 10, 10, 10    
+name_tke_max_ter  =  tke_max_ter
+flag_tke_max_lic  =  10, 4, 10, 10, 10    
+name_tke_max_lic  =  tke_max_lic
+flag_tke_max_oce  =  10, 4, 10, 10, 10    
+name_tke_max_oce  =  tke_max_oce
+flag_tke_max_sic  =  10, 4, 10, 10, 10    
+name_tke_max_sic  =  tke_max_sic
+# Kz melange
+flag_kz           =  4, 10, 10, 10, 10    
+name_kz           =  kz
+# Kz max melange
+flag_kz_max       =  4, 10, 10, 10, 10    
+name_kz_max       =  kz_max
+# Sfce net SW radiation OR
+flag_SWnetOR      =  10, 10, 2, 10, 10    
+name_SWnetOR      =  SWnetOR
+# Sfce incident SW radiation OR
+flag_SWdownOR     =  10, 10, 2, 10, 10    
+name_SWdownOR     =  SWdownOR
+# Sfce incident LW radiation OR
+flag_LWdownOR     =  10, 10, 2, 10, 10    
+name_LWdownOR     =  LWdownOR
+# Solid Large-scale Precip
+flag_snowl        =  10, 1, 10, 10, 10    
+name_snowl        =  snowl
+# cape max
+flag_cape_max     =  10, 1, 10, 10, 10    
+name_cape_max     =  cape_max
+# Down. IR rad. at surface
+flag_solldown     =  10, 1, 10, 1, 10    
+name_solldown     =  solldown
+# Boundary-layer dTs(o)
+flag_dtsvdfo      =  10, 10, 10, 1, 10    
+name_dtsvdfo      =  dtsvdfo
+# Boundary-layer dTs(t)
+flag_dtsvdft      =  10, 10, 10, 1, 10    
+name_dtsvdft      =  dtsvdft
+# Boundary-layer dTs(g)
+flag_dtsvdfg      =  10, 10, 10, 1, 10    
+name_dtsvdfg      =  dtsvdfg
+# Boundary-layer dTs(g)
+flag_dtsvdfi      =  10, 10, 10, 1, 10    
+name_dtsvdfi      =  dtsvdfi
+# rugosity
+flag_rugs         =  10, 10, 10, 1, 1    
+name_rugs         =  rugs
+# Cloud liquid water content
+flag_lwcon        =  2, 5, 10, 10, 1    
+name_lwcon        =  lwcon
+# Cloud ice water content
+flag_iwcon        =  2, 5, 10, 10, 10    
+name_iwcon        =  iwcon
+# Air temperature
+flag_temp         =  2, 3, 4, 1, 1    
+name_temp         =  temp
+# Potential air temperature
+flag_theta        =  2, 3, 4, 1, 1    
+name_theta        =  theta
+# Specific humidity
+flag_ovap         =  2, 3, 4, 1, 1    
+name_ovap         =  ovap
+# Geopotential height
+flag_wvapp        =  2, 10, 10, 10, 10    
+name_wvapp        =  wvapp
+# Zonal wind
+flag_geop         =  2, 3, 10, 1, 1    
+name_geop         =  geop
+# Zonal wind
+flag_vitu         =  2, 3, 4, 1, 1    
+name_vitu         =  vitu
+# Meridional wind
+flag_vitv         =  2, 3, 4, 1, 1    
+name_vitv         =  vitv
+# Vertical wind
+flag_vitw         =  2, 3, 10, 10, 1    
+name_vitw         =  vitw
+# Air pressure
+flag_pres         =  2, 3, 10, 1, 1    
+name_pres         =  pres
+# Cloud Fraction
+flag_rneb         =  2, 5, 10, 10, 1    
+name_rneb         =  rneb
+# Convective Cloud Fraction
+flag_rnebcon      =  2, 5, 10, 10, 1    
+name_rnebcon      =  rnebcon
+# Relative humidity
+flag_rhum         =  2, 10, 10, 10, 10    
+name_rhum         =  rhum
+# Ozone concentration
+flag_ozone        =  2, 10, 10, 10, 10    
+name_ozone        =  ozone
+# saturated updraft
+flag_upwd         =  2, 10, 10, 10, 10    
+name_upwd         =  upwd
+# Physics dT
+flag_dtphy        =  2, 10, 10, 10, 1    
+name_dtphy        =  dtphy
+# Physics dq
+flag_dqphy        =  2, 10, 10, 10, 1    
+name_dqphy        =  dqphy
+# Convective precipitation lic and ice
+flag_pr_con_l     =  2, 10, 10, 10, 10    
+name_pr_con_l     =  pr_con_l
+flag_pr_con_i     =  2, 10, 10, 10, 10    
+name_pr_con_i     =  pr_con_i
+# Large scale precipitation lic and ice
+flag_pr_lsc_l     =  2, 10, 10, 10, 10    
+name_pr_lsc_l     =  pr_lsc_l
+flag_pr_lsc_i     =  2, 10, 10, 10, 10    
+name_pr_lsc_i     =  pr_lsc_i
+# Albedo surf, Snow age and rugosity (ter sic lic oce)
+flag_albe_ter     =  3, 4, 10, 1, 10    
+name_albe_ter     =  albe_ter 
+flag_albe_lic     =  3, 4, 10, 1, 10    
+name_albe_lic     =  albe_lic
+flag_albe_oce     =  3, 4, 10, 1, 10    
+name_albe_oce     =  albe_oce
+flag_albe_sic     =  3, 4, 10, 1, 10    
+name_albe_sic     =  albe_sic 
+flag_ages_ter     =  3, 10, 10, 10, 10    
+name_ages_ter     =  ages_ter
+flag_ages_lic     =  3, 10, 10, 10, 10    
+name_ages_lic     =  ages_lic
+flag_ages_oce     =  3, 10, 10, 10, 10    
+name_ages_oce     =  ages_oce
+flag_ages_sic     =  3, 10, 10, 10, 10    
+name_ages_sic     =  ages_sic
+flag_rugs_ter     =  3, 4, 10, 1, 10    
+name_rugs_ter     =  rugs_ter 
+flag_rugs_lic     =  3, 4, 10, 1, 10    
+name_rugs_lic     =  rugs_lic
+flag_rugs_oce     =  3, 4, 10, 1, 10    
+name_rugs_oce     =  rugs_oce
+flag_rugs_sic     =  3, 4, 10, 1, 10    
+name_rugs_sic     =  rugs_sic
+# Surface albedo
+flag_albs         =  3, 10, 10, 1, 10    
+name_albs         =  albs
+# Surface albedo LW
+flag_albslw       =  3, 10, 10, 1, 10    
+name_albslw       =  albslw
+# Convective Cloud Liquid water content
+flag_clwcon       =  4, 10, 10, 10, 10    
+name_clwcon       =  clwcon
+# undilute adiab updraft
+flag_Ma           =  4, 10, 10, 10, 10    
+name_Ma           =  Ma
+# saturated downdraft
+flag_dnwd         =  4, 10, 10, 10, 10    
+name_dnwd         =  dnwd
+# unsat. downdraft
+flag_dnwd0        =  4, 10, 10, 10, 10    
+name_dnwd0        =  dnwd0
+# Dynamics dT dQ dU dV, .....
+flag_dtdyn        =  4, 10, 10, 10, 1
+name_dtdyn        =  dtdyn
+flag_dqdyn        =  4, 10, 10, 10, 1    
+name_dqdyn        =  dqdyn
+flag_dudyn        =  4, 10, 10, 10, 1    
+name_dudyn        =  dudyn
+flag_dvdyn        =  4, 10, 10, 10, 1    
+name_dvdyn        =  dvdyn 
+flag_dtcon        =  4, 5, 10, 10, 10    
+name_dtcon        =  dtcon
+flag_ducon        =  4, 10, 10, 10, 10    
+name_ducon        =  ducon
+flag_dqcon        =  4, 5, 10, 10, 10    
+name_dqcon        =  dqcon
+flag_dtwak        =  4, 5, 10, 10, 10    
+name_dtwak        =  dtwak
+flag_dqwak        =  4, 5, 10, 10, 10    
+name_dqwak        =  dqwak
+flag_wake_h       =  4, 5, 10, 10, 10    
+name_wake_h       =  wake_h
+flag_wake_s       =  4, 5, 10, 10, 10    
+name_wake_s       =  wake_s
+flag_wake_deltat  =  4, 5, 10, 10, 10    
+name_wake_deltat  =  wake_deltat
+flag_wake_deltaq  =  4, 5, 10, 10, 10    
+name_wake_deltaq  =  wake_deltaq
+flag_wake_omg     =  4, 5, 10, 10, 10    
+name_wake_omg     =  wake_omg 
+flag_Vprecip      =  10, 10, 10, 10, 10    
+name_Vprecip      =  Vprecip
+flag_ftd          =  4, 5, 10, 10, 10    
+name_ftd          =  ftd
+flag_fqd          =  4, 5, 10, 10, 10    
+name_fqd          =  fqd
+flag_dtlsc        =  4, 10, 10, 10, 10    
+name_dtlsc        =  dtlsc
+flag_dtlschr      =  4, 10, 10, 10, 10    
+name_dtlschr      =  dtlschr
+flag_dqlsc        =  4, 10, 10, 10, 10    
+name_dqlsc        =  dqlsc
+flag_dtvdf        =  4, 10, 10, 1, 10    
+name_dtvdf        =  dtvdf
+flag_dqvdf        =  4, 10, 10, 1, 10    
+name_dqvdf        =  dqvdf
+flag_dteva        =  4, 10, 10, 10, 10    
+name_dteva        =  dteva
+flag_dqeva        =  4, 10, 10, 10, 10    
+name_dqeva        =  dqeva
+flag_ptconv       =  4, 10, 10, 10, 10    
+name_ptconv       =  ptconv
+flag_ratqs        =  4, 10, 10, 10, 10    
+name_ratqs        =  ratqs
+flag_dtthe        =  4, 10, 10, 10, 10    
+name_dtthe        =  dtthe
+flag_f_th         =  4, 10, 10, 10, 10    
+name_f_th         =  f_th
+flag_e_th         =  4, 10, 10, 10, 10    
+name_e_th         =  e_th
+flag_w_th         =  4, 10, 10, 10, 10    
+name_w_th         =  w_th
+flag_lambda_th    =  4, 10, 10, 10, 10    
+name_lambda_th    =  lambda_th
+flag_q_th         =  4, 10, 10, 10, 10    
+name_q_th         =  q_th
+flag_a_th         =  4, 10, 10, 10, 10    
+name_a_th         =  a_th
+flag_d_th         =  4, 10, 10, 10, 10    
+name_d_th         =  d_th
+flag_f0_th        =  4, 10, 10, 10, 10    
+name_f0_th        =  f0_th
+flag_zmax_th      =  4, 10, 10, 10, 10    
+name_zmax_th      =  zmax_th
+flag_dqthe        =  4, 10, 10, 10, 1    
+name_dqthe        =  dqthe
+flag_dtajs        =  4, 10, 10, 10, 10    
+name_dtajs        =  dtajs
+flag_dqajs        =  4, 10, 10, 10, 10    
+name_dqajs        =  dqajs
+flag_dtswr        =  4, 10, 10, 10, 1    
+name_dtswr        =  dtswr
+flag_dtsw0        =  4, 10, 10, 10, 10    
+name_dtsw0        =  dtsw0 
+flag_dtlwr        =  4, 10, 10, 10, 1    
+name_dtlwr        =  dtlwr
+flag_dtlw0        =  4, 10, 10, 10, 10    
+name_dtlw0        =  dtlw0
+flag_dtec         =  4, 10, 10, 10, 10    
+name_dtec         =  dtec
+flag_duvdf        =  4, 10, 10, 10, 10    
+name_duvdf        =  duvdf
+flag_dvvdf        =  4, 10, 10, 10, 10    
+name_dvvdf        =  dvvdf
+flag_duoro        =  4, 10, 10, 10, 10    
+name_duoro        =  duoro
+flag_dvoro        =  4, 10, 10, 10, 10    
+name_dvoro        =  dvoro
+flag_dulif        =  4, 10, 10, 10, 10    
+name_dulif        =  dulif
+flag_dvlif        =  4, 10, 10, 10, 10    
+name_dvlif        =  dvlif
+###! Attention a refaire correctement
+flag_trac01       =  4, 10, 10, 10, 10    
+name_trac01       =  trac01 
+flag_trac02       =  4, 10, 10, 10, 10    
+name_trac02       =  trac02
+
Index: /LMDZ4/branches/LMDZ4-dev/run.def
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/run.def	(revision 1082)
+++ /LMDZ4/branches/LMDZ4-dev/run.def	(revision 1083)
@@ -1,8 +1,9 @@
 #
-# $Header$
+# $Header: /home/cvsroot/LMDZ4/run.def,v 1.1.1.1 2004-05-19 12:53:05 lmdzadmin Exp $
 #
 INCLUDEDEF=physiq.def
 INCLUDEDEF=gcm.def
 INCLUDEDEF=orchidee.def
+INCLUDEDEF=outputs.def
 ## Jour de l'etat initial ( = 350  si 20 Decembre ,par expl. ,comme ici )
 dayref=1
