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.
Changeset 12078 for NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides – NEMO

Ignore:
Timestamp:
2019-12-05T19:31:55+01:00 (4 years ago)
Author:
smueller
Message:

New version of the modification originally implemented by changeset [10865] and removed by changeset [12037] (ticket #2194)

Location:
NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdydta.F90

    r12065 r12078  
    7575CONTAINS 
    7676 
    77    SUBROUTINE bdy_dta( kt, kit, kt_offset ) 
     77   SUBROUTINE bdy_dta( kt, kt_offset ) 
    7878      !!---------------------------------------------------------------------- 
    7979      !!                   ***  SUBROUTINE bdy_dta  *** 
     
    8585      !!---------------------------------------------------------------------- 
    8686      INTEGER, INTENT(in)           ::   kt           ! ocean time-step index  
    87       INTEGER, INTENT(in), OPTIONAL ::   kit          ! subcycle time-step index (for timesplitting option) 
    88       INTEGER, INTENT(in), OPTIONAL ::   kt_offset    ! time offset in units of timesteps. NB. if kit 
    89       !                                               ! is present then units = subcycle timesteps. 
     87      INTEGER, INTENT(in), OPTIONAL ::   kt_offset    ! time offset in units of timesteps 
    9088      !                                               ! kt_offset = 0 => get data at "now" time level 
    9189      !                                               ! kt_offset = -1 => get data at "before" time level 
     
    105103      ! Initialise data arrays once for all from initial conditions where required 
    106104      !--------------------------------------------------------------------------- 
    107       IF( kt == nit000 .AND. .NOT.PRESENT(kit) ) THEN 
     105      IF( kt == nit000 ) THEN 
    108106 
    109107         ! Calculate depth-mean currents 
     
    216214         ! read/update all bdy data 
    217215         ! ------------------------ 
    218          CALL fld_read( kt, 1, bf_alias, kit = kit, kt_offset = kt_offset ) 
     216         CALL fld_read( kt, 1, bf_alias, kt_offset = kt_offset ) 
    219217 
    220218         ! apply some corrections in some specific cases... 
     
    275273            END DO 
    276274         ENDIF   ! ltotvel 
    277  
    278          ! update tidal harmonic forcing 
    279          IF( PRESENT(kit) .AND. nn_dyn2d_dta(jbdy) .GE. 2 ) THEN 
    280             CALL bdytide_update( kt = kt, idx = idx_bdy(jbdy), dta = dta_alias, td = tides(jbdy),   &  
    281                &                 kit = kit, kt_offset = kt_offset ) 
    282          ENDIF 
    283275 
    284276         !  atm surface pressure : add inverted barometer effect to ssh if it was read 
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdytides.F90

    r12065 r12078  
    3030 
    3131   PUBLIC   bdytide_init     ! routine called in bdy_init 
    32    PUBLIC   bdytide_update   ! routine called in bdy_dta 
    3332   PUBLIC   bdy_dta_tides    ! routine called in dyn_spg_ts 
    3433 
     
    256255 
    257256 
    258    SUBROUTINE bdytide_update( kt, idx, dta, td, kit, kt_offset ) 
    259       !!---------------------------------------------------------------------- 
    260       !!                 ***  SUBROUTINE bdytide_update  *** 
    261       !!                 
    262       !! ** Purpose : - Add tidal forcing to ssh, u2d and v2d OBC data arrays.  
    263       !!                 
    264       !!---------------------------------------------------------------------- 
    265       INTEGER          , INTENT(in   ) ::   kt          ! Main timestep counter 
    266       TYPE(OBC_INDEX)  , INTENT(in   ) ::   idx         ! OBC indices 
    267       TYPE(OBC_DATA)   , INTENT(inout) ::   dta         ! OBC external data 
    268       TYPE(TIDES_DATA) , INTENT(inout) ::   td          ! tidal harmonics data 
    269       INTEGER, OPTIONAL, INTENT(in   ) ::   kit         ! Barotropic timestep counter (for timesplitting option) 
    270       INTEGER, OPTIONAL, INTENT(in   ) ::   kt_offset   ! time offset in units of timesteps. NB. if kit 
    271       !                                                 ! is present then units = subcycle timesteps. 
    272       !                                                 ! kt_offset = 0  => get data at "now"    time level 
    273       !                                                 ! kt_offset = -1 => get data at "before" time level 
    274       !                                                 ! kt_offset = +1 => get data at "after"  time level 
    275       !                                                 ! etc. 
    276       ! 
    277       INTEGER  ::   itide, igrd, ib       ! dummy loop indices 
    278       INTEGER  ::   time_add              ! time offset in units of timesteps 
    279       INTEGER, DIMENSION(3) ::   ilen0    ! length of boundary data (from OBC arrays) 
    280       REAL(wp) ::   z_arg, z_sarg, zflag, zramp   ! local scalars     
    281       REAL(wp), DIMENSION(jpmax_harmo) :: z_sist, z_cost 
    282       !!---------------------------------------------------------------------- 
    283       ! 
    284       ilen0(1) =  SIZE(td%ssh(:,1,1)) 
    285       ilen0(2) =  SIZE(td%u(:,1,1)) 
    286       ilen0(3) =  SIZE(td%v(:,1,1)) 
    287  
    288       zflag=1 
    289       IF ( PRESENT(kit) ) THEN 
    290         IF ( kit /= 1 ) zflag=0 
    291       ENDIF 
    292  
    293       IF ( (nsec_day == NINT(0.5_wp * rdt) .OR. kt==nit000) .AND. zflag==1 ) THEN 
    294         ! 
    295         kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt 
    296         ! 
    297         IF(lwp) THEN 
    298            WRITE(numout,*) 
    299            WRITE(numout,*) 'bdytide_update : (re)Initialization of the tidal bdy forcing at kt=',kt 
    300            WRITE(numout,*) '~~~~~~~~~~~~~~ ' 
    301         ENDIF 
    302         ! 
    303         CALL tide_init_elevation ( idx, td ) 
    304         CALL tide_init_velocities( idx, td ) 
    305         ! 
    306       ENDIF  
    307  
    308       time_add = 0 
    309       IF( PRESENT(kt_offset) ) THEN 
    310          time_add = kt_offset 
    311       ENDIF 
    312           
    313       IF( PRESENT(kit) ) THEN   
    314          z_arg = ((kt-kt_tide) * rdt + (kit+0.5_wp*(time_add-1)) * rdt / REAL(nn_baro,wp) ) 
    315       ELSE                               
    316          z_arg = ((kt-kt_tide)+time_add) * rdt 
    317       ENDIF 
    318  
    319       ! Linear ramp on tidal component at open boundaries  
    320       zramp = 1._wp 
    321       IF (ln_tide_ramp) zramp = MIN(MAX( (z_arg + (kt_tide-nit000)*rdt)/(rn_tide_ramp_dt*rday),0._wp),1._wp) 
    322  
    323       DO itide = 1, nb_harmo 
    324          z_sarg = z_arg * tide_harmonics(itide)%omega 
    325          z_cost(itide) = COS( z_sarg ) 
    326          z_sist(itide) = SIN( z_sarg ) 
    327       END DO 
    328  
    329       DO itide = 1, nb_harmo 
    330          igrd=1                              ! SSH on tracer grid 
    331          DO ib = 1, ilen0(igrd) 
    332             dta%ssh(ib) = dta%ssh(ib) + zramp*(td%ssh(ib,itide,1)*z_cost(itide) + td%ssh(ib,itide,2)*z_sist(itide)) 
    333          END DO 
    334          igrd=2                              ! U grid 
    335          DO ib = 1, ilen0(igrd) 
    336             dta%u2d(ib) = dta%u2d(ib) + zramp*(td%u  (ib,itide,1)*z_cost(itide) + td%u  (ib,itide,2)*z_sist(itide)) 
    337          END DO 
    338          igrd=3                              ! V grid 
    339          DO ib = 1, ilen0(igrd)  
    340             dta%v2d(ib) = dta%v2d(ib) + zramp*(td%v  (ib,itide,1)*z_cost(itide) + td%v  (ib,itide,2)*z_sist(itide)) 
    341          END DO 
    342       END DO 
    343       ! 
    344    END SUBROUTINE bdytide_update 
    345  
    346  
    347257   SUBROUTINE bdy_dta_tides( kt, kit, kt_offset ) 
    348258      !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.