Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdytides.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdytides.F90	(revision 10859)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdytides.F90	(revision 10860)
@@ -44,4 +44,6 @@
 !$AGRIF_END_DO_NOT_TREAT
    TYPE(OBC_DATA)  , PUBLIC, DIMENSION(jp_bdy) :: dta_bdy_s  !: bdy external data (slow component)
+
+   INTEGER ::   kt_tide
 
    !!----------------------------------------------------------------------
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg.F90	(revision 10859)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg.F90	(revision 10860)
@@ -42,4 +42,6 @@
    INTEGER, PARAMETER ::   np_EXP = 0   !       explicit time stepping
    INTEGER, PARAMETER ::   np_NO  =-1   ! no surface pressure gradient, no scheme
+   !
+   REAL(wp) ::   zt0step !   Time of day at the beginning of the time step
 
    !! * Substitutions
@@ -112,5 +114,7 @@
          IF( .NOT.ln_dynspg_ts .AND. ( ln_tide_pot .AND. ln_tide )  ) THEN   ! N.B. added directly at sub-time-step in ts-case
             !
-            CALL upd_tide( kt )                      ! update tide potential
+            ! Update tide potential at the beginning of current time step
+            zt0step = REAL(nsec_day, wp)-0.5_wp*rdt
+            CALL upd_tide(zt0step)
             !
             DO jj = 2, jpjm1                         ! add tide potential forcing
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg_ts.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg_ts.F90	(revision 10859)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg_ts.F90	(revision 10860)
@@ -171,4 +171,5 @@
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ztwdmask, zuwdmask, zvwdmask ! ROMS wetting and drying masks at t,u,v points
       REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zuwdav2, zvwdav2    ! averages over the sub-steps of zuwdmask and zvwdmask
+      REAL(wp) ::   zt0substep !   Time of day at the beginning of the time substep
       !!----------------------------------------------------------------------
       !
@@ -718,5 +719,9 @@
          ! Update only tidal forcing at open boundaries
          IF( ln_bdy      .AND. ln_tide )   CALL bdy_dta_tides( kt, kit=jn, time_offset= noffset+1 )
-         IF( ln_tide_pot .AND. ln_tide )   CALL upd_tide     ( kt, kit=jn, time_offset= noffset   )
+         ! Update tide potential at the beginning of current time substep
+         IF( ln_tide_pot .AND. ln_tide ) THEN
+            zt0substep = REAL(nsec_day, wp) - 0.5_wp*rdt + (jn + noffset - 1) * rdt / REAL(nn_baro, wp)
+            CALL upd_tide(zt0substep)
+         END IF
          !
          ! Set extrapolation coefficients for predictor step:
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide_mod.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide_mod.F90	(revision 10859)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide_mod.F90	(revision 10860)
@@ -54,5 +54,4 @@
    LOGICAL , PUBLIC ::   ln_tide_ramp    !:
    INTEGER , PUBLIC ::   nb_harmo        !: Number of active tidal components
-   INTEGER , PUBLIC ::   kt_tide         !:
    REAL(wp), PUBLIC ::   rn_tide_ramp_dt     !:
    REAL(wp), PUBLIC ::   rn_scal_load    !:
@@ -64,4 +63,5 @@
    REAL(wp),         ALLOCATABLE, DIMENSION(:,:,:) ::   amp_load, phi_load
 
+   REAL(wp) ::   rn_tide_ramp_t !   Elapsed time in seconds
 
    REAL(wp) ::   sh_T, sh_s, sh_h, sh_p, sh_p1             ! astronomic angles
@@ -146,7 +146,4 @@
       ! Ensure that tidal components have been set in namelist_cfg
       IF( nb_harmo == 0 )   CALL ctl_stop( 'tide_init : No tidal components set in nam_tide' )
-      !
-      ! Reference time step for time-dependent tidal parameters
-      kt_tide = nit000
       !
       IF (.NOT.ln_scal_load ) rn_scal_load = 0._wp
@@ -339,11 +336,4 @@
       IF( nsec_day == NINT(0.5_wp * rdt) .OR. kt == nit000 ) THEN      ! start a new day
          !
-         ! If the run does not start from midnight then need to initialise tides
-         ! at the start of the current day (only occurs when kt==nit000)
-         IF ( nsec_day /= NINT(0.5_wp * rdt) ) THEN 
-            kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt
-         ELSE
-            kt_tide = kt 
-         ENDIF
          CALL tide_harmo(tide_components, tide_harmonics, ndt05) ! Update oscillation parameters of tidal components for start of current day
          !
@@ -361,4 +351,5 @@
          IF( ln_tide_pot )   CALL tide_init_potential
          !
+         rn_tide_ramp_t = (kt - nit000)*rdt !   Elapsed time in seconds
       ENDIF
       !
@@ -730,5 +721,5 @@
 
 
-   SUBROUTINE upd_tide( kt, kit, time_offset )
+   SUBROUTINE upd_tide(pdelta)
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE upd_tide  ***
@@ -740,30 +731,12 @@
       !! ** Action  :   pot_astro   actronomical potential
       !!----------------------------------------------------------------------      
-      INTEGER, INTENT(in)           ::   kt      ! ocean time-step index
-      INTEGER, INTENT(in), OPTIONAL ::   kit     ! external mode sub-time-step index (lk_dynspg_ts=T)
-      INTEGER, INTENT(in), OPTIONAL ::   time_offset ! time offset in number 
-                                                     ! of internal steps             (lk_dynspg_ts=F)
-                                                     ! of external steps             (lk_dynspg_ts=T)
-      !
-      INTEGER  ::   joffset      ! local integer
-      INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp) ::   zt, zramp    ! local scalar
-      REAL(wp), DIMENSION(nb_harmo) ::   zwt 
+      REAL, INTENT(in)              ::   pdelta      ! Temporal offset in seconds
+      INTEGER                       ::   jk          ! Dummy loop index
+      REAL(wp)                      ::   zt, zramp   ! Local scalars
+      REAL(wp), DIMENSION(nb_harmo) ::   zwt         ! Temporary array
       !!----------------------------------------------------------------------      
       !
-      !                               ! tide pulsation at model time step (or sub-time-step)
-      zt = ( kt - kt_tide ) * rdt
-      !
-      joffset = 0
-      IF( PRESENT( time_offset ) )   joffset = time_offset
-      !
-      IF( PRESENT( kit ) )   THEN
-         zt = zt + ( kit +  joffset - 1 ) * rdt / REAL( nn_baro, wp )
-      ELSE
-         zt = zt + joffset * rdt
-      ENDIF
-      !
-      zwt(:) = tide_harmonics(:)%omega * zt
-
+      zwt(:) = tide_harmonics(:)%omega * pdelta
+      !
       pot_astro(:,:) = 0._wp          ! update tidal potential (sum of all harmonics)
       DO jk = 1, nb_harmo   
@@ -772,6 +745,5 @@
       !
       IF( ln_tide_ramp ) THEN         ! linear increase if asked
-         zt = ( kt - nit000 ) * rdt
-         IF( PRESENT( kit ) )   zt = zt + ( kit + joffset -1) * rdt / REAL( nn_baro, wp )
+         zt = rn_tide_ramp_t + pdelta
          zramp = MIN(  MAX( zt / (rn_tide_ramp_dt*rday) , 0._wp ) , 1._wp  )
          pot_astro(:,:) = zramp * pot_astro(:,:)
