- Timestamp:
- 2015-12-16T10:25:22+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90
r5930 r6060 15 15 !! 'key_bdy' Open Boundary Condition 16 16 !!---------------------------------------------------------------------- 17 !! PUBLIC 18 !! bdytide_init : read of namelist and initialisation of tidal harmonics data 19 !! tide_update : calculation of tidal forcing at each timestep 20 !!---------------------------------------------------------------------- 21 USE timing ! Timing 22 USE oce ! ocean dynamics and tracers 23 USE dom_oce ! ocean space and time domain 24 USE iom 25 USE in_out_manager ! I/O units 26 USE phycst ! physical constants 27 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 28 USE bdy_par ! Unstructured boundary parameters 29 USE bdy_oce ! ocean open boundary conditions 30 USE daymod ! calendar 31 USE wrk_nemo ! Memory allocation 32 USE tideini 33 ! USE tide_mod ! Useless ?? 34 USE fldread 17 !! bdytide_init : read of namelist and initialisation of tidal harmonics data 18 !! tide_update : calculation of tidal forcing at each timestep 19 !!---------------------------------------------------------------------- 20 USE oce ! ocean dynamics and tracers 21 USE dom_oce ! ocean space and time domain 22 USE phycst ! physical constants 23 USE bdy_par ! Unstructured boundary parameters 24 USE bdy_oce ! ocean open boundary conditions 25 USE tideini ! 26 USE daymod ! calendar 27 ! 28 USE in_out_manager ! I/O units 29 USE iom ! xIO server 30 USE fldread ! 31 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 32 USE wrk_nemo ! Memory allocation 33 USE timing ! timing 35 34 36 35 IMPLICIT NONE … … 42 41 43 42 TYPE, PUBLIC :: TIDES_DATA !: Storage for external tidal harmonics data 44 REAL(wp), POINTER, DIMENSION(:,:,:) :: ssh0 !: Tidal constituents : SSH0 (read in file) 45 REAL(wp), POINTER, DIMENSION(:,:,:) :: u0 !: Tidal constituents : U0 (read in file) 46 REAL(wp), POINTER, DIMENSION(:,:,:) :: v0 !: Tidal constituents : V0 (read in file) 47 REAL(wp), POINTER, DIMENSION(:,:,:) :: ssh !: Tidal constituents : SSH (after nodal cor.) 48 REAL(wp), POINTER, DIMENSION(:,:,:) :: u !: Tidal constituents : U (after nodal cor.) 49 REAL(wp), POINTER, DIMENSION(:,:,:) :: v !: Tidal constituents : V (after nodal cor.) 43 REAL(wp), POINTER, DIMENSION(:,:,:) :: ssh0 !: Tidal constituents : SSH0 (read in file) 44 REAL(wp), POINTER, DIMENSION(:,:,:) :: u0, v0 !: Tidal constituents : U0, V0 (read in file) 45 REAL(wp), POINTER, DIMENSION(:,:,:) :: ssh !: Tidal constituents : SSH (after nodal cor.) 46 REAL(wp), POINTER, DIMENSION(:,:,:) :: u , v !: Tidal constituents : U , V (after nodal cor.) 50 47 END TYPE TIDES_DATA 51 48 … … 91 88 NAMELIST/nambdy_tide/filtide, ln_bdytide_2ddta, ln_bdytide_conj 92 89 !!---------------------------------------------------------------------- 93 94 IF( nn_timing == 1 ) CALL timing_start('bdytide_init')95 90 ! 91 IF( nn_timing == 1 ) CALL timing_start('bdytide_init') 92 ! 96 93 IF (nb_bdy>0) THEN 97 94 IF(lwp) WRITE(numout,*) … … 263 260 ENDIF ! ln_bdytide_2ddta=.true. 264 261 ! 265 IF ( ln_bdytide_conj ) THEN! assume complex conjugate in data files262 IF( ln_bdytide_conj ) THEN ! assume complex conjugate in data files 266 263 td%ssh0(:,:,2) = - td%ssh0(:,:,2) 267 264 td%u0 (:,:,2) = - td%u0 (:,:,2) … … 274 271 ALLOCATE( dta_bdy_s(ib_bdy)%u2d ( ilen0(2) ) ) 275 272 ALLOCATE( dta_bdy_s(ib_bdy)%v2d ( ilen0(3) ) ) 276 dta_bdy_s(ib_bdy)%ssh(:) = 0. e0277 dta_bdy_s(ib_bdy)%u2d(:) = 0. e0278 dta_bdy_s(ib_bdy)%v2d(:) = 0. e0273 dta_bdy_s(ib_bdy)%ssh(:) = 0._wp 274 dta_bdy_s(ib_bdy)%u2d(:) = 0._wp 275 dta_bdy_s(ib_bdy)%v2d(:) = 0._wp 279 276 ! 280 277 ENDIF ! nn_dyn2d_dta(ib_bdy) .ge. 2 281 278 ! 282 279 END DO ! loop on ib_bdy 283 284 IF( nn_timing == 1 ) CALL timing_stop('bdytide_init')285 280 ! 281 IF( nn_timing == 1 ) CALL timing_stop('bdytide_init') 282 ! 286 283 END SUBROUTINE bdytide_init 287 284 288 SUBROUTINE bdytide_update ( kt, idx, dta, td, jit, time_offset ) 285 286 SUBROUTINE bdytide_update( kt, idx, dta, td, jit, time_offset ) 289 287 !!---------------------------------------------------------------------- 290 288 !! *** SUBROUTINE bdytide_update *** … … 293 291 !! 294 292 !!---------------------------------------------------------------------- 295 INTEGER , INTENT( in ):: kt ! Main timestep counter296 TYPE(OBC_INDEX) , INTENT( in ):: idx ! OBC indices297 TYPE(OBC_DATA) , INTENT(inout):: dta ! OBC external data298 TYPE(TIDES_DATA) ,INTENT( inout) :: td ! tidal harmonics data299 INTEGER, INTENT(in),OPTIONAL:: jit ! Barotropic timestep counter (for timesplitting option)300 INTEGER, INTENT( in ), OPTIONAL:: time_offset ! time offset in units of timesteps. NB. if jit301 302 303 304 305 306 ! !307 INTEGER , DIMENSION(3) :: ilen0 !: length of boundary data (from OBC arrays)308 INTEGER :: itide, igrd, ib ! dummy loop indices309 INTEGER :: time_add ! time offset in units of timesteps310 REAL(wp) :: z_arg, z_sarg, zflag, zramp293 INTEGER , INTENT(in ) :: kt ! Main timestep counter 294 TYPE(OBC_INDEX) , INTENT(in ) :: idx ! OBC indices 295 TYPE(OBC_DATA) , INTENT(inout) :: dta ! OBC external data 296 TYPE(TIDES_DATA) , INTENT(inout) :: td ! tidal harmonics data 297 INTEGER, OPTIONAL, INTENT(in ) :: jit ! Barotropic timestep counter (for timesplitting option) 298 INTEGER, OPTIONAL, INTENT(in ) :: time_offset ! time offset in units of timesteps. NB. if jit 299 ! ! is present then units = subcycle timesteps. 300 ! ! time_offset = 0 => get data at "now" time level 301 ! ! time_offset = -1 => get data at "before" time level 302 ! ! time_offset = +1 => get data at "after" time level 303 ! ! etc. 304 ! 305 INTEGER :: itide, igrd, ib ! dummy loop indices 306 INTEGER :: time_add ! time offset in units of timesteps 307 INTEGER, DIMENSION(3) :: ilen0 ! length of boundary data (from OBC arrays) 308 REAL(wp) :: z_arg, z_sarg, zflag, zramp ! local scalars 311 309 REAL(wp), DIMENSION(jpmax_harmo) :: z_sist, z_cost 312 310 !!---------------------------------------------------------------------- 313 314 IF( nn_timing == 1 ) CALL timing_start('bdytide_update')315 311 ! 312 IF( nn_timing == 1 ) CALL timing_start('bdytide_update') 313 ! 316 314 ilen0(1) = SIZE(td%ssh(:,1,1)) 317 315 ilen0(2) = SIZE(td%u(:,1,1)) … … 374 372 END DO 375 373 ! 376 IF( nn_timing == 1 ) CALL timing_stop('bdytide_update')374 IF( nn_timing == 1 ) CALL timing_stop('bdytide_update') 377 375 ! 378 376 END SUBROUTINE bdytide_update 377 379 378 380 379 SUBROUTINE bdy_dta_tides( kt, kit, time_offset ) … … 385 384 !! 386 385 !!---------------------------------------------------------------------- 387 INTEGER, INTENT( in ):: kt ! Main timestep counter388 INTEGER, INTENT( in ),OPTIONAL:: kit ! Barotropic timestep counter (for timesplitting option)389 INTEGER, INTENT( in ),OPTIONAL:: time_offset ! time offset in units of timesteps. NB. if kit390 391 392 393 394 395 ! !396 LOGICAL :: lk_first_btstp! =.TRUE. if time splitting and first barotropic step397 INTEGER , DIMENSION(jpbgrd) :: ilen0398 INTEGER , DIMENSION(1:jpbgrd) :: nblen, nblenrim ! short cuts399 INTEGER :: itide, ib_bdy, ib, igrd ! loop indices400 INTEGER :: time_add ! time offset in units of timesteps401 REAL(wp) :: z_arg, z_sarg, zramp, zoff, z_cost, z_sist402 !!---------------------------------------------------------------------- 403 404 IF( nn_timing == 1 ) CALL timing_start('bdy_dta_tides')405 386 INTEGER, INTENT(in) :: kt ! Main timestep counter 387 INTEGER, OPTIONAL, INTENT(in) :: kit ! Barotropic timestep counter (for timesplitting option) 388 INTEGER, OPTIONAL, INTENT(in) :: time_offset ! time offset in units of timesteps. NB. if kit 389 ! ! is present then units = subcycle timesteps. 390 ! ! time_offset = 0 => get data at "now" time level 391 ! ! time_offset = -1 => get data at "before" time level 392 ! ! time_offset = +1 => get data at "after" time level 393 ! ! etc. 394 ! 395 LOGICAL :: lk_first_btstp ! =.TRUE. if time splitting and first barotropic step 396 INTEGER :: itide, ib_bdy, ib, igrd ! loop indices 397 INTEGER :: time_add ! time offset in units of timesteps 398 INTEGER, DIMENSION(jpbgrd) :: ilen0 399 INTEGER, DIMENSION(1:jpbgrd) :: nblen, nblenrim ! short cuts 400 REAL(wp) :: z_arg, z_sarg, zramp, zoff, z_cost, z_sist 401 !!---------------------------------------------------------------------- 402 ! 403 IF( nn_timing == 1 ) CALL timing_start('bdy_dta_tides') 404 ! 406 405 lk_first_btstp=.TRUE. 407 406 IF ( PRESENT(kit).AND.( kit /= 1 ) ) THEN ; lk_first_btstp=.FALSE. ; ENDIF … … 502 501 END SUBROUTINE bdy_dta_tides 503 502 503 504 504 SUBROUTINE tide_init_elevation( idx, td ) 505 505 !!---------------------------------------------------------------------- 506 506 !! *** ROUTINE tide_init_elevation *** 507 507 !!---------------------------------------------------------------------- 508 TYPE(OBC_INDEX), INTENT( in ) :: idx ! OBC indices 509 TYPE(TIDES_DATA),INTENT( inout ) :: td ! tidal harmonics data 510 !! * Local declarations 511 INTEGER, DIMENSION(1) :: ilen0 !: length of boundary data (from OBC arrays) 508 TYPE(OBC_INDEX) , INTENT(in ) :: idx ! OBC indices 509 TYPE(TIDES_DATA), INTENT(inout) :: td ! tidal harmonics data 510 ! 511 INTEGER :: itide, igrd, ib ! dummy loop indices 512 INTEGER, DIMENSION(1) :: ilen0 ! length of boundary data (from OBC arrays) 512 513 REAL(wp),ALLOCATABLE, DIMENSION(:) :: mod_tide, phi_tide 513 INTEGER :: itide, igrd, ib ! dummy loop indices514 514 !!---------------------------------------------------------------------- 515 ! 515 516 igrd=1 516 517 ! SSH on tracer grid. 517 518 518 ilen0(1) = SIZE(td%ssh0(:,1,1)) 519 520 ALLOCATE( mod_tide(ilen0(igrd)),phi_tide(ilen0(igrd)))521 519 ! 520 ALLOCATE( mod_tide(ilen0(igrd)), phi_tide(ilen0(igrd)) ) 521 ! 522 522 DO itide = 1, nb_harmo 523 523 DO ib = 1, ilen0(igrd) … … 534 534 ENDDO 535 535 END DO 536 537 DEALLOCATE( mod_tide,phi_tide)538 536 ! 537 DEALLOCATE( mod_tide, phi_tide ) 538 ! 539 539 END SUBROUTINE tide_init_elevation 540 540 541 541 542 SUBROUTINE tide_init_velocities( idx, td ) 542 543 !!---------------------------------------------------------------------- 543 544 !! *** ROUTINE tide_init_elevation *** 544 545 !!---------------------------------------------------------------------- 545 TYPE(OBC_INDEX), INTENT( in ) :: idx ! OBC indices 546 TYPE(TIDES_DATA),INTENT( inout ) :: td ! tidal harmonics data 547 !! * Local declarations 548 INTEGER, DIMENSION(3) :: ilen0 !: length of boundary data (from OBC arrays) 546 TYPE(OBC_INDEX) , INTENT(in ) :: idx ! OBC indices 547 TYPE(TIDES_DATA), INTENT(inout) :: td ! tidal harmonics data 548 ! 549 INTEGER :: itide, igrd, ib ! dummy loop indices 550 INTEGER, DIMENSION(3) :: ilen0 ! length of boundary data (from OBC arrays) 549 551 REAL(wp),ALLOCATABLE, DIMENSION(:) :: mod_tide, phi_tide 550 INTEGER :: itide, igrd, ib ! dummy loop indices551 552 !!---------------------------------------------------------------------- 553 ! 552 554 ilen0(2) = SIZE(td%u0(:,1,1)) 553 555 ilen0(3) = SIZE(td%v0(:,1,1)) 554 556 ! 555 557 igrd=2 ! U grid. 556 557 ALLOCATE( mod_tide(ilen0(igrd)),phi_tide(ilen0(igrd)))558 558 ! 559 ALLOCATE( mod_tide(ilen0(igrd)) , phi_tide(ilen0(igrd)) ) 560 ! 559 561 DO itide = 1, nb_harmo 560 562 DO ib = 1, ilen0(igrd) … … 571 573 ENDDO 572 574 END DO 573 574 DEALLOCATE( mod_tide,phi_tide)575 575 ! 576 DEALLOCATE( mod_tide , phi_tide ) 577 ! 576 578 igrd=3 ! V grid. 577 578 ALLOCATE( mod_tide(ilen0(igrd)),phi_tide(ilen0(igrd)))579 ! 580 ALLOCATE( mod_tide(ilen0(igrd)) , phi_tide(ilen0(igrd)) ) 579 581 580 582 DO itide = 1, nb_harmo … … 592 594 ENDDO 593 595 END DO 594 595 DEALLOCATE( mod_tide,phi_tide)596 596 ! 597 DEALLOCATE( mod_tide, phi_tide ) 598 ! 597 599 END SUBROUTINE tide_init_velocities 600 598 601 #else 599 602 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.