!
! $Header$
!
#ifndef INCA
      ndex = 0
      ndex2d = 0
      ndex3d = 0
c
      itau_w = itau_phy + nstep

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,pphis,zx_tmp_2d)
      CALL histwrite_phy(nid_tra,"phis",itau_w,pphis)
C
cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,airephy,zx_tmp_2d)      
      CALL histwrite_phy(nid_tra,"aire",itau_w,airephy)

      DO it=1,nqmax
C champs 2D


cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,tr_seri(1,1,it),zx_tmp_3d)
       CALL histwrite_phy(nid_tra,tnom(it+2),itau_w,tr_seri(:,:,it))
       if (lessivage) THEN
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,flestottr(1,1,it),zx_tmp_3d)
       CALL histwrite_phy(nid_tra,"fl"//tnom(it+2),itau_w,
     .                                   flestottr(:,:,it))
      endif
      
c----Olivia
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_th(1,1,it),zx_tmp_3d)
       CALL histwrite_phy(nid_tra,"d_tr_th_"//tnom(it+2),itau_w,
     .                                           d_tr_th(:,:,it))
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_cv(1,1,it),zx_tmp_3d)
       CALL histwrite_phy(nid_tra,"d_tr_cv_"//tnom(it+2),itau_w,
     .                                           d_tr_cv(:,:,it))
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,d_tr_cl(1,1,it),zx_tmp_3d)
       CALL histwrite_phy(nid_tra,"d_tr_cl_"//tnom(it+2),itau_w,
     .                                           d_tr_cl(:,:,it))
c---fin Olivia      
      
      ENDDO


C abder
cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,yu1,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"pyu1",itau_w,yu1)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,yv1,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"pyv1",itau_w,yv1)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,pftsol1,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"ftsol1",itau_w,pftsol1)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,pftsol2,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"ftsol2",itau_w,pftsol2)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,pftsol3,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"ftsol3",itau_w,pftsol3)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,pftsol4,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"ftsol4",itau_w,pftsol4)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,ppsrf1,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"psrf1",itau_w,ppsrf1)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,ppsrf2,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"psrf2",itau_w,ppsrf2)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,ppsrf3,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"psrf3",itau_w,ppsrf3)

cym      CALL gr_fi_ecrit(1,klon,iim,jjm+1,ppsrf4,zx_tmp_2d)
         CALL histwrite_phy(nid_tra,"psrf4",itau_w,ppsrf4)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,pplay,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"pplay",itau_w,pplay)

cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,t_seri,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"t",itau_w,t_seri)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,pmfu,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"mfu",itau_w,pmfu)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,pmfd,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"mfd",itau_w,pmfd)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,pen_u,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"en_u",itau_w,pen_u)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,pen_d,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"en_d",itau_w,pen_d)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,pde_d,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"de_d",itau_w,pde_d)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,pde_u,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"de_u",itau_w,pde_u)
cym      CALL gr_fi_ecrit(klev,klon,iim,jjm+1,coefh,zx_tmp_3d)
        CALL histwrite_phy(nid_tra,"coefh",itau_w,coefh)


c abder

      if (ok_sync) then
c$OMP MASTER
        call histsync(nid_tra)
c$OMP END MASTER
       endif

#endif



