- Timestamp:
- 2011-09-27T14:33:01+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obctides.F90
r2814 r2865 94 94 REWIND(numnam) 95 95 DO ib_obc = 1, nb_obc 96 IF( nn_ tides(ib_obc) .gt. 0) THEN96 IF( nn_dyn2d_dta(ib_obc) .ge. 2 ) THEN 97 97 98 98 td => tides(ib_obc) … … 260 260 ENDIF ! date correction 261 261 ! 262 ENDIF ! nn_ tides .gt. 0262 ENDIF ! nn_dyn2d_dta(ib_obc) .ge. 2 263 263 ! 264 264 END DO ! loop on ib_obc … … 267 267 268 268 269 SUBROUTINE tide_update ( kt, jit, idx, dta, td)269 SUBROUTINE tide_update ( kt, idx, dta, td, jit, time_offset ) 270 270 !!---------------------------------------------------------------------- 271 271 !! *** SUBROUTINE tide_update *** … … 276 276 INTEGER, INTENT( in ) :: kt ! Main timestep counter 277 277 !!gm doctor jit ==> kit 278 INTEGER, INTENT( in ) :: jit ! Barotropic timestep counter (for timesplitting option)279 278 TYPE(OBC_INDEX), INTENT( in ) :: idx ! OBC indices 280 279 TYPE(OBC_DATA), INTENT(inout) :: dta ! OBC external data 281 280 TYPE(TIDES_DATA),INTENT( in ) :: td ! tidal harmonics data 281 INTEGER,INTENT(in),OPTIONAL :: jit ! Barotropic timestep counter (for timesplitting option) 282 INTEGER,INTENT( in ), OPTIONAL :: time_offset ! time offset in units of timesteps. NB. if jit 283 ! is present then units = subcycle timesteps. 284 ! time_offset = 0 => get data at "now" time level 285 ! time_offset = -1 => get data at "before" time level 286 ! time_offset = +1 => get data at "after" time level 287 ! etc. 282 288 !! 283 289 INTEGER :: itide, igrd, ib ! dummy loop indices 290 INTEGER :: time_add ! time offset in units of timesteps 284 291 REAL(wp) :: z_arg, z_sarg 285 292 REAL(wp), DIMENSION(jptides_max) :: z_sist, z_cost 286 293 !!---------------------------------------------------------------------- 287 294 295 time_add = 0 296 IF( PRESENT(time_offset) ) THEN 297 time_add = time_offset 298 ENDIF 299 288 300 ! Note tide phase speeds are in deg/hour, so we need to convert the 289 301 ! elapsed time in seconds to hours by dividing by 3600.0 290 IF( jit == 0 ) THEN 291 z_arg = kt * rdt * rad / 3600.0 292 ELSE ! we are in a barotropic subcycle (for timesplitting option) 293 ! z_arg = ( (kt-1) * rdt + jit * rdt / REAL(nn_baro,lwp) ) * rad / 3600.0 294 z_arg = ( (kt-1) * rdt + jit * rdt / REAL(nn_baro,wp) ) * rad / 3600.0 302 IF( PRESENT(jit) ) THEN 303 z_arg = ( (kt-1) * rdt + (jit+time_add) * rdt / REAL(nn_baro,wp) ) * rad / 3600.0 304 ELSE 305 z_arg = (kt+time_add) * rdt * rad / 3600.0 295 306 ENDIF 296 307 … … 301 312 END DO 302 313 303 !304 314 DO itide = 1, td%ncpt 305 315 igrd=1 ! SSH on tracer grid.
Note: See TracChangeset
for help on using the changeset viewer.