Index: trunk/ICOSA_LMDZ/src/phyvenus/interface_icosa_lmdz.f90
===================================================================
--- trunk/ICOSA_LMDZ/src/phyvenus/interface_icosa_lmdz.f90	(revision 2000)
+++ trunk/ICOSA_LMDZ/src/phyvenus/interface_icosa_lmdz.f90	(revision 2084)
@@ -209,4 +209,5 @@
   INTEGER :: day_ini
   INTEGER :: day_end
+  INTEGER :: raz_date
 
   ! Tracer related information
@@ -326,9 +327,12 @@
     ! for the rest ptime/timeofday is what matters. To well estimate them,
     ! day_length must be multiple of dt*itau_physics. Error order:1e-4.
-    day_length=10080000   
+    day_length=10087000   
     CALL getin('day_length',day_length)
     
     run_length=day_length ! default
     CALL getin('run_length',run_length)
+    
+    raz_date=0 ! default: 0: no change in date
+    CALL getin('raz_date',raz_date)
 
     IF (startphy_file) THEN
@@ -355,5 +359,23 @@
       day_ini=tab_cntrl(13)
       annee_ref=tab_cntrl(14)
-      ptime=modulo((tab_cntrl(15)*tab_cntrl(1))/day_length,1.0)
+      ! check if tab_cntrl(1), the stored physics time step
+      ! is the same as the current physics time step (within roundoff precision)
+      if (abs(((itau_physics*dt)-tab_cntrl(1))/(itau_physics*dt))<=1.e-8) then
+        ! Everything OK
+        ptime=modulo((tab_cntrl(15)*tab_cntrl(1))/day_length,1.0)
+      else ! unless raz_date == 1 , we have a problem
+        if (raz_date==1) then
+          ! we reset date to midnight at lon=0 in the physics
+          ptime=0.0
+        else
+          write(*,*)"Error: physics time step in startphy.nc is different"
+          write(*,*)"       from what is specified via run_icosa.def"
+          write(*,*)"       From run_icosa.def:    ",itau_physics*dt
+          write(*,*)"       From startphy.nc file: ",tab_cntrl(1)
+          write(*,*)"       You must reset date to midnight at lon=0"
+          write(*,*)"       by specifying raz_date=1 in your def file"
+          call abort
+        endif
+      endif
 
       status=nf90_close(ncid)
