Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/BDY/bdydta.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/BDY/bdydta.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/BDY/bdydta.F90	(revision 12127)
@@ -75,5 +75,5 @@
 CONTAINS
 
-   SUBROUTINE bdy_dta( kt, kit, kt_offset )
+   SUBROUTINE bdy_dta( kt, kit, pt_offset )
       !!----------------------------------------------------------------------
       !!                   ***  SUBROUTINE bdy_dta  ***
@@ -86,10 +86,6 @@
       INTEGER, INTENT(in)           ::   kt           ! ocean time-step index 
       INTEGER, INTENT(in), OPTIONAL ::   kit          ! subcycle time-step index (for timesplitting option)
-      INTEGER, INTENT(in), OPTIONAL ::   kt_offset    ! time offset in units of timesteps. NB. if kit
+      REAL(wp),INTENT(in), OPTIONAL ::   pt_offset    ! time offset in units of timesteps. NB. if kit
       !                                               ! is present then units = subcycle timesteps.
-      !                                               ! kt_offset = 0 => get data at "now" time level
-      !                                               ! kt_offset = -1 => get data at "before" time level
-      !                                               ! kt_offset = +1 => get data at "after" time level
-      !                                               ! etc.
       !
       INTEGER ::  jbdy, jfld, jstart, jend, ib, jl    ! dummy loop indices
@@ -216,5 +212,5 @@
          ! read/update all bdy data
          ! ------------------------
-         CALL fld_read( kt, 1, bf_alias, kit = kit, kt_offset = kt_offset )
+         CALL fld_read( kt, 1, bf_alias, kit = kit, pt_offset = pt_offset )
 
          ! apply some corrections in some specific cases...
@@ -279,5 +275,5 @@
          IF( PRESENT(kit) .AND. nn_dyn2d_dta(jbdy) .GE. 2 ) THEN
             CALL bdytide_update( kt = kt, idx = idx_bdy(jbdy), dta = dta_alias, td = tides(jbdy),   & 
-               &                 kit = kit, kt_offset = kt_offset )
+               &                 kit = kit, pt_offset = pt_offset )
          ENDIF
 
@@ -343,19 +339,21 @@
                   nblen => idx_bdy(jbdy)%nblen
                   nblenrim => idx_bdy(jbdy)%nblenrim
-                  IF( cn_dyn2d(jbdy) == 'frs' ) THEN ; ilen1(:)=nblen(:) ; ELSE ; ilen1(:)=nblenrim(:) ; ENDIF 
-                     IF ( dta_bdy(jbdy)%lneed_ssh   ) dta_bdy_s(jbdy)%ssh(1:ilen1(1)) = dta_bdy(jbdy)%ssh(1:ilen1(1))
-                     IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%u2d(1:ilen1(2)) = dta_bdy(jbdy)%u2d(1:ilen1(2))
-                     IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%v2d(1:ilen1(3)) = dta_bdy(jbdy)%v2d(1:ilen1(3))
-                  ENDIF
-               END DO
-            ELSE ! Add tides if not split-explicit free surface else this is done in ts loop
-               !
-               CALL bdy_dta_tides( kt=kt, kt_offset=kt_offset )
-            ENDIF
-         ENDIF
-         !
-         IF( ln_timing )   CALL timing_stop('bdy_dta')
-         !
-      END SUBROUTINE bdy_dta
+                  IF( cn_dyn2d(jbdy) == 'frs' ) THEN   ;   ilen1(:)=nblen(:)
+                  ELSE                                 ;   ilen1(:)=nblenrim(:)
+                  ENDIF
+                  IF ( dta_bdy(jbdy)%lneed_ssh   ) dta_bdy_s(jbdy)%ssh(1:ilen1(1)) = dta_bdy(jbdy)%ssh(1:ilen1(1))
+                  IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%u2d(1:ilen1(2)) = dta_bdy(jbdy)%u2d(1:ilen1(2))
+                  IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%v2d(1:ilen1(3)) = dta_bdy(jbdy)%v2d(1:ilen1(3))
+               ENDIF
+            END DO
+         ELSE ! Add tides if not split-explicit free surface else this is done in ts loop
+            !
+            CALL bdy_dta_tides( kt=kt, pt_offset=pt_offset )
+         ENDIF
+      ENDIF
+      !
+      IF( ln_timing )   CALL timing_stop('bdy_dta')
+      !
+   END SUBROUTINE bdy_dta
 
 
Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/BDY/bdytides.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/BDY/bdytides.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/BDY/bdytides.F90	(revision 12127)
@@ -262,5 +262,5 @@
 
 
-   SUBROUTINE bdytide_update( kt, idx, dta, td, kit, kt_offset )
+   SUBROUTINE bdytide_update( kt, idx, dta, td, kit, pt_offset )
       !!----------------------------------------------------------------------
       !!                 ***  SUBROUTINE bdytide_update  ***
@@ -274,15 +274,10 @@
       TYPE(TIDES_DATA) , INTENT(inout) ::   td          ! tidal harmonics data
       INTEGER, OPTIONAL, INTENT(in   ) ::   kit         ! Barotropic timestep counter (for timesplitting option)
-      INTEGER, OPTIONAL, INTENT(in   ) ::   kt_offset   ! time offset in units of timesteps. NB. if kit
+      REAL(wp), OPTIONAL,INTENT(in   ) ::   pt_offset   ! time offset in units of timesteps. NB. if kit
       !                                                 ! is present then units = subcycle timesteps.
-      !                                                 ! kt_offset = 0  => get data at "now"    time level
-      !                                                 ! kt_offset = -1 => get data at "before" time level
-      !                                                 ! kt_offset = +1 => get data at "after"  time level
-      !                                                 ! etc.
       !
       INTEGER  ::   itide, igrd, ib       ! dummy loop indices
-      INTEGER  ::   time_add              ! time offset in units of timesteps
       INTEGER, DIMENSION(3) ::   ilen0    ! length of boundary data (from OBC arrays)
-      REAL(wp) ::   z_arg, z_sarg, zflag, zramp   ! local scalars    
+      REAL(wp) ::   z_arg, z_sarg, zflag, zramp, zt_offset  ! local scalars    
       REAL(wp), DIMENSION(jpmax_harmo) :: z_sist, z_cost
       !!----------------------------------------------------------------------
@@ -299,5 +294,5 @@
       IF ( (nsec_day == NINT(0.5_wp * rdt) .OR. kt==nit000) .AND. zflag==1 ) THEN
         !
-        kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt
+        kt_tide = kt - NINT((REAL(nsec_day,wp) - 0.5_wp * rdt)/rdt)
         !
         IF(lwp) THEN
@@ -312,18 +307,16 @@
       ENDIF 
 
-      time_add = 0
-      IF( PRESENT(kt_offset) ) THEN
-         time_add = kt_offset
-      ENDIF
+      zt_offset = 0._wp
+      IF( PRESENT(pt_offset) )   zt_offset = pt_offset
          
       IF( PRESENT(kit) ) THEN  
-         z_arg = ((kt-kt_tide) * rdt + (kit+0.5_wp*(time_add-1)) * rdt / REAL(nn_baro,wp) )
+         z_arg =   REAL( kt - kt_tide, wp) * rdt + ( REAL(kit, wp) + 0.5_wp * ( zt_offset - 1._wp ) ) * rdt / REAL(nn_baro, wp)
       ELSE                              
-         z_arg = ((kt-kt_tide)+time_add) * rdt
+         z_arg = ( REAL( kt - kt_tide, wp) + zt_offset ) * rdt
       ENDIF
 
       ! Linear ramp on tidal component at open boundaries 
       zramp = 1._wp
-      IF (ln_tide_ramp) zramp = MIN(MAX( (z_arg + (kt_tide-nit000)*rdt)/(rdttideramp*rday),0._wp),1._wp)
+      IF (ln_tide_ramp) zramp = MIN(MAX( (z_arg + REAL(kt_tide-nit000,wp)*rdt)/(rdttideramp*rday),0._wp),1._wp)
 
       DO itide = 1, nb_harmo
@@ -351,5 +344,5 @@
 
 
-   SUBROUTINE bdy_dta_tides( kt, kit, kt_offset )
+   SUBROUTINE bdy_dta_tides( kt, kit, pt_offset )
       !!----------------------------------------------------------------------
       !!                 ***  SUBROUTINE bdy_dta_tides  ***
@@ -360,17 +353,12 @@
       INTEGER,           INTENT(in) ::   kt          ! Main timestep counter
       INTEGER, OPTIONAL, INTENT(in) ::   kit         ! Barotropic timestep counter (for timesplitting option)
-      INTEGER, OPTIONAL, INTENT(in) ::   kt_offset   ! time offset in units of timesteps. NB. if kit
+      REAL(wp),OPTIONAL, INTENT(in) ::   pt_offset   ! time offset in units of timesteps. NB. if kit
       !                                              ! is present then units = subcycle timesteps.
-      !                                              ! kt_offset = 0  => get data at "now"    time level
-      !                                              ! kt_offset = -1 => get data at "before" time level
-      !                                              ! kt_offset = +1 => get data at "after"  time level
-      !                                              ! etc.
       !
       LOGICAL  ::   lk_first_btstp            ! =.TRUE. if time splitting and first barotropic step
       INTEGER  ::   itide, ib_bdy, ib, igrd   ! loop indices
-      INTEGER  ::   time_add                  ! time offset in units of timesteps
       INTEGER, DIMENSION(jpbgrd)   ::   ilen0 
       INTEGER, DIMENSION(1:jpbgrd) ::   nblen, nblenrim  ! short cuts
-      REAL(wp) ::   z_arg, z_sarg, zramp, zoff, z_cost, z_sist      
+      REAL(wp) ::   z_arg, z_sarg, zramp, zoff, z_cost, z_sist, zt_offset   
       !!----------------------------------------------------------------------
       !
@@ -378,19 +366,17 @@
       IF ( PRESENT(kit).AND.( kit /= 1 ) ) THEN ; lk_first_btstp=.FALSE. ; ENDIF
 
-      time_add = 0
-      IF( PRESENT(kt_offset) ) THEN
-         time_add = kt_offset
-      ENDIF
+      zt_offset = 0._wp
+      IF( PRESENT(pt_offset) )   zt_offset = pt_offset
       
       ! Absolute time from model initialization:   
       IF( PRESENT(kit) ) THEN  
-         z_arg = ( kt + (kit+time_add-1) / REAL(nn_baro,wp) ) * rdt
+         z_arg = ( REAL(kt, wp) + ( REAL(kit, wp) + zt_offset - 1. ) / REAL(nn_baro, wp) ) * rdt
       ELSE                              
-         z_arg = ( kt + time_add ) * rdt
+         z_arg = ( REAL(kt, wp) + zt_offset ) * rdt
       ENDIF
 
       ! Linear ramp on tidal component at open boundaries 
       zramp = 1.
-      IF (ln_tide_ramp) zramp = MIN(MAX( (z_arg - nit000*rdt)/(rdttideramp*rday),0.),1.)
+      IF (ln_tide_ramp) zramp = MIN(MAX( (z_arg - REAL(nit000, wp)*rdt)/(rdttideramp*rday),0.),1.)
 
       DO ib_bdy = 1,nb_bdy
@@ -409,5 +395,5 @@
             IF ( ( nsec_day == NINT(0.5_wp * rdt) .OR. kt==nit000 ) .AND. lk_first_btstp ) THEN
                !
-               kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt
+               kt_tide = kt - NINT((REAL(nsec_day,wp) - 0.5_wp * rdt)/rdt)
                !
                IF(lwp) THEN
@@ -421,5 +407,5 @@
                !
             ENDIF
-            zoff = -kt_tide * rdt ! time offset relative to nodal factor computation time
+            zoff = REAL(-kt_tide,wp) * rdt ! time offset relative to nodal factor computation time
             !
             ! If time splitting, initialize arrays from slow varying open boundary data:
Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/DYN/dynspg_ts.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/DYN/dynspg_ts.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/DYN/dynspg_ts.F90	(revision 12127)
@@ -423,6 +423,6 @@
          !                    !==  Update the forcing ==! (BDY and tides)
          !
-         IF( ln_bdy      .AND. ln_tide )   CALL bdy_dta_tides( kt, kit=jn, kt_offset= noffset+1 )
-         IF( ln_tide_pot .AND. ln_tide )   CALL upd_tide     ( kt, kit=jn, kt_offset= noffset   )
+         IF( ln_bdy      .AND. ln_tide )   CALL bdy_dta_tides( kt, kit=jn, pt_offset= REAL(noffset,wp) + 1._wp )
+         IF( ln_tide_pot .AND. ln_tide )   CALL upd_tide     ( kt, kit=jn, pt_offset= REAL(noffset,wp)         )
          !
          !                    !==  extrapolation at mid-step  ==!   (jn+1/2)
Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/SBC/fldread.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/SBC/fldread.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/SBC/fldread.F90	(revision 12127)
@@ -132,5 +132,5 @@
 CONTAINS
 
-   SUBROUTINE fld_read( kt, kn_fsbc, sd, kit, kt_offset )
+   SUBROUTINE fld_read( kt, kn_fsbc, sd, kit, pt_offset )
       !!---------------------------------------------------------------------
       !!                    ***  ROUTINE fld_read  ***
@@ -148,8 +148,5 @@
       TYPE(FLD), INTENT(inout), DIMENSION(:) ::   sd        ! input field related variables
       INTEGER  , INTENT(in   ), OPTIONAL     ::   kit       ! subcycle timestep for timesplitting option
-      INTEGER  , INTENT(in   ), OPTIONAL     ::   kt_offset ! provide fields at time other than "now"
-      !                                                     !   kt_offset = -1 => fields at "before" time level
-      !                                                     !   kt_offset = +1 => fields at "after"  time level
-      !                                                     !   etc.
+      REAL(wp) , INTENT(in   ), OPTIONAL     ::   pt_offset ! provide fields at time other than "now"
       !!
       INTEGER  ::   imf          ! size of the structure sd
@@ -168,5 +165,5 @@
       ELSE                                      ;   zt_offset = 0.
       ENDIF
-      IF( PRESENT(kt_offset) )   zt_offset = REAL( kt_offset, wp )
+      IF( PRESENT(pt_offset) )   zt_offset = pt_offset
 
       ! Note that all varibles starting by nsec_* are shifted time by +1/2 time step to be centrered
Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/SBC/updtide.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/SBC/updtide.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/SBC/updtide.F90	(revision 12127)
@@ -27,5 +27,5 @@
 CONTAINS
 
-   SUBROUTINE upd_tide( kt, kit, kt_offset )
+   SUBROUTINE upd_tide( kt, kit, pt_offset )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE upd_tide  ***
@@ -39,24 +39,24 @@
       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 ::   kt_offset ! time offset in number 
+      REAL(wp),INTENT(in), OPTIONAL ::   pt_offset ! time offset in number 
                                                      ! of internal steps             (lk_dynspg_ts=F)
                                                      ! of external steps             (lk_dynspg_ts=T)
       !
-      INTEGER  ::   ioffset      ! local integer
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       REAL(wp) ::   zt, zramp    ! local scalar
+      REAL(wp) ::   zt_offset    
       REAL(wp), DIMENSION(nb_harmo) ::   zwt 
       !!----------------------------------------------------------------------      
       !
       !                               ! tide pulsation at model time step (or sub-time-step)
-      zt = ( kt - kt_tide ) * rdt
+      zt = REAL( kt - kt_tide, wp ) * rdt
       !
-      ioffset = 0
-      IF( PRESENT( kt_offset ) )   ioffset = kt_offset
+      zt_offset = 0._wp
+      IF( PRESENT( pt_offset ) )   zt_offset = pt_offset
       !
       IF( PRESENT( kit ) )   THEN
-         zt = zt + ( kit +  ioffset - 1 ) * rdt / REAL( nn_baro, wp )
+         zt = zt + ( REAL( kit, wp ) +  zt_offset - 1._wp ) * rdt / REAL( nn_baro, wp )
       ELSE
-         zt = zt + ioffset * rdt
+         zt = zt + zt_offset * rdt
       ENDIF
       !
@@ -70,5 +70,5 @@
       IF( ln_tide_ramp ) THEN         ! linear increase if asked
          zt = ( kt - nit000 ) * rdt
-         IF( PRESENT( kit ) )   zt = zt + ( kit + ioffset -1) * rdt / REAL( nn_baro, wp )
+         IF( PRESENT( kit ) )   zt = zt + ( REAL( kit, wp ) + zt_offset -1._wp ) * rdt / REAL( nn_baro, wp )
          zramp = MIN(  MAX( zt / (rdttideramp*rday) , 0._wp ) , 1._wp  )
          pot_astro(:,:) = zramp * pot_astro(:,:)
Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/step.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/step.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/OCE/step.F90	(revision 12127)
@@ -112,5 +112,5 @@
       IF( ln_tide    )   CALL sbc_tide( kstp )                   ! update tide potential
       IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                   ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib) 
-      IF( ln_bdy     )   CALL bdy_dta ( kstp, kt_offset = +1 )   ! update dynamic & tracer data at open boundaries
+      IF( ln_bdy     )   CALL bdy_dta ( kstp, pt_offset = 1. )   ! update dynamic & tracer data at open boundaries
                          CALL sbc     ( kstp )                   ! Sea Boundary Condition (including sea-ice)
 
Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/SAS/step.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/SAS/step.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/SAS/step.F90	(revision 12127)
@@ -96,5 +96,5 @@
       !           From SAS: ocean bdy data are wrong  (but we do not care) and ice bdy data are OK.  
       !           This is not clean and should be changed in the future. 
-      IF( ln_bdy     )       CALL bdy_dta ( kstp, kt_offset=+1 )   ! update dynamic & tracer data at open boundaries
+      IF( ln_bdy     )       CALL bdy_dta ( kstp, pt_offset = 1. )   ! update dynamic & tracer data at open boundaries
       ! ==>
                              CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
Index: NEMO/branches/2019/dev_r12114_ticket_2263/src/TOP/trcbc.F90
===================================================================
--- NEMO/branches/2019/dev_r12114_ticket_2263/src/TOP/trcbc.F90	(revision 12116)
+++ NEMO/branches/2019/dev_r12114_ticket_2263/src/TOP/trcbc.F90	(revision 12127)
@@ -368,8 +368,8 @@
       IF( PRESENT(jit) ) THEN 
          !
-         ! OPEN boundary conditions (use kt_offset=+1 as they are applied at the end of the step)
+         ! OPEN boundary conditions (use pt_offset=1. as they are applied at the end of the step)
          IF( nb_trcobc > 0 ) THEN
            if (lwp) write(numout,'(a,i5,a,i10)') '   reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt
-           CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kit=jit, kt_offset=+1)
+           CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kit=jit, pt_offset=1.)
          ENDIF
          !
@@ -388,8 +388,8 @@
       ELSE
          !
-         ! OPEN boundary conditions (use kt_offset=+1 as they are applied at the end of the step)
+         ! OPEN boundary conditions (use pt_offset=1. as they are applied at the end of the step)
          IF( nb_trcobc > 0 ) THEN
            if (lwp) write(numout,'(a,i5,a,i10)') '   reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt
-           CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kt_offset=+1)
+           CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, pt_offset=1.)
          ENDIF
          !
