Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdydta.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdydta.F90	(revision 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdydta.F90	(revision 10773)
@@ -23,5 +23,5 @@
    USE phycst         ! physical constants
    USE sbcapr         ! atmospheric pressure forcing
-   USE sbctide        ! Tidal forcing or not
+   USE tide_mod, ONLY: ln_tide ! tidal forcing
    USE bdy_oce        ! ocean open boundary conditions  
    USE bdytides       ! tidal forcing at boundaries
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdyini.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdyini.F90	(revision 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdyini.F90	(revision 10773)
@@ -22,5 +22,5 @@
    USE bdydta         ! open boundary cond. setting   (bdy_dta_init routine)
    USE bdytides       ! open boundary cond. setting   (bdytide_init routine)
-   USE sbctide        ! Tidal forcing or not
+   USE tide_mod, ONLY: ln_tide ! tidal forcing
    USE phycst   , ONLY: rday
    !
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 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg.F90	(revision 10773)
@@ -23,4 +23,5 @@
    USE sbctide        ! 
    USE updtide        ! 
+   USE tide_mod       !
    USE trd_oce        ! trends: ocean variables
    USE trddyn         ! trend manager: dynamics
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 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg_ts.F90	(revision 10773)
@@ -46,4 +46,5 @@
    USE sbctide         ! tides
    USE updtide         ! tide potential
+   USE tide_mod        !
    USE sbcwave         ! surface wave
    USE diatmb          ! Top,middle,bottom output
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/SBC/sbctide.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/SBC/sbctide.F90	(revision 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/SBC/sbctide.F90	(revision 10773)
@@ -18,17 +18,7 @@
 
    IMPLICIT NONE
-   PUBLIC
+   PRIVATE
 
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) ::   pot_astro   !
-
-   !!----------------------------------------------------------------------
-   !!   tidal potential
-   !!----------------------------------------------------------------------
-   !!   sbc_tide            : 
-   !!   tide_init_potential :
-   !!----------------------------------------------------------------------
-
-   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   amp_pot, phi_pot
-   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   amp_load, phi_load
+   PUBLIC sbc_tide
  
    !!----------------------------------------------------------------------
@@ -50,14 +40,7 @@
       IF( nsec_day == NINT(0.5_wp * rdt) .OR. kt == nit000 ) THEN      ! start a new day
          !
-         IF( kt == nit000 )THEN
-            ALLOCATE( amp_pot(jpi,jpj,nb_harmo),                      &
-               &      phi_pot(jpi,jpj,nb_harmo), pot_astro(jpi,jpj)   )
-            IF( ln_read_load )THEN
-               ALLOCATE( amp_load(jpi,jpj,nb_harmo), phi_load(jpi,jpj,nb_harmo) )
-               CALL tide_init_load
-            ENDIF
-         ENDIF
          !
          IF( ln_read_load )THEN
+            IF ( kt == nit000 ) CALL tide_init_load
             amp_pot(:,:,:) = amp_load(:,:,:)
             phi_pot(:,:,:) = phi_load(:,:,:)
@@ -98,71 +81,4 @@
    END SUBROUTINE sbc_tide
 
-
-   SUBROUTINE tide_init_potential
-      !!----------------------------------------------------------------------
-      !!                 ***  ROUTINE tide_init_potential  ***
-      !!----------------------------------------------------------------------
-      INTEGER  ::   ji, jj, jk   ! dummy loop indices
-      REAL(wp) ::   zcons, ztmp1, ztmp2, zlat, zlon, ztmp, zamp, zcs   ! local scalar
-      !!----------------------------------------------------------------------
-
-      DO jk = 1, nb_harmo
-         zcons = 0.7_wp * Wave(ntide(jk))%equitide * ftide(jk)
-         DO ji = 1, jpi
-            DO jj = 1, jpj
-               ztmp1 =  ftide(jk) * amp_pot(ji,jj,jk) * COS( phi_pot(ji,jj,jk) + v0tide(jk) + utide(jk) )
-               ztmp2 = -ftide(jk) * amp_pot(ji,jj,jk) * SIN( phi_pot(ji,jj,jk) + v0tide(jk) + utide(jk) )
-               zlat = gphit(ji,jj)*rad !! latitude en radian
-               zlon = glamt(ji,jj)*rad !! longitude en radian
-               ztmp = v0tide(jk) + utide(jk) + Wave(ntide(jk))%nutide * zlon
-               ! le potentiel est composé des effets des astres:
-               IF    ( Wave(ntide(jk))%nutide == 1 )  THEN  ;  zcs = zcons * SIN( 2._wp*zlat )
-               ELSEIF( Wave(ntide(jk))%nutide == 2 )  THEN  ;  zcs = zcons * COS( zlat )**2
-               ELSE                                         ;  zcs = 0._wp
-               ENDIF
-               ztmp1 = ztmp1 + zcs * COS( ztmp )
-               ztmp2 = ztmp2 - zcs * SIN( ztmp )
-               zamp = SQRT( ztmp1*ztmp1 + ztmp2*ztmp2 )
-               amp_pot(ji,jj,jk) = zamp
-               phi_pot(ji,jj,jk) = ATAN2( -ztmp2 / MAX( 1.e-10_wp , zamp ) ,   &
-                  &                        ztmp1 / MAX( 1.e-10_wp,  zamp )   )
-            END DO
-         END DO
-      END DO
-      !
-   END SUBROUTINE tide_init_potential
-
-   SUBROUTINE tide_init_load
-      !!----------------------------------------------------------------------
-      !!                 ***  ROUTINE tide_init_load  ***
-      !!----------------------------------------------------------------------
-      INTEGER :: inum                 ! Logical unit of input file
-      INTEGER :: ji, jj, itide        ! dummy loop indices
-      REAL(wp), DIMENSION(jpi,jpj) ::   ztr, zti   !: workspace to read in tidal harmonics data 
-      !!----------------------------------------------------------------------
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'tide_init_load : Initialization of load potential from file'
-         WRITE(numout,*) '~~~~~~~~~~~~~~ '
-      ENDIF
-      !
-      CALL iom_open ( cn_tide_load , inum )
-      !
-      DO itide = 1, nb_harmo
-         CALL iom_get  ( inum, jpdom_data,TRIM(Wave(ntide(itide))%cname_tide)//'_z1', ztr(:,:) )
-         CALL iom_get  ( inum, jpdom_data,TRIM(Wave(ntide(itide))%cname_tide)//'_z2', zti(:,:) )
-         !
-         DO ji=1,jpi
-            DO jj=1,jpj
-               amp_load(ji,jj,itide) =  SQRT( ztr(ji,jj)**2. + zti(ji,jj)**2. )
-               phi_load(ji,jj,itide) = ATAN2(-zti(ji,jj), ztr(ji,jj) )
-            END DO
-         END DO
-         !
-      END DO
-      CALL iom_close( inum )
-      !
-   END SUBROUTINE tide_init_load
-
   !!======================================================================
 END MODULE sbctide
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/SBC/updtide.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/SBC/updtide.F90	(revision 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/SBC/updtide.F90	(revision 10773)
@@ -13,5 +13,5 @@
    USE phycst          ! physical constant
    USE sbctide         ! tide potential variable
-   USE tide_mod, ONLY: ln_tide_ramp, rdttideramp
+   USE tide_mod, ONLY: ln_tide_ramp, rdttideramp, kt_tide, omega_tide, pot_astro, amp_pot, phi_pot, nb_harmo
 
    IMPLICIT NONE
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 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide_mod.F90	(revision 10773)
@@ -22,4 +22,6 @@
    PUBLIC   tide_harmo       ! called by tideini and diaharm modules
    PUBLIC   tide_init_Wave   ! called by tideini and diaharm modules
+   PUBLIC   tide_init_load
+   PUBLIC   tide_init_potential
 
    INTEGER, PUBLIC, PARAMETER ::   jpmax_harmo = 19   !: maximum number of harmonic
@@ -53,4 +55,9 @@
 
    INTEGER , PUBLIC, ALLOCATABLE, DIMENSION(:) ::   ntide   !:
+
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   pot_astro !: tidal potential
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::   amp_pot, phi_pot
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::   amp_load, phi_load
+
 
    REAL(wp) ::   sh_T, sh_s, sh_h, sh_p, sh_p1             ! astronomic angles
@@ -149,4 +156,10 @@
       IF (.NOT.ln_scal_load ) rn_scal_load = 0._wp
       !
+      ALLOCATE( amp_pot(jpi,jpj,nb_harmo),                      &
+           &      phi_pot(jpi,jpj,nb_harmo), pot_astro(jpi,jpj)   )
+      IF( ln_read_load ) THEN
+         ALLOCATE( amp_load(jpi,jpj,nb_harmo), phi_load(jpi,jpj,nb_harmo) )
+      ENDIF
+      !
    END SUBROUTINE tide_init
 
@@ -155,4 +168,72 @@
 #     include "tide.h90"
    END SUBROUTINE tide_init_Wave
+
+
+   SUBROUTINE tide_init_potential
+      !!----------------------------------------------------------------------
+      !!                 ***  ROUTINE tide_init_potential  ***
+      !!----------------------------------------------------------------------
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zcons, ztmp1, ztmp2, zlat, zlon, ztmp, zamp, zcs   ! local scalar
+      !!----------------------------------------------------------------------
+
+      DO jk = 1, nb_harmo
+         zcons = 0.7_wp * Wave(ntide(jk))%equitide * ftide(jk)
+         DO ji = 1, jpi
+            DO jj = 1, jpj
+               ztmp1 =  ftide(jk) * amp_pot(ji,jj,jk) * COS( phi_pot(ji,jj,jk) + v0tide(jk) + utide(jk) )
+               ztmp2 = -ftide(jk) * amp_pot(ji,jj,jk) * SIN( phi_pot(ji,jj,jk) + v0tide(jk) + utide(jk) )
+               zlat = gphit(ji,jj)*rad !! latitude en radian
+               zlon = glamt(ji,jj)*rad !! longitude en radian
+               ztmp = v0tide(jk) + utide(jk) + Wave(ntide(jk))%nutide * zlon
+               ! le potentiel est composé des effets des astres:
+               IF    ( Wave(ntide(jk))%nutide == 1 )  THEN  ;  zcs = zcons * SIN( 2._wp*zlat )
+               ELSEIF( Wave(ntide(jk))%nutide == 2 )  THEN  ;  zcs = zcons * COS( zlat )**2
+               ELSE                                         ;  zcs = 0._wp
+               ENDIF
+               ztmp1 = ztmp1 + zcs * COS( ztmp )
+               ztmp2 = ztmp2 - zcs * SIN( ztmp )
+               zamp = SQRT( ztmp1*ztmp1 + ztmp2*ztmp2 )
+               amp_pot(ji,jj,jk) = zamp
+               phi_pot(ji,jj,jk) = ATAN2( -ztmp2 / MAX( 1.e-10_wp , zamp ) ,   &
+                  &                        ztmp1 / MAX( 1.e-10_wp,  zamp )   )
+            END DO
+         END DO
+      END DO
+      !
+   END SUBROUTINE tide_init_potential
+
+
+   SUBROUTINE tide_init_load
+      !!----------------------------------------------------------------------
+      !!                 ***  ROUTINE tide_init_load  ***
+      !!----------------------------------------------------------------------
+      INTEGER :: inum                 ! Logical unit of input file
+      INTEGER :: ji, jj, itide        ! dummy loop indices
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztr, zti   !: workspace to read in tidal harmonics data 
+      !!----------------------------------------------------------------------
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'tide_init_load : Initialization of load potential from file'
+         WRITE(numout,*) '~~~~~~~~~~~~~~ '
+      ENDIF
+      !
+      CALL iom_open ( cn_tide_load , inum )
+      !
+      DO itide = 1, nb_harmo
+         CALL iom_get  ( inum, jpdom_data,TRIM(Wave(ntide(itide))%cname_tide)//'_z1', ztr(:,:) )
+         CALL iom_get  ( inum, jpdom_data,TRIM(Wave(ntide(itide))%cname_tide)//'_z2', zti(:,:) )
+         !
+         DO ji=1,jpi
+            DO jj=1,jpj
+               amp_load(ji,jj,itide) =  SQRT( ztr(ji,jj)**2. + zti(ji,jj)**2. )
+               phi_load(ji,jj,itide) = ATAN2(-zti(ji,jj), ztr(ji,jj) )
+            END DO
+         END DO
+         !
+      END DO
+      CALL iom_close( inum )
+      !
+   END SUBROUTINE tide_init_load
 
 
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/step_oce.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/step_oce.F90	(revision 10772)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/step_oce.F90	(revision 10773)
@@ -20,4 +20,5 @@
    USE sbcapr          ! surface boundary condition: atmospheric pressure
    USE sbctide         ! Tide initialisation
+   USE tide_mod, ONLY : ln_tide
    USE sbcwave         ! Wave intialisation
 
