Changeset 929 for LMDZ4/trunk


Ignore:
Timestamp:
Mar 20, 2008, 1:14:18 PM (17 years ago)
Author:
lmdzadmin
Message:

Ecriture plus compacte des sorties et ajout variables LMDZ AI
IM

Location:
LMDZ4/trunk/libf/phylmd
Files:
3 edited

Legend:

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

    r922 r929  
    1515  IMPLICIT NONE
    1616
    17    integer, parameter                :: nfiles = 4
    18    logical, dimension(nfiles), save  :: clef_files
    19    integer, dimension(nfiles), save  :: lev_files
    20    integer, dimension(nfiles), save  :: nid_files
     17   integer, parameter                           :: nfiles = 4
     18   logical, dimension(nfiles), save             :: clef_files
     19   integer, dimension(nfiles), save             :: lev_files
     20   integer, dimension(nfiles), save             :: nid_files
     21
     22   integer, dimension(nfiles), save             :: nhorim, nvertm
     23   real, dimension(nfiles), save                :: zstophym, zoutm
     24   CHARACTER(len=20), dimension(nfiles), save   :: type_ecri
     25
    2126!   integer, save                     :: nid_hf3d
    2227
     
    2530
    2631  logical, dimension(nfiles), save  :: ok_reglim         = (/ .false., .true., .true., .false. /)
    27   real, dimension(nfiles), save     :: lonmin_reg        = (/ 0., 0., 0., 0. /)
    28   real, dimension(nfiles), save     :: lonmax_reg        = (/ 90., 90., 90., 90. /)
    29   real, dimension(nfiles), save     :: latmin_reg        = (/ 0., 0., 0., 0. /)
     32  real, dimension(nfiles), save     :: lonmin_reg        = (/ 0., -45., 0., 0. /)
     33  real, dimension(nfiles), save     :: lonmax_reg        = (/ 90., 45., 90., 90. /)
     34  real, dimension(nfiles), save     :: latmin_reg        = (/ 0., -45., 0., 0. /)
    3035  real, dimension(nfiles), save     :: latmax_reg        = (/ 90., 90., 90., 90. /)
    3136
     
    149154  integer, dimension(nfiles) , save :: flag_s_pblh       = (/ 1, 10, 10, 1 /)
    150155  integer, dimension(nfiles) , save :: flag_s_pblt       = (/ 1, 10, 10, 1 /)
    151   integer, dimension(nfiles) , save :: flag_s_lclt       = (/ 1, 10, 10, 1 /)
     156  integer, dimension(nfiles) , save :: flag_s_lcl       = (/ 1, 10, 10, 1 /)
    152157  integer, dimension(nfiles) , save :: flag_s_capCL      = (/ 1, 10, 10, 1 /)
    153   integer, dimension(nfiles) , save :: flag_s_oliqCLL    = (/ 1, 10, 10, 1 /)
     158  integer, dimension(nfiles) , save :: flag_s_oliqCL    = (/ 1, 10, 10, 1 /)
    154159  integer, dimension(nfiles) , save :: flag_s_cteiCL     = (/ 1, 10, 10, 1 /)
    155160  integer, dimension(nfiles) , save :: flag_s_therm      = (/ 1, 10, 10, 1 /)
     
    233238  integer, dimension(nfiles) , save :: flag_dtphy        = (/ 2, 10, 10, 10 /)
    234239  integer, dimension(nfiles) , save :: flag_dqphy        = (/ 2, 10, 10, 10 /)
    235 ! arevoir probleme noms (geop, ovap  a ?????)
     240  integer, dimension(nfiles) , save :: flag_pr_con_l     = (/ 2, 10, 10, 10 /)
     241  integer, dimension(nfiles) , save :: flag_pr_con_i     = (/ 2, 10, 10, 10 /)
     242  integer, dimension(nfiles) , save :: flag_pr_lsc_l     = (/ 2, 10, 10, 10 /)
     243  integer, dimension(nfiles) , save :: flag_pr_lsc_i     = (/ 2, 10, 10, 10 /)
     244!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    236245
    237246  integer, dimension(nfiles) , save :: flag_albe_sol     = (/ 3, 4, 10, 1 /)
     
    283292!! histbeg, histvert et histdef
    284293!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    285 
    286        SUBROUTINE phys_output_open ( jj_nb, jjmp1, nqmax, &
    287      &                nlevSTD, clevSTD, nbteta, ctetaSTD, &
    288      &              dtime, presnivs, ok_veget, ocean, iflag_pbl, &
    289      &                ok_mensuel,ok_journe,ok_hf,ok_instan, &
    290      &                 rlon, rlat, nid_fil)
    291 
    292 
    293    
    294        USE iophy
    295        USE dimphy
    296        USE ioipsl
    297 
    298        IMPLICIT NONE
    299        include "dimensions.h"
    300        include "temps.h"
    301        include "indicesol.h"
    302        include "advtrac.h"
    303        include "clesphys.h"
    304 
    305         integer      :: jj_nb, jjmp1, nqmax
    306         integer      :: nbteta, nlevSTD, radpas
    307         logical      :: ok_mensuel, ok_journe, ok_hf, ok_instan
    308         real         :: dtime, zstophy, zout
    309         integer      :: nhori, nvert
    310         integer      :: idayref
    311         real         :: zjulian
    312         real, dimension(klev) :: presnivs
    313         character(len=4), dimension(nlevSTD) :: clevSTD
    314         integer      :: nsrf, k, iq, iiq, iff, i, j
    315         logical      :: ok_veget
    316         integer           :: iflag_pbl
    317         CHARACTER(len=3)  :: bb2
    318         CHARACTER(len=2)  :: bb3
    319         character(len=6)  :: ocean
    320         CHARACTER(len=3)  :: ctetaSTD(nbteta)
    321         integer, dimension(nfiles) :: nid_fil
    322         real, dimension(nfiles)    ::  ecrit_files
    323         CHARACTER(len=20), dimension(nfiles) :: name_files
    324         CHARACTER(len=20), dimension(nfiles) :: type_ecri
    325         INTEGER, dimension(iim*jjmp1) ::  ndex2d
    326         INTEGER, dimension(iim*jjmp1*klev) :: ndex3d
    327         REAL, dimension(klon) :: rlon, rlat
    328         integer               :: imin_ins, imax_ins
    329         integer               :: jmin_ins, jmax_ins
    330         REAL, dimension(iim,jjmp1) :: zx_lon, zx_lat
    331 
    332         name_files(1) = 'histmth'
    333         name_files(2) = 'histday'
    334         name_files(3) = 'histhf'
    335         name_files(4) = 'histins'
    336 
    337         type_ecri(1) = 'ave(X)'
    338         type_ecri(2) = 'ave(X)'
    339         type_ecri(3) = 'ave(X)'
    340         type_ecri(4) = 'inst(X)'
    341 
    342         clef_files(1) = ok_mensuel
    343         clef_files(2) = ok_journe
    344         clef_files(3) = ok_hf
    345         clef_files(4) = ok_instan
    346 
    347         lev_files(1) = lev_histmth
    348         lev_files(2) = lev_histday
    349         lev_files(3) = lev_histhf
    350         lev_files(4) = 1
    351 
    352         ecrit_files(1) = ecrit_mth
    353         ecrit_files(2) = ecrit_day
    354         ecrit_files(3) = ecrit_hf
    355         ecrit_files(4) = ecrit_ins
     294 
     295  SUBROUTINE phys_output_open(jjmp1,nqmax,nlevSTD,clevSTD,nbteta, &
     296                              ctetaSTD,dtime, presnivs, ok_veget, &
     297                              ocean, iflag_pbl,ok_mensuel,ok_journe, &
     298                              ok_hf,ok_instan, nid_fil)
     299
     300  USE iophy
     301  USE dimphy
     302  USE ioipsl
     303  USE mod_phys_lmdz_para
     304
     305  IMPLICIT NONE
     306  include "dimensions.h"
     307  include "temps.h"
     308  include "indicesol.h"
     309  include "advtrac.h"
     310  include "clesphys.h"
     311
     312  integer                               :: jjmp1, nqmax
     313  integer                               :: nbteta, nlevSTD, radpas
     314  logical                               :: ok_mensuel, ok_journe, ok_hf, ok_instan
     315  real                                  :: dtime
     316  integer                               :: idayref
     317  real                                  :: zjulian
     318  real, dimension(klev)                 :: presnivs
     319  character(len=4), dimension(nlevSTD)  :: clevSTD
     320  integer                               :: nsrf, k, iq, iiq, iff, i, j
     321  logical                               :: ok_veget
     322  integer                               :: iflag_pbl
     323  CHARACTER(len=3)                      :: bb2
     324  CHARACTER(len=2)                      :: bb3
     325  character(len=6)                      :: ocean
     326  CHARACTER(len=3)                      :: ctetaSTD(nbteta)
     327  integer, dimension(nfiles)            :: nid_fil
     328  real, dimension(nfiles)               :: ecrit_files
     329  CHARACTER(len=20), dimension(nfiles)  :: name_files
     330  INTEGER, dimension(iim*jjmp1)         ::  ndex2d
     331  INTEGER, dimension(iim*jjmp1*klev)    :: ndex3d
     332  integer                               :: imin_ins, imax_ins
     333  integer                               :: jmin_ins, jmax_ins
     334
     335   name_files(1) = 'histmth'
     336   name_files(2) = 'histday'
     337   name_files(3) = 'histhf'
     338   name_files(4) = 'histins'
     339
     340   type_ecri(1) = 'ave(X)'
     341   type_ecri(2) = 'ave(X)'
     342   type_ecri(3) = 'ave(X)'
     343   type_ecri(4) = 'inst(X)'
     344
     345   clef_files(1) = ok_mensuel
     346   clef_files(2) = ok_journe
     347   clef_files(3) = ok_hf
     348   clef_files(4) = ok_instan
     349
     350   lev_files(1) = lev_histmth
     351   lev_files(2) = lev_histday
     352   lev_files(3) = lev_histhf
     353   lev_files(4) = 1
     354
     355   ecrit_files(1) = ecrit_mth
     356   ecrit_files(2) = ecrit_day
     357   ecrit_files(3) = ecrit_hf
     358   ecrit_files(4) = ecrit_ins
    356359 
    357360!!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    360363!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    361364
    362       DO iff=1,nfiles
    363  
    364        IF (clef_files(iff)) THEN
     365 DO iff=1,nfiles
     366
     367    IF (clef_files(iff)) THEN
    365368     
    366          zstophy = dtime         ! Frequence ou l on moyenne
    367          zout = ecrit_files(iff) ! Frequence ou l on ecrit
    368 
    369           idayref = day_ref
    370 
    371           CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    372 
    373 !         print*,'Dans hist_def, name_files(iff) ',name_files(iff)
     369      zstophym(iff) = dtime         ! Frequence ou l on moyenne
     370      zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit
     371
     372      idayref = day_ref
     373      CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    374374
    375375!!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !!
    376376!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    377          if (ok_reglim(iff)) then
    378 
    379 ! a reecrire plus simplement en appelant io_lat et io_lon de iophy
    380 
    381            CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon,zx_lon)
    382            CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlat,zx_lat)
    383 
    384            DO i = 1, iim
    385               zx_lon(i,1) = rlon(i+1)
    386               zx_lon(i,jjmp1) = rlon(i+1)
    387            ENDDO
    388 
    389                
    390            imin_ins=1
    391            imax_ins=iim
    392            jmin_ins=1
    393            jmax_ins=jjmp1
    394 
    395            do i=1,iim-1
    396             if (zx_lon(i,1).lt.lonmin_reg(iff)) imin_ins=i
    397             if (zx_lon(i,1).le.lonmax_reg(iff)) imax_ins=i+1
    398            enddo
    399 
    400            do j=1,jjmp1-1
    401             if (zx_lat(1,j).ge.latmin_reg(iff)) jmax_ins=j
    402             if (zx_lat(1,j).gt.latmax_reg(iff)) jmin_ins=j
    403            enddo
    404 
     377     if (ok_reglim(iff)) then
     378
     379        imin_ins=1
     380        imax_ins=iim
     381        jmin_ins=1
     382        jmax_ins=jjmp1
     383
     384        do i=1,iim-1
     385           print*,'io_lon(i)=',io_lon(i)
     386           if (io_lon(i).le.lonmin_reg(iff)) imin_ins=i
     387           if (io_lon(i).le.lonmax_reg(iff)) imax_ins=i
     388        enddo
     389
     390        do j=1,jjmp1-1
     391            print*,'io_lat(j)=',io_lat(j)
     392            if (io_lat(j).ge.latmin_reg(iff)) jmax_ins=j
     393            if (io_lat(j).ge.latmax_reg(iff)) jmin_ins=j
     394        enddo
    405395
    406396         print*,'On stoke le fichier hist sur, ', &
    407      &   imin_ins,imax_ins,jmin_ins,jmax_ins
     397         imin_ins,imax_ins,jmin_ins,jmax_ins
    408398         print*,'On stoke le fichier instantanne sur, ', &
    409      &   zx_lon(imin_ins,1),zx_lon(imax_ins,1), &
    410      &   zx_lat(1,jmin_ins),zx_lat(1,jmax_ins)
    411 
    412      
    413          CALL histbeg(name_files(iff),iim,zx_lon(:,1), &
    414      &                jjmp1,zx_lat(1,:), &
    415      &            imin_ins,imax_ins-imin_ins+1, &
    416      &           jmin_ins,jmax_ins-jmin_ins+1, &
    417      &           itau_phy, zjulian, dtime, &
    418      &          nhori, nid_fil(iff))
    419 
     399         io_lon(imin_ins),io_lon(imax_ins), &
     400         io_lat(jmin_ins),io_lat(jmax_ins)
     401
     402 CALL histbeg(name_files(iff),iim,io_lon,jjmp1,io_lat, &
     403              imin_ins,imax_ins-imin_ins+1, &
     404              jmin_ins,jmax_ins-jmin_ins+1, &
     405              itau_phy,zjulian,dtime,nhorim(iff),nid_fil(iff))
    420406!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    421407       else
    422 
    423           CALL histbeg_phy(name_files(iff),itau_phy, &
    424      &                     zjulian, dtime, &
    425      &                     nhori, nid_fil(iff))
     408 CALL histbeg_phy(name_files(iff),itau_phy,zjulian,dtime,nhorim(iff),nid_fil(iff))
    426409       endif
    427410 
    428           nid_files(iff)=nid_fil(iff)
    429 !         print*,'Dans hist_def, nid_files(iff) ',nid_files(iff)
    430 
    431          CALL histvert(nid_files(iff),"presnivs", &
    432      &                 "Vertical levels","mb", &
    433      &                 klev, presnivs/100., nvert)
     411      nid_files(iff)=nid_fil(iff)
     412
     413 CALL histvert(nid_files(iff),"presnivs","Vertical levels","mb",klev, presnivs/100., nvertm(iff))
    434414
    435415!!!!!!!!!!!!! Traitement des champs 3D pour histhf !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    438418!          CALL histbeg_phy("histhf3d",itau_phy, &
    439419!     &                     zjulian, dtime, &
    440 !     &                     nhori, nid_hf3d)
     420!     &                     nhorim, nid_hf3d)
    441421
    442422!         CALL histvert(nid_hf3d,"presnivs", &
    443423!     &                 "Vertical levels","mb", &
    444 !     &                 klev, presnivs/100., nvert)
     424!     &                 klev, presnivs/100., nvertm)
    445425!          ENDIF
    446426
    447 
    448427!!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    449        IF (flag_phis(iff)<=lev_files(iff)) THEN
    450         CALL  histdef(nid_files(iff),"phis", &
    451      &                 "Surface geop. height", "m2/s2", &
    452      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    453      &                 "once",  zstophy,zout)
    454        ENDIF
    455 
    456        IF (flag_aire(iff)<=lev_files(iff)) THEN
    457          CALL histdef(nid_files(iff), "aire", "Grid area", "-", &
    458      &               iim,jj_nb,nhori, 1,1,1, -99, 32, &
    459      &              "once",  zstophy,zout)
    460        ENDIF
    461 
    462 
    463        IF (flag_contfracATM(iff)<=lev_files(iff)) THEN
    464          CALL histdef(nid_files(iff), &
    465      &               "contfracATM","% sfce ter+lic ", &
    466      &               "-", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    467      &                "once", zstophy,zout)
    468       ENDIF
    469 
    470        IF (flag_contfracOR(iff)<=lev_files(iff)) THEN
    471          CALL histdef(nid_files(iff), &
    472      &                "contfracOR","% sfce terre OR", &
    473      &                 "-", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    474      &                "once", zstophy,zout)
    475       ENDIF
    476 
    477        IF (flag_aireTER(iff)<=lev_files(iff)) THEN
    478          CALL histdef(nid_files(iff), &
    479      &                "aireTER","Grid area CONT","-", &
    480      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    481      &                "once", zstophy,zout)
    482       ENDIF
     428 CALL histdef2d(iff,flag_phis,"phis","Surface geop.height","m2/s2")
     429 CALL histdef2d(iff,flag_aire,"aire","Grid area","-")
     430 CALL histdef2d(iff,flag_contfracATM,"contfracATM","% sfce ter+lic","-")
     431 CALL histdef2d(iff,flag_contfracOR,"contfracOR","% sfce terre OR","-" )
     432 CALL histdef2d(iff,flag_aireTER,"aireTER","Grid area CONT","-" )
    483433
    484434!!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    485 
    486        IF (flag_flat(iff)<=lev_files(iff)) THEN
    487         CALL histdef(nid_files(iff), "flat", "Latent heat flux", &
    488      &                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    489      &                type_ecri(iff), zstophy,zout)
    490       ENDIF
    491 
    492        IF (flag_slp(iff)<=lev_files(iff)) THEN
    493          CALL histdef(nid_files(iff), "slp", &
    494      &               "Sea Level Pressure", "Pa", &
    495      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    496      &                type_ecri(iff), zstophy,zout)
    497       ENDIF
    498 
    499        IF (flag_tsol(iff)<=lev_files(iff)) THEN
    500         CALL histdef(nid_files(iff), "tsol", &
    501      &                "Surface Temperature", "K", &
    502      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    503      &                type_ecri(iff), zstophy,zout)
    504        ENDIF
    505 
    506        IF (flag_t2m(iff)<=lev_files(iff)) THEN
    507          CALL histdef(nid_files(iff), "t2m", &
    508      &                "Temperature 2m", "K", &
    509      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    510      &                type_ecri(iff), zstophy,zout)
    511       ENDIF
    512 
    513        IF (flag_t2m_min(iff)<=lev_files(iff)) THEN
    514          CALL histdef(nid_files(iff), "t2m_min", &
    515      &                "Temp 2m min", "K", &
    516      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    517      &                "t_min(X)", zstophy,zout)
    518       ENDIF
    519 
    520        IF (flag_t2m_max(iff)<=lev_files(iff)) THEN
    521          CALL histdef(nid_files(iff), "t2m_max", &
    522      &                "Temp 2m max", "K", &
    523      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    524      &                "t_max(X)", zstophy,zout)
    525       ENDIF
    526 
    527        IF (flag_wind10m(iff)<=lev_files(iff)) THEN
    528        CALL histdef(nid_files(iff), "wind10m", &
    529      &                "10-m wind speed","m/s", &
    530      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    531      &                type_ecri(iff), zstophy,zout)
    532       ENDIF
    533 
    534        IF (flag_wind10max(iff)<=lev_files(iff)) THEN
    535          CALL histdef(nid_files(iff), "wind10max", &
    536      &                "10-m wind speed max.", "m/s", &
    537      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    538      &                "t_max(X)", zstophy,zout)
    539        ENDIF
    540 
    541        IF (flag_sicf(iff)<=lev_files(iff)) THEN
    542          CALL histdef(nid_files(iff), "sicf", &
    543      &                "Sea-ice fraction", "-", &
    544      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    545      &                type_ecri(iff), zstophy,zout)
    546       ENDIF
    547 
    548        IF (flag_q2m(iff)<=lev_files(iff)) THEN
    549          CALL histdef(nid_files(iff), "q2m", &
    550      &                "Specific humidity 2m", &
    551      &                "kg/kg", iim,jj_nb,nhori, &
    552      &                1,1,1, -99, 32, &
    553      &                type_ecri(iff), zstophy,zout)
    554        ENDIF
    555 
    556        IF (flag_u10m(iff)<=lev_files(iff)) THEN
    557         CALL histdef(nid_files(iff), "u10m", &
    558      &                "Vent zonal 10m", "m/s", &
    559      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    560      &                type_ecri(iff), zstophy,zout)
    561       ENDIF
    562 
    563        IF (flag_v10m(iff)<=lev_files(iff)) THEN
    564         CALL histdef(nid_files(iff), "v10m", &
    565      &                "Vent meridien 10m", &
    566      &                "m/s", iim,jj_nb,nhori, &
    567      &                1,1,1, -99, 32, &
    568      &                type_ecri(iff), zstophy,zout)
    569       ENDIF
    570 
    571        IF (flag_psol(iff)<=lev_files(iff)) THEN
    572          CALL histdef(nid_files(iff),"psol", &
    573      &                "Surface Pressure","Pa", &
    574      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    575      &                type_ecri(iff), zstophy,zout)
    576       ENDIF
    577 
    578        IF (flag_qsurf(iff)<=lev_files(iff)) THEN
    579          CALL histdef(nid_files(iff),"qsurf", &
    580      &                "Surface Air humidity", &
    581      &             "kg/kg",iim,jj_nb,nhori, 1,1,1, -99, 32, &
    582      &                type_ecri(iff), zstophy,zout)
    583       ENDIF
    584 
    585       if (.not. ok_veget) then
    586        IF (flag_qsol(iff)<=lev_files(iff)) THEN
    587          CALL histdef(nid_files(iff), "qsol", &
    588      &                "Soil watter content", &
    589      &                "mm", iim,jj_nb,nhori, &
    590      &                 1,1,1, -99, 32, &
    591      &                type_ecri(iff), zstophy,zout)
    592       ENDIF
    593       endif
    594 
    595        IF (flag_ndayrain(iff)<=lev_files(iff)) THEN
    596          CALL histdef(nid_files(iff), "ndayrain", &
    597      &            "Number of day with rain (liq+sol)", "-", &
    598      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    599      &                "inst(X)", zout,zout)
    600       ENDIF
    601 
    602        IF (flag_precip(iff)<=lev_files(iff)) THEN
    603         CALL histdef(nid_files(iff),"precip", &
    604      &         "Precip Totale liq+sol","kg/(s*m2)", &
    605      &             iim,jj_nb,nhori, 1,1,1, -99, 32, &
    606      &               type_ecri(iff), zstophy,zout)
    607       ENDIF
    608 
    609        IF (flag_plul(iff)<=lev_files(iff)) THEN
    610          CALL histdef(nid_files(iff), "plul", &
    611      &             "Large-scale Precip.","kg/(s*m2)", &
    612      &               iim,jj_nb,nhori, 1,1,1, -99, 32, &
    613      &                  type_ecri(iff), zstophy,zout)
    614       ENDIF
    615 
    616        IF (flag_pluc(iff)<=lev_files(iff)) THEN
    617          CALL histdef(nid_files(iff), "pluc", &
    618      &              "Convective Precip.", "kg/(s*m2)", &
    619      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    620      &                type_ecri(iff), zstophy,zout)
    621       ENDIF
    622 
    623        IF (flag_snow(iff)<=lev_files(iff)) THEN
    624        CALL histdef(nid_files(iff),"snow", &
    625      &               "Snow fall","kg/(s*m2)", &
    626      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    627      &                type_ecri(iff), zstophy,zout)
    628       ENDIF
    629 
    630        IF (flag_evap(iff)<=lev_files(iff)) THEN
    631         CALL histdef(nid_files(iff),"evap", &
    632      &                "Evaporat", "kg/(s*m2)", &
    633      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    634      &                type_ecri(iff), zstophy,zout)
    635       ENDIF
    636 
    637        IF (flag_tops(iff)<=lev_files(iff)) THEN
    638        CALL histdef(nid_files(iff),"tops", &
    639      &                "Solar rad. at TOA","W/m2", &
    640      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    641      &                type_ecri(iff), zstophy,zout)
    642       ENDIF
    643 
    644        IF (flag_tops0(iff)<=lev_files(iff)) THEN
    645        CALL histdef(nid_files(iff),"tops0", &
    646      &               "CS Solar rad. at TOA", &
    647      &          "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    648      &                type_ecri(iff), zstophy,zout)
    649       ENDIF
    650 
    651        IF (flag_topl(iff)<=lev_files(iff)) THEN
    652          CALL histdef(nid_files(iff), "topl", &
    653      &               "IR rad. at TOA", &
    654      &          "W/m2",iim,jj_nb,nhori, 1,1,1, -99, 32, &
    655      &                type_ecri(iff), zstophy,zout)
    656       ENDIF
    657 
    658        IF (flag_topl0(iff)<=lev_files(iff)) THEN
    659         CALL histdef(nid_files(iff),"topl0", &
    660      &                "IR rad. at TOA","W/m2", &
    661      &                 iim,jj_nb,nhori, 1,1,1, -99, 32, &
    662      &                type_ecri(iff), zstophy,zout)
    663       ENDIF
    664 
    665        IF (flag_SWupTOA(iff)<=lev_files(iff)) THEN
    666         CALL histdef(nid_files(iff),"SWupTOA", &
    667      &                "SWup at TOA","W/m2", &
    668      &                iim,jj_nb,nhori, 1,1,1,-99, &
    669      &                32, type_ecri(iff), zstophy,zout)
    670       ENDIF
    671 
    672        IF (flag_SWupTOAclr(iff)<=lev_files(iff)) THEN
    673          CALL histdef(nid_files(iff), "SWupTOAclr", &
    674      &                "SWup clear sky at TOA","W/m2", &
    675      &                iim,jj_nb,nhori, 1,1,1,-99, &
    676      &                32, type_ecri(iff), zstophy,zout)
    677       ENDIF
    678 
    679        IF (flag_SWdnTOA(iff)<=lev_files(iff)) THEN
    680         CALL histdef(nid_files(iff),"SWdnTOA", &
    681      &                "SWdn at TOA","W/m2", &
    682      &                iim,jj_nb,nhori, 1,1,1,-99, &
    683      &                32, type_ecri(iff), zstophy,zout)
    684       ENDIF
    685 
    686        IF (flag_SWdnTOAclr(iff)<=lev_files(iff)) THEN
    687          CALL histdef(nid_files(iff), "SWdnTOAclr", &
    688      &                "SWdn clear sky at TOA","W/m2", &
    689      &                iim,jj_nb,nhori, 1,1,1,-99, &
    690      &                32, type_ecri(iff), zstophy,zout)
    691       ENDIF
    692 
    693        IF (flag_SWup200(iff)<=lev_files(iff)) THEN
    694         CALL histdef(nid_files(iff),"SWup200", &
    695      &                "SWup at 200mb","W/m2", &
    696      &                iim,jj_nb,nhori, 1,1,1,-99, &
    697      &                32, type_ecri(iff), zstophy,zout)
    698       ENDIF
    699 
    700        IF (flag_SWup200clr(iff)<=lev_files(iff)) THEN
    701          CALL histdef(nid_files(iff), "SWup200clr", &
    702      &              "SWup clear sky at 200mb","W/m2", &
    703      &                iim,jj_nb,nhori, 1,1,1,-99, &
    704      &                32, type_ecri(iff), zstophy,zout)
    705       ENDIF
    706 
    707        IF (flag_SWdn200(iff)<=lev_files(iff)) THEN
    708         CALL histdef(nid_files(iff),"SWdn200", &
    709      &                "SWdn at 200mb","W/m2", &
    710      &                iim,jj_nb,nhori, 1,1,1,-99, &
    711      &                32, type_ecri(iff), zstophy,zout)
    712       ENDIF
    713 
    714        IF (flag_SWdn200clr(iff)<=lev_files(iff)) THEN
    715          CALL histdef(nid_files(iff), "SWdn200clr", &
    716      &                "SWdn clear sky at 200mb","W/m2", &
    717      &                iim,jj_nb,nhori, 1,1,1,-99, &
    718      &                32, type_ecri(iff), zstophy,zout)
    719       ENDIF
    720 
    721        IF (flag_LWup200(iff)<=lev_files(iff)) THEN
    722         CALL histdef(nid_files(iff),"LWup200", &
    723      &                "LWup at 200mb","W/m2", &
    724      &                iim,jj_nb,nhori, 1,1,1,-99, &
    725      &                32, type_ecri(iff), zstophy,zout)
    726       ENDIF
    727 
    728        IF (flag_LWup200clr(iff)<=lev_files(iff)) THEN
    729          CALL histdef(nid_files(iff), "LWup200clr", &
    730      &                "LWup clear sky at 200mb","W/m2", &
    731      &                iim,jj_nb,nhori, 1,1,1,-99, &
    732      &                32, type_ecri(iff), zstophy,zout)
    733       ENDIF
    734 
    735        IF (flag_LWdn200(iff)<=lev_files(iff)) THEN
    736         CALL histdef(nid_files(iff),"LWdn200", &
    737      &                "LWdn at 200mb","W/m2", &
    738      &                iim,jj_nb,nhori, 1,1,1,-99, &
    739      &                32, type_ecri(iff), zstophy,zout)
    740       ENDIF
    741 
    742        IF (flag_LWdn200clr(iff)<=lev_files(iff)) THEN
    743          CALL histdef(nid_files(iff), "LWdn200clr", &
    744      &                "LWdn clear sky at 200mb","W/m2", &
    745      &                iim,jj_nb,nhori, 1,1,1,-99, &
    746      &                32, type_ecri(iff), zstophy,zout)
    747       ENDIF
    748 
    749        IF (flag_sols(iff)<=lev_files(iff)) THEN
    750          CALL histdef(nid_files(iff), "sols", &
    751      &               "Solar rad. at surf.", &
    752      &           "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    753      &                type_ecri(iff), zstophy,zout)
    754       ENDIF
    755 
    756        IF (flag_sols0(iff)<=lev_files(iff)) THEN
    757          CALL histdef(nid_files(iff), "sols0", &
    758      &                "Solar rad. at surf.", &
    759      &            "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    760      &                type_ecri(iff), zstophy,zout)
    761       ENDIF
    762 
    763        IF (flag_soll(iff)<=lev_files(iff)) THEN
    764         CALL histdef(nid_files(iff),"soll", &
    765      &               "IR rad. at surface","W/m2", &
    766      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    767      &                type_ecri(iff), zstophy,zout)
    768       ENDIF
    769 
    770        IF (flag_radsol(iff)<=lev_files(iff)) THEN
    771         CALL histdef(nid_files(iff),"radsol", &
    772      &               "Rayonnement au sol", &
    773      &          "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    774      &                type_ecri(iff), zstophy,zout)
    775       ENDIF
    776 
    777        IF (flag_soll0(iff)<=lev_files(iff)) THEN
    778          CALL histdef(nid_files(iff), "soll0", &
    779      &                "IR rad. at surface", &
    780      &             "W/m2",iim,jj_nb,nhori, 1,1,1, -99, 32, &
    781      &                type_ecri(iff), zstophy,zout)
    782       ENDIF
    783 
    784        IF (flag_SWupSFC(iff)<=lev_files(iff)) THEN
    785          CALL histdef(nid_files(iff), "SWupSFC", &
    786      &               "SWup at surface", &
    787      &                "W/m2",iim,jj_nb,nhori, 1,1,1,-99, &
    788      &                32, type_ecri(iff), zstophy,zout)
    789       ENDIF
    790 
    791        IF (flag_SWupSFCclr(iff)<=lev_files(iff)) THEN
    792          CALL histdef(nid_files(iff), "SWupSFCclr", &
    793      &                "SWup clear sky at surface","W/m2", &
    794      &               iim,jj_nb,nhori, 1,1,1,-99, &
    795      &                32, type_ecri(iff), zstophy,zout)
    796       ENDIF
    797 
    798        IF (flag_SWdnSFC(iff)<=lev_files(iff)) THEN
    799         CALL histdef(nid_files(iff),"SWdnSFC", &
    800      &               "SWdn at surface","W/m2", &
    801      &                iim,jj_nb,nhori, 1,1,1,-99, &
    802      &                32, type_ecri(iff), zstophy,zout)
    803       ENDIF
    804 
    805        IF (flag_SWdnSFCclr(iff)<=lev_files(iff)) THEN
    806          CALL histdef(nid_files(iff), "SWdnSFCclr", &
    807      &                "SWdn clear sky at surface","W/m2", &
    808      &               iim,jj_nb,nhori, 1,1,1,-99, &
    809      &                32, type_ecri(iff), zstophy,zout)
    810       ENDIF
    811 
    812        IF (flag_LWupSFC(iff)<=lev_files(iff)) THEN
    813         CALL histdef(nid_files(iff),"LWupSFC", &
    814      &               "Upwd. IR rad. at surface", "W/m2", &
    815      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    816      &                type_ecri(iff), zstophy,zout)
    817       ENDIF
    818 
    819        IF (flag_LWdnSFC(iff)<=lev_files(iff)) THEN
    820         CALL histdef(nid_files(iff),"LWdnSFC", &
    821      &                "Down. IR rad. at surface", &
    822      &            "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    823      &                type_ecri(iff), zstophy,zout)
    824       ENDIF
    825 
    826        IF (flag_LWupSFCclr(iff)<=lev_files(iff)) THEN
    827          CALL histdef(nid_files(iff),"LWupSFCclr", &
    828      &                "CS Upwd. IR rad. at surface", &
    829      &            "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    830      &                type_ecri(iff), zstophy,zout)
    831       ENDIF
    832 
    833        IF (flag_LWdnSFCclr(iff)<=lev_files(iff)) THEN
    834          CALL histdef(nid_files(iff),"LWdnSFCclr", &
    835      &                "Down. CS IR rad. at surface", &
    836      &                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    837      &                type_ecri(iff), zstophy,zout)
    838       ENDIF
    839 
    840        IF (flag_bils(iff)<=lev_files(iff)) THEN
    841         CALL histdef(nid_files(iff), &
    842      &                "bils","Surf. total heat flux","W/m2", &
    843      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    844      &                type_ecri(iff), zstophy,zout)
    845       ENDIF
    846 
    847        IF (flag_sens(iff)<=lev_files(iff)) THEN
    848          CALL histdef(nid_files(iff),"sens", &
    849      &                "Sensible heat flux","W/m2", &
    850      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    851      &                type_ecri(iff), zstophy,zout)
    852       ENDIF
    853 
    854        IF (flag_fder(iff)<=lev_files(iff)) THEN
    855          CALL histdef(nid_files(iff),"fder", &
    856      &                "Heat flux derivation","W/m2", &
    857      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    858      &                type_ecri(iff), zstophy,zout)
    859       ENDIF
    860 
    861        IF (flag_ffonte(iff)<=lev_files(iff)) THEN
    862        CALL histdef(nid_files(iff),"ffonte", &
    863      &                "Thermal flux for snow melting", &
    864      &                "W/m2",iim,jj_nb,nhori, 1,1,1, -99, 32, &
    865      &                type_ecri(iff), zstophy,zout)
    866       ENDIF
    867 
    868        IF (flag_fqcalving(iff)<=lev_files(iff)) THEN
    869         CALL histdef(nid_files(iff), "fqcalving", &
    870      &                 "Ice Calving", &
    871      &            "kg/m2/s",iim,jj_nb,nhori, 1,1,1, -99, 32, &
    872      &                type_ecri(iff), zstophy,zout)
    873       ENDIF
    874 
    875        IF (flag_fqfonte(iff)<=lev_files(iff)) THEN
    876          CALL histdef(nid_files(iff), "fqfonte", &
    877      &                "Land ice melt", &
    878      &           "kg/m2/s",iim,jj_nb,nhori, 1,1,1, -99, 32, &
    879      &                type_ecri(iff), zstophy,zout)
    880       ENDIF
    881 
    882          DO nsrf = 1, nbsrf
    883             IF (flag_pourc_sol(iff)<=lev_files(iff)) THEN
    884          call histdef(nid_files(iff), "pourc_"//clnsurf(nsrf), &
    885      &                "% "//clnsurf(nsrf), "%", &
    886      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    887      &         type_ecri(iff), zstophy,zout)
    888             ENDIF
    889 
    890             IF (flag_fract_sol(iff)<=lev_files(iff)) THEN
    891          call histdef(nid_files(iff), "fract_"//clnsurf(nsrf), &
    892      &         "Fraction "//clnsurf(nsrf), "1", &
    893      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    894      &         type_ecri(iff), zstophy,zout)
    895             ENDIF
    896 
    897            IF (flag_taux_sol(iff)<=lev_files(iff)) THEN
    898              call histdef(nid_files(iff), "taux_"//clnsurf(nsrf), &
    899      &         "Zonal wind stress"//clnsurf(nsrf), "Pa", &
    900      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    901      &         type_ecri(iff), zstophy,zout)
    902            ENDIF
    903 
    904            IF (flag_tauy_sol(iff)<=lev_files(iff)) THEN           
    905              call histdef(nid_files(iff), "tauy_"//clnsurf(nsrf), &
    906      &         "Meridional wind stress "//clnsurf(nsrf), "Pa", &
    907      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    908      &         type_ecri(iff), zstophy,zout)
    909            ENDIF
    910 
    911           IF (flag_tsol_sol(iff)<=lev_files(iff)) THEN
    912            call histdef(nid_files(iff), "tsol_"//clnsurf(nsrf), &
    913      &         "Temperature "//clnsurf(nsrf), "K", &
    914      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    915      &         type_ecri(iff), zstophy,zout)
    916           ENDIF
    917 
    918           IF (flag_u10m_sol(iff)<=lev_files(iff)) THEN
    919            call histdef(nid_files(iff), "u10m_"//clnsurf(nsrf), &
    920      &         "Vent Zonal 10m "//clnsurf(nsrf), "m/s", &
    921      &          iim,jj_nb,nhori, 1,1,1, -99, 32, &
    922      &          type_ecri(iff), zstophy,zout)
    923           ENDIF
    924 
    925           IF (flag_v10m_sol(iff)<=lev_files(iff)) THEN
    926            call histdef(nid_files(iff), "v10m_"//clnsurf(nsrf), &
    927      &         "Vent meredien 10m "//clnsurf(nsrf), "m/s", &
    928      &          iim,jj_nb,nhori, 1,1,1, -99, 32, &
    929      &          type_ecri(iff), zstophy,zout)
    930           ENDIF
    931  
    932           IF (flag_t2m_sol(iff)<=lev_files(iff)) THEN
    933             call histdef(nid_files(iff), "t2m_"//clnsurf(nsrf), &
    934      &            "Temp 2m "//clnsurf(nsrf), "K", &
    935      &            iim,jj_nb,nhori, 1,1,1, -99, 32, &
    936      &            type_ecri(iff), zstophy,zout)
    937           ENDIF
    938 
    939           IF (flag_sens_sol(iff)<=lev_files(iff)) THEN
    940            call histdef(nid_files(iff), "sens_"//clnsurf(nsrf), &
    941      &         "Sensible heat flux "//clnsurf(nsrf), "W/m2", &
    942      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    943      &         type_ecri(iff), zstophy,zout)
    944           ENDIF
    945 
    946           IF (flag_lat_sol(iff)<=lev_files(iff)) THEN
    947            call histdef(nid_files(iff), "lat_"//clnsurf(nsrf), &
    948      &         "Latent heat flux "//clnsurf(nsrf), "W/m2", &
    949      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    950      &         type_ecri(iff), zstophy,zout)
    951           ENDIF
    952 
    953           IF (flag_flw_sol(iff)<=lev_files(iff)) THEN
    954            call histdef(nid_files(iff), "flw_"//clnsurf(nsrf), &
    955      &         "LW "//clnsurf(nsrf), "W/m2", &
    956      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    957      &         type_ecri(iff), zstophy,zout)
    958          ENDIF
    959 
    960           IF (flag_fsw_sol(iff)<=lev_files(iff)) THEN
    961            call histdef(nid_files(iff), "fsw_"//clnsurf(nsrf), &
    962      &         "SW "//clnsurf(nsrf), "W/m2", &
    963      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    964      &         type_ecri(iff), zstophy,zout)
    965          ENDIF
    966 
    967           IF (flag_wbils_sol(iff)<=lev_files(iff)) THEN
    968            call histdef(nid_files(iff), "wbils_"//clnsurf(nsrf), &
    969      &         "Bilan sol "//clnsurf(nsrf), "W/m2", &
    970      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    971      &         type_ecri(iff), zstophy,zout)
    972          ENDIF
    973 
    974           IF (flag_wbilo_sol(iff)<=lev_files(iff)) THEN
    975            call histdef(nid_files(iff), "wbilo_"//clnsurf(nsrf), &
    976      &         "Bilan eau "//clnsurf(nsrf), "kg/(m2*s)", &
    977      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    978      &         type_ecri(iff), zstophy,zout)
    979          ENDIF
    980 
    981          if (iflag_pbl>1 .and. lev_files(iff).gt.10 ) then
    982           IF (flag_tke_sol(iff)<=lev_files(iff)) THEN
    983            call histdef(nid_files(iff), "tke_"//clnsurf(nsrf), &
    984      &         "Max Turb. Kinetic Energy "//clnsurf(nsrf), "-", &
    985      &         iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    986      &         type_ecri(iff), zstophy,zout)
    987           ENDIF
    988 
    989           IF (flag_tke_max_sol(iff)<=lev_files(iff)) THEN
    990            call histdef(nid_files(iff), "tke_max_"//clnsurf(nsrf), &
    991      &         "Max Turb. Kinetic Energy "//clnsurf(nsrf), "-", &
    992      &         iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    993      &         "t_max(X)", zstophy,zout)
    994           ENDIF
    995          endif
    996 
    997         END DO
    998 
    999         IF (flag_cdrm(iff)<=lev_files(iff)) THEN
    1000          CALL histdef(nid_files(iff), "cdrm", &
    1001      &                "Momentum drag coef.", "-", &
    1002      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1003      &                type_ecri(iff), zstophy,zout)
    1004         ENDIF
    1005 
    1006         IF (flag_cdrh(iff)<=lev_files(iff)) THEN
    1007          CALL histdef(nid_files(iff), "cdrh", &
    1008      &                "Heat drag coef.", "-", &
    1009      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1010      &                type_ecri(iff), zstophy,zout)
    1011         ENDIF
    1012 
    1013         IF (flag_cldl(iff)<=lev_files(iff)) THEN
    1014          CALL histdef(nid_files(iff), "cldl", &
    1015      &                "Low-level cloudiness", "-", &
    1016      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1017      &                type_ecri(iff), zstophy,zout)
    1018         ENDIF
    1019 
    1020         IF (flag_cldm(iff)<=lev_files(iff)) THEN
    1021          CALL histdef(nid_files(iff), "cldm", &
    1022      &                "Mid-level cloudiness", "-", &
    1023      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1024      &                type_ecri(iff), zstophy,zout)
    1025         ENDIF
    1026 
    1027         IF (flag_cldh(iff)<=lev_files(iff)) THEN
    1028          CALL histdef(nid_files(iff), "cldh", &
    1029      &                "High-level cloudiness", "-", &
    1030      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1031      &                type_ecri(iff), zstophy,zout)
    1032         ENDIF
    1033 
    1034         IF (flag_cldt(iff)<=lev_files(iff)) THEN
    1035          CALL histdef(nid_files(iff), "cldt", &
    1036      &                "Total cloudiness", "%", &
    1037      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1038      &                type_ecri(iff), zstophy,zout)
    1039         ENDIF
    1040 
    1041         IF (flag_cldq(iff)<=lev_files(iff)) THEN
    1042          CALL histdef(nid_files(iff),"cldq", &
    1043      &                "Cloud liquid water path","kg/m2", &
    1044      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1045      &                type_ecri(iff), zstophy,zout)
    1046         ENDIF
    1047 
    1048         IF (flag_lwp(iff)<=lev_files(iff)) THEN
    1049          CALL histdef(nid_files(iff),"lwp", &
    1050      &                "Cloud water path","kg/m2", &
    1051      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1052      &                type_ecri(iff), zstophy,zout)
    1053         ENDIF
    1054 
    1055         IF (flag_iwp(iff)<=lev_files(iff)) THEN
    1056          CALL histdef(nid_files(iff),"iwp", &
    1057      &                "Cloud ice water path","kg/m2", &
    1058      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1059      &                type_ecri(iff), zstophy,zout)
    1060         ENDIF
    1061 
    1062         IF (flag_ue(iff)<=lev_files(iff)) THEN
    1063          CALL histdef(nid_files(iff), "ue", &
    1064      &                "Zonal energy transport", "-", &
    1065      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1066      &                type_ecri(iff), zstophy,zout)
    1067         ENDIF
    1068 
    1069         IF (flag_ve(iff)<=lev_files(iff)) THEN
    1070          CALL histdef(nid_files(iff), "ve", &
    1071      &                "Merid energy transport", "-", &
    1072      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1073      &                type_ecri(iff), zstophy,zout)
    1074         ENDIF
    1075 
    1076         IF (flag_uq(iff)<=lev_files(iff)) THEN
    1077          CALL histdef(nid_files(iff), "uq", &
    1078      &                "Zonal humidity transport", "-", &
    1079      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1080      &                type_ecri(iff), zstophy,zout)
    1081         ENDIF
    1082 
    1083         IF (flag_vq(iff)<=lev_files(iff)) THEN
    1084          CALL histdef(nid_files(iff), "vq", &
    1085      &                "Merid humidity transport", "-", &
    1086      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1087      &                type_ecri(iff), zstophy,zout)
    1088         ENDIF
    1089 
    1090       IF(iflag_con.GE.3) THEN ! sb
    1091         IF (flag_cape(iff)<=lev_files(iff)) THEN
    1092          CALL histdef(nid_files(iff), "cape", &
    1093      &                "Conv avlbl pot ener", "J/kg", &
    1094      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1095      &                type_ecri(iff), zstophy,zout)
    1096         ENDIF
    1097 
    1098         IF (flag_pbase(iff)<=lev_files(iff)) THEN
    1099          CALL histdef(nid_files(iff), "pbase", &
    1100      &                "Cld base pressure", "mb", &
    1101      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1102      &                type_ecri(iff), zstophy,zout)
    1103         ENDIF
    1104 
    1105         IF (flag_ptop(iff)<=lev_files(iff)) THEN
    1106          CALL histdef(nid_files(iff), "ptop", &
    1107      &                "Cld top pressure", "mb", &
    1108      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1109      &                type_ecri(iff), zstophy,zout)
    1110         ENDIF
    1111 
    1112         IF (flag_fbase(iff)<=lev_files(iff)) THEN
    1113          CALL histdef(nid_files(iff), "fbase", &
    1114      &                "Cld base mass flux", "kg/m2/s", &
    1115      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1116      &                type_ecri(iff), zstophy,zout)
    1117         ENDIF
    1118 
    1119         IF (flag_prw(iff)<=lev_files(iff)) THEN
    1120          CALL histdef(nid_files(iff), "prw", &
    1121      &                "Precipitable water", "kg/m2", &
    1122      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1123      &                type_ecri(iff), zstophy,zout)
    1124         ENDIF
    1125 
    1126       ENDIF !iflag_con .GE. 3
    1127 
    1128         IF (flag_s_pblh(iff)<=lev_files(iff)) THEN
    1129          CALL histdef(nid_files(iff), "s_pblh", &
    1130      &                "Boundary Layer Height", "m", &
    1131      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1132      &                type_ecri(iff), zstophy,zout)
    1133         ENDIF
    1134 
    1135         IF (flag_s_pblt(iff)<=lev_files(iff)) THEN
    1136          CALL histdef(nid_files(iff), "s_pblt", &
    1137      &               "t at Boundary Layer Height","K", &
    1138      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1139      &                type_ecri(iff), zstophy,zout)
    1140         ENDIF
    1141 
    1142         IF (flag_s_lclt(iff)<=lev_files(iff)) THEN
    1143          CALL histdef(nid_files(iff), "s_lcl", &
    1144      &                "Condensation level", "m", &
    1145      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1146      &                type_ecri(iff), zstophy,zout)
    1147         ENDIF
    1148 
    1149         IF (flag_s_capCL(iff)<=lev_files(iff)) THEN
    1150          CALL histdef(nid_files(iff), "s_capCL", &
    1151      &               "Conv avlbl pot enerfor ABL", "J/m2", &
    1152      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1153      &                type_ecri(iff), zstophy,zout)
    1154         ENDIF
    1155 
    1156         IF (flag_s_oliqCLL(iff)<=lev_files(iff)) THEN
    1157          CALL histdef(nid_files(iff), "s_oliqCL", &
    1158      &                "Liq Water in BL", "kg/m2", &
    1159      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1160      &                type_ecri(iff), zstophy,zout)
    1161         ENDIF
    1162 
    1163         IF (flag_s_cteiCL(iff)<=lev_files(iff)) THEN
    1164          CALL histdef(nid_files(iff), "s_cteiCL", &
    1165      &               "Instability criteria(ABL)", "K", &
    1166      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1167      &                type_ecri(iff), zstophy,zout)
    1168         ENDIF
    1169 
    1170         IF (flag_s_therm(iff)<=lev_files(iff)) THEN
    1171         CALL histdef(nid_files(iff), "s_therm", &
    1172      &                "Exces du thermique", "K", &
    1173      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1174      &                type_ecri(iff), zstophy,zout)
    1175         ENDIF
    1176 
    1177         IF (flag_s_trmb1(iff)<=lev_files(iff)) THEN
    1178          CALL histdef(nid_files(iff), "s_trmb1", &
    1179      &                "deep_cape(HBTM2)", "J/m2", &
    1180      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1181      &                type_ecri(iff), zstophy,zout)
    1182         ENDIF
    1183 
    1184         IF (flag_s_trmb2(iff)<=lev_files(iff)) THEN
    1185          CALL histdef(nid_files(iff), "s_trmb2", &
    1186      &                "inhibition (HBTM2)", "J/m2", &
    1187      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1188      &                type_ecri(iff), zstophy,zout)
    1189         ENDIF
    1190 
    1191         IF (flag_s_trmb3(iff)<=lev_files(iff)) THEN
    1192          CALL histdef(nid_files(iff), "s_trmb3", &
    1193      &                "Point Omega (HBTM2)", "m", &
    1194      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1195      &                type_ecri(iff), zstophy,zout)
    1196         ENDIF
     435 CALL histdef2d(iff,flag_flat,"flat","Latent heat flux","W/m2")
     436 CALL histdef2d(iff,flag_slp,"slp","Sea Level Pressure", "Pa" )
     437 CALL histdef2d(iff,flag_tsol,"tsol","Surface Temperature", "K")
     438 CALL histdef2d( iff,flag_t2m,"t2m","Temperature 2m", "K" )
     439 CALL histdef2d(iff,flag_t2m_min,"t2m_min","Temp 2m min", "K" )
     440 CALL histdef2d(iff,flag_t2m_max,"t2m_max", "Temp 2m max", "K" )
     441 CALL histdef2d(iff,flag_wind10m,"wind10m","10-m wind speed","m/s")
     442 CALL histdef2d(iff,flag_wind10max,"wind10max","10m wind speed max","m/s")
     443 CALL histdef2d(iff,flag_sicf,"sicf","Sea-ice fraction", "-" )
     444 CALL histdef2d(iff,flag_q2m,"q2m","Specific humidity 2m", "kg/kg")
     445 CALL histdef2d(iff,flag_u10m,"u10m","Vent zonal 10m", "m/s" )
     446 CALL histdef2d(iff,flag_v10m,"v10m","Vent meridien 10m", "m/s")
     447 CALL histdef2d(iff,flag_psol,"psol","Surface Pressure","Pa" )
     448 CALL histdef2d(iff,flag_qsurf,"qsurf","Surface Air humidity", "kg/kg")
     449
     450  if (.not. ok_veget) then
     451 CALL histdef2d(iff,flag_qsol,"qsol","Soil watter content", "mm" )
     452  endif
     453
     454 CALL histdef2d(iff,flag_ndayrain,"ndayrain","Number of dayrain(liq+sol)","-")
     455 CALL histdef2d(iff,flag_precip,"precip","Precip Totale liq+sol","kg/(s*m2)" )
     456 CALL histdef2d(iff,flag_plul,"plul","Large-scale Precip.","kg/(s*m2)")
     457 CALL histdef2d(iff,flag_pluc,"pluc","Convective Precip.","kg/(s*m2)")
     458 CALL histdef2d(iff,flag_snow,"snow","Snow fall","kg/(s*m2)" )
     459 CALL histdef2d(iff,flag_evap,"evap","Evaporat", "kg/(s*m2)" )
     460 CALL histdef2d(iff,flag_tops,"tops","Solar rad. at TOA","W/m2")
     461 CALL histdef2d(iff,flag_tops0,"tops0","CS Solar rad. at TOA", "W/m2")
     462 CALL histdef2d(iff,flag_topl,"topl","IR rad. at TOA", "W/m2" )
     463 CALL histdef2d(iff,flag_topl0,"topl0", "IR rad. at TOA","W/m2")
     464 CALL histdef2d(iff,flag_SWupTOA,"SWupTOA","SWup at TOA","W/m2")
     465 CALL histdef2d(iff,flag_SWupTOAclr,"SWupTOAclr","SWup clear sky at TOA","W/m2")
     466 CALL histdef2d(iff,flag_SWdnTOA, "SWdnTOA","SWdn at TOA","W/m2" )
     467 CALL histdef2d(iff,flag_SWdnTOAclr,"SWdnTOAclr","SWdn clear sky at TOA","W/m2")
     468 CALL histdef2d(iff,flag_SWup200,"SWup200","SWup at 200mb","W/m2" )
     469 CALL histdef2d(iff,flag_SWup200clr,"SWup200clr","SWup clear sky at 200mb","W/m2")
     470 CALL histdef2d(iff,flag_SWdn200,"SWdn200","SWdn at 200mb","W/m2" )
     471 CALL histdef2d(iff,flag_SWdn200clr,"SWdn200clr","SWdn clear sky at 200mb","W/m2")
     472 CALL histdef2d(iff,flag_LWup200,"LWup200","LWup at 200mb","W/m2")
     473 CALL histdef2d(iff,flag_LWup200clr, "LWup200clr","LWup clear sky at 200mb","W/m2")
     474 CALL histdef2d(iff,flag_LWdn200,"LWdn200","LWdn at 200mb","W/m2")
     475 CALL histdef2d(iff,flag_LWdn200clr, "LWdn200clr","LWdn clear sky at 200mb","W/m2")
     476 CALL histdef2d(iff,flag_sols,"sols","Solar rad. at surf.","W/m2")
     477 CALL histdef2d(iff,flag_sols0,"sols0","Solar rad. at surf.","W/m2")
     478 CALL histdef2d(iff,flag_soll,"soll","IR rad. at surface","W/m2") 
     479 CALL histdef2d(iff,flag_radsol,"radsol","Rayonnement au sol","W/m2")
     480 CALL histdef2d(iff,flag_soll0,"soll0","IR rad. at surface","W/m2")
     481 CALL histdef2d(iff,flag_SWupSFC,"SWupSFC","SWup at surface","W/m2")
     482 CALL histdef2d(iff,flag_SWupSFCclr,"SWupSFCclr","SWup clear sky at surface","W/m2")
     483 CALL histdef2d(iff,flag_SWdnSFC,"SWdnSFC","SWdn at surface","W/m2")
     484 CALL histdef2d(iff,flag_SWdnSFCclr,"SWdnSFCclr","SWdn clear sky at surface","W/m2")
     485 CALL histdef2d(iff,flag_LWupSFC,"LWupSFC","Upwd. IR rad. at surface","W/m2")
     486 CALL histdef2d(iff,flag_LWdnSFC,"LWdnSFC","Down. IR rad. at surface","W/m2")
     487 CALL histdef2d(iff,flag_LWupSFCclr,"LWupSFCclr","CS Upwd. IR rad. at surface","W/m2")
     488 CALL histdef2d(iff,flag_LWdnSFCclr,"LWdnSFCclr","Down. CS IR rad. at surface","W/m2")
     489 CALL histdef2d(iff,flag_bils,"bils","Surf. total heat flux","W/m2")
     490 CALL histdef2d(iff,flag_sens,"sens","Sensible heat flux","W/m2")
     491 CALL histdef2d(iff,flag_fder,"fder","Heat flux derivation","W/m2")
     492 CALL histdef2d(iff,flag_ffonte,"ffonte","Thermal flux for snow melting","W/m2")
     493 CALL histdef2d(iff,flag_fqcalving,"fqcalving","Ice Calving","kg/m2/s")
     494 CALL histdef2d(iff,flag_fqfonte,"fqfonte","Land ice melt","kg/m2/s")
     495
     496     DO nsrf = 1, nbsrf
     497 CALL histdef2d(iff,flag_pourc_sol,"pourc_"//clnsurf(nsrf),"% "//clnsurf(nsrf),"%")
     498 CALL histdef2d(iff,flag_fract_sol,"fract_"//clnsurf(nsrf),"Fraction "//clnsurf(nsrf),"1")
     499 CALL histdef2d(iff,flag_taux_sol,"taux_"//clnsurf(nsrf),"Zonal wind stress"//clnsurf(nsrf),"Pa")
     500 CALL histdef2d(iff,flag_tauy_sol,"tauy_"//clnsurf(nsrf),"Meridional wind stress "//clnsurf(nsrf),"Pa")
     501 CALL histdef2d(iff,flag_tsol_sol,"tsol_"//clnsurf(nsrf),"Temperature "//clnsurf(nsrf),"K")
     502 CALL histdef2d(iff,flag_u10m_sol,"u10m_"//clnsurf(nsrf),"Vent Zonal 10m "//clnsurf(nsrf),"m/s")
     503 CALL histdef2d(iff,flag_v10m_sol,"v10m_"//clnsurf(nsrf),"Vent meredien 10m "//clnsurf(nsrf),"m/s")
     504 CALL histdef2d(iff,flag_t2m_sol,"t2m_"//clnsurf(nsrf),"Temp 2m "//clnsurf(nsrf),"K")
     505 CALL histdef2d(iff,flag_sens_sol,"sens_"//clnsurf(nsrf),"Sensible heat flux "//clnsurf(nsrf),"W/m2")
     506 CALL histdef2d(iff,flag_lat_sol,"lat_"//clnsurf(nsrf),"Latent heat flux "//clnsurf(nsrf),"W/m2")
     507 CALL histdef2d(iff,flag_flw_sol,"flw_"//clnsurf(nsrf),"LW "//clnsurf(nsrf),"W/m2")
     508 CALL histdef2d(iff,flag_fsw_sol,"fsw_"//clnsurf(nsrf),"SW "//clnsurf(nsrf),"W/m2")
     509 CALL histdef2d(iff,flag_wbils_sol,"wbils_"//clnsurf(nsrf),"Bilan sol "//clnsurf(nsrf),"W/m2" )
     510 CALL histdef2d(iff,flag_wbilo_sol,"wbilo_"//clnsurf(nsrf),"Bilan eau "//clnsurf(nsrf),"kg/(m2*s)")
     511  if (iflag_pbl>1 .and. lev_files(iff).gt.10 ) then
     512 CALL histdef2d(iff,flag_tke_sol,"tke_"//clnsurf(nsrf),"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
     513 CALL histdef2d(iff,flag_tke_max_sol,"tke_max_"//clnsurf(nsrf),"Max Turb. Kinetic Energy "//clnsurf(nsrf),"-")
     514  endif
     515 CALL histdef2d(iff,flag_albe_sol, "albe_"//clnsurf(nsrf),"Albedo surf. "//clnsurf(nsrf),"-")
     516 CALL histdef2d(iff,flag_rugs_sol,"rugs_"//clnsurf(nsrf),"Latent heat flux "//clnsurf(nsrf),"W/m2")
     517 CALL histdef2d(iff,flag_ages_sol,"ages_"//clnsurf(nsrf),"Snow age","day")
     518     END DO
     519
     520 CALL histdef2d(iff,flag_albs,"albs","Surface albedo","-")
     521 CALL histdef2d(iff,flag_albslw,"albslw","Surface albedo LW","-")
     522 CALL histdef2d(iff,flag_cdrm,"cdrm","Momentum drag coef.", "-")
     523 CALL histdef2d(iff,flag_cdrh,"cdrh","Heat drag coef.", "-" )
     524 CALL histdef2d(iff,flag_cldl,"cldl","Low-level cloudiness", "-")
     525 CALL histdef2d(iff,flag_cldm,"cldm","Mid-level cloudiness", "-")
     526 CALL histdef2d(iff,flag_cldh,"cldh","High-level cloudiness", "-")
     527 CALL histdef2d(iff,flag_cldt,"cldt","Total cloudiness","%")
     528 CALL histdef2d(iff,flag_cldq,"cldq","Cloud liquid water path","kg/m2")
     529 CALL histdef2d(iff,flag_lwp,"lwp","Cloud water path","kg/m2")
     530 CALL histdef2d(iff,flag_iwp,"iwp","Cloud ice water path","kg/m2" )
     531 CALL histdef2d(iff,flag_ue,"ue","Zonal energy transport","-")
     532 CALL histdef2d(iff,flag_ve,"ve","Merid energy transport", "-")
     533 CALL histdef2d(iff,flag_uq,"uq","Zonal humidity transport", "-")
     534 CALL histdef2d(iff,flag_vq,"vq","Merid humidity transport", "-")
     535
     536     IF(iflag_con.GE.3) THEN ! sb
     537 CALL histdef2d(iff,flag_cape,"cape","Conv avlbl pot ener","J/kg")
     538 CALL histdef2d(iff,flag_pbase,"pbase","Cld base pressure", "mb")
     539 CALL histdef2d(iff,flag_ptop,"ptop","Cld top pressure", "mb")
     540 CALL histdef2d(iff,flag_fbase,"fbase","Cld base mass flux","kg/m2/s")
     541 CALL histdef2d(iff,flag_prw,"prw","Precipitable water","kg/m2")
     542     ENDIF !iflag_con .GE. 3
     543
     544 CALL histdef2d(iff,flag_s_pblh,"s_pblh","Boundary Layer Height","m")
     545 CALL histdef2d(iff,flag_s_pblt,"s_pblt","t at Boundary Layer Height","K")
     546 CALL histdef2d(iff,flag_s_lcl,"s_lcl","Condensation level","m")
     547 CALL histdef2d(iff,flag_s_capCL,"s_capCL","Conv avlbl pot enerfor ABL", "J/m2" )
     548 CALL histdef2d(iff,flag_s_oliqCL,"s_oliqCL","Liq Water in BL","kg/m2")
     549 CALL histdef2d(iff,flag_s_cteiCL,"s_cteiCL","Instability criteria(ABL)","K")
     550 CALL histdef2d(iff,flag_s_therm,"s_therm","Exces du thermique", "K")
     551 CALL histdef2d(iff,flag_s_trmb1,"s_trmb1","deep_cape(HBTM2)","J/m2")
     552 CALL histdef2d(iff,flag_s_trmb2,"s_trmb2","inhibition (HBTM2)","J/m2")
     553 CALL histdef2d(iff,flag_s_trmb3,"s_trmb3","Point Omega (HBTM2)","m")
    1197554
    1198555! Champs interpolles sur des niveaux de pression
     
    1203560!      on ecrit u v t q a 850 700 500 200 au niv 3
    1204561
    1205        DO k=1, nlevSTD
    1206          IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
    1207          IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
    1208          IF(bb2.EQ."850".OR.bb2.EQ."700".OR. &
    1209      &      bb2.EQ."500".OR.bb2.EQ."200") THEN
    1210 
    1211         IF (flag_ulevsSTD(iff)<=lev_files(iff)) THEN
    1212           CALL histdef(nid_files(iff), "u"//bb2, &
    1213      &                 "Zonal wind "//bb2//"mb","m/s", &
    1214      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1215      &                "inst(X)", zout,zout)
    1216         ENDIF
    1217 
    1218         IF (flag_vlevsSTD(iff)<=lev_files(iff)) THEN
    1219           CALL histdef(nid_files(iff), "v"//bb2, &
    1220      &                 "Meridional wind "//bb2//"mb","m/s", &
    1221      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1222      &                "inst(X)", zout,zout)
    1223         ENDIF
    1224 
    1225         IF (flag_wlevsSTD(iff)<=lev_files(iff)) THEN
    1226           CALL histdef(nid_files(iff), "w"//bb2, &
    1227      &                 "Vertical wind "//bb2//"mb","m/s", &
    1228      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1229      &                "inst(X)", zout,zout)
    1230         ENDIF
    1231 
    1232         IF (flag_philevsSTD(iff)<=lev_files(iff)) THEN
    1233           CALL histdef(nid_files(iff), "phi"//bb2, &
    1234      &                 "Geopotential "//bb2//"mb","m", &
    1235      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1236      &                "inst(X)", zout,zout)
    1237         ENDIF
    1238 
    1239         IF (flag_qlevsSTD(iff)<=lev_files(iff)) THEN
    1240           CALL histdef(nid_files(iff), "q"//bb2, &
    1241      &               "Specific humidity "//bb2//"mb","kg/kg", &
    1242      &               iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1243      &               "inst(X)", zout,zout)
    1244         ENDIF
    1245 
    1246         IF (flag_tlevsSTD(iff)<=lev_files(iff)) THEN
    1247           CALL histdef(nid_files(iff), "t"//bb2, &
    1248      &                 "Temperature "//bb2//"mb","K", &
    1249      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1250      &                "inst(X)", zout,zout)
    1251         ENDIF
    1252 
    1253        ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
     562        DO k=1, nlevSTD
     563     IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
     564     IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
     565     IF(bb2.EQ."850".OR.bb2.EQ."700".OR.bb2.EQ."500".OR.bb2.EQ."200")THEN
     566 CALL histdef2d(iff,flag_ulevsSTD,"u"//bb2,"Zonal wind "//bb2//"mb","m/s")
     567 CALL histdef2d(iff,flag_vlevsSTD,"v"//bb2,"Meridional wind "//bb2//"mb","m/s")
     568 CALL histdef2d(iff,flag_wlevsSTD,"w"//bb2,"Vertical wind "//bb2//"mb","m/s")
     569 CALL histdef2d(iff,flag_philevsSTD,"phi"//bb2,"Geopotential "//bb2//"mb","m")
     570 CALL histdef2d(iff,flag_qlevsSTD,"q"//bb2,"Specific humidity "//bb2//"mb","kg/kg" )
     571 CALL histdef2d(iff,flag_tlevsSTD,"t"//bb2,"Temperature "//bb2//"mb","K")
     572     ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
    1254573       ENDDO
    1255574
    1256575!IM diagnostiques flux ocean-atm ou ocean-glace de mer
    1257576!IM pour utilisation dans un modele de "slab" ocean
    1258 
    1259       IF (flag_fluxo(iff)<=lev_files(iff)) THEN
    1260        CALL histdef(nid_files(iff), "fluxo", &
    1261      &              "Flux turbulents ocean-atmosphere", "W/m2", &
    1262      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1263      &              type_ecri(iff), zstophy,zout)
    1264       ENDIF
    1265 
    1266       IF (flag_fluxg(iff)<=lev_files(iff)) THEN
    1267        CALL histdef(nid_files(iff), "fluxg", &
    1268      &              "Flux turbulents ocean-glace de mer","W/m2", &
    1269      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1270      &              type_ecri(iff), zstophy,zout)
    1271       ENDIF
    1272 
    1273       IF (flag_t_oce_sic(iff)<=lev_files(iff)) THEN
    1274        CALL histdef(nid_files(iff), "t_oce_sic", &
    1275      &              "Temp. mixte oce-sic","K", &
    1276      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1277      &              type_ecri(iff), zstophy,zout)
    1278       ENDIF
    1279 
    1280        IF (OCEAN.EQ.'force ') THEN
    1281         IF (flag_lmt_bils(iff)<=lev_files(iff)) THEN
    1282          CALL histdef(nid_files(iff), "lmt_bils", &
    1283      &       "Bilan au sol atmosphere forcee", "W/m2", &
    1284      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1285      &              type_ecri(iff), zstophy,zout)
    1286         ENDIF
    1287 
    1288        ELSE IF (OCEAN.EQ.'slab  ') THEN
    1289 
    1290         IF (flag_slab_bils(iff)<=lev_files(iff)) THEN
    1291          CALL histdef(nid_files(iff), "slab_bils", &
    1292      &       "Bilan au sol Slab", "W/m2", &
    1293      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1294      &              type_ecri(iff), zstophy,zout)
    1295         ENDIF
    1296 
    1297         IF (flag_tslab(iff)<=lev_files(iff)) THEN
    1298          CALL histdef(nid_files(iff), "tslab", "Slab SST ", "K", &
    1299      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1300      &              type_ecri(iff), zstophy,zout)
    1301         ENDIF
    1302 
    1303         IF (flag_seaice(iff)<=lev_files(iff)) THEN
    1304          CALL histdef(nid_files(iff),"seaice","Slab seaice","kg/m2", &
    1305      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1306      &              type_ecri(iff), zstophy,zout)
    1307         ENDIF
    1308 
    1309         IF (flag_siceh(iff)<=lev_files(iff)) THEN
    1310          CALL histdef(nid_files(iff),"siceh", &
    1311      &               "Slab seaice height","m", &
    1312      &              iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1313      &              type_ecri(iff), zstophy,zout)
    1314         ENDIF
    1315        ENDIF
    1316 
    1317       IF (flag_weakinv(iff)<=lev_files(iff)) THEN
    1318          CALL histdef(nid_files(iff), "weakinv", &
    1319      &            "Weak inversion", "-", &
    1320      &            iim,jjmp1,nhori, 1,1,1, -99, 32, &
    1321      &            type_ecri(iff), zstophy,zout)
    1322       ENDIF
    1323 
    1324       IF (flag_dthmin(iff)<=lev_files(iff)) THEN
    1325          CALL histdef(nid_files(iff), "dthmin", &
    1326      &            "dTheta mini", "K/m", &
    1327      &            iim,jjmp1,nhori, 1,1,1, -99, 32, &
    1328      &            type_ecri(iff), zstophy,zout)
    1329       ENDIF
    1330 
    1331        IF (flag_meantaucld(iff)<=lev_files(iff)) THEN
    1332          CALL histdef(nid_files(iff),"meantaucld", &
    1333      &                 "ISCCP mean cloud optical thickness","1", &
    1334      &                 iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1335      &                 type_ecri(iff), zstophy,zout)
    1336       ENDIF
    1337 
    1338        IF (flag_cldtau(iff)<=lev_files(iff)) THEN
    1339         CALL histdef(nid_files(iff),"cldtau", &
    1340      &                 "Cloud optical thickness","1", &
    1341      &                 iim,jj_nb,nhori, klev,1,klev, nvert, 32, &
    1342      &                 type_ecri(iff), zstophy,zout)
    1343       ENDIF
    1344 
    1345        IF (flag_cldemi(iff)<=lev_files(iff)) THEN
    1346         CALL histdef(nid_files(iff),"cldemi", &
    1347      &                  "Cloud optical emissivity","1", &
    1348      &                 iim,jj_nb,nhori, klev,1,klev, nvert, 32, &
    1349      &                 type_ecri(iff), zstophy,zout)
    1350       ENDIF
    1351 
    1352        IF (flag_rh2m(iff)<=lev_files(iff)) THEN
    1353         CALL histdef(nid_files(iff), "rh2m", &
    1354      &                  "Relative humidity at 2m", "%", &
    1355      &                 iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1356      &                 type_ecri(iff), zstophy,zout)
    1357       ENDIF
    1358 
    1359        IF (flag_qsat2m(iff)<=lev_files(iff)) THEN
    1360          CALL histdef(nid_files(iff), "qsat2m", &
    1361      &                  "Saturant humidity at 2m", "%", &
    1362      &                 iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1363      &                 type_ecri(iff), zstophy,zout)
    1364       ENDIF
    1365 
    1366        IF (flag_tpot(iff)<=lev_files(iff)) THEN
    1367          CALL histdef(nid_files(iff), "tpot", &
    1368      &                "Surface air potential temperature", "K", &
    1369      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1370      &                type_ecri(iff), zstophy,zout)
    1371       ENDIF
    1372 
    1373        IF (flag_tpote(iff)<=lev_files(iff)) THEN
    1374          CALL histdef(nid_files(iff), "tpote", &
    1375      &        "Surface air equivalent potential temperature", "K", &
    1376      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1377      &                type_ecri(iff), zstophy,zout)
    1378       ENDIF
    1379 
    1380        IF (flag_SWnetOR(iff)<=lev_files(iff)) THEN
    1381          CALL histdef(nid_files(iff), "SWnetOR", &
    1382      &                "Sfce net SW radiation OR", "W/m2", &
    1383      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1384      &                type_ecri(iff), zstophy,zout)
    1385       ENDIF
    1386 
    1387        IF (flag_SWdownOR(iff)<=lev_files(iff)) THEN
    1388          CALL histdef(nid_files(iff), "SWdownOR", &
    1389      &                "Sfce incident SW radiation OR", "W/m2", &
    1390      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1391      &                type_ecri(iff), zstophy,zout)
    1392       ENDIF
    1393 
    1394        IF (flag_LWdownOR(iff)<=lev_files(iff)) THEN
    1395          CALL histdef(nid_files(iff), "LWdownOR", &
    1396      &                "Sfce incident LW radiation OR", "W/m2", &
    1397      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1398      &                type_ecri(iff), zstophy,zout)
    1399       ENDIF
    1400 
    1401        IF (flag_snowl(iff)<=lev_files(iff)) THEN
    1402          CALL histdef(nid_files(iff), "snowl", &
    1403      &              "Solid Large-scale Precip.","kg/(m2*s)", &
    1404      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1405      &                type_ecri(iff), zstophy,zout)
    1406       ENDIF
    1407 
    1408        IF (flag_cape_max(iff)<=lev_files(iff)) THEN
    1409          CALL histdef(nid_files(iff), "cape_max", "CAPE max.", &
    1410      &                "J/kg", &
    1411      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1412      &                't_max(X)', zstophy,zout)
    1413       ENDIF
    1414 
    1415        IF (flag_solldown(iff)<=lev_files(iff)) THEN
    1416          CALL histdef(nid_files(iff), "solldown", &
    1417      &                  "Down. IR rad. at surface", &
    1418      &                "W/m2", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1419      &                type_ecri(iff), zstophy,zout)
    1420       ENDIF
    1421 
    1422        IF (flag_dtsvdfo(iff)<=lev_files(iff)) THEN
    1423         CALL histdef(nid_files(iff), "dtsvdfo", &
    1424      &                  "Boundary-layer dTs(o)", &
    1425      &               "K/s", iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1426      &               type_ecri(iff), zout,zout)
    1427       ENDIF
    1428 
    1429        IF (flag_dtsvdft(iff)<=lev_files(iff)) THEN
    1430         CALL histdef(nid_files(iff), "dtsvdft", &
    1431      &                  "Boundary-layer dTs(t)", "K/s", &
    1432      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1433      &                type_ecri(iff), zout,zout)
    1434       ENDIF
    1435 
    1436        IF (flag_dtsvdfg(iff)<=lev_files(iff)) THEN
    1437       CALL histdef(nid_files(iff), "dtsvdfg", &
    1438      &                  "Boundary-layer dTs(g)", "K/s", &
    1439      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1440      &                type_ecri(iff), zout,zout)
    1441       ENDIF
    1442 
    1443        IF (flag_dtsvdfi(iff)<=lev_files(iff)) THEN
    1444       CALL histdef(nid_files(iff), "dtsvdfi", &
    1445      &                  "Boundary-layer dTs(g)", "K/s", &
    1446      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1447      &                type_ecri(iff), zout,zout)
    1448       ENDIF
    1449 
    1450        IF (flag_rugs(iff)<=lev_files(iff)) THEN
    1451          CALL histdef(nid_files(iff), "rugs", "rugosity", "-", &
    1452      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1453      &                "inst(X)", zout,zout)
    1454       ENDIF
     577 CALL histdef2d(iff,flag_fluxo,"fluxo","Flux turbulents ocean-atmosphere","W/m2")
     578 CALL histdef2d(iff,flag_fluxg,"fluxg","Flux turbulents ocean-glace de mer","W/m2")
     579 CALL histdef2d(iff,flag_t_oce_sic,"t_oce_sic","Temp mixte oce-sic","K")
     580
     581     IF (OCEAN.EQ.'force ') THEN
     582 CALL histdef2d(iff,flag_lmt_bils,"lmt_bils","Bilan au sol atmosphere forcee","W/m2")
     583     ELSE IF (OCEAN.EQ.'slab  ') THEN
     584 CALL histdef2d(iff,flag_slab_bils,"slab_bils","Bilan au sol Slab","W/m2")
     585 CALL histdef2d(iff,flag_tslab,"tslab", "Slab SST ", "K")
     586 CALL histdef2d(iff,flag_seaice,"seaice","Slab seaice","kg/m2")
     587 CALL histdef2d(iff,flag_siceh,"siceh","Slab seaice height","m")
     588     ENDIF
     589
     590 CALL histdef2d(iff,flag_weakinv, "weakinv","Weak inversion", "-")
     591 CALL histdef2d(iff,flag_dthmin,"dthmin","dTheta mini", "K/m")
     592 CALL histdef2d(iff,flag_meantaucld,"meantaucld","ISCCP mean cloud optical thickness","1")
     593 CALL histdef2d(iff,flag_rh2m,"rh2m","Relative humidity at 2m", "%" )
     594 CALL histdef2d(iff,flag_qsat2m,"qsat2m","Saturant humidity at 2m", "%")
     595 CALL histdef2d(iff,flag_tpot,"tpot","Surface air potential temperature","K")
     596 CALL histdef2d(iff,flag_tpote,"tpote","Surface air equivalent potential temperature","K")
     597 CALL histdef2d(iff,flag_SWnetOR,"SWnetOR","Sfce net SW radiation OR", "W/m2")
     598 CALL histdef2d(iff,flag_SWdownOR,"SWdownOR","Sfce incident SW radiation OR","W/m2")
     599 CALL histdef2d(iff,flag_LWdownOR,"LWdownOR","Sfce incident LW radiation OR","W/m2")
     600 CALL histdef2d(iff,flag_snowl,"snowl","Solid Large-scale Precip.","kg/(m2*s)")
     601 CALL histdef2d(iff,flag_cape_max,"cape_max","CAPE max.", "J/kg")
     602 CALL histdef2d(iff,flag_solldown,"solldown","Down. IR rad. at surface","W/m2")
     603 CALL histdef2d(iff,flag_dtsvdfo,"dtsvdfo","Boundary-layer dTs(o)","K/s")
     604 CALL histdef2d(iff,flag_dtsvdft,"dtsvdft","Boundary-layer dTs(t)","K/s")
     605 CALL histdef2d(iff,flag_dtsvdfg,"dtsvdfg","Boundary-layer dTs(g)","K/s")
     606 CALL histdef2d(iff,flag_dtsvdfi,"dtsvdfi","Boundary-layer dTs(g)","K/s")
     607 CALL histdef2d(iff,flag_rugs,"rugs","rugosity", "-" )
    1455608
    1456609! Champs 3D:
    1457 
    1458        IF (flag_lwcon(iff)<=lev_files(iff)) THEN
    1459          CALL histdef(nid_files(iff),"lwcon", &
    1460      &                 "Cloud liquid water content","kg/kg", &
    1461      &                iim,jj_nb,nhori, klev,1,klev, nvert, 32, &
    1462      &                type_ecri(iff), zstophy,zout)
    1463       ENDIF
    1464 
    1465        IF (flag_iwcon(iff)<=lev_files(iff)) THEN
    1466          CALL histdef(nid_files(iff),"iwcon", &
    1467      &                "Cloud ice water content","kg/kg", &
    1468      &                iim,jj_nb,nhori, klev,1,klev, nvert, 32, &
    1469      &                type_ecri(iff), zstophy,zout)
    1470       ENDIF
    1471 
    1472        IF (flag_temp(iff)<=lev_files(iff)) THEN
    1473         CALL histdef(nid_files(iff),"temp","Air temperature","K", &
    1474      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1475      &                type_ecri(iff), zstophy,zout)
    1476       ENDIF
    1477 
    1478        IF (flag_ovap(iff)<=lev_files(iff)) THEN
    1479          CALL histdef(nid_files(iff), "ovap", &
    1480      &                  "Specific humidity","kg/kg", &
    1481      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1482      &                type_ecri(iff), zstophy,zout)
    1483       ENDIF
    1484 
    1485 
    1486        IF (flag_geop(iff)<=lev_files(iff)) THEN
    1487          CALL histdef(nid_files(iff), "geop", &
    1488      &                  "Geopotential height", "m2/s2", &
    1489      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1490      &                type_ecri(iff), zstophy,zout)
    1491       ENDIF
    1492 
    1493        IF (flag_vitu(iff)<=lev_files(iff)) THEN
    1494          CALL histdef(nid_files(iff), "vitu", "Zonal wind", "m/s", &
    1495      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1496      &                type_ecri(iff), zstophy,zout)
    1497       ENDIF
    1498 
    1499        IF (flag_vitv(iff)<=lev_files(iff)) THEN
    1500          CALL histdef(nid_files(iff),"vitv","Meridional wind","m/s", &
    1501      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1502      &                type_ecri(iff), zstophy,zout)
    1503       ENDIF
    1504 
    1505        IF (flag_vitw(iff)<=lev_files(iff)) THEN
    1506          CALL histdef(nid_files(iff),"vitw","Vertical wind","m/s", &
    1507      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1508      &                type_ecri(iff), zstophy,zout)
    1509       ENDIF
    1510 
    1511        IF (flag_pres(iff)<=lev_files(iff)) THEN
    1512          CALL histdef(nid_files(iff), "pres", "Air pressure", "Pa", &
    1513      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1514      &                type_ecri(iff), zstophy,zout)
    1515       ENDIF
    1516 
    1517        IF (flag_rneb(iff)<=lev_files(iff)) THEN
    1518         CALL histdef(nid_files(iff), "rneb", "Cloud fraction", "-", &
    1519      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1520      &                type_ecri(iff), zstophy,zout)
    1521       ENDIF
    1522 
    1523        IF (flag_rnebcon(iff)<=lev_files(iff)) THEN
    1524          CALL histdef(nid_files(iff), "rnebcon", &
    1525      &                "Convective Cloud Fraction", "-", &
    1526      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1527      &                type_ecri(iff), zstophy,zout)
    1528       ENDIF
    1529 
    1530        IF (flag_rhum(iff)<=lev_files(iff)) THEN
    1531         CALL histdef(nid_files(iff), "rhum", "Relative humidity", "-", &
    1532      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1533      &                type_ecri(iff), zstophy,zout)
    1534       ENDIF
    1535 
    1536        IF (flag_ozone(iff)<=lev_files(iff)) THEN
    1537          CALL histdef(nid_files(iff), "ozone", &
    1538      &                  "Ozone concentration", "ppmv", &
    1539      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1540      &                type_ecri(iff), zstophy,zout)
    1541       ENDIF
    1542 
    1543        IF (flag_upwd(iff)<=lev_files(iff)) THEN
    1544          CALL histdef(nid_files(iff), "upwd", &
    1545      &                  "saturated updraft", "kg/m2/s", &
    1546      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1547      &                type_ecri(iff), zstophy,zout)
    1548       ENDIF
    1549 
    1550        IF (flag_dtphy(iff)<=lev_files(iff)) THEN
    1551          CALL histdef(nid_files(iff), "dtphy", "Physics dT", "K/s", &
    1552      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1553      &                type_ecri(iff), zstophy,zout)
    1554       ENDIF
    1555 
    1556        IF (flag_dqphy(iff)<=lev_files(iff)) THEN
    1557          CALL histdef(nid_files(iff), "dqphy", &
    1558      &                  "Physics dQ", "(kg/kg)/s", &
    1559      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1560      &                type_ecri(iff), zstophy,zout)
    1561       ENDIF
    1562 
    1563         DO nsrf=1, nbsrf
    1564           IF (flag_albe_sol(iff)<=lev_files(iff)) THEN
    1565            call histdef(nid_files(iff), "albe_"//clnsurf(nsrf), &
    1566      &          "Albedo surf. "//clnsurf(nsrf), "-", &
    1567      &          iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1568      &          type_ecri(iff), zstophy,zout)
    1569         ENDIF
    1570 
    1571           IF (flag_rugs_sol(iff)<=lev_files(iff)) THEN 
    1572            call histdef(nid_files(iff), "rugs_"//clnsurf(nsrf), &
    1573      &          "Latent heat flux "//clnsurf(nsrf), "W/m2", &
    1574      &         iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1575      &         type_ecri(iff), zstophy,zout)
    1576        ENDIF
    1577 
    1578         IF (flag_ages_sol(iff)<=lev_files(iff)) THEN
    1579          CALL histdef(nid_files(iff), &
    1580      &          "ages_"//clnsurf(nsrf), "Snow age","day", &
    1581      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1582      &                type_ecri(iff), zstophy,zout)
    1583        ENDIF
    1584 
    1585          ENDDO !nsrf=1, nbsrf
    1586 
    1587        IF (flag_albs(iff)<=lev_files(iff)) THEN
    1588          CALL histdef(nid_files(iff),"albs","Surface albedo","-", &
    1589      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1590      &                type_ecri(iff), zstophy,zout)
    1591       ENDIF
    1592 
    1593        IF (flag_albslw(iff)<=lev_files(iff)) THEN
    1594          CALL histdef(nid_files(iff),"albslw", &
    1595      &                  "Surface albedo LW", "-", &
    1596      &                iim,jj_nb,nhori, 1,1,1, -99, 32, &
    1597      &                type_ecri(iff), zstophy,zout)
    1598       ENDIF
     610 CALL histdef3d(iff,flag_lwcon,"lwcon","Cloud liquid water content","kg/kg")
     611 CALL histdef3d(iff,flag_iwcon,"iwcon","Cloud ice water content","kg/kg")
     612 CALL histdef3d(iff,flag_temp,"temp","Air temperature","K" )
     613 CALL histdef3d(iff,flag_ovap,"ovap","Specific humidity","kg/kg" )
     614 CALL histdef3d(iff,flag_geop,"geop","Geopotential height","m2/s2")
     615 CALL histdef3d(iff,flag_vitu,"vitu","Zonal wind", "m/s" )
     616 CALL histdef3d(iff,flag_vitv,"vitv","Meridional wind","m/s" )
     617 CALL histdef3d(iff,flag_vitw,"vitw","Vertical wind","m/s" )
     618 CALL histdef3d(iff,flag_pres,"pres","Air pressure", "Pa" )
     619 CALL histdef3d(iff,flag_rneb,"rneb","Cloud fraction","-")
     620 CALL histdef3d(iff,flag_rnebcon,"rnebcon","Convective Cloud Fraction","-")
     621 CALL histdef3d(iff,flag_rhum,"rhum","Relative humidity","-")
     622 CALL histdef3d(iff,flag_ozone,"ozone","Ozone concentration", "ppmv")
     623 CALL histdef3d(iff,flag_upwd,"upwd","saturated updraft", "kg/m2/s")
     624 CALL histdef3d(iff,flag_dtphy,"dtphy","Physics dT","K/s")
     625 CALL histdef3d(iff,flag_dqphy,"dqphy","Physics dQ", "(kg/kg)/s")
     626 CALL histdef3d(iff,flag_cldtau,"cldtau","Cloud optical thickness","1")
     627 CALL histdef3d(iff,flag_cldemi,"cldemi","Cloud optical emissivity","1")
     628 CALL histdef3d(iff,flag_pr_con_l,"pmflxr","Convective precipitation lic"," ")
     629 CALL histdef3d(iff,flag_pr_con_i,"pmflxs","Convective precipitation ice"," ")
     630 CALL histdef3d(iff,flag_pr_lsc_l,"prfl","Large scale precipitation lic"," ")
     631 CALL histdef3d(iff,flag_pr_lsc_i,"psfl","Large scale precipitation ice"," ")
    1599632
    1600633!FH Sorties pour la couche limite
    1601       if (iflag_pbl>1) then
    1602        IF (flag_tke(iff)<=lev_files(iff)) THEN
    1603          CALL histdef(nid_files(iff), "tke","TKE","m2/s2", &
    1604      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1605      &                type_ecri(iff), zstophy,zout)
    1606       ENDIF
    1607 
    1608        IF (flag_tke_max(iff)<=lev_files(iff)) THEN
    1609          CALL histdef(nid_files(iff), "tke_max","TKE max","m2/s2", &
    1610      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1611      &                "t_max(X)", zstophy,zout)
    1612       ENDIF
     634     if (iflag_pbl>1) then
     635 CALL histdef3d(iff,flag_tke,"tke","TKE","m2/s2")
     636 CALL histdef3d(iff,flag_tke_max,"tke_max","TKE max","m2/s2")
     637     endif
     638
     639 CALL histdef3d(iff,flag_kz,"kz","Kz melange","m2/s")
     640 CALL histdef3d(iff,flag_kz_max,"kz_max","Kz melange max","m2/s" )
     641 CALL histdef3d(iff,flag_clwcon,"clwcon","Convective Cloud Liquid water content", "kg/kg")
     642 CALL histdef3d(iff,flag_Ma,"Ma","undilute adiab updraft","kg/m2/s")
     643 CALL histdef3d(iff,flag_dnwd,"dnwd","saturated downdraft","kg/m2/s")
     644 CALL histdef3d(iff,flag_dnwd0,"dnwd0","unsat. downdraft", "kg/m2/s")
     645 CALL histdef3d(iff,flag_dtdyn,"dtdyn","Dynamics dT","K/s")
     646 CALL histdef3d(iff,flag_dqdyn,"dqdyn","Dynamics dQ", "(kg/kg)/s")
     647 CALL histdef3d(iff,flag_dtcon,"dtcon","Convection dT","K/s")
     648 CALL histdef3d(iff,flag_ducon,"ducon","Convection du","m/s2")
     649 CALL histdef3d(iff,flag_dqcon,"dqcon","Convection dQ", "(kg/kg)/s")
     650 CALL histdef3d(iff,flag_dtlsc,"dtlsc","Condensation dT", "K/s")
     651 CALL histdef3d(iff,flag_dtlschr,"dtlschr","Large-scale condensational heating rate","K/s")
     652 CALL histdef3d(iff,flag_dqlsc,"dqlsc","Condensation dQ","(kg/kg)/s")
     653 CALL histdef3d(iff,flag_dtvdf,"dtvdf","Boundary-layer dT", "K/s")
     654 CALL histdef3d(iff,flag_dqvdf,"dqvdf","Boundary-layer dQ","(kg/kg)/s")
     655 CALL histdef3d(iff,flag_dteva,"dteva","Reevaporation dT", "K/s")
     656 CALL histdef3d(iff,flag_dqeva,"dqeva","Reevaporation dQ","(kg/kg)/s")
     657 CALL histdef3d(iff,flag_ptconv,"ptconv","POINTS CONVECTIFS"," ")
     658 CALL histdef3d(iff,flag_ratqs,"ratqs", "RATQS"," ")
     659 CALL histdef3d(iff,flag_dtthe,"dtthe","Dry adjust. dT", "K/s")
     660 CALL histdef3d(iff,flag_dqthe,"dqthe","Dry adjust. dQ","(kg/kg)/s")
     661 CALL histdef3d(iff,flag_dtajs,"dtajs","Dry adjust. dT", "K/s")
     662 CALL histdef3d(iff,flag_dqajs,"dqajs","Dry adjust. dQ","(kg/kg)/s")
     663 CALL histdef3d(iff,flag_dtswr,"dtswr","SW radiation dT","K/s")
     664 CALL histdef3d(iff,flag_dtsw0,"dtsw0","CS SW radiation dT","K/s")
     665 CALL histdef3d(iff,flag_dtlwr,"dtlwr","LW radiation dT","K/s")
     666 CALL histdef3d(iff,flag_dtlw0,"dtlw0", "CS LW radiation dT","K/s")
     667 CALL histdef3d(iff,flag_dtec,"dtec","Cinetic dissip dT","K/s")
     668 CALL histdef3d(iff,flag_duvdf,"duvdf","Boundary-layer dU","m/s2")
     669 CALL histdef3d(iff,flag_dvvdf,"dvvdf","Boundary-layer dV", "m/s2")
     670
     671     IF (ok_orodr) THEN
     672 CALL histdef3d(iff,flag_duoro,"duoro","Orography dU","m/s2")
     673 CALL histdef3d(iff,flag_dvoro,"dvoro","Orography dV", "m/s2")
     674     ENDIF
     675
     676     IF (ok_orolf) THEN
     677 CALL histdef3d(iff,flag_dulif,"dulif","Orography dU","m/s2")
     678 CALL histdef3d(iff,flag_dvlif,"dvlif","Orography dV", "m/s2")
     679     ENDIF
     680
     681      if (nqmax>=3) THEN
     682    DO iq=3,nqmax
     683       iiq=niadv(iq)
     684 CALL histdef3d ( iff, flag_trac, tnom(iq),ttext(iiq), "-" )
     685    ENDDO
    1613686      endif
    1614 
    1615        IF (flag_kz(iff)<=lev_files(iff)) THEN
    1616          CALL histdef(nid_files(iff), "kz","Kz melange","m2/s", &
    1617      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1618      &                type_ecri(iff), zstophy,zout)
    1619       ENDIF
    1620 
    1621        IF (flag_kz_max(iff)<=lev_files(iff)) THEN
    1622          CALL histdef(nid_files(iff), "kz_max", &
    1623      &                  "Kz melange max","m2/s", &
    1624      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1625      &                "t_max(X)", zstophy,zout)
    1626       ENDIF
    1627 
    1628        IF (flag_clwcon(iff)<=lev_files(iff)) THEN
    1629          CALL histdef(nid_files(iff), "clwcon", &
    1630      &                "Convective Cloud Liquid water content", &
    1631      &                 "kg/kg", &
    1632      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1633      &                type_ecri(iff), zstophy,zout)
    1634       ENDIF
    1635 
    1636        IF (flag_Ma(iff)<=lev_files(iff)) THEN
    1637          CALL histdef(nid_files(iff),"Ma", &
    1638      &                  "undilute adiab updraft","kg/m2/s", &
    1639      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1640      &                type_ecri(iff), zstophy,zout)
    1641       ENDIF
    1642 
    1643        IF (flag_dnwd(iff)<=lev_files(iff)) THEN
    1644          CALL histdef(nid_files(iff), "dnwd", &
    1645      &                  "saturated downdraft","kg/m2/s", &
    1646      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1647      &                type_ecri(iff), zstophy,zout)
    1648       ENDIF
    1649 
    1650        IF (flag_dnwd0(iff)<=lev_files(iff)) THEN
    1651          CALL histdef(nid_files(iff), "dnwd0", &
    1652      &                  "unsat. downdraft", "kg/m2/s", &
    1653      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1654      &                type_ecri(iff), zstophy,zout)
    1655       ENDIF
    1656 
    1657        IF (flag_dtdyn(iff)<=lev_files(iff)) THEN
    1658          CALL histdef(nid_files(iff),"dtdyn","Dynamics dT","K/s", &
    1659      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1660      &                type_ecri(iff), zstophy,zout)
    1661       ENDIF
    1662 
    1663        IF (flag_dqdyn(iff)<=lev_files(iff)) THEN
    1664          CALL histdef(nid_files(iff), "dqdyn", &
    1665      &                  "Dynamics dQ", "(kg/kg)/s", &
    1666      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1667      &                type_ecri(iff), zstophy,zout)
    1668       ENDIF
    1669 
    1670        IF (flag_dtcon(iff)<=lev_files(iff)) THEN
    1671          CALL histdef(nid_files(iff),"dtcon","Convection dT","K/s", &
    1672      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1673      &                type_ecri(iff), zstophy,zout)
    1674       ENDIF
    1675 
    1676        IF (flag_ducon(iff)<=lev_files(iff)) THEN
    1677         CALL histdef(nid_files(iff),"ducon","Convection du","m/s2", &
    1678      &               iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1679      &               type_ecri(iff), zstophy,zout)
    1680       ENDIF
    1681 
    1682        IF (flag_dqcon(iff)<=lev_files(iff)) THEN
    1683          CALL histdef(nid_files(iff), "dqcon", &
    1684      &                  "Convection dQ", "(kg/kg)/s", &
    1685      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1686      &                type_ecri(iff), zstophy,zout)
    1687       ENDIF
    1688 
    1689        IF (flag_dtlsc(iff)<=lev_files(iff)) THEN
    1690          CALL histdef(nid_files(iff), "dtlsc", &
    1691      &                  "Condensation dT", "K/s", &
    1692      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1693      &                type_ecri(iff), zstophy,zout)
    1694       ENDIF
    1695 
    1696        IF (flag_dtlschr(iff)<=lev_files(iff)) THEN
    1697          CALL histdef(nid_files(iff), "dtlschr", &
    1698      &                "Large-scale condensational heating rate", &
    1699      &                "K/s",iim,jj_nb, nhori, klev,1,klev,nvert, &
    1700      &                 32,type_ecri(iff), zstophy,zout)
    1701       ENDIF
    1702 
    1703        IF (flag_dqlsc(iff)<=lev_files(iff)) THEN
    1704          CALL histdef(nid_files(iff), "dqlsc", &
    1705      &                "Condensation dQ", "(kg/kg)/s", &
    1706      &               iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1707      &                type_ecri(iff), zstophy,zout)
    1708       ENDIF
    1709 
    1710        IF (flag_dtvdf(iff)<=lev_files(iff)) THEN
    1711         CALL histdef(nid_files(iff), "dtvdf", &
    1712      &                "Boundary-layer dT", "K/s", &
    1713      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1714      &                type_ecri(iff), zstophy,zout)
    1715       ENDIF
    1716 
    1717        IF (flag_dqvdf(iff)<=lev_files(iff)) THEN
    1718          CALL histdef(nid_files(iff), "dqvdf", &
    1719      &                "Boundary-layer dQ","(kg/kg)/s", &
    1720      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1721      &                type_ecri(iff), zstophy,zout)
    1722       ENDIF
    1723 
    1724        IF (flag_dteva(iff)<=lev_files(iff)) THEN
    1725          CALL histdef(nid_files(iff), "dteva", &
    1726      &                  "Reevaporation dT", "K/s", &
    1727      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1728      &                type_ecri(iff), zstophy,zout)
    1729       ENDIF
    1730 
    1731        IF (flag_dqeva(iff)<=lev_files(iff)) THEN
    1732          CALL histdef(nid_files(iff), "dqeva", &
    1733      &                  "Reevaporation dQ","(kg/kg)/s", &
    1734      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1735      &                type_ecri(iff), zstophy,zout)
    1736       ENDIF
    1737 
    1738        IF (flag_ptconv(iff)<=lev_files(iff)) THEN
    1739          CALL histdef(nid_files(iff), "ptconv", &
    1740      &                  "POINTS CONVECTIFS"," ", &
    1741      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1742      &                type_ecri(iff), zstophy,zout)
    1743       ENDIF
    1744 
    1745        IF (flag_ratqs(iff)<=lev_files(iff)) THEN
    1746          CALL histdef(nid_files(iff), "ratqs", "RATQS"," ", &
    1747      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1748      &                type_ecri(iff), zstophy,zout)
    1749       ENDIF
    1750 
    1751        IF (flag_dtthe(iff)<=lev_files(iff)) THEN
    1752          CALL histdef(nid_files(iff), "dtthe", &
    1753      &                  "Dry adjust. dT", "K/s", &
    1754      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1755      &                type_ecri(iff), zstophy,zout)
    1756       ENDIF
    1757 
    1758        IF (flag_dqthe(iff)<=lev_files(iff)) THEN
    1759          CALL histdef(nid_files(iff),"dqthe", &
    1760      &                "Dry adjust. dQ","(kg/kg)/s", &
    1761      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1762      &                type_ecri(iff), zstophy,zout)
    1763       ENDIF
    1764 
    1765        IF (flag_dtajs(iff)<=lev_files(iff)) THEN
    1766          CALL histdef(nid_files(iff), "dtajs", &
    1767      &                  "Dry adjust. dT", "K/s", &
    1768      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1769      &                type_ecri(iff), zstophy,zout)
    1770       ENDIF
    1771 
    1772        IF (flag_dqajs(iff)<=lev_files(iff)) THEN
    1773          CALL histdef(nid_files(iff),"dqajs", &
    1774      &                  "Dry adjust. dQ","(kg/kg)/s", &
    1775      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1776      &                type_ecri(iff), zstophy,zout)
    1777       ENDIF
    1778 
    1779        IF (flag_dtswr(iff)<=lev_files(iff)) THEN
    1780          CALL histdef(nid_files(iff), "dtswr", &
    1781      &                  "SW radiation dT", "K/s", &
    1782      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1783      &                type_ecri(iff), zstophy,zout)
    1784       ENDIF
    1785 
    1786        IF (flag_dtsw0(iff)<=lev_files(iff)) THEN
    1787          CALL histdef(nid_files(iff), "dtsw0", &
    1788      &                  "CS SW radiation dT", "K/s", &
    1789      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1790      &                type_ecri(iff), zstophy,zout)
    1791       ENDIF
    1792 
    1793        IF (flag_dtlwr(iff)<=lev_files(iff)) THEN
    1794          CALL histdef(nid_files(iff), "dtlwr", &
    1795      &                  "LW radiation dT", "K/s", &
    1796      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1797      &                type_ecri(iff), zstophy,zout)
    1798       ENDIF
    1799 
    1800        IF (flag_dtlw0(iff)<=lev_files(iff)) THEN
    1801          CALL histdef(nid_files(iff),"dtlw0", &
    1802      &                  "CS LW radiation dT","K/s", &
    1803      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1804      &                type_ecri(iff), zstophy,zout)
    1805       ENDIF
    1806 
    1807        IF (flag_dtec(iff)<=lev_files(iff)) THEN
    1808          CALL histdef(nid_files(iff), "dtec", &
    1809      &                  "Cinetic dissip dT", "K/s", &
    1810      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1811      &                type_ecri(iff), zstophy,zout)
    1812       ENDIF
    1813 
    1814        IF (flag_duvdf(iff)<=lev_files(iff)) THEN
    1815          CALL histdef(nid_files(iff), "duvdf", &
    1816      &                  "Boundary-layer dU", "m/s2", &
    1817      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1818      &                type_ecri(iff), zstophy,zout)
    1819       ENDIF
    1820 
    1821        IF (flag_dvvdf(iff)<=lev_files(iff)) THEN
    1822          CALL histdef(nid_files(iff), "dvvdf", &
    1823      &          "Boundary-layer dV", "m/s2", &
    1824      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1825      &                type_ecri(iff), zstophy,zout)
    1826       ENDIF
    1827 
    1828          IF (ok_orodr) THEN
    1829        IF (flag_duoro(iff)<=lev_files(iff)) THEN
    1830          CALL histdef(nid_files(iff), "duoro", &
    1831      &                  "Orography dU", "m/s2", &
    1832      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1833      &                type_ecri(iff), zstophy,zout)
    1834       ENDIF
    1835 
    1836        IF (flag_dvoro(iff)<=lev_files(iff)) THEN
    1837          CALL histdef(nid_files(iff), "dvoro", &
    1838      &                  "Orography dV", "m/s2", &
    1839      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1840      &                type_ecri(iff), zstophy,zout)
    1841       ENDIF
    1842 
    1843          ENDIF
    1844 
    1845       IF (ok_orolf) THEN
    1846        IF (flag_dulif(iff)<=lev_files(iff)) THEN
    1847          CALL histdef(nid_files(iff), "dulif", &
    1848      &                "Orography dU", "m/s2", &
    1849      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1850      &                type_ecri(iff), zstophy,zout)
    1851        ENDIF
    1852 
    1853        IF (flag_dvlif(iff)<=lev_files(iff)) THEN
    1854          CALL histdef(nid_files(iff), "dvlif", &
    1855      &                  "Orography dV", "m/s2", &
    1856      &               iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1857      &                type_ecri(iff), zstophy,zout)
    1858        ENDIF
    1859       ENDIF
    1860 
    1861           IF (flag_trac(iff)<=lev_files(iff)) THEN
    1862            if (nqmax>=3) THEN
    1863              DO iq=3,nqmax
    1864               iiq=niadv(iq)
    1865          CALL histdef(nid_files(iff),tnom(iq),ttext(iiq), "-", &
    1866      &                iim,jj_nb,nhori, klev,1,klev,nvert, 32, &
    1867      &                type_ecri(iff), zstophy,zout)
    1868              ENDDO
    1869            endif
    1870          ENDIF
    1871687
    1872688        CALL histend(nid_files(iff))
     
    1880696      end subroutine phys_output_open
    1881697
     698      SUBROUTINE histdef2d (iff,flag_var,nomvar,titrevar,unitvar)
     699     
     700       use ioipsl
     701       USE dimphy
     702       USE mod_phys_lmdz_para
     703
     704       IMPLICIT NONE
     705       
     706       include "dimensions.h"
     707       include "temps.h"
     708       include "indicesol.h"
     709       include "advtrac.h"
     710       include "clesphys.h"
     711
     712       integer                          :: iff
     713       integer, dimension(nfiles)       :: flag_var
     714       character(len=*)                 :: nomvar
     715       character(len=*)                 :: titrevar
     716       character(len=*)                 :: unitvar
     717       
     718       if ( flag_var(iff)<=lev_files(iff) ) then
     719 call histdef (nid_files(iff),nomvar,titrevar,unitvar, &
     720               iim,jj_nb,nhorim(iff), 1,1,1, -99, 32, &
     721               type_ecri(iff), zstophym(iff),zoutm(iff))               
     722       endif                     
     723      end subroutine histdef2d
     724
     725      SUBROUTINE histdef3d (iff,flag_var,nomvar,titrevar,unitvar)
     726
     727       use ioipsl
     728       USE dimphy
     729       USE mod_phys_lmdz_para
     730
     731       IMPLICIT NONE
     732
     733       include "dimensions.h"
     734       include "temps.h"
     735       include "indicesol.h"
     736       include "advtrac.h"
     737       include "clesphys.h"
     738
     739       integer                          :: iff
     740       integer, dimension(nfiles)       :: flag_var
     741       character(len=*)                 :: nomvar
     742       character(len=*)                 :: titrevar
     743       character(len=*)                 :: unitvar
     744
     745       if ( flag_var(iff)<=lev_files(iff) ) then
     746 call histdef (nid_files(iff),nomvar,titrevar,unitvar, &
     747               iim,jj_nb,nhorim(iff), klev,1,klev,nvertm(iff), 32, &
     748               type_ecri(iff), zstophym(iff),zoutm(iff))
     749       endif
     750      end subroutine histdef3d
     751
     752
    1882753END MODULE phys_output_mod
    1883754
  • LMDZ4/trunk/libf/phylmd/phys_output_write.h

    r907 r929  
    519519        ENDIF
    520520
    521         IF (flag_s_lclt(iff)<=lev_files(iff)) THEN
     521        IF (flag_s_lcl(iff)<=lev_files(iff)) THEN
    522522      CALL histwrite_phy(nid_files(iff),"s_lcl",itau_w,s_lcl)
    523523        ENDIF
     
    527527        ENDIF
    528528
    529         IF (flag_s_oliqCLL(iff)<=lev_files(iff)) THEN
     529        IF (flag_s_oliqCL(iff)<=lev_files(iff)) THEN
    530530      CALL histwrite_phy(nid_files(iff),"s_oliqCL",itau_w,s_oliqCL)
    531531        ENDIF
     
    706706       IF (flag_cldemi(iff)<=lev_files(iff)) THEN
    707707       CALL histwrite_phy(nid_files(iff),"cldemi",itau_w,cldemi)
     708       ENDIF
     709
     710       IF (flag_pr_con_l(iff)<=lev_files(iff)) THEN
     711       CALL histwrite_phy(nid_files(iff),"pmflxr",itau_w,pmflxr)
     712       ENDIF
     713
     714       IF (flag_pr_con_i(iff)<=lev_files(iff)) THEN
     715       CALL histwrite_phy(nid_files(iff),"pmflxs",itau_w,pmflxs)
     716       ENDIF
     717
     718       IF (flag_pr_lsc_l(iff)<=lev_files(iff)) THEN
     719       CALL histwrite_phy(nid_files(iff),"prfl",itau_w,prfl)
     720       ENDIF
     721
     722       IF (flag_pr_lsc_i(iff)<=lev_files(iff)) THEN
     723       CALL histwrite_phy(nid_files(iff),"psfl",itau_w,psfl)
    708724       ENDIF
    709725
  • LMDZ4/trunk/libf/phylmd/physiq.F

    r927 r929  
    18761876c#endif
    18771877
    1878       call phys_output_open ( jj_nb, jjmp1, nqmax,
    1879      &               nlevSTD, clevSTD, nbteta, ctetaSTD,
    1880      &      dtime, presnivs, ok_veget, ocean, iflag_pbl,
    1881      &               ok_mensuel,ok_journe,ok_hf,ok_instan,
    1882      &               rlon, rlat, nid_files)
    1883 
     1878       call phys_output_open(jjmp1,nqmax,nlevSTD,clevSTD,nbteta,
     1879     &                        ctetaSTD,dtime,presnivs,ok_veget,
     1880     &                        ocean,iflag_pbl,ok_mensuel,ok_journe,
     1881     &                        ok_hf,ok_instan,nid_files)
    18841882
    18851883#ifdef histISCCP
     
    36383636!==========================================================================
    36393637
    3640       if (klon.eq.1) then
     3638      if (1.eq.1) then
    36413639      write(lunout,*) 'FIN DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
    36423640      write(lunout,*)
    3643      s 'nlon,nlev,nqmax,debut,lafin,rjourvrai,gmtime,pdtphys'
     3641     s 'nlon,nlev,nqmax,debut,lafin,rjourvrai,gmtime,pdtphys pct tlos'
    36443642      write(lunout,*)
    3645      s  nlon,nlev,nqmax,debut,lafin,rjourvrai,gmtime,pdtphys
     3643     s  nlon,nlev,nqmax,debut,lafin,rjourvrai,gmtime,pdtphys,
     3644     s  pctsrf(igout,is_ter), pctsrf(igout,is_lic), pctsrf(igout,is_oce),
     3645     s  pctsrf(igout,is_sic)
    36463646      write(lunout,*) 'd_t_dyn,d_t_con,d_t_lsc,d_t_ajsb,d_t_ajs,d_t_eva'
    36473647      do k=1,nlev
Note: See TracChangeset for help on using the changeset viewer.