New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
updtide.F90 in branches/2013/dev_r3858_NOC_ZTC/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

source: branches/2013/dev_r3858_NOC_ZTC/NEMOGCM/NEMO/OPA_SRC/SBC/updtide.F90 @ 3953

Last change on this file since 3953 was 3953, checked in by gm, 11 years ago

dev_r3858_NOC_ZTC, #863 : activate tide potential in filtered ssh case + style in tide modules

File size: 3.8 KB
Line 
1MODULE updtide
2   !!======================================================================
3   !!                       ***  MODULE  updtide  ***
4   !! Initialization of tidal forcing
5   !!======================================================================
6   !! History :  9.0  !  07  (O. Le Galloudec)  Original code
7   !!----------------------------------------------------------------------
8#if defined key_tide
9   !!----------------------------------------------------------------------
10   !!   'key_tide' :                                        tidal potential
11   !!----------------------------------------------------------------------
12   !!   upd_tide       : update tidal potential
13   !!----------------------------------------------------------------------
14   USE oce             ! ocean dynamics and tracers variables
15   USE dom_oce         ! ocean space and time domain
16   USE in_out_manager  ! I/O units
17   USE phycst          ! physical constant
18   USE sbctide         ! tide potential variable
19   USE tideini, ONLY: ln_tide_ramp, rdttideramp
20
21   IMPLICIT NONE
22   PUBLIC
23
24   PUBLIC   upd_tide   ! called in dynspg_... modules
25 
26   !!----------------------------------------------------------------------
27   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
28   !! $Id: sbcfwb.F90 3625 2012-11-21 13:19:18Z acc $
29   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
30   !!----------------------------------------------------------------------
31CONTAINS
32
33   SUBROUTINE upd_tide( kt, kit, kbaro )
34      !!----------------------------------------------------------------------
35      !!                 ***  ROUTINE upd_tide  ***
36      !!
37      !! ** Purpose :   provide at each time step the astronomical potential
38      !!
39      !! ** Method  :   computed from pulsation and amplitude of all tide components
40      !!
41      !! ** Action  :   pot_astro   actronomical potential
42      !!----------------------------------------------------------------------     
43      INTEGER, INTENT(in)           ::   kt      ! ocean time-step index
44      INTEGER, INTENT(in), OPTIONAL ::   kit     ! external mode sub-time-step index (lk_dynspg_ts=T only)
45      INTEGER, INTENT(in), OPTIONAL ::   kbaro   ! number of sub-time-step           (lk_dynspg_ts=T only)
46      !
47      INTEGER  ::   ji, jj, jk   ! dummy loop indices
48      REAL(wp) ::   zt, zramp    ! local scalar
49      REAL(wp), DIMENSION(nb_harmo) ::   zwt 
50      !!----------------------------------------------------------------------     
51      !
52      !                               ! tide pulsation at model time step (or sub-time-step)
53      zt = ( kt - kt_tide ) * rdt
54      IF( PRESENT( kit ) .AND. PRESENT( kbaro ) )   zt = zt + kit * rdt / REAL( kbaro, wp )
55      zwt(:) = omega_tide(:) * zt
56
57      pot_astro(:,:) = 0._wp          ! update tidal potential (sum of all harmonics)
58      DO jk = 1, nb_harmo   
59         pot_astro(:,:) = pot_astro(:,:) + amp_pot(:,:,jk) * COS( zwt(jk) + phi_pot(:,:,jk) )     
60      END DO
61      !
62      IF( ln_tide_ramp ) THEN         ! linear increase if asked
63         zt = ( kt - nit000 ) * rdt
64         IF( PRESENT( kit ) .AND. PRESENT( kbaro ) )   zt = zt + kit * rdt / REAL( kbaro, wp )
65         zramp = MIN(  MAX( zt / (rdttideramp*rday) , 0._wp ) , 1._wp  )
66         pot_astro(:,:) = zramp * pot_astro(:,:)
67      ENDIF
68      !
69   END SUBROUTINE upd_tide
70
71#else
72  !!----------------------------------------------------------------------
73  !!   Dummy module :                                        NO TIDE
74  !!----------------------------------------------------------------------
75CONTAINS
76  SUBROUTINE upd_tide( kt,kit )          ! Empty routine
77    INTEGER,INTENT (IN) :: kt, kit
78    WRITE(*,*) 'upd_tide: You should not have seen this print! error?', kt
79  END SUBROUTINE upd_tide
80
81#endif
82
83  !!======================================================================
84
85END MODULE updtide
Note: See TracBrowser for help on using the repository browser.