Ignore:
Timestamp:
Jun 9, 2011, 12:13:33 AM (13 years ago)
Author:
musat
Message:

Ajouts CFMIP2/CMIP5

  • 6eme fichier de sortie "stations" histstn.nc qui necessite 2 fichiers (voir DefLists?): npCFMIP_param.data(_*) contenant le nombre de points (120 pour simulations AMIP, 73 pour aqua) pointlocations.txt(_*) contenant le numero, les coordonnees (lon,lat) et le nom de chaque station
  • flag LOGICAL dans tous les appels histwrite_phy pour pouvoir sortir le fichier histstn.nc

NB: 1) les flags de type phys_ que l'on met dans le physiq.def_L* pour ajouter plus de sorties

necessitent dorenavant 6 valeurs, la 6eme correspondant au fichier histstn.nc

2) par defaut le fichier histstn.nc ne sort pas; pour le sortir ajouter les lignes suivantes

dans physiq.def_L*

### Type de fichier : global (n) ou stations (y)
phys_out_filestations = n n n n n y

  • introduction de 2 jeux de flags pour les taux des GES; taux actuels avec suffixes _act, taux futurs avec "_per" avec 2 appels au rayonnement si taux "_per" different des taux "_act" (utiles pour diags. CFMIP 4CO2)
  • flags "betaCRF" pour calculs CRF pour experiences sensibilite proprietes optiques eau liquide nuageuse avec initialisations par defaut; sinon besoin de fichier beta_crf.data

Ajout flag LOGICAL lCOSP necessaire pour sortir un fichier stations
IM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/phys_output_mod.F90

    r1518 r1539  
    1717
    1818
    19    integer, parameter                           :: nfiles = 5
     19   integer, parameter                           :: nfiles = 6
    2020   logical, dimension(nfiles), save             :: clef_files
     21   logical, dimension(nfiles), save             :: clef_stations
    2122   integer, dimension(nfiles), save             :: lev_files
    2223   integer, dimension(nfiles), save             :: nid_files
    23 !!$OMP THREADPRIVATE(clef_files, lev_files,nid_files)
     24   integer, dimension(nfiles), save  :: nnid_files
     25!!$OMP THREADPRIVATE(clef_files, clef_stations, lev_files,nid_files,nnid_files)
     26   integer, dimension(nfiles), private, save :: nnhorim
    2427 
    2528   integer, dimension(nfiles), private, save :: nhorim, nvertm
     
    4245
    4346  TYPE ctrl_out
    44    integer,dimension(5) :: flag
     47   integer,dimension(6) :: flag
    4548   character(len=20)     :: name
    4649  END TYPE ctrl_out
     
    4851!!! Comosentes de la coordonnee sigma-hybride
    4952!!! Ap et Bp
    50   type(ctrl_out),save :: o_Ahyb         = ctrl_out((/ 1, 1, 1, 1, 1 /), 'Ap')
    51   type(ctrl_out),save :: o_Bhyb         = ctrl_out((/ 1, 1, 1, 1, 1 /), 'Bp')
    52   type(ctrl_out),save :: o_Alt          = ctrl_out((/ 1, 1, 1, 1, 1 /), 'Alt')
     53  type(ctrl_out),save :: o_Ahyb         = ctrl_out((/ 1, 1, 1, 1, 1, 1 /), 'Ap')
     54  type(ctrl_out),save :: o_Bhyb         = ctrl_out((/ 1, 1, 1, 1, 1, 1 /), 'Bp')
     55  type(ctrl_out),save :: o_Alt          = ctrl_out((/ 1, 1, 1, 1, 1, 1 /), 'Alt')
    5356
    5457!!! 1D
    55   type(ctrl_out),save :: o_phis         = ctrl_out((/ 1, 1, 10, 5, 1 /), 'phis')
    56   type(ctrl_out),save :: o_aire         = ctrl_out((/ 1, 1, 10,  10, 1 /),'aire')
    57   type(ctrl_out),save :: o_contfracATM  = ctrl_out((/ 10, 1,  1, 10, 10 /),'contfracATM')
    58   type(ctrl_out),save :: o_contfracOR   = ctrl_out((/ 10, 1,  1, 10, 10 /),'contfracOR')
    59   type(ctrl_out),save :: o_aireTER      = ctrl_out((/ 10, 10, 1, 10, 10 /),'aireTER')
     58  type(ctrl_out),save :: o_phis         = ctrl_out((/ 1, 1, 10, 5, 1, 1 /), 'phis')
     59  type(ctrl_out),save :: o_aire         = ctrl_out((/ 1, 1, 10,  10, 1, 1 /),'aire')
     60  type(ctrl_out),save :: o_contfracATM  = ctrl_out((/ 10, 1,  1, 10, 10, 10 /),'contfracATM')
     61  type(ctrl_out),save :: o_contfracOR   = ctrl_out((/ 10, 1,  1, 10, 10, 10 /),'contfracOR')
     62  type(ctrl_out),save :: o_aireTER      = ctrl_out((/ 10, 10, 1, 10, 10, 10 /),'aireTER')
    6063 
    6164!!! 2D
    62 
    63   type(ctrl_out),save :: o_flat         = ctrl_out((/ 5, 1, 10, 5, 1 /),'flat')
    64   type(ctrl_out),save :: o_slp          = ctrl_out((/ 1, 1, 1, 10, 1 /),'slp')
    65   type(ctrl_out),save :: o_tsol         = ctrl_out((/ 1, 1, 1, 5, 1 /),'tsol')
    66   type(ctrl_out),save :: o_t2m          = ctrl_out((/ 1, 1, 1, 5, 1 /),'t2m')
    67   type(ctrl_out),save :: o_t2m_min      = ctrl_out((/ 1, 1, 10, 10, 10 /),'t2m_min')
    68   type(ctrl_out),save :: o_t2m_max      = ctrl_out((/ 1, 1, 10, 10, 10 /),'t2m_max')
    69   type(ctrl_out),save,dimension(4) :: o_t2m_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_ter'), &
    70                                                  ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_lic'), &
    71                                                  ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_oce'), &
    72                                                  ctrl_out((/ 10, 4, 10, 10, 10 /),'t2m_sic') /)
    73 
    74   type(ctrl_out),save :: o_wind10m      = ctrl_out((/ 1, 1, 1, 10, 10 /),'wind10m')
    75   type(ctrl_out),save :: o_wind10max    = ctrl_out((/ 10, 1, 10, 10, 10 /),'wind10max')
    76   type(ctrl_out),save :: o_sicf         = ctrl_out((/ 1, 1, 10, 10, 10 /),'sicf')
    77   type(ctrl_out),save :: o_q2m          = ctrl_out((/ 1, 1, 1, 5, 1 /),'q2m')
    78   type(ctrl_out),save :: o_u10m         = ctrl_out((/ 1, 1, 1, 5, 1 /),'u10m')
    79   type(ctrl_out),save :: o_v10m         = ctrl_out((/ 1, 1, 1, 5, 1 /),'v10m')
    80   type(ctrl_out),save :: o_psol         = ctrl_out((/ 1, 1, 1, 5, 1 /),'psol')
    81   type(ctrl_out),save :: o_qsurf        = ctrl_out((/ 1, 10, 10, 10, 10 /),'qsurf')
    82 
    83   type(ctrl_out),save,dimension(4) :: o_u10m_srf     = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_ter'), &
    84                                               ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_lic'), &
    85                                               ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_oce'), &
    86                                               ctrl_out((/ 10, 4, 10, 10, 10 /),'u10m_sic') /)
    87 
    88   type(ctrl_out),save,dimension(4) :: o_v10m_srf     = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_ter'), &
    89                                               ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_lic'), &
    90                                               ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_oce'), &
    91                                               ctrl_out((/ 10, 4, 10, 10, 10 /),'v10m_sic') /)
    92 
    93   type(ctrl_out),save :: o_qsol         = ctrl_out((/ 1, 10, 10, 10, 10 /),'qsol')
    94 
    95   type(ctrl_out),save :: o_ndayrain     = ctrl_out((/ 1, 10, 10, 10, 10 /),'ndayrain')
    96   type(ctrl_out),save :: o_precip       = ctrl_out((/ 1, 1, 1, 5, 10 /),'precip')
    97   type(ctrl_out),save :: o_plul         = ctrl_out((/ 1, 1, 1, 10, 10 /),'plul')
    98 
    99   type(ctrl_out),save :: o_pluc         = ctrl_out((/ 1, 1, 1, 5, 10 /),'pluc')
    100   type(ctrl_out),save :: o_snow         = ctrl_out((/ 1, 1, 10, 5, 10 /),'snow')
    101   type(ctrl_out),save :: o_evap         = ctrl_out((/ 1, 1, 10, 10, 10 /),'evap')
    102   type(ctrl_out),save,dimension(4) :: o_evap_srf     = (/ ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_ter'), &
    103                                            ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_lic'), &
    104                                            ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_oce'), &
    105                                            ctrl_out((/ 1, 1, 10, 10, 10 /),'evap_sic') /)
    106   type(ctrl_out),save :: o_msnow       = ctrl_out((/ 1, 10, 10, 10, 10 /),'msnow')
    107   type(ctrl_out),save :: o_fsnow       = ctrl_out((/ 1, 10, 10, 10, 10 /),'fsnow')
    108 
    109   type(ctrl_out),save :: o_tops         = ctrl_out((/ 1, 1, 10, 10, 10 /),'tops')
    110   type(ctrl_out),save :: o_tops0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'tops0')
    111   type(ctrl_out),save :: o_topl         = ctrl_out((/ 1, 1, 10, 5, 10 /),'topl')
    112   type(ctrl_out),save :: o_topl0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'topl0')
    113   type(ctrl_out),save :: o_SWupTOA      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupTOA')
    114   type(ctrl_out),save :: o_SWupTOAclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupTOAclr')
    115   type(ctrl_out),save :: o_SWdnTOA      = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnTOA')
    116   type(ctrl_out),save :: o_SWdnTOAclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWdnTOAclr')
    117   type(ctrl_out),save :: o_nettop       = ctrl_out((/ 1, 4, 10, 10, 10 /),'nettop')
    118 
    119   type(ctrl_out),save :: o_SWup200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'SWup200')
    120   type(ctrl_out),save :: o_SWup200clr   = ctrl_out((/ 10, 1, 10, 10, 10 /),'SWup200clr')
    121   type(ctrl_out),save :: o_SWdn200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'SWdn200')
    122   type(ctrl_out),save :: o_SWdn200clr   = ctrl_out((/ 10, 1, 10, 10, 10 /),'SWdn200clr')
     65  type(ctrl_out),save :: o_flat         = ctrl_out((/ 5, 1, 10, 10, 5, 10 /),'flat')
     66  type(ctrl_out),save :: o_slp          = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'slp')
     67  type(ctrl_out),save :: o_tsol         = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'tsol')
     68  type(ctrl_out),save :: o_t2m          = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'t2m')
     69  type(ctrl_out),save :: o_t2m_min      = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'t2m_min')
     70  type(ctrl_out),save :: o_t2m_max      = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'t2m_max')
     71  type(ctrl_out),save,dimension(4) :: o_t2m_srf      = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_ter'), &
     72                                                 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_lic'), &
     73                                                 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_oce'), &
     74                                                 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'t2m_sic') /)
     75
     76  type(ctrl_out),save :: o_wind10m      = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'wind10m')
     77  type(ctrl_out),save :: o_wind10max    = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'wind10max')
     78  type(ctrl_out),save :: o_sicf         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'sicf')
     79  type(ctrl_out),save :: o_q2m          = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'q2m')
     80  type(ctrl_out),save :: o_u10m         = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'u10m')
     81  type(ctrl_out),save :: o_v10m         = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'v10m')
     82  type(ctrl_out),save :: o_psol         = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'psol')
     83  type(ctrl_out),save :: o_qsurf        = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'qsurf')
     84
     85  type(ctrl_out),save,dimension(4) :: o_u10m_srf     = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_ter'), &
     86                                              ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_lic'), &
     87                                              ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_oce'), &
     88                                              ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_sic') /)
     89
     90  type(ctrl_out),save,dimension(4) :: o_v10m_srf     = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_ter'), &
     91                                              ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_lic'), &
     92                                              ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_oce'), &
     93                                              ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'v10m_sic') /)
     94
     95  type(ctrl_out),save :: o_qsol         = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'qsol')
     96
     97  type(ctrl_out),save :: o_ndayrain     = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ndayrain')
     98  type(ctrl_out),save :: o_precip       = ctrl_out((/ 1, 1, 1, 10, 5, 10 /),'precip')
     99  type(ctrl_out),save :: o_plul         = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'plul')
     100
     101  type(ctrl_out),save :: o_pluc         = ctrl_out((/ 1, 1, 1, 10, 5, 10 /),'pluc')
     102  type(ctrl_out),save :: o_snow         = ctrl_out((/ 1, 1, 10, 10, 5, 10 /),'snow')
     103  type(ctrl_out),save :: o_evap         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'evap')
     104  type(ctrl_out),save,dimension(4) :: o_evap_srf     = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_ter'), &
     105                                           ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_lic'), &
     106                                           ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_oce'), &
     107                                           ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'evap_sic') /)
     108  type(ctrl_out),save :: o_msnow       = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'msnow')
     109  type(ctrl_out),save :: o_fsnow       = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsnow')
     110
     111  type(ctrl_out),save :: o_tops         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'tops')
     112  type(ctrl_out),save :: o_tops0        = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'tops0')
     113  type(ctrl_out),save :: o_topl         = ctrl_out((/ 1, 1, 10, 5, 10, 10 /),'topl')
     114  type(ctrl_out),save :: o_topl0        = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'topl0')
     115  type(ctrl_out),save :: o_SWupTOA      = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWupTOA')
     116  type(ctrl_out),save :: o_SWupTOAclr   = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWupTOAclr')
     117  type(ctrl_out),save :: o_SWdnTOA      = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWdnTOA')
     118  type(ctrl_out),save :: o_SWdnTOAclr   = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'SWdnTOAclr')
     119  type(ctrl_out),save :: o_nettop       = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'nettop')
     120
     121  type(ctrl_out),save :: o_SWup200      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'SWup200')
     122  type(ctrl_out),save :: o_SWup200clr   = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'SWup200clr')
     123  type(ctrl_out),save :: o_SWdn200      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'SWdn200')
     124  type(ctrl_out),save :: o_SWdn200clr   = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'SWdn200clr')
    123125
    124126! arajouter
    125 !  type(ctrl_out),save :: o_LWupTOA     = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupTOA')
    126 !  type(ctrl_out),save :: o_LWupTOAclr  = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupTOAclr')
    127 !  type(ctrl_out),save :: o_LWdnTOA     = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnTOA')
    128 !  type(ctrl_out),save :: o_LWdnTOAclr  = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWdnTOAclr')
    129 
    130   type(ctrl_out),save :: o_LWup200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWup200')
    131   type(ctrl_out),save :: o_LWup200clr   = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWup200clr')
    132   type(ctrl_out),save :: o_LWdn200      = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWdn200')
    133   type(ctrl_out),save :: o_LWdn200clr   = ctrl_out((/ 1, 10, 10, 10, 10 /),'LWdn200clr')
    134   type(ctrl_out),save :: o_sols         = ctrl_out((/ 1, 1, 10, 10, 10 /),'sols')
    135   type(ctrl_out),save :: o_sols0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'sols0')
    136   type(ctrl_out),save :: o_soll         = ctrl_out((/ 1, 1, 10, 10, 10 /),'soll')
    137   type(ctrl_out),save :: o_soll0        = ctrl_out((/ 1, 5, 10, 10, 10 /),'soll0')
    138   type(ctrl_out),save :: o_radsol       = ctrl_out((/ 1, 1, 10, 10, 10 /),'radsol')
    139   type(ctrl_out),save :: o_SWupSFC      = ctrl_out((/ 1, 4, 10, 5, 10 /),'SWupSFC')
    140   type(ctrl_out),save :: o_SWupSFCclr   = ctrl_out((/ 1, 4, 10, 10, 10 /),'SWupSFCclr')
    141   type(ctrl_out),save :: o_SWdnSFC      = ctrl_out((/ 1, 1, 10, 5, 10 /),'SWdnSFC')
    142   type(ctrl_out),save :: o_SWdnSFCclr   = ctrl_out((/ 1, 4, 10, 5, 10 /),'SWdnSFCclr')
    143   type(ctrl_out),save :: o_LWupSFC      = ctrl_out((/ 1, 4, 10, 10, 10 /),'LWupSFC')
    144   type(ctrl_out),save :: o_LWupSFCclr   = ctrl_out((/ 1, 4, 10, 5, 10 /),'LWupSFCclr')
    145   type(ctrl_out),save :: o_LWdnSFC      = ctrl_out((/ 1, 4, 10, 5, 10 /),'LWdnSFC')
    146   type(ctrl_out),save :: o_LWdnSFCclr   = ctrl_out((/ 1, 4, 10, 5, 10 /),'LWdnSFCclr')
    147   type(ctrl_out),save :: o_bils         = ctrl_out((/ 1, 2, 10, 5, 10 /),'bils')
    148   type(ctrl_out),save :: o_sens         = ctrl_out((/ 1, 1, 10, 5, 10 /),'sens')
    149   type(ctrl_out),save :: o_fder         = ctrl_out((/ 1, 2, 10, 10, 10 /),'fder')
    150   type(ctrl_out),save :: o_ffonte       = ctrl_out((/ 1, 10, 10, 10, 10 /),'ffonte')
    151   type(ctrl_out),save :: o_fqcalving    = ctrl_out((/ 1, 10, 10, 10, 10 /),'fqcalving')
    152   type(ctrl_out),save :: o_fqfonte      = ctrl_out((/ 1, 10, 10, 10, 10 /),'fqfonte')
    153 
    154   type(ctrl_out),save :: o_taux         = ctrl_out((/ 1, 10, 10, 10, 10 /),'taux')
    155   type(ctrl_out),save :: o_tauy         = ctrl_out((/ 1, 10, 10, 10, 10 /),'tauy')
    156   type(ctrl_out),save,dimension(4) :: o_taux_srf     = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_ter'), &
    157                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_lic'), &
    158                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_oce'), &
    159                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'taux_sic') /)
    160 
    161   type(ctrl_out),save,dimension(4) :: o_tauy_srf     = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_ter'), &
    162                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_lic'), &
    163                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_oce'), &
    164                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'tauy_sic') /)
    165 
    166 
    167   type(ctrl_out),save,dimension(4) :: o_pourc_srf    = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_ter'), &
    168                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_lic'), &
    169                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_oce'), &
    170                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'pourc_sic') /)     
    171 
    172   type(ctrl_out),save,dimension(4) :: o_fract_srf    = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_ter'), &
    173                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_lic'), &
    174                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_oce'), &
    175                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'fract_sic') /)
    176 
    177   type(ctrl_out),save,dimension(4) :: o_tsol_srf     = (/ ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_ter'), &
    178                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_lic'), &
    179                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_oce'), &
    180                                                  ctrl_out((/ 1, 4, 10, 10, 10 /),'tsol_sic') /)
    181 
    182   type(ctrl_out),save,dimension(4) :: o_sens_srf     = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_ter'), &
    183                                                  ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_lic'), &
    184                                                  ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_oce'), &
    185                                                  ctrl_out((/ 1, 4, 10, 1, 10 /),'sens_sic') /)
    186 
    187   type(ctrl_out),save,dimension(4) :: o_lat_srf      = (/ ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_ter'), &
    188                                                  ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_lic'), &
    189                                                  ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_oce'), &
    190                                                  ctrl_out((/ 1, 4, 10, 1, 10 /),'lat_sic') /)
    191 
    192   type(ctrl_out),save,dimension(4) :: o_flw_srf      = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_ter'), &
    193                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_lic'), &
    194                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_oce'), &
    195                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'flw_sic') /)
     127!  type(ctrl_out),save :: o_LWupTOA     = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWupTOA')
     128!  type(ctrl_out),save :: o_LWupTOAclr  = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWupTOAclr')
     129!  type(ctrl_out),save :: o_LWdnTOA     = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWdnTOA')
     130!  type(ctrl_out),save :: o_LWdnTOAclr  = ctrl_out((/ 1, 4, 10, 10, 10, 10 /),'LWdnTOAclr')
     131
     132  type(ctrl_out),save :: o_LWup200      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWup200')
     133  type(ctrl_out),save :: o_LWup200clr   = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWup200clr')
     134  type(ctrl_out),save :: o_LWdn200      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWdn200')
     135  type(ctrl_out),save :: o_LWdn200clr   = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'LWdn200clr')
     136  type(ctrl_out),save :: o_sols         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'sols')
     137  type(ctrl_out),save :: o_sols0        = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'sols0')
     138  type(ctrl_out),save :: o_soll         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'soll')
     139  type(ctrl_out),save :: o_soll0        = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'soll0')
     140  type(ctrl_out),save :: o_radsol       = ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'radsol')
     141  type(ctrl_out),save :: o_SWupSFC      = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'SWupSFC')
     142  type(ctrl_out),save :: o_SWupSFCclr   = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'SWupSFCclr')
     143  type(ctrl_out),save :: o_SWdnSFC      = ctrl_out((/ 1, 1, 10, 10, 5, 10 /),'SWdnSFC')
     144  type(ctrl_out),save :: o_SWdnSFCclr   = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'SWdnSFCclr')
     145  type(ctrl_out),save :: o_LWupSFC      = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWupSFC')
     146  type(ctrl_out),save :: o_LWupSFCclr   = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWupSFCclr')
     147  type(ctrl_out),save :: o_LWdnSFC      = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWdnSFC')
     148  type(ctrl_out),save :: o_LWdnSFCclr   = ctrl_out((/ 1, 4, 10, 10, 5, 10 /),'LWdnSFCclr')
     149  type(ctrl_out),save :: o_bils         = ctrl_out((/ 1, 2, 10, 5, 10, 10 /),'bils')
     150  type(ctrl_out),save :: o_sens         = ctrl_out((/ 1, 1, 10, 10, 5, 10 /),'sens')
     151  type(ctrl_out),save :: o_fder         = ctrl_out((/ 1, 2, 10, 10, 10, 10 /),'fder')
     152  type(ctrl_out),save :: o_ffonte       = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ffonte')
     153  type(ctrl_out),save :: o_fqcalving    = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fqcalving')
     154  type(ctrl_out),save :: o_fqfonte      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fqfonte')
     155
     156  type(ctrl_out),save :: o_taux         = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'taux')
     157  type(ctrl_out),save :: o_tauy         = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'tauy')
     158  type(ctrl_out),save,dimension(4) :: o_taux_srf     = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_ter'), &
     159                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_lic'), &
     160                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_oce'), &
     161                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'taux_sic') /)
     162
     163  type(ctrl_out),save,dimension(4) :: o_tauy_srf     = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_ter'), &
     164                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_lic'), &
     165                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_oce'), &
     166                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tauy_sic') /)
     167
     168
     169  type(ctrl_out),save,dimension(4) :: o_pourc_srf    = (/ ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_ter'), &
     170                                                 ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_lic'), &
     171                                                 ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_oce'), &
     172                                                 ctrl_out((/ 1, 7, 10, 10, 10, 10 /),'pourc_sic') /)     
     173
     174  type(ctrl_out),save,dimension(4) :: o_fract_srf    = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_ter'), &
     175                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_lic'), &
     176                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_oce'), &
     177                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'fract_sic') /)
     178
     179  type(ctrl_out),save,dimension(4) :: o_tsol_srf     = (/ ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_ter'), &
     180                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_lic'), &
     181                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_oce'), &
     182                                                 ctrl_out((/ 1, 6, 10, 10, 10, 10 /),'tsol_sic') /)
     183
     184  type(ctrl_out),save,dimension(4) :: o_sens_srf     = (/ ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_ter'), &
     185                                                 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_lic'), &
     186                                                 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_oce'), &
     187                                                 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'sens_sic') /)
     188
     189  type(ctrl_out),save,dimension(4) :: o_lat_srf      = (/ ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_ter'), &
     190                                                 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_lic'), &
     191                                                 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_oce'), &
     192                                                 ctrl_out((/ 1, 6, 10, 7, 10, 10 /),'lat_sic') /)
     193
     194  type(ctrl_out),save,dimension(4) :: o_flw_srf      = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_ter'), &
     195                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_lic'), &
     196                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_oce'), &
     197                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'flw_sic') /)
    196198                                                 
    197   type(ctrl_out),save,dimension(4) :: o_fsw_srf      = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_ter'), &
    198                                                   ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_lic'), &
    199                                                   ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_oce'), &
    200                                                   ctrl_out((/ 1, 10, 10, 10, 10 /),'fsw_sic') /)
    201 
    202   type(ctrl_out),save,dimension(4) :: o_wbils_srf    = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_ter'), &
    203                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_lic'), &
    204                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_oce'), &
    205                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'wbils_sic') /)
    206 
    207   type(ctrl_out),save,dimension(4) :: o_wbilo_srf    = (/ ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_ter'), &
    208                                                      ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_lic'), &
    209                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_oce'), &
    210                                                  ctrl_out((/ 1, 10, 10, 10, 10 /),'wbilo_sic') /)
    211 
    212 
    213   type(ctrl_out),save :: o_cdrm         = ctrl_out((/ 1, 10, 10, 10, 10 /),'cdrm')
    214   type(ctrl_out),save :: o_cdrh         = ctrl_out((/ 1, 10, 10, 1, 10 /),'cdrh')
    215   type(ctrl_out),save :: o_cldl         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldl')
    216   type(ctrl_out),save :: o_cldm         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldm')
    217   type(ctrl_out),save :: o_cldh         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldh')
    218   type(ctrl_out),save :: o_cldt         = ctrl_out((/ 1, 1, 2, 5, 10 /),'cldt')
    219   type(ctrl_out),save :: o_cldq         = ctrl_out((/ 1, 1, 10, 10, 10 /),'cldq')
    220   type(ctrl_out),save :: o_lwp          = ctrl_out((/ 1, 5, 10, 10, 10 /),'lwp')
    221   type(ctrl_out),save :: o_iwp          = ctrl_out((/ 1, 5, 10, 10, 10 /),'iwp')
    222   type(ctrl_out),save :: o_ue           = ctrl_out((/ 1, 10, 10, 10, 10 /),'ue')
    223   type(ctrl_out),save :: o_ve           = ctrl_out((/ 1, 10, 10, 10, 10 /),'ve')
    224   type(ctrl_out),save :: o_uq           = ctrl_out((/ 1, 10, 10, 10, 10 /),'uq')
    225   type(ctrl_out),save :: o_vq           = ctrl_out((/ 1, 10, 10, 10, 10 /),'vq')
     199  type(ctrl_out),save,dimension(4) :: o_fsw_srf      = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_ter'), &
     200                                                  ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_lic'), &
     201                                                  ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_oce'), &
     202                                                  ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fsw_sic') /)
     203
     204  type(ctrl_out),save,dimension(4) :: o_wbils_srf    = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_ter'), &
     205                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_lic'), &
     206                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_oce'), &
     207                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbils_sic') /)
     208
     209  type(ctrl_out),save,dimension(4) :: o_wbilo_srf    = (/ ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_ter'), &
     210                                                     ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_lic'), &
     211                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_oce'), &
     212                                                 ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbilo_sic') /)
     213
     214
     215  type(ctrl_out),save :: o_cdrm         = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'cdrm')
     216  type(ctrl_out),save :: o_cdrh         = ctrl_out((/ 1, 10, 10, 7, 10, 10 /),'cdrh')
     217  type(ctrl_out),save :: o_cldl         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldl')
     218  type(ctrl_out),save :: o_cldm         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldm')
     219  type(ctrl_out),save :: o_cldh         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldh')
     220  type(ctrl_out),save :: o_cldt         = ctrl_out((/ 1, 1, 2, 10, 5, 10 /),'cldt')
     221  type(ctrl_out),save :: o_cldq         = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'cldq')
     222  type(ctrl_out),save :: o_lwp          = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'lwp')
     223  type(ctrl_out),save :: o_iwp          = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'iwp')
     224  type(ctrl_out),save :: o_ue           = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ue')
     225  type(ctrl_out),save :: o_ve           = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'ve')
     226  type(ctrl_out),save :: o_uq           = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'uq')
     227  type(ctrl_out),save :: o_vq           = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'vq')
    226228 
    227   type(ctrl_out),save :: o_cape         = ctrl_out((/ 1, 10, 10, 10, 10 /),'cape')
    228   type(ctrl_out),save :: o_pbase        = ctrl_out((/ 1, 5, 10, 10, 10 /),'pbase')
    229   type(ctrl_out),save :: o_ptop         = ctrl_out((/ 1, 5, 10, 10, 10 /),'ptop')
    230   type(ctrl_out),save :: o_fbase        = ctrl_out((/ 1, 10, 10, 10, 10 /),'fbase')
    231   type(ctrl_out),save :: o_plcl        = ctrl_out((/ 1, 10, 10, 10, 10 /),'plcl')
    232   type(ctrl_out),save :: o_plfc        = ctrl_out((/ 1, 10, 10, 10, 10 /),'plfc')
    233   type(ctrl_out),save :: o_wbeff        = ctrl_out((/ 1, 10, 10, 10, 10 /),'wbeff')
    234   type(ctrl_out),save :: o_prw          = ctrl_out((/ 1, 1, 10, 10, 10 /),'prw')
    235 
    236   type(ctrl_out),save :: o_s_pblh       = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_pblh')
    237   type(ctrl_out),save :: o_s_pblt       = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_pblt')
    238   type(ctrl_out),save :: o_s_lcl        = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_lcl')
    239   type(ctrl_out),save :: o_s_capCL      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_capCL')
    240   type(ctrl_out),save :: o_s_oliqCL     = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_oliqCL')
    241   type(ctrl_out),save :: o_s_cteiCL     = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_cteiCL')
    242   type(ctrl_out),save :: o_s_therm      = ctrl_out((/ 1, 10, 10, 10, 1 /),'s_therm')
    243   type(ctrl_out),save :: o_s_trmb1      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_trmb1')
    244   type(ctrl_out),save :: o_s_trmb2      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_trmb2')
    245   type(ctrl_out),save :: o_s_trmb3      = ctrl_out((/ 1, 10, 10, 10, 10 /),'s_trmb3')
    246 
    247   type(ctrl_out),save :: o_slab_bils    = ctrl_out((/ 1, 1, 10, 10, 10 /),'slab_bils_oce')
    248 
    249   type(ctrl_out),save :: o_ale_bl       = ctrl_out((/ 1, 1, 1, 10, 10 /),'ale_bl')
    250   type(ctrl_out),save :: o_alp_bl       = ctrl_out((/ 1, 1, 1, 10, 10 /),'alp_bl')
    251   type(ctrl_out),save :: o_ale_wk       = ctrl_out((/ 1, 1, 1, 10, 10 /),'ale_wk')
    252   type(ctrl_out),save :: o_alp_wk       = ctrl_out((/ 1, 1, 1, 10, 10 /),'alp_wk')
    253 
    254   type(ctrl_out),save :: o_ale          = ctrl_out((/ 1, 1, 1, 10, 10 /),'ale')
    255   type(ctrl_out),save :: o_alp          = ctrl_out((/ 1, 1, 1, 10, 10 /),'alp')
    256   type(ctrl_out),save :: o_cin          = ctrl_out((/ 1, 1, 1, 10, 10 /),'cin')
    257   type(ctrl_out),save :: o_wape         = ctrl_out((/ 1, 1, 1, 10, 10 /),'wape')
     229  type(ctrl_out),save :: o_cape         = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'cape')
     230  type(ctrl_out),save :: o_pbase        = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'pbase')
     231  type(ctrl_out),save :: o_ptop         = ctrl_out((/ 1, 5, 10, 10, 10, 10 /),'ptop')
     232  type(ctrl_out),save :: o_fbase        = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'fbase')
     233  type(ctrl_out),save :: o_plcl        = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'plcl')
     234  type(ctrl_out),save :: o_plfc        = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'plfc')
     235  type(ctrl_out),save :: o_wbeff        = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'wbeff')
     236  type(ctrl_out),save :: o_prw          = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'prw')
     237
     238  type(ctrl_out),save :: o_s_pblh       = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_pblh')
     239  type(ctrl_out),save :: o_s_pblt       = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_pblt')
     240  type(ctrl_out),save :: o_s_lcl        = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_lcl')
     241  type(ctrl_out),save :: o_s_therm      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_therm')
     242!IM : Les champs suivants (s_capCL, s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F
     243! type(ctrl_out),save :: o_s_capCL      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_capCL')
     244! type(ctrl_out),save :: o_s_oliqCL     = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_oliqCL')
     245! type(ctrl_out),save :: o_s_cteiCL     = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_cteiCL')
     246! type(ctrl_out),save :: o_s_trmb1      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_trmb1')
     247! type(ctrl_out),save :: o_s_trmb2      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_trmb2')
     248! type(ctrl_out),save :: o_s_trmb3      = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'s_trmb3')
     249
     250  type(ctrl_out),save :: o_slab_bils    = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'slab_bils_oce')
     251
     252  type(ctrl_out),save :: o_ale_bl       = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'ale_bl')
     253  type(ctrl_out),save :: o_alp_bl       = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_bl')
     254  type(ctrl_out),save :: o_ale_wk       = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'ale_wk')
     255  type(ctrl_out),save :: o_alp_wk       = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp_wk')
     256
     257  type(ctrl_out),save :: o_ale          = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'ale')
     258  type(ctrl_out),save :: o_alp          = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'alp')
     259  type(ctrl_out),save :: o_cin          = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'cin')
     260  type(ctrl_out),save :: o_wape         = ctrl_out((/ 1, 1, 1, 10, 10, 10 /),'wape')
    258261
    259262
    260263! Champs interpolles sur des niveaux de pression ??? a faire correctement
    261264                                             
    262   type(ctrl_out),save,dimension(6) :: o_uSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'u850'), &
    263                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'u700'), &
    264                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'u500'), &
    265                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'u200'), &
    266                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'u50'), &
    267                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'u10') /)
     265  type(ctrl_out),save,dimension(7) :: o_uSTDlevs     = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u850'), &
     266                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u700'), &
     267                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u500'), &
     268                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u200'), &
     269                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u100'), &
     270                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u50'), &
     271                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'u10') /)
    268272                                                     
    269273
    270   type(ctrl_out),save,dimension(6) :: o_vSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'v850'), &
    271                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'v700'), &
    272                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'v500'), &
    273                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'v200'), &
    274                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'v50'), &
    275                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'v10') /)
    276 
    277   type(ctrl_out),save,dimension(6) :: o_wSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'w850'), &
    278                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'w700'), &
    279                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'w500'), &
    280                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'w200'), &
    281                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'w50'), &
    282                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'w10') /)
    283 
    284   type(ctrl_out),save,dimension(6) :: o_tSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'t850'), &
    285                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'t700'), &
    286                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'t500'), &
    287                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'t200'), &
    288                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'t50'), &
    289                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'t10') /)
    290 
    291   type(ctrl_out),save,dimension(6) :: o_qSTDlevs     = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'q850'), &
    292                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'q700'), &
    293                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'q500'), &
    294                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'q200'), &
    295                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'q50'), &
    296                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'q10') /)
    297 
    298   type(ctrl_out),save,dimension(6) :: o_zSTDlevs   = (/ ctrl_out((/ 1, 1, 3, 10, 10 /),'z850'), &
    299                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'z700'), &
    300                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'z500'), &
    301                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'z200'), &
    302                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'z50'), &
    303                                                      ctrl_out((/ 1, 1, 3, 10, 10 /),'z10') /)
    304 
    305 
    306   type(ctrl_out),save :: o_t_oce_sic    = ctrl_out((/ 1, 10, 10, 10, 10 /),'t_oce_sic')
    307 
    308   type(ctrl_out),save :: o_weakinv      = ctrl_out((/ 10, 1, 10, 10, 10 /),'weakinv')
    309   type(ctrl_out),save :: o_dthmin       = ctrl_out((/ 10, 1, 10, 10, 10 /),'dthmin')
    310   type(ctrl_out),save,dimension(4) :: o_u10_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_ter'), &
    311                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_lic'), &
    312                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_oce'), &
    313                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'u10_sic') /)
    314 
    315   type(ctrl_out),save,dimension(4) :: o_v10_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_ter'), &
    316                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_lic'), &
    317                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_oce'), &
    318                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'v10_sic') /)
    319 
    320   type(ctrl_out),save :: o_cldtau       = ctrl_out((/ 10, 5, 10, 10, 10 /),'cldtau')                     
    321   type(ctrl_out),save :: o_cldemi       = ctrl_out((/ 10, 5, 10, 10, 10 /),'cldemi')
    322   type(ctrl_out),save :: o_rh2m         = ctrl_out((/ 5, 5, 10, 10, 10 /),'rh2m')
    323   type(ctrl_out),save :: o_rh2m_min     = ctrl_out((/ 10, 5, 10, 10, 10 /),'rh2m_min')
    324   type(ctrl_out),save :: o_rh2m_max     = ctrl_out((/ 10, 5, 10, 10, 10 /),'rh2m_max')
    325   type(ctrl_out),save :: o_qsat2m       = ctrl_out((/ 10, 5, 10, 10, 10 /),'qsat2m')
    326   type(ctrl_out),save :: o_tpot         = ctrl_out((/ 10, 5, 10, 10, 10 /),'tpot')
    327   type(ctrl_out),save :: o_tpote        = ctrl_out((/ 10, 5, 10, 10, 10 /),'tpote')
    328   type(ctrl_out),save :: o_tke          = ctrl_out((/ 4, 10, 10, 10, 10 /),'tke ')
    329   type(ctrl_out),save :: o_tke_max      = ctrl_out((/ 4, 10, 10, 10, 10 /),'tke_max')
    330 
    331   type(ctrl_out),save,dimension(4) :: o_tke_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_ter'), &
    332                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_lic'), &
    333                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_oce'), &
    334                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_sic') /)
    335 
    336   type(ctrl_out),save,dimension(4) :: o_tke_max_srf  = (/ ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_ter'), &
    337                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_lic'), &
    338                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_oce'), &
    339                                                      ctrl_out((/ 10, 4, 10, 10, 10 /),'tke_max_sic') /)
    340 
    341   type(ctrl_out),save :: o_kz           = ctrl_out((/ 4, 10, 10, 10, 10 /),'kz')
    342   type(ctrl_out),save :: o_kz_max       = ctrl_out((/ 4, 10, 10, 10, 10 /),'kz_max')
    343   type(ctrl_out),save :: o_SWnetOR      = ctrl_out((/ 10, 10, 2, 10, 10 /),'SWnetOR')
    344   type(ctrl_out),save :: o_SWdownOR     = ctrl_out((/ 10, 10, 2, 10, 10 /),'SWdownOR')
    345   type(ctrl_out),save :: o_LWdownOR     = ctrl_out((/ 10, 10, 2, 10, 10 /),'LWdownOR')
    346 
    347   type(ctrl_out),save :: o_snowl        = ctrl_out((/ 10, 1, 10, 10, 10 /),'snowl')
    348   type(ctrl_out),save :: o_cape_max     = ctrl_out((/ 10, 1, 10, 10, 10 /),'cape_max')
    349   type(ctrl_out),save :: o_solldown     = ctrl_out((/ 10, 1, 10, 10, 10 /),'solldown')
    350 
    351   type(ctrl_out),save :: o_dtsvdfo      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdfo')
    352   type(ctrl_out),save :: o_dtsvdft      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdft')
    353   type(ctrl_out),save :: o_dtsvdfg      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdfg')
    354   type(ctrl_out),save :: o_dtsvdfi      = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtsvdfi')
    355   type(ctrl_out),save :: o_rugs         = ctrl_out((/ 10, 10, 10, 10, 10 /),'rugs')
    356 
    357   type(ctrl_out),save :: o_topswad      = ctrl_out((/ 2, 10, 10, 10, 10 /),'topswad')
    358   type(ctrl_out),save :: o_topswai      = ctrl_out((/ 2, 10, 10, 10, 10 /),'topswai')
    359   type(ctrl_out),save :: o_solswad      = ctrl_out((/ 2, 10, 10, 10, 10 /),'solswad')
    360   type(ctrl_out),save :: o_solswai      = ctrl_out((/ 2, 10, 10, 10, 10 /),'solswai')
    361 
    362   type(ctrl_out),save,dimension(10) :: o_tausumaero  = (/ ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_ASBCM'), &
    363                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_ASPOMM'), &
    364                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_ASSO4M'), &
    365                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_CSSO4M'), &
    366                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_SSSSM'), &
    367                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_ASSSM'), &
    368                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_CSSSM'), &
    369                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_CIDUSTM'), &
    370                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_AIBCM'), &
    371                                                      ctrl_out((/ 4, 4, 10, 10, 10 /),'OD550_AIPOMM') /)
    372 
    373   type(ctrl_out),save :: o_od550aer         = ctrl_out((/ 4, 4, 10, 10, 10 /),'od550aer')
    374   type(ctrl_out),save :: o_od865aer         = ctrl_out((/ 4, 4, 10, 10, 10 /),'od865aer')
    375   type(ctrl_out),save :: o_absvisaer        = ctrl_out((/ 4, 4, 10, 10, 10 /),'absvisaer')
    376   type(ctrl_out),save :: o_od550lt1aer      = ctrl_out((/ 4, 4, 10, 10, 10 /),'od550lt1aer')
    377 
    378   type(ctrl_out),save :: o_sconcso4         = ctrl_out((/ 4, 4, 10, 10, 10 /),'sconcso4')
    379   type(ctrl_out),save :: o_sconcoa          = ctrl_out((/ 4, 4, 10, 10, 10 /),'sconcoa')
    380   type(ctrl_out),save :: o_sconcbc          = ctrl_out((/ 4, 4, 10, 10, 10 /),'sconcbc')
    381   type(ctrl_out),save :: o_sconcss          = ctrl_out((/ 4, 4, 10, 10, 10 /),'sconcss')
    382   type(ctrl_out),save :: o_sconcdust        = ctrl_out((/ 4, 4, 10, 10, 10 /),'sconcdust')
    383   type(ctrl_out),save :: o_concso4          = ctrl_out((/ 4, 4, 10, 10, 10 /),'concso4')
    384   type(ctrl_out),save :: o_concoa           = ctrl_out((/ 4, 4, 10, 10, 10 /),'concoa')
    385   type(ctrl_out),save :: o_concbc           = ctrl_out((/ 4, 4, 10, 10, 10 /),'concbc')
    386   type(ctrl_out),save :: o_concss           = ctrl_out((/ 4, 4, 10, 10, 10 /),'concss')
    387   type(ctrl_out),save :: o_concdust         = ctrl_out((/ 4, 4, 10, 10, 10 /),'concdust')
    388   type(ctrl_out),save :: o_loadso4          = ctrl_out((/ 4, 4, 10, 10, 10 /),'loadso4')
    389   type(ctrl_out),save :: o_loadoa           = ctrl_out((/ 4, 4, 10, 10, 10 /),'loadoa')
    390   type(ctrl_out),save :: o_loadbc           = ctrl_out((/ 4, 4, 10, 10, 10 /),'loadbc')
    391   type(ctrl_out),save :: o_loadss           = ctrl_out((/ 4, 4, 10, 10, 10 /),'loadss')
    392   type(ctrl_out),save :: o_loaddust         = ctrl_out((/ 4, 4, 10, 10, 10 /),'loaddust')
    393 
    394 
    395   type(ctrl_out),save :: o_swtoaas_nat      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swtoaas_nat')
    396   type(ctrl_out),save :: o_swsrfas_nat      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swsrfas_nat')
    397   type(ctrl_out),save :: o_swtoacs_nat      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swtoacs_nat')
    398   type(ctrl_out),save :: o_swsrfcs_nat      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swsrfcs_nat')
    399 
    400   type(ctrl_out),save :: o_swtoaas_ant      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swtoaas_ant')
    401   type(ctrl_out),save :: o_swsrfas_ant      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swsrfas_ant')
    402   type(ctrl_out),save :: o_swtoacs_ant      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swtoacs_ant')
    403   type(ctrl_out),save :: o_swsrfcs_ant      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swsrfcs_ant')
    404   type(ctrl_out),save :: o_swtoacf_nat      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swtoacf_nat')
    405   type(ctrl_out),save :: o_swsrfcf_nat      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swsrfcf_nat')
    406   type(ctrl_out),save :: o_swtoacf_ant      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swtoacf_ant')
    407   type(ctrl_out),save :: o_swsrfcf_ant      = ctrl_out((/ 4, 4, 10, 10, 10 /),'swsrfcf_ant')
    408   type(ctrl_out),save :: o_swtoacf_zero     = ctrl_out((/ 4, 4, 10, 10, 10 /),'swtoacf_zero')
    409   type(ctrl_out),save :: o_swsrfcf_zero     = ctrl_out((/ 4, 4, 10, 10, 10 /),'swsrfcf_zero')
    410 
    411   type(ctrl_out),save :: o_cldncl          = ctrl_out((/ 4, 4, 10, 10, 10 /),'cldncl')
    412   type(ctrl_out),save :: o_reffclwtop      = ctrl_out((/ 4, 4, 10, 10, 10 /),'reffclwtop')
    413   type(ctrl_out),save :: o_cldnvi          = ctrl_out((/ 4, 4, 10, 10, 10 /),'cldnvi')
    414   type(ctrl_out),save :: o_lcc             = ctrl_out((/ 4, 4, 10, 10, 10 /),'lcc')
     274  type(ctrl_out),save,dimension(7) :: o_vSTDlevs     = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v850'), &
     275                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v700'), &
     276                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v500'), &
     277                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v200'), &
     278                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v100'), &
     279                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v50'), &
     280                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'v10') /)
     281
     282  type(ctrl_out),save,dimension(7) :: o_wSTDlevs     = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w850'), &
     283                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w700'), &
     284                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w500'), &
     285                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w200'), &
     286                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w100'), &
     287                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w50'), &
     288                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'w10') /)
     289
     290  type(ctrl_out),save,dimension(7) :: o_tSTDlevs     = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t850'), &
     291                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t700'), &
     292                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t500'), &
     293                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t200'), &
     294                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t100'), &
     295                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t50'), &
     296                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'t10') /)
     297
     298  type(ctrl_out),save,dimension(7) :: o_qSTDlevs     = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q850'), &
     299                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q700'), &
     300                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q500'), &
     301                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q200'), &
     302                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q100'), &
     303                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q50'), &
     304                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'q10') /)
     305
     306  type(ctrl_out),save,dimension(7) :: o_zSTDlevs   = (/ ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z850'), &
     307                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z700'), &
     308                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z500'), &
     309                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z200'), &
     310                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z100'), &
     311                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z50'), &
     312                                                     ctrl_out((/ 1, 7, 7, 10, 10, 10 /),'z10') /)
     313
     314
     315  type(ctrl_out),save :: o_t_oce_sic    = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'t_oce_sic')
     316
     317  type(ctrl_out),save :: o_weakinv      = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'weakinv')
     318  type(ctrl_out),save :: o_dthmin       = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'dthmin')
     319  type(ctrl_out),save,dimension(4) :: o_u10_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_ter'), &
     320                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_lic'), &
     321                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_oce'), &
     322                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'u10_sic') /)
     323
     324  type(ctrl_out),save,dimension(4) :: o_v10_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_ter'), &
     325                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_lic'), &
     326                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_oce'), &
     327                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'v10_sic') /)
     328
     329  type(ctrl_out),save :: o_cldtau       = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'cldtau')                     
     330  type(ctrl_out),save :: o_cldemi       = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'cldemi')
     331  type(ctrl_out),save :: o_rh2m         = ctrl_out((/ 5, 5, 10, 10, 10, 10 /),'rh2m')
     332  type(ctrl_out),save :: o_rh2m_min     = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'rh2m_min')
     333  type(ctrl_out),save :: o_rh2m_max     = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'rh2m_max')
     334  type(ctrl_out),save :: o_qsat2m       = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'qsat2m')
     335  type(ctrl_out),save :: o_tpot         = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'tpot')
     336  type(ctrl_out),save :: o_tpote        = ctrl_out((/ 10, 5, 10, 10, 10, 10 /),'tpote')
     337  type(ctrl_out),save :: o_tke          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tke ')
     338  type(ctrl_out),save :: o_tke_max      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tke_max')
     339
     340  type(ctrl_out),save,dimension(4) :: o_tke_srf      = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_ter'), &
     341                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_lic'), &
     342                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_oce'), &
     343                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_sic') /)
     344
     345  type(ctrl_out),save,dimension(4) :: o_tke_max_srf  = (/ ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_ter'), &
     346                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_lic'), &
     347                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_oce'), &
     348                                                     ctrl_out((/ 10, 4, 10, 10, 10, 10 /),'tke_max_sic') /)
     349
     350  type(ctrl_out),save :: o_kz           = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'kz')
     351  type(ctrl_out),save :: o_kz_max       = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'kz_max')
     352  type(ctrl_out),save :: o_SWnetOR      = ctrl_out((/ 10, 10, 2, 10, 10, 10 /),'SWnetOR')
     353  type(ctrl_out),save :: o_SWdownOR     = ctrl_out((/ 10, 10, 2, 10, 10, 10 /),'SWdownOR')
     354  type(ctrl_out),save :: o_LWdownOR     = ctrl_out((/ 10, 10, 2, 10, 10, 10 /),'LWdownOR')
     355
     356  type(ctrl_out),save :: o_snowl        = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'snowl')
     357  type(ctrl_out),save :: o_cape_max     = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'cape_max')
     358  type(ctrl_out),save :: o_solldown     = ctrl_out((/ 10, 1, 10, 10, 10, 10 /),'solldown')
     359
     360  type(ctrl_out),save :: o_dtsvdfo      = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdfo')
     361  type(ctrl_out),save :: o_dtsvdft      = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdft')
     362  type(ctrl_out),save :: o_dtsvdfg      = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdfg')
     363  type(ctrl_out),save :: o_dtsvdfi      = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtsvdfi')
     364  type(ctrl_out),save :: o_rugs         = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'rugs')
     365
     366  type(ctrl_out),save :: o_topswad      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswad')
     367  type(ctrl_out),save :: o_topswai      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'topswai')
     368  type(ctrl_out),save :: o_solswad      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswad')
     369  type(ctrl_out),save :: o_solswai      = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'solswai')
     370
     371  type(ctrl_out),save,dimension(10) :: o_tausumaero  = (/ ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASBCM'), &
     372                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASPOMM'), &
     373                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASSO4M'), &
     374                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_CSSO4M'), &
     375                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_SSSSM'), &
     376                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_ASSSM'), &
     377                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_CSSSM'), &
     378                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_CIDUSTM'), &
     379                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_AIBCM'), &
     380                                                     ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'OD550_AIPOMM') /)
     381
     382  type(ctrl_out),save :: o_od550aer     = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'od550aer')
     383  type(ctrl_out),save :: o_od865aer     = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'od865aer')
     384  type(ctrl_out),save :: o_absvisaer    = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'absvisaer')
     385  type(ctrl_out),save :: o_od550lt1aer  = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'od550lt1aer')
     386
     387  type(ctrl_out),save :: o_sconcso4     = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcso4')
     388  type(ctrl_out),save :: o_sconcoa      = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcoa')
     389  type(ctrl_out),save :: o_sconcbc      = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcbc')
     390  type(ctrl_out),save :: o_sconcss      = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcss')
     391  type(ctrl_out),save :: o_sconcdust    = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'sconcdust')
     392  type(ctrl_out),save :: o_concso4      = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concso4')
     393  type(ctrl_out),save :: o_concoa       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concoa')
     394  type(ctrl_out),save :: o_concbc       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concbc')
     395  type(ctrl_out),save :: o_concss       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concss')
     396  type(ctrl_out),save :: o_concdust     = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'concdust')
     397  type(ctrl_out),save :: o_loadso4      = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadso4')
     398  type(ctrl_out),save :: o_loadoa       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadoa')
     399  type(ctrl_out),save :: o_loadbc       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadbc')
     400  type(ctrl_out),save :: o_loadss       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loadss')
     401  type(ctrl_out),save :: o_loaddust     = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'loaddust')
     402
     403  type(ctrl_out),save :: o_swtoaas_nat  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoaas_nat')
     404  type(ctrl_out),save :: o_swsrfas_nat  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfas_nat')
     405  type(ctrl_out),save :: o_swtoacs_nat  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacs_nat')
     406  type(ctrl_out),save :: o_swsrfcs_nat  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcs_nat')
     407
     408  type(ctrl_out),save :: o_swtoaas_ant  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoaas_ant')
     409  type(ctrl_out),save :: o_swsrfas_ant  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfas_ant')
     410  type(ctrl_out),save :: o_swtoacs_ant  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacs_ant')
     411  type(ctrl_out),save :: o_swsrfcs_ant  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcs_ant')
     412
     413  type(ctrl_out),save :: o_swtoacf_nat  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacf_nat')
     414  type(ctrl_out),save :: o_swsrfcf_nat  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcf_nat')
     415  type(ctrl_out),save :: o_swtoacf_ant  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacf_ant')
     416  type(ctrl_out),save :: o_swsrfcf_ant  = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcf_ant')
     417  type(ctrl_out),save :: o_swtoacf_zero = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swtoacf_zero')
     418  type(ctrl_out),save :: o_swsrfcf_zero = ctrl_out((/ 4, 6, 10, 10, 10, 10 /),'swsrfcf_zero')
     419
     420  type(ctrl_out),save :: o_cldncl       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'cldncl')
     421  type(ctrl_out),save :: o_reffclwtop   = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'reffclwtop')
     422  type(ctrl_out),save :: o_cldnvi       = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'cldnvi')
     423  type(ctrl_out),save :: o_lcc          = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'lcc')
    415424
    416425
    417426!!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    418   type(ctrl_out),save :: o_ec550aer     = ctrl_out((/ 4,  4, 10, 10, 1 /),'ec550aer')
    419   type(ctrl_out),save :: o_lwcon        = ctrl_out((/ 2, 5, 10, 10, 1 /),'lwcon')
    420   type(ctrl_out),save :: o_iwcon        = ctrl_out((/ 2, 5, 10, 10, 10 /),'iwcon')
    421   type(ctrl_out),save :: o_temp         = ctrl_out((/ 2, 3, 4, 10, 1 /),'temp')
    422   type(ctrl_out),save :: o_theta        = ctrl_out((/ 2, 3, 4, 10, 1 /),'theta')
    423   type(ctrl_out),save :: o_ovap         = ctrl_out((/ 2, 3, 4, 10, 1 /),'ovap')
    424   type(ctrl_out),save :: o_ovapinit         = ctrl_out((/ 2, 3, 10, 10, 1 /),'ovapinit')
    425   type(ctrl_out),save :: o_wvapp        = ctrl_out((/ 2, 10, 10, 10, 10 /),'wvapp')
    426   type(ctrl_out),save :: o_geop         = ctrl_out((/ 2, 3, 10, 10, 1 /),'geop')
    427   type(ctrl_out),save :: o_vitu         = ctrl_out((/ 2, 3, 4, 5, 1 /),'vitu')
    428   type(ctrl_out),save :: o_vitv         = ctrl_out((/ 2, 3, 4, 5, 1 /),'vitv')
    429   type(ctrl_out),save :: o_vitw         = ctrl_out((/ 2, 3, 10, 5, 1 /),'vitw')
    430   type(ctrl_out),save :: o_pres         = ctrl_out((/ 2, 3, 10, 10, 1 /),'pres')
    431   type(ctrl_out),save :: o_paprs        = ctrl_out((/ 2, 3, 10, 10, 1 /),'paprs')
    432   type(ctrl_out),save :: o_mass        = ctrl_out((/ 2, 3, 10, 10, 1 /),'mass')
    433 
    434   type(ctrl_out),save :: o_rneb         = ctrl_out((/ 2, 5, 10, 10, 1 /),'rneb')
    435   type(ctrl_out),save :: o_rnebcon      = ctrl_out((/ 2, 5, 10, 10, 1 /),'rnebcon')
    436   type(ctrl_out),save :: o_rhum         = ctrl_out((/ 2, 5, 10, 10, 10 /),'rhum')
    437   type(ctrl_out),save :: o_ozone        = ctrl_out((/ 2, 10, 10, 10, 10 /),'ozone')
    438   type(ctrl_out),save :: o_ozone_light  = ctrl_out((/ 2, 10, 10, 10, 10 /),'ozone_daylight')
    439   type(ctrl_out),save :: o_upwd         = ctrl_out((/ 2, 10, 10, 10, 10 /),'upwd')
    440   type(ctrl_out),save :: o_dtphy        = ctrl_out((/ 2, 10, 10, 10, 10 /),'dtphy')
    441   type(ctrl_out),save :: o_dqphy        = ctrl_out((/ 2, 10, 10, 10, 10 /),'dqphy')
    442   type(ctrl_out),save :: o_pr_con_l     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_con_l')
    443   type(ctrl_out),save :: o_pr_con_i     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_con_i')
    444   type(ctrl_out),save :: o_pr_lsc_l     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_lsc_l')
    445   type(ctrl_out),save :: o_pr_lsc_i     = ctrl_out((/ 2, 10, 10, 10, 10 /),'pr_lsc_i')
    446   type(ctrl_out),save :: o_re           = ctrl_out((/ 5, 10, 10, 10, 10 /),'re')
    447   type(ctrl_out),save :: o_fl           = ctrl_out((/ 5, 10, 10, 10, 10 /),'fl')
    448   type(ctrl_out),save :: o_scdnc        =ctrl_out((/ 4,  4, 10, 10, 1 /),'scdnc')
    449   type(ctrl_out),save :: o_reffclws     =ctrl_out((/ 4,  4, 10, 10, 1 /),'reffclws')
    450   type(ctrl_out),save :: o_reffclwc     =ctrl_out((/ 4,  4, 10, 10, 1 /),'reffclwc')
    451   type(ctrl_out),save :: o_lcc3d        =ctrl_out((/ 4,  4, 10, 10, 1 /),'lcc3d')
    452   type(ctrl_out),save :: o_lcc3dcon     =ctrl_out((/ 4,  4, 10, 10, 1 /),'lcc3dcon')
    453   type(ctrl_out),save :: o_lcc3dstra    =ctrl_out((/ 4,  4, 10, 10, 1 /),'lcc3dstra')
     427  type(ctrl_out),save :: o_ec550aer     = ctrl_out((/ 2, 6, 10, 10, 10, 10 /),'ec550aer')
     428  type(ctrl_out),save :: o_lwcon        = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'lwcon')
     429  type(ctrl_out),save :: o_iwcon        = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'iwcon')
     430  type(ctrl_out),save :: o_temp         = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'temp')
     431  type(ctrl_out),save :: o_theta        = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'theta')
     432  type(ctrl_out),save :: o_ovap         = ctrl_out((/ 2, 3, 4, 10, 10, 10 /),'ovap')
     433  type(ctrl_out),save :: o_ovapinit     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ovapinit')
     434  type(ctrl_out),save :: o_wvapp        = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'wvapp')
     435  type(ctrl_out),save :: o_geop         = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'geop')
     436  type(ctrl_out),save :: o_vitu         = ctrl_out((/ 2, 3, 4, 6, 10, 10 /),'vitu')
     437  type(ctrl_out),save :: o_vitv         = ctrl_out((/ 2, 3, 4, 6, 10, 10 /),'vitv')
     438  type(ctrl_out),save :: o_vitw         = ctrl_out((/ 2, 3, 10, 6, 10, 10 /),'vitw')
     439  type(ctrl_out),save :: o_pres         = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'pres')
     440  type(ctrl_out),save :: o_paprs        = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'paprs')
     441  type(ctrl_out),save :: o_mass        = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'mass')
     442  type(ctrl_out),save :: o_zfull       = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'zfull')
     443  type(ctrl_out),save :: o_zhalf       = ctrl_out((/ 2, 3, 10, 10, 10, 10 /),'zhalf')
     444  type(ctrl_out),save :: o_rneb         = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'rneb')
     445  type(ctrl_out),save :: o_rnebcon      = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'rnebcon')
     446  type(ctrl_out),save :: o_rhum         = ctrl_out((/ 2, 5, 10, 10, 10, 10 /),'rhum')
     447  type(ctrl_out),save :: o_ozone        = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ozone')
     448  type(ctrl_out),save :: o_ozone_light  = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'ozone_daylight')
     449  type(ctrl_out),save :: o_upwd         = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'upwd')
     450  type(ctrl_out),save :: o_dtphy        = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'dtphy')
     451  type(ctrl_out),save :: o_dqphy        = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'dqphy')
     452  type(ctrl_out),save :: o_pr_con_l     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_con_l')
     453  type(ctrl_out),save :: o_pr_con_i     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_con_i')
     454  type(ctrl_out),save :: o_pr_lsc_l     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_lsc_l')
     455  type(ctrl_out),save :: o_pr_lsc_i     = ctrl_out((/ 2, 10, 10, 10, 10, 10 /),'pr_lsc_i')
     456  type(ctrl_out),save :: o_re           = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'re')
     457  type(ctrl_out),save :: o_fl           = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'fl')
     458  type(ctrl_out),save :: o_scdnc        = ctrl_out((/ 2,  6, 10, 10, 10, 10 /),'scdnc')
     459  type(ctrl_out),save :: o_reffclws     = ctrl_out((/ 2,  6, 10, 10, 10, 10 /),'reffclws')
     460  type(ctrl_out),save :: o_reffclwc     = ctrl_out((/ 2,  6, 10, 10, 10, 10 /),'reffclwc')
     461  type(ctrl_out),save :: o_lcc3d        = ctrl_out((/ 2,  6, 10, 10, 10, 10 /),'lcc3d')
     462  type(ctrl_out),save :: o_lcc3dcon     = ctrl_out((/ 2,  6, 10, 10, 10, 10 /),'lcc3dcon')
     463  type(ctrl_out),save :: o_lcc3dstra    = ctrl_out((/ 2,  6, 10, 10, 10, 10 /),'lcc3dstra')
    454464!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    455465
    456   type(ctrl_out),save,dimension(4) :: o_albe_srf     = (/ ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_ter'), &
    457                                                      ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_lic'), &
    458                                                      ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_oce'), &
    459                                                      ctrl_out((/ 3, 4, 10, 1, 10 /),'albe_sic') /)
    460 
    461   type(ctrl_out),save,dimension(4) :: o_ages_srf     = (/ ctrl_out((/ 10, 10, 10, 10, 10 /),'ages_ter'), &
    462                                                      ctrl_out((/ 3, 10, 10, 10, 10 /),'ages_lic'), &
    463                                                      ctrl_out((/ 10, 10, 10, 10, 10 /),'ages_oce'), &
    464                                                      ctrl_out((/ 3, 10, 10, 10, 10 /),'ages_sic') /)
    465 
    466   type(ctrl_out),save,dimension(4) :: o_rugs_srf     = (/ ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_ter'), &
    467                                                      ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_lic'), &
    468                                                      ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_oce'), &
    469                                                      ctrl_out((/ 3, 4, 10, 10, 10 /),'rugs_sic') /)
    470 
    471   type(ctrl_out),save :: o_alb1         = ctrl_out((/ 3, 10, 10, 10, 10 /),'albs')
    472   type(ctrl_out),save :: o_alb2       = ctrl_out((/ 3, 10, 10, 10, 10 /),'albslw')
    473 
    474   type(ctrl_out),save :: o_clwcon       = ctrl_out((/ 4, 10, 10, 10, 10 /),'clwcon')
    475   type(ctrl_out),save :: o_Ma           = ctrl_out((/ 4, 10, 10, 10, 10 /),'Ma')
    476   type(ctrl_out),save :: o_dnwd         = ctrl_out((/ 4, 10, 10, 10, 10 /),'dnwd')
    477   type(ctrl_out),save :: o_dnwd0        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dnwd0')
    478   type(ctrl_out),save :: o_mc           = ctrl_out((/ 4, 10, 10, 10, 10 /),'mc')
    479   type(ctrl_out),save :: o_ftime_con    = ctrl_out((/ 4, 10, 10, 10, 10 /),'ftime_con')
    480   type(ctrl_out),save :: o_dtdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dtdyn')
    481   type(ctrl_out),save :: o_dqdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dqdyn')
    482   type(ctrl_out),save :: o_dudyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dudyn')  !AXC
    483   type(ctrl_out),save :: o_dvdyn        = ctrl_out((/ 4, 10, 10, 10, 1 /),'dvdyn')  !AXC
    484   type(ctrl_out),save :: o_dtcon        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dtcon')
    485   type(ctrl_out),save :: o_ducon        = ctrl_out((/ 4, 10, 10, 10, 10 /),'ducon')
    486   type(ctrl_out),save :: o_dqcon        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dqcon')
    487   type(ctrl_out),save :: o_dtwak        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dtwak')
    488   type(ctrl_out),save :: o_dqwak        = ctrl_out((/ 4, 5, 10, 10, 10 /),'dqwak')
    489   type(ctrl_out),save :: o_wake_h       = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_h')
    490   type(ctrl_out),save :: o_wake_s       = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_s')
    491   type(ctrl_out),save :: o_wake_deltat  = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_deltat')
    492   type(ctrl_out),save :: o_wake_deltaq  = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_deltaq')
    493   type(ctrl_out),save :: o_wake_omg     = ctrl_out((/ 4, 5, 10, 10, 10 /),'wake_omg')
    494   type(ctrl_out),save :: o_Vprecip      = ctrl_out((/ 10, 10, 10, 10, 10 /),'Vprecip')
    495   type(ctrl_out),save :: o_ftd          = ctrl_out((/ 4, 5, 10, 10, 10 /),'ftd')
    496   type(ctrl_out),save :: o_fqd          = ctrl_out((/ 4, 5, 10, 10, 10 /),'fqd')
    497   type(ctrl_out),save :: o_dtlsc        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlsc')
    498   type(ctrl_out),save :: o_dtlschr      = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlschr')
    499   type(ctrl_out),save :: o_dqlsc        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqlsc')
    500   type(ctrl_out),save :: o_dtvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtvdf')
    501   type(ctrl_out),save :: o_dqvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqvdf')
    502   type(ctrl_out),save :: o_dteva        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dteva')
    503   type(ctrl_out),save :: o_dqeva        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqeva')
     466  type(ctrl_out),save,dimension(4) :: o_albe_srf     = (/ ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_ter'), &
     467                                                     ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_lic'), &
     468                                                     ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_oce'), &
     469                                                     ctrl_out((/ 3, 7, 10, 7, 10, 10 /),'albe_sic') /)
     470
     471  type(ctrl_out),save,dimension(4) :: o_ages_srf     = (/ ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'ages_ter'), &
     472                                                     ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'ages_lic'), &
     473                                                     ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'ages_oce'), &
     474                                                     ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'ages_sic') /)
     475
     476  type(ctrl_out),save,dimension(4) :: o_rugs_srf     = (/ ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_ter'), &
     477                                                     ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_lic'), &
     478                                                     ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_oce'), &
     479                                                     ctrl_out((/ 3, 6, 10, 10, 10, 10 /),'rugs_sic') /)
     480
     481  type(ctrl_out),save :: o_alb1         = ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'alb1')
     482  type(ctrl_out),save :: o_alb2       = ctrl_out((/ 3, 10, 10, 10, 10, 10 /),'alb2')
     483
     484  type(ctrl_out),save :: o_clwcon       = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'clwcon')
     485  type(ctrl_out),save :: o_Ma           = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'Ma')
     486  type(ctrl_out),save :: o_dnwd         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dnwd')
     487  type(ctrl_out),save :: o_dnwd0        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dnwd0')
     488  type(ctrl_out),save :: o_mc           = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'mc')
     489  type(ctrl_out),save :: o_ftime_con    = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ftime_con')
     490  type(ctrl_out),save :: o_dtdyn        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtdyn')
     491  type(ctrl_out),save :: o_dqdyn        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqdyn')
     492  type(ctrl_out),save :: o_dudyn        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dudyn')  !AXC
     493  type(ctrl_out),save :: o_dvdyn        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvdyn')  !AXC
     494  type(ctrl_out),save :: o_dtcon        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtcon')
     495  type(ctrl_out),save :: o_ducon        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ducon')
     496  type(ctrl_out),save :: o_dqcon        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqcon')
     497  type(ctrl_out),save :: o_dtwak        = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'dtwak')
     498  type(ctrl_out),save :: o_dqwak        = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'dqwak')
     499  type(ctrl_out),save :: o_wake_h       = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_h')
     500  type(ctrl_out),save :: o_wake_s       = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_s')
     501  type(ctrl_out),save :: o_wake_deltat  = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_deltat')
     502  type(ctrl_out),save :: o_wake_deltaq  = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_deltaq')
     503  type(ctrl_out),save :: o_wake_omg     = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'wake_omg')
     504  type(ctrl_out),save :: o_Vprecip      = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'Vprecip')
     505  type(ctrl_out),save :: o_ftd          = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'ftd')
     506  type(ctrl_out),save :: o_fqd          = ctrl_out((/ 4, 5, 10, 10, 10, 10 /),'fqd')
     507  type(ctrl_out),save :: o_dtlsc        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlsc')
     508  type(ctrl_out),save :: o_dtlschr      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlschr')
     509  type(ctrl_out),save :: o_dqlsc        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqlsc')
     510  type(ctrl_out),save :: o_dtvdf        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtvdf')
     511  type(ctrl_out),save :: o_dqvdf        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqvdf')
     512  type(ctrl_out),save :: o_dteva        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dteva')
     513  type(ctrl_out),save :: o_dqeva        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqeva')
    504514
    505515!!!!!!!!!!!!!!!! Specifique thermiques
    506   type(ctrl_out),save :: o_dqlscth        = ctrl_out((/ 10, 10, 10, 10, 10 /),'dqlscth')
    507   type(ctrl_out),save :: o_dqlscst        = ctrl_out((/ 10, 10, 10, 10, 10 /),'dqlscst')
    508   type(ctrl_out),save :: o_dtlscth        = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtlscth')
    509   type(ctrl_out),save :: o_dtlscst        = ctrl_out((/ 10, 10, 10, 10, 10 /),'dtlscst')
    510   type(ctrl_out),save :: o_plulth        = ctrl_out((/ 10, 10, 10, 10, 10 /),'plulth')
    511   type(ctrl_out),save :: o_plulst        = ctrl_out((/ 10, 10, 10, 10, 10 /),'plulst')
    512   type(ctrl_out),save :: o_lmaxth        = ctrl_out((/ 10, 10, 10, 10, 10 /),'lmaxth')
    513   type(ctrl_out),save :: o_ptconvth        = ctrl_out((/ 10, 10, 10, 10, 10 /),'ptconvth')
     516  type(ctrl_out),save :: o_dqlscth        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dqlscth')
     517  type(ctrl_out),save :: o_dqlscst        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dqlscst')
     518  type(ctrl_out),save :: o_dtlscth        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtlscth')
     519  type(ctrl_out),save :: o_dtlscst        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'dtlscst')
     520  type(ctrl_out),save :: o_plulth        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'plulth')
     521  type(ctrl_out),save :: o_plulst        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'plulst')
     522  type(ctrl_out),save :: o_lmaxth        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'lmaxth')
     523  type(ctrl_out),save :: o_ptconvth        = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'ptconvth')
    514524!!!!!!!!!!!!!!!!!!!!!!!!
    515525
    516526
    517   type(ctrl_out),save :: o_ptconv       = ctrl_out((/ 4, 10, 10, 10, 10 /),'ptconv')
    518   type(ctrl_out),save :: o_ratqs        = ctrl_out((/ 4, 10, 10, 10, 10 /),'ratqs')
    519   type(ctrl_out),save :: o_dtthe        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtthe')
    520   type(ctrl_out),save :: o_f_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'f_th')
    521   type(ctrl_out),save :: o_e_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'e_th')
    522   type(ctrl_out),save :: o_w_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'w_th')
    523   type(ctrl_out),save :: o_lambda_th    = ctrl_out((/ 10, 10, 10, 10, 10 /),'lambda_th')
    524   type(ctrl_out),save :: o_ftime_th     = ctrl_out((/ 10, 10, 10, 10, 10 /),'ftime_th')
    525   type(ctrl_out),save :: o_q_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'q_th')
    526   type(ctrl_out),save :: o_a_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'a_th')
    527   type(ctrl_out),save :: o_d_th         = ctrl_out((/ 4, 10, 10, 10, 10 /),'d_th')
    528   type(ctrl_out),save :: o_f0_th        = ctrl_out((/ 4, 10, 10, 10, 10 /),'f0_th')
    529   type(ctrl_out),save :: o_zmax_th      = ctrl_out((/ 4, 10, 10, 10, 10 /),'zmax_th')
    530   type(ctrl_out),save :: o_dqthe        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqthe')
    531   type(ctrl_out),save :: o_dtajs        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtajs')
    532   type(ctrl_out),save :: o_dqajs        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dqajs')
    533   type(ctrl_out),save :: o_dtswr        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtswr')
    534   type(ctrl_out),save :: o_dtsw0        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtsw0')
    535   type(ctrl_out),save :: o_dtlwr        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlwr')
    536   type(ctrl_out),save :: o_dtlw0        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtlw0')
    537   type(ctrl_out),save :: o_dtec         = ctrl_out((/ 4, 10, 10, 10, 10 /),'dtec')
    538   type(ctrl_out),save :: o_duvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'duvdf')
    539   type(ctrl_out),save :: o_dvvdf        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dvvdf')
    540   type(ctrl_out),save :: o_duoro        = ctrl_out((/ 4, 10, 10, 10, 10 /),'duoro')
    541   type(ctrl_out),save :: o_dvoro        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dvoro')
    542   type(ctrl_out),save :: o_dulif        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dulif')
    543   type(ctrl_out),save :: o_dvlif        = ctrl_out((/ 4, 10, 10, 10, 10 /),'dvlif')
     527  type(ctrl_out),save :: o_ptconv       = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ptconv')
     528  type(ctrl_out),save :: o_ratqs        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ratqs')
     529  type(ctrl_out),save :: o_dtthe        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtthe')
     530  type(ctrl_out),save :: o_f_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'f_th')
     531  type(ctrl_out),save :: o_e_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'e_th')
     532  type(ctrl_out),save :: o_w_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'w_th')
     533  type(ctrl_out),save :: o_lambda_th    = ctrl_out((/ 10, 10, 10, 10, 10, 10 /),'lambda_th')
     534  type(ctrl_out),save :: o_ftime_th     = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ftime_th')
     535  type(ctrl_out),save :: o_q_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'q_th')
     536  type(ctrl_out),save :: o_a_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'a_th')
     537  type(ctrl_out),save :: o_d_th         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'d_th')
     538  type(ctrl_out),save :: o_f0_th        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'f0_th')
     539  type(ctrl_out),save :: o_zmax_th      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'zmax_th')
     540  type(ctrl_out),save :: o_dqthe        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqthe')
     541  type(ctrl_out),save :: o_dtajs        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtajs')
     542  type(ctrl_out),save :: o_dqajs        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dqajs')
     543  type(ctrl_out),save :: o_dtswr        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtswr')
     544  type(ctrl_out),save :: o_dtsw0        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtsw0')
     545  type(ctrl_out),save :: o_dtlwr        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlwr')
     546  type(ctrl_out),save :: o_dtlw0        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlw0')
     547  type(ctrl_out),save :: o_dtec         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtec')
     548  type(ctrl_out),save :: o_duvdf        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'duvdf')
     549  type(ctrl_out),save :: o_dvvdf        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvvdf')
     550  type(ctrl_out),save :: o_duoro        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'duoro')
     551  type(ctrl_out),save :: o_dvoro        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvoro')
     552  type(ctrl_out),save :: o_dulif        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dulif')
     553  type(ctrl_out),save :: o_dvlif        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvlif')
     554  type(ctrl_out),save :: o_duhin        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'duhin')
     555  type(ctrl_out),save :: o_dvhin        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dvhin')
     556  type(ctrl_out),save :: o_dtoro        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtoro')
     557  type(ctrl_out),save :: o_dtlif        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dtlif')
     558  type(ctrl_out),save :: o_dthin        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dthin')
     559
    544560  type(ctrl_out),save,allocatable :: o_trac(:)
     561
     562  type(ctrl_out),save :: o_rsu        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsu')
     563  type(ctrl_out),save :: o_rsd        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsd')
     564  type(ctrl_out),save :: o_rlu        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rlu')
     565  type(ctrl_out),save :: o_rld        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rld')
     566  type(ctrl_out),save :: o_rsucs      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsucs')
     567  type(ctrl_out),save :: o_rsdcs      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsdcs')
     568  type(ctrl_out),save :: o_rlucs      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rlucs')
     569  type(ctrl_out),save :: o_rldcs      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rldcs')
     570
     571  type(ctrl_out),save :: o_tnt          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnt')
     572  type(ctrl_out),save :: o_tntc         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tntc')
     573  type(ctrl_out),save :: o_tntr        = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tntr')
     574  type(ctrl_out),save :: o_tntscpbl          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tntscpbl')
     575
     576  type(ctrl_out),save :: o_tnhus          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnhus')
     577  type(ctrl_out),save :: o_tnhusc         = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnhusc')
     578  type(ctrl_out),save :: o_tnhusscpbl     = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'tnhusscpbl')
     579
     580  type(ctrl_out),save :: o_evu          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'evu')
     581
     582  type(ctrl_out),save :: o_h2o          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'h2o')
     583
     584  type(ctrl_out),save :: o_mcd          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'mcd')
     585  type(ctrl_out),save :: o_dmc          = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'dmc')
     586  type(ctrl_out),save :: o_ref_liq      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ref_liq')
     587  type(ctrl_out),save :: o_ref_ice      = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'ref_ice')
     588
     589  type(ctrl_out),save :: o_rsut4co2     = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsut4co2')
     590  type(ctrl_out),save :: o_rlut4co2     = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlut4co2')
     591  type(ctrl_out),save :: o_rsutcs4co2   = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsutcs4co2')
     592  type(ctrl_out),save :: o_rlutcs4co2   = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlutcs4co2')
     593
     594  type(ctrl_out),save :: o_rsu4co2     = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsu4co2')
     595  type(ctrl_out),save :: o_rlu4co2     = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlu4co2')
     596  type(ctrl_out),save :: o_rsucs4co2   = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsucs4co2')
     597  type(ctrl_out),save :: o_rlucs4co2   = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rlucs4co2')
     598  type(ctrl_out),save :: o_rsd4co2     = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsd4co2')
     599  type(ctrl_out),save :: o_rld4co2     = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rld4co2')
     600  type(ctrl_out),save :: o_rsdcs4co2   = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rsdcs4co2')
     601  type(ctrl_out),save :: o_rldcs4co2   = ctrl_out((/ 5, 10, 10, 10, 10, 10 /),'rldcs4co2')
     602
     603
    545604    CONTAINS
    546605
     
    550609!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    551610 
    552   SUBROUTINE phys_output_open(jjmp1,nlevSTD,clevSTD,nbteta, &
    553        ctetaSTD,dtime, ok_veget, &
     611  SUBROUTINE phys_output_open(rlon,rlat,pim,tabij,ipt,jpt,plon,plat, &
     612       jjmp1,nlevSTD,clevSTD,nbteta, &
     613       ctetaSTD, dtime, ok_veget, &
    554614       type_ocean, iflag_pbl,ok_mensuel,ok_journe, &
    555615       ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, read_climoz, &
     616       phys_out_filestations, &
    556617       new_aod, aerosol_couple)   
    557 
    558618
    559619  USE iophy
     
    571631  include "thermcell.h"
    572632  include "comvert.h"
     633
     634    real,dimension(klon),intent(in) :: rlon
     635    real,dimension(klon),intent(in) :: rlat
     636    integer, intent(in)             :: pim
     637    INTEGER, DIMENSION(pim)            :: tabij
     638    INTEGER,dimension(pim), intent(in) :: ipt, jpt
     639    REAL,dimension(pim), intent(in) :: plat, plon
     640    REAL,dimension(pim,2) :: plat_bounds, plon_bounds
    573641
    574642  integer                               :: jjmp1
     
    606674  integer, dimension(nfiles)            :: phys_out_filelevels
    607675  CHARACTER(len=20), dimension(nfiles)  :: type_ecri_files, phys_out_filetypes
    608   character(len=20), dimension(nfiles)  :: chtimestep   = (/ 'DefFreq', 'DefFreq','DefFreq', 'DefFreq', 'DefFreq' /)
     676  character(len=20), dimension(nfiles)  :: chtimestep   = (/ 'DefFreq', 'DefFreq','DefFreq', 'DefFreq', 'DefFreq', 'DefFreq' /)
    609677  logical, dimension(nfiles)            :: phys_out_filekeys
     678  logical, dimension(nfiles)            :: phys_out_filestations
    610679
    611680!!!!!!!!!! stockage dans une region limitee pour chaque fichier !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    612681!                 entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax]
    613682
    614   logical, dimension(nfiles), save  :: phys_out_regfkey       = (/ .false., .false., .false., .false., .false. /)
    615   real, dimension(nfiles), save     :: phys_out_lonmin        = (/ -180., -180., -180., -180., -180. /)
    616   real, dimension(nfiles), save     :: phys_out_lonmax        = (/ 180., 180., 180., 180., 180. /)
    617   real, dimension(nfiles), save     :: phys_out_latmin        = (/ -90., -90., -90., -90., -90. /)
    618   real, dimension(nfiles), save     :: phys_out_latmax        = (/ 90., 90., 90., 90., 90. /)
    619 
    620 !IM definition dynamique flag o_trac pour sortie traceurs
    621   INTEGER :: nq
    622   CHARACTER(len=8) :: solsym(nqtot)
     683  logical, dimension(nfiles), save  :: phys_out_regfkey       = (/ .false., .false., .false., .false., .false., .false. /)
     684  real, dimension(nfiles), save     :: phys_out_lonmin        = (/ -180., -180., -180., -180., -180., -180. /)
     685  real, dimension(nfiles), save     :: phys_out_lonmax        = (/ 180., 180., 180., 180., 180., 180. /)
     686  real, dimension(nfiles), save     :: phys_out_latmin        = (/ -90., -90., -90., -90., -90., -90. /)
     687  real, dimension(nfiles), save     :: phys_out_latmax        = (/ 90., 90., 90., 90., 90., 90. /)
    623688
    624689   print*,'Debut phys_output_mod.F90'
     
    627692   if (.not. allocated(o_trac)) ALLOCATE(o_trac(nqtot))
    628693
    629    levmax = (/ klev, klev, klev, klev, klev /)
     694   levmax = (/ klev, klev, klev, klev, klev, klev /)
    630695
    631696   phys_out_filenames(1) = 'histmth'
     
    634699   phys_out_filenames(4) = 'histins'
    635700   phys_out_filenames(5) = 'histLES'
     701   phys_out_filenames(6) = 'histstn'
    636702
    637703   type_ecri(1) = 'ave(X)'
     
    640706   type_ecri(4) = 'inst(X)'
    641707   type_ecri(5) = 'ave(X)'
     708   type_ecri(6) = 'inst(X)'
    642709
    643710   clef_files(1) = ok_mensuel
     
    646713   clef_files(4) = ok_instan
    647714   clef_files(5) = ok_LES
     715   clef_files(6) = ok_instan
     716
     717!sortir des fichiers "stations" si clef_stations(:)=.TRUE.
     718   clef_stations(1) = .FALSE.
     719   clef_stations(2) = .FALSE.
     720   clef_stations(3) = .FALSE.
     721   clef_stations(4) = .FALSE.
     722   clef_stations(5) = .FALSE.
     723   clef_stations(6) = .FALSE.
    648724
    649725   lev_files(1) = lev_histmth
     
    652728   lev_files(4) = lev_histins
    653729   lev_files(5) = lev_histLES
    654 
     730   lev_files(6) = lev_histins
    655731
    656732   ecrit_files(1) = ecrit_mth
     
    659735   ecrit_files(4) = ecrit_ins
    660736   ecrit_files(5) = ecrit_LES
     737   ecrit_files(6) = ecrit_ins
    661738 
    662739!! Lectures des parametres de sorties dans physiq.def
     
    674751     phys_out_filekeys(:)=clef_files(:)
    675752   call getin('phys_out_filekeys',clef_files)
     753     phys_out_filestations(:)=clef_stations(:)
     754   call getin('phys_out_filestations',clef_stations)
    676755     phys_out_filelevels(:)=lev_files(:)
    677756   call getin('phys_out_filelevels',lev_files)
     
    689768   print*,'phys_out_filetypes=',type_ecri
    690769   print*,'phys_out_filekeys=',clef_files
     770   print*,'phys_out_filestations=',clef_stations
    691771   print*,'phys_out_filelevels=',lev_files
    692772
     
    760840              itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff))
    761841!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     842!IM fichiers stations
     843     else if (clef_stations(iff)) THEN
     844
     845     print*,'phys_output_mod phys_out_filenames=',phys_out_filenames(iff)
     846
     847      call histbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, &
     848                           phys_out_filenames(iff), &
     849                           itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff))
    762850       else
    763851 CALL histbeg_phy(phys_out_filenames(iff),itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff))
     
    793881!                 1,preff,nvertp0(iff))
    794882!!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    795  CALL histdef2d(iff,o_phis%flag,o_phis%name,"Surface geop.height", "m2/s2")
     883 IF (.NOT.clef_stations(iff)) THEN
     884!
     885!IM: there is no way to have one single value in a netcdf file
     886!
    796887   type_ecri(1) = 'once'
    797888   type_ecri(2) = 'once'
     
    799890   type_ecri(4) = 'once'
    800891   type_ecri(5) = 'once'
    801  CALL histdef2d(iff,o_aire%flag,o_aire%name,"Grid area", "-")
    802  CALL histdef2d(iff,o_contfracATM%flag,o_contfracATM%name,"% sfce ter+lic", "-")
     892   type_ecri(6) = 'once'
     893   CALL histdef2d(iff,clef_stations(iff),o_aire%flag,o_aire%name,"Grid area", "-")
     894   CALL histdef2d(iff,clef_stations(iff),o_contfracATM%flag,o_contfracATM%name,"% sfce ter+lic", "-")
     895 ENDIF
    803896   type_ecri(:) = type_ecri_files(:)
    804897
    805898!!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    806  CALL histdef2d(iff,o_contfracOR%flag,o_contfracOR%name,"% sfce terre OR", "-" )
    807  CALL histdef2d(iff,o_aireTER%flag,o_aireTER%name,"Grid area CONT", "-" )
    808  CALL histdef2d(iff,o_flat%flag,o_flat%name, "Latent heat flux", "W/m2")
    809  CALL histdef2d(iff,o_slp%flag,o_slp%name, "Sea Level Pressure", "Pa" )
    810  CALL histdef2d(iff,o_tsol%flag,o_tsol%name, "Surface Temperature", "K")
    811  CALL histdef2d(iff,o_t2m%flag,o_t2m%name, "Temperature 2m", "K" )
     899 CALL histdef2d(iff,clef_stations(iff),o_phis%flag,o_phis%name,"Surface geop.height", "m2/s2" )
     900 CALL histdef2d(iff,clef_stations(iff),o_contfracOR%flag,o_contfracOR%name,"% sfce terre OR", "-" )
     901 CALL histdef2d(iff,clef_stations(iff),o_aireTER%flag,o_aireTER%name,"Grid area CONT", "-" )
     902 CALL histdef2d(iff,clef_stations(iff),o_flat%flag,o_flat%name, "Latent heat flux", "W/m2")
     903 CALL histdef2d(iff,clef_stations(iff),o_slp%flag,o_slp%name, "Sea Level Pressure", "Pa" )
     904 CALL histdef2d(iff,clef_stations(iff),o_tsol%flag,o_tsol%name, "Surface Temperature", "K")
     905 CALL histdef2d(iff,clef_stations(iff),o_t2m%flag,o_t2m%name, "Temperature 2m", "K" )
     906  IF (.NOT.clef_stations(iff)) THEN
     907!
     908!IM: there is no way to have one single value in a netcdf file
     909!
    812910   type_ecri(1) = 't_min(X)'
    813911   type_ecri(2) = 't_min(X)'
     
    815913   type_ecri(4) = 't_min(X)'
    816914   type_ecri(5) = 't_min(X)'
    817  CALL histdef2d(iff,o_t2m_min%flag,o_t2m_min%name, "Temp 2m min", "K" )
     915   type_ecri(6) = 't_min(X)'
     916   CALL histdef2d(iff,clef_stations(iff),o_t2m_min%flag,o_t2m_min%name, "Temp 2m min", "K" )
    818917   type_ecri(1) = 't_max(X)'
    819918   type_ecri(2) = 't_max(X)'
     
    821920   type_ecri(4) = 't_max(X)'
    822921   type_ecri(5) = 't_max(X)'
    823  CALL histdef2d(iff,o_t2m_max%flag,o_t2m_max%name, "Temp 2m max", "K" )
     922   type_ecri(6) = 't_max(X)'
     923   CALL histdef2d(iff,clef_stations(iff),o_t2m_max%flag,o_t2m_max%name, "Temp 2m max", "K" )
     924  ENDIF
    824925   type_ecri(:) = type_ecri_files(:)
    825  CALL histdef2d(iff,o_wind10m%flag,o_wind10m%name, "10-m wind speed", "m/s")
    826  CALL histdef2d(iff,o_wind10max%flag,o_wind10max%name, "10m wind speed max", "m/s")
    827  CALL histdef2d(iff,o_sicf%flag,o_sicf%name, "Sea-ice fraction", "-" )
    828  CALL histdef2d(iff,o_q2m%flag,o_q2m%name, "Specific humidity 2m", "kg/kg")
    829  CALL histdef2d(iff,o_u10m%flag,o_u10m%name, "Vent zonal 10m", "m/s" )
    830  CALL histdef2d(iff,o_v10m%flag,o_v10m%name, "Vent meridien 10m", "m/s")
    831  CALL histdef2d(iff,o_psol%flag,o_psol%name, "Surface Pressure", "Pa" )
    832  CALL histdef2d(iff,o_qsurf%flag,o_qsurf%name, "Surface Air humidity", "kg/kg")
     926 CALL histdef2d(iff,clef_stations(iff),o_wind10m%flag,o_wind10m%name, "10-m wind speed", "m/s")
     927 CALL histdef2d(iff,clef_stations(iff),o_wind10max%flag,o_wind10max%name, "10m wind speed max", "m/s")
     928 CALL histdef2d(iff,clef_stations(iff),o_sicf%flag,o_sicf%name, "Sea-ice fraction", "-" )
     929 CALL histdef2d(iff,clef_stations(iff),o_q2m%flag,o_q2m%name, "Specific humidity 2m", "kg/kg")
     930 CALL histdef2d(iff,clef_stations(iff),o_u10m%flag,o_u10m%name, "Vent zonal 10m", "m/s" )
     931 CALL histdef2d(iff,clef_stations(iff),o_v10m%flag,o_v10m%name, "Vent meridien 10m", "m/s")
     932 CALL histdef2d(iff,clef_stations(iff),o_psol%flag,o_psol%name, "Surface Pressure", "Pa" )
     933 CALL histdef2d(iff,clef_stations(iff),o_qsurf%flag,o_qsurf%name, "Surface Air humidity", "kg/kg")
    833934
    834935  if (.not. ok_veget) then
    835  CALL histdef2d(iff,o_qsol%flag,o_qsol%name, "Soil watter content", "mm" )
     936 CALL histdef2d(iff,clef_stations(iff),o_qsol%flag,o_qsol%name, "Soil watter content", "mm" )
    836937  endif
    837938
    838  CALL histdef2d(iff,o_ndayrain%flag,o_ndayrain%name, "Number of dayrain(liq+sol)", "-")
    839  CALL histdef2d(iff,o_precip%flag,o_precip%name, "Precip Totale liq+sol", "kg/(s*m2)" )
    840  CALL histdef2d(iff,o_plul%flag,o_plul%name, "Large-scale Precip.", "kg/(s*m2)")
    841  CALL histdef2d(iff,o_pluc%flag,o_pluc%name, "Convective Precip.", "kg/(s*m2)")
    842  CALL histdef2d(iff,o_snow%flag,o_snow%name, "Snow fall", "kg/(s*m2)" )
    843  CALL histdef2d(iff,o_msnow%flag,o_msnow%name, "Surface snow amount", "kg/m2" )
    844  CALL histdef2d(iff,o_fsnow%flag,o_fsnow%name, "Surface snow area fraction", "-" )
    845  CALL histdef2d(iff,o_evap%flag,o_evap%name, "Evaporat", "kg/(s*m2)" )
    846  CALL histdef2d(iff,o_tops%flag,o_tops%name, "Solar rad. at TOA", "W/m2")
    847  CALL histdef2d(iff,o_tops0%flag,o_tops0%name, "CS Solar rad. at TOA", "W/m2")
    848  CALL histdef2d(iff,o_topl%flag,o_topl%name, "IR rad. at TOA", "W/m2" )
    849  CALL histdef2d(iff,o_topl0%flag,o_topl0%name, "IR rad. at TOA", "W/m2")
    850  CALL histdef2d(iff,o_SWupTOA%flag,o_SWupTOA%name, "SWup at TOA", "W/m2")
    851  CALL histdef2d(iff,o_SWupTOAclr%flag,o_SWupTOAclr%name, "SWup clear sky at TOA", "W/m2")
    852  CALL histdef2d(iff,o_SWdnTOA%flag,o_SWdnTOA%name, "SWdn at TOA", "W/m2" )
    853  CALL histdef2d(iff,o_SWdnTOAclr%flag,o_SWdnTOAclr%name, "SWdn clear sky at TOA", "W/m2")
    854  CALL histdef2d(iff,o_nettop%flag,o_nettop%name, "Net dn radiatif flux at TOA", "W/m2")
    855  CALL histdef2d(iff,o_SWup200%flag,o_SWup200%name, "SWup at 200mb", "W/m2" )
    856  CALL histdef2d(iff,o_SWup200clr%flag,o_SWup200clr%name, "SWup clear sky at 200mb", "W/m2")
    857  CALL histdef2d(iff,o_SWdn200%flag,o_SWdn200%name, "SWdn at 200mb", "W/m2" )
    858  CALL histdef2d(iff,o_SWdn200clr%flag,o_SWdn200clr%name, "SWdn clear sky at 200mb", "W/m2")
    859  CALL histdef2d(iff,o_LWup200%flag,o_LWup200%name, "LWup at 200mb", "W/m2")
    860  CALL histdef2d(iff,o_LWup200clr%flag,o_LWup200clr%name, "LWup clear sky at 200mb", "W/m2")
    861  CALL histdef2d(iff,o_LWdn200%flag,o_LWdn200%name, "LWdn at 200mb", "W/m2")
    862  CALL histdef2d(iff,o_LWdn200clr%flag,o_LWdn200clr%name, "LWdn clear sky at 200mb", "W/m2")
    863  CALL histdef2d(iff,o_sols%flag,o_sols%name, "Solar rad. at surf.", "W/m2")
    864  CALL histdef2d(iff,o_sols0%flag,o_sols0%name, "Solar rad. at surf.", "W/m2")
    865  CALL histdef2d(iff,o_soll%flag,o_soll%name, "IR rad. at surface", "W/m2") 
    866  CALL histdef2d(iff,o_radsol%flag,o_radsol%name, "Rayonnement au sol", "W/m2")
    867  CALL histdef2d(iff,o_soll0%flag,o_soll0%name, "IR rad. at surface", "W/m2")
    868  CALL histdef2d(iff,o_SWupSFC%flag,o_SWupSFC%name, "SWup at surface", "W/m2")
    869  CALL histdef2d(iff,o_SWupSFCclr%flag,o_SWupSFCclr%name, "SWup clear sky at surface", "W/m2")
    870  CALL histdef2d(iff,o_SWdnSFC%flag,o_SWdnSFC%name, "SWdn at surface", "W/m2")
    871  CALL histdef2d(iff,o_SWdnSFCclr%flag,o_SWdnSFCclr%name, "SWdn clear sky at surface", "W/m2")
    872  CALL histdef2d(iff,o_LWupSFC%flag,o_LWupSFC%name, "Upwd. IR rad. at surface", "W/m2")
    873  CALL histdef2d(iff,o_LWdnSFC%flag,o_LWdnSFC%name, "Down. IR rad. at surface", "W/m2")
    874  CALL histdef2d(iff,o_LWupSFCclr%flag,o_LWupSFCclr%name, "CS Upwd. IR rad. at surface", "W/m2")
    875  CALL histdef2d(iff,o_LWdnSFCclr%flag,o_LWdnSFCclr%name, "Down. CS IR rad. at surface", "W/m2")
    876  CALL histdef2d(iff,o_bils%flag,o_bils%name, "Surf. total heat flux", "W/m2")
    877  CALL histdef2d(iff,o_sens%flag,o_sens%name, "Sensible heat flux", "W/m2")
    878  CALL histdef2d(iff,o_fder%flag,o_fder%name, "Heat flux derivation", "W/m2")
    879  CALL histdef2d(iff,o_ffonte%flag,o_ffonte%name, "Thermal flux for snow melting", "W/m2")
    880  CALL histdef2d(iff,o_fqcalving%flag,o_fqcalving%name, "Ice Calving", "kg/m2/s")
    881  CALL histdef2d(iff,o_fqfonte%flag,o_fqfonte%name, "Land ice melt", "kg/m2/s")
    882 
    883  CALL histdef2d(iff,o_taux%flag,o_taux%name, "Zonal wind stress","Pa")
    884  CALL histdef2d(iff,o_tauy%flag,o_tauy%name, "Meridional wind stress","Pa")
     939 CALL histdef2d(iff,clef_stations(iff),o_ndayrain%flag,o_ndayrain%name, "Number of dayrain(liq+sol)", "-")
     940 CALL histdef2d(iff,clef_stations(iff),o_precip%flag,o_precip%name, "Precip Totale liq+sol", "kg/(s*m2)" )
     941 CALL histdef2d(iff,clef_stations(iff),o_plul%flag,o_plul%name, "Large-scale Precip.", "kg/(s*m2)")
     942 CALL histdef2d(iff,clef_stations(iff),o_pluc%flag,o_pluc%name, "Convective Precip.", "kg/(s*m2)")
     943 CALL histdef2d(iff,clef_stations(iff),o_snow%flag,o_snow%name, "Snow fall", "kg/(s*m2)" )
     944 CALL histdef2d(iff,clef_stations(iff),o_msnow%flag,o_msnow%name, "Surface snow amount", "kg/m2" )
     945 CALL histdef2d(iff,clef_stations(iff),o_fsnow%flag,o_fsnow%name, "Surface snow area fraction", "-" )
     946 CALL histdef2d(iff,clef_stations(iff),o_evap%flag,o_evap%name, "Evaporat", "kg/(s*m2)" )
     947 CALL histdef2d(iff,clef_stations(iff),o_tops%flag,o_tops%name, "Solar rad. at TOA", "W/m2")
     948 CALL histdef2d(iff,clef_stations(iff),o_tops0%flag,o_tops0%name, "CS Solar rad. at TOA", "W/m2")
     949 CALL histdef2d(iff,clef_stations(iff),o_topl%flag,o_topl%name, "IR rad. at TOA", "W/m2" )
     950 CALL histdef2d(iff,clef_stations(iff),o_topl0%flag,o_topl0%name, "IR rad. at TOA", "W/m2")
     951 CALL histdef2d(iff,clef_stations(iff),o_SWupTOA%flag,o_SWupTOA%name, "SWup at TOA", "W/m2")
     952 CALL histdef2d(iff,clef_stations(iff),o_SWupTOAclr%flag,o_SWupTOAclr%name, "SWup clear sky at TOA", "W/m2")
     953 CALL histdef2d(iff,clef_stations(iff),o_SWdnTOA%flag,o_SWdnTOA%name, "SWdn at TOA", "W/m2" )
     954 CALL histdef2d(iff,clef_stations(iff),o_SWdnTOAclr%flag,o_SWdnTOAclr%name, "SWdn clear sky at TOA", "W/m2")
     955 CALL histdef2d(iff,clef_stations(iff),o_nettop%flag,o_nettop%name, "Net dn radiatif flux at TOA", "W/m2")
     956 CALL histdef2d(iff,clef_stations(iff),o_SWup200%flag,o_SWup200%name, "SWup at 200mb", "W/m2" )
     957 CALL histdef2d(iff,clef_stations(iff),o_SWup200clr%flag,o_SWup200clr%name, "SWup clear sky at 200mb", "W/m2")
     958 CALL histdef2d(iff,clef_stations(iff),o_SWdn200%flag,o_SWdn200%name, "SWdn at 200mb", "W/m2" )
     959 CALL histdef2d(iff,clef_stations(iff),o_SWdn200clr%flag,o_SWdn200clr%name, "SWdn clear sky at 200mb", "W/m2")
     960 CALL histdef2d(iff,clef_stations(iff),o_LWup200%flag,o_LWup200%name, "LWup at 200mb", "W/m2")
     961 CALL histdef2d(iff,clef_stations(iff),o_LWup200clr%flag,o_LWup200clr%name, "LWup clear sky at 200mb", "W/m2")
     962 CALL histdef2d(iff,clef_stations(iff),o_LWdn200%flag,o_LWdn200%name, "LWdn at 200mb", "W/m2")
     963 CALL histdef2d(iff,clef_stations(iff),o_LWdn200clr%flag,o_LWdn200clr%name, "LWdn clear sky at 200mb", "W/m2")
     964 CALL histdef2d(iff,clef_stations(iff),o_sols%flag,o_sols%name, "Solar rad. at surf.", "W/m2")
     965 CALL histdef2d(iff,clef_stations(iff),o_sols0%flag,o_sols0%name, "Solar rad. at surf.", "W/m2")
     966 CALL histdef2d(iff,clef_stations(iff),o_soll%flag,o_soll%name, "IR rad. at surface", "W/m2") 
     967 CALL histdef2d(iff,clef_stations(iff),o_radsol%flag,o_radsol%name, "Rayonnement au sol", "W/m2")
     968 CALL histdef2d(iff,clef_stations(iff),o_soll0%flag,o_soll0%name, "IR rad. at surface", "W/m2")
     969 CALL histdef2d(iff,clef_stations(iff),o_SWupSFC%flag,o_SWupSFC%name, "SWup at surface", "W/m2")
     970 CALL histdef2d(iff,clef_stations(iff),o_SWupSFCclr%flag,o_SWupSFCclr%name, "SWup clear sky at surface", "W/m2")
     971 CALL histdef2d(iff,clef_stations(iff),o_SWdnSFC%flag,o_SWdnSFC%name, "SWdn at surface", "W/m2")
     972 CALL histdef2d(iff,clef_stations(iff),o_SWdnSFCclr%flag,o_SWdnSFCclr%name, "SWdn clear sky at surface", "W/m2")
     973 CALL histdef2d(iff,clef_stations(iff),o_LWupSFC%flag,o_LWupSFC%name, "Upwd. IR rad. at surface", "W/m2")
     974 CALL histdef2d(iff,clef_stations(iff),o_LWdnSFC%flag,o_LWdnSFC%name, "Down. IR rad. at surface", "W/m2")
     975 CALL histdef2d(iff,clef_stations(iff),o_LWupSFCclr%flag,o_LWupSFCclr%name, "CS Upwd. IR rad. at surface", "W/m2")
     976 CALL histdef2d(iff,clef_stations(iff),o_LWdnSFCclr%flag,o_LWdnSFCclr%name, "Down. CS IR rad. at surface", "W/m2")
     977 CALL histdef2d(iff,clef_stations(iff),o_bils%flag,o_bils%name, "Surf. total heat flux", "W/m2")
     978 CALL histdef2d(iff,clef_stations(iff),o_sens%flag,o_sens%name, "Sensible heat flux", "W/m2")
     979 CALL histdef2d(iff,clef_stations(iff),o_fder%flag,o_fder%name, "Heat flux derivation", "W/m2")
     980 CALL histdef2d(iff,clef_stations(iff),o_ffonte%flag,o_ffonte%name, "Thermal flux for snow melting", "W/m2")
     981 CALL histdef2d(iff,clef_stations(iff),o_fqcalving%flag,o_fqcalving%name, "Ice Calving", "kg/m2/s")
     982 CALL histdef2d(iff,clef_stations(iff),o_fqfonte%flag,o_fqfonte%name, "Land ice melt", "kg/m2/s")
     983
     984 CALL histdef2d(iff,clef_stations(iff),o_taux%flag,o_taux%name, "Zonal wind stress","Pa")
     985 CALL histdef2d(iff,clef_stations(iff),o_tauy%flag,o_tauy%name, "Meridional wind stress","Pa")
    885986
    886987     DO nsrf = 1, nbsrf
    887  CALL histdef2d(iff,o_pourc_srf(nsrf)%flag,o_pourc_srf(nsrf)%name,"% "//clnsurf(nsrf),"%")
    888  CALL histdef2d(iff,o_fract_srf(nsrf)%flag,o_fract_srf(nsrf)%name,"Fraction "//clnsurf(nsrf),"1")
    889  CALL histdef2d(iff,o_taux_srf(nsrf)%flag,o_taux_srf(nsrf)%name,"Zonal wind stress"//clnsurf(nsrf),"Pa")
    890  CALL histdef2d(iff,o_tauy_srf(nsrf)%flag,o_tauy_srf(nsrf)%name,"Meridional wind stress "//clnsurf(nsrf),"Pa")
    891  CALL histdef2d(iff,o_tsol_srf(nsrf)%flag,o_tsol_srf(nsrf)%name,"Temperature "//clnsurf(nsrf),"K")
    892  CALL histdef2d(iff,o_u10m_srf(nsrf)%flag,o_u10m_srf(nsrf)%name,"Vent Zonal 10m "//clnsurf(nsrf),"m/s")
    893  CALL histdef2d(iff,o_evap_srf(nsrf)%flag,o_evap_srf(nsrf)%name,"evaporation at surface "//clnsurf(nsrf),"kg/(s*m2)")
    894  CALL histdef2d(iff,o_v10m_srf(nsrf)%flag,o_v10m_srf(nsrf)%name,"Vent meredien 10m "//clnsurf(nsrf),"m/s")
    895  CALL histdef2d(iff,o_t2m_srf(nsrf)%flag,o_t2m_srf(nsrf)%name,"Temp 2m "//clnsurf(nsrf),"K")
    896  CALL histdef2d(iff,o_sens_srf(nsrf)%flag,o_sens_srf(nsrf)%name,"Sensible heat flux "//clnsurf(nsrf),"W/m2")
    897  CALL histdef2d(iff,o_lat_srf(nsrf)%flag,o_lat_srf(nsrf)%name,"Latent heat flux "//clnsurf(nsrf),"W/m2")
    898  CALL histdef2d(iff,o_flw_srf(nsrf)%flag,o_flw_srf(nsrf)%name,"LW "//clnsurf(nsrf),"W/m2")
    899  CALL histdef2d(iff,o_fsw_srf(nsrf)%flag,o_fsw_srf(nsrf)%name,"SW "//clnsurf(nsrf),"W/m2")
    900  CALL histdef2d(iff,o_wbils_srf(nsrf)%flag,o_wbils_srf(nsrf)%name,"Bilan sol "//clnsurf(nsrf),"W/m2" )
    901  CALL histdef2d(iff,o_wbilo_srf(nsrf)%flag,o_wbilo_srf(nsrf)%name,"Bilan eau "//clnsurf(nsrf),"kg/(m2*s)")
     988 CALL histdef2d(iff,clef_stations(iff),o_pourc_srf(nsrf)%flag,o_pourc_srf(nsrf)%name,"% "//clnsurf(nsrf),"%")
     989 CALL histdef2d(iff,clef_stations(iff),o_fract_srf(nsrf)%flag,o_fract_srf(nsrf)%name,"Fraction "//clnsurf(nsrf),"1")
     990 CALL histdef2d(iff,clef_stations(iff), &
     991o_taux_srf(nsrf)%flag,o_taux_srf(nsrf)%name,"Zonal wind stress"//clnsurf(nsrf),"Pa")
     992 CALL histdef2d(iff,clef_stations(iff), &
     993o_tauy_srf(nsrf)%flag,o_tauy_srf(nsrf)%name,"Meridional wind stress "//clnsurf(nsrf),"Pa")
     994 CALL histdef2d(iff,clef_stations(iff), &
     995o_tsol_srf(nsrf)%flag,o_tsol_srf(nsrf)%name,"Temperature "//clnsurf(nsrf),"K")
     996 CALL histdef2d(iff,clef_stations(iff), &
     997o_u10m_srf(nsrf)%flag,o_u10m_srf(nsrf)%name,"Vent Zonal 10m "//clnsurf(nsrf),"m/s")
     998 CALL histdef2d(iff,clef_stations(iff), &
     999o_evap_srf(nsrf)%flag,o_evap_srf(nsrf)%name,"evaporation at surface "//clnsurf(nsrf),"kg/(s*m2)")
     1000 CALL histdef2d(iff,clef_stations(iff), &
     1001o_v10m_srf(nsrf)%flag,o_v10m_srf(nsrf)%name,"Vent meredien 10m "//clnsurf(nsrf),"m/s")
     1002 CALL histdef2d(iff,clef_stations(iff), &
     1003o_t2m_srf(nsrf)%flag,o_t2m_srf(nsrf)%name,"Temp 2m "//clnsurf(nsrf),"K")
     1004 CALL histdef2d(iff,clef_stations(iff), &
     1005o_sens_srf(nsrf)%flag,o_sens_srf(nsrf)%name,"Sensible heat flux "//clnsurf(nsrf),"W/m2")
     1006 CALL histdef2d(iff,clef_stations(iff), &
     1007o_lat_srf(nsrf)%flag,o_lat_srf(nsrf)%name,"Latent heat flux "//clnsurf(nsrf),"W/m2")
     1008 CALL histdef2d(iff,clef_stations(iff), &
     1009o_flw_srf(nsrf)%flag,o_flw_srf(nsrf)%name,"LW "//clnsurf(nsrf),"W/m2")
     1010 CALL histdef2d(iff,clef_stations(iff), &
     1011o_fsw_srf(nsrf)%flag,o_fsw_srf(nsrf)%name,"SW "//clnsurf(nsrf),"W/m2")
     1012 CALL histdef2d(iff,clef_stations(iff), &
     1013o_wbils_srf(nsrf)%flag,o_wbils_srf(nsrf)%name,"Bilan sol "//clnsurf(nsrf),"W/m2" )
     1014 CALL histdef2d(iff,clef_stations(iff), &
     1015o_wbilo_srf(nsrf)%flag,o_wbilo_srf(nsrf)%name,"Bilan eau "//clnsurf(nsrf),"kg/(m2*s)")
    9021016  if (iflag_pbl>1 .and. lev_files(iff).gt.10 ) then
    903  CALL histdef2d(iff,o_tke_srf(nsrf)%flag,o_tke_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
     1017 CALL histdef2d(iff,clef_stations(iff), &
     1018o_tke_srf(nsrf)%flag,o_tke_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
     1019
     1020  IF (.NOT.clef_stations(iff)) THEN
     1021!
     1022!IM: there is no way to have one single value in a netcdf file
     1023!
    9041024   type_ecri(1) = 't_max(X)'
    9051025   type_ecri(2) = 't_max(X)'
     
    9071027   type_ecri(4) = 't_max(X)'
    9081028   type_ecri(5) = 't_max(X)'
    909  CALL histdef2d(iff,o_tke_max_srf(nsrf)%flag,o_tke_max_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
     1029   type_ecri(6) = 't_max(X)'
     1030  CALL histdef2d(iff,clef_stations(iff), &
     1031  o_tke_max_srf(nsrf)%flag,o_tke_max_srf(nsrf)%name,"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
    9101032   type_ecri(:) = type_ecri_files(:)
     1033  ENDIF
     1034
    9111035  endif
    912  CALL histdef2d(iff,o_albe_srf(nsrf)%flag,o_albe_srf(nsrf)%name,"Albedo VIS surf. "//clnsurf(nsrf),"-")
    913  CALL histdef2d(iff,o_rugs_srf(nsrf)%flag,o_rugs_srf(nsrf)%name,"Surface roughness "//clnsurf(nsrf),"m")
    914  CALL histdef2d(iff,o_ages_srf(nsrf)%flag,o_ages_srf(nsrf)%name,"Snow age", "day")
     1036
     1037 CALL histdef2d(iff,clef_stations(iff), &
     1038o_albe_srf(nsrf)%flag,o_albe_srf(nsrf)%name,"Albedo VIS surf. "//clnsurf(nsrf),"-")
     1039 CALL histdef2d(iff,clef_stations(iff), &
     1040o_rugs_srf(nsrf)%flag,o_rugs_srf(nsrf)%name,"Surface roughness "//clnsurf(nsrf),"m")
     1041 CALL histdef2d(iff,clef_stations(iff), &
     1042o_ages_srf(nsrf)%flag,o_ages_srf(nsrf)%name,"Snow age", "day")
    9151043END DO
    9161044
     
    9181046 IF (ok_ade.OR.ok_aie) THEN
    9191047
    920   CALL histdef2d(iff,o_od550aer%flag,o_od550aer%name, "Total aerosol optical depth at 550nm", "-")
    921   CALL histdef2d(iff,o_od865aer%flag,o_od865aer%name, "Total aerosol optical depth at 870nm", "-")
    922   CALL histdef2d(iff,o_absvisaer%flag,o_absvisaer%name, "Absorption aerosol visible optical depth", "-")
    923   CALL histdef2d(iff,o_od550lt1aer%flag,o_od550lt1aer%name, "Fine mode optical depth", "-")
    924   CALL histdef2d(iff,o_sconcso4%flag,o_sconcso4%name,"Surface Concentration of Sulfate ","kg/m3")
    925   CALL histdef2d(iff,o_sconcoa%flag,o_sconcoa%name,"Surface Concentration of Organic Aerosol ","kg/m3")
    926   CALL histdef2d(iff,o_sconcbc%flag,o_sconcbc%name,"Surface Concentration of Black Carbon ","kg/m3")
    927   CALL histdef2d(iff,o_sconcss%flag,o_sconcss%name,"Surface Concentration of Sea Salt ","kg/m3")
    928   CALL histdef2d(iff,o_sconcdust%flag,o_sconcdust%name,"Surface Concentration of Dust ","kg/m3")
    929   CALL histdef3d(iff,o_concso4%flag,o_concso4%name,"Concentration of Sulfate ","kg/m3")
    930   CALL histdef3d(iff,o_concoa%flag,o_concoa%name,"Concentration of Organic Aerosol ","kg/m3")
    931   CALL histdef3d(iff,o_concbc%flag,o_concbc%name,"Concentration of Black Carbon ","kg/m3")
    932   CALL histdef3d(iff,o_concss%flag,o_concss%name,"Concentration of Sea Salt ","kg/m3")
    933   CALL histdef3d(iff,o_concdust%flag,o_concdust%name,"Concentration of Dust ","kg/m3")
    934   CALL histdef2d(iff,o_loadso4%flag,o_loadso4%name,"Column Load of Sulfate ","kg/m2")
    935   CALL histdef2d(iff,o_loadoa%flag,o_loadoa%name,"Column Load of Organic Aerosol ","kg/m2")
    936   CALL histdef2d(iff,o_loadbc%flag,o_loadbc%name,"Column Load of Black Carbon ","kg/m2")
    937   CALL histdef2d(iff,o_loadss%flag,o_loadss%name,"Column Load of Sea Salt ","kg/m2")
    938   CALL histdef2d(iff,o_loaddust%flag,o_loaddust%name,"Column Load of Dust ","kg/m2")
     1048  CALL histdef2d(iff,clef_stations(iff), &
     1049o_od550aer%flag,o_od550aer%name, "Total aerosol optical depth at 550nm", "-")
     1050  CALL histdef2d(iff,clef_stations(iff), &
     1051o_od865aer%flag,o_od865aer%name, "Total aerosol optical depth at 870nm", "-")
     1052  CALL histdef2d(iff,clef_stations(iff), &
     1053o_absvisaer%flag,o_absvisaer%name, "Absorption aerosol visible optical depth", "-")
     1054  CALL histdef2d(iff,clef_stations(iff), &
     1055o_od550lt1aer%flag,o_od550lt1aer%name, "Fine mode optical depth", "-")
     1056
     1057
     1058  CALL histdef2d(iff,clef_stations(iff), &
     1059o_sconcso4%flag,o_sconcso4%name,"Surface Concentration of Sulfate ","kg/m3")
     1060  CALL histdef2d(iff,clef_stations(iff), &
     1061o_sconcoa%flag,o_sconcoa%name,"Surface Concentration of Organic Aerosol ","kg/m3")
     1062  CALL histdef2d(iff,clef_stations(iff), &
     1063o_sconcbc%flag,o_sconcbc%name,"Surface Concentration of Black Carbon ","kg/m3")
     1064  CALL histdef2d(iff,clef_stations(iff), &
     1065o_sconcss%flag,o_sconcss%name,"Surface Concentration of Sea Salt ","kg/m3")
     1066  CALL histdef2d(iff,clef_stations(iff), &
     1067o_sconcdust%flag,o_sconcdust%name,"Surface Concentration of Dust ","kg/m3")
     1068  CALL histdef3d(iff,clef_stations(iff), &
     1069o_concso4%flag,o_concso4%name,"Concentration of Sulfate ","kg/m3")
     1070  CALL histdef3d(iff,clef_stations(iff), &
     1071o_concoa%flag,o_concoa%name,"Concentration of Organic Aerosol ","kg/m3")
     1072  CALL histdef3d(iff,clef_stations(iff), &
     1073o_concbc%flag,o_concbc%name,"Concentration of Black Carbon ","kg/m3")
     1074  CALL histdef3d(iff,clef_stations(iff), &
     1075o_concss%flag,o_concss%name,"Concentration of Sea Salt ","kg/m3")
     1076  CALL histdef3d(iff,clef_stations(iff), &
     1077o_concdust%flag,o_concdust%name,"Concentration of Dust ","kg/m3")
     1078  CALL histdef2d(iff,clef_stations(iff), &
     1079o_loadso4%flag,o_loadso4%name,"Column Load of Sulfate ","kg/m2")
     1080  CALL histdef2d(iff,clef_stations(iff), &
     1081o_loadoa%flag,o_loadoa%name,"Column Load of Organic Aerosol ","kg/m2")
     1082  CALL histdef2d(iff,clef_stations(iff), &
     1083o_loadbc%flag,o_loadbc%name,"Column Load of Black Carbon ","kg/m2")
     1084  CALL histdef2d(iff,clef_stations(iff), &
     1085o_loadss%flag,o_loadss%name,"Column Load of Sea Salt ","kg/m2")
     1086  CALL histdef2d(iff,clef_stations(iff), &
     1087o_loaddust%flag,o_loaddust%name,"Column Load of Dust ","kg/m2")
    9391088
    9401089  DO naero = 1, naero_spc
    941   CALL histdef2d(iff,o_tausumaero(naero)%flag,o_tausumaero(naero)%name,"Aerosol Optical depth at 550 nm "//name_aero(naero),"1")
     1090  CALL histdef2d(iff,clef_stations(iff), &
     1091o_tausumaero(naero)%flag,o_tausumaero(naero)%name,"Aerosol Optical depth at 550 nm "//name_aero(naero),"1")
    9421092  END DO
    9431093 ENDIF
     
    9451095
    9461096 IF (ok_ade) THEN
    947   CALL histdef2d(iff,o_topswad%flag,o_topswad%name, "ADE at TOA", "W/m2")
    948   CALL histdef2d(iff,o_solswad%flag,o_solswad%name, "ADE at SRF", "W/m2")
    949 
    950  CALL histdef2d(iff,o_swtoaas_nat%flag,o_swtoaas_nat%name, "Natural aerosol radiative forcing all-sky at TOA", "W/m2")
    951  CALL histdef2d(iff,o_swsrfas_nat%flag,o_swsrfas_nat%name, "Natural aerosol radiative forcing all-sky at SRF", "W/m2")
    952  CALL histdef2d(iff,o_swtoacs_nat%flag,o_swtoacs_nat%name, "Natural aerosol radiative forcing clear-sky at TOA", "W/m2")
    953  CALL histdef2d(iff,o_swsrfcs_nat%flag,o_swsrfcs_nat%name, "Natural aerosol radiative forcing clear-sky at SRF", "W/m2")
    954 
    955  CALL histdef2d(iff,o_swtoaas_ant%flag,o_swtoaas_ant%name, "Anthropogenic aerosol radiative forcing all-sky at TOA", "W/m2")
    956  CALL histdef2d(iff,o_swsrfas_ant%flag,o_swsrfas_ant%name, "Anthropogenic aerosol radiative forcing all-sky at SRF", "W/m2")
    957  CALL histdef2d(iff,o_swtoacs_ant%flag,o_swtoacs_ant%name, "Anthropogenic aerosol radiative forcing clear-sky at TOA", "W/m2")
    958  CALL histdef2d(iff,o_swsrfcs_ant%flag,o_swsrfcs_ant%name, "Anthropogenic aerosol radiative forcing clear-sky at SRF", "W/m2")
     1097  CALL histdef2d(iff,clef_stations(iff), &
     1098o_topswad%flag,o_topswad%name, "ADE at TOA", "W/m2")
     1099  CALL histdef2d(iff,clef_stations(iff), &
     1100o_solswad%flag,o_solswad%name, "ADE at SRF", "W/m2")
     1101
     1102 CALL histdef2d(iff,clef_stations(iff), &
     1103o_swtoaas_nat%flag,o_swtoaas_nat%name, "Natural aerosol radiative forcing all-sky at TOA", "W/m2")
     1104 CALL histdef2d(iff,clef_stations(iff), &
     1105o_swsrfas_nat%flag,o_swsrfas_nat%name, "Natural aerosol radiative forcing all-sky at SRF", "W/m2")
     1106 CALL histdef2d(iff,clef_stations(iff), &
     1107o_swtoacs_nat%flag,o_swtoacs_nat%name, "Natural aerosol radiative forcing clear-sky at TOA", "W/m2")
     1108 CALL histdef2d(iff,clef_stations(iff), &
     1109o_swsrfcs_nat%flag,o_swsrfcs_nat%name, "Natural aerosol radiative forcing clear-sky at SRF", "W/m2")
     1110
     1111 CALL histdef2d(iff,clef_stations(iff), &
     1112o_swtoaas_ant%flag,o_swtoaas_ant%name, "Anthropogenic aerosol radiative forcing all-sky at TOA", "W/m2")
     1113 CALL histdef2d(iff,clef_stations(iff), &
     1114o_swsrfas_ant%flag,o_swsrfas_ant%name, "Anthropogenic aerosol radiative forcing all-sky at SRF", "W/m2")
     1115 CALL histdef2d(iff,clef_stations(iff), &
     1116o_swtoacs_ant%flag,o_swtoacs_ant%name, "Anthropogenic aerosol radiative forcing clear-sky at TOA", "W/m2")
     1117 CALL histdef2d(iff,clef_stations(iff), &
     1118o_swsrfcs_ant%flag,o_swsrfcs_ant%name, "Anthropogenic aerosol radiative forcing clear-sky at SRF", "W/m2")
    9591119
    9601120 IF (.NOT. aerosol_couple) THEN
    961  CALL histdef2d(iff,o_swtoacf_nat%flag,o_swtoacf_nat%name, "Natural aerosol impact on cloud radiative forcing at TOA", "W/m2")
    962  CALL histdef2d(iff,o_swsrfcf_nat%flag,o_swsrfcf_nat%name, "Natural aerosol impact on cloud radiative forcing  at SRF", "W/m2")
    963  CALL histdef2d(iff,o_swtoacf_ant%flag,o_swtoacf_ant%name, "Anthropogenic aerosol impact on cloud radiative forcing at TOA", "W/m2")
    964  CALL histdef2d(iff,o_swsrfcf_ant%flag,o_swsrfcf_ant%name, "Anthropogenic aerosol impact on cloud radiative forcing at SRF", "W/m2")
    965  CALL histdef2d(iff,o_swtoacf_zero%flag,o_swtoacf_zero%name, "Cloud radiative forcing (allsky-clearsky fluxes) at TOA", "W/m2")
    966  CALL histdef2d(iff,o_swsrfcf_zero%flag,o_swsrfcf_zero%name, "Cloud radiative forcing (allsky-clearsky fluxes) at SRF", "W/m2")
     1121 CALL histdef2d(iff,clef_stations(iff), &
     1122o_swtoacf_nat%flag,o_swtoacf_nat%name, "Natural aerosol impact on cloud radiative forcing at TOA", "W/m2")
     1123 CALL histdef2d(iff,clef_stations(iff), &
     1124o_swsrfcf_nat%flag,o_swsrfcf_nat%name, "Natural aerosol impact on cloud radiative forcing  at SRF", "W/m2")
     1125 CALL histdef2d(iff,clef_stations(iff), &
     1126o_swtoacf_ant%flag,o_swtoacf_ant%name, "Anthropogenic aerosol impact on cloud radiative forcing at TOA", "W/m2")
     1127 CALL histdef2d(iff,clef_stations(iff), &
     1128o_swsrfcf_ant%flag,o_swsrfcf_ant%name, "Anthropogenic aerosol impact on cloud radiative forcing at SRF", "W/m2")
     1129 CALL histdef2d(iff,clef_stations(iff), &
     1130o_swtoacf_zero%flag,o_swtoacf_zero%name, "Cloud radiative forcing (allsky-clearsky fluxes) at TOA", "W/m2")
     1131 CALL histdef2d(iff,clef_stations(iff), &
     1132o_swsrfcf_zero%flag,o_swsrfcf_zero%name, "Cloud radiative forcing (allsky-clearsky fluxes) at SRF", "W/m2")
    9671133 ENDIF
    9681134
     
    9701136
    9711137 IF (ok_aie) THEN
    972   CALL histdef2d(iff,o_topswai%flag,o_topswai%name, "AIE at TOA", "W/m2")
    973   CALL histdef2d(iff,o_solswai%flag,o_solswai%name, "AIE at SFR", "W/m2")
     1138  CALL histdef2d(iff,clef_stations(iff), &
     1139o_topswai%flag,o_topswai%name, "AIE at TOA", "W/m2")
     1140  CALL histdef2d(iff,clef_stations(iff), &
     1141o_solswai%flag,o_solswai%name, "AIE at SFR", "W/m2")
    9741142!Cloud droplet number concentration
    975   CALL histdef3d(iff,o_scdnc%flag,o_scdnc%name, "Cloud droplet number concentration","m-3")
    976   CALL histdef2d(iff,o_cldncl%flag,o_cldncl%name, "CDNC at top of liquid water cloud", "m-3")
    977   CALL histdef3d(iff,o_reffclws%flag,o_reffclws%name, "Stratiform Cloud Droplet Effective Radius","m")
    978   CALL histdef3d(iff,o_reffclwc%flag,o_reffclwc%name, "Convective Cloud Droplet Effective Radius","m")
    979   CALL histdef2d(iff,o_cldnvi%flag,o_cldnvi%name, "Column Integrated Cloud Droplet Number", "m-2")
    980   CALL histdef3d(iff,o_lcc3d%flag,o_lcc3d%name, "Cloud liquid fraction","1")
    981   CALL histdef3d(iff,o_lcc3dcon%flag,o_lcc3dcon%name, "Convective cloud liquid fraction","1")
    982   CALL histdef3d(iff,o_lcc3dstra%flag,o_lcc3dstra%name, "Stratiform cloud liquid fraction","1")
    983   CALL histdef2d(iff,o_lcc%flag,o_lcc%name, "Cloud liquid fraction at top of cloud","1")
    984   CALL histdef2d(iff,o_reffclwtop%flag,o_reffclwtop%name, "Droplet effective radius at top of liquid water cloud", "m")
     1143  CALL histdef3d(iff,clef_stations(iff), &
     1144o_scdnc%flag,o_scdnc%name, "Cloud droplet number concentration","m-3")
     1145  CALL histdef2d(iff,clef_stations(iff), &
     1146o_cldncl%flag,o_cldncl%name, "CDNC at top of liquid water cloud", "m-3")
     1147  CALL histdef3d(iff,clef_stations(iff), &
     1148o_reffclws%flag,o_reffclws%name, "Stratiform Cloud Droplet Effective Radius (aerosol diags.)","m")
     1149  CALL histdef3d(iff,clef_stations(iff), &
     1150o_reffclwc%flag,o_reffclwc%name, "Convective Cloud Droplet Effective Radius (aerosol diags.)","m")
     1151  CALL histdef2d(iff,clef_stations(iff), &
     1152o_cldnvi%flag,o_cldnvi%name, "Column Integrated Cloud Droplet Number", "m-2")
     1153  CALL histdef3d(iff,clef_stations(iff), &
     1154o_lcc3d%flag,o_lcc3d%name, "Cloud liquid fraction","1")
     1155  CALL histdef3d(iff,clef_stations(iff), &
     1156o_lcc3dcon%flag,o_lcc3dcon%name, "Convective cloud liquid fraction","1")
     1157  CALL histdef3d(iff,clef_stations(iff), &
     1158o_lcc3dstra%flag,o_lcc3dstra%name, "Stratiform cloud liquid fraction","1")
     1159  CALL histdef2d(iff,clef_stations(iff), &
     1160o_lcc%flag,o_lcc%name, "Cloud liquid fraction at top of cloud","1")
     1161  CALL histdef2d(iff,clef_stations(iff), &
     1162o_reffclwtop%flag,o_reffclwtop%name, "Droplet effective radius at top of liquid water cloud", "m")
    9851163 ENDIF
    9861164
    9871165
    988  CALL histdef2d(iff,o_alb1%flag,o_alb1%name, "Surface VIS albedo", "-")
    989  CALL histdef2d(iff,o_alb2%flag,o_alb2%name, "Surface Near IR albedo", "-")
    990  CALL histdef2d(iff,o_cdrm%flag,o_cdrm%name, "Momentum drag coef.", "-")
    991  CALL histdef2d(iff,o_cdrh%flag,o_cdrh%name, "Heat drag coef.", "-" )
    992  CALL histdef2d(iff,o_cldl%flag,o_cldl%name, "Low-level cloudiness", "-")
    993  CALL histdef2d(iff,o_cldm%flag,o_cldm%name, "Mid-level cloudiness", "-")
    994  CALL histdef2d(iff,o_cldh%flag,o_cldh%name, "High-level cloudiness", "-")
    995  CALL histdef2d(iff,o_cldt%flag,o_cldt%name, "Total cloudiness", "-")
    996  CALL histdef2d(iff,o_cldq%flag,o_cldq%name, "Cloud liquid water path", "kg/m2")
    997  CALL histdef2d(iff,o_lwp%flag,o_lwp%name, "Cloud water path", "kg/m2")
    998  CALL histdef2d(iff,o_iwp%flag,o_iwp%name, "Cloud ice water path", "kg/m2" )
    999  CALL histdef2d(iff,o_ue%flag,o_ue%name, "Zonal energy transport", "-")
    1000  CALL histdef2d(iff,o_ve%flag,o_ve%name, "Merid energy transport", "-")
    1001  CALL histdef2d(iff,o_uq%flag,o_uq%name, "Zonal humidity transport", "-")
    1002  CALL histdef2d(iff,o_vq%flag,o_vq%name, "Merid humidity transport", "-")
     1166 CALL histdef2d(iff,clef_stations(iff), &
     1167o_alb1%flag,o_alb1%name, "Surface VIS albedo", "-")
     1168 CALL histdef2d(iff,clef_stations(iff), &
     1169o_alb2%flag,o_alb2%name, "Surface Near IR albedo", "-")
     1170 CALL histdef2d(iff,clef_stations(iff), &
     1171o_cdrm%flag,o_cdrm%name, "Momentum drag coef.", "-")
     1172 CALL histdef2d(iff,clef_stations(iff), &
     1173o_cdrh%flag,o_cdrh%name, "Heat drag coef.", "-" )
     1174 CALL histdef2d(iff,clef_stations(iff), &
     1175o_cldl%flag,o_cldl%name, "Low-level cloudiness", "-")
     1176 CALL histdef2d(iff,clef_stations(iff), &
     1177o_cldm%flag,o_cldm%name, "Mid-level cloudiness", "-")
     1178 CALL histdef2d(iff,clef_stations(iff), &
     1179o_cldh%flag,o_cldh%name, "High-level cloudiness", "-")
     1180 CALL histdef2d(iff,clef_stations(iff), &
     1181o_cldt%flag,o_cldt%name, "Total cloudiness", "-")
     1182 CALL histdef2d(iff,clef_stations(iff), &
     1183o_cldq%flag,o_cldq%name, "Cloud liquid water path", "kg/m2")
     1184 CALL histdef2d(iff,clef_stations(iff), &
     1185o_lwp%flag,o_lwp%name, "Cloud water path", "kg/m2")
     1186 CALL histdef2d(iff,clef_stations(iff), &
     1187o_iwp%flag,o_iwp%name, "Cloud ice water path", "kg/m2" )
     1188 CALL histdef2d(iff,clef_stations(iff), &
     1189o_ue%flag,o_ue%name, "Zonal energy transport", "-")
     1190 CALL histdef2d(iff,clef_stations(iff), &
     1191o_ve%flag,o_ve%name, "Merid energy transport", "-")
     1192 CALL histdef2d(iff,clef_stations(iff), &
     1193o_uq%flag,o_uq%name, "Zonal humidity transport", "-")
     1194 CALL histdef2d(iff,clef_stations(iff), &
     1195o_vq%flag,o_vq%name, "Merid humidity transport", "-")
    10031196
    10041197     IF(iflag_con.GE.3) THEN ! sb
    1005  CALL histdef2d(iff,o_cape%flag,o_cape%name, "Conv avlbl pot ener", "J/kg")
    1006  CALL histdef2d(iff,o_pbase%flag,o_pbase%name, "Cld base pressure", "Pa")
    1007  CALL histdef2d(iff,o_ptop%flag,o_ptop%name, "Cld top pressure", "Pa")
    1008  CALL histdef2d(iff,o_fbase%flag,o_fbase%name, "Cld base mass flux", "kg/m2/s")
    1009  CALL histdef2d(iff,o_plcl%flag,o_plcl%name, "Lifting Condensation Level", "hPa")
    1010  CALL histdef2d(iff,o_plfc%flag,o_plfc%name, "Level of Free Convection", "hPa")
    1011  CALL histdef2d(iff,o_wbeff%flag,o_wbeff%name, "Conv. updraft velocity at LFC", "m/s")
    1012  CALL histdef2d(iff,o_prw%flag,o_prw%name, "Precipitable water", "kg/m2")
     1198 CALL histdef2d(iff,clef_stations(iff), &
     1199o_cape%flag,o_cape%name, "Conv avlbl pot ener", "J/kg")
     1200 CALL histdef2d(iff,clef_stations(iff), &
     1201o_pbase%flag,o_pbase%name, "Cld base pressure", "Pa")
     1202 CALL histdef2d(iff,clef_stations(iff), &
     1203o_ptop%flag,o_ptop%name, "Cld top pressure", "Pa")
     1204 CALL histdef2d(iff,clef_stations(iff), &
     1205o_fbase%flag,o_fbase%name, "Cld base mass flux", "kg/m2/s")
     1206 CALL histdef2d(iff,clef_stations(iff), &
     1207o_plcl%flag,o_plcl%name, "Lifting Condensation Level", "hPa")
     1208 CALL histdef2d(iff,clef_stations(iff), &
     1209o_plfc%flag,o_plfc%name, "Level of Free Convection", "hPa")
     1210 CALL histdef2d(iff,clef_stations(iff), &
     1211o_wbeff%flag,o_wbeff%name, "Conv. updraft velocity at LFC", "m/s")
     1212 CALL histdef2d(iff,clef_stations(iff), &
     1213o_prw%flag,o_prw%name, "Precipitable water", "kg/m2")
     1214  IF (.NOT.clef_stations(iff)) THEN
     1215!
     1216!IM: there is no way to have one single value in a netcdf file
     1217!
     1218    type_ecri(1) = 't_max(X)'
     1219    type_ecri(2) = 't_max(X)'
     1220    type_ecri(3) = 't_max(X)'
     1221    type_ecri(4) = 't_max(X)'
     1222    type_ecri(5) = 't_max(X)'
     1223    type_ecri(6) = 't_max(X)'
     1224    CALL histdef2d(iff,clef_stations(iff), &
     1225  o_cape_max%flag,o_cape_max%name, "CAPE max.", "J/kg")
     1226  ENDIF
     1227   type_ecri(:) = type_ecri_files(:)
     1228 CALL histdef3d(iff,clef_stations(iff), &
     1229o_upwd%flag,o_upwd%name, "saturated updraft", "kg/m2/s")
     1230 CALL histdef3d(iff,clef_stations(iff), &
     1231o_Ma%flag,o_Ma%name, "undilute adiab updraft", "kg/m2/s")
     1232 CALL histdef3d(iff,clef_stations(iff), &
     1233o_dnwd%flag,o_dnwd%name, "saturated downdraft", "kg/m2/s")
     1234 CALL histdef3d(iff,clef_stations(iff), &
     1235o_dnwd0%flag,o_dnwd0%name, "unsat. downdraft", "kg/m2/s")
     1236 CALL histdef3d(iff,clef_stations(iff), &
     1237o_mc%flag,o_mc%name, "Convective mass flux", "kg/m2/s")
     1238   type_ecri(1) = 'inst(X)'
     1239   type_ecri(2) = 'inst(X)'
     1240   type_ecri(3) = 'inst(X)'
     1241   type_ecri(4) = 'inst(X)'
     1242   type_ecri(5) = 'inst(X)'
     1243   type_ecri(6) = 'inst(X)'
     1244 CALL histdef2d(iff,clef_stations(iff), &
     1245o_ftime_con%flag,o_ftime_con%name, "Fraction of time convection Occurs", " ")
     1246   type_ecri(:) = type_ecri_files(:)
     1247     ENDIF !iflag_con .GE. 3
     1248
     1249 CALL histdef2d(iff,clef_stations(iff), &
     1250o_s_pblh%flag,o_s_pblh%name, "Boundary Layer Height", "m")
     1251 CALL histdef2d(iff,clef_stations(iff), &
     1252o_s_pblt%flag,o_s_pblt%name, "t at Boundary Layer Height", "K")
     1253 CALL histdef2d(iff,clef_stations(iff), &
     1254o_s_lcl%flag,o_s_lcl%name, "Condensation level", "m")
     1255 CALL histdef2d(iff,clef_stations(iff), &
     1256o_s_therm%flag,o_s_therm%name, "Exces du thermique", "K")
     1257!IM : Les champs suivants (s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F
     1258!CALL histdef2d(iff,clef_stations(iff), &
     1259!o_s_capCL%flag,o_s_capCL%name, "Conv avlbl pot enerfor ABL", "J/m2" )
     1260!CALL histdef2d(iff,clef_stations(iff), &
     1261!o_s_oliqCL%flag,o_s_oliqCL%name, "Liq Water in BL", "kg/m2")
     1262!CALL histdef2d(iff,clef_stations(iff), &
     1263!o_s_cteiCL%flag,o_s_cteiCL%name, "Instability criteria(ABL)", "K")
     1264!CALL histdef2d(iff,clef_stations(iff), &
     1265!o_s_trmb1%flag,o_s_trmb1%name, "deep_cape(HBTM2)", "J/m2")
     1266!CALL histdef2d(iff,clef_stations(iff), &
     1267!o_s_trmb2%flag,o_s_trmb2%name, "inhibition (HBTM2)", "J/m2")
     1268!CALL histdef2d(iff,clef_stations(iff), &
     1269!o_s_trmb3%flag,o_s_trmb3%name, "Point Omega (HBTM2)", "m")
     1270
     1271! Champs interpolles sur des niveaux de pression
     1272
     1273   type_ecri(1) = 'inst(X)'
     1274   type_ecri(2) = 'inst(X)'
     1275   type_ecri(3) = 'inst(X)'
     1276   type_ecri(4) = 'inst(X)'
     1277   type_ecri(5) = 'inst(X)'
     1278   type_ecri(6) = 'inst(X)'
     1279
     1280! Attention a reverifier
     1281
     1282        ilev=0       
     1283        DO k=1, nlevSTD
     1284     bb2=clevSTD(k)
     1285     IF(bb2.EQ."850".OR.bb2.EQ."700".OR.bb2.EQ."500".OR.bb2.EQ."200" &
     1286.OR.bb2.EQ."100".OR.bb2.EQ."50".OR.bb2.EQ."10")THEN
     1287      ilev=ilev+1
     1288!     print*,'ilev k bb2 flag name ',ilev,k, bb2,o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name
     1289 CALL histdef2d(iff,clef_stations(iff), &
     1290o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name,"Zonal wind "//bb2//"hPa", "m/s")
     1291 CALL histdef2d(iff,clef_stations(iff), &
     1292o_vSTDlevs(ilev)%flag,o_vSTDlevs(ilev)%name,"Meridional wind "//bb2//"hPa", "m/s")
     1293 CALL histdef2d(iff,clef_stations(iff), &
     1294o_wSTDlevs(ilev)%flag,o_wSTDlevs(ilev)%name,"Vertical wind "//bb2//"hPa", "Pa/s")
     1295 CALL histdef2d(iff,clef_stations(iff), &
     1296o_zSTDlevs(ilev)%flag,o_zSTDlevs(ilev)%name,"Geopotential height "//bb2//"hPa", "m")
     1297 CALL histdef2d(iff,clef_stations(iff), &
     1298o_qSTDlevs(ilev)%flag,o_qSTDlevs(ilev)%name,"Specific humidity "//bb2//"hPa", "kg/kg" )
     1299 CALL histdef2d(iff,clef_stations(iff), &
     1300o_tSTDlevs(ilev)%flag,o_tSTDlevs(ilev)%name,"Temperature "//bb2//"hPa", "K")
     1301     ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR."500".OR.bb2.EQ."200".OR.bb2.EQ."50".OR.bb2.EQ."10")
     1302       ENDDO
     1303   type_ecri(:) = type_ecri_files(:)
     1304
     1305 CALL histdef2d(iff,clef_stations(iff), &
     1306o_t_oce_sic%flag,o_t_oce_sic%name, "Temp mixte oce-sic", "K")
     1307
     1308 IF (type_ocean=='slab') &
     1309     CALL histdef2d(iff,clef_stations(iff), &
     1310o_slab_bils%flag, o_slab_bils%name,"Bilan au sol sur ocean slab", "W/m2")
     1311
     1312! Couplage conv-CL
     1313 IF (iflag_con.GE.3) THEN
     1314    IF (iflag_coupl>=1) THEN
     1315 CALL histdef2d(iff,clef_stations(iff), &
     1316o_ale_bl%flag,o_ale_bl%name, "ALE BL", "m2/s2")
     1317 CALL histdef2d(iff,clef_stations(iff), &
     1318o_alp_bl%flag,o_alp_bl%name, "ALP BL", "m2/s2")
     1319    ENDIF
     1320 ENDIF !(iflag_con.GE.3)
     1321
     1322 CALL histdef2d(iff,clef_stations(iff), &
     1323o_weakinv%flag,o_weakinv%name, "Weak inversion", "-")
     1324 CALL histdef2d(iff,clef_stations(iff), &
     1325o_dthmin%flag,o_dthmin%name, "dTheta mini", "K/m")
     1326 CALL histdef2d(iff,clef_stations(iff), &
     1327o_rh2m%flag,o_rh2m%name, "Relative humidity at 2m", "%" )
     1328
     1329  IF (.NOT.clef_stations(iff)) THEN
     1330!
     1331!IM: there is no way to have one single value in a netcdf file
     1332!
     1333   type_ecri(1) = 't_min(X)'
     1334   type_ecri(2) = 't_min(X)'
     1335   type_ecri(3) = 't_min(X)'
     1336   type_ecri(4) = 't_min(X)'
     1337   type_ecri(5) = 't_min(X)'
     1338   type_ecri(6) = 't_min(X)'
     1339   CALL histdef2d(iff,clef_stations(iff),o_rh2m_min%flag,o_rh2m_min%name, "Min Relative humidity at 2m", "%" )
    10131340   type_ecri(1) = 't_max(X)'
    10141341   type_ecri(2) = 't_max(X)'
     
    10161343   type_ecri(4) = 't_max(X)'
    10171344   type_ecri(5) = 't_max(X)'
    1018  CALL histdef2d(iff,o_cape_max%flag,o_cape_max%name, "CAPE max.", "J/kg")
     1345   type_ecri(6) = 't_max(X)'
     1346   CALL histdef2d(iff,clef_stations(iff),o_rh2m_max%flag,o_rh2m_max%name, "Max Relative humidity at 2m", "%" )
     1347  ENDIF 
     1348
    10191349   type_ecri(:) = type_ecri_files(:)
    1020  CALL histdef3d(iff,o_upwd%flag,o_upwd%name, "saturated updraft", "kg/m2/s")
    1021  CALL histdef3d(iff,o_Ma%flag,o_Ma%name, "undilute adiab updraft", "kg/m2/s")
    1022  CALL histdef3d(iff,o_dnwd%flag,o_dnwd%name, "saturated downdraft", "kg/m2/s")
    1023  CALL histdef3d(iff,o_dnwd0%flag,o_dnwd0%name, "unsat. downdraft", "kg/m2/s")
    1024  CALL histdef3d(iff,o_mc%flag,o_mc%name, "Convective mass flux", "kg/m2/s")
    1025    type_ecri(1) = 'inst(X)'
    1026    type_ecri(2) = 'inst(X)'
    1027    type_ecri(3) = 'inst(X)'
    1028    type_ecri(4) = 'inst(X)'
    1029    type_ecri(5) = 'inst(X)'
    1030  CALL histdef2d(iff,o_ftime_con%flag,o_ftime_con%name, "Fraction of time convection Occurs", " ")
    1031    type_ecri(:) = type_ecri_files(:)
    1032      ENDIF !iflag_con .GE. 3
    1033 
    1034  CALL histdef2d(iff,o_s_pblh%flag,o_s_pblh%name, "Boundary Layer Height", "m")
    1035  CALL histdef2d(iff,o_s_pblt%flag,o_s_pblt%name, "t at Boundary Layer Height", "K")
    1036  CALL histdef2d(iff,o_s_lcl%flag,o_s_lcl%name, "Condensation level", "m")
    1037  CALL histdef2d(iff,o_s_therm%flag,o_s_therm%name, "Exces du thermique", "K")
    1038 !IM : Les champs suivants (s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F
    1039 !CALL histdef2d(iff,o_s_capCL%flag,o_s_capCL%name, "Conv avlbl pot enerfor ABL", "J/m2" )
    1040 !CALL histdef2d(iff,o_s_oliqCL%flag,o_s_oliqCL%name, "Liq Water in BL", "kg/m2")
    1041 !CALL histdef2d(iff,o_s_cteiCL%flag,o_s_cteiCL%name, "Instability criteria(ABL)", "K")
    1042 !CALL histdef2d(iff,o_s_trmb1%flag,o_s_trmb1%name, "deep_cape(HBTM2)", "J/m2")
    1043 !CALL histdef2d(iff,o_s_trmb2%flag,o_s_trmb2%name, "inhibition (HBTM2)", "J/m2")
    1044 !CALL histdef2d(iff,o_s_trmb3%flag,o_s_trmb3%name, "Point Omega (HBTM2)", "m")
    1045 
    1046 ! Champs interpolles sur des niveaux de pression
    1047 
    1048    type_ecri(1) = 'inst(X)'
    1049    type_ecri(2) = 'inst(X)'
    1050    type_ecri(3) = 'inst(X)'
    1051    type_ecri(4) = 'inst(X)'
    1052    type_ecri(5) = 'inst(X)'
    1053 
    1054 ! Attention a reverifier
    1055 
    1056         ilev=0       
    1057         DO k=1, nlevSTD
    1058 !     IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
    1059      bb2=clevSTD(k)
    1060      IF(bb2.EQ."850".OR.bb2.EQ."700".OR.bb2.EQ."500".OR.bb2.EQ."200".OR.bb2.EQ."50".OR.bb2.EQ."10")THEN
    1061       ilev=ilev+1
    1062       print*,'ilev k bb2 flag name ',ilev,k, bb2,o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name
    1063  CALL histdef2d(iff,o_uSTDlevs(ilev)%flag,o_uSTDlevs(ilev)%name,"Zonal wind "//bb2//"hPa", "m/s")
    1064  CALL histdef2d(iff,o_vSTDlevs(ilev)%flag,o_vSTDlevs(ilev)%name,"Meridional wind "//bb2//"hPa", "m/s")
    1065  CALL histdef2d(iff,o_wSTDlevs(ilev)%flag,o_wSTDlevs(ilev)%name,"Vertical wind "//bb2//"hPa", "Pa/s")
    1066  CALL histdef2d(iff,o_zSTDlevs(ilev)%flag,o_zSTDlevs(ilev)%name,"Geopotential height "//bb2//"hPa", "m")
    1067  CALL histdef2d(iff,o_qSTDlevs(ilev)%flag,o_qSTDlevs(ilev)%name,"Specific humidity "//bb2//"hPa", "kg/kg" )
    1068  CALL histdef2d(iff,o_tSTDlevs(ilev)%flag,o_tSTDlevs(ilev)%name,"Temperature "//bb2//"hPa", "K")
    1069      ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR."500".OR.bb2.EQ."200".OR.bb2.EQ."50".OR.bb2.EQ."10")
    1070        ENDDO
    1071    type_ecri(:) = type_ecri_files(:)
    1072 
    1073  CALL histdef2d(iff,o_t_oce_sic%flag,o_t_oce_sic%name, "Temp mixte oce-sic", "K")
    1074 
    1075  IF (type_ocean=='slab') &
    1076      CALL histdef2d(iff,o_slab_bils%flag, o_slab_bils%name,"Bilan au sol sur ocean slab", "W/m2")
    1077 
    1078 ! Couplage conv-CL
    1079  IF (iflag_con.GE.3) THEN
    1080     IF (iflag_coupl>=1) THEN
    1081  CALL histdef2d(iff,o_ale_bl%flag,o_ale_bl%name, "ALE BL", "m2/s2")
    1082  CALL histdef2d(iff,o_alp_bl%flag,o_alp_bl%name, "ALP BL", "m2/s2")
    1083     ENDIF
    1084  ENDIF !(iflag_con.GE.3)
    1085 
    1086  CALL histdef2d(iff,o_weakinv%flag,o_weakinv%name, "Weak inversion", "-")
    1087  CALL histdef2d(iff,o_dthmin%flag,o_dthmin%name, "dTheta mini", "K/m")
    1088  CALL histdef2d(iff,o_rh2m%flag,o_rh2m%name, "Relative humidity at 2m", "%" )
    1089    type_ecri(1) = 't_min(X)'
    1090    type_ecri(2) = 't_min(X)'
    1091    type_ecri(3) = 't_min(X)'
    1092    type_ecri(4) = 't_min(X)'
    1093    type_ecri(5) = 't_min(X)'
    1094  CALL histdef2d(iff,o_rh2m_min%flag,o_rh2m_min%name, "Min Relative humidity at 2m", "%" )
     1350 CALL histdef2d(iff,clef_stations(iff),o_qsat2m%flag,o_qsat2m%name, "Saturant humidity at 2m", "%")
     1351 CALL histdef2d(iff,clef_stations(iff),o_tpot%flag,o_tpot%name, "Surface air potential temperature", "K")
     1352 CALL histdef2d(iff,clef_stations(iff), &
     1353o_tpote%flag,o_tpote%name, "Surface air equivalent potential temperature", "K")
     1354 CALL histdef2d(iff,clef_stations(iff),o_SWnetOR%flag,o_SWnetOR%name, "Sfce net SW radiation OR", "W/m2")
     1355 CALL histdef2d(iff,clef_stations(iff),o_SWdownOR%flag,o_SWdownOR%name, "Sfce incident SW radiation OR", "W/m2")
     1356 CALL histdef2d(iff,clef_stations(iff),o_LWdownOR%flag,o_LWdownOR%name, "Sfce incident LW radiation OR", "W/m2")
     1357 CALL histdef2d(iff,clef_stations(iff),o_snowl%flag,o_snowl%name, "Solid Large-scale Precip.", "kg/(m2*s)")
     1358
     1359 CALL histdef2d(iff,clef_stations(iff),o_solldown%flag,o_solldown%name, "Down. IR rad. at surface", "W/m2")
     1360 CALL histdef2d(iff,clef_stations(iff),o_dtsvdfo%flag,o_dtsvdfo%name, "Boundary-layer dTs(o)", "K/s")
     1361 CALL histdef2d(iff,clef_stations(iff),o_dtsvdft%flag,o_dtsvdft%name, "Boundary-layer dTs(t)", "K/s")
     1362 CALL histdef2d(iff,clef_stations(iff),o_dtsvdfg%flag,o_dtsvdfg%name, "Boundary-layer dTs(g)", "K/s")
     1363 CALL histdef2d(iff,clef_stations(iff),o_dtsvdfi%flag,o_dtsvdfi%name, "Boundary-layer dTs(g)", "K/s")
     1364 CALL histdef2d(iff,clef_stations(iff),o_rugs%flag,o_rugs%name, "rugosity", "-" )
     1365
     1366! Champs 3D:
     1367 CALL histdef3d(iff,clef_stations(iff),o_ec550aer%flag,o_ec550aer%name, "Extinction at 550nm", "m^-1")
     1368 CALL histdef3d(iff,clef_stations(iff),o_lwcon%flag,o_lwcon%name, "Cloud liquid water content", "kg/kg")
     1369 CALL histdef3d(iff,clef_stations(iff),o_iwcon%flag,o_iwcon%name, "Cloud ice water content", "kg/kg")
     1370 CALL histdef3d(iff,clef_stations(iff),o_temp%flag,o_temp%name, "Air temperature", "K" )
     1371 CALL histdef3d(iff,clef_stations(iff),o_theta%flag,o_theta%name, "Potential air temperature", "K" )
     1372 CALL histdef3d(iff,clef_stations(iff),o_ovap%flag,o_ovap%name, "Specific humidity", "kg/kg" )
     1373 CALL histdef3d(iff,clef_stations(iff), &
     1374o_ovapinit%flag,o_ovapinit%name, "Specific humidity (begin of timestep)", "kg/kg" )
     1375 CALL histdef3d(iff,clef_stations(iff), &
     1376o_geop%flag,o_geop%name, "Geopotential height", "m2/s2")
     1377 CALL histdef3d(iff,clef_stations(iff), &
     1378o_vitu%flag,o_vitu%name, "Zonal wind", "m/s" )
     1379 CALL histdef3d(iff,clef_stations(iff), &
     1380o_vitv%flag,o_vitv%name, "Meridional wind", "m/s" )
     1381 CALL histdef3d(iff,clef_stations(iff), &
     1382o_vitw%flag,o_vitw%name, "Vertical wind", "Pa/s" )
     1383 CALL histdef3d(iff,clef_stations(iff), &
     1384o_pres%flag,o_pres%name, "Air pressure", "Pa" )
     1385 CALL histdef3d(iff,clef_stations(iff), &
     1386o_paprs%flag,o_paprs%name, "Air pressure Inter-Couches", "Pa" )
     1387 CALL histdef3d(iff,clef_stations(iff), &
     1388o_mass%flag,o_mass%name, "Masse Couches", "kg/m2" )
     1389 CALL histdef3d(iff,clef_stations(iff), &
     1390o_zfull%flag,o_zfull%name, "Altitude of full pressure levels", "m" )
     1391 CALL histdef3d(iff,clef_stations(iff), &
     1392o_zhalf%flag,o_zhalf%name, "Altitude of half pressure levels", "m" )
     1393 CALL histdef3d(iff,clef_stations(iff), &
     1394o_rneb%flag,o_rneb%name, "Cloud fraction", "-")
     1395 CALL histdef3d(iff,clef_stations(iff), &
     1396o_rnebcon%flag,o_rnebcon%name, "Convective Cloud Fraction", "-")
     1397 CALL histdef3d(iff,clef_stations(iff), &
     1398o_rhum%flag,o_rhum%name, "Relative humidity", "-")
     1399 CALL histdef3d(iff,clef_stations(iff), &
     1400o_ozone%flag,o_ozone%name, "Ozone mole fraction", "-")
     1401 if (read_climoz == 2) &
     1402      CALL histdef3d(iff,clef_stations(iff), &
     1403o_ozone_light%flag,o_ozone_light%name, &
     1404      "Daylight ozone mole fraction", "-")
     1405 CALL histdef3d(iff,clef_stations(iff), &
     1406o_dtphy%flag,o_dtphy%name, "Physics dT", "K/s")
     1407 CALL histdef3d(iff,clef_stations(iff), &
     1408o_dqphy%flag,o_dqphy%name, "Physics dQ", "(kg/kg)/s")
     1409 CALL histdef3d(iff,clef_stations(iff), &
     1410o_cldtau%flag,o_cldtau%name, "Cloud optical thickness", "1")
     1411 CALL histdef3d(iff,clef_stations(iff), &
     1412o_cldemi%flag,o_cldemi%name, "Cloud optical emissivity", "1")
     1413!IM: bug ?? dimensionnement variables (klon,klev+1) pmflxr, pmflxs, prfl, psfl
     1414 CALL histdef3d(iff,clef_stations(iff), &
     1415o_pr_con_l%flag,o_pr_con_l%name, "Convective precipitation lic", " ")
     1416 CALL histdef3d(iff,clef_stations(iff), &
     1417o_pr_con_i%flag,o_pr_con_i%name, "Convective precipitation ice", " ")
     1418 CALL histdef3d(iff,clef_stations(iff), &
     1419o_pr_lsc_l%flag,o_pr_lsc_l%name, "Large scale precipitation lic", " ")
     1420 CALL histdef3d(iff,clef_stations(iff), &
     1421o_pr_lsc_i%flag,o_pr_lsc_i%name, "Large scale precipitation ice", " ")
     1422!Cloud droplet effective radius
     1423 CALL histdef3d(iff,clef_stations(iff), &
     1424o_re%flag,o_re%name, "Cloud droplet effective radius","um")
     1425 CALL histdef3d(iff,clef_stations(iff), &
     1426o_fl%flag,o_fl%name, "Denominator of Cloud droplet effective radius"," ")
     1427!FH Sorties pour la couche limite
     1428     if (iflag_pbl>1) then
     1429 CALL histdef3d(iff,clef_stations(iff), &
     1430o_tke%flag,o_tke%name, "TKE", "m2/s2")
     1431  IF (.NOT.clef_stations(iff)) THEN
     1432!
     1433!IM: there is no way to have one single value in a netcdf file
     1434!
    10951435   type_ecri(1) = 't_max(X)'
    10961436   type_ecri(2) = 't_max(X)'
     
    10981438   type_ecri(4) = 't_max(X)'
    10991439   type_ecri(5) = 't_max(X)'
    1100  CALL histdef2d(iff,o_rh2m_max%flag,o_rh2m_max%name, "Max Relative humidity at 2m", "%" )
     1440   type_ecri(6) = 't_max(X)'
     1441   CALL histdef3d(iff,clef_stations(iff), &
     1442  o_tke_max%flag,o_tke_max%name, "TKE max", "m2/s2")
     1443  ENDIF
    11011444   type_ecri(:) = type_ecri_files(:)
    1102  CALL histdef2d(iff,o_qsat2m%flag,o_qsat2m%name, "Saturant humidity at 2m", "%")
    1103  CALL histdef2d(iff,o_tpot%flag,o_tpot%name, "Surface air potential temperature", "K")
    1104  CALL histdef2d(iff,o_tpote%flag,o_tpote%name, "Surface air equivalent potential temperature", "K")
    1105  CALL histdef2d(iff,o_SWnetOR%flag,o_SWnetOR%name, "Sfce net SW radiation OR", "W/m2")
    1106  CALL histdef2d(iff,o_SWdownOR%flag,o_SWdownOR%name, "Sfce incident SW radiation OR", "W/m2")
    1107  CALL histdef2d(iff,o_LWdownOR%flag,o_LWdownOR%name, "Sfce incident LW radiation OR", "W/m2")
    1108  CALL histdef2d(iff,o_snowl%flag,o_snowl%name, "Solid Large-scale Precip.", "kg/(m2*s)")
    1109 
    1110  CALL histdef2d(iff,o_solldown%flag,o_solldown%name, "Down. IR rad. at surface", "W/m2")
    1111  CALL histdef2d(iff,o_dtsvdfo%flag,o_dtsvdfo%name, "Boundary-layer dTs(o)", "K/s")
    1112  CALL histdef2d(iff,o_dtsvdft%flag,o_dtsvdft%name, "Boundary-layer dTs(t)", "K/s")
    1113  CALL histdef2d(iff,o_dtsvdfg%flag,o_dtsvdfg%name, "Boundary-layer dTs(g)", "K/s")
    1114  CALL histdef2d(iff,o_dtsvdfi%flag,o_dtsvdfi%name, "Boundary-layer dTs(g)", "K/s")
    1115  CALL histdef2d(iff,o_rugs%flag,o_rugs%name, "rugosity", "-" )
    1116 
    1117 ! Champs 3D:
    1118  CALL histdef3d(iff,o_ec550aer%flag,o_ec550aer%name, "Extinction at 550nm", "m^-1")
    1119  CALL histdef3d(iff,o_lwcon%flag,o_lwcon%name, "Cloud liquid water content", "kg/kg")
    1120  CALL histdef3d(iff,o_iwcon%flag,o_iwcon%name, "Cloud ice water content", "kg/kg")
    1121  CALL histdef3d(iff,o_temp%flag,o_temp%name, "Air temperature", "K" )
    1122  CALL histdef3d(iff,o_theta%flag,o_theta%name, "Potential air temperature", "K" )
    1123  CALL histdef3d(iff,o_ovap%flag,o_ovap%name, "Specific humidity", "kg/kg" )
    1124  CALL histdef3d(iff,o_ovapinit%flag,o_ovapinit%name, "Specific humidity (begin of timestep)", "kg/kg" )
    1125  CALL histdef3d(iff,o_geop%flag,o_geop%name, "Geopotential height", "m2/s2")
    1126  CALL histdef3d(iff,o_vitu%flag,o_vitu%name, "Zonal wind", "m/s" )
    1127  CALL histdef3d(iff,o_vitv%flag,o_vitv%name, "Meridional wind", "m/s" )
    1128  CALL histdef3d(iff,o_vitw%flag,o_vitw%name, "Vertical wind", "Pa/s" )
    1129  CALL histdef3d(iff,o_pres%flag,o_pres%name, "Air pressure", "Pa" )
    1130  CALL histdef3d(iff,o_paprs%flag,o_paprs%name, "Air pressure Inter-Couches", "Pa" )
    1131  CALL histdef3d(iff,o_mass%flag,o_mass%name, "Masse Couches", "kg/m2" )
    1132  CALL histdef3d(iff,o_rneb%flag,o_rneb%name, "Cloud fraction", "-")
    1133  CALL histdef3d(iff,o_rnebcon%flag,o_rnebcon%name, "Convective Cloud Fraction", "-")
    1134  CALL histdef3d(iff,o_rhum%flag,o_rhum%name, "Relative humidity", "-")
    1135  CALL histdef3d(iff,o_ozone%flag,o_ozone%name, "Ozone mole fraction", "-")
    1136  if (read_climoz == 2) &
    1137       CALL histdef3d(iff,o_ozone_light%flag,o_ozone_light%name, &
    1138       "Daylight ozone mole fraction", "-")
    1139  CALL histdef3d(iff,o_dtphy%flag,o_dtphy%name, "Physics dT", "K/s")
    1140  CALL histdef3d(iff,o_dqphy%flag,o_dqphy%name, "Physics dQ", "(kg/kg)/s")
    1141  CALL histdef3d(iff,o_cldtau%flag,o_cldtau%name, "Cloud optical thickness", "1")
    1142  CALL histdef3d(iff,o_cldemi%flag,o_cldemi%name, "Cloud optical emissivity", "1")
    1143 !IM: bug ?? dimensionnement variables (klon,klev+1) pmflxr, pmflxs, prfl, psfl
    1144  CALL histdef3d(iff,o_pr_con_l%flag,o_pr_con_l%name, "Convective precipitation lic", " ")
    1145  CALL histdef3d(iff,o_pr_con_i%flag,o_pr_con_i%name, "Convective precipitation ice", " ")
    1146  CALL histdef3d(iff,o_pr_lsc_l%flag,o_pr_lsc_l%name, "Large scale precipitation lic", " ")
    1147  CALL histdef3d(iff,o_pr_lsc_i%flag,o_pr_lsc_i%name, "Large scale precipitation ice", " ")
    1148 !Cloud droplet effective radius
    1149  CALL histdef3d(iff,o_re%flag,o_re%name, "Cloud droplet effective radius","um")
    1150  CALL histdef3d(iff,o_fl%flag,o_fl%name, "Denominator of Cloud droplet effective radius"," ")
    1151 !FH Sorties pour la couche limite
    1152      if (iflag_pbl>1) then
    1153  CALL histdef3d(iff,o_tke%flag,o_tke%name, "TKE", "m2/s2")
     1445     endif
     1446
     1447 CALL histdef3d(iff,clef_stations(iff), &
     1448o_kz%flag,o_kz%name, "Kz melange", "m2/s")
     1449  IF (.NOT.clef_stations(iff)) THEN
     1450!
     1451!IM: there is no way to have one single value in a netcdf file
     1452!
    11541453   type_ecri(1) = 't_max(X)'
    11551454   type_ecri(2) = 't_max(X)'
     
    11571456   type_ecri(4) = 't_max(X)'
    11581457   type_ecri(5) = 't_max(X)'
    1159  CALL histdef3d(iff,o_tke_max%flag,o_tke_max%name, "TKE max", "m2/s2")
     1458   type_ecri(6) = 't_max(X)'
     1459   CALL histdef3d(iff,clef_stations(iff), &
     1460   o_kz_max%flag,o_kz_max%name, "Kz melange max", "m2/s" )
     1461  ENDIF
    11601462   type_ecri(:) = type_ecri_files(:)
    1161      endif
    1162 
    1163  CALL histdef3d(iff,o_kz%flag,o_kz%name, "Kz melange", "m2/s")
    1164    type_ecri(1) = 't_max(X)'
    1165    type_ecri(2) = 't_max(X)'
    1166    type_ecri(3) = 't_max(X)'
    1167    type_ecri(4) = 't_max(X)'
    1168    type_ecri(5) = 't_max(X)'
    1169  CALL histdef3d(iff,o_kz_max%flag,o_kz_max%name, "Kz melange max", "m2/s" )
    1170    type_ecri(:) = type_ecri_files(:)
    1171  CALL histdef3d(iff,o_clwcon%flag,o_clwcon%name, "Convective Cloud Liquid water content", "kg/kg")
    1172  CALL histdef3d(iff,o_dtdyn%flag,o_dtdyn%name, "Dynamics dT", "K/s")
    1173  CALL histdef3d(iff,o_dqdyn%flag,o_dqdyn%name, "Dynamics dQ", "(kg/kg)/s")
    1174  CALL histdef3d(iff,o_dudyn%flag,o_dudyn%name, "Dynamics dU", "m/s2")
    1175  CALL histdef3d(iff,o_dvdyn%flag,o_dvdyn%name, "Dynamics dV", "m/s2")
    1176  CALL histdef3d(iff,o_dtcon%flag,o_dtcon%name, "Convection dT", "K/s")
    1177  CALL histdef3d(iff,o_ducon%flag,o_ducon%name, "Convection du", "m/s2")
    1178  CALL histdef3d(iff,o_dqcon%flag,o_dqcon%name, "Convection dQ", "(kg/kg)/s")
     1463 CALL histdef3d(iff,clef_stations(iff), &
     1464o_clwcon%flag,o_clwcon%name, "Convective Cloud Liquid water content", "kg/kg")
     1465 CALL histdef3d(iff,clef_stations(iff), &
     1466o_dtdyn%flag,o_dtdyn%name, "Dynamics dT", "K/s")
     1467 CALL histdef3d(iff,clef_stations(iff), &
     1468o_dqdyn%flag,o_dqdyn%name, "Dynamics dQ", "(kg/kg)/s")
     1469 CALL histdef3d(iff,clef_stations(iff), &
     1470o_dudyn%flag,o_dudyn%name, "Dynamics dU", "m/s2")
     1471 CALL histdef3d(iff,clef_stations(iff), &
     1472o_dvdyn%flag,o_dvdyn%name, "Dynamics dV", "m/s2")
     1473 CALL histdef3d(iff,clef_stations(iff), &
     1474o_dtcon%flag,o_dtcon%name, "Convection dT", "K/s")
     1475 CALL histdef3d(iff,clef_stations(iff), &
     1476o_ducon%flag,o_ducon%name, "Convection du", "m/s2")
     1477 CALL histdef3d(iff,clef_stations(iff), &
     1478o_dqcon%flag,o_dqcon%name, "Convection dQ", "(kg/kg)/s")
    11791479
    11801480! Wakes
    11811481 IF(iflag_con.EQ.3) THEN
    11821482 IF (iflag_wake >= 1) THEN
    1183    CALL histdef2d(iff,o_ale_wk%flag,o_ale_wk%name, "ALE WK", "m2/s2")
    1184    CALL histdef2d(iff,o_alp_wk%flag,o_alp_wk%name, "ALP WK", "m2/s2")
    1185    CALL histdef2d(iff,o_ale%flag,o_ale%name, "ALE", "m2/s2")
    1186    CALL histdef2d(iff,o_alp%flag,o_alp%name, "ALP", "W/m2")
    1187    CALL histdef2d(iff,o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2")
    1188    CALL histdef2d(iff,o_wape%flag,o_WAPE%name, "WAPE", "m2/s2")
    1189    CALL histdef2d(iff,o_wake_h%flag,o_wake_h%name, "wake_h", "-")
    1190    CALL histdef2d(iff,o_wake_s%flag,o_wake_s%name, "wake_s", "-")
    1191    CALL histdef3d(iff,o_dtwak%flag,o_dtwak%name, "Wake dT", "K/s")
    1192    CALL histdef3d(iff,o_dqwak%flag,o_dqwak%name, "Wake dQ", "(kg/kg)/s")
    1193    CALL histdef3d(iff,o_wake_deltat%flag,o_wake_deltat%name, "wake_deltat", " ")
    1194    CALL histdef3d(iff,o_wake_deltaq%flag,o_wake_deltaq%name, "wake_deltaq", " ")
    1195    CALL histdef3d(iff,o_wake_omg%flag,o_wake_omg%name, "wake_omg", " ")
     1483   CALL histdef2d(iff,clef_stations(iff), &
     1484o_ale_wk%flag,o_ale_wk%name, "ALE WK", "m2/s2")
     1485   CALL histdef2d(iff,clef_stations(iff), &
     1486o_alp_wk%flag,o_alp_wk%name, "ALP WK", "m2/s2")
     1487   CALL histdef2d(iff,clef_stations(iff), &
     1488o_ale%flag,o_ale%name, "ALE", "m2/s2")
     1489   CALL histdef2d(iff,clef_stations(iff), &
     1490o_alp%flag,o_alp%name, "ALP", "W/m2")
     1491   CALL histdef2d(iff,clef_stations(iff),o_cin%flag,o_cin%name, "Convective INhibition", "m2/s2")
     1492   CALL histdef2d(iff,clef_stations(iff),o_wape%flag,o_WAPE%name, "WAPE", "m2/s2")
     1493   CALL histdef2d(iff,clef_stations(iff),o_wake_h%flag,o_wake_h%name, "wake_h", "-")
     1494   CALL histdef2d(iff,clef_stations(iff),o_wake_s%flag,o_wake_s%name, "wake_s", "-")
     1495   CALL histdef3d(iff,clef_stations(iff),o_dtwak%flag,o_dtwak%name, "Wake dT", "K/s")
     1496   CALL histdef3d(iff,clef_stations(iff),o_dqwak%flag,o_dqwak%name, "Wake dQ", "(kg/kg)/s")
     1497   CALL histdef3d(iff,clef_stations(iff),o_wake_deltat%flag,o_wake_deltat%name, "wake_deltat", " ")
     1498   CALL histdef3d(iff,clef_stations(iff),o_wake_deltaq%flag,o_wake_deltaq%name, "wake_deltaq", " ")
     1499   CALL histdef3d(iff,clef_stations(iff),o_wake_omg%flag,o_wake_omg%name, "wake_omg", " ")
    11961500 ENDIF
    1197    CALL histdef3d(iff,o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-")
    1198    CALL histdef3d(iff,o_ftd%flag,o_ftd%name, "tend temp due aux descentes precip", "-")
    1199    CALL histdef3d(iff,o_fqd%flag,o_fqd%name,"tend vap eau due aux descentes precip", "-")
     1501   CALL histdef3d(iff,clef_stations(iff),o_Vprecip%flag,o_Vprecip%name, "precipitation vertical profile", "-")
     1502   CALL histdef3d(iff,clef_stations(iff),o_ftd%flag,o_ftd%name, "tend temp due aux descentes precip", "-")
     1503   CALL histdef3d(iff,clef_stations(iff),o_fqd%flag,o_fqd%name,"tend vap eau due aux descentes precip", "-")
    12001504 ENDIF !(iflag_con.EQ.3)
    12011505
    1202  CALL histdef3d(iff,o_dtlsc%flag,o_dtlsc%name, "Condensation dT", "K/s")
    1203  CALL histdef3d(iff,o_dtlschr%flag,o_dtlschr%name,"Large-scale condensational heating rate","K/s")
    1204  CALL histdef3d(iff,o_dqlsc%flag,o_dqlsc%name, "Condensation dQ", "(kg/kg)/s")
    1205  CALL histdef3d(iff,o_dtvdf%flag,o_dtvdf%name, "Boundary-layer dT", "K/s")
    1206  CALL histdef3d(iff,o_dqvdf%flag,o_dqvdf%name, "Boundary-layer dQ", "(kg/kg)/s")
    1207  CALL histdef3d(iff,o_dteva%flag,o_dteva%name, "Reevaporation dT", "K/s")
    1208  CALL histdef3d(iff,o_dqeva%flag,o_dqeva%name, "Reevaporation dQ", "(kg/kg)/s")
    1209  CALL histdef3d(iff,o_ptconv%flag,o_ptconv%name, "POINTS CONVECTIFS", " ")
    1210  CALL histdef3d(iff,o_ratqs%flag,o_ratqs%name, "RATQS", " ")
    1211  CALL histdef3d(iff,o_dtthe%flag,o_dtthe%name, "Dry adjust. dT", "K/s")
     1506 CALL histdef3d(iff,clef_stations(iff),o_dtlsc%flag,o_dtlsc%name, "Condensation dT", "K/s")
     1507 CALL histdef3d(iff,clef_stations(iff),o_dtlschr%flag,o_dtlschr%name,"Large-scale condensational heating rate","K/s")
     1508 CALL histdef3d(iff,clef_stations(iff),o_dqlsc%flag,o_dqlsc%name, "Condensation dQ", "(kg/kg)/s")
     1509 CALL histdef3d(iff,clef_stations(iff),o_dtvdf%flag,o_dtvdf%name, "Boundary-layer dT", "K/s")
     1510 CALL histdef3d(iff,clef_stations(iff),o_dqvdf%flag,o_dqvdf%name, "Boundary-layer dQ", "(kg/kg)/s")
     1511 CALL histdef3d(iff,clef_stations(iff),o_dteva%flag,o_dteva%name, "Reevaporation dT", "K/s")
     1512 CALL histdef3d(iff,clef_stations(iff),o_dqeva%flag,o_dqeva%name, "Reevaporation dQ", "(kg/kg)/s")
     1513 CALL histdef3d(iff,clef_stations(iff),o_ptconv%flag,o_ptconv%name, "POINTS CONVECTIFS", " ")
     1514 CALL histdef3d(iff,clef_stations(iff),o_ratqs%flag,o_ratqs%name, "RATQS", " ")
     1515 CALL histdef3d(iff,clef_stations(iff),o_dtthe%flag,o_dtthe%name, "Thermal dT", "K/s")
    12121516
    12131517if(iflag_thermals.gt.1) THEN
    1214  CALL histdef3d(iff,o_dqlscth%flag,o_dqlscth%name, "dQ therm.", "(kg/kg)/s")
    1215  CALL histdef3d(iff,o_dqlscst%flag,o_dqlscst%name, "dQ strat.", "(kg/kg)/s")
    1216  CALL histdef3d(iff,o_dtlscth%flag,o_dtlscth%name, "dQ therm.", "K/s")
    1217  CALL histdef3d(iff,o_dtlscst%flag,o_dtlscst%name, "dQ strat.", "K/s")
    1218  CALL histdef2d(iff,o_plulth%flag,o_plulth%name, "Rainfall therm.", "K/s")
    1219  CALL histdef2d(iff,o_plulst%flag,o_plulst%name, "Rainfall strat.", "K/s")
    1220  CALL histdef2d(iff,o_lmaxth%flag,o_lmaxth%name, "Upper level thermals", "")
    1221  CALL histdef3d(iff,o_ptconvth%flag,o_ptconvth%name, "POINTS CONVECTIFS therm.", " ")
    1222  CALL histdef3d(iff,o_f_th%flag,o_f_th%name, "Thermal plume mass flux", "K/s")
    1223  CALL histdef3d(iff,o_e_th%flag,o_e_th%name,"Thermal plume entrainment","K/s")
    1224  CALL histdef3d(iff,o_w_th%flag,o_w_th%name,"Thermal plume vertical velocity","m/s")
    1225  CALL histdef3d(iff,o_lambda_th%flag,o_lambda_th%name,"Thermal plume vertical velocity","m/s")
    1226  CALL histdef2d(iff,o_ftime_th%flag,o_ftime_th%name,"Fraction of time Shallow convection occurs"," ")
    1227  CALL histdef3d(iff,o_q_th%flag,o_q_th%name, "Thermal plume total humidity", "kg/kg")
    1228  CALL histdef3d(iff,o_a_th%flag,o_a_th%name, "Thermal plume fraction", "")
    1229  CALL histdef3d(iff,o_d_th%flag,o_d_th%name, "Thermal plume detrainment", "K/s")
    1230 !IM endif !iflag_thermals.gt.1
    1231  CALL histdef2d(iff,o_f0_th%flag,o_f0_th%name, "Thermal closure mass flux", "K/s")
    1232  CALL histdef2d(iff,o_zmax_th%flag,o_zmax_th%name, "Thermal plume height", "K/s")
    1233  CALL histdef3d(iff,o_dqthe%flag,o_dqthe%name, "Dry adjust. dQ", "(kg/kg)/s")
     1518 CALL histdef3d(iff,clef_stations(iff),o_dqlscth%flag,o_dqlscth%name, "dQ therm.", "(kg/kg)/s")
     1519 CALL histdef3d(iff,clef_stations(iff),o_dqlscst%flag,o_dqlscst%name, "dQ strat.", "(kg/kg)/s")
     1520 CALL histdef3d(iff,clef_stations(iff),o_dtlscth%flag,o_dtlscth%name, "dQ therm.", "K/s")
     1521 CALL histdef3d(iff,clef_stations(iff),o_dtlscst%flag,o_dtlscst%name, "dQ strat.", "K/s")
     1522 CALL histdef2d(iff,clef_stations(iff),o_plulth%flag,o_plulth%name, "Rainfall therm.", "K/s")
     1523 CALL histdef2d(iff,clef_stations(iff),o_plulst%flag,o_plulst%name, "Rainfall strat.", "K/s")
     1524 CALL histdef2d(iff,clef_stations(iff),o_lmaxth%flag,o_lmaxth%name, "Upper level thermals", "")
     1525 CALL histdef3d(iff,clef_stations(iff),o_ptconvth%flag,o_ptconvth%name, "POINTS CONVECTIFS therm.", " ")
     1526 CALL histdef3d(iff,clef_stations(iff),o_f_th%flag,o_f_th%name, "Thermal plume mass flux", "kg/(m2*s)")
     1527 CALL histdef3d(iff,clef_stations(iff),o_e_th%flag,o_e_th%name,"Thermal plume entrainment","K/s")
     1528 CALL histdef3d(iff,clef_stations(iff),o_w_th%flag,o_w_th%name,"Thermal plume vertical velocity","m/s")
     1529 CALL histdef3d(iff,clef_stations(iff), &
     1530o_lambda_th%flag,o_lambda_th%name,"Thermal plume vertical velocity","m/s")
     1531 CALL histdef2d(iff,clef_stations(iff), &
     1532o_ftime_th%flag,o_ftime_th%name,"Fraction of time Shallow convection occurs"," ")
     1533 CALL histdef3d(iff,clef_stations(iff), &
     1534o_q_th%flag,o_q_th%name, "Thermal plume total humidity", "kg/kg")
     1535 CALL histdef3d(iff,clef_stations(iff), &
     1536o_a_th%flag,o_a_th%name, "Thermal plume fraction", "")
     1537 CALL histdef3d(iff,clef_stations(iff), &
     1538o_d_th%flag,o_d_th%name, "Thermal plume detrainment", "K/s")
     1539
     1540 CALL histdef2d(iff,clef_stations(iff), &
     1541o_f0_th%flag,o_f0_th%name, "Thermal closure mass flux", "K/s")
     1542 CALL histdef2d(iff,clef_stations(iff), &
     1543o_zmax_th%flag,o_zmax_th%name, "Thermal plume height", "K/s")
     1544 CALL histdef3d(iff,clef_stations(iff), &
     1545o_dqthe%flag,o_dqthe%name, "Thermal dQ", "(kg/kg)/s")
    12341546endif !iflag_thermals.gt.1
    1235  CALL histdef3d(iff,o_dtajs%flag,o_dtajs%name, "Dry adjust. dT", "K/s")
    1236  CALL histdef3d(iff,o_dqajs%flag,o_dqajs%name, "Dry adjust. dQ", "(kg/kg)/s")
    1237  CALL histdef3d(iff,o_dtswr%flag,o_dtswr%name, "SW radiation dT", "K/s")
    1238  CALL histdef3d(iff,o_dtsw0%flag,o_dtsw0%name, "CS SW radiation dT", "K/s")
    1239  CALL histdef3d(iff,o_dtlwr%flag,o_dtlwr%name, "LW radiation dT", "K/s")
    1240  CALL histdef3d(iff,o_dtlw0%flag,o_dtlw0%name, "CS LW radiation dT", "K/s")
    1241  CALL histdef3d(iff,o_dtec%flag,o_dtec%name, "Cinetic dissip dT", "K/s")
    1242  CALL histdef3d(iff,o_duvdf%flag,o_duvdf%name, "Boundary-layer dU", "m/s2")
    1243  CALL histdef3d(iff,o_dvvdf%flag,o_dvvdf%name, "Boundary-layer dV", "m/s2")
     1547 CALL histdef3d(iff,clef_stations(iff), &
     1548o_dtajs%flag,o_dtajs%name, "Dry adjust. dT", "K/s")
     1549 CALL histdef3d(iff,clef_stations(iff), &
     1550o_dqajs%flag,o_dqajs%name, "Dry adjust. dQ", "(kg/kg)/s")
     1551 CALL histdef3d(iff,clef_stations(iff), &
     1552o_dtswr%flag,o_dtswr%name, "SW radiation dT", "K/s")
     1553 CALL histdef3d(iff,clef_stations(iff), &
     1554o_dtsw0%flag,o_dtsw0%name, "CS SW radiation dT", "K/s")
     1555 CALL histdef3d(iff,clef_stations(iff), &
     1556o_dtlwr%flag,o_dtlwr%name, "LW radiation dT", "K/s")
     1557 CALL histdef3d(iff,clef_stations(iff), &
     1558o_dtlw0%flag,o_dtlw0%name, "CS LW radiation dT", "K/s")
     1559 CALL histdef3d(iff,clef_stations(iff), &
     1560o_dtec%flag,o_dtec%name, "Cinetic dissip dT", "K/s")
     1561 CALL histdef3d(iff,clef_stations(iff), &
     1562o_duvdf%flag,o_duvdf%name, "Boundary-layer dU", "m/s2")
     1563 CALL histdef3d(iff,clef_stations(iff), &
     1564o_dvvdf%flag,o_dvvdf%name, "Boundary-layer dV", "m/s2")
    12441565
    12451566     IF (ok_orodr) THEN
    1246  CALL histdef3d(iff,o_duoro%flag,o_duoro%name, "Orography dU", "m/s2")
    1247  CALL histdef3d(iff,o_dvoro%flag,o_dvoro%name, "Orography dV", "m/s2")
     1567 CALL histdef3d(iff,clef_stations(iff), &
     1568o_duoro%flag,o_duoro%name, "Orography dU", "m/s2")
     1569 CALL histdef3d(iff,clef_stations(iff), &
     1570o_dvoro%flag,o_dvoro%name, "Orography dV", "m/s2")
     1571 CALL histdef3d(iff,clef_stations(iff), &
     1572o_dtoro%flag,o_dtoro%name, "Orography dT", "K/s")
    12481573     ENDIF
    12491574
    12501575     IF (ok_orolf) THEN
    1251  CALL histdef3d(iff,o_dulif%flag,o_dulif%name, "Orography dU", "m/s2")
    1252  CALL histdef3d(iff,o_dvlif%flag,o_dvlif%name, "Orography dV", "m/s2")
     1576 CALL histdef3d(iff,clef_stations(iff), &
     1577o_dulif%flag,o_dulif%name, "Orography dU", "m/s2")
     1578 CALL histdef3d(iff,clef_stations(iff), &
     1579o_dvlif%flag,o_dvlif%name, "Orography dV", "m/s2")
     1580 CALL histdef3d(iff,clef_stations(iff), &
     1581o_dtlif%flag,o_dtlif%name, "Orography dT", "K/s")
    12531582     ENDIF
     1583
     1584     IF (ok_hines) then
     1585 CALL histdef3d(iff,clef_stations(iff), &
     1586o_duhin%flag,o_duhin%name, "Hines GWD dU", "m/s2")
     1587 CALL histdef3d(iff,clef_stations(iff), &
     1588o_dvhin%flag,o_dvhin%name, "Hines GWD dV", "m/s2")
     1589
     1590 CALL histdef3d(iff,clef_stations(iff), &
     1591o_dthin%flag,o_dthin%name, "Hines GWD dT", "K/s")
     1592     ENDIF
     1593
     1594 CALL histdef3d(iff,clef_stations(iff), &
     1595o_rsu%flag,o_rsu%name, "SW upward radiation", "W m-2")
     1596 CALL histdef3d(iff,clef_stations(iff), &
     1597o_rsd%flag,o_rsd%name, "SW downward radiation", "W m-2")
     1598 CALL histdef3d(iff,clef_stations(iff), &
     1599o_rlu%flag,o_rlu%name, "LW upward radiation", "W m-2")
     1600 CALL histdef3d(iff,clef_stations(iff), &
     1601o_rld%flag,o_rld%name, "LW downward radiation", "W m-2")
     1602
     1603 CALL histdef3d(iff,clef_stations(iff), &
     1604o_rsucs%flag,o_rsucs%name, "SW CS upward radiation", "W m-2")
     1605 CALL histdef3d(iff,clef_stations(iff), &
     1606o_rsdcs%flag,o_rsdcs%name, "SW CS downward radiation", "W m-2")
     1607 CALL histdef3d(iff,clef_stations(iff), &
     1608o_rlucs%flag,o_rlucs%name, "LW CS upward radiation", "W m-2")
     1609 CALL histdef3d(iff,clef_stations(iff), &
     1610o_rldcs%flag,o_rldcs%name, "LW CS downward radiation", "W m-2")
     1611 
     1612 CALL histdef3d(iff,clef_stations(iff), &
     1613o_tnt%flag,o_tnt%name, "Tendency of air temperature", "K s-1")
     1614
     1615 CALL histdef3d(iff,clef_stations(iff), &
     1616o_tntc%flag,o_tntc%name, "Tendency of air temperature due to Moist Convection", &
     1617"K s-1")
     1618
     1619 CALL histdef3d(iff,clef_stations(iff), &
     1620o_tntr%flag,o_tntr%name, "Air temperature tendency due to Radiative heating", &
     1621"K s-1")
     1622
     1623 CALL histdef3d(iff,clef_stations(iff), &
     1624o_tntscpbl%flag,o_tntscpbl%name, "Air temperature tendency due to St cloud and precipitation and BL mixing", &
     1625"K s-1")
     1626
     1627 CALL histdef3d(iff,clef_stations(iff), &
     1628o_tnhus%flag,o_tnhus%name, "Tendency of specific humidity", "s-1")
     1629
     1630 CALL histdef3d(iff,clef_stations(iff), &
     1631o_tnhusc%flag,o_tnhusc%name, "Tendency of specific humidity due to convection", "s-1")
     1632
     1633 CALL histdef3d(iff,clef_stations(iff), &
     1634o_tnhusscpbl%flag,o_tnhusscpbl%name, "Tendency of Specific humidity due to ST cl, precip and BL mixing", &
     1635"s-1")
     1636
     1637 CALL histdef3d(iff,clef_stations(iff), &
     1638o_evu%flag,o_evu%name, "Eddy viscosity coefficient for Momentum Variables", "m2 s-1")
     1639
     1640 CALL histdef3d(iff,clef_stations(iff), &
     1641o_h2o%flag,o_h2o%name, "Mass Fraction of Water", "1")
     1642
     1643 CALL histdef3d(iff,clef_stations(iff), &
     1644o_mcd%flag,o_mcd%name, "Downdraft COnvective Mass Flux", "kg/(m2*s)")
     1645
     1646 CALL histdef3d(iff,clef_stations(iff), &
     1647o_dmc%flag,o_dmc%name, "Deep COnvective Mass Flux", "kg/(m2*s)")
     1648
     1649 CALL histdef3d(iff,clef_stations(iff), &
     1650o_ref_liq%flag,o_ref_liq%name, "Effective radius of convective cloud liquid water particle", "m")
     1651
     1652 CALL histdef3d(iff,clef_stations(iff), &
     1653o_ref_ice%flag,o_ref_ice%name, "Effective radius of startiform cloud ice particle", "m")
     1654
     1655   if (RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR. &
     1656    RN2O_per.NE.RN2O_act.OR.RCFC11_per.NE.RCFC11_act.OR. &
     1657    RCFC12_per.NE.RCFC12_act) THEN
     1658
     1659 CALL histdef2d(iff,clef_stations(iff),o_rsut4co2%flag,o_rsut4co2%name, &
     1660 "TOA Out SW in 4xCO2 atmosphere", "W/m2")
     1661CALL histdef2d(iff,clef_stations(iff),o_rlut4co2%flag,o_rlut4co2%name, &
     1662"TOA Out LW in 4xCO2 atmosphere", "W/m2")
     1663CALL histdef2d(iff,clef_stations(iff),o_rsutcs4co2%flag,o_rsutcs4co2%name, &
     1664"TOA Out CS SW in 4xCO2 atmosphere", "W/m2")
     1665CALL histdef2d(iff,clef_stations(iff),o_rlutcs4co2%flag,o_rlutcs4co2%name, &
     1666"TOA Out CS LW in 4xCO2 atmosphere", "W/m2")
     1667
     1668CALL histdef3d(iff,clef_stations(iff),o_rsu4co2%flag,o_rsu4co2%name, &
     1669"Upwelling SW 4xCO2 atmosphere", "W/m2")
     1670CALL histdef3d(iff,clef_stations(iff),o_rlu4co2%flag,o_rlu4co2%name, &
     1671"Upwelling LW 4xCO2 atmosphere", "W/m2")
     1672CALL histdef3d(iff,clef_stations(iff),o_rsucs4co2%flag,o_rsucs4co2%name, &
     1673"Upwelling CS SW 4xCO2 atmosphere", "W/m2")
     1674CALL histdef3d(iff,clef_stations(iff),o_rlucs4co2%flag,o_rlucs4co2%name, &
     1675"Upwelling CS LW 4xCO2 atmosphere", "W/m2")
     1676
     1677 CALL histdef3d(iff,clef_stations(iff),o_rsd4co2%flag,o_rsd4co2%name, &
     1678 "Downwelling SW 4xCO2 atmosphere", "W/m2")
     1679 CALL histdef3d(iff,clef_stations(iff),o_rld4co2%flag,o_rld4co2%name, &
     1680"Downwelling LW 4xCO2 atmosphere", "W/m2")
     1681 CALL histdef3d(iff,clef_stations(iff),o_rsdcs4co2%flag,o_rsdcs4co2%name, &
     1682"Downwelling CS SW 4xCO2 atmosphere", "W/m2")
     1683 CALL histdef3d(iff,clef_stations(iff),o_rldcs4co2%flag,o_rldcs4co2%name, &
     1684"Downwelling CS LW 4xCO2 atmosphere", "W/m2")
     1685
     1686   endif
    12541687
    12551688
     
    12571690     DO iq=3,nqtot 
    12581691       iiq=niadv(iq)
    1259        o_trac(iq-2) = ctrl_out((/ 4, 5, 1, 1, 1 /),tname(iiq))
    1260        CALL histdef3d (iff, o_trac(iq-2)%flag,o_trac(iq-2)%name,'Tracer '//ttext(iiq), "-" )
     1692       o_trac(iq-2) = ctrl_out((/ 4, 5, 1, 1, 1, 10 /),tname(iiq))
     1693       CALL histdef3d (iff,clef_stations(iff), &
     1694 o_trac(iq-2)%flag,o_trac(iq-2)%name,'Tracer '//ttext(iiq), "-" )
    12611695     ENDDO
    12621696    ENDIF
     
    12731707      end subroutine phys_output_open
    12741708
    1275       SUBROUTINE histdef2d (iff,flag_var,nomvar,titrevar,unitvar)
     1709      SUBROUTINE histdef2d (iff,lpoint,flag_var,nomvar,titrevar,unitvar)
    12761710     
    12771711       use ioipsl
    12781712       USE dimphy
    12791713       USE mod_phys_lmdz_para
     1714       USE iophy
    12801715
    12811716       IMPLICIT NONE
     
    12871722
    12881723       integer                          :: iff
     1724       logical                          :: lpoint
    12891725       integer, dimension(nfiles)       :: flag_var
    12901726       character(len=20)                 :: nomvar
     
    13021738! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def
    13031739       call conf_physoutputs(nomvar,flag_var)
    1304        
     1740     
     1741       if(.NOT.lpoint) THEN 
    13051742       if ( flag_var(iff)<=lev_files(iff) ) then
    13061743 call histdef (nid_files(iff),nomvar,titrevar,unitvar, &
     
    13081745               type_ecri(iff), zstophym,zoutm(iff))               
    13091746       endif                     
     1747       else
     1748       if ( flag_var(iff)<=lev_files(iff) ) then
     1749 call histdef (nid_files(iff),nomvar,titrevar,unitvar, &
     1750               npstn,1,nhorim(iff), 1,1,1, -99, 32, &
     1751               type_ecri(iff), zstophym,zoutm(iff))               
     1752       endif                     
     1753       endif                     
    13101754      end subroutine histdef2d
    13111755
    1312       SUBROUTINE histdef3d (iff,flag_var,nomvar,titrevar,unitvar)
     1756      SUBROUTINE histdef3d (iff,lpoint,flag_var,nomvar,titrevar,unitvar)
    13131757
    13141758       use ioipsl
    13151759       USE dimphy
    13161760       USE mod_phys_lmdz_para
     1761       USE iophy
    13171762
    13181763       IMPLICIT NONE
     
    13241769
    13251770       integer                          :: iff
     1771       logical                          :: lpoint
    13261772       integer, dimension(nfiles)       :: flag_var
    13271773       character(len=20)                 :: nomvar
     
    13401786       endif
    13411787
     1788       if(.NOT.lpoint) THEN
    13421789       if ( flag_var(iff)<=lev_files(iff) ) then
    13431790          call histdef (nid_files(iff), nomvar, titrevar, unitvar, &
     
    13451792               levmax(iff)-levmin(iff)+1, nvertm(iff), 32, type_ecri(iff), &
    13461793               zstophym, zoutm(iff))
     1794       endif
     1795       else
     1796       if ( flag_var(iff)<=lev_files(iff) ) then
     1797          call histdef (nid_files(iff), nomvar, titrevar, unitvar, &
     1798               npstn,1,nhorim(iff), klev, levmin(iff), &
     1799               levmax(iff)-levmin(iff)+1, nvertm(iff), 32, &
     1800               type_ecri(iff), zstophym,zoutm(iff))
     1801       endif
    13471802       endif
    13481803      end subroutine histdef3d
Note: See TracChangeset for help on using the changeset viewer.