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 12250 for NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/BDY/bdytides.F90 – NEMO

Ignore:
Timestamp:
2019-12-14T09:41:16+01:00 (4 years ago)
Author:
smasson
Message:

rev12240_dev_r11943_MERGE_2019: same as [12246], add modifications from dev_r12114_ticket_2263, results unchanged except SPITZ12 as explained in #2263

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/BDY/bdytides.F90

    r12205 r12250  
    269269 
    270270 
    271    SUBROUTINE bdy_dta_tides( kt, kit, kt_offset ) 
     271   SUBROUTINE bdy_dta_tides( kt, kit, pt_offset ) 
    272272      !!---------------------------------------------------------------------- 
    273273      !!                 ***  SUBROUTINE bdy_dta_tides  *** 
     
    278278      INTEGER,           INTENT(in) ::   kt          ! Main timestep counter 
    279279      INTEGER, OPTIONAL, INTENT(in) ::   kit         ! Barotropic timestep counter (for timesplitting option) 
    280       INTEGER, OPTIONAL, INTENT(in) ::   kt_offset   ! time offset in units of timesteps. NB. if kit 
    281       !                                              ! is present then units = subcycle timesteps. 
    282       !                                              ! kt_offset = 0  => get data at "now"    time level 
    283       !                                              ! kt_offset = -1 => get data at "before" time level 
    284       !                                              ! kt_offset = +1 => get data at "after"  time level 
    285       !                                              ! etc. 
     280      REAL(wp),OPTIONAL, INTENT(in) ::   pt_offset   ! time offset in units of timesteps 
    286281      ! 
    287282      LOGICAL  ::   lk_first_btstp            ! =.TRUE. if time splitting and first barotropic step 
    288283      INTEGER  ::   itide, ib_bdy, ib, igrd   ! loop indices 
    289       INTEGER  ::   time_add                  ! time offset in units of timesteps 
    290284      INTEGER, DIMENSION(jpbgrd)   ::   ilen0  
    291285      INTEGER, DIMENSION(1:jpbgrd) ::   nblen, nblenrim  ! short cuts 
    292       REAL(wp) ::   z_arg, z_sarg, zramp, zoff, z_cost, z_sist       
     286      REAL(wp) ::   z_arg, z_sarg, zramp, zoff, z_cost, z_sist, zt_offset    
    293287      !!---------------------------------------------------------------------- 
    294288      ! 
     
    296290      IF ( PRESENT(kit).AND.( kit /= 1 ) ) THEN ; lk_first_btstp=.FALSE. ; ENDIF 
    297291 
    298       time_add = 0 
    299       IF( PRESENT(kt_offset) ) THEN 
    300          time_add = kt_offset 
    301       ENDIF 
     292      zt_offset = 0._wp 
     293      IF( PRESENT(pt_offset) )   zt_offset = pt_offset 
    302294       
    303295      ! Absolute time from model initialization:    
    304296      IF( PRESENT(kit) ) THEN   
    305          z_arg = ( kt + (kit+time_add-1) / REAL(nn_baro,wp) ) * rdt 
     297         z_arg = ( REAL(kt, wp) + ( REAL(kit, wp) + zt_offset - 1. ) / REAL(nn_baro, wp) ) * rdt 
    306298      ELSE                               
    307          z_arg = ( kt + time_add ) * rdt 
     299         z_arg = ( REAL(kt, wp) + zt_offset ) * rdt 
    308300      ENDIF 
    309301 
    310302      ! Linear ramp on tidal component at open boundaries  
    311303      zramp = 1. 
    312       IF (ln_tide_ramp) zramp = MIN(MAX( (z_arg - nit000*rdt)/(rn_tide_ramp_dt*rday),0.),1.) 
     304      IF (ln_tide_ramp) zramp = MIN(MAX( (z_arg - REAL(nit000,wp)*rdt)/(rn_tide_ramp_dt*rday),0.),1.) 
    313305 
    314306      DO ib_bdy = 1,nb_bdy 
     
    327319            IF ( ( nsec_day == NINT(0.5_wp * rdt) .OR. kt==nit000 ) .AND. lk_first_btstp ) THEN 
    328320               ! 
    329                kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt 
     321               kt_tide = kt - NINT((REAL(nsec_day,wp) - 0.5_wp * rdt)/rdt) 
    330322               ! 
    331323               IF(lwp) THEN 
     
    339331               ! 
    340332            ENDIF 
    341             zoff = -kt_tide * rdt ! time offset relative to nodal factor computation time 
     333            zoff = REAL(-kt_tide,wp) * rdt ! time offset relative to nodal factor computation time 
    342334            ! 
    343335            ! If time splitting, initialize arrays from slow varying open boundary data: 
Note: See TracChangeset for help on using the changeset viewer.