Index: /trunk/DOC/chantiers/commit_importants.log
===================================================================
--- /trunk/DOC/chantiers/commit_importants.log	(revision 1524)
+++ /trunk/DOC/chantiers/commit_importants.log	(revision 1525)
@@ -1647,5 +1647,5 @@
 
 **********************
-**** commit_v1523 ****
+**** commit_v1524 ****
 **********************
 Ehouarn: More updates to enforce dynamics/physics separation:
@@ -1653,2 +1653,8 @@
   make a "time_phylmdz_mod.F90" module to store that
   information and fill it via "iniphysiq".
+
+**********************
+**** commit_v1525 ****
+**********************
+Ehouarn: Further adaptations to enforce dynamics/physics separation:
+- get rid of references to "control_mod" from physics packages.
Index: /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/iniphysiq_mod.F90
===================================================================
--- /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/iniphysiq_mod.F90	(revision 1524)
+++ /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/iniphysiq_mod.F90	(revision 1525)
@@ -16,4 +16,5 @@
                                 klon_omp_end, & ! end index of local omp subgrid
                                 klon_mpi_begin ! start indes of columns (on local mpi grid)
+  USE control_mod, ONLY: nday
   USE comgeomphy, ONLY: initcomgeomphy, &
                         airephy, & ! physics grid area (m2)
@@ -175,5 +176,5 @@
 
   ! Initialize some "temporal and calendar" related variables
-  CALL init_time(annee_ref,day_ref,day_ini,day_end,ptimestep)
+  CALL init_time(annee_ref,day_ref,day_ini,day_end,nday,ptimestep)
 
 !$OMP END PARALLEL
Index: /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/scal_wind.F
===================================================================
--- /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/scal_wind.F	(revision 1525)
+++ /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/scal_wind.F	(revision 1525)
@@ -0,0 +1,54 @@
+      SUBROUTINE scal_wind(xus,xvs,xu,xv)
+c=======================================================================
+c
+c
+c   Subject:
+c   ------
+c On passe  les variable xus, xvs  aux points de vent u et v (xu et xv)
+c
+c=======================================================================
+      IMPLICIT NONE
+c-----------------------------------------------------------------------
+c   Declararations:
+c   ---------------
+
+#include "dimensions.h"
+#include "paramet.h"
+
+c   Arguments:
+c   ----------
+
+      REAL xu(iip1,jjp1,llm),xv(iip1,jjm,llm)
+      REAL xus(iip1,jjp1,llm), xvs (iip1,jjp1,llm)
+
+c   Local:
+c   ------
+
+      INTEGER i,j,l
+
+c-----------------------------------------------------------------------
+
+c   transport zonal:
+c   ----------------
+      DO l=1,llm
+        Do j=1,jjp1
+	      DO i=1,iim
+            xu(i,j,l)=0.5*(xus(i,j,l)+xus(i+1,j,l))
+	      ENDDO
+          xu(iip1,j,l)=xu(1,j,l)
+	    ENDDO
+      ENDDO
+
+
+c   Transport meridien:
+c   -------------------
+      DO l=1,llm
+         DO j=1,jjm
+           do i=1 ,iip1
+	         xv(i,j,l)=.5*(xvs(i,j,l)+xvs(i,j+1,l))
+           end do
+	     ENDDO
+	  ENDDO
+
+      RETURN
+      END
Index: /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/wind_scal.F
===================================================================
--- /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/wind_scal.F	(revision 1525)
+++ /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phytitan/wind_scal.F	(revision 1525)
@@ -0,0 +1,54 @@
+      SUBROUTINE wind_scal(pbaru,pbarv,us,vs)
+c=======================================================================
+c
+c
+c   Subject:
+c   ------
+c   On ramene les flux de masse /vents  aux points scalaires.
+c
+c=======================================================================
+      IMPLICIT NONE
+c-----------------------------------------------------------------------
+c   Declararations:
+c   ---------------
+
+#include "dimensions.h"
+#include "paramet.h"
+
+c   Arguments:
+c   ----------
+
+      REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)
+      REAL us(ip1jmp1,llm), vs (ip1jmp1,llm)
+
+c   Local:
+c   ------
+
+      INTEGER ij,l
+
+c-----------------------------------------------------------------------
+
+c   transport zonal:
+c   ----------------
+      DO l=1,llm
+	 DO ij=2,ip1jmp1
+            us(ij,l)=.5*(pbaru(ij,l)+pbaru(ij-1,l))
+	 ENDDO
+      ENDDO
+      CALL SCOPY(jjp1*llm,us(iip1,1),iip1,us(1,1),iip1)
+
+
+c   Transport meridien:
+c   -------------------
+      DO l=1,llm
+         DO ij=iip2,ip1jm
+	    vs(ij,l)=.5*(pbarv(ij,l)+pbarv(ij-iip1,l))
+	 ENDDO
+	 DO ij=1,iip1
+	    vs(ij,l)=0.
+	    vs(ip1jm+ij,l)=0.
+	 ENDDO
+      ENDDO
+
+      RETURN
+      END
Index: /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phyvenus/scal_wind.F
===================================================================
--- /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phyvenus/scal_wind.F	(revision 1525)
+++ /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phyvenus/scal_wind.F	(revision 1525)
@@ -0,0 +1,54 @@
+      SUBROUTINE scal_wind(xus,xvs,xu,xv)
+c=======================================================================
+c
+c
+c   Subject:
+c   ------
+c On passe  les variable xus, xvs  aux points de vent u et v (xu et xv)
+c
+c=======================================================================
+      IMPLICIT NONE
+c-----------------------------------------------------------------------
+c   Declararations:
+c   ---------------
+
+#include "dimensions.h"
+#include "paramet.h"
+
+c   Arguments:
+c   ----------
+
+      REAL xu(iip1,jjp1,llm),xv(iip1,jjm,llm)
+      REAL xus(iip1,jjp1,llm), xvs (iip1,jjp1,llm)
+
+c   Local:
+c   ------
+
+      INTEGER i,j,l
+
+c-----------------------------------------------------------------------
+
+c   transport zonal:
+c   ----------------
+      DO l=1,llm
+        Do j=1,jjp1
+	      DO i=1,iim
+            xu(i,j,l)=0.5*(xus(i,j,l)+xus(i+1,j,l))
+	      ENDDO
+          xu(iip1,j,l)=xu(1,j,l)
+	    ENDDO
+      ENDDO
+
+
+c   Transport meridien:
+c   -------------------
+      DO l=1,llm
+         DO j=1,jjm
+           do i=1 ,iip1
+	         xv(i,j,l)=.5*(xvs(i,j,l)+xvs(i,j+1,l))
+           end do
+	     ENDDO
+	  ENDDO
+
+      RETURN
+      END
Index: /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phyvenus/wind_scal.F
===================================================================
--- /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phyvenus/wind_scal.F	(revision 1525)
+++ /trunk/LMDZ.COMMON/libf/dynlonlat_phylonlat/phyvenus/wind_scal.F	(revision 1525)
@@ -0,0 +1,54 @@
+      SUBROUTINE wind_scal(pbaru,pbarv,us,vs)
+c=======================================================================
+c
+c
+c   Subject:
+c   ------
+c   On ramene les flux de masse /vents  aux points scalaires.
+c
+c=======================================================================
+      IMPLICIT NONE
+c-----------------------------------------------------------------------
+c   Declararations:
+c   ---------------
+
+#include "dimensions.h"
+#include "paramet.h"
+
+c   Arguments:
+c   ----------
+
+      REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)
+      REAL us(ip1jmp1,llm), vs (ip1jmp1,llm)
+
+c   Local:
+c   ------
+
+      INTEGER ij,l
+
+c-----------------------------------------------------------------------
+
+c   transport zonal:
+c   ----------------
+      DO l=1,llm
+	 DO ij=2,ip1jmp1
+            us(ij,l)=.5*(pbaru(ij,l)+pbaru(ij-1,l))
+	 ENDDO
+      ENDDO
+      CALL SCOPY(jjp1*llm,us(iip1,1),iip1,us(1,1),iip1)
+
+
+c   Transport meridien:
+c   -------------------
+      DO l=1,llm
+         DO ij=iip2,ip1jm
+	    vs(ij,l)=.5*(pbarv(ij,l)+pbarv(ij-iip1,l))
+	 ENDDO
+	 DO ij=1,iip1
+	    vs(ij,l)=0.
+	    vs(ip1jm+ij,l)=0.
+	 ENDDO
+      ENDDO
+
+      RETURN
+      END
Index: /trunk/LMDZ.GENERIC/README
===================================================================
--- /trunk/LMDZ.GENERIC/README	(revision 1524)
+++ /trunk/LMDZ.GENERIC/README	(revision 1525)
@@ -1148,2 +1148,6 @@
   to module "time_phylmdz_mod".
 - made "inifis" a module.
+
+== 30/03/2016 == EM
+- Got rid of references to "control_mod" from the physics. Added a couple
+  of relevent variables for outputs in time_phylmdz_mod.
Index: /trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/iniphysiq_mod.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/iniphysiq_mod.F90	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/dynlonlat_phylonlat/phystd/iniphysiq_mod.F90	(revision 1525)
@@ -14,5 +14,5 @@
                                klon_omp_end, & ! end index of local omp subgrid
                                klon_mpi_begin ! start indes of columns (on local mpi grid)
-
+use control_mod, only: nday 
 use comgeomphy, only : initcomgeomphy, &
                        airephy, & ! physics grid area (m2)
@@ -176,5 +176,5 @@
 ! copy some fundamental parameters to physics 
 ! and do some initializations 
-call inifis(klon_omp,nlayer,nqtot,pdayref,punjours,ptimestep, &
+call inifis(klon_omp,nlayer,nqtot,pdayref,punjours,nday,ptimestep, &
             rlatd,rlond,airephy,prad,pg,pr,pcpp)
 
Index: /trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90	(revision 1525)
@@ -9,5 +9,5 @@
   use planete_mod
   use callkeys_mod, only: check_cpp_match, pceil, tstrat, tracer
-!  use control_mod
+  use inifis_mod, only: inifis
   use comcstfi_mod
   implicit none
@@ -203,5 +203,7 @@
   call calc_cpp_mugaz
 
-  call inifis(1,llm,0,86400.0,1.0,0.0,0.0,1.0,rad,g,r,cpp)
+  call inifis(1,llm,0,1,86400.0,1,1.0,&
+              (/0.0/),(/0.0/),(/1.0/),&
+              rad,g,r,cpp)
 
   ! Tracer initialisation
Index: /trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F	(revision 1525)
@@ -12,5 +12,4 @@
       use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat, volcapa
       USE comgeomfi_h, only: lati, long, area
-      use control_mod, only: day_step, ecritphy
       use phyredem, only: physdem0,physdem1
       use comgeomphy, only: initcomgeomphy
@@ -21,5 +20,6 @@
       use comcstfi_mod, only: pi, cpp, rad, g, r,
      &                        mugaz, rcp, omeg
-      use time_phylmdz_mod, only: daysec, dtphys
+      use time_phylmdz_mod, only: daysec, dtphys, day_step, ecritphy,
+     &                            nday
       use callkeys_mod, only: tracer,check_cpp_match,rings_shadow,
      &	                      specOLR,water,pceil,ok_slab_ocean
@@ -488,4 +488,5 @@
       call getin("ndt",ndt)
       write(*,*) " ndt = ",ndt
+      nday=ndt
 
       ndt=ndt*day_step     
@@ -505,5 +506,5 @@
 !!! - physical frequency: nevermind, in inifis this is a simple print
       cpp=1.d-7 !JL because we divide by cpp in inifis, there may be a more elegant solution
-      CALL inifis(1,llm,nq,day0,daysec,dtphys,
+      CALL inifis(1,llm,nq,day0,daysec,nday,dtphys,
      .            latitude,longitude,area,rad,g,r,cpp)
 !!! We check everything is OK.
Index: /trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90	(revision 1525)
@@ -5,5 +5,5 @@
 
   SUBROUTINE inifis(ngrid,nlayer,nq, &
-             day_ini,pdaysec,ptimestep, &
+             day_ini,pdaysec,nday,ptimestep, &
              plat,plon,parea, &
              prad,pg,pr,pcpp)
@@ -14,5 +14,6 @@
   use comgeomfi_h, only: long, lati, area, totarea, totarea_planet
   use comsoil_h, only: ini_comsoil_h
-  use control_mod, only: ecritphy
+  use time_phylmdz_mod, only: ecritphy,day_step,iphysiq, &
+                              init_time, daysec, dtphys
   use comcstfi_mod, only: rad, cpp, g, r, rcp, &
                           mugaz, pi, avocado
@@ -20,5 +21,4 @@
   use planetwide_mod, only: planetwide_sumval
   use callkeys_mod
-  use time_phylmdz_mod, only: init_time, daysec, dtphys
 
 !=======================================================================
@@ -64,5 +64,5 @@
 
   REAL,INTENT(IN) :: prad,pg,pr,pcpp,pdaysec,ptimestep
- 
+  INTEGER,INTENT(IN) :: nday
   INTEGER,INTENT(IN) :: ngrid,nlayer,nq
   REAL,INTENT(IN) :: plat(ngrid),plon(ngrid),parea(ngrid)
@@ -91,9 +91,12 @@
 
   ! Initialize some "temporal and calendar" related variables
-  CALL init_time(day_ini,pdaysec,ptimestep)
-
-  ! read in 'ecritphy' (frequency of calls to physics, in dynamical steps)
-  ! (also done in dyn3d/defrun_new but not in LMDZ.COMMON)
-  call getin_p("ecritphy",ecritphy)
+  CALL init_time(day_ini,pdaysec,nday,ptimestep)
+
+  ! read in some parameters from "run.def" for physics,
+  ! or shared between dynamics and physics.
+  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
 
 ! --------------------------------------------------------------
Index: /trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/physiq.F90	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/physiq.F90	(revision 1525)
@@ -24,5 +24,5 @@
                           igcm_h2o_ice, igcm_h2o_vap, igcm_dustbin, &
                           igcm_co2_ice
-      use control_mod, only: ecritphy, iphysiq, nday
+      use time_phylmdz_mod, only: ecritphy, iphysiq, nday
       use phyredem, only: physdem0, physdem1
       use slab_ice_h
Index: /trunk/LMDZ.GENERIC/libf/phystd/time_phylmdz_mod.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/time_phylmdz_mod.F90	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/time_phylmdz_mod.F90	(revision 1525)
@@ -4,4 +4,9 @@
     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)
     REAL,SAVE    :: daysec     ! length of day (s)
 !$OMP THREADPRIVATE(daysec)
@@ -9,14 +14,23 @@
 !$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)
+
 CONTAINS
 
-  SUBROUTINE init_time(day_ini_, daysec_, dtphys_)
+  SUBROUTINE init_time(day_ini_, daysec_, nday_, dtphys_)
     IMPLICIT NONE
     INTEGER,INTENT(IN) :: day_ini_
     REAL,INTENT(IN) :: daysec_
+    INTEGER,INTENT(IN) :: nday_
     REAL,INTENT(IN) :: dtphys_
     
     day_ini=day_ini_
     daysec=daysec_
+    nday=nday_
     dtphys=dtphys_
 
Index: /trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F	(revision 1525)
@@ -40,9 +40,8 @@
 !=================================================================
       use surfdat_h, only: phisfi
-      use control_mod, only: ecritphy, day_step, iphysiq
+      use time_phylmdz_mod, only: ecritphy, day_step, iphysiq, day_ini
       USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root,
      &                               is_master, gather
       USE mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo
-      USE time_phylmdz_mod, ONLY: day_ini
       implicit none
 
Index: /trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90	(revision 1525)
@@ -13,5 +13,5 @@
 
 use comsoil_h, only: nsoilmx
-use control_mod, only: ecritphy, day_step, iphysiq
+use time_phylmdz_mod, only: ecritphy, day_step, iphysiq
 use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
 use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo
Index: /trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F	(revision 1525)
@@ -48,7 +48,6 @@
       use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo
 #endif
-      use control_mod, only: ecritphy, iphysiq, day_step
+      use time_phylmdz_mod, only: ecritphy, iphysiq, day_step, day_ini
       use callkeys_mod, only: iradia
-      use time_phylmdz_mod, ONLY: day_ini
 
       implicit none
Index: /trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F	(revision 1524)
+++ /trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F	(revision 1525)
@@ -48,7 +48,6 @@
       use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo
 #endif
-      use control_mod, only: ecritphy, iphysiq, day_step
+      use time_phylmdz_mod, only: ecritphy, iphysiq, day_step, day_ini
       use callkeys_mod, only: iradia
-      use time_phylmdz_mod, ONLY: day_ini
 
       implicit none
Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 1524)
+++ /trunk/LMDZ.MARS/README	(revision 1525)
@@ -2232,2 +2232,7 @@
   to module "time_phylmdz_mod".
 - Made "phys_state_var_init" a module
+
+== 30/03/2016 == EM
+- Got rid of references to "control_mod" from the physics. Added a couple
+  of relevent variables for outputs in time_phylmdz_mod.
+
Index: /trunk/LMDZ.MARS/libf/phymars/conf_phys.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1524)
+++ /trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1525)
@@ -38,7 +38,7 @@
       use surfdat_h, only: albedo_h2o_ice, inert_h2o_ice,
      &                     frost_albedo_threshold
-      use control_mod, only: ecritphy
+      use time_phylmdz_mod, only: ecritphy,day_step,iphysiq,ecritstart,
+     &                            daysec,dtphys
       use planete_h
-      use time_phylmdz_mod, only: daysec,dtphys
       use dimradmars_mod, only: naerkind, name_iaer,
      &                      ini_scatterers,tauvis
@@ -50,13 +50,19 @@
 
       INTEGER,INTENT(IN) :: ngrid,nlayer,nq
-      INTEGER ig,ierr,j
+      INTEGER ierr,j
  
       CHARACTER ch1*12
-      CHARACTER ch80*80
-
-      ! read in 'ecritphy' (frequency of calls to physics, in dynamical steps)
-      ! (also done in dyn3d/defrun_new but not in LMDZ.COMMON)
-      call getin("ecritphy",ecritphy)
-      
+
+      ! read in some parameters from "run.def" for physics,
+      ! or shared between dynamics and physics.
+      ecritphy=240 ! default value
+      call getin("ecritphy",ecritphy) ! frequency of outputs in physics,
+                                      ! in dynamical steps
+      day_step=960 ! default value
+      call getin("day_step",day_step) ! number of dynamical steps per day
+      iphysiq=20 ! default value
+      call getin("iphysiq",iphysiq) ! call physics every iphysiq dyn step
+      ecritstart=0 ! default value
+      call getin("ecritstart",ecritstart) ! write a restart every ecristart steps
 ! --------------------------------------------------------------
 !  Reading the "callphys.def" file controlling some key options
Index: /trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F	(revision 1524)
+++ /trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F	(revision 1525)
@@ -11,5 +11,4 @@
      &                     watercaptag
       use slope_mod, only: theta_sl, psi_sl
-      use control_mod, only: day_step
       use phyredem, only: physdem0,physdem1
       use comgeomphy, only: initcomgeomphy
@@ -17,5 +16,5 @@
      &                     obliquit, emin_turb, lmixmin
       use comcstfi_h, only: pi, rad, omeg, g, mugaz, rcp, r, cpp
-      use time_phylmdz_mod, only: daysec, dtphys
+      use time_phylmdz_mod, only: daysec, dtphys, day_step
       use dimradmars_mod, only: tauscaling,tauvis
       USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff,sig
Index: /trunk/LMDZ.MARS/libf/phymars/phyetat0.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/phyetat0.F90	(revision 1524)
+++ /trunk/LMDZ.MARS/libf/phymars/phyetat0.F90	(revision 1525)
@@ -6,8 +6,8 @@
   use surfdat_h, only: phisfi, albedodat, z0, z0_default,&
                        zmea, zstd, zsig, zgam, zthe
-  use control_mod, only: timestart
   use iostart, only: nid_start, open_startphy, close_startphy, &
                      get_field, get_var, inquire_field, &
                      inquire_dimension, inquire_dimension_length
+  use ioipsl_getincom, only : getin
 
   implicit none
@@ -79,4 +79,6 @@
       LOGICAL :: found
 
+      REAL :: timestart ! to pick which initial state to start from
+
 ! open physics initial state file:
 call open_startphy(fichnom)
@@ -167,4 +169,8 @@
       
 ! Time axis
+! obtain timestart from run.def
+timestart=-9999 ! default value
+call getin("timestart",timestart)
+
 found=inquire_dimension("Time")
 if (.not.found) then
Index: /trunk/LMDZ.MARS/libf/phymars/physiq.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1524)
+++ /trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1525)
@@ -25,5 +25,5 @@
       use slope_mod, only: theta_sl, psi_sl
       use conc_mod, only: rnew, cpnew, mmean
-      use control_mod, only: iphysiq, day_step, ecritstart
+      use time_phylmdz_mod, only: iphysiq, day_step, ecritstart, daysec
       use dimradmars_mod, only: tauscaling, aerosol,
      &                          dtrad, fluxrad_sky, fluxrad, albedo,
@@ -34,5 +34,4 @@
      &                     obliquit
       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/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 1525)
@@ -4,4 +4,7 @@
     REAL,SAVE    :: dtphys      ! physics time step (s)
 !$OMP THREADPRIVATE(pdtphys)
+    INTEGER,SAVE :: day_step    ! number of dynamical steps per day
+                                ! (set via conf_phys)
+!$OMP THREADPRIVATE(day_step)
     REAL,SAVE    :: daysec     ! length of day (s)
 !$OMP THREADPRIVATE(daysec)
@@ -12,7 +15,17 @@
 !$OMP THREADPRIVATE(hour_ini)
 
+    INTEGER,SAVE :: ecritphy    ! for diagfi.nc outputs, write every ecritphy
+                                ! dynamical steps (set via conf_phys)
+!$OMP THREADPRIVATE(ecritphy)
+    INTEGER,SAVE :: iphysiq   ! call physics every iphysiq dynamical step
+                              ! (set via conf_phys)
+!$OMP THREADPRIVATE(iphysiq)
+    INTEGER,SAVE :: ecritstart ! write a restart state every ecritstart
+                               ! dynamical steps (set via conf_phys)
+!$OMP THREADPRIVATE(ecritstart)
 CONTAINS
 
   SUBROUTINE init_time(day_ini_, hour_ini_, daysec_, dtphys_)
+    USE ioipsl_getin_p_mod, ONLY : getin_p
     IMPLICIT NONE
     INTEGER,INTENT(IN) :: day_ini_
@@ -25,5 +38,5 @@
     daysec=daysec_
     dtphys=dtphys_
-
+    
   END SUBROUTINE init_time
 
Index: /trunk/LMDZ.MARS/libf/phymars/writediagfi.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 1524)
+++ /trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 1525)
@@ -40,9 +40,8 @@
 !=================================================================
       use surfdat_h, only: phisfi
-      use control_mod, only: ecritphy, day_step, iphysiq
+      use time_phylmdz_mod, only: ecritphy, day_step, iphysiq, day_ini
       USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root,
      &                               is_master, gather
       USE mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo
-      USE time_phylmdz_mod, ONLY: day_ini
       implicit none
 
Index: /trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90	(revision 1524)
+++ /trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90	(revision 1525)
@@ -13,5 +13,5 @@
 
 use comsoil_h, only: nsoilmx
-use control_mod, only: ecritphy, day_step, iphysiq
+use time_phylmdz_mod, only: ecritphy, day_step, iphysiq
 use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
 use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo
Index: /trunk/LMDZ.TITAN/libf/phytitan/common_mod.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/common_mod.F90	(revision 1524)
+++ /trunk/LMDZ.TITAN/libf/phytitan/common_mod.F90	(revision 1525)
@@ -89,5 +89,4 @@
 SUBROUTINE common_init
 use dimphy
-USE control_mod
 IMPLICIT NONE
 #include "dimensions.h"
Index: /trunk/LMDZ.TITAN/libf/phytitan/dyn1d/rcm1d.F
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/dyn1d/rcm1d.F	(revision 1524)
+++ /trunk/LMDZ.TITAN/libf/phytitan/dyn1d/rcm1d.F	(revision 1525)
@@ -2,5 +2,5 @@
       
       USE infotrac
-      use control_mod
+      use control_mod, only: planet_type, day_step
       use comgeomphy
       USE phys_state_var_mod
Index: /trunk/LMDZ.TITAN/libf/phytitan/dyn1d/temps_mod.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/dyn1d/temps_mod.F90	(revision 1525)
+++ /trunk/LMDZ.TITAN/libf/phytitan/dyn1d/temps_mod.F90	(revision 1525)
@@ -0,0 +1,1 @@
+link ../../dyn3d/temps_mod.F90
Index: /trunk/LMDZ.TITAN/libf/phytitan/phyetat0.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/phyetat0.F90	(revision 1524)
+++ /trunk/LMDZ.TITAN/libf/phytitan/phyetat0.F90	(revision 1525)
@@ -14,6 +14,5 @@
       USE infotrac
       USE comgeomphy,  only: rlatd,rlond
-      USE control_mod, only: raz_date
-      USE time_phylmdz_mod, only: itau_phy
+      USE time_phylmdz_mod, only: itau_phy, raz_date
 
 implicit none
Index: /trunk/LMDZ.TITAN/libf/phytitan/phyredem.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/phyredem.F90	(revision 1524)
+++ /trunk/LMDZ.TITAN/libf/phytitan/phyredem.F90	(revision 1525)
@@ -13,6 +13,5 @@
       USE infotrac
       USE comgeomphy,  only: rlatd,rlond
-      USE control_mod, only: raz_date
-      USE time_phylmdz_mod, only: day_end, annee_ref, itau_phy
+      USE time_phylmdz_mod, only: day_end, annee_ref, itau_phy, raz_date
 
       implicit none
Index: /trunk/LMDZ.TITAN/libf/phytitan/phys_state_var_mod.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/phys_state_var_mod.F90	(revision 1524)
+++ /trunk/LMDZ.TITAN/libf/phytitan/phys_state_var_mod.F90	(revision 1525)
@@ -97,6 +97,5 @@
 !======================================================================
 SUBROUTINE phys_state_var_init
-use dimphy
-USE control_mod
+
 IMPLICIT NONE
 #include "dimsoil.h"
@@ -145,6 +144,5 @@
 !======================================================================
 SUBROUTINE phys_state_var_end
-use dimphy
-use control_mod
+
 IMPLICIT NONE
 
Index: /trunk/LMDZ.TITAN/libf/phytitan/physiq.F
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/physiq.F	(revision 1524)
+++ /trunk/LMDZ.TITAN/libf/phytitan/physiq.F	(revision 1525)
@@ -57,5 +57,4 @@
 !      USE histcom ! not needed; histcom is included in ioipsl
       USE infotrac
-      USE control_mod
       use dimphy
       USE comgeomphy
@@ -72,5 +71,5 @@
       USE moyzon_mod
       USE write_field_phy
-      USE time_phylmdz_mod, only: itau_phy,day_ref,annee_ref
+      USE time_phylmdz_mod, only: itau_phy,day_ref,annee_ref,nday
       USE logic_mod, only: iflag_trac,moyzon_ch,moyzon_mu
       IMPLICIT none
Index: unk/LMDZ.TITAN/libf/phytitan/scal_wind.F
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/scal_wind.F	(revision 1524)
+++ 	(revision )
@@ -1,54 +1,0 @@
-      SUBROUTINE scal_wind(xus,xvs,xu,xv)
-c=======================================================================
-c
-c
-c   Subject:
-c   ------
-c On passe  les variable xus, xvs  aux points de vent u et v (xu et xv)
-c
-c=======================================================================
-      IMPLICIT NONE
-c-----------------------------------------------------------------------
-c   Declararations:
-c   ---------------
-
-#include "dimensions.h"
-#include "paramet.h"
-
-c   Arguments:
-c   ----------
-
-      REAL xu(iip1,jjp1,llm),xv(iip1,jjm,llm)
-      REAL xus(iip1,jjp1,llm), xvs (iip1,jjp1,llm)
-
-c   Local:
-c   ------
-
-      INTEGER i,j,l
-
-c-----------------------------------------------------------------------
-
-c   transport zonal:
-c   ----------------
-      DO l=1,llm
-        Do j=1,jjp1
-	      DO i=1,iim
-            xu(i,j,l)=0.5*(xus(i,j,l)+xus(i+1,j,l))
-	      ENDDO
-          xu(iip1,j,l)=xu(1,j,l)
-	    ENDDO
-      ENDDO
-
-
-c   Transport meridien:
-c   -------------------
-      DO l=1,llm
-         DO j=1,jjm
-           do i=1 ,iip1
-	         xv(i,j,l)=.5*(xvs(i,j,l)+xvs(i,j+1,l))
-           end do
-	     ENDDO
-	  ENDDO
-
-      RETURN
-      END
Index: /trunk/LMDZ.TITAN/libf/phytitan/time_phylmdz_mod.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/time_phylmdz_mod.F90	(revision 1524)
+++ /trunk/LMDZ.TITAN/libf/phytitan/time_phylmdz_mod.F90	(revision 1525)
@@ -4,4 +4,6 @@
     REAL,SAVE    :: pdtphys     ! physics time step (s)
 !$OMP THREADPRIVATE(pdtphys)
+    INTEGER,SAVE :: nday        ! number of days to run
+!$OMP THREADPRIVATE(nday)
     INTEGER,SAVE :: annee_ref   ! reference year from the origin
 !$OMP THREADPRIVATE(annee_ref)
@@ -12,4 +14,6 @@
     INTEGER,SAVE :: day_end     ! final day of the run since first day of annee_ref
 !$OMP THREADPRIVATE(day_end)
+    INTEGER,SAVE :: raz_date    ! flag to reset date (0:no, 1:yes)
+!$OMP THREADPRIVATE(raz_date)
     INTEGER,SAVE :: itau_phy     ! number of physics iterations
 !$OMP THREADPRIVATE(itau_phy)
@@ -17,5 +21,7 @@
 CONTAINS
 
-  SUBROUTINE init_time(annee_ref_, day_ref_, day_ini_, day_end_, pdtphys_)
+  SUBROUTINE init_time(annee_ref_, day_ref_, day_ini_, day_end_, &
+                       nday_, pdtphys_)
+    USE ioipsl_getin_p_mod, ONLY : getin_p
     IMPLICIT NONE
     INTEGER,INTENT(IN) :: annee_ref_
@@ -23,4 +29,5 @@
     INTEGER,INTENT(IN) :: day_ini_
     INTEGER,INTENT(IN) :: day_end_
+    INTEGER,INTENT(IN) :: nday_
     REAL,INTENT(IN) :: pdtphys_
     
@@ -29,6 +36,11 @@
     day_ini=day_ini_
     day_end=day_end_
+    nday=nday_
     pdtphys=pdtphys_
 
+    ! Initialize module variable not inherited from dynamics
+    raz_date = 0 ! default value
+    CALL getin_p('raz_date', raz_date)
+    
   END SUBROUTINE init_time
 
Index: unk/LMDZ.TITAN/libf/phytitan/wind_scal.F
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/wind_scal.F	(revision 1524)
+++ 	(revision )
@@ -1,54 +1,0 @@
-      SUBROUTINE wind_scal(pbaru,pbarv,us,vs)
-c=======================================================================
-c
-c
-c   Subject:
-c   ------
-c   On ramene les flux de masse /vents  aux points scalaires.
-c
-c=======================================================================
-      IMPLICIT NONE
-c-----------------------------------------------------------------------
-c   Declararations:
-c   ---------------
-
-#include "dimensions.h"
-#include "paramet.h"
-
-c   Arguments:
-c   ----------
-
-      REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)
-      REAL us(ip1jmp1,llm), vs (ip1jmp1,llm)
-
-c   Local:
-c   ------
-
-      INTEGER ij,l
-
-c-----------------------------------------------------------------------
-
-c   transport zonal:
-c   ----------------
-      DO l=1,llm
-	 DO ij=2,ip1jmp1
-            us(ij,l)=.5*(pbaru(ij,l)+pbaru(ij-1,l))
-	 ENDDO
-      ENDDO
-      CALL SCOPY(jjp1*llm,us(iip1,1),iip1,us(1,1),iip1)
-
-
-c   Transport meridien:
-c   -------------------
-      DO l=1,llm
-         DO ij=iip2,ip1jm
-	    vs(ij,l)=.5*(pbarv(ij,l)+pbarv(ij-iip1,l))
-	 ENDDO
-	 DO ij=1,iip1
-	    vs(ij,l)=0.
-	    vs(ip1jm+ij,l)=0.
-	 ENDDO
-      ENDDO
-
-      RETURN
-      END
Index: /trunk/LMDZ.VENUS/libf/phyvenus/conc.F90
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/conc.F90	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/conc.F90	(revision 1525)
@@ -68,5 +68,4 @@
      subroutine conc_init
      USE dimphy
-     USE control_mod
      implicit none
 #include"param.h"
Index: /trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/rcm1d.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/rcm1d.F	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/rcm1d.F	(revision 1525)
@@ -2,5 +2,5 @@
       
       USE infotrac
-      use control_mod
+      use control_mod, only: planet_type, day_step
       use comgeomphy
       USE phys_state_var_mod
Index: /trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/temps_mod.F90
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/temps_mod.F90	(revision 1525)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/dyn1d/temps_mod.F90	(revision 1525)
@@ -0,0 +1,1 @@
+link ../../dyn3d/temps_mod.F90
Index: /trunk/LMDZ.VENUS/libf/phyvenus/new_cloud_sedim.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/new_cloud_sedim.F	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/new_cloud_sedim.F	(revision 1525)
@@ -6,5 +6,4 @@
       USE ioipsl
       USE infotrac
-      USE control_mod
       USE dimphy
       USE comgeomphy
Index: /trunk/LMDZ.VENUS/libf/phyvenus/new_photochemistry_venus.F90
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/new_photochemistry_venus.F90	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/new_photochemistry_venus.F90	(revision 1525)
@@ -4,8 +4,4 @@
  SUBROUTINE new_photochemistry_venus(nz, n_lon, ptimestep, p, t ,tr, mumean, sza_input, nesp)
 
-! USE ioipsl
-! USE control_mod
-! USE dimphy
-! USE comgeomphy
  USE chemparam_mod
  USE infotrac
Index: /trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90	(revision 1525)
@@ -14,6 +14,5 @@
       USE infotrac
       USE comgeomphy,  only: rlatd,rlond
-      USE control_mod, only: raz_date
-      USE time_phylmdz_mod, only: itau_phy
+      USE time_phylmdz_mod, only: itau_phy, raz_date
 
 implicit none
Index: /trunk/LMDZ.VENUS/libf/phyvenus/phyredem.F90
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/phyredem.F90	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/phyredem.F90	(revision 1525)
@@ -13,6 +13,5 @@
       USE infotrac
       USE comgeomphy,  only: rlatd,rlond
-      USE control_mod, only: raz_date
-      USE time_phylmdz_mod, only: day_end, annee_ref, itau_phy
+      USE time_phylmdz_mod, only: day_end, annee_ref, itau_phy, raz_date
 
       implicit none
Index: /trunk/LMDZ.VENUS/libf/phyvenus/phys_state_var_mod.F90
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/phys_state_var_mod.F90	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/phys_state_var_mod.F90	(revision 1525)
@@ -110,6 +110,5 @@
 !======================================================================
 SUBROUTINE phys_state_var_init
-use dimphy
-USE control_mod
+
 IMPLICIT NONE
 #include "dimsoil.h"
@@ -161,6 +160,5 @@
 !======================================================================
 SUBROUTINE phys_state_var_end
-use dimphy
-use control_mod
+
 IMPLICIT NONE
 
Index: /trunk/LMDZ.VENUS/libf/phyvenus/physiq.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/physiq.F	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/physiq.F	(revision 1525)
@@ -57,5 +57,4 @@
 !      USE histcom ! not needed; histcom is included in ioipsl
       USE infotrac
-      USE control_mod
       use dimphy
       USE comgeomphy
Index: /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_chimie.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_chimie.F	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_chimie.F	(revision 1525)
@@ -24,9 +24,4 @@
 cAA 1/ le call phytrac se fait avec nqmax 
 c======================================================================
-c      USE ioipsl
-c      USE infotrac
-c      USE control_mod
-c      USE dimphy
-c      USE comgeomphy
       USE chemparam_mod
       use conc, only: mmean
Index: /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_emiss.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_emiss.F	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_emiss.F	(revision 1525)
@@ -28,7 +28,5 @@
 c
 c======================================================================
-      USE ioipsl
       USE infotrac
-      USE control_mod
       use dimphy
       USE comgeomphy
Index: /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_relax.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_relax.F	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/phytrac_relax.F	(revision 1525)
@@ -25,7 +25,5 @@
 c
 c======================================================================
-      USE ioipsl
       USE infotrac
-      USE control_mod
       use dimphy
       USE comgeomphy
Index: unk/LMDZ.VENUS/libf/phyvenus/scal_wind.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/scal_wind.F	(revision 1524)
+++ 	(revision )
@@ -1,55 +1,0 @@
-      SUBROUTINE scal_wind(xus,xvs,xu,xv)
-c=======================================================================
-c
-c
-c   Subject:
-c   ------
-c On passe  les variable xus, xvs  aux points de vent u et v (xu et xv)
-c
-c=======================================================================
-      IMPLICIT NONE
-c-----------------------------------------------------------------------
-c   Declararations:
-c   ---------------
-
-#include "dimensions.h"
-#include "paramet.h"
-#include "comgeom.h"
-
-c   Arguments:
-c   ----------
-
-      REAL xu(iip1,jjp1,llm),xv(iip1,jjm,llm)
-      REAL xus(iip1,jjp1,llm), xvs (iip1,jjp1,llm)
-
-c   Local:
-c   ------
-
-      INTEGER i,j,l
-
-c-----------------------------------------------------------------------
-
-c   transport zonal:
-c   ----------------
-      DO l=1,llm
-        Do j=1,jjp1
-	      DO i=1,iim
-            xu(i,j,l)=0.5*(xus(i,j,l)+xus(i+1,j,l))
-	      ENDDO
-          xu(iip1,j,l)=xu(1,j,l)
-	    ENDDO
-      ENDDO
-
-
-c   Transport meridien:
-c   -------------------
-      DO l=1,llm
-         DO j=1,jjm
-           do i=1 ,iip1
-	         xv(i,j,l)=.5*(xvs(i,j,l)+xvs(i,j+1,l))
-           end do
-	     ENDDO
-	  ENDDO
-
-      RETURN
-      END
Index: /trunk/LMDZ.VENUS/libf/phyvenus/time_phylmdz_mod.F90
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/time_phylmdz_mod.F90	(revision 1524)
+++ /trunk/LMDZ.VENUS/libf/phyvenus/time_phylmdz_mod.F90	(revision 1525)
@@ -12,4 +12,6 @@
     INTEGER,SAVE :: day_end     ! final day of the run since first day of annee_ref
 !$OMP THREADPRIVATE(day_end)
+    INTEGER,SAVE :: raz_date    ! flag to reset date (0:no, 1:yes)
+!$OMP THREADPRIVATE(raz_date)
     INTEGER,SAVE :: itau_phy     ! number of physics iterations
 !$OMP THREADPRIVATE(itau_phy)
@@ -18,4 +20,5 @@
 
   SUBROUTINE init_time(annee_ref_, day_ref_, day_ini_, day_end_, pdtphys_)
+    USE ioipsl_getin_p_mod, ONLY : getin_p
     IMPLICIT NONE
     INTEGER,INTENT(IN) :: annee_ref_
@@ -31,4 +34,8 @@
     pdtphys=pdtphys_
 
+    ! Initialize module variable not inherited from dynamics
+    raz_date = 0 ! default value
+    CALL getin_p('raz_date', raz_date)
+    
   END SUBROUTINE init_time
 
Index: unk/LMDZ.VENUS/libf/phyvenus/wind_scal.F
===================================================================
--- /trunk/LMDZ.VENUS/libf/phyvenus/wind_scal.F	(revision 1524)
+++ 	(revision )
@@ -1,55 +1,0 @@
-      SUBROUTINE wind_scal(pbaru,pbarv,us,vs)
-c=======================================================================
-c
-c
-c   Subject:
-c   ------
-c   On ramene les flux de masse /vents  aux points scalaires.
-c
-c=======================================================================
-      IMPLICIT NONE
-c-----------------------------------------------------------------------
-c   Declararations:
-c   ---------------
-
-#include "dimensions.h"
-#include "paramet.h"
-#include "comgeom.h"
-
-c   Arguments:
-c   ----------
-
-      REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)
-      REAL us(ip1jmp1,llm), vs (ip1jmp1,llm)
-
-c   Local:
-c   ------
-
-      INTEGER ij,l
-
-c-----------------------------------------------------------------------
-
-c   transport zonal:
-c   ----------------
-      DO l=1,llm
-	 DO ij=2,ip1jmp1
-            us(ij,l)=.5*(pbaru(ij,l)+pbaru(ij-1,l))
-	 ENDDO
-      ENDDO
-      CALL SCOPY(jjp1*llm,us(iip1,1),iip1,us(1,1),iip1)
-
-
-c   Transport meridien:
-c   -------------------
-      DO l=1,llm
-         DO ij=iip2,ip1jm
-	    vs(ij,l)=.5*(pbarv(ij,l)+pbarv(ij-iip1,l))
-	 ENDDO
-	 DO ij=1,iip1
-	    vs(ij,l)=0.
-	    vs(ip1jm+ij,l)=0.
-	 ENDDO
-      ENDDO
-
-      RETURN
-      END
