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 10810)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdytides.F90	(revision 10811)
@@ -115,5 +115,5 @@
                     WRITE(numout,*) '             Tidal components: ' 
                DO itide = 1, nb_harmo
-                  WRITE(numout,*)  '                 ', Wave(ntide(itide))%cname_tide 
+                  WRITE(numout,*)  '                 ', tide_components(itide)%cname_tide 
                END DO
             ENDIF 
@@ -156,6 +156,6 @@
                igrd = 1                       ! Everything is at T-points here
                DO itide = 1, nb_harmo
-                  CALL iom_get( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_z1', ztr(:,:) )
-                  CALL iom_get( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_z2', zti(:,:) ) 
+                  CALL iom_get( inum, jpdom_autoglo, TRIM(tide_components(itide)%cname_tide)//'_z1', ztr(:,:) )
+                  CALL iom_get( inum, jpdom_autoglo, TRIM(tide_components(itide)%cname_tide)//'_z2', zti(:,:) ) 
                   DO ib = 1, ilen0(igrd)
                      ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
@@ -172,6 +172,6 @@
                igrd = 2                       ! Everything is at U-points here
                DO itide = 1, nb_harmo
-                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_u1', ztr(:,:) )
-                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_u2', zti(:,:) )
+                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(tide_components(itide)%cname_tide)//'_u1', ztr(:,:) )
+                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(tide_components(itide)%cname_tide)//'_u2', zti(:,:) )
                   DO ib = 1, ilen0(igrd)
                      ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
@@ -188,6 +188,6 @@
                igrd = 3                       ! Everything is at V-points here
                DO itide = 1, nb_harmo
-                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_v1', ztr(:,:) )
-                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(Wave(ntide(itide))%cname_tide)//'_v2', zti(:,:) )
+                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(tide_components(itide)%cname_tide)//'_v1', ztr(:,:) )
+                  CALL iom_get  ( inum, jpdom_autoglo, TRIM(tide_components(itide)%cname_tide)//'_v2', zti(:,:) )
                   DO ib = 1, ilen0(igrd)
                      ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
@@ -217,5 +217,5 @@
                DO itide = 1, nb_harmo
                   !                                                              ! SSH fields
-                  clfile = TRIM(filtide)//TRIM(Wave(ntide(itide))%cname_tide)//'_grid_T.nc'
+                  clfile = TRIM(filtide)//TRIM(tide_components(itide)%cname_tide)//'_grid_T.nc'
                   CALL iom_open( clfile, inum )
                   CALL fld_map( inum, 'z1' , dta_read(1:ilen0(1),1:1,1:1) , 1,  ibmap_ptr(1) )
@@ -225,5 +225,5 @@
                   CALL iom_close( inum )
                   !                                                              ! U fields
-                  clfile = TRIM(filtide)//TRIM(Wave(ntide(itide))%cname_tide)//'_grid_U.nc'
+                  clfile = TRIM(filtide)//TRIM(tide_components(itide)%cname_tide)//'_grid_U.nc'
                   CALL iom_open( clfile, inum )
                   CALL fld_map( inum, 'u1' , dta_read(1:ilen0(2),1:1,1:1) , 1, ibmap_ptr(2) )
@@ -233,5 +233,5 @@
                   CALL iom_close( inum )
                   !                                                              ! V fields
-                  clfile = TRIM(filtide)//TRIM(Wave(ntide(itide))%cname_tide)//'_grid_V.nc'
+                  clfile = TRIM(filtide)//TRIM(tide_components(itide)%cname_tide)//'_grid_V.nc'
                   CALL iom_open( clfile, inum )
                   CALL fld_map( inum, 'v1' , dta_read(1:ilen0(3),1:1,1:1) , 1, ibmap_ptr(3) )
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DIA/diaharm.F90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DIA/diaharm.F90	(revision 10810)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DIA/diaharm.F90	(revision 10811)
@@ -38,5 +38,4 @@
    INTEGER ::   nb_ana        ! Number of harmonics to analyse
 
-   INTEGER , ALLOCATABLE, DIMENSION(:)       ::   name
    REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ana_temp
    REAL(wp), ALLOCATABLE, DIMENSION(:)       ::   ana_freq, ut   , vt   , ft
@@ -73,4 +72,5 @@
       INTEGER :: jh, nhan, jk, ji
       INTEGER ::   ios                 ! Local integer output status for namelist read
+      TYPE(tide), PUBLIC, DIMENSION(:), POINTER ::   tide_components ! Selected tidal components
 
       NAMELIST/nam_diaharm/ nit000_han, nitend_han, nstep_han, tname
@@ -84,6 +84,4 @@
       !
       IF( .NOT. ln_tide )   CALL ctl_stop( 'dia_harm_init : ln_tide must be true for harmonic analysis')
-      !
-      CALL tide_init_Wave
       !
       REWIND( numnam_ref )              ! Namelist nam_diaharm in reference namelist : Tidal harmonic analysis
@@ -111,12 +109,9 @@
          &                        CALL ctl_stop( 'dia_harm_init : analysis time span must be a multiple of nstep_han' )
 
-      nb_ana = 0
-      DO jk=1,jpmax_harmo
-         DO ji=1,jpmax_harmo
-            IF(TRIM(tname(jk)) == Wave(ji)%cname_tide) THEN
-               nb_ana=nb_ana+1
-            ENDIF
-         END DO
-      END DO
+      ! Request parameters for tidal components that have been selected for
+      ! harmonic analysis
+      CALL tide_init_components(tname, tide_components)
+      ! Number of tidal components selected for harmonic analysis
+      nb_ana = size(tide_components)
       !
       IF(lwp) THEN
@@ -132,19 +127,9 @@
       ENDIF
 
-      ALLOCATE(name    (nb_ana))
-      DO jk=1,nb_ana
-       DO ji=1,jpmax_harmo
-          IF (TRIM(tname(jk)) ==  Wave(ji)%cname_tide) THEN
-             name(jk) = ji
-             EXIT
-          END IF
-       END DO
-      END DO
-
       ! Initialize frequency array:
       ! ---------------------------
       ALLOCATE( ana_freq(nb_ana), ut(nb_ana), vt(nb_ana), ft(nb_ana) )
 
-      CALL tide_harmo( ana_freq, vt, ut, ft, name, nb_ana )
+      CALL tide_harmo( ana_freq, vt, ut, ft, nb_ana )
 
       IF(lwp) WRITE(numout,*) 'Analysed frequency  : ',nb_ana ,'Frequency '
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 10810)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/SBC/sbctide.F90	(revision 10811)
@@ -61,5 +61,5 @@
             kt_tide = kt 
          ENDIF
-         CALL tide_harmo( omega_tide, v0tide, utide, ftide, ntide, nb_harmo )
+         CALL tide_harmo( omega_tide, v0tide, utide, ftide, nb_harmo )
          !
          !
@@ -69,5 +69,5 @@
             WRITE(numout,*) '~~~~~~~~ '
             DO jk = 1, nb_harmo
-               WRITE(numout,*) Wave(ntide(jk))%cname_tide, utide(jk), ftide(jk), v0tide(jk), omega_tide(jk)
+               WRITE(numout,*) tide_components(jk)%cname_tide, utide(jk), ftide(jk), v0tide(jk), omega_tide(jk)
             END DO
          ENDIF
Index: /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide.h90
===================================================================
--- /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide.h90	(revision 10810)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide.h90	(revision 10811)
@@ -3,27 +3,27 @@
    !!----------------------------------------------------------------------
 
-   !             !! name_tide , equitide , nutide , nt , ns , nh , np , np1 , shift , nksi , nnu0 , nnu1 , nnu2 , R , formula !!
-   !             !!           !          !        !    !    !    !    !     !       !      !      !      !      !   !         !!
-   Wave( 1) = tide(  'M2'     , 0.242297 ,    2   ,  2 , -2 ,  2 ,  0 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,    78   )
-   Wave( 2) = tide(  'N2'     , 0.046313 ,    2   ,  2 , -3 ,  2 ,  1 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,    78   )
-   Wave( 3) = tide( '2N2'     , 0.006184 ,    2   ,  2 , -4 ,  2 ,  2 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,    78   )
-   Wave( 4) = tide(  'S2'     , 0.113572 ,    2   ,  2 ,  0 ,  0 ,  0 ,  0  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,     0   )
-   Wave( 5) = tide(  'K2'     , 0.030875 ,    2   ,  2 ,  0 ,  2 ,  0 ,  0  ,    0  ,  0   ,  0   ,  0   , -2   , 0 ,   235   )
+   !                        !! name_tide , equitide , nutide , nt , ns , nh , np , np1 , shift , nksi , nnu0 , nnu1 , nnu2 , R , formula !!
+   !                        !!           !          !        !    !    !    !    !     !       !      !      !      !      !   !         !!
+   tide_components( 1) = tide(  'M2'     , 0.242297 ,    2   ,  2 , -2 ,  2 ,  0 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,    78   )
+   tide_components( 2) = tide(  'N2'     , 0.046313 ,    2   ,  2 , -3 ,  2 ,  1 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,    78   )
+   tide_components( 3) = tide( '2N2'     , 0.006184 ,    2   ,  2 , -4 ,  2 ,  2 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,    78   )
+   tide_components( 4) = tide(  'S2'     , 0.113572 ,    2   ,  2 ,  0 ,  0 ,  0 ,  0  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,     0   )
+   tide_components( 5) = tide(  'K2'     , 0.030875 ,    2   ,  2 ,  0 ,  2 ,  0 ,  0  ,    0  ,  0   ,  0   ,  0   , -2   , 0 ,   235   )
    !              !           !          !        !    !    !    !    !     !       !      !      !      !      !   !         !
-   Wave( 6) = tide(  'K1'     , 0.142408 ,    1   ,  1 ,  0 ,  1 ,  0 ,  0  ,  -90  ,  0   ,  0   , -1   ,  0   , 0 ,   227   )
-   Wave( 7) = tide(  'O1'     , 0.101266 ,    1   ,  1 , -2 ,  1 ,  0 ,  0  ,  +90  ,  2   , -1   ,  0   ,  0   , 0 ,    75   )
-   Wave( 8) = tide(  'Q1'     , 0.019387 ,    1   ,  1 , -3 ,  1 ,  1 ,  0  ,  +90  ,  2   , -1   ,  0   ,  0   , 0 ,    75   )
-   Wave( 9) = tide(  'P1'     , 0.047129 ,    1   ,  1 ,  0 , -1 ,  0 ,  0  ,  +90  ,  0   ,  0   ,  0   ,  0   , 0 ,    0    )
+   tide_components( 6) = tide(  'K1'     , 0.142408 ,    1   ,  1 ,  0 ,  1 ,  0 ,  0  ,  -90  ,  0   ,  0   , -1   ,  0   , 0 ,   227   )
+   tide_components( 7) = tide(  'O1'     , 0.101266 ,    1   ,  1 , -2 ,  1 ,  0 ,  0  ,  +90  ,  2   , -1   ,  0   ,  0   , 0 ,    75   )
+   tide_components( 8) = tide(  'Q1'     , 0.019387 ,    1   ,  1 , -3 ,  1 ,  1 ,  0  ,  +90  ,  2   , -1   ,  0   ,  0   , 0 ,    75   )
+   tide_components( 9) = tide(  'P1'     , 0.047129 ,    1   ,  1 ,  0 , -1 ,  0 ,  0  ,  +90  ,  0   ,  0   ,  0   ,  0   , 0 ,    0    )
    !              !           !          !        !    !    !    !    !     !       !      !      !      !      !   !         !
-   Wave(10) = tide(  'M4'     , 0.000000 ,    4   ,  4 , -4 ,  4 ,  0 ,  0  ,    0  ,  4   , -4   ,  0   ,  0   , 0 ,    1    )
+   tide_components(10) = tide(  'M4'     , 0.000000 ,    4   ,  4 , -4 ,  4 ,  0 ,  0  ,    0  ,  4   , -4   ,  0   ,  0   , 0 ,    1    )
    !              !           !          !        !    !    !    !    !     !       !      !      !      !      !   !         !
-   Wave(11) = tide(  'Mf'     , 0.042017 ,    0   ,  0 ,  2 ,  0 ,  0 ,  0  ,    0  , -2   ,  0   ,  0   ,  0   , 0 ,   74    )
-   Wave(12) = tide(  'Mm'     , 0.022191 ,    0   ,  0 ,  1 ,  0 , -1 ,  0  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,   73    )
-   Wave(13) = tide(  'Msqm'   , 0.000667 ,    0   ,  0 ,  4 , -2 ,  0 ,  0  ,    0  , -2   ,  0   ,  0   ,  0   , 0 ,   74    )
-   Wave(14) = tide(  'Mtm'    , 0.008049 ,    0   ,  0 ,  3 ,  0 , -1 ,  0  ,    0  , -2   ,  0   ,  0   ,  0   , 0 ,   74    )
+   tide_components(11) = tide(  'Mf'     , 0.042017 ,    0   ,  0 ,  2 ,  0 ,  0 ,  0  ,    0  , -2   ,  0   ,  0   ,  0   , 0 ,   74    )
+   tide_components(12) = tide(  'Mm'     , 0.022191 ,    0   ,  0 ,  1 ,  0 , -1 ,  0  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,   73    )
+   tide_components(13) = tide(  'Msqm'   , 0.000667 ,    0   ,  0 ,  4 , -2 ,  0 ,  0  ,    0  , -2   ,  0   ,  0   ,  0   , 0 ,   74    )
+   tide_components(14) = tide(  'Mtm'    , 0.008049 ,    0   ,  0 ,  3 ,  0 , -1 ,  0  ,    0  , -2   ,  0   ,  0   ,  0   , 0 ,   74    )
    !              !           !          !        !    !    !    !    !     !       !      !      !      !      !   !         !
-   Wave(15) = tide(  'S1'     , 0.000000 ,    1   ,  1 ,  0 ,  0 ,  0 ,  0  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,    0    )   
-   Wave(16) = tide(  'MU2'    , 0.005841 ,    2   ,  2 , -4 ,  4 ,  0 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,   78    )
-   Wave(17) = tide(  'NU2'    , 0.009094 ,    2   ,  2 , -3 ,  4 , -1 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,   78    ) 
-   Wave(18) = tide(  'L2'     , 0.006694 ,    2   ,  2 , -1 ,  2 , -1 ,  0  , +180  ,  2   , -2   ,  0   ,  0   , 0 ,  215    )
-   Wave(19) = tide(  'T2'     , 0.006614 ,    2   ,  2 ,  0 , -1 ,  0 ,  1  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,    0    )
+   tide_components(15) = tide(  'S1'     , 0.000000 ,    1   ,  1 ,  0 ,  0 ,  0 ,  0  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,    0    )   
+   tide_components(16) = tide(  'MU2'    , 0.005841 ,    2   ,  2 , -4 ,  4 ,  0 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,   78    )
+   tide_components(17) = tide(  'NU2'    , 0.009094 ,    2   ,  2 , -3 ,  4 , -1 ,  0  ,    0  ,  2   , -2   ,  0   ,  0   , 0 ,   78    ) 
+   tide_components(18) = tide(  'L2'     , 0.006694 ,    2   ,  2 , -1 ,  2 , -1 ,  0  , +180  ,  2   , -2   ,  0   ,  0   , 0 ,  215    )
+   tide_components(19) = tide(  'T2'     , 0.006614 ,    2   ,  2 ,  0 , -1 ,  0 ,  1  ,    0  ,  0   ,  0   ,  0   ,  0   , 0 ,    0    )
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 10810)
+++ /NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide_mod.F90	(revision 10811)
@@ -21,13 +21,13 @@
    PUBLIC   tide_init
    PUBLIC   tide_harmo       ! called by tideini and diaharm modules
-   PUBLIC   tide_init_Wave   ! called by tideini and diaharm modules
+   PUBLIC   tide_init_components ! called internally and by module diaharm
    PUBLIC   tide_init_load
    PUBLIC   tide_init_potential
    PUBLIC   upd_tide         ! called in dynspg_... modules
 
-   INTEGER, PUBLIC, PARAMETER ::   jpmax_harmo = 19   !: maximum number of harmonic
+   INTEGER, PUBLIC, PARAMETER ::   jpmax_harmo = 64   !: maximum number of harmonic components
 
    TYPE, PUBLIC ::    tide
-      CHARACTER(LEN=4) ::   cname_tide
+      CHARACTER(LEN=4) ::   cname_tide = ''
       REAL(wp)         ::   equitide
       INTEGER          ::   nutide
@@ -37,5 +37,5 @@
    END TYPE tide
 
-   TYPE(tide), PUBLIC, DIMENSION(jpmax_harmo) ::   Wave   !:
+   TYPE(tide), PUBLIC, DIMENSION(:), POINTER ::   tide_components !: Array of selected tidal component parameters
 
    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:) ::   omega_tide   !:
@@ -49,5 +49,5 @@
    LOGICAL , PUBLIC ::   ln_scal_load    !:
    LOGICAL , PUBLIC ::   ln_tide_ramp    !:
-   INTEGER , PUBLIC ::   nb_harmo        !:
+   INTEGER , PUBLIC ::   nb_harmo        !: Number of active tidal components
    INTEGER , PUBLIC ::   kt_tide         !:
    REAL(wp), PUBLIC ::   rn_tide_ramp_dt     !:
@@ -55,6 +55,4 @@
    CHARACTER(lc), PUBLIC ::   cn_tide_load   !: 
    REAL(wp)         ::   rn_tide_gamma   ! Tidal tilt factor
-
-   INTEGER , PUBLIC, ALLOCATABLE, DIMENSION(:) ::   ntide   !:
 
    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   pot_astro !: tidal potential
@@ -79,5 +77,5 @@
       !!----------------------------------------------------------------------      
       INTEGER  :: ji, jk
-      CHARACTER(LEN=4), DIMENSION(jpmax_harmo) :: sn_tide_cnames
+      CHARACTER(LEN=4), DIMENSION(jpmax_harmo) :: sn_tide_cnames ! Names of selected tidal components
       INTEGER  ::   ios                 ! Local integer output status for namelist read
       !
@@ -86,4 +84,7 @@
       !!----------------------------------------------------------------------
       !
+      ! Initialise all array elements of sn_tide_cnames, as some of them
+      ! typically do not appear in namelist_ref or namelist_cfg
+      sn_tide_cnames(:) = ''
       ! Read Namelist nam_tide
       REWIND( numnam_ref )              ! Namelist nam_tide in reference namelist : Tides
@@ -120,12 +121,8 @@
       ENDIF
       !
-      CALL tide_init_Wave
-      !
-      nb_harmo=0
-      DO jk = 1, jpmax_harmo
-         DO ji = 1,jpmax_harmo
-            IF( TRIM(sn_tide_cnames(jk)) == Wave(ji)%cname_tide )   nb_harmo = nb_harmo + 1
-         END DO
-      END DO
+      ! Initialise array of selected tidal components
+      CALL tide_init_components(sn_tide_cnames, tide_components)
+      ! Number of active tidal components
+      nb_harmo = size(tide_components)
       !       
       ! Ensure that tidal components have been set in namelist_cfg
@@ -143,14 +140,4 @@
          &   CALL ctl_stop('rn_tide_ramp_dt must be positive')
       !
-      ALLOCATE( ntide(nb_harmo) )
-      DO jk = 1, nb_harmo
-         DO ji = 1, jpmax_harmo
-            IF( TRIM(sn_tide_cnames(jk)) == Wave(ji)%cname_tide ) THEN
-               ntide(jk) = ji
-               EXIT
-            ENDIF
-         END DO
-      END DO
-      !
       ALLOCATE( omega_tide(nb_harmo), v0tide    (nb_harmo),   &
          &      utide     (nb_harmo), ftide     (nb_harmo)  )
@@ -168,7 +155,56 @@
 
 
-   SUBROUTINE tide_init_Wave
-#     include "tide.h90"
-   END SUBROUTINE tide_init_Wave
+   SUBROUTINE tide_init_components(pcnames, ptide_comp)
+      !!----------------------------------------------------------------------
+      !!                 ***  ROUTINE tide_init_components  ***
+      !!
+      !! Returns pointer to array of variables of type 'tide' that contain
+      !! information about the selected tidal components
+      !! ----------------------------------------------------------------------
+      CHARACTER(LEN=4),              DIMENSION(jpmax_harmo), INTENT(in)  ::   pcnames         ! Names of selected components
+      TYPE(tide),       POINTER,     DIMENSION(:),           INTENT(out) ::   ptide_comp      ! Selected components
+      INTEGER,          ALLOCATABLE, DIMENSION(:)                        ::   kcomppos        ! Indices of selected components
+      INTEGER                                                            ::   kcomp, jk, ji   ! Miscellaneous integers
+      TYPE(tide),       POINTER,     DIMENSION(:)                        ::   tide_components ! All available components
+      
+      ! Populate local array with information about all available tidal
+      ! components
+      !
+      ! Note, here 'tide_components' locally overrides the global module
+      ! variable of the same name to enable the use of the global name in the
+      ! include file that contains the initialisation of elements of array
+      ! 'tide_components'
+      ALLOCATE(tide_components(jpmax_harmo), kcomppos(jpmax_harmo))
+      ! Initialise array of indices of the selected componenents
+      kcomppos(:) = 0
+      ! Include tidal component parameters for all available components
+#include "tide.h90"
+      
+      ! Identify the selected components that are availble
+      kcomp = 0
+      DO jk = 1, jpmax_harmo
+         IF (TRIM(pcnames(jk)) /= '') THEN
+            DO ji = 1, jpmax_harmo
+               IF (TRIM(pcnames(jk)) == tide_components(ji)%cname_tide) THEN
+                  kcomp = kcomp + 1
+                  WRITE(numout, '(10X,"Tidal component #",I2.2,36X,"= ",A4)') kcomp, pcnames(jk)
+                  kcomppos(kcomp) = ji
+                  EXIT
+               END IF
+            END DO
+         END IF
+      END DO
+      
+      ! Allocate and populate reduced list of components
+      ALLOCATE(ptide_comp(kcomp))
+      DO jk = 1, kcomp
+         ptide_comp(jk) = tide_components(kcomppos(jk))
+      END DO
+      
+      ! Release local array of available components and list of selected
+      ! components
+      DEALLOCATE(tide_components, kcomppos)
+      
+   END SUBROUTINE tide_init_components
 
 
@@ -182,5 +218,5 @@
 
       DO jk = 1, nb_harmo
-         zcons = rn_tide_gamma * Wave(ntide(jk))%equitide * ftide(jk)
+         zcons = rn_tide_gamma * tide_components(jk)%equitide * ftide(jk)
          DO ji = 1, jpi
             DO jj = 1, jpj
@@ -189,8 +225,8 @@
                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
+               ztmp = v0tide(jk) + utide(jk) + tide_components(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
+               IF    ( tide_components(jk)%nutide == 1 )  THEN  ;  zcs = zcons * SIN( 2._wp*zlat )
+               ELSEIF( tide_components(jk)%nutide == 2 )  THEN  ;  zcs = zcons * COS( zlat )**2
                ELSE                                         ;  zcs = 0._wp
                ENDIF
@@ -225,6 +261,6 @@
       !
       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(:,:) )
+         CALL iom_get  ( inum, jpdom_data,TRIM(tide_components(itide)%cname_tide)//'_z1', ztr(:,:) )
+         CALL iom_get  ( inum, jpdom_data,TRIM(tide_components(itide)%cname_tide)//'_z2', zti(:,:) )
          !
          DO ji=1,jpi
@@ -241,8 +277,7 @@
 
 
-   SUBROUTINE tide_harmo( pomega, pvt, put , pcor, ktide ,kc)
-      !!----------------------------------------------------------------------
-      !!----------------------------------------------------------------------
-      INTEGER , DIMENSION(kc), INTENT(in ) ::   ktide            ! Indice of tidal constituents
+   SUBROUTINE tide_harmo( pomega, pvt, put , pcor, kc)
+      !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
       INTEGER                , INTENT(in ) ::   kc               ! Total number of tidal constituents
       REAL(wp), DIMENSION(kc), INTENT(out) ::   pomega           ! pulsation in radians/s
@@ -251,6 +286,6 @@
       !
       CALL astronomic_angle
-      CALL tide_pulse( pomega, ktide ,kc )
-      CALL tide_vuf  ( pvt, put, pcor, ktide ,kc )
+      CALL tide_pulse( pomega, kc )
+      CALL tide_vuf  ( pvt, put, pcor, kc )
       !
    END SUBROUTINE tide_harmo
@@ -348,5 +383,5 @@
 
 
-   SUBROUTINE tide_pulse( pomega, ktide ,kc )
+   SUBROUTINE tide_pulse( pomega, kc )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE tide_pulse  ***
@@ -355,5 +390,4 @@
       !!----------------------------------------------------------------------
       INTEGER                , INTENT(in ) ::   kc       ! Total number of tidal constituents
-      INTEGER , DIMENSION(kc), INTENT(in ) ::   ktide    ! Indice of tidal constituents
       REAL(wp), DIMENSION(kc), INTENT(out) ::   pomega   ! pulsation in radians/s
       !
@@ -371,9 +405,9 @@
       !
       DO jh = 1, kc
-         pomega(jh) = (  zomega_T * Wave( ktide(jh) )%nT   &
-            &          + zomega_s * Wave( ktide(jh) )%ns   &
-            &          + zomega_h * Wave( ktide(jh) )%nh   &
-            &          + zomega_p * Wave( ktide(jh) )%np   &
-            &          + zomega_p1* Wave( ktide(jh) )%np1  ) * zscale
+         pomega(jh) = (  zomega_T * tide_components( jh )%nT   &
+            &          + zomega_s * tide_components( jh )%ns   &
+            &          + zomega_h * tide_components( jh )%nh   &
+            &          + zomega_p * tide_components( jh )%np   &
+            &          + zomega_p1* tide_components( jh )%np1  ) * zscale
       END DO
       !
@@ -381,5 +415,5 @@
 
 
-   SUBROUTINE tide_vuf( pvt, put, pcor, ktide ,kc )
+   SUBROUTINE tide_vuf( pvt, put, pcor, kc )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE tide_vuf  ***
@@ -392,5 +426,4 @@
       !!----------------------------------------------------------------------
       INTEGER                , INTENT(in ) ::   kc               ! Total number of tidal constituents
-      INTEGER , DIMENSION(kc), INTENT(in ) ::   ktide            ! Indice of tidal constituents
       REAL(wp), DIMENSION(kc), INTENT(out) ::   pvt, put, pcor   !
       !
@@ -401,20 +434,20 @@
          !  Phase of the tidal potential relative to the Greenwhich 
          !  meridian (e.g. the position of the fictuous celestial body). Units are radian:
-         pvt(jh) = sh_T * Wave( ktide(jh) )%nT    &
-            &    + sh_s * Wave( ktide(jh) )%ns    &
-            &    + sh_h * Wave( ktide(jh) )%nh    &
-            &    + sh_p * Wave( ktide(jh) )%np    &
-            &    + sh_p1* Wave( ktide(jh) )%np1   &
-            &    +        Wave( ktide(jh) )%shift * rad
+         pvt(jh) = sh_T * tide_components( jh )%nT    &
+            &    + sh_s * tide_components( jh )%ns    &
+            &    + sh_h * tide_components( jh )%nh    &
+            &    + sh_p * tide_components( jh )%np    &
+            &    + sh_p1* tide_components( jh )%np1   &
+            &    +        tide_components( jh )%shift * rad
          !
          !  Phase correction u due to nodal motion. Units are radian:
-         put(jh) = sh_xi     * Wave( ktide(jh) )%nksi   &
-            &    + sh_nu     * Wave( ktide(jh) )%nnu0   &
-            &    + sh_nuprim * Wave( ktide(jh) )%nnu1   &
-            &    + sh_nusec  * Wave( ktide(jh) )%nnu2   &
-            &    + sh_R      * Wave( ktide(jh) )%R
+         put(jh) = sh_xi     * tide_components( jh )%nksi   &
+            &    + sh_nu     * tide_components( jh )%nnu0   &
+            &    + sh_nuprim * tide_components( jh )%nnu1   &
+            &    + sh_nusec  * tide_components( jh )%nnu2   &
+            &    + sh_R      * tide_components( jh )%R
 
          !  Nodal correction factor:
-         pcor(jh) = nodal_factort( Wave( ktide(jh) )%nformula )
+         pcor(jh) = nodal_factort( tide_components( jh )%nformula )
       END DO
       !
