Ignore:
Timestamp:
Mar 21, 2002, 4:09:32 PM (23 years ago)
Author:
lmdzadmin
Message:

2 changements pour les fichiers histoire:

  • utilisation de l'entree "rectilineaire" de IOIPSL pour ne plus avoir

a

lancer ncregular a chaque fois

  • le calendrier des fichiers histoire est maintenant base sur la date d'initialisation de la simulation plutot que sur la date de depart du

job

en cours

LF

Location:
LMDZ.3.3/branches/rel-LF/libf
Files:
1 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • LMDZ.3.3/branches/rel-LF/libf/bibio/initdynav.F

    r350 r353  
     1c
     2c $Header$
     3c
    14      subroutine initdynav(infile,day0,anne0,tstep,t_ops,t_wrt
    25     .                     ,nq,fileid)
  • LMDZ.3.3/branches/rel-LF/libf/bibio/initfluxsto.F

    r177 r353  
    6666      integer uhoriid, vhoriid, thoriid, zvertiid,dhoriid,dvertiid
    6767      integer ii,jj
    68       integer zan
     68      integer zan, idayref
    6969      logical ok_sync
    7070C
     
    7979C         
    8080
    81       zan = anne_ini
    82       CALL ymds2ju(zan, 1, 1, 0.0, zjulian)
    83       zjulian = zjulian + day_ini
    84       tau0 = 0
     81      zan = annee_ref
     82      idayref = day_ref
     83      CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
     84      tau0 = itau_dyn
    8585       
    8686        do jj = 1, jjp1
     
    9191      enddo
    9292 
    93       call histbeg(infile, iip1, rlong, jjp1, rlat,
     93      call histbeg(infile, iip1, rlong(:,1), jjp1, rlat(1,:),
    9494     .             1, iip1, 1, jjp1,
    9595     .             tau0, zjulian, tstep, uhoriid, fileid)
     
    107107      enddo
    108108
    109       call histbeg('fluxstokev.nc', iip1, rlong, jjm, rlat,
     109      call histbeg('fluxstokev.nc', iip1, rlong(:,1), jjm, rlat(1,:),
    110110     .             1, iip1, 1, jjm,
    111111     .             tau0, zjulian, tstep, vhoriid, filevid)
  • LMDZ.3.3/branches/rel-LF/libf/bibio/inithist.F

    r177 r353  
    6464      integer uhoriid, vhoriid, thoriid, zvertiid
    6565      integer ii,jj
    66       integer zan
     66      integer zan, dayref
    6767C
    6868C  Initialisations
     
    7676
    7777      zan = anne0
    78       CALL ymds2ju(zan, 1, 1, 0.0, zjulian)
    79       zjulian = zjulian + day0
    80       tau0 = 0
     78      dayref = day0
     79      CALL ymds2ju(zan, 1, dayref, 0.0, zjulian)
     80      tau0 = itau_dyn
    8181     
    8282      do jj = 1, jjp1
     
    8787      enddo
    8888       
    89       call histbeg(infile, iip1, rlong, jjp1, rlat,
     89      call histbeg(infile, iip1, rlong(:,1), jjp1, rlat(1,:),
    9090     .             1, iip1, 1, jjp1,
    9191     .             tau0, zjulian, tstep, uhoriid, fileid)
     
    102102      enddo
    103103
    104       call histbeg('dyn_histv.nc', iip1, rlong, jjm, rlat,
     104      call histbeg('dyn_histv.nc', iip1, rlong(:,1), jjm, rlat(1,:),
    105105     .             1, iip1, 1, jjm,
    106106     .             tau0, zjulian, tstep, vhoriid, filevid)
  • LMDZ.3.3/branches/rel-LF/libf/bibio/writedynav.F

    r295 r353  
    6464      REAL vnat(ip1jm,llm),unat(ip1jmp1,llm)
    6565      logical ok_sync
     66      integer itau_w
    6667C
    6768C  Initialisations
     
    7677      vnat = 999.999
    7778      unat = 999.999
     79      itau_w = itau_dyn + time
    7880
    7981C Passage aux composantes naturelles du vent
     
    8688C
    8789      call gr_u_scal(llm, unat, us)
    88       call histwrite(histid, 'u', time, us,
     90      call histwrite(histid, 'u', itau_w, us,
    8991     .               iip1*jjp1*llm, ndex3d)
    9092C
     
    9294C
    9395      call gr_v_scal(llm, vnat, vs)
    94       call histwrite(histid, 'v', time, vs,
     96      call histwrite(histid, 'v', itau_w, vs,
    9597     .               iip1*jjp1*llm, ndex3d)
    9698C
    9799C  Temperature potentielle moyennee
    98100C
    99       call histwrite(histid, 'theta', time, teta,
     101      call histwrite(histid, 'theta', itau_w, teta,
    100102     .                iip1*jjp1*llm, ndex3d)
    101103C
     
    105107        tm(ii) = teta(ii) * ppk(ii)/cpp
    106108      enddo
    107       call histwrite(histid, 'temp', time, tm,
     109      call histwrite(histid, 'temp', itau_w, tm,
    108110     .                iip1*jjp1*llm, ndex3d)
    109111C
    110112C  Geopotentiel
    111113C
    112       call histwrite(histid, 'phi', time, phi,
     114      call histwrite(histid, 'phi', itau_w, phi,
    113115     .                iip1*jjp1*llm, ndex3d)
    114116C
     
    122124            WRITE(str(2:3),'(i2.2)') iq
    123125          ENDIF
    124           call histwrite(histid, str, time, q(:,:,iq),
     126          call histwrite(histid, str, itau_w, q(:,:,iq),
    125127     .                   iip1*jjp1*llm, ndex3d)
    126128        enddo
     
    129131C  Masse
    130132C
    131        call histwrite(histid, 'masse', time, masse, iip1*jjp1, ndex2d)
     133       call histwrite(histid, 'masse', itau_w, masse, iip1*jjp1, ndex2d)
    132134C
    133135C  Pression au sol
    134136C
    135        call histwrite(histid, 'ps', time, ps, iip1*jjp1, ndex2d)
     137       call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
    136138C
    137139C  Geopotentiel au sol
    138140C
    139        call histwrite(histid, 'phis', time, phis, iip1*jjp1, ndex2d)
     141       call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)
    140142C
    141143C  Fin
  • LMDZ.3.3/branches/rel-LF/libf/bibio/writehist.F

    r30 r353  
    6363      character*3 str
    6464      logical ok_sync
     65      integer itau_w
    6566C
    6667C  Initialisations
     
    7172      ndex2d = 0
    7273      ok_sync =.TRUE.
     74      itau_w = itau_dyn + time
    7375C
    7476C  Appels a histwrite pour l'ecriture des variables a sauvegarder
     
    7678C  Vents U
    7779C
    78       call histwrite(histid, 'ucov', time, ucov,
     80      call histwrite(histid, 'ucov', itau_w, ucov,
    7981     .               iip1*jjp1*llm, ndexu)
    8082
     
    8284C  Vents V
    8385C
    84       call histwrite(histvid, 'vcov', time, vcov,
     86      call histwrite(histvid, 'vcov', itau_w, vcov,
    8587     .               iip1*jjm*llm, ndexv)
    8688
     
    8890C  Temperature potentielle
    8991C
    90       call histwrite(histid, 'teta', time, teta,
     92      call histwrite(histid, 'teta', itau_w, teta,
    9193     .                iip1*jjp1*llm, ndexu)
    9294C
    9395C  Geopotentiel
    9496C
    95       call histwrite(histid, 'phi', time, phi,
     97      call histwrite(histid, 'phi', itau_w, phi,
    9698     .                iip1*jjp1*llm, ndexu)
    9799C
     
    105107            WRITE(str(2:3),'(i2.2)') iq
    106108          ENDIF
    107           call histwrite(histid, str, time, q(:,:,iq),
     109          call histwrite(histid, str, itau_w, q(:,:,iq),
    108110     .                   iip1*jjp1*llm, ndexu)
    109111        enddo
     
    112114C  Masse
    113115C
    114       call histwrite(histid, 'masse', time, masse, iip1*jjp1, ndex2d)
     116      call histwrite(histid, 'masse', itau_w, masse, iip1*jjp1, ndex2d)
    115117C
    116118C  Pression au sol
    117119C
    118       call histwrite(histid, 'ps', time, ps, iip1*jjp1, ndex2d)
     120      call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d)
    119121C
    120122C  Geopotentiel au sol
    121123C
    122       call histwrite(histid, 'phis', time, phis, iip1*jjp1, ndex2d)
     124      call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)
    123125C
    124126C  Fin
  • LMDZ.3.3/branches/rel-LF/libf/bibio/writephys.F90

    r284 r353  
    9393  real, dimension(llm) :: zlev
    9494  real                 :: date0, dtime
     95  integer              :: itau_deb
    9596!
    9697! Variables locales
     
    121122! Initialisation du fichier
    122123!
    123   call histbeg(nom_fichier, iim, temp_lon, jjm, temp_lat, &
    124      &                 1, iim, 1, jjm, 0, date0, dtime, &
     124  call histbeg(nom_fichier, iim, temp_lon(:,1), jjm, temp_lat(1,:), &
     125     &                 1, iim, 1, jjm, itau_deb, date0, dtime, &
    125126     &                 nhori, file_id)
    126127  call histvert(file_id, "presnivs", "Vertical levels", "mb", &
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/create_etat0_limit.F

    r325 r353  
    1818
    1919      LOGICAL interbar, extrap , oldice
    20       PARAMETER ( interbar = .TRUE. , extrap = .FALSE. , oldice=.TRUE.)
     20      PARAMETER ( interbar = .TRUE. , extrap = .FALSE. , oldice=.true.)
    2121#include "dimensions.h"
    2222#include "paramet.h"
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/dynetat0.F

    r232 r353  
    8282      jm         = tab_cntrl(2)
    8383      lllm       = tab_cntrl(3)
    84       day_ini    = tab_cntrl(4)
    85       anne_ini   = tab_cntrl(5)
     84      day_ref    = tab_cntrl(4)
     85      annee_ref  = tab_cntrl(5)
    8686      rad        = tab_cntrl(6)
    8787      omeg       = tab_cntrl(7)
     
    115115        IF( tab_cntrl(27).EQ.1. ) ysinus = . TRUE.
    116116      ENDIF
     117
     118      day_ini = tab_cntrl(30)
     119      itau_dyn = tab_cntrl(31)
    117120c   .................................................................
    118121c
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/dynredem.F

    r232 r353  
    11c $Header$
    22c
    3       SUBROUTINE dynredem0(fichnom,idayref,anneeref,phis,nq)
     3      SUBROUTINE dynredem0(fichnom,iday_end,phis,nq)
    44      USE IOIPSL
    55      IMPLICIT NONE
     
    2323c   Arguments:
    2424c   ----------
    25       INTEGER*4 idayref,anneeref
     25      INTEGER iday_end
    2626      REAL phis(ip1jmp1)
    2727      CHARACTER*(*) fichnom
     
    5656      modname='dynredem'
    5757
    58       call ymds2ju(anneeref,1,idayref,0.0, zjulian)
    59       call ju2ymds(zjulian, yyears0,mmois0,jjour0,hours)
     58      call ymds2ju(annee_ref, 1, iday_end, 0.0, zjulian)
     59      call ju2ymds(zjulian, yyears0, mmois0, jjour0, hours)
    6060       
    6161
     
    6666       tab_cntrl(2)  = FLOAT(jjm)
    6767       tab_cntrl(3)  = FLOAT(llm)
    68        tab_cntrl(4)  = FLOAT(idayref)
    69        tab_cntrl(5)  = FLOAT(anneeref)
     68       tab_cntrl(4)  = FLOAT(day_ref)
     69       tab_cntrl(5)  = FLOAT(annee_ref)
    7070       tab_cntrl(6)  = rad
    7171       tab_cntrl(7)  = omeg
     
    106106       IF( ysinus )  tab_cntrl(27) = 1.
    107107      ENDIF
     108
     109       tab_cntrl(30) = FLOAT(iday_end)
     110       tab_cntrl(31) = FLOAT(itau_dyn + itaufin)
    108111c
    109112c    .........................................................
     
    378381      ierr = NF_CLOSE(nid) ! fermer le fichier
    379382
    380       PRINT*,'iim,jjm,llm,idayref',iim,jjm,llm,idayref
     383      PRINT*,'iim,jjm,llm,iday_end',iim,jjm,llm,iday_end
    381384      PRINT*,'rad,omeg,g,cpp,kappa',
    382385     ,        rad,omeg,g,cpp,kappa
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/gcm.F

    r295 r353  
    299299      PRINT 300, itau,itaufin,day_ini,day_end
    300300
    301       CALL dynredem0("restart.nc",day_end,anne_ini,phis,nqmx)
     301      CALL dynredem0("restart.nc", day_end, phis, nqmx)
    302302
    303303      ecripar = .TRUE.
     
    306306      t_ops = iecri * daysec
    307307      t_wrt = iecri * daysec
    308 C      CALL inithist(dynhist_file,day_ini,anne_ini,time_step,
     308C      CALL inithist(dynhist_file,day_ref,annee_ref,time_step,
    309309c     .              t_ops, t_wrt, nqmx, histid, histvid)
    310310
    311311      t_ops = iperiod * time_step
    312312      t_wrt = periodav * daysec
    313       CALL initdynav(dynhistave_file,day_ini,anne_ini,time_step,
     313      CALL initdynav(dynhistave_file,day_ref,annee_ref,time_step,
    314314     .              t_ops, t_wrt, nqmx, histaveid)
    315315
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/limit_netcdf.F

    r327 r353  
    226226     . dlon_msk, dlat_msk, champ_msk, interbar  )
    227227
    228       CALL mask_c_o(imdep, jmdep, dlon_msk, dlat_msk,champ_msk,
    229      .             iim, jjp1, rlonv, rlatu, champint)
    230 c      CALL gr_int_dyn(champint, masque, iim, jjp1)
    231 c      DO i = 1, iim
    232 c         masque(i,1) = FLOAT(NINT(masque(i,1)))
    233 c         masque(i,jjp1) = FLOAT(NINT(masque(i,jjp1)))
    234 c      ENDDO
    235228      DO i = 1, iim
    236229      DO j = 1, jjp1
    237          mask(i,j) = champint(i,j)
    238       ENDDO
    239       ENDDO
    240 c      CALL gr_dyn_fi(1, iip1, jjp1, klon, masque, phy_nat0)
     230         mask(i,j) = masque(i,j)
     231      ENDDO
     232      ENDDO
    241233      ierr = NF_CLOSE(ncid)
    242234c
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/offlinenc.F

    r232 r353  
    200200      else
    201201         day_ini=0
    202          anne_ini=0
     202         annee_ref=0
    203203      endif
    204204
     
    347347      close(98)
    348348
    349       CALL dynredem0("restart.nc",day_end,anne_ini,phis,nq)
     349      CALL dynredem0("restart.nc",day_end,phis,nq)
    350350
    351351c-----------------------------------------------------------------------
     
    398398         dynhistave_file = 'histmoy.nc'
    399399         day_ini=0
    400          anne_ini=0
     400         annee_ref=0
    401401         t_ops =(1./48.)*daysec
    402402         t_wrt =(1./48.)*daysec
     
    404404         mode=1
    405405
    406 c        CALL initdynav(dynhistave_file,day_ini,anne_ini,dtav,
     406c        CALL initdynav(dynhistave_file,day_ini,annee_ref,dtav,
    407407c    .              t_ops, t_wrt, nq,mode, histaveid)
    408408
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/temps.h

    r179 r353  
    44! INCLUDE 'temps.h'
    55
    6       COMMON/temps/itaufin,dt, day_ini,day_end,anne_ini
     6      COMMON/temps/itaufin, dt, day_ini, day_end, annee_ref, day_ref,
     7     .             itau_dyn, itau_phy
    78
    8       INTEGER  itaufin
    9       INTEGER*4 day_ini,day_end,anne_ini
    10       REAL     dt
     9      INTEGER   itaufin
     10      INTEGER*4 itau_dyn, itau_phy
     11      INTEGER*4 day_ini, day_end, annee_ref, day_ref
     12      REAL      dt
    1113
    1214!-----------------------------------------------------------------------
  • LMDZ.3.3/branches/rel-LF/libf/dyn3d/temps.inc

    r117 r353  
     1!
     2! $Header$
     3!
    14!-----------------------------------------------------------------------
    25! INCLUDE 'temps.h'
    36
    4       COMMON/temps/itaufin,dt, &
    5      &  day_ini,day_end,anne_ini
     7      COMMON/temps/itaufin, dt, &
     8     &  day_ini, day_end, annee_ref, day_ref, itau_dyn, itau_phy
    69
    710      INTEGER  itaufin
    8       INTEGER*4 day_ini,day_end,anne_ini
     11      INTEGER*4 itau_dyn, itau_phy
     12      INTEGER*4 day_ini, day_end, annee_ref, day_ref
    913      REAL     dt
    1014
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/clmain.F

    r341 r353  
    201201      SAVE debugindex
    202202      DATA debugindex/.false./
     203      integer idayref
    203204#include "temps.h"
    204205     
     
    208209! initialisation sorties netcdf
    209210!
    210           CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
    211           zjulian = zjulian + day_ini
     211          idayref = day_ini
     212          CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    212213          CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlon,zx_lon)
    213214          DO i = 1, iim
     
    217218          CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlat,zx_lat)
    218219          cldebug='sous_index'
    219           CALL histbeg(cldebug, iim,zx_lon,jjm+1,zx_lat,1,iim,1,jjm
    220      $        +1, 0,zjulian,dtime,nhoridbg,nidbg)
     220          CALL histbeg(cldebug, iim,zx_lon(:,1),jjm+1,zx_lat(1,:),
     221     $        1,iim,1,jjm
     222     $        +1, itau_phy,zjulian,dtime,nhoridbg,nidbg)
    221223! no vertical axis
    222224          cl_surf(1)='ter'
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/condsurf.F

    r258 r353  
    6767c  .............   modif  (  P. Le Van )  ...........
    6868
    69        anneelim  = anne_ini
    70        anneemax  = anne_ini + nannemax
     69       anneelim  = annee_ref
     70       anneemax  = annee_ref + nannemax
    7171c
    7272c
     
    8383         PRINT *,' PBS ! Le jour a lire sur le fichier limit ne se '
    8484         PRINT *,' trouve pas sur les ',nannemax,' annees a partir de '
    85          PRINT *,' l annee de debut', anne_ini
     85         PRINT *,' l annee de debut', annee_ref
    8686           CALL EXIT(1)
    8787c
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/initphysto.F

    r230 r353  
    6868      integer uhoriid, vhoriid, thoriid, zvertiid
    6969      integer ii,jj
    70       integer zan
     70      integer zan, idayref
    7171      logical ok_sync
    7272      REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
     
    8585
    8686      zan = anneeref
    87       CALL ymds2ju(zan, 1, 1, 0.0, zjulian)
    88       zjulian = zjulian + dayref
     87      idayref = dayref
     88      CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
    8989      tau0 = 0
    9090       
     
    9797
    9898
    99       call histbeg(infile, iim, zx_lon, jjm+1, zx_lat,
     99      call histbeg(infile, iim, zx_lon(:,1), jjm+1, zx_lat(1,:),
    100100     .             1, iim, 1, jjm+1,
    101101     .             tau0, zjulian, tstep, nhoriid, fileid)
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/interface_surf.F90

    r313 r353  
    12391239  INTEGER :: ndexct(iim*(jjm+1)),ndexcs(iim*(jjm+1))
    12401240  REAL :: zx_lon(iim,jjm+1), zx_lat(iim,jjm+1), zjulian
     1241  integer :: idayref, itau_w
    12411242  include 'param_cou.h'
    12421243  include 'inc_cpl.h'
    1243   include 'temps.h'
     1244  include 'temps.inc'
    12441245!
    12451246! Initialisation
     
    13101311! initialisation sorties netcdf
    13111312!
    1312     CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
    1313     zjulian = zjulian + day_ini
     1313    idayref = day_ini
     1314    CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    13141315    CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlon,zx_lon)
    13151316    DO i = 1, iim
     
    13191320    CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlat,zx_lat)
    13201321    clintocplnam="cpl_atm_tauflx"
    1321     CALL histbeg(clintocplnam, iim,zx_lon,jjm+1,zx_lat,1,iim,1,jjm+1, &
    1322        & 0,zjulian,dtime,nhoridct,nidct)
     1322    CALL histbeg(clintocplnam, iim,zx_lon(:,1),jjm+1,zx_lat(1,:),1,iim,1,jjm+1, &
     1323       & itau_phy,zjulian,dtime,nhoridct,nidct)
    13231324! no vertical axis
    13241325    CALL histdef(nidct, 'tauxe','tauxe', &
     
    13381339
    13391340    clfromcplnam="cpl_atm_sst"
    1340     CALL histbeg(clfromcplnam, iim,zx_lon,jjm+1,zx_lat,1,iim,1,jjm+1, &
     1341    CALL histbeg(clfromcplnam, iim,zx_lon(:,1),jjm+1,zx_lat(1,:),1,iim,1,jjm+1, &
    13411342       & 0,zjulian,dtime,nhoridcs,nidcs)
    13421343! no vertical axis
     
    14191420!
    14201421      ndexcs(:)=0
    1421       CALL histwrite(nidcs,cl_read(1),itime,read_sst,iim*(jjm+1),ndexcs)
    1422       CALL histwrite(nidcs,cl_read(2),itime,read_sic,iim*(jjm+1),ndexcs)
    1423       CALL histwrite(nidcs,cl_read(3),itime,read_alb_sic,iim*(jjm+1),ndexcs)
    1424       CALL histwrite(nidcs,cl_read(4),itime,read_sit,iim*(jjm+1),ndexcs)
     1422      itau_w = itau_phy + itime
     1423      CALL histwrite(nidcs,cl_read(1),itau_w,read_sst,iim*(jjm+1),ndexcs)
     1424      CALL histwrite(nidcs,cl_read(2),itau_w,read_sic,iim*(jjm+1),ndexcs)
     1425      CALL histwrite(nidcs,cl_read(3),itau_w,read_alb_sic,iim*(jjm+1),ndexcs)
     1426      CALL histwrite(nidcs,cl_read(4),itau_w,read_sit,iim*(jjm+1),ndexcs)
    14251427      CALL histsync(nidcs)
    14261428! pas utile      IF (npas-itime.LT.nexca )CALL histclo(nidcs)
     
    15821584!
    15831585      ndexct(:)=0
    1584       CALL histwrite(nidct,'tauxe',itime,wri_taux,iim*(jjm+1),ndexct)
    1585       CALL histwrite(nidct,'tauyn',itime,wri_tauy,iim*(jjm+1),ndexct)
    1586       CALL histwrite(nidct,'tmp_lon',itime,tmp_lon,iim*(jjm+1),ndexct)
    1587       CALL histwrite(nidct,'tmp_lat',itime,tmp_lat,iim*(jjm+1),ndexct)
     1586      CALL histwrite(nidct,'tauxe',itau_w,wri_taux,iim*(jjm+1),ndexct)
     1587      CALL histwrite(nidct,'tauyn',itau_w,wri_tauy,iim*(jjm+1),ndexct)
     1588      CALL histwrite(nidct,'tmp_lon',itau_w,tmp_lon,iim*(jjm+1),ndexct)
     1589      CALL histwrite(nidct,'tmp_lat',itau_w,tmp_lat,iim*(jjm+1),ndexct)
    15881590
    15891591!
     
    15961598! envoi au coupleur
    15971599!
    1598       CALL histwrite(nidct,cl_writ(1),itime,wri_sol_ice,iim*(jjm+1),ndexct)
    1599       CALL histwrite(nidct,cl_writ(2),itime,wri_sol_sea,iim*(jjm+1),ndexct)
    1600       CALL histwrite(nidct,cl_writ(3),itime,wri_nsol_ice,iim*(jjm+1),ndexct)
    1601       CALL histwrite(nidct,cl_writ(4),itime,wri_nsol_sea,iim*(jjm+1),ndexct)
    1602       CALL histwrite(nidct,cl_writ(5),itime,wri_fder_ice,iim*(jjm+1),ndexct)
    1603       CALL histwrite(nidct,cl_writ(6),itime,wri_evap_ice,iim*(jjm+1),ndexct)
    1604       CALL histwrite(nidct,cl_writ(7),itime,wri_evap_sea,iim*(jjm+1),ndexct)
    1605       CALL histwrite(nidct,cl_writ(8),itime,wri_rain,iim*(jjm+1),ndexct)
    1606       CALL histwrite(nidct,cl_writ(9),itime,wri_snow,iim*(jjm+1),ndexct)
    1607       CALL histwrite(nidct,cl_writ(10),itime,wri_rcoa,iim*(jjm+1),ndexct)
    1608       CALL histwrite(nidct,cl_writ(11),itime,wri_rriv,iim*(jjm+1),ndexct)
    1609       CALL histwrite(nidct,cl_writ(12),itime,wri_tauxx,iim*(jjm+1),ndexct)
    1610       CALL histwrite(nidct,cl_writ(13),itime,wri_tauyy,iim*(jjm+1),ndexct)
    1611       CALL histwrite(nidct,cl_writ(14),itime,wri_tauzz,iim*(jjm+1),ndexct)
    1612       CALL histwrite(nidct,cl_writ(15),itime,wri_tauxx,iim*(jjm+1),ndexct)
    1613       CALL histwrite(nidct,cl_writ(16),itime,wri_tauyy,iim*(jjm+1),ndexct)
    1614       CALL histwrite(nidct,cl_writ(17),itime,wri_tauzz,iim*(jjm+1),ndexct)
     1600      CALL histwrite(nidct,cl_writ(1),itau_w,wri_sol_ice,iim*(jjm+1),ndexct)
     1601      CALL histwrite(nidct,cl_writ(2),itau_w,wri_sol_sea,iim*(jjm+1),ndexct)
     1602      CALL histwrite(nidct,cl_writ(3),itau_w,wri_nsol_ice,iim*(jjm+1),ndexct)
     1603      CALL histwrite(nidct,cl_writ(4),itau_w,wri_nsol_sea,iim*(jjm+1),ndexct)
     1604      CALL histwrite(nidct,cl_writ(5),itau_w,wri_fder_ice,iim*(jjm+1),ndexct)
     1605      CALL histwrite(nidct,cl_writ(6),itau_w,wri_evap_ice,iim*(jjm+1),ndexct)
     1606      CALL histwrite(nidct,cl_writ(7),itau_w,wri_evap_sea,iim*(jjm+1),ndexct)
     1607      CALL histwrite(nidct,cl_writ(8),itau_w,wri_rain,iim*(jjm+1),ndexct)
     1608      CALL histwrite(nidct,cl_writ(9),itau_w,wri_snow,iim*(jjm+1),ndexct)
     1609      CALL histwrite(nidct,cl_writ(10),itau_w,wri_rcoa,iim*(jjm+1),ndexct)
     1610      CALL histwrite(nidct,cl_writ(11),itau_w,wri_rriv,iim*(jjm+1),ndexct)
     1611      CALL histwrite(nidct,cl_writ(12),itau_w,wri_tauxx,iim*(jjm+1),ndexct)
     1612      CALL histwrite(nidct,cl_writ(13),itau_w,wri_tauyy,iim*(jjm+1),ndexct)
     1613      CALL histwrite(nidct,cl_writ(14),itau_w,wri_tauzz,iim*(jjm+1),ndexct)
     1614      CALL histwrite(nidct,cl_writ(15),itau_w,wri_tauxx,iim*(jjm+1),ndexct)
     1615      CALL histwrite(nidct,cl_writ(16),itau_w,wri_tauyy,iim*(jjm+1),ndexct)
     1616      CALL histwrite(nidct,cl_writ(17),itau_w,wri_tauzz,iim*(jjm+1),ndexct)
    16151617      CALL histsync(nidct)
    16161618! pas utile      IF (lafin) CALL histclo(nidct)
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/phyetat0.F

    r151 r353  
     1c
     2c $Header$
     3c
    14      SUBROUTINE phyetat0 (fichnom,dtime,co2_ppm,solaire,
    25     .            rlat,rlon, pctsrf, tsol,tsoil,deltat,qsol,snow,
     
    1619#include "dimsoil.h"
    1720#include "clesphys.h"
     21#include "temps.h"
    1822c======================================================================
    1923      CHARACTER*(*) fichnom
     
    3741      real fder(klon)
    3842      REAL frugs(klon,nbsrf)
    39       REAL agesno(klon)
     43      REAL agesno(klon,nbsrf)
    4044      REAL zmea(klon)
    4145      REAL zstd(klon)
     
    161165
    162166      ENDIF
     167
     168      itau_phy = tab_cntrl(15)
     169
    163170c
    164171c Lecture des latitudes (coordonnees):
     
    874881            xmax = MAX(frugs(i,1),xmax)
    875882         ENDDO
    876          PRINT*,'Neige du sol <RUG>', xmin, xmax
     883         PRINT*,'rugosite <RUG>', xmin, xmax
    877884         DO nsrf = 2, nbsrf
    878885         DO i = 1, klon
     
    888895      IF (ierr.NE.NF_NOERR) THEN
    889896         PRINT*, 'phyetat0: Le champ <AGESNO> est absent'
    890          PRINT*, "          Valeur par default: 50"
    891          DO i = 1, klon
    892             agesno(i) = 50.0
    893          ENDDO
    894       ELSE
    895 #ifdef NC_DOUBLE
    896          ierr = NF_GET_VAR_DOUBLE(nid, nvarid, agesno)
    897 #else
    898          ierr = NF_GET_VAR_REAL(nid, nvarid, agesno)
     897         PRINT*, '          Mais je vais essayer de lire AGESNO**'
     898         DO nsrf = 1, nbsrf
     899           IF (nsrf.GT.99) THEN
     900             PRINT*, "Trop de sous-mailles"
     901             CALL abort
     902           ENDIF
     903           WRITE(str2,'(i2.2)') nsrf
     904           ierr = NF_INQ_VARID (nid, "AGESNO"//str2, nvarid)
     905           IF (ierr.NE.NF_NOERR) THEN
     906              PRINT*, "phyetat0: Le champ <AGESNO"//str2//"> est absent"
     907              agesno = 50.0
     908           ENDIF
     909#ifdef NC_DOUBLE
     910           ierr = NF_GET_VAR_DOUBLE(nid, nvarid, agesno(1,nsrf))
     911#else
     912           ierr = NF_GET_VAR_REAL(nid, nvarid, agesno(1,nsrf))
     913#endif
     914           IF (ierr.NE.NF_NOERR) THEN
     915             PRINT*, "phyetat0: Lecture echouee pour <AGESNO"//str2//">"
     916             CALL abort
     917           ENDIF
     918           xmin = 1.0E+20
     919           xmax = -1.0E+20
     920           DO i = 1, klon
     921              xmin = MIN(agesno(i,nsrf),xmin)
     922              xmax = MAX(agesno(i,nsrf),xmax)
     923           ENDDO
     924           PRINT*,'Age de la neige AGESNO**:', nsrf, xmin, xmax
     925         ENDDO
     926      ELSE
     927         PRINT*, 'phyetat0: Le champ <AGESNO> est present'
     928         PRINT*, '          J ignore donc les autres AGESNO**'
     929#ifdef NC_DOUBLE
     930         ierr = NF_GET_VAR_DOUBLE(nid, nvarid, agesno(1,1))
     931#else
     932         ierr = NF_GET_VAR_REAL(nid, nvarid, agesno(1,1))
    899933#endif
    900934         IF (ierr.NE.NF_NOERR) THEN
    901             PRINT*, 'phyetat0: Lecture echouee pour <AGESNO>'
     935            PRINT*, "phyetat0: Lecture echouee pour <AGESNO>"
    902936            CALL abort
    903937         ENDIF
     
    905939         xmax = -1.0E+20
    906940         DO i = 1, klon
    907             xmin = MIN(agesno(i),xmin)
    908             xmax = MAX(agesno(i),xmax)
    909          ENDDO
    910          PRINT*,'Age de la neige agesno:', xmin, xmax
    911       ENDIF
    912 c
     941            xmin = MIN(agesno(i,1),xmin)
     942            xmax = MAX(agesno(i,1),xmax)
     943         ENDDO
     944         PRINT*,'Age de la neige <AGESNO>', xmin, xmax
     945         DO nsrf = 2, nbsrf
     946         DO i = 1, klon
     947            agesno(i,nsrf) = agesno(i,1)
     948         ENDDO
     949         ENDDO
     950      ENDIF
     951
    913952c
    914953      ierr = NF_INQ_VARID (nid, "ZMEA", nvarid)
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/physiq.F

    r340 r353  
    360360c
    361361      INTEGER julien
    362       INTEGER idayvrai
    363       SAVE idayvrai
    364362c
    365363      INTEGER lmt_pas
     
    555553      SAVE ecrit_reg   ! frequence d'ecriture
    556554c
     555      integer itau_w   ! pas de temps ecriture = itap + itau_phy
    557556c
    558557c
     
    589588      logical ok_sync
    590589      real date0
     590      integer idayref
    591591
    592592C essai writephys
     
    761761c Gestion calendrier
    762762
    763          CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
    764          zjulian = zjulian + day_ini
    765 
    766763c
    767764      IF (ok_journe) THEN
    768765c
    769          CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
    770          zjulian = zjulian + day_ini
     766         idayref = day_ref
     767         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    771768c
    772769         CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon,zx_lon)
     
    779776         ENDDO
    780777         CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlat,zx_lat)
     778         write(*,*)'zx_lon = ',zx_lon(:,1)
     779         write(*,*)'zx_lat = ',zx_lat(1,:)
    781780         CALL histbeg("histday", iim,zx_lon(:,1), jjmp1,zx_lat(1,:),
    782      .                 1,iim,1,jjmp1, 0, zjulian, dtime,
     781     .                 1,iim,1,jjmp1, itau_phy, zjulian, dtime,
    783782     .                 nhori, nid_day)
     783         write(*,*)'Journee ', itau_phy, zjulian
    784784         CALL histvert(nid_day, "presnivs", "Vertical levels", "mb",
    785785     .                 klev, presnivs, nvert)
     
    10021002      IF (ok_mensuel) THEN
    10031003c
    1004          CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
    1005          zjulian = zjulian + day_ini
     1004         idayref = day_ref
     1005         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    10061006c
    10071007         CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon,zx_lon)
     
    10151015         CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlat,zx_lat)
    10161016         CALL histbeg("histmth.nc", iim,zx_lon(:,1), jjmp1,zx_lat(1,:),
    1017      .                 1,iim,1,jjmp1, 0, zjulian, dtime,
     1017     .                 1,iim,1,jjmp1, itau_phy, zjulian, dtime,
    10181018     .                 nhori, nid_mth)
     1019         write(*,*)'Mensuel ', itau_phy, zjulian
    10191020         CALL histvert(nid_mth, "presnivs", "Vertical levels", "mb",
    10201021     .                 klev, presnivs, nvert)
     
    14461447      IF (ok_instan) THEN
    14471448c
    1448          CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
    1449          zjulian = zjulian + day_ini
     1449         idayref = day_ref
     1450         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
    14501451c
    14511452         CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon,zx_lon)
     
    14581459         ENDDO
    14591460         CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlat,zx_lat)
    1460          CALL histbeg("histins", iim,zx_lon, jjmp1,zx_lat,
    1461      .                 1,iim,1,jjmp1, 0, zjulian, dtime,
     1461         CALL histbeg("histins", iim,zx_lon(:,1), jjmp1,zx_lat(1,:),
     1462     .                 1,iim,1,jjmp1, itau_phy, zjulian, dtime,
    14621463     .                 nhori, nid_ins)
     1464         write(*,*)'Inst ', itau_phy, zjulian
    14631465         CALL histvert(nid_ins, "presnivs", "Vertical levels", "mb",
    14641466     .                 klev, presnivs, nvert)
     
    17631765c
    17641766      IF (MOD(itap-1,lmt_pas) .EQ. 0) THEN
    1765          idayvrai = NINT(xjour)
    1766          PRINT *,' PHYS cond  julien ',julien,idayvrai
     1767         PRINT *,' PHYS cond  julien ',julien
    17671768         CALL ozonecm( FLOAT(julien), rlat, paprs, wo)
    17681769      ENDIF
     
    23982399         zsto = dtime
    23992400         zout = dtime * FLOAT(ecrit_day)
     2401         itau_w = itau_phy + itap
    24002402
    24012403         i = NINT(zout/zsto)
     
    24182420C
    24192421      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
    2420       CALL histwrite(nid_day,"tsol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2422      CALL histwrite(nid_day,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24212423c     call writephy(fid_day,prof2d_av,'tsol',zxtsol,
    24222424c    .              'Surface Temperature','K')
     
    24252427      zx_tmp_fi2d(1 : klon) = ftsol(1 : klon, is_ter)
    24262428      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d ,zx_tmp_2d)
    2427       CALL histwrite(nid_day,"tter",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2429      CALL histwrite(nid_day,"tter",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24282430c     call writephy(fid_day,prof2d_av,'tter',ftsol(1 : klon, is_ter),
    24292431c    .              'Surface Temperature','K')
     
    24312433      zx_tmp_fi2d(1 : klon) = ftsol(1 : klon, is_lic)
    24322434      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
    2433       CALL histwrite(nid_day,"tlic",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2435      CALL histwrite(nid_day,"tlic",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24342436c     call writephy(fid_day,prof2d_av,'tlic',ftsol(1 : klon, is_lic),
    24352437c    .              'Surface Temperature','K')
     
    24372439      zx_tmp_fi2d(1 : klon) = ftsol(1 : klon, is_oce)
    24382440      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
    2439       CALL histwrite(nid_day,"toce",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2441      CALL histwrite(nid_day,"toce",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24402442c     call writephy(fid_day,prof2d_av,'toce',ftsol(1 : klon, is_oce),
    24412443c    .              'Surface Temperature','K')
     
    24432445      zx_tmp_fi2d(1 : klon) = ftsol(1 : klon, is_sic)
    24442446      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
    2445       CALL histwrite(nid_day,"tsic",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2447      CALL histwrite(nid_day,"tsic",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24462448c     call writephy(fid_day,prof2d_av,'tsic',ftsol(1 : klon, is_sic),
    24472449c    .              'Surface Temperature','K')
     
    24512453      ENDDO
    24522454      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2453       CALL histwrite(nid_day,"psol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2455      CALL histwrite(nid_day,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24542456c Essai writephys
    24552457      varname = 'psol'
     
    24632465      ENDDO
    24642466      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2465       CALL histwrite(nid_day,"rain",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2467      CALL histwrite(nid_day,"rain",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24662468c     call writephy(fid_day,prof2d_av,'rain',zx_tmp_fi2d,
    24672469c    .              'Precipitation','mm/day')
     
    24702472c
    24712473      CALL gr_fi_ecrit(1, klon,iim,jjmp1, snow_fall,zx_tmp_2d)
    2472       CALL histwrite(nid_day,"snow",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2474      CALL histwrite(nid_day,"snow",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24732475c     call writephy(fid_day,prof2d_av,'snow',snow_fall,
    24742476c    .              'Snow','mm/day')
    24752477c
    24762478      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxsnow,zx_tmp_2d)
    2477       CALL histwrite(nid_day,"snow_cov",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2479      CALL histwrite(nid_day,"snow_cov",itau_w,zx_tmp_2d,iim*jjmp1,
     2480     .               ndex2d)
    24782481c     call writephy(fid_day,prof2d_av,'snow_cov',zxsnow,
    24792482c    .              'Snow cover','mm')
    24802483c
    24812484      CALL gr_fi_ecrit(1, klon,iim,jjmp1, evap,zx_tmp_2d)
    2482       CALL histwrite(nid_day,"evap",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2485      CALL histwrite(nid_day,"evap",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24832486c     call writephy(fid_day,prof2d_av,'evap',evap,
    24842487c    .              'Evaporation','mm/day')
    24852488c
    24862489      CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
    2487       CALL histwrite(nid_day,"tops",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2490      CALL histwrite(nid_day,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24882491c     call writephy(fid_day,prof2d_av,'tops',topsw,
    24892492c    .              'Solar rad. at TOA','W/m2')
    24902493c
    24912494      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
    2492       CALL histwrite(nid_day,"topl",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2495      CALL histwrite(nid_day,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24932496c     call writephy(fid_day,prof2d_av,'topl',toplw,
    24942497c    .              'IR rad. at TOA','W/m2')
    24952498c
    24962499      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
    2497       CALL histwrite(nid_day,"sols",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2500      CALL histwrite(nid_day,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    24982501c     call writephy(fid_day,prof2d_av,'sols',solsw,
    24992502c    .              'Solar rad. at surf.','W/m2')
    25002503c
    25012504      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
    2502       CALL histwrite(nid_day,"soll",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2505      CALL histwrite(nid_day,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    25032506c     call writephy(fid_day,prof2d_av,'soll',sollw,
    25042507c    .              'IR rad. at surface','W/m2')
    25052508c
    25062509      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdown,zx_tmp_2d)
    2507       CALL histwrite(nid_day,"solldown",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2510      CALL histwrite(nid_day,"solldown",itau_w,zx_tmp_2d,iim*jjmp1,
     2511     .               ndex2d)
    25082512c     call writephy(fid_day,prof2d_av,'solldown',sollwdown,
    25092513c    .              'Down. IR rad. at surface','W/m2')
    25102514c
    25112515      CALL gr_fi_ecrit(1, klon,iim,jjmp1, bils,zx_tmp_2d)
    2512       CALL histwrite(nid_day,"bils",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2516      CALL histwrite(nid_day,"bils",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    25132517c     call writephy(fid_day,prof2d_av,'bils',bils,
    25142518c    .              'Surf. total heat flux','W/m2')
    25152519c
    25162520      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sens,zx_tmp_2d)
    2517       CALL histwrite(nid_day,"sens",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2521      CALL histwrite(nid_day,"sens",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    25182522c     call writephy(fid_day,prof2d_av,'sens',sens,
    25192523c    .              'Sensible heat flux','W/m2')
    25202524c
    25212525      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fder,zx_tmp_2d)
    2522       CALL histwrite(nid_day,"fder",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2526      CALL histwrite(nid_day,"fder",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    25232527c     call writephy(fid_day,prof2d_av,'fder',fder,
    25242528c    .              'Heat flux derivation','W/m2')
     
    25292533        zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
    25302534        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2531         CALL histwrite(nid_day,"pourc_"//clnsurf(nsrf),itap,
     2535        CALL histwrite(nid_day,"pourc_"//clnsurf(nsrf),itau_w,
    25322536     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25332537c       call writephy(fid_day,prof2d_av,'pourc_'//clnsurf(nsrf),
     
    25372541        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
    25382542        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2539         CALL histwrite(nid_day,"tsol_"//clnsurf(nsrf),itap,
     2543        CALL histwrite(nid_day,"tsol_"//clnsurf(nsrf),itau_w,
    25402544     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25412545c       call writephy(fid_day,prof2d_av,'tsol_'//clnsurf(nsrf),
     
    25452549        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
    25462550        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2547         CALL histwrite(nid_day,"sens_"//clnsurf(nsrf),itap,
     2551        CALL histwrite(nid_day,"sens_"//clnsurf(nsrf),itau_w,
    25482552     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25492553c       call writephy(fid_day,prof2d_av,'sens_'//clnsurf(nsrf),
     
    25532557        zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
    25542558        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2555         CALL histwrite(nid_day,"lat_"//clnsurf(nsrf),itap,
     2559        CALL histwrite(nid_day,"lat_"//clnsurf(nsrf),itau_w,
    25562560     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25572561c       call writephy(fid_day,prof2d_av,'lat_'//clnsurf(nsrf),
     
    25612565        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
    25622566        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2563         CALL histwrite(nid_day,"taux_"//clnsurf(nsrf),itap,
     2567        CALL histwrite(nid_day,"taux_"//clnsurf(nsrf),itau_w,
    25642568     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25652569c       call writephy(fid_day,prof2d_av,'taux_'//clnsurf(nsrf),
     
    25692573        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
    25702574        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2571         CALL histwrite(nid_day,"tauy_"//clnsurf(nsrf),itap,
     2575        CALL histwrite(nid_day,"tauy_"//clnsurf(nsrf),itau_w,
    25722576     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25732577c       call writephy(fid_day,prof2d_av,'tauy_'//clnsurf(nsrf),
     
    25772581        zx_tmp_fi2d(1 : klon) = falbe( 1 : klon, nsrf)
    25782582        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2579         CALL histwrite(nid_day,"albe_"//clnsurf(nsrf),itap,
     2583        CALL histwrite(nid_day,"albe_"//clnsurf(nsrf),itau_w,
    25802584     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25812585c       call writephy(fid_day,prof2d_av,'albe_'//clnsurf(nsrf),
     
    25882592        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
    25892593        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2590         CALL histwrite(nid_day,"rugs_"//clnsurf(nsrf),itap,
     2594        CALL histwrite(nid_day,"rugs_"//clnsurf(nsrf),itau_w,
    25912595     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    25922596c       call writephy(fid_day,prof2d_av,'rugs_'//clnsurf(nsrf),
     
    26002604c$$$      ENDDO
    26012605c$$$      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2602 c$$$      CALL histwrite(nid_day,"sicf",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2606c$$$      CALL histwrite(nid_day,"sicf",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    26032607c
    26042608      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldl,zx_tmp_2d)
    2605       CALL histwrite(nid_day,"cldl",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2609      CALL histwrite(nid_day,"cldl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    26062610c     call writephy(fid_day,prof2d_av,'cldl',cldl,
    26072611c    .              'Low-level cloudiness','-')
    26082612c
    26092613      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldm,zx_tmp_2d)
    2610       CALL histwrite(nid_day,"cldm",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2614      CALL histwrite(nid_day,"cldm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    26112615c     call writephy(fid_day,prof2d_av,'cldm',cldm,
    26122616c    .              'Mid-level cloudiness','-')
    26132617c
    26142618      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldh,zx_tmp_2d)
    2615       CALL histwrite(nid_day,"cldh",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2619      CALL histwrite(nid_day,"cldh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    26162620c     call writephy(fid_day,prof2d_av,'cldh',cldh,
    26172621c    .              'High-level cloudiness','-')
    26182622c
    26192623      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldt,zx_tmp_2d)
    2620       CALL histwrite(nid_day,"cldt",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2624      CALL histwrite(nid_day,"cldt",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    26212625c     call writephy(fid_day,prof2d_av,'cldt',cldt,
    26222626c    .              'Total cloudiness','-')
    26232627c
    26242628      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldq,zx_tmp_2d)
    2625       CALL histwrite(nid_day,"cldq",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2629      CALL histwrite(nid_day,"cldq",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    26262630c     call writephy(fid_day,prof2d_av,'cldq',cldq,
    26272631c    .              'Cloud liquid water path','-')
     
    26302634c
    26312635      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
    2632       CALL histwrite(nid_day,"temp",itap,zx_tmp_3d,
     2636      CALL histwrite(nid_day,"temp",itau_w,zx_tmp_3d,
    26332637     .                                   iim*jjmp1*klev,ndex3d)
    26342638c Essai writephys
     
    26392643c
    26402644      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,ivap), zx_tmp_3d)
    2641       CALL histwrite(nid_day,"ovap",itap,zx_tmp_3d,
     2645      CALL histwrite(nid_day,"ovap",itau_w,zx_tmp_3d,
    26422646     .                                   iim*jjmp1*klev,ndex3d)
    26432647c     call writephy(fid_day,prof3d_av,'ovap',qx(1,1,ivap),
     
    26452649c
    26462650      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
    2647       CALL histwrite(nid_day,"geop",itap,zx_tmp_3d,
     2651      CALL histwrite(nid_day,"geop",itau_w,zx_tmp_3d,
    26482652     .                                   iim*jjmp1*klev,ndex3d)
    26492653c     call writephy(fid_day,prof3d_av,'geop',zphi,
     
    26512655c
    26522656      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
    2653       CALL histwrite(nid_day,"vitu",itap,zx_tmp_3d,
     2657      CALL histwrite(nid_day,"vitu",itau_w,zx_tmp_3d,
    26542658     .                                   iim*jjmp1*klev,ndex3d)
    26552659c     call writephy(fid_day,prof3d_av,'vitu',u_seri,
     
    26572661c
    26582662      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
    2659       CALL histwrite(nid_day,"vitv",itap,zx_tmp_3d,
     2663      CALL histwrite(nid_day,"vitv",itau_w,zx_tmp_3d,
    26602664     .                                   iim*jjmp1*klev,ndex3d)
    26612665c     call writephy(fid_day,prof3d_av,'vitv',v_seri,
     
    26632667c
    26642668      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
    2665       CALL histwrite(nid_day,"vitw",itap,zx_tmp_3d,
     2669      CALL histwrite(nid_day,"vitw",itau_w,zx_tmp_3d,
    26662670     .                                   iim*jjmp1*klev,ndex3d)
    26672671c     call writephy(fid_day,prof3d_av,'vitw',omega,
     
    26692673c
    26702674      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
    2671       CALL histwrite(nid_day,"pres",itap,zx_tmp_3d,
     2675      CALL histwrite(nid_day,"pres",itau_w,zx_tmp_3d,
    26722676     .                                   iim*jjmp1*klev,ndex3d)
    26732677c     call writephy(fid_day,prof3d_av,'pres',pplay,
     
    26902694         zsto = dtime
    26912695         zout = dtime * ecrit_mth
     2696         itau_w = itau_phy + itap
    26922697
    26932698         i = NINT(zout/zsto)
     
    27002705
    27012706      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
    2702       CALL histwrite(nid_mth,"tsol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2707      CALL histwrite(nid_mth,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27032708c
    27042709      DO i = 1, klon
     
    27062711      ENDDO
    27072712      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2708       CALL histwrite(nid_mth,"psol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2713      CALL histwrite(nid_mth,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27092714c
    27102715      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxqsol,zx_tmp_2d)
    2711       CALL histwrite(nid_mth,"qsol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2716      CALL histwrite(nid_mth,"qsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27122717c
    27132718      DO i = 1, klon
     
    27152720      ENDDO
    27162721      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2717       CALL histwrite(nid_mth,"rain",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2722      CALL histwrite(nid_mth,"rain",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27182723c
    27192724      DO i = 1, klon
     
    27212726      ENDDO
    27222727      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2723       CALL histwrite(nid_mth,"plul",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2728      CALL histwrite(nid_mth,"plul",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27242729c
    27252730      DO i = 1, klon
     
    27272732      ENDDO
    27282733      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2729       CALL histwrite(nid_mth,"pluc",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2734      CALL histwrite(nid_mth,"pluc",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27302735c
    27312736      CALL gr_fi_ecrit(1, klon,iim,jjmp1, snow_fall,zx_tmp_2d)
    2732       CALL histwrite(nid_mth,"snow",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2737      CALL histwrite(nid_mth,"snow",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27332738c
    27342739      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxsnow,zx_tmp_2d)
    2735       CALL histwrite(nid_mth,"snow_cov",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2740      CALL histwrite(nid_mth,"snow_cov",itau_w,zx_tmp_2d,iim*jjmp1,
     2741     .               ndex2d)
    27362742c
    27372743      CALL gr_fi_ecrit(1, klon,iim,jjmp1, evap,zx_tmp_2d)
    2738       CALL histwrite(nid_mth,"evap",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2744      CALL histwrite(nid_mth,"evap",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27392745c
    27402746      CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
    2741       CALL histwrite(nid_mth,"tops",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2747      CALL histwrite(nid_mth,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27422748c
    27432749      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
    2744       CALL histwrite(nid_mth,"topl",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2750      CALL histwrite(nid_mth,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27452751c
    27462752      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
    2747       CALL histwrite(nid_mth,"sols",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2753      CALL histwrite(nid_mth,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27482754c
    27492755      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
    2750       CALL histwrite(nid_mth,"soll",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2756      CALL histwrite(nid_mth,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27512757c
    27522758      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdown,zx_tmp_2d)
    2753       CALL histwrite(nid_mth,"solldown",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2759      CALL histwrite(nid_mth,"solldown",itau_w,zx_tmp_2d,iim*jjmp1,
     2760     .               ndex2d)
    27542761c
    27552762      CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw0,zx_tmp_2d)
    2756       CALL histwrite(nid_mth,"tops0",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2763      CALL histwrite(nid_mth,"tops0",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27572764c
    27582765      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw0,zx_tmp_2d)
    2759       CALL histwrite(nid_mth,"topl0",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2766      CALL histwrite(nid_mth,"topl0",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27602767c
    27612768      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw0,zx_tmp_2d)
    2762       CALL histwrite(nid_mth,"sols0",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2769      CALL histwrite(nid_mth,"sols0",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27632770c
    27642771      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw0,zx_tmp_2d)
    2765       CALL histwrite(nid_mth,"soll0",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2772      CALL histwrite(nid_mth,"soll0",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27662773c
    27672774      CALL gr_fi_ecrit(1, klon,iim,jjmp1, bils,zx_tmp_2d)
    2768       CALL histwrite(nid_mth,"bils",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2775      CALL histwrite(nid_mth,"bils",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27692776c
    27702777      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sens,zx_tmp_2d)
    2771       CALL histwrite(nid_mth,"sens",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2778      CALL histwrite(nid_mth,"sens",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27722779c
    27732780      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fder,zx_tmp_2d)
    2774       CALL histwrite(nid_mth,"fder",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2781      CALL histwrite(nid_mth,"fder",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27752782c
    27762783c
     
    27792786c      ENDDO
    27802787c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2781 c      CALL histwrite(nid_mth,"frtu",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2788c      CALL histwrite(nid_mth,"frtu",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27822789c
    27832790c      DO i = 1, klon
     
    27852792c      ENDDO
    27862793c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2787 c      CALL histwrite(nid_mth,"frtv",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2794c      CALL histwrite(nid_mth,"frtv",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    27882795c
    27892796      DO nsrf = 1, nbsrf
     
    27912798        zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
    27922799        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2793         CALL histwrite(nid_mth,"pourc_"//clnsurf(nsrf),itap,
     2800        CALL histwrite(nid_mth,"pourc_"//clnsurf(nsrf),itau_w,
    27942801     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    27952802C
    27962803        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
    27972804        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2798         CALL histwrite(nid_mth,"tsol_"//clnsurf(nsrf),itap,
     2805        CALL histwrite(nid_mth,"tsol_"//clnsurf(nsrf),itau_w,
    27992806     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    28002807C
    28012808        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
    28022809        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2803         CALL histwrite(nid_mth,"sens_"//clnsurf(nsrf),itap,
     2810        CALL histwrite(nid_mth,"sens_"//clnsurf(nsrf),itau_w,
    28042811     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    28052812C
    28062813        zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
    28072814        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2808         CALL histwrite(nid_mth,"lat_"//clnsurf(nsrf),itap,
     2815        CALL histwrite(nid_mth,"lat_"//clnsurf(nsrf),itau_w,
    28092816     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    28102817C
    28112818        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
    28122819        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2813         CALL histwrite(nid_mth,"taux_"//clnsurf(nsrf),itap,
     2820        CALL histwrite(nid_mth,"taux_"//clnsurf(nsrf),itau_w,
    28142821     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    28152822C     
    28162823        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
    28172824        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2818         CALL histwrite(nid_mth,"tauy_"//clnsurf(nsrf),itap,
     2825        CALL histwrite(nid_mth,"tauy_"//clnsurf(nsrf),itau_w,
    28192826     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    28202827C
    28212828        zx_tmp_fi2d(1 : klon) = falbe( 1 : klon, nsrf)
    28222829        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2823         CALL histwrite(nid_mth,"albe_"//clnsurf(nsrf),itap,
     2830        CALL histwrite(nid_mth,"albe_"//clnsurf(nsrf),itau_w,
    28242831     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    28252832C
    28262833        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
    28272834        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    2828         CALL histwrite(nid_mth,"rugs_"//clnsurf(nsrf),itap,
     2835        CALL histwrite(nid_mth,"rugs_"//clnsurf(nsrf),itau_w,
    28292836     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    28302837c
    28312838      zx_tmp_fi2d(1 : klon) = agesno( 1 : klon, nsrf)
    28322839      CALL gr_fi_ecrit(1, klon,iim,jjmp1, agesno,zx_tmp_2d)
    2833       CALL histwrite(nid_mth,"ages_"//clnsurf(nsrf),itap
     2840      CALL histwrite(nid_mth,"ages_"//clnsurf(nsrf),itau_w
    28342841     $    ,zx_tmp_2d,iim*jjmp1,ndex2d)
    28352842
     
    28392846c$$$      ENDDO
    28402847c$$$      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    2841 c$$$      CALL histwrite(nid_mth,"sicf",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2848c$$$      CALL histwrite(nid_mth,"sicf",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28422849c
    28432850      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsol,zx_tmp_2d)
    2844       CALL histwrite(nid_mth,"albs",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2851      CALL histwrite(nid_mth,"albs",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28452852      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsollw,zx_tmp_2d)
    2846       CALL histwrite(nid_mth,"albslw",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2853      CALL histwrite(nid_mth,"albslw",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28472854c
    28482855      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
    2849       CALL histwrite(nid_mth,"cdrm",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2856      CALL histwrite(nid_mth,"cdrm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28502857c
    28512858      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
    2852       CALL histwrite(nid_mth,"cdrh",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2859      CALL histwrite(nid_mth,"cdrh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28532860c
    28542861      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldl,zx_tmp_2d)
    2855       CALL histwrite(nid_mth,"cldl",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2862      CALL histwrite(nid_mth,"cldl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28562863c
    28572864      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldm,zx_tmp_2d)
    2858       CALL histwrite(nid_mth,"cldm",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2865      CALL histwrite(nid_mth,"cldm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28592866c
    28602867      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldh,zx_tmp_2d)
    2861       CALL histwrite(nid_mth,"cldh",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2868      CALL histwrite(nid_mth,"cldh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28622869c
    28632870      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldt,zx_tmp_2d)
    2864       CALL histwrite(nid_mth,"cldt",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2871      CALL histwrite(nid_mth,"cldt",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28652872c
    28662873      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldq,zx_tmp_2d)
    2867       CALL histwrite(nid_mth,"cldq",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2874      CALL histwrite(nid_mth,"cldq",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28682875c
    28692876      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
    2870       CALL histwrite(nid_mth,"ue",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2877      CALL histwrite(nid_mth,"ue",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28712878c
    28722879      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
    2873       CALL histwrite(nid_mth,"ve",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2880      CALL histwrite(nid_mth,"ve",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28742881c
    28752882      CALL gr_fi_ecrit(1, klon,iim,jjmp1, uq,zx_tmp_2d)
    2876       CALL histwrite(nid_mth,"uq",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2883      CALL histwrite(nid_mth,"uq",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28772884c
    28782885      CALL gr_fi_ecrit(1, klon,iim,jjmp1, vq,zx_tmp_2d)
    2879       CALL histwrite(nid_mth,"vq",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2886      CALL histwrite(nid_mth,"vq",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28802887cKE43
    28812888      IF (iflag_con .GE. 3) THEN ! sb
    28822889c
    28832890      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cape,zx_tmp_2d)
    2884       CALL histwrite(nid_mth,"cape",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2891      CALL histwrite(nid_mth,"cape",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28852892c
    28862893      CALL gr_fi_ecrit(1, klon,iim,jjmp1,pbase,zx_tmp_2d)
    2887       CALL histwrite(nid_mth,"pbase",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2894      CALL histwrite(nid_mth,"pbase",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28882895c
    28892896      CALL gr_fi_ecrit(1, klon,iim,jjmp1,ema_pct,zx_tmp_2d)
    2890       CALL histwrite(nid_mth,"ptop",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2897      CALL histwrite(nid_mth,"ptop",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28912898c
    28922899      CALL gr_fi_ecrit(1, klon,iim,jjmp1,ema_cbmf,zx_tmp_2d)
    2893       CALL histwrite(nid_mth,"fbase",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     2900      CALL histwrite(nid_mth,"fbase",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    28942901c
    28952902c
     
    29002907C
    29012908      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
    2902       CALL histwrite(nid_mth,"temp",itap,zx_tmp_3d,
     2909      CALL histwrite(nid_mth,"temp",itau_w,zx_tmp_3d,
    29032910     .                                   iim*jjmp1*klev,ndex3d)
    29042911c
    29052912      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,ivap), zx_tmp_3d)
    2906       CALL histwrite(nid_mth,"ovap",itap,zx_tmp_3d,
     2913      CALL histwrite(nid_mth,"ovap",itau_w,zx_tmp_3d,
    29072914     .                                   iim*jjmp1*klev,ndex3d)
    29082915c
    29092916      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
    2910       CALL histwrite(nid_mth,"geop",itap,zx_tmp_3d,
     2917      CALL histwrite(nid_mth,"geop",itau_w,zx_tmp_3d,
    29112918     .                                   iim*jjmp1*klev,ndex3d)
    29122919c
    29132920      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
    2914       CALL histwrite(nid_mth,"vitu",itap,zx_tmp_3d,
     2921      CALL histwrite(nid_mth,"vitu",itau_w,zx_tmp_3d,
    29152922     .                                   iim*jjmp1*klev,ndex3d)
    29162923c
    29172924      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
    2918       CALL histwrite(nid_mth,"vitv",itap,zx_tmp_3d,
     2925      CALL histwrite(nid_mth,"vitv",itau_w,zx_tmp_3d,
    29192926     .                                   iim*jjmp1*klev,ndex3d)
    29202927c
    29212928      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
    2922       CALL histwrite(nid_mth,"vitw",itap,zx_tmp_3d,
     2929      CALL histwrite(nid_mth,"vitw",itau_w,zx_tmp_3d,
    29232930     .                                   iim*jjmp1*klev,ndex3d)
    29242931c
    29252932      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
    2926       CALL histwrite(nid_mth,"pres",itap,zx_tmp_3d,
     2933      CALL histwrite(nid_mth,"pres",itau_w,zx_tmp_3d,
    29272934     .                                   iim*jjmp1*klev,ndex3d)
    29282935c
    29292936      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, cldfra, zx_tmp_3d)
    2930       CALL histwrite(nid_mth,"rneb",itap,zx_tmp_3d,
     2937      CALL histwrite(nid_mth,"rneb",itau_w,zx_tmp_3d,
    29312938     .                                   iim*jjmp1*klev,ndex3d)
    29322939c
    29332940      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_rh, zx_tmp_3d)
    2934       CALL histwrite(nid_mth,"rhum",itap,zx_tmp_3d,
     2941      CALL histwrite(nid_mth,"rhum",itau_w,zx_tmp_3d,
    29352942     .                                   iim*jjmp1*klev,ndex3d)
    29362943c
    29372944      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, cldliq, zx_tmp_3d)
    2938       CALL histwrite(nid_mth,"oliq",itap,zx_tmp_3d,
     2945      CALL histwrite(nid_mth,"oliq",itau_w,zx_tmp_3d,
    29392946     .                                   iim*jjmp1*klev,ndex3d)
    29402947c
    29412948      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
    2942       CALL histwrite(nid_mth,"dtdyn",itap,zx_tmp_3d,
     2949      CALL histwrite(nid_mth,"dtdyn",itau_w,zx_tmp_3d,
    29432950     .                                   iim*jjmp1*klev,ndex3d)
    29442951c
    29452952      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_dyn, zx_tmp_3d)
    2946       CALL histwrite(nid_mth,"dqdyn",itap,zx_tmp_3d,
     2953      CALL histwrite(nid_mth,"dqdyn",itau_w,zx_tmp_3d,
    29472954     .                                   iim*jjmp1*klev,ndex3d)
    29482955c
    29492956      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_con, zx_tmp_3d)
    2950       CALL histwrite(nid_mth,"dtcon",itap,zx_tmp_3d,
     2957      CALL histwrite(nid_mth,"dtcon",itau_w,zx_tmp_3d,
    29512958     .                                   iim*jjmp1*klev,ndex3d)
    29522959c
    29532960      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_con, zx_tmp_3d)
    2954       CALL histwrite(nid_mth,"dqcon",itap,zx_tmp_3d,
     2961      CALL histwrite(nid_mth,"dqcon",itau_w,zx_tmp_3d,
    29552962     .                                   iim*jjmp1*klev,ndex3d)
    29562963c
    29572964      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_lsc, zx_tmp_3d)
    2958       CALL histwrite(nid_mth,"dtlsc",itap,zx_tmp_3d,
     2965      CALL histwrite(nid_mth,"dtlsc",itau_w,zx_tmp_3d,
    29592966     .                                   iim*jjmp1*klev,ndex3d)
    29602967c
    29612968      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_lsc, zx_tmp_3d)
    2962       CALL histwrite(nid_mth,"dqlsc",itap,zx_tmp_3d,
     2969      CALL histwrite(nid_mth,"dqlsc",itau_w,zx_tmp_3d,
    29632970     .                                   iim*jjmp1*klev,ndex3d)
    29642971c
    29652972      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_vdf, zx_tmp_3d)
    2966       CALL histwrite(nid_mth,"dtvdf",itap,zx_tmp_3d,
     2973      CALL histwrite(nid_mth,"dtvdf",itau_w,zx_tmp_3d,
    29672974     .                                   iim*jjmp1*klev,ndex3d)
    29682975c
    29692976      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_vdf, zx_tmp_3d)
    2970       CALL histwrite(nid_mth,"dqvdf",itap,zx_tmp_3d,
     2977      CALL histwrite(nid_mth,"dqvdf",itau_w,zx_tmp_3d,
    29712978     .                                   iim*jjmp1*klev,ndex3d)
    29722979c
    29732980      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_eva, zx_tmp_3d)
    2974       CALL histwrite(nid_mth,"dteva",itap,zx_tmp_3d,
     2981      CALL histwrite(nid_mth,"dteva",itau_w,zx_tmp_3d,
    29752982     .                                   iim*jjmp1*klev,ndex3d)
    29762983c
    29772984      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_eva, zx_tmp_3d)
    2978       CALL histwrite(nid_mth,"dqeva",itap,zx_tmp_3d,
     2985      CALL histwrite(nid_mth,"dqeva",itau_w,zx_tmp_3d,
    29792986     .                                   iim*jjmp1*klev,ndex3d)
    29802987c
    29812988      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zpt_conv, zx_tmp_3d)
    2982       CALL histwrite(nid_mth,"ptconv",itap,zx_tmp_3d,
     2989      CALL histwrite(nid_mth,"ptconv",itau_w,zx_tmp_3d,
    29832990     .                                   iim*(jjmp1)*klev,ndex3d)
    29842991c
    29852992      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, ratqs, zx_tmp_3d)
    2986       CALL histwrite(nid_mth,"ratqs",itap,zx_tmp_3d,
     2993      CALL histwrite(nid_mth,"ratqs",itau_w,zx_tmp_3d,
    29872994     .                                   iim*(jjmp1)*klev,ndex3d)
    29882995c
    29892996      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_ajs, zx_tmp_3d)
    2990       CALL histwrite(nid_mth,"dtajs",itap,zx_tmp_3d,
     2997      CALL histwrite(nid_mth,"dtajs",itau_w,zx_tmp_3d,
    29912998     .                                   iim*jjmp1*klev,ndex3d)
    29922999c
    29933000      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_ajs, zx_tmp_3d)
    2994       CALL histwrite(nid_mth,"dqajs",itap,zx_tmp_3d,
     3001      CALL histwrite(nid_mth,"dqajs",itau_w,zx_tmp_3d,
    29953002     .                                   iim*jjmp1*klev,ndex3d)
    29963003c
    29973004      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, heat, zx_tmp_3d)
    2998       CALL histwrite(nid_mth,"dtswr",itap,zx_tmp_3d,
     3005      CALL histwrite(nid_mth,"dtswr",itau_w,zx_tmp_3d,
    29993006     .                                   iim*jjmp1*klev,ndex3d)
    30003007c
    30013008      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, heat0, zx_tmp_3d)
    3002       CALL histwrite(nid_mth,"dtsw0",itap,zx_tmp_3d,
     3009      CALL histwrite(nid_mth,"dtsw0",itau_w,zx_tmp_3d,
    30033010     .                                   iim*jjmp1*klev,ndex3d)
    30043011c
    30053012      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, cool, zx_tmp_3d)
    3006       CALL histwrite(nid_mth,"dtlwr",itap,zx_tmp_3d,
     3013      CALL histwrite(nid_mth,"dtlwr",itau_w,zx_tmp_3d,
    30073014     .                                   iim*jjmp1*klev,ndex3d)
    30083015c
    30093016      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, cool0, zx_tmp_3d)
    3010       CALL histwrite(nid_mth,"dtlw0",itap,zx_tmp_3d,
     3017      CALL histwrite(nid_mth,"dtlw0",itau_w,zx_tmp_3d,
    30113018     .                                   iim*jjmp1*klev,ndex3d)
    30123019c
    30133020      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_vdf, zx_tmp_3d)
    3014       CALL histwrite(nid_mth,"duvdf",itap,zx_tmp_3d,
     3021      CALL histwrite(nid_mth,"duvdf",itau_w,zx_tmp_3d,
    30153022     .                                   iim*jjmp1*klev,ndex3d)
    30163023c
    30173024      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_vdf, zx_tmp_3d)
    3018       CALL histwrite(nid_mth,"dvvdf",itap,zx_tmp_3d,
     3025      CALL histwrite(nid_mth,"dvvdf",itau_w,zx_tmp_3d,
    30193026     .                                   iim*jjmp1*klev,ndex3d)
    30203027c
    30213028      IF (ok_orodr) THEN
    30223029      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_oro, zx_tmp_3d)
    3023       CALL histwrite(nid_mth,"duoro",itap,zx_tmp_3d,
     3030      CALL histwrite(nid_mth,"duoro",itau_w,zx_tmp_3d,
    30243031     .                                   iim*jjmp1*klev,ndex3d)
    30253032c
    30263033      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_oro, zx_tmp_3d)
    3027       CALL histwrite(nid_mth,"dvoro",itap,zx_tmp_3d,
     3034      CALL histwrite(nid_mth,"dvoro",itau_w,zx_tmp_3d,
    30283035     .                                   iim*jjmp1*klev,ndex3d)
    30293036c
     
    30323039      IF (ok_orolf) THEN
    30333040      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_lif, zx_tmp_3d)
    3034       CALL histwrite(nid_mth,"dulif",itap,zx_tmp_3d,
     3041      CALL histwrite(nid_mth,"dulif",itau_w,zx_tmp_3d,
    30353042     .                                   iim*jjmp1*klev,ndex3d)
    30363043c
    30373044      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_lif, zx_tmp_3d)
    3038       CALL histwrite(nid_mth,"dvlif",itap,zx_tmp_3d,
     3045      CALL histwrite(nid_mth,"dvlif",itau_w,zx_tmp_3d,
    30393046     .                                   iim*jjmp1*klev,ndex3d)
    30403047      ENDIF
    30413048C
    30423049      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, wo, zx_tmp_3d)
    3043       CALL histwrite(nid_mth,"ozone",itap,zx_tmp_3d,
     3050      CALL histwrite(nid_mth,"ozone",itau_w,zx_tmp_3d,
    30443051     .                                   iim*jjmp1*klev,ndex3d)
    30453052c
     
    30493056         CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq+2), zx_tmp_3d)
    30503057         WRITE(str2,'(i2.2)') iq
    3051          CALL histwrite(nid_mth,"trac"//str2,itap,zx_tmp_3d,
     3058         CALL histwrite(nid_mth,"trac"//str2,itau_w,zx_tmp_3d,
    30523059     .                                   iim*jjmp1*klev,ndex3d)
    30533060      ELSE
     
    30613068c
    30623069      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, upwd, zx_tmp_3d)
    3063       CALL histwrite(nid_mth,"upwd",itap,zx_tmp_3d,
     3070      CALL histwrite(nid_mth,"upwd",itau_w,zx_tmp_3d,
    30643071     .                                   iim*jjmp1*klev,ndex3d)
    30653072c
    30663073      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, dnwd, zx_tmp_3d)
    3067       CALL histwrite(nid_mth,"dnwd",itap,zx_tmp_3d,
     3074      CALL histwrite(nid_mth,"dnwd",itau_w,zx_tmp_3d,
    30683075     .                                   iim*jjmp1*klev,ndex3d)
    30693076c
    30703077      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, dnwd0, zx_tmp_3d)
    3071       CALL histwrite(nid_mth,"dnwd0",itap,zx_tmp_3d,
     3078      CALL histwrite(nid_mth,"dnwd0",itau_w,zx_tmp_3d,
    30723079     .                                   iim*jjmp1*klev,ndex3d)
    30733080c
    30743081      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, Ma, zx_tmp_3d)
    3075       CALL histwrite(nid_mth,"Ma",itap,zx_tmp_3d,
     3082      CALL histwrite(nid_mth,"Ma",itau_w,zx_tmp_3d,
    30763083     .                                   iim*jjmp1*klev,ndex3d)
    30773084c
     
    30943101         zsto = dtime * ecrit_ins
    30953102         zout = dtime * ecrit_ins
     3103         itau_w = itau_phy + itap
    30963104
    30973105         i = NINT(zout/zsto)
     
    31073115      ENDDO
    31083116      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    3109       CALL histwrite(nid_ins,"psol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3117      CALL histwrite(nid_ins,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31103118c
    31113119      DO i = 1, klon
     
    31133121      ENDDO
    31143122      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    3115       CALL histwrite(nid_ins,"rain",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3123      CALL histwrite(nid_ins,"rain",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31163124c
    31173125      DO i = 1, klon
     
    31193127      ENDDO
    31203128      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    3121       CALL histwrite(nid_ins,"plul",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3129      CALL histwrite(nid_ins,"plul",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31223130c
    31233131      DO i = 1, klon
     
    31253133      ENDDO
    31263134      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
    3127       CALL histwrite(nid_ins,"pluc",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3135      CALL histwrite(nid_ins,"pluc",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31283136
    31293137      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
    3130       CALL histwrite(nid_ins,"tsol",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3138      CALL histwrite(nid_ins,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31313139c
    31323140      CALL gr_fi_ecrit(1, klon,iim,jjmp1, snow_fall,zx_tmp_2d)
    3133       CALL histwrite(nid_ins,"snow",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3141      CALL histwrite(nid_ins,"snow",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31343142
    31353143c
    31363144      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
    3137       CALL histwrite(nid_ins,"topl",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3145      CALL histwrite(nid_ins,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31383146c
    31393147      CALL gr_fi_ecrit(1, klon,iim,jjmp1, evap,zx_tmp_2d)
    3140       CALL histwrite(nid_ins,"evap",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3148      CALL histwrite(nid_ins,"evap",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31413149c
    31423150      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
    3143       CALL histwrite(nid_ins,"sols",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3151      CALL histwrite(nid_ins,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31443152c
    31453153      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
    3146       CALL histwrite(nid_ins,"soll",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3154      CALL histwrite(nid_ins,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31473155c
    31483156      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdown,zx_tmp_2d)
    3149       CALL histwrite(nid_ins,"solldown",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3157      CALL histwrite(nid_ins,"solldown",itau_w,zx_tmp_2d,iim*jjmp1,
     3158     .                ndex2d)
    31503159c
    31513160      CALL gr_fi_ecrit(1, klon,iim,jjmp1, bils,zx_tmp_2d)
    3152       CALL histwrite(nid_ins,"bils",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3161      CALL histwrite(nid_ins,"bils",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31533162c
    31543163      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sens,zx_tmp_2d)
    3155       CALL histwrite(nid_ins,"sens",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3164      CALL histwrite(nid_ins,"sens",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31563165c
    31573166      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fder,zx_tmp_2d)
    3158       CALL histwrite(nid_ins,"fder",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3167      CALL histwrite(nid_ins,"fder",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    31593168c
    31603169      CALL gr_fi_ecrit(1, klon,iim,jjmp1, d_ts(1,is_oce),zx_tmp_2d)
    3161       CALL histwrite(nid_ins,"dtsvdfo",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3170      CALL histwrite(nid_ins,"dtsvdfo",itau_w,zx_tmp_2d,iim*jjmp1,
     3171     .               ndex2d)
    31623172c
    31633173      CALL gr_fi_ecrit(1, klon,iim,jjmp1, d_ts(1,is_ter),zx_tmp_2d)
    3164       CALL histwrite(nid_ins,"dtsvdft",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3174      CALL histwrite(nid_ins,"dtsvdft",itau_w,zx_tmp_2d,iim*jjmp1,
     3175     .               ndex2d)
    31653176c
    31663177      CALL gr_fi_ecrit(1, klon,iim,jjmp1, d_ts(1,is_lic),zx_tmp_2d)
    3167       CALL histwrite(nid_ins,"dtsvdfg",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3178      CALL histwrite(nid_ins,"dtsvdfg",itau_w,zx_tmp_2d,iim*jjmp1,
     3179     .               ndex2d)
    31683180c
    31693181      CALL gr_fi_ecrit(1, klon,iim,jjmp1, d_ts(1,is_sic),zx_tmp_2d)
    3170       CALL histwrite(nid_ins,"dtsvdfi",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3182      CALL histwrite(nid_ins,"dtsvdfi",itau_w,zx_tmp_2d,iim*jjmp1,
     3183     .               ndex2d)
    31713184
    31723185      DO nsrf = 1, nbsrf
     
    31743187        zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
    31753188        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3176         CALL histwrite(nid_ins,"pourc_"//clnsurf(nsrf),itap,
     3189        CALL histwrite(nid_ins,"pourc_"//clnsurf(nsrf),itau_w,
    31773190     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    31783191C
    31793192        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
    31803193        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3181         CALL histwrite(nid_ins,"sens_"//clnsurf(nsrf),itap,
     3194        CALL histwrite(nid_ins,"sens_"//clnsurf(nsrf),itau_w,
    31823195     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    31833196C
    31843197        zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
    31853198        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3186         CALL histwrite(nid_ins,"lat_"//clnsurf(nsrf),itap,
     3199        CALL histwrite(nid_ins,"lat_"//clnsurf(nsrf),itau_w,
    31873200     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    31883201C
    31893202        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
    31903203        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3191         CALL histwrite(nid_ins,"tsol_"//clnsurf(nsrf),itap,
     3204        CALL histwrite(nid_ins,"tsol_"//clnsurf(nsrf),itau_w,
    31923205     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    31933206C
    31943207        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
    31953208        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3196         CALL histwrite(nid_ins,"taux_"//clnsurf(nsrf),itap,
     3209        CALL histwrite(nid_ins,"taux_"//clnsurf(nsrf),itau_w,
    31973210     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    31983211C     
    31993212        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
    32003213        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3201         CALL histwrite(nid_ins,"tauy_"//clnsurf(nsrf),itap,
     3214        CALL histwrite(nid_ins,"tauy_"//clnsurf(nsrf),itau_w,
    32023215     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    32033216C
    32043217        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
    32053218        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3206         CALL histwrite(nid_ins,"rugs_"//clnsurf(nsrf),itap,
     3219        CALL histwrite(nid_ins,"rugs_"//clnsurf(nsrf),itau_w,
    32073220     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    32083221C
    32093222        zx_tmp_fi2d(1 : klon) = falbe( 1 : klon, nsrf)
    32103223        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
    3211         CALL histwrite(nid_ins,"albe_"//clnsurf(nsrf),itap,
     3224        CALL histwrite(nid_ins,"albe_"//clnsurf(nsrf),itau_w,
    32123225     $      zx_tmp_2d,iim*jjmp1,ndex2d)
    32133226C
    32143227      END DO 
    32153228      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsol,zx_tmp_2d)
    3216       CALL histwrite(nid_ins,"albs",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3229      CALL histwrite(nid_ins,"albs",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    32173230      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsollw,zx_tmp_2d)
    3218       CALL histwrite(nid_ins,"albslw",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3231      CALL histwrite(nid_ins,"albslw",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    32193232c
    32203233      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxsnow,zx_tmp_2d)
    3221       CALL histwrite(nid_ins,"snow_cov",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3234      CALL histwrite(nid_ins,"snow_cov",itau_w,zx_tmp_2d,iim*jjmp1,
     3235     .               ndex2d)
    32223236c
    32233237      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxrugs,zx_tmp_2d)
    3224       CALL histwrite(nid_ins,"rugs",itap,zx_tmp_2d,iim*jjmp1,ndex2d)
     3238      CALL histwrite(nid_ins,"rugs",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
    32253239c
    32263240c Champs 3D:
    32273241c
    32283242      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
    3229       CALL histwrite(nid_ins,"temp",itap,zx_tmp_3d,
     3243      CALL histwrite(nid_ins,"temp",itau_w,zx_tmp_3d,
    32303244     .                                   iim*jjmp1*klev,ndex3d)
    32313245c
    32323246      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
    3233       CALL histwrite(nid_ins,"vitu",itap,zx_tmp_3d,
     3247      CALL histwrite(nid_ins,"vitu",itau_w,zx_tmp_3d,
    32343248     .                                   iim*jjmp1*klev,ndex3d)
    32353249c
    32363250      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
    3237       CALL histwrite(nid_ins,"vitv",itap,zx_tmp_3d,
     3251      CALL histwrite(nid_ins,"vitv",itau_w,zx_tmp_3d,
    32383252     .                                   iim*jjmp1*klev,ndex3d)
    32393253c
    32403254      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
    3241       CALL histwrite(nid_ins,"geop",itap,zx_tmp_3d,
     3255      CALL histwrite(nid_ins,"geop",itau_w,zx_tmp_3d,
    32423256     .                                   iim*jjmp1*klev,ndex3d)
    32433257c
    32443258      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
    3245       CALL histwrite(nid_ins,"pres",itap,zx_tmp_3d,
     3259      CALL histwrite(nid_ins,"pres",itau_w,zx_tmp_3d,
    32463260     .                                   iim*jjmp1*klev,ndex3d)
    32473261c
    32483262      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_vdf, zx_tmp_3d)
    3249       CALL histwrite(nid_ins,"dtvdf",itap,zx_tmp_3d,
     3263      CALL histwrite(nid_ins,"dtvdf",itau_w,zx_tmp_3d,
    32503264     .                                   iim*jjmp1*klev,ndex3d)
    32513265c
    32523266      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_vdf, zx_tmp_3d)
    3253       CALL histwrite(nid_ins,"dqvdf",itap,zx_tmp_3d,
     3267      CALL histwrite(nid_ins,"dqvdf",itau_w,zx_tmp_3d,
    32543268     .                                   iim*jjmp1*klev,ndex3d)
    32553269
     
    33393353c
    33403354      IF (lafin) THEN
     3355         itau_phy = itau_phy + itap
    33413356ccc         IF (ok_oasis) CALL quitcpl
    33423357         CALL phyredem ("restartphy.nc",dtime,radpas,co2_ppm,solaire,
  • LMDZ.3.3/branches/rel-LF/libf/phylmd/phytrac.F

    r295 r353  
    235235         itap=0
    236236C         
    237          CALL ymds2ju(anne_ini, 1, 1, 0.0, zjulian)
    238          zjulian = zjulian + day_ini
     237         CALL ymds2ju(annee_ref, 1, 1, 0.0, zjulian)
     238         zjulian = zjulian + day_ref
    239239c
    240240         CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlon,zx_lon)
     
    247247c         ENDDO
    248248         CALL gr_fi_ecrit(1,klon,iim,jjm+1,xlat,zx_lat)
    249          CALL histbeg("histrac", iim,zx_lon, jjm+1,zx_lat,
    250      .                 1,iim,1,jjm+1, 0, zjulian, pdtphys,
     249         CALL histbeg("histrac", iim,zx_lon(:,1), jjm+1,zx_lat(1,:),
     250     .                 1,iim,1,jjm+1, itau_phy, zjulian, pdtphys,
    251251     .                 nhori, nid_tra)
    252252         CALL histvert(nid_tra, "presnivs", "Vertical levels", "mb",
Note: See TracChangeset for help on using the changeset viewer.