Index: trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/iniphysiq_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/iniphysiq_mod.F90	(revision 1523)
+++ trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/iniphysiq_mod.F90	(revision 1524)
@@ -23,4 +23,6 @@
 use infotrac, only : nqtot ! number of advected tracers
 use comgeomfi_h, only: ini_fillgeom
+use temps_mod, only: day_ini, hour_ini
+use phys_state_var_init_mod, only: phys_state_var_init
 use regular_lonlat_mod, only: init_regular_lonlat, &
                               east, west, north, south, &
@@ -171,7 +173,11 @@
 ! and do some initializations 
 call phys_state_var_init(klon_omp,nlayer,nqtot, &
-                         punjours,ptimestep,prad,pg,pr,pcpp)
+                         day_ini,hour_ini,punjours,ptimestep, &
+                         prad,pg,pr,pcpp)
 call ini_fillgeom(klon_omp,rlatd,rlond,airephy)
 call conf_phys(klon_omp,nlayer,nqtot)
+
+! Initialize some "temporal and calendar" related variables
+!CALL init_time(day_ini,hour_ini,punjours,ptimestep)
 
 !$OMP END PARALLEL
Index: trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/newstart.F
===================================================================
--- trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/newstart.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/dynlonlat_phylonlat/phymars/newstart.F	(revision 1524)
@@ -41,4 +41,5 @@
       USE temps_mod, ONLY: day_ini,hour_ini
       USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
+      USE phys_state_var_init_mod, ONLY: phys_state_var_init
 
       implicit none
@@ -373,5 +374,6 @@
 !      'datafile' path may be changed by user)
       call phys_state_var_init(ngridmx,llm,nqtot,
-     .                         daysec,dtphys,rad,g,r,cpp)
+     &                         day_ini,hour_ini,daysec,dtphys,
+     &                         rad,g,r,cpp)
       call ini_fillgeom(ngridmx,latfi,lonfi,airefi)
       call conf_phys(ngridmx,llm,nqtot)
Index: trunk/LMDZ.MARS/libf/phymars/callradite.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/callradite.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/callradite.F	(revision 1524)
@@ -10,5 +10,6 @@
      &            iaer_dust_submicron,iaer_h2o_ice
       use yomlw_h, only: gcp, nlaylte
-      USE comcstfi_h
+      use comcstfi_h, only: g,cpp
+      use time_phylmdz_mod, only: daysec
       IMPLICIT NONE
 c=======================================================================
Index: trunk/LMDZ.MARS/libf/phymars/co2snow.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/co2snow.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/co2snow.F	(revision 1524)
@@ -4,5 +4,5 @@
       use surfdat_h, only: iceradius, dtemisice
       use comgeomfi_h, only: lati ! grid point latitudes (rad)
-      USE comcstfi_h
+      use time_phylmdz_mod, only: daysec
       IMPLICIT NONE
 
Index: trunk/LMDZ.MARS/libf/phymars/comcstfi_h.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/comcstfi_h.F90	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/comcstfi_h.F90	(revision 1524)
@@ -2,14 +2,12 @@
       IMPLICIT NONE
 
-      REAL pi
-      REAL rad
-      REAL g
-      REAL r
-      REAL cpp
-      REAL rcp
-      REAL dtphys
-      REAL daysec
-      REAL mugaz
-      REAL omeg
+      REAL pi ! something like 3.14159
+      REAL rad ! radius of the planet (m)
+      REAL g ! gravity (m/s2)
+      REAL r ! reduced gas constant (r=8.314511/(mugaz/1000.0))
+      REAL cpp ! Cp of the atmosphere
+      REAL rcp ! r/cpp
+      REAL mugaz ! molar mass of the atmosphere (g/mol)
+      REAL omeg ! planet rotation rate (rad/s)
 
       END MODULE comcstfi_h
Index: trunk/LMDZ.MARS/libf/phymars/conf_phys.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1524)
@@ -40,5 +40,5 @@
       use control_mod, only: ecritphy
       use planete_h
-      USE comcstfi_h, only: daysec,dtphys
+      use time_phylmdz_mod, only: daysec,dtphys
       use dimradmars_mod, only: naerkind, name_iaer,
      &                      ini_scatterers,tauvis
Index: trunk/LMDZ.MARS/libf/phymars/dyn1d/temps_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dyn1d/temps_mod.F90	(revision 1523)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../../dyn3d/temps_mod.F90
Index: trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F	(revision 1524)
@@ -16,9 +16,10 @@
       use planete_h, only: year_day, periheli, aphelie, peri_day,
      &                     obliquit, emin_turb, lmixmin
-      use comcstfi_h, only: pi, rad, daysec, omeg, g, mugaz, rcp, r,
-     &                      cpp, dtphys
+      use comcstfi_h, only: pi, rad, omeg, g, mugaz, rcp, r, cpp
+      use time_phylmdz_mod, only: daysec, dtphys
       use dimradmars_mod, only: tauscaling,tauvis
       USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff,sig
       USE logic_mod, ONLY: hybrid
+      USE phys_state_var_init_mod, ONLY: phys_state_var_init
       IMPLICIT NONE
 
@@ -478,5 +479,5 @@
 !Mars possible matter with dtphys in input and include!!!
       call phys_state_var_init(1,llm,nq,
-     .          daysec,dtphys,rad,g,r,cpp)
+     .          day0,time,daysec,dtphys,rad,g,r,cpp)
       call ini_fillgeom(1,latitude,longitude,(/1.0/))
       call conf_phys(1,llm,nq)
Index: trunk/LMDZ.MARS/libf/phymars/eofdump_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/eofdump_mod.F90	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/eofdump_mod.F90	(revision 1524)
@@ -79,5 +79,6 @@
 
       use comgeomfi_h, only: long, lati
-      use comcstfi_h
+      use comcstfi_h, only: pi
+      use time_phylmdz_mod, only: daysec, dtphys
       USE comvert_mod, ONLY: aps,bps
       implicit none
Index: trunk/LMDZ.MARS/libf/phymars/inistats.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/inistats.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/inistats.F	(revision 1524)
@@ -3,12 +3,13 @@
       use mod_phys_lmdz_para, only : is_master
       USE comvert_mod, ONLY: ap,bp,aps,bps,preff,pseudoalt,presnivs
-      USE comcstfi_h, ONLY: daysec,dtphys,pi
+      USE comcstfi_h, ONLY: pi
+      USE time_phylmdz_mod, ONLY: daysec,dtphys
       implicit none
 
-#include "dimensions.h"
-#include "paramet.h"
-#include "comgeom.h"
-#include "statto.h"
-#include "netcdf.inc"
+      include "dimensions.h"
+      include "paramet.h"
+      include "comgeom.h"
+      include "statto.h"
+      include "netcdf.inc"
 
       integer,intent(out) :: ierr
Index: trunk/LMDZ.MARS/libf/phymars/iniwrite.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/iniwrite.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/iniwrite.F	(revision 1524)
@@ -2,9 +2,9 @@
 
       use comsoil_h, only: mlayer, nsoilmx
-      USE comcstfi_h
+      USE comcstfi_h, only: g, mugaz, omeg, rad, rcp, pi 
       USE comvert_mod, ONLY: ap,bp,aps,bps,pseudoalt
       USE logic_mod, ONLY: fxyhypb,ysinus
       USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy
-      USE temps_mod, ONLY: hour_ini
+      USE time_phylmdz_mod, ONLY: hour_ini, daysec, dtphys
       USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
       IMPLICIT NONE
Index: trunk/LMDZ.MARS/libf/phymars/lwi.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwi.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/lwi.F	(revision 1524)
@@ -6,5 +6,6 @@
       use dimradmars_mod, only: ndlo2, ndlon, nflev, nir
       use yomlw_h, only: gcp, nlaylte, xi
-      USE comcstfi_h
+      USE comcstfi_h, ONLY: g, cpp
+      USE time_phylmdz_mod, ONLY: dtphys
       implicit none
 
Index: trunk/LMDZ.MARS/libf/phymars/nirco2abs.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nirco2abs.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/nirco2abs.F	(revision 1524)
@@ -4,5 +4,6 @@
        use tracer_mod, only: igcm_co2, igcm_o
        use comgeomfi_h, only: sinlon, coslon, sinlat, coslat
-       USE comcstfi_h
+       USE comcstfi_h, ONLY: pi
+       USE time_phylmdz_mod, ONLY: daysec
        IMPLICIT NONE
 c=======================================================================
Index: trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F	(revision 1524)
@@ -1357,5 +1357,5 @@
       function hrkday_convert                        
      @     ( mmean_nlte,cpmean_nlte )         
-      USE comcstfi_h
+      use time_phylmdz_mod, only: daysec
       use param_v4_h, only: n_avog
       implicit none                           
Index: trunk/LMDZ.MARS/libf/phymars/phyredem.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/phyredem.F90	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/phyredem.F90	(revision 1524)
@@ -22,6 +22,8 @@
                       put_var, put_field, length
   use mod_grid_phy_lmdz, only : klon_glo
-  use planete_h
-  use comcstfi_h
+  use planete_h, only: aphelie, emin_turb, lmixmin, obliquit, &
+                       peri_day, periheli, year_day
+  use comcstfi_h, only: g, mugaz, omeg, rad, rcp
+  use time_phylmdz_mod, only: daysec
 
   implicit none
Index: trunk/LMDZ.MARS/libf/phymars/phys_state_var_init.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/phys_state_var_init.F	(revision 1523)
+++ 	(revision )
@@ -1,90 +1,0 @@
-      SUBROUTINE phys_state_var_init(ngrid,nlayer,nq
-     .               ,pdaysec,ptimestep,prad,pg,pr,pcpp)
-
-!=======================================================================
-!
-!   purpose:
-!   -------
-!
-!   Allocate arrays in modules
-!   Fill geometrical arrays
-!   Fill a first set of physical constants
-!   -- was done previously in inifis
-!
-!=======================================================================
-!   
-!   authors: Ehouarn Millour and Aymeric Spiga
-!            14/04/2014
-!
-!   arguments:
-!   ----------
-!
-!   input:
-!   ------
-!
-!    ngrid                 Size of the horizontal grid.
-!    nlayer                Number of vertical layers.
-!    nq                    Number of tracers.
-!
-!=======================================================================
-
-      use slope_mod, only: ini_slope_mod
-      use comsaison_h, only: ini_comsaison_h
-      use surfdat_h, only: ini_surfdat_h
-      use comgeomfi_h, only: ini_comgeomfi_h
-      use comsoil_h, only: ini_comsoil_h
-      use dimradmars_mod, only: ini_dimradmars_mod
-      use yomlw_h, only: ini_yomlw_h
-      use conc_mod, only: ini_conc_mod
-      use turb_mod, only: ini_turb_mod
-      use comcstfi_h, only: pi,rad,cpp,g,r,rcp,daysec,dtphys
-      use tracer_mod, only: nqmx
-
-      IMPLICIT NONE
-      
-      INTEGER,INTENT(IN) :: ngrid,nlayer,nq
-      REAL,INTENT(IN) :: pdaysec,ptimestep,prad,pg,pr,pcpp
-      EXTERNAL SSUM
-      REAL SSUM
-
-      ! set dimension in tracer_mod
-      nqmx=nq
-
-      ! set parameters in comcstfi_h
-      pi=2.*asin(1.) 
-      rad=prad
-      cpp=pcpp
-      g=pg
-      r=pr
-      rcp=r/cpp
-      daysec=pdaysec
-      dtphys=ptimestep
-
-      ! allocate "slope_mod" arrays
-      call ini_slope_mod(ngrid)
-
-      ! allocate "comsaison_h" arrays
-      call ini_comsaison_h(ngrid)
-
-      ! allocate "surfdat_h" arrays
-      call ini_surfdat_h(ngrid,nq)
-
-      ! allocate "comgeomfi_h" arrays
-      call ini_comgeomfi_h(ngrid)
-
-      ! allocate "comsoil_h" arrays
-      call ini_comsoil_h(ngrid)
-
-      ! set some variables in "dimradmars_mod"
-      call ini_dimradmars_mod(ngrid,nlayer)
-
-      ! allocate arrays in "yomlw_h"
-      call ini_yomlw_h(ngrid)
-
-      ! allocate arrays in "conc_mod" (aeronomars)
-      call ini_conc_mod(ngrid,nlayer)
-
-      ! allocate arrays in "turb_mod"
-      call ini_turb_mod(ngrid,nlayer)
-
-      END SUBROUTINE phys_state_var_init
Index: trunk/LMDZ.MARS/libf/phymars/phys_state_var_init_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/phys_state_var_init_mod.F90	(revision 1524)
+++ trunk/LMDZ.MARS/libf/phymars/phys_state_var_init_mod.F90	(revision 1524)
@@ -0,0 +1,99 @@
+MODULE phys_state_var_init_mod
+
+CONTAINS
+
+      SUBROUTINE phys_state_var_init(ngrid,nlayer,nq, &
+                                     day_ini,hour_ini,pdaysec,ptimestep, &
+                                     prad,pg,pr,pcpp)
+
+!=======================================================================
+!
+!   purpose:
+!   -------
+!
+!   Allocate arrays in modules
+!   Fill geometrical arrays
+!   Fill a first set of physical constants
+!   -- was done previously in inifis
+!
+!=======================================================================
+!   
+!   authors: Ehouarn Millour and Aymeric Spiga
+!            14/04/2014
+!
+!   arguments:
+!   ----------
+!
+!   input:
+!   ------
+!
+!    ngrid                 Size of the horizontal grid.
+!    nlayer                Number of vertical layers.
+!    nq                    Number of tracers.
+!
+!=======================================================================
+
+      use slope_mod, only: ini_slope_mod
+      use comsaison_h, only: ini_comsaison_h
+      use surfdat_h, only: ini_surfdat_h
+      use comgeomfi_h, only: ini_comgeomfi_h
+      use comsoil_h, only: ini_comsoil_h
+      use dimradmars_mod, only: ini_dimradmars_mod
+      use yomlw_h, only: ini_yomlw_h
+      use conc_mod, only: ini_conc_mod
+      use turb_mod, only: ini_turb_mod
+      use comcstfi_h, only: pi,rad,cpp,g,r,rcp
+      use tracer_mod, only: nqmx
+      use time_phylmdz_mod, only: init_time
+
+      IMPLICIT NONE
+      
+      INTEGER,INTENT(IN) :: ngrid,nlayer,nq
+      INTEGER,INTENT(IN) :: day_ini
+      REAL,INTENT(IN) :: hour_ini
+      REAL,INTENT(IN) :: pdaysec,ptimestep,prad,pg,pr,pcpp
+
+      ! set dimension in tracer_mod
+      nqmx=nq
+
+      ! set parameters in comcstfi_h
+      pi=2.*asin(1.) 
+      rad=prad
+      cpp=pcpp
+      g=pg
+      r=pr
+      rcp=r/cpp
+
+      ! Initialize some "temporal and calendar" related variables
+      call init_time(day_ini,hour_ini,pdaysec,ptimestep)
+
+      ! allocate "slope_mod" arrays
+      call ini_slope_mod(ngrid)
+
+      ! allocate "comsaison_h" arrays
+      call ini_comsaison_h(ngrid)
+
+      ! allocate "surfdat_h" arrays
+      call ini_surfdat_h(ngrid,nq)
+
+      ! allocate "comgeomfi_h" arrays
+      call ini_comgeomfi_h(ngrid)
+
+      ! allocate "comsoil_h" arrays
+      call ini_comsoil_h(ngrid)
+
+      ! set some variables in "dimradmars_mod"
+      call ini_dimradmars_mod(ngrid,nlayer)
+
+      ! allocate arrays in "yomlw_h"
+      call ini_yomlw_h(ngrid)
+
+      ! allocate arrays in "conc_mod" (aeronomars)
+      call ini_conc_mod(ngrid,nlayer)
+
+      ! allocate arrays in "turb_mod"
+      call ini_turb_mod(ngrid,nlayer)
+
+      END SUBROUTINE phys_state_var_init
+
+END MODULE phys_state_var_init_mod
Index: trunk/LMDZ.MARS/libf/phymars/physiq.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1524)
@@ -33,5 +33,6 @@
       use planete_h, only: aphelie, periheli, year_day, peri_day,
      &                     obliquit
-      USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad, daysec
+      USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad
+      use time_phylmdz_mod, only: daysec
       use param_v4_h, only: nreact,n_avog, 
      &                      fill_data_thermos, allocate_param_thermos
Index: trunk/LMDZ.MARS/libf/phymars/tabfi.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 1524)
@@ -50,6 +50,8 @@
       use iostart, only: get_var
       use mod_phys_lmdz_para, only: is_parallel
-      use comcstfi_h
-      use planete_h
+      use comcstfi_h, only: g, mugaz, omeg, rad, rcp
+      use time_phylmdz_mod, only: daysec, dtphys
+      use planete_h, only: aphelie, emin_turb, lmixmin, obliquit,
+     &                     peri_day, periheli, year_day
       implicit none
  
@@ -541,5 +543,5 @@
       write(*,*) 
 
-      ENDIF 			!	of if (Lmodif == 1)
+      ENDIF ! of if (Lmodif == 1)
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/time_phylmdz_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/time_phylmdz_mod.F90	(revision 1524)
+++ trunk/LMDZ.MARS/libf/phymars/time_phylmdz_mod.F90	(revision 1524)
@@ -0,0 +1,30 @@
+MODULE time_phylmdz_mod
+
+    IMPLICIT NONE
+    REAL,SAVE    :: dtphys      ! physics time step (s)
+!$OMP THREADPRIVATE(pdtphys)
+    REAL,SAVE    :: daysec     ! length of day (s)
+!$OMP THREADPRIVATE(daysec)
+    INTEGER,SAVE :: day_ini     ! initial day of the run
+!$OMP THREADPRIVATE(day_ini)
+    REAL,SAVE :: hour_ini       ! start time (fraction of day) of the run
+                                ! 0=<hour_ini<1
+!$OMP THREADPRIVATE(hour_ini)
+
+CONTAINS
+
+  SUBROUTINE init_time(day_ini_, hour_ini_, daysec_, dtphys_)
+    IMPLICIT NONE
+    INTEGER,INTENT(IN) :: day_ini_
+    REAL,INTENT(IN) :: hour_ini_
+    REAL,INTENT(IN) :: daysec_
+    REAL,INTENT(IN) :: dtphys_
+    
+    day_ini=day_ini_
+    hour_ini=hour_ini_
+    daysec=daysec_
+    dtphys=dtphys_
+
+  END SUBROUTINE init_time
+
+END MODULE time_phylmdz_mod      
Index: trunk/LMDZ.MARS/libf/phymars/writediagfi.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 1524)
@@ -44,5 +44,5 @@
      &                               is_master, gather
       USE mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo
-      USE temps_mod, ONLY: day_ini
+      USE time_phylmdz_mod, ONLY: day_ini
       implicit none
 
Index: trunk/LMDZ.MARS/libf/phymars/writeg1d.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/writeg1d.F	(revision 1523)
+++ trunk/LMDZ.MARS/libf/phymars/writeg1d.F	(revision 1524)
@@ -124,5 +124,5 @@
 
       SUBROUTINE endg1d(ngrid,nlayer,zlayer,ndt)
-      USE comcstfi_h
+      USE time_phylmdz_mod, ONLY: dtphys, daysec
       IMPLICIT NONE
 c.......................................................................
