Changeset 6225 for branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90
- Timestamp:
- 2016-01-08T10:35:19+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90
r4624 r6225 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, ONLY: fld_map 35 USE dynspg_oce, ONLY: lk_dynspg_ts 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 36 34 37 35 IMPLICIT NONE … … 43 41 44 42 TYPE, PUBLIC :: TIDES_DATA !: Storage for external tidal harmonics data 45 REAL(wp), POINTER, DIMENSION(:,:,:) :: ssh0 !: Tidal constituents : SSH0 (read in file) 46 REAL(wp), POINTER, DIMENSION(:,:,:) :: u0 !: Tidal constituents : U0 (read in file) 47 REAL(wp), POINTER, DIMENSION(:,:,:) :: v0 !: Tidal constituents : V0 (read in file) 48 REAL(wp), POINTER, DIMENSION(:,:,:) :: ssh !: Tidal constituents : SSH (after nodal cor.) 49 REAL(wp), POINTER, DIMENSION(:,:,:) :: u !: Tidal constituents : U (after nodal cor.) 50 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.) 51 47 END TYPE TIDES_DATA 52 48 … … 54 50 TYPE(TIDES_DATA), PUBLIC, DIMENSION(jp_bdy), TARGET :: tides !: External tidal harmonics data 55 51 !$AGRIF_END_DO_NOT_TREAT 56 TYPE(OBC_DATA) , P RIVATE, DIMENSION(jp_bdy) :: dta_bdy_s !: bdy external data (slow component)52 TYPE(OBC_DATA) , PUBLIC, DIMENSION(jp_bdy) :: dta_bdy_s !: bdy external data (slow component) 57 53 58 54 !!---------------------------------------------------------------------- 59 55 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 60 !! $Id$ 56 !! $Id$ 61 57 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 62 58 !!---------------------------------------------------------------------- … … 88 84 !! 89 85 TYPE(TIDES_DATA), POINTER :: td !: local short cut 86 TYPE(MAP_POINTER), DIMENSION(jpbgrd) :: ibmap_ptr !: array of pointers to nbmap 90 87 !! 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,*) … … 125 122 IF(lwp) WRITE(numout,*) ' Number of tidal components to read: ', nb_harmo 126 123 IF(lwp) THEN 127 WRITE(numout,*) ' Tidal c pt name - Phase speed (deg/hr)'124 WRITE(numout,*) ' Tidal components: ' 128 125 DO itide = 1, nb_harmo 129 WRITE(numout,*) ' ', Wave(ntide(itide))%cname_tide, omega_tide(itide)126 WRITE(numout,*) ' ', Wave(ntide(itide))%cname_tide 130 127 END DO 131 128 ENDIF … … 220 217 ! 221 218 ALLOCATE( dta_read( MAXVAL(ilen0(1:3)), 1, 1 ) ) 219 ! 220 ! Set map structure 221 ibmap_ptr(1)%ptr => idx_bdy(ib_bdy)%nbmap(:,1) 222 ibmap_ptr(1)%ll_unstruc = ln_coords_file(ib_bdy) 223 ibmap_ptr(2)%ptr => idx_bdy(ib_bdy)%nbmap(:,2) 224 ibmap_ptr(2)%ll_unstruc = ln_coords_file(ib_bdy) 225 ibmap_ptr(3)%ptr => idx_bdy(ib_bdy)%nbmap(:,3) 226 ibmap_ptr(3)%ll_unstruc = ln_coords_file(ib_bdy) 222 227 223 228 ! Open files and read in tidal forcing data … … 228 233 clfile = TRIM(filtide)//TRIM(Wave(ntide(itide))%cname_tide)//'_grid_T.nc' 229 234 CALL iom_open( clfile, inum ) 230 CALL fld_map( inum, 'z1' , dta_read(1:ilen0(1),1:1,1:1) , 1, idx_bdy(ib_bdy)%nbmap(:,1) )235 CALL fld_map( inum, 'z1' , dta_read(1:ilen0(1),1:1,1:1) , 1, ibmap_ptr(1) ) 231 236 td%ssh0(:,itide,1) = dta_read(1:ilen0(1),1,1) 232 CALL fld_map( inum, 'z2' , dta_read(1:ilen0(1),1:1,1:1) , 1, idx_bdy(ib_bdy)%nbmap(:,1) )237 CALL fld_map( inum, 'z2' , dta_read(1:ilen0(1),1:1,1:1) , 1, ibmap_ptr(1) ) 233 238 td%ssh0(:,itide,2) = dta_read(1:ilen0(1),1,1) 234 239 CALL iom_close( inum ) … … 236 241 clfile = TRIM(filtide)//TRIM(Wave(ntide(itide))%cname_tide)//'_grid_U.nc' 237 242 CALL iom_open( clfile, inum ) 238 CALL fld_map( inum, 'u1' , dta_read(1:ilen0(2),1:1,1:1) , 1, i dx_bdy(ib_bdy)%nbmap(:,2) )243 CALL fld_map( inum, 'u1' , dta_read(1:ilen0(2),1:1,1:1) , 1, ibmap_ptr(2) ) 239 244 td%u0(:,itide,1) = dta_read(1:ilen0(2),1,1) 240 CALL fld_map( inum, 'u2' , dta_read(1:ilen0(2),1:1,1:1) , 1, i dx_bdy(ib_bdy)%nbmap(:,2) )245 CALL fld_map( inum, 'u2' , dta_read(1:ilen0(2),1:1,1:1) , 1, ibmap_ptr(2) ) 241 246 td%u0(:,itide,2) = dta_read(1:ilen0(2),1,1) 242 247 CALL iom_close( inum ) … … 244 249 clfile = TRIM(filtide)//TRIM(Wave(ntide(itide))%cname_tide)//'_grid_V.nc' 245 250 CALL iom_open( clfile, inum ) 246 CALL fld_map( inum, 'v1' , dta_read(1:ilen0(3),1:1,1:1) , 1, i dx_bdy(ib_bdy)%nbmap(:,3) )251 CALL fld_map( inum, 'v1' , dta_read(1:ilen0(3),1:1,1:1) , 1, ibmap_ptr(3) ) 247 252 td%v0(:,itide,1) = dta_read(1:ilen0(3),1,1) 248 CALL fld_map( inum, 'v2' , dta_read(1:ilen0(3),1:1,1:1) , 1, i dx_bdy(ib_bdy)%nbmap(:,3) )253 CALL fld_map( inum, 'v2' , dta_read(1:ilen0(3),1:1,1:1) , 1, ibmap_ptr(3) ) 249 254 td%v0(:,itide,2) = dta_read(1:ilen0(3),1,1) 250 255 CALL iom_close( inum ) … … 255 260 ENDIF ! ln_bdytide_2ddta=.true. 256 261 ! 257 IF ( ln_bdytide_conj ) THEN! assume complex conjugate in data files262 IF( ln_bdytide_conj ) THEN ! assume complex conjugate in data files 258 263 td%ssh0(:,:,2) = - td%ssh0(:,:,2) 259 264 td%u0 (:,:,2) = - td%u0 (:,:,2) … … 261 266 ENDIF 262 267 ! 263 IF ( lk_dynspg_ts ) THEN ! Allocate arrays to save slowly varying boundary data during 264 ! time splitting integration 265 ALLOCATE( dta_bdy_s(ib_bdy)%ssh ( ilen0(1) ) ) 266 ALLOCATE( dta_bdy_s(ib_bdy)%u2d ( ilen0(2) ) ) 267 ALLOCATE( dta_bdy_s(ib_bdy)%v2d ( ilen0(3) ) ) 268 dta_bdy_s(ib_bdy)%ssh(:) = 0.e0 269 dta_bdy_s(ib_bdy)%u2d(:) = 0.e0 270 dta_bdy_s(ib_bdy)%v2d(:) = 0.e0 271 ENDIF 268 ! Allocate slow varying data in the case of time splitting: 269 ! Do it anyway because at this stage knowledge of free surface scheme is unknown 270 ALLOCATE( dta_bdy_s(ib_bdy)%ssh ( ilen0(1) ) ) 271 ALLOCATE( dta_bdy_s(ib_bdy)%u2d ( ilen0(2) ) ) 272 ALLOCATE( dta_bdy_s(ib_bdy)%v2d ( ilen0(3) ) ) 273 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 272 276 ! 273 277 ENDIF ! nn_dyn2d_dta(ib_bdy) .ge. 2 274 278 ! 275 279 END DO ! loop on ib_bdy 276 277 IF( nn_timing == 1 ) CALL timing_stop('bdytide_init')278 280 ! 281 IF( nn_timing == 1 ) CALL timing_stop('bdytide_init') 282 ! 279 283 END SUBROUTINE bdytide_init 280 284 281 SUBROUTINE bdytide_update ( kt, idx, dta, td, jit, time_offset ) 285 286 SUBROUTINE bdytide_update( kt, idx, dta, td, jit, time_offset ) 282 287 !!---------------------------------------------------------------------- 283 288 !! *** SUBROUTINE bdytide_update *** … … 286 291 !! 287 292 !!---------------------------------------------------------------------- 288 INTEGER , INTENT( in ):: kt ! Main timestep counter289 TYPE(OBC_INDEX) , INTENT( in ):: idx ! OBC indices290 TYPE(OBC_DATA) , INTENT(inout):: dta ! OBC external data291 TYPE(TIDES_DATA) ,INTENT( inout) :: td ! tidal harmonics data292 INTEGER, INTENT(in),OPTIONAL:: jit ! Barotropic timestep counter (for timesplitting option)293 INTEGER, INTENT( in ), OPTIONAL:: time_offset ! time offset in units of timesteps. NB. if jit294 295 296 297 298 299 ! !300 INTEGER , DIMENSION(3) :: ilen0 !: length of boundary data (from OBC arrays)301 INTEGER :: itide, igrd, ib ! dummy loop indices302 INTEGER :: time_add ! time offset in units of timesteps303 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 304 309 REAL(wp), DIMENSION(jpmax_harmo) :: z_sist, z_cost 305 310 !!---------------------------------------------------------------------- 306 307 IF( nn_timing == 1 ) CALL timing_start('bdytide_update')308 311 ! 312 IF( nn_timing == 1 ) CALL timing_start('bdytide_update') 313 ! 309 314 ilen0(1) = SIZE(td%ssh(:,1,1)) 310 315 ilen0(2) = SIZE(td%u(:,1,1)) … … 316 321 ENDIF 317 322 318 IF ( nsec_day == NINT(0.5_wp * rdttra(1)) .AND. zflag==1 ) THEN323 IF ( (nsec_day == NINT(0.5_wp * rdt) .OR. kt==nit000) .AND. zflag==1 ) THEN 319 324 ! 320 kt_tide = kt 325 kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt 321 326 ! 322 327 IF(lwp) THEN … … 367 372 END DO 368 373 ! 369 IF( nn_timing == 1 ) CALL timing_stop('bdytide_update')374 IF( nn_timing == 1 ) CALL timing_stop('bdytide_update') 370 375 ! 371 376 END SUBROUTINE bdytide_update … … 378 383 !! 379 384 !!---------------------------------------------------------------------- 380 INTEGER, INTENT( in ):: kt ! Main timestep counter381 INTEGER, INTENT( in ),OPTIONAL:: kit ! Barotropic timestep counter (for timesplitting option)382 INTEGER, INTENT( in ),OPTIONAL:: time_offset ! time offset in units of timesteps. NB. if kit383 384 385 386 387 388 ! !389 LOGICAL :: lk_first_btstp! =.TRUE. if time splitting and first barotropic step390 INTEGER , DIMENSION(jpbgrd) :: ilen0391 INTEGER , DIMENSION(1:jpbgrd) :: nblen, nblenrim ! short cuts392 INTEGER :: itide, ib_bdy, ib, igrd ! loop indices393 INTEGER :: time_add ! time offset in units of timesteps394 REAL(wp) :: z_arg, z_sarg, zramp, zoff, z_cost, z_sist395 !!---------------------------------------------------------------------- 396 397 IF( nn_timing == 1 ) CALL timing_start('bdy_dta_tides')398 385 INTEGER, INTENT(in) :: kt ! Main timestep counter 386 INTEGER, OPTIONAL, INTENT(in) :: kit ! Barotropic timestep counter (for timesplitting option) 387 INTEGER, OPTIONAL, INTENT(in) :: time_offset ! time offset in units of timesteps. NB. if kit 388 ! ! is present then units = subcycle timesteps. 389 ! ! time_offset = 0 => get data at "now" time level 390 ! ! time_offset = -1 => get data at "before" time level 391 ! ! time_offset = +1 => get data at "after" time level 392 ! ! etc. 393 ! 394 LOGICAL :: lk_first_btstp ! =.TRUE. if time splitting and first barotropic step 395 INTEGER :: itide, ib_bdy, ib, igrd ! loop indices 396 INTEGER :: time_add ! time offset in units of timesteps 397 INTEGER, DIMENSION(jpbgrd) :: ilen0 398 INTEGER, DIMENSION(1:jpbgrd) :: nblen, nblenrim ! short cuts 399 REAL(wp) :: z_arg, z_sarg, zramp, zoff, z_cost, z_sist 400 !!---------------------------------------------------------------------- 401 ! 402 IF( nn_timing == 1 ) CALL timing_start('bdy_dta_tides') 403 ! 399 404 lk_first_btstp=.TRUE. 400 405 IF ( PRESENT(kit).AND.( kit /= 1 ) ) THEN ; lk_first_btstp=.FALSE. ; ENDIF … … 407 412 ! Absolute time from model initialization: 408 413 IF( PRESENT(kit) ) THEN 409 z_arg = ( kt + (kit+ 0.5_wp*(time_add-1)) / REAL(nn_baro,wp) ) * rdt414 z_arg = ( kt + (kit+time_add-1) / REAL(nn_baro,wp) ) * rdt 410 415 ELSE 411 416 z_arg = ( kt + time_add ) * rdt … … 418 423 DO ib_bdy = 1,nb_bdy 419 424 420 ! line below should be simplified (runoff case)421 !! CHANUT: TO BE SORTED OUT422 !! IF (( nn_dyn2d_dta(ib_bdy) .ge. 2 ).AND.(nn_tra(ib_bdy).NE.4)) THEN423 425 IF ( nn_dyn2d_dta(ib_bdy) .ge. 2 ) THEN 424 426 … … 434 436 ! We refresh nodal factors every day below 435 437 ! This should be done somewhere else 436 IF ( nsec_day == NINT(0.5_wp * rdttra(1)) .AND. lk_first_btstp ) THEN437 ! 438 kt_tide = kt 438 IF ( ( nsec_day == NINT(0.5_wp * rdt) .OR. kt==nit000 ) .AND. lk_first_btstp ) THEN 439 ! 440 kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt 439 441 ! 440 442 IF(lwp) THEN … … 450 452 zoff = -kt_tide * rdt ! time offset relative to nodal factor computation time 451 453 ! 452 ! If time splitting, save data at first barotropic iteration 453 IF ( PRESENT(kit) ) THEN 454 IF ( lk_first_btstp ) THEN ! Save slow varying open boundary data: 455 dta_bdy_s(ib_bdy)%ssh(1:ilen0(1)) = dta_bdy(ib_bdy)%ssh(1:ilen0(1)) 456 dta_bdy_s(ib_bdy)%u2d(1:ilen0(2)) = dta_bdy(ib_bdy)%u2d(1:ilen0(2)) 457 dta_bdy_s(ib_bdy)%v2d(1:ilen0(3)) = dta_bdy(ib_bdy)%v2d(1:ilen0(3)) 458 459 ELSE ! Initialize arrays from slow varying open boundary data: 460 dta_bdy(ib_bdy)%ssh(1:ilen0(1)) = dta_bdy_s(ib_bdy)%ssh(1:ilen0(1)) 461 dta_bdy(ib_bdy)%u2d(1:ilen0(2)) = dta_bdy_s(ib_bdy)%u2d(1:ilen0(2)) 462 dta_bdy(ib_bdy)%v2d(1:ilen0(3)) = dta_bdy_s(ib_bdy)%v2d(1:ilen0(3)) 463 ENDIF 454 ! If time splitting, initialize arrays from slow varying open boundary data: 455 IF ( PRESENT(kit) ) THEN 456 IF ( dta_bdy(ib_bdy)%ll_ssh ) dta_bdy(ib_bdy)%ssh(1:ilen0(1)) = dta_bdy_s(ib_bdy)%ssh(1:ilen0(1)) 457 IF ( dta_bdy(ib_bdy)%ll_u2d ) dta_bdy(ib_bdy)%u2d(1:ilen0(2)) = dta_bdy_s(ib_bdy)%u2d(1:ilen0(2)) 458 IF ( dta_bdy(ib_bdy)%ll_v2d ) dta_bdy(ib_bdy)%v2d(1:ilen0(3)) = dta_bdy_s(ib_bdy)%v2d(1:ilen0(3)) 464 459 ENDIF 465 460 ! … … 471 466 z_sist = zramp * SIN( z_sarg ) 472 467 ! 473 igrd=1 ! SSH on tracer grid 474 DO ib = 1, ilen0(igrd) 475 dta_bdy(ib_bdy)%ssh(ib) = dta_bdy(ib_bdy)%ssh(ib) + & 476 & ( tides(ib_bdy)%ssh(ib,itide,1)*z_cost + & 477 & tides(ib_bdy)%ssh(ib,itide,2)*z_sist ) 478 END DO 479 ! 480 igrd=2 ! U grid 481 DO ib = 1, ilen0(igrd) 482 dta_bdy(ib_bdy)%u2d(ib) = dta_bdy(ib_bdy)%u2d(ib) + & 483 & ( tides(ib_bdy)%u(ib,itide,1)*z_cost + & 484 & tides(ib_bdy)%u(ib,itide,2)*z_sist ) 485 END DO 486 ! 487 igrd=3 ! V grid 488 DO ib = 1, ilen0(igrd) 489 dta_bdy(ib_bdy)%v2d(ib) = dta_bdy(ib_bdy)%v2d(ib) + & 490 & ( tides(ib_bdy)%v(ib,itide,1)*z_cost + & 491 & tides(ib_bdy)%v(ib,itide,2)*z_sist ) 492 END DO 493 END DO 468 IF ( dta_bdy(ib_bdy)%ll_ssh ) THEN 469 igrd=1 ! SSH on tracer grid 470 DO ib = 1, ilen0(igrd) 471 dta_bdy(ib_bdy)%ssh(ib) = dta_bdy(ib_bdy)%ssh(ib) + & 472 & ( tides(ib_bdy)%ssh(ib,itide,1)*z_cost + & 473 & tides(ib_bdy)%ssh(ib,itide,2)*z_sist ) 474 END DO 475 ENDIF 476 ! 477 IF ( dta_bdy(ib_bdy)%ll_u2d ) THEN 478 igrd=2 ! U grid 479 DO ib = 1, ilen0(igrd) 480 dta_bdy(ib_bdy)%u2d(ib) = dta_bdy(ib_bdy)%u2d(ib) + & 481 & ( tides(ib_bdy)%u(ib,itide,1)*z_cost + & 482 & tides(ib_bdy)%u(ib,itide,2)*z_sist ) 483 END DO 484 ENDIF 485 ! 486 IF ( dta_bdy(ib_bdy)%ll_v2d ) THEN 487 igrd=3 ! V grid 488 DO ib = 1, ilen0(igrd) 489 dta_bdy(ib_bdy)%v2d(ib) = dta_bdy(ib_bdy)%v2d(ib) + & 490 & ( tides(ib_bdy)%v(ib,itide,1)*z_cost + & 491 & tides(ib_bdy)%v(ib,itide,2)*z_sist ) 492 END DO 493 ENDIF 494 END DO 494 495 END IF 495 496 END DO … … 499 500 END SUBROUTINE bdy_dta_tides 500 501 502 501 503 SUBROUTINE tide_init_elevation( idx, td ) 502 504 !!---------------------------------------------------------------------- 503 505 !! *** ROUTINE tide_init_elevation *** 504 506 !!---------------------------------------------------------------------- 505 TYPE(OBC_INDEX), INTENT( in ) :: idx ! OBC indices 506 TYPE(TIDES_DATA),INTENT( inout ) :: td ! tidal harmonics data 507 !! * Local declarations 508 INTEGER, DIMENSION(1) :: ilen0 !: length of boundary data (from OBC arrays) 507 TYPE(OBC_INDEX) , INTENT(in ) :: idx ! OBC indices 508 TYPE(TIDES_DATA), INTENT(inout) :: td ! tidal harmonics data 509 ! 510 INTEGER :: itide, igrd, ib ! dummy loop indices 511 INTEGER, DIMENSION(1) :: ilen0 ! length of boundary data (from OBC arrays) 509 512 REAL(wp),ALLOCATABLE, DIMENSION(:) :: mod_tide, phi_tide 510 INTEGER :: itide, igrd, ib ! dummy loop indices511 513 !!---------------------------------------------------------------------- 514 ! 512 515 igrd=1 513 516 ! SSH on tracer grid. 514 515 517 ilen0(1) = SIZE(td%ssh0(:,1,1)) 516 517 ALLOCATE( mod_tide(ilen0(igrd)),phi_tide(ilen0(igrd)))518 518 ! 519 ALLOCATE( mod_tide(ilen0(igrd)), phi_tide(ilen0(igrd)) ) 520 ! 519 521 DO itide = 1, nb_harmo 520 522 DO ib = 1, ilen0(igrd) … … 531 533 ENDDO 532 534 END DO 533 534 DEALLOCATE( mod_tide,phi_tide)535 535 ! 536 DEALLOCATE( mod_tide, phi_tide ) 537 ! 536 538 END SUBROUTINE tide_init_elevation 537 539 540 538 541 SUBROUTINE tide_init_velocities( idx, td ) 539 542 !!---------------------------------------------------------------------- 540 543 !! *** ROUTINE tide_init_elevation *** 541 544 !!---------------------------------------------------------------------- 542 TYPE(OBC_INDEX), INTENT( in ) :: idx ! OBC indices 543 TYPE(TIDES_DATA),INTENT( inout ) :: td ! tidal harmonics data 544 !! * Local declarations 545 INTEGER, DIMENSION(3) :: ilen0 !: length of boundary data (from OBC arrays) 545 TYPE(OBC_INDEX) , INTENT(in ) :: idx ! OBC indices 546 TYPE(TIDES_DATA), INTENT(inout) :: td ! tidal harmonics data 547 ! 548 INTEGER :: itide, igrd, ib ! dummy loop indices 549 INTEGER, DIMENSION(3) :: ilen0 ! length of boundary data (from OBC arrays) 546 550 REAL(wp),ALLOCATABLE, DIMENSION(:) :: mod_tide, phi_tide 547 INTEGER :: itide, igrd, ib ! dummy loop indices548 551 !!---------------------------------------------------------------------- 552 ! 549 553 ilen0(2) = SIZE(td%u0(:,1,1)) 550 554 ilen0(3) = SIZE(td%v0(:,1,1)) 551 555 ! 552 556 igrd=2 ! U grid. 553 554 ALLOCATE( mod_tide(ilen0(igrd)),phi_tide(ilen0(igrd)))555 557 ! 558 ALLOCATE( mod_tide(ilen0(igrd)) , phi_tide(ilen0(igrd)) ) 559 ! 556 560 DO itide = 1, nb_harmo 557 561 DO ib = 1, ilen0(igrd) … … 568 572 ENDDO 569 573 END DO 570 571 DEALLOCATE( mod_tide,phi_tide)572 574 ! 575 DEALLOCATE( mod_tide , phi_tide ) 576 ! 573 577 igrd=3 ! V grid. 574 575 ALLOCATE( mod_tide(ilen0(igrd)),phi_tide(ilen0(igrd)))578 ! 579 ALLOCATE( mod_tide(ilen0(igrd)) , phi_tide(ilen0(igrd)) ) 576 580 577 581 DO itide = 1, nb_harmo … … 589 593 ENDDO 590 594 END DO 591 592 DEALLOCATE( mod_tide,phi_tide)593 595 ! 596 DEALLOCATE( mod_tide, phi_tide ) 597 ! 594 598 END SUBROUTINE tide_init_velocities 599 595 600 #else 596 601 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.