!
! $Header$
!
#ifndef INCA
c$OMP MASTER 
         CALL ymds2ju(annee_ref, 1, day_ref, 0.0, zjulian)
c
cym         CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlon,zx_lon)
cym         DO i = 1, iim
cym            zx_lon(i,1) = xlon(i+1)
cym            zx_lon(i,jjm+1) = xlon(i+1)
cym         ENDDO
cym         CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlat,zx_lat)
cym         CALL histbeg("histrac", iim,zx_lon(:,1), jjm+1,zx_lat(1,:),
cym     .                 1,iim,1,jjm+1, itau_phy, zjulian, pdtphys,
cym     .                 nhori, nid_tra)
         CALL histbeg_phy("histrac", itau_phy, zjulian, pdtphys,
     .                 nhori, nid_tra)
         CALL histvert(nid_tra, "presnivs", "Vertical levels", "mb",
     .                 klev, presnivs, nvert)



         zsto = pdtphys
         zout = pdtphys * ecrit_tra
c
         CALL histdef(nid_tra, "phis", "Surface geop. height", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "once",  zsto,zout)
c
         CALL histdef(nid_tra, "aire", "Grid area", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "once",  zsto,zout)
         DO it=1,nqmax
C champ 2D
         iq=it+2
         iiq=niadv(iq)
         CALL histdef(nid_tra, tnom(iq), ttext(iiq), "U/kga",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         if (lessivage) THEN
         CALL histdef(nid_tra, "fl"//tnom(iq),"Flux "//ttext(iiq),
     .              "U/m2/s",iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .              "ave(X)", zsto,zout)
         endif

c---Ajout Olivia
         CALL histdef(nid_tra, "d_tr_th_"//tnom(iq),
     .	              "tendance thermique"// ttext(iiq), "?",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "d_tr_cv_"//tnom(iq),
     .	              "tendance convection"// ttext(iiq), "?",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "d_tr_cl_"//tnom(iq),
     .	              "tendance couche limite"// ttext(iiq), "?",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
c---fin Olivia	 

         ENDDO

         CALL histdef(nid_tra, "pyu1", "Vent niv 1", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)

         CALL histdef(nid_tra, "pyv1", "Vent niv 1", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "psrf1", "nature sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "psrf2", "nature sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "psrf3", "nature sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "psrf4", "nature sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "ftsol1", "temper sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "ftsol2", "temper sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "ftsol3", "temper sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst",  zout,zout)
         CALL histdef(nid_tra, "ftsol4", "temper sol", "-",
     .                iim,jj_nb,nhori, 1,1,1, -99, 32,
     .                "inst(X)",  zout,zout)
         CALL histdef(nid_tra, "pplay", "flux u mont","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "inst(X)", zout,zout)
         CALL histdef(nid_tra, "t", "flux u mont","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "inst(X)", zout,zout)
         CALL histdef(nid_tra, "mfu", "flux u mont","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "mfd", "flux u decen","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "en_u", "flux u mont","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "en_d", "flux u mont","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "de_d", "flux u mont","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "de_u", "flux u decen","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)
         CALL histdef(nid_tra, "coefh", "turbulent coef","-",
     .                iim,jj_nb,nhori, klev,1,klev,nvert, 32,
     .                "ave(X)", zsto,zout)

c
         CALL histend(nid_tra)
         ndex2d = 0
         ndex3d = 0
         ndex = 0
c$OMP END MASTER
#endif
