Index: trunk/LMDZ.GENERIC/changelog.txt
===================================================================
--- trunk/LMDZ.GENERIC/changelog.txt	(revision 3724)
+++ trunk/LMDZ.GENERIC/changelog.txt	(revision 3725)
@@ -2063,5 +2063,11 @@
 == 14/04/2025 == EM+MT
 Change default CO2 ice aerosol properties file from old "optprop_co2_vis_ff.dat"
-to "optprop_co2ice_vis_n50.dat". Kee possibility for now to still used old file
+to "optprop_co2ice_vis_n50.dat". Keep possibility for now to still used old file
 by seting "forgetit=.true." in suaer_corrk.F90
 
+== 15/04/2025 == EM
+Change the way the rate of outputs for diagfi.nc files is specified:
+IMPORTANT: Specifying "ecritphy" no longer possible and will trigger an error.
+Use "diagfi_output_rate" to specify output rate (in physics steps) instead.
+This should makes things (hopefully) clearer for users and also better
+enforces a cleaner and clearer separation between dynamics and physics.
Index: trunk/LMDZ.GENERIC/deftank/callphys.GJ581d
===================================================================
--- trunk/LMDZ.GENERIC/deftank/callphys.GJ581d	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/callphys.GJ581d	(revision 3725)
@@ -3,4 +3,6 @@
 # Run with or without tracer transport ?
 tracer    = .true.
+# rate of outputs for diagfi files (in physics steps, default: 24)
+diagfi_output_rate = 24
 # Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating
 diurnal   = .false.
Index: trunk/LMDZ.GENERIC/deftank/callphys.earlymars
===================================================================
--- trunk/LMDZ.GENERIC/deftank/callphys.earlymars	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/callphys.earlymars	(revision 3725)
@@ -3,4 +3,6 @@
 # Run with or without tracer transport ?
 tracer    = .true.
+# rate of outputs for diagfi files (in physics steps, default: 24)
+diagfi_output_rate = 6
 # Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating
 diurnal   = .true.
Index: trunk/LMDZ.GENERIC/deftank/callphys.earthslab
===================================================================
--- trunk/LMDZ.GENERIC/deftank/callphys.earthslab	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/callphys.earthslab	(revision 3725)
@@ -3,4 +3,6 @@
 # Run with or without tracer transport ?
 tracer    = .true.
+# rate of outputs for diagfi files (in physics steps, default: 24)
+diagfi_output_rate = 6
 # Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating
 diurnal   = .true.
Index: trunk/LMDZ.GENERIC/deftank/earth1d.rcm1d.def
===================================================================
--- trunk/LMDZ.GENERIC/deftank/earth1d.rcm1d.def	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/earth1d.rcm1d.def	(revision 3725)
@@ -35,5 +35,5 @@
 ndt            = 1300
 # Number of steps between each writting in diagfi 
-ecritphy=120
+diagfi_output_rate=120
 
 
Index: trunk/LMDZ.GENERIC/deftank/jupiter1d/rcm1d.def
===================================================================
--- trunk/LMDZ.GENERIC/deftank/jupiter1d/rcm1d.def	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/jupiter1d/rcm1d.def	(revision 3725)
@@ -38,5 +38,5 @@
 ndt            = 63000
 # ecriture physiq
-ecritphy = 200
+diagfi_output_rate = 200
 
 ## Vertical levels
Index: trunk/LMDZ.GENERIC/deftank/rcm1d.def.earth
===================================================================
--- trunk/LMDZ.GENERIC/deftank/rcm1d.def.earth	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/rcm1d.def.earth	(revision 3725)
@@ -15,5 +15,5 @@
 ndt =20
 # Number of steps between each writing in diagfi
-ecritphy=12
+diagfi_output_rate=12
 
 #### Physical parameters
Index: trunk/LMDZ.GENERIC/deftank/run.def.32x24x25
===================================================================
--- trunk/LMDZ.GENERIC/deftank/run.def.32x24x25	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/run.def.32x24x25	(revision 3725)
@@ -70,7 +70,4 @@
   grireg=.true.
 
-# Output in diagfi file every ecritphy dynamical steps
- ecritphy=120
-
 # longitude (degrees) of zoom center
    clon=63.
Index: trunk/LMDZ.GENERIC/deftank/run.def.64x48x25
===================================================================
--- trunk/LMDZ.GENERIC/deftank/run.def.64x48x25	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/run.def.64x48x25	(revision 3725)
@@ -70,7 +70,4 @@
   grireg=.true.
 
-# Output in diagfi file every ecritphy dynamical steps
- ecritphy=240
-
 # longitude (degrees) of zoom center
    clon=63.
Index: trunk/LMDZ.GENERIC/deftank/run.def.earlymars_hires
===================================================================
--- trunk/LMDZ.GENERIC/deftank/run.def.earlymars_hires	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/run.def.earlymars_hires	(revision 3725)
@@ -70,7 +70,4 @@
   grireg=.true.
 
-# Output in diagfi file every ecritphy dynamical steps
- ecritphy=1920
-
 # longitude (degrees) of zoom center
    clon=63.
Index: trunk/LMDZ.GENERIC/deftank/run.def.earth_hires
===================================================================
--- trunk/LMDZ.GENERIC/deftank/run.def.earth_hires	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/run.def.earth_hires	(revision 3725)
@@ -67,7 +67,4 @@
   grireg=.true.
 
-# Output in diagfi file every ecritphy dynamical steps
- ecritphy=360
-
 # longitude (degrees) of zoom center
    clon=0.
Index: trunk/LMDZ.GENERIC/deftank/run.def.earthslab.64x48x30
===================================================================
--- trunk/LMDZ.GENERIC/deftank/run.def.earthslab.64x48x30	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/run.def.earthslab.64x48x30	(revision 3725)
@@ -65,8 +65,4 @@
   grireg=.true.
 
-# Output in diagfi file every ecritphy dynamical steps
-  ecritphy=9600
-# ecritphy=1
-
 # longitude (degrees) of zoom center
    clon=0.
Index: trunk/LMDZ.GENERIC/deftank/saturn1d/rcm1d.def
===================================================================
--- trunk/LMDZ.GENERIC/deftank/saturn1d/rcm1d.def	(revision 3724)
+++ trunk/LMDZ.GENERIC/deftank/saturn1d/rcm1d.def	(revision 3725)
@@ -42,5 +42,5 @@
 ndt            = 342020
 # Number of steps between each writing in diagfi
-ecritphy=5000
+diagfi_output_rate=5000
 
 # OVERRIDE callphys.def settings
Index: trunk/LMDZ.GENERIC/libf/aeronostd/calchim_asis.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/aeronostd/calchim_asis.F90	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/aeronostd/calchim_asis.F90	(revision 3725)
@@ -10,5 +10,5 @@
       USE comcstfi_mod
       use callkeys_mod
-      use time_phylmdz_mod, only: ecritphy, iphysiq ! output rate set by ecritphy
+      use time_phylmdz_mod, only: diagfi_output_rate ! output rate
       use types_asis,       only: v_phot_3d, jlabel, nb_phot_hv_max
       use chimiedata_h
@@ -133,5 +133,5 @@
       integer :: iter(nlayer)      !  Number of chemical iterations
                                    !  within one physical timestep 
-      integer :: icount
+      integer,intent(in) :: icount ! physics iteration number
 !     for output:
 
@@ -285,14 +285,9 @@
                         ig, zzlay, zzlev, zdens, zycol, ptimestep)
             surface_flux2(ig,:) = surface_flux2(ig,:) + surface_flux(ig,:)
-            if (ngrid==1) then
-              if(mod(icount,ecritphy).eq.0) then
-                surface_flux2(ig,:) = surface_flux2(ig,:)/float(ecritphy)
-              endif
-            else
-              if(mod(icount*iphysiq,ecritphy).eq.0) then
-                surface_flux2(ig,:) = surface_flux2(ig,:)*iphysiq/float(ecritphy)
-              endif
+            if(mod(icount,diagfi_output_rate).eq.0) then
+              !note that surface_flux2(:,:) is reset every diagfi_output_rate
+              surface_flux2(ig,:) = surface_flux2(ig,:)/float(diagfi_output_rate)
             endif
-         end if
+         end if ! of if (depos)
 
 !=======================================================================
@@ -405,12 +400,6 @@
             end do
             ! Restart flux average
-            if (ngrid == 1) then
-               if(mod(icount,ecritphy).eq.0) then
-                  surface_flux2(:,:) = 0.0
-               endif
-            else
-               if(mod(icount*iphysiq,ecritphy).eq.0) then
-                  surface_flux2(:,:) = 0.0
-               endif
+            if(mod(icount,diagfi_output_rate).eq.0) then
+              surface_flux2(:,:) = 0.0
             endif
          endif ! end depos
@@ -424,6 +413,4 @@
 
       end if ! of if (output)
-
-      return
 
 
Index: trunk/LMDZ.GENERIC/libf/aeronostd/writediagspecUV.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/aeronostd/writediagspecUV.F	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/aeronostd/writediagspecUV.F	(revision 3725)
@@ -30,5 +30,6 @@
      &                              nbp_lon, nbp_lat, grid_type,
      &                              unstructured
-      use time_phylmdz_mod, only: ecritphy, iphysiq, day_step, day_ini
+      use time_phylmdz_mod, only: diagfi_output_rate, dtphys, daysec
+      use time_phylmdz_mod, only: day_ini
 
       implicit none
@@ -48,5 +49,5 @@
 !      real dx0
 
-      integer irythme
+      integer isample
       integer ierr
       integer iq
@@ -87,7 +88,7 @@
 !output frequency
 
-      irythme = ecritphy ! output with ecritphy frequency
-!EM+JL if the spetra need to be output more frequently, need to define a ecritSpec...
-!     irythme = iphysiq  ! sortie a tous les pas physique
+      isample = diagfi_output_rate ! output with ecritphy frequency
+!EM+JL if the spectra need to be output more frequently, need to define a 
+! diagspec_output_rate...
 
 !***************************************************************
@@ -173,5 +174,5 @@
 !------------------------------------------------------------------------
       if (nom.eq.firstnom) then
-          zitau = zitau + iphysiq
+          zitau = zitau + 1
       end if
 
@@ -180,5 +181,5 @@
 !--------------------------------------------------------
 
-      if ( MOD(zitau+1,irythme) .eq.0.) then
+      if ( MOD(zitau+1,isample) .eq.0.) then
 
 ! Compute/write/extend 'Time' coordinate (date given in days)
@@ -193,5 +194,5 @@
            ntime=ntime+1 ! increment # of stored time steps
            ! compute corresponding date (in days and fractions thereof)
-           date= float (zitau +1)/float (day_step)
+           date=(zitau +1)*(dtphys/daysec)
 
            if (is_master) then
@@ -313,5 +314,5 @@
         endif ! of if (dimpx.eq.3)
 
-      endif ! of if ( MOD(zitau+1,irythme) .eq.0.)
+      endif ! of if ( MOD(zitau+1,isample) .eq.0.)
 
       ! Close the NetCDF file
Index: trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F	(revision 3725)
@@ -21,6 +21,6 @@
       use comcstfi_mod, only: pi, cpp, rad, g, r,
      &                        mugaz, rcp, omeg
-      use time_phylmdz_mod, only: daysec, dtphys, day_step, ecritphy,
-     &                            nday, iphysiq
+      use time_phylmdz_mod, only: daysec, dtphys, nday,
+     &                            diagfi_output_rate
       use callkeys_mod, only: tracer,rings_shadow,
      &	                      specOLR,water,pceil,ok_slab_ocean,photochem
@@ -71,9 +71,7 @@
 !==================================================================
 
-#include "dimensions.h"
-#include "paramet.h"
-!include "dimphys.h"
-#include "netcdf.inc"
-#include "comgeom.h"
+      include "dimensions.h"
+      include "paramet.h"
+      include "comgeom.h"
 
 c --------------------------------------------------------------
@@ -91,5 +89,6 @@
 c
       INTEGER day0          ! date initial (sol ; =0 a Ls=0)
-      REAL day              ! date durant le run
+      REAL day              ! date during the run
+      INTEGER day_step ! number of time steps per day
       REAL time             ! time (0<time<1 ; time=0.5 a midi)
       REAL play(llm)        ! Pressure at the middle of the layers (Pa)
@@ -596,9 +595,8 @@
       write(*,*) " day_step = ",day_step
 
-      iphysiq=1 ! in 1D model physics are called evry time step
-      ecritphy=day_step ! default value for ecritphy
+      diagfi_output_rate=day_step ! default value for diagfi_output_rate
       PRINT *,'Nunber of steps between writediagfi ?'
-      call getin("ecritphy",ecritphy)
-      write(*,*) " ecritphy = ",ecritphy
+      call getin("diagfi_output_rate",diagfi_output_rate)
+      write(*,*) " diagfi_output_rate = ",diagfi_output_rate
 
       ndt=10 ! default value for ndt
Index: trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90	(revision 3725)
@@ -17,5 +17,5 @@
   use comgeomfi_h, only: totarea, totarea_planet
   use comsoil_h, only: ini_comsoil_h, nsoilmx, lay1_soil, alpha_soil
-  use time_phylmdz_mod, only: ecritphy,day_step,iphysiq, &
+  use time_phylmdz_mod, only: diagfi_output_rate, &
                               init_time, daysec, dtphys
   use comcstfi_mod, only: rad, cpp, g, r, rcp, &
@@ -76,5 +76,6 @@
   integer,intent(in) :: day_ini
 
-  INTEGER ig
+  INTEGER :: ig
+  REAL :: ecritphy ! to check that this obsolete flag is no longer used...
   CHARACTER(len=20) :: rname="inifis" ! routine name, for messages
  
@@ -103,8 +104,12 @@
   ! read in some parameters from "run.def" for physics,
   ! or shared between dynamics and physics.
+  ecritphy=-666 ! dummy default value
   call getin_p("ecritphy",ecritphy) ! frequency of outputs in physics,
                                     ! in dynamical steps
-  call getin_p("day_step",day_step) ! number of dynamical steps per day
-  call getin_p("iphysiq",iphysiq) ! call physics every iphysiq dyn step
+  if (ecritphy/=-666) then
+    call abort_physic(rname, &
+         "Error: parameter ecritphy is obsolete! Remove it! "//&
+         "And use diagfi_output_rate instead",1)
+  endif
 
   ! do we read a startphy.nc file? (default: .true.)
@@ -142,4 +147,11 @@
      call getin_p("tracer",tracer)
      if (is_master) write(*,*) trim(rname)//": tracer = ",tracer
+
+     if (is_master) write(*,*) trim(rname)//&
+       ": Output rate for diagfi.nc file (in physics steps) ?"
+     diagfi_output_rate=24 !default value
+     call getin_p("diagfi_output_rate",diagfi_output_rate)
+     if (is_master) write(*,*) trim(rname)//": diagfi_output_rate = ",&
+                               diagfi_output_rate
 
      if (is_master) write(*,*) trim(rname)//&
Index: trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3725)
@@ -37,7 +37,5 @@
                           igcm_h2o_ice, igcm_h2o_vap, igcm_dustbin, &
                           igcm_co2_ice, nesp, is_chim, is_condensable,constants_epsi_generic
-                        !  igcm_co2_ice, nesp, is_chim, is_condensable,constants_epsi_generic, &
-                        !  half_life, top_prod, bot_prod
-      use time_phylmdz_mod, only: ecritphy, iphysiq, nday
+      use time_phylmdz_mod, only: diagfi_output_rate, nday
       use phyetat0_mod, only: phyetat0,tab_cntrl_mod
       use surfini_mod, only: surfini
@@ -2249,5 +2247,5 @@
 
          if(meanOLR .and. is_master)then
-            if((ngrid.gt.1) .or. (mod(icount-1,ecritphy).eq.0))then
+            if((ngrid.gt.1) .or. (mod(icount-1,diagfi_output_rate).eq.0))then
                ! to record global radiative balance
                open(92,file="rad_bal.out",form='formatted',position='append')
@@ -2326,5 +2324,5 @@
 
          if(meanOLR .and. is_master)then
-            if((ngrid.gt.1) .or. (mod(icount-1,ecritphy).eq.0))then
+            if((ngrid.gt.1) .or. (mod(icount-1,diagfi_output_rate).eq.0))then
                ! to record global water balance
                open(98,file="h2o_bal.out",form='formatted',position='append')
@@ -2403,5 +2401,5 @@
 
       if(lastcall) then
-         ztime_fin = ptime + ptimestep/(float(iphysiq)*daysec)
+         ztime_fin = ptime + (ptimestep/daysec)
 
 #ifndef MESOSCALE
@@ -2525,5 +2523,5 @@
 !           OUTPUT in netcdf file "DIAGFI.NC", containing any variable for diagnostic
 !
-!             Note 1 : output with  period "ecritphy", set in "run.def"
+!             Note 1 : output with  period "diagfi_output_rate", set in "run.def"
 !
 !             Note 2 : writediagfi can also be called from any other subroutine for any variable,
Index: trunk/LMDZ.GENERIC/libf/phystd/time_phylmdz_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/time_phylmdz_mod.F90	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/time_phylmdz_mod.F90	(revision 3725)
@@ -4,7 +4,4 @@
     REAL,SAVE    :: dtphys     ! physics time step (s)
 !$OMP THREADPRIVATE(dtphys)
-    INTEGER,SAVE :: day_step    ! number of dynamical steps per day
-                                ! (set via inifis)
-!$OMP THREADPRIVATE(day_step)
     INTEGER,SAVE :: nday       ! number of days to run
 !$OMP THREADPRIVATE(nday)
@@ -14,10 +11,8 @@
 !$OMP THREADPRIVATE(day_ini)
 
-    INTEGER,SAVE :: ecritphy  ! for diagfi.nc outputs, write every ecritphy
-                              ! dynamical steps (set via inifis)
-!$OMP THREADPRIVATE(ecritphy)
-    INTEGER,SAVE :: iphysiq   ! call physics every iphysiq dynamical step
-                              ! (set via inifis)
-!$OMP THREADPRIVATE(iphysiq)
+    INTEGER,SAVE :: diagfi_output_rate ! for diagfi.nc outputs, write every 
+                                     ! diagfi_output_rate physical step
+                                    ! (set via inifis)
+!$OMP THREADPRIVATE(diagfi_output_rate)
 
 CONTAINS
Index: trunk/LMDZ.GENERIC/libf/phystd/volcano.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/volcano.F90	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/volcano.F90	(revision 3725)
@@ -338,5 +338,5 @@
         READ(407,*,iostat=ierr) nvoltrac
         write(*,*)trim(rname)//' number of outgased tracers:',nvoltrac
-        !Read in eruption frequency (in multiples of iphysiq) and offset of eruption
+        !Read in eruption frequency (in sols) and offset of eruption
         READ(407,'(A)',iostat=ierr) tracline
         READ(tracline,*) eruptfreq, eruptoffset, eruptdur
Index: trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F	(revision 3725)
@@ -41,5 +41,6 @@
       use surfdat_h, only: phisfi
       use geometry_mod, only: cell_area
-      use time_phylmdz_mod, only: ecritphy, day_step, iphysiq, day_ini
+      use time_phylmdz_mod, only: diagfi_output_rate, dtphys, daysec
+      use time_phylmdz_mod, only: day_ini
       USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root,
      &                               is_master, gather
@@ -73,5 +74,4 @@
       REAL area((nbp_lon+1),nbp_lat)
 
-      integer irythme
       integer ierr,ierr2
       integer i,j,l, ig0
@@ -119,9 +119,4 @@
            return
       endif
-
-!***************************************************************
-!Sortie des variables au rythme voulu
-
-      irythme = int(ecritphy) ! output rate set by ecritphy
 
 !***************************************************************
@@ -267,5 +262,5 @@
 !------------------------------------------------------------------------
       if (nom.eq.firstnom) then
-          zitau = zitau + iphysiq
+          zitau = zitau + 1
       end if
 
@@ -274,5 +269,5 @@
 !--------------------------------------------------------
 
-      if ( MOD(zitau+1,irythme) .eq.0.) then
+      if ( MOD(zitau+1,diagfi_output_rate) .eq.0.) then
 
 ! Compute/write/extend 'Time' coordinate (date given in days)
@@ -287,5 +282,5 @@
            ntime=ntime+1 ! increment # of stored time steps
            ! compute corresponding date (in days and fractions thereof)
-           date=(zitau +1.)/day_step
+           date=(zitau +1.)*(dtphys/daysec)
            ! Get NetCDF ID of 'Time' variable
            ierr= NF_INQ_VARID(nid,"Time",varid)
@@ -619,5 +614,5 @@
         endif ! of if (dim.eq.3) elseif(dim.eq.2)...
 
-      endif ! of if ( MOD(zitau+1,irythme) .eq.0.)
+      endif ! of if ( MOD(zitau+1,diagfi_output_rate) .eq.0.)
 
       if (is_master) then
Index: trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90	(revision 3725)
@@ -20,5 +20,5 @@
 use comsoil_h, only: nsoilmx, inertiedat
 use geometry_mod, only: cell_area
-use time_phylmdz_mod, only: ecritphy, day_step, iphysiq
+use time_phylmdz_mod, only: diagfi_output_rate, dtphys, daysec
 use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
 use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo, &
@@ -92,8 +92,4 @@
     stop
   endif
-
-  ! Set output sample rate
-  isample=int(ecritphy) ! same as for diagfi outputs
-  ! Note ecritphy is known from control.h
 
   ! Create output NetCDF file
@@ -158,15 +154,14 @@
 if (name.eq.firstname) then
   ! if we run across 'firstname', then it is a new time step
-  zitau=zitau+iphysiq
-  ! Note iphysiq is known from control.h
+  zitau=zitau+1
 endif
 
 ! 3. Write data, if the time index matches the sample rate
-if (mod(zitau+1,isample).eq.0) then
+if (mod(zitau+1,diagfi_output_rate).eq.0) then
 
 ! 3.1 If first call at this date, update 'time' variable
   if (name.eq.firstname) then
     ntime=ntime+1
-    date=float(zitau+1)/float(day_step)
+    date=(zitau+1)*(dtphys/daysec)
     ! Note: day_step is known from control.h
 
@@ -394,5 +389,5 @@
 
 endif ! of if (dimpx.eq.3) elseif (dimpx.eq.2) ...
-endif ! of if (mod(zitau+1,isample).eq.0)
+endif ! of if (mod(zitau+1,diagfi_output_rate).eq.0)
 
 ! 4. Close the NetCDF file
Index: trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F	(revision 3725)
@@ -48,5 +48,6 @@
      &                              nbp_lon, nbp_lat, grid_type,
      &                              unstructured
-      use time_phylmdz_mod, only: ecritphy, iphysiq, day_step, day_ini
+      use time_phylmdz_mod, only: diagfi_output_rate, dtphys, daysec
+      use time_phylmdz_mod, only: day_ini
       use callkeys_mod, only: iradia
 
@@ -67,5 +68,5 @@
 !      real dx0
 
-      integer irythme
+      integer isample
       integer ierr
       integer iq
@@ -106,7 +107,7 @@
 !Sortie des variables au rythme voulu
 
-      irythme = ecritphy*iradia ! sortie au rythme de ecritphy*iradia
-!EM+JL if the spetra need to be output more frequently, need to define a ecritSpec...
-!     irythme = iphysiq  ! sortie a tous les pas physique
+      isample = diagfi_output_rate*iradia ! output rate
+!EM+JL if the spectra need to be output more frequently, need to define a 
+! diagspec_output_rate...
 
 
@@ -193,5 +194,5 @@
 !------------------------------------------------------------------------
       if (nom.eq.firstnom) then
-          zitau = zitau + iphysiq
+          zitau = zitau + 1
       end if
 
@@ -200,5 +201,5 @@
 !--------------------------------------------------------
 
-      if ( MOD(zitau+1,irythme) .eq.0.) then
+      if ( MOD(zitau+1,isample) .eq.0.) then
 
 ! Compute/write/extend 'Time' coordinate (date given in days)
@@ -213,5 +214,5 @@
            ntime=ntime+1 ! increment # of stored time steps
            ! compute corresponding date (in days and fractions thereof)
-           date= float (zitau +1)/float (day_step)
+           date=(zitau +1)*(dtphys/daysec)
 
            if (is_master) then
@@ -333,5 +334,5 @@
         endif ! of if (dimpx.eq.3)
 
-      endif ! of if ( MOD(zitau+1,irythme) .eq.0.)
+      endif ! of if ( MOD(zitau+1,isample) .eq.0.)
 
       ! Close the NetCDF file
Index: trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F	(revision 3724)
+++ trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F	(revision 3725)
@@ -48,5 +48,6 @@
      &                              nbp_lon, nbp_lat, grid_type,
      &                              unstructured
-      use time_phylmdz_mod, only: ecritphy, iphysiq, day_step, day_ini
+      use time_phylmdz_mod, only: diagfi_output_rate, dtphys, daysec
+      use time_phylmdz_mod, only: day_ini
       use callkeys_mod, only: iradia
 
@@ -67,5 +68,5 @@
 !      real dx0
 
-      integer irythme
+      integer isample
       integer ierr
       integer iq
@@ -106,7 +107,7 @@
 !Sortie des variables au rythme voulu
 
-      irythme = ecritphy*iradia ! sortie au rythme de ecritphy
-!EM+JL if the spetra need to be output more frequently, need to define a ecritSpec...
-!     irythme = iphysiq  ! sortie a tous les pas physique
+      isample = diagfi_output_rate*iradia ! output rate
+!EM+JL if the spectra need to be output more frequently, need to define a 
+! diagspec_output_rate...
 
 !***************************************************************
@@ -192,5 +193,5 @@
 !------------------------------------------------------------------------
       if (nom.eq.firstnom) then
-          zitau = zitau + iphysiq
+          zitau = zitau + 1
       end if
 
@@ -199,5 +200,5 @@
 !--------------------------------------------------------
 
-      if ( MOD(zitau+1,irythme) .eq.0.) then
+      if ( MOD(zitau+1,isample) .eq.0.) then
 
 ! Compute/write/extend 'Time' coordinate (date given in days)
@@ -212,5 +213,5 @@
            ntime=ntime+1 ! increment # of stored time steps
            ! compute corresponding date (in days and fractions thereof)
-           date= float (zitau +1)/float (day_step)
+           date=(zitau +1)*(dtphys/daysec)
 
            if (is_master) then
@@ -332,5 +333,5 @@
         endif ! of if (dimpx.eq.3)
 
-      endif ! of if ( MOD(zitau+1,irythme) .eq.0.)
+      endif ! of if ( MOD(zitau+1,isample) .eq.0.)
 
       ! Close the NetCDF file
