- Timestamp:
- 2019-12-14T09:41:16+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/BDY/bdytides.F90
r12205 r12250 269 269 270 270 271 SUBROUTINE bdy_dta_tides( kt, kit, kt_offset )271 SUBROUTINE bdy_dta_tides( kt, kit, pt_offset ) 272 272 !!---------------------------------------------------------------------- 273 273 !! *** SUBROUTINE bdy_dta_tides *** … … 278 278 INTEGER, INTENT(in) :: kt ! Main timestep counter 279 279 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 286 281 ! 287 282 LOGICAL :: lk_first_btstp ! =.TRUE. if time splitting and first barotropic step 288 283 INTEGER :: itide, ib_bdy, ib, igrd ! loop indices 289 INTEGER :: time_add ! time offset in units of timesteps290 284 INTEGER, DIMENSION(jpbgrd) :: ilen0 291 285 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 293 287 !!---------------------------------------------------------------------- 294 288 ! … … 296 290 IF ( PRESENT(kit).AND.( kit /= 1 ) ) THEN ; lk_first_btstp=.FALSE. ; ENDIF 297 291 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 302 294 303 295 ! Absolute time from model initialization: 304 296 IF( PRESENT(kit) ) THEN 305 z_arg = ( kt + (kit+time_add-1) / REAL(nn_baro,wp) ) * rdt297 z_arg = ( REAL(kt, wp) + ( REAL(kit, wp) + zt_offset - 1. ) / REAL(nn_baro, wp) ) * rdt 306 298 ELSE 307 z_arg = ( kt + time_add) * rdt299 z_arg = ( REAL(kt, wp) + zt_offset ) * rdt 308 300 ENDIF 309 301 310 302 ! Linear ramp on tidal component at open boundaries 311 303 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.) 313 305 314 306 DO ib_bdy = 1,nb_bdy … … 327 319 IF ( ( nsec_day == NINT(0.5_wp * rdt) .OR. kt==nit000 ) .AND. lk_first_btstp ) THEN 328 320 ! 329 kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt321 kt_tide = kt - NINT((REAL(nsec_day,wp) - 0.5_wp * rdt)/rdt) 330 322 ! 331 323 IF(lwp) THEN … … 339 331 ! 340 332 ENDIF 341 zoff = -kt_tide* rdt ! time offset relative to nodal factor computation time333 zoff = REAL(-kt_tide,wp) * rdt ! time offset relative to nodal factor computation time 342 334 ! 343 335 ! If time splitting, initialize arrays from slow varying open boundary data:
Note: See TracChangeset
for help on using the changeset viewer.