Changeset 503 for trunk/NEMO/OPA_SRC/TRA/trabbl.F90
- Timestamp:
- 2006-09-27T10:52:29+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/TRA/trabbl.F90
r481 r503 4 4 !! Ocean physics : advective and/or diffusive bottom boundary layer scheme 5 5 !!============================================================================== 6 !! History : 8.0 ! 96-06 (L. Mortier) Original code 7 !! 8.0 ! 97-11 (G. Madec) Optimization 8 !! 8.5 ! 02-08 (G. Madec) free form + modules 9 !!---------------------------------------------------------------------- 6 10 #if defined key_trabbl_dif || defined key_trabbl_adv || defined key_esopa 7 11 !!---------------------------------------------------------------------- 8 12 !! 'key_trabbl_dif' or diffusive bottom boundary layer 9 13 !! 'key_trabbl_adv' advective bottom boundary layer 14 !!---------------------------------------------------------------------- 10 15 !!---------------------------------------------------------------------- 11 16 !! tra_bbl_dif : update the active tracer trends due to the bottom … … 15 20 !! tra_bbl_init : initialization, namlist read, parameters control 16 21 !!---------------------------------------------------------------------- 17 !! * Modules used18 USE oce ! ocean dynamics and active tracers19 USE dom_oce ! ocean space and time domain20 USE trdmod_oce 21 USE in_out_manager 22 USE lbclnk 23 USE prtctl 22 USE oce ! ocean dynamics and active tracers 23 USE dom_oce ! ocean space and time domain 24 USE trdmod ! ocean active tracers trends 25 USE trdmod_oce ! ocean variables trends 26 USE in_out_manager ! I/O manager 27 USE lbclnk ! ocean lateral boundary conditions 28 USE prtctl ! Print control 24 29 25 30 IMPLICIT NONE 26 31 PRIVATE 27 32 28 !! * Routine accessibility29 33 PUBLIC tra_bbl_dif ! routine called by step.F90 30 34 PUBLIC tra_bbl_adv ! routine called by step.F90 31 35 32 !! * Shared module variables33 REAL(wp), PUBLIC :: & !!: * bbl namelist *34 atrbbl = 1.e+3 !: lateral coeff. for bottom boundary35 ! ! layer scheme (m2/s) 36 !!* Namelist nambbl: bottom boundary layer 37 REAL(wp), PUBLIC :: atrbbl = 1.e+3 !: lateral coeff. for bottom boundary layer scheme (m2/s) 38 NAMELIST/nambbl/ atrbbl 39 36 40 # if defined key_trabbl_dif 37 LOGICAL, PUBLIC, PARAMETER :: & !: 38 lk_trabbl_dif = .TRUE. !: diffusive bottom boundary layer flag 41 LOGICAL, PUBLIC, PARAMETER :: lk_trabbl_dif = .TRUE. !: diffusive bottom boundary layer flag 39 42 # else 40 LOGICAL, PUBLIC, PARAMETER :: & !: 41 lk_trabbl_dif = .FALSE. !: diffusive bottom boundary layer flag 43 LOGICAL, PUBLIC, PARAMETER :: lk_trabbl_dif = .FALSE. !: diffusive bottom boundary layer flag 42 44 # endif 43 45 44 46 # if defined key_trabbl_adv 45 LOGICAL, PUBLIC, PARAMETER :: & !: 46 lk_trabbl_adv = .TRUE. !: advective bottom boundary layer flag 47 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: & !: 48 u_bbl, v_bbl, & !: velocity involved in exhanges in the advective BBL 49 w_bbl !: vertical increment of velocity due to advective BBL 50 ! ! only affect tracer vertical advection 47 LOGICAL, PUBLIC, PARAMETER :: lk_trabbl_adv = .TRUE. !: advective bottom boundary layer flag 48 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: u_bbl !: 3 components of the velocity 49 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: v_bbl !: associated with advective BBL 50 REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) :: w_bbl !: (only affect tracer) 51 51 # else 52 LOGICAL, PUBLIC, PARAMETER :: & !: 53 lk_trabbl_adv = .FALSE. !: advective bottom boundary layer flag 52 LOGICAL, PUBLIC, PARAMETER :: lk_trabbl_adv = .FALSE. !: advective bottom boundary layer flag 54 53 # endif 55 54 56 !! * Module variables 57 INTEGER, DIMENSION(jpi,jpj) :: & !: 58 mbkt, & ! vertical index of the bottom ocean T-level 59 mbku, mbkv ! vertical index of the bottom ocean U/V-level 55 INTEGER, DIMENSION(jpi,jpj) :: mbkt ! vertical index of the bottom ocean T-level 56 INTEGER, DIMENSION(jpi,jpj) :: mbku, mbkv ! vertical index of the bottom ocean U/V-level 60 57 61 58 !! * Substitutions … … 63 60 # include "vectopt_loop_substitute.h90" 64 61 !!---------------------------------------------------------------------- 65 !! OPA 9.0 , LOCEAN-IPSL (200 5)62 !! OPA 9.0 , LOCEAN-IPSL (2006) 66 63 !! $Header$ 67 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt64 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 68 65 !!---------------------------------------------------------------------- 69 66 … … 102 99 !! ** Action : - update (ta,sa) at the bottom level with the bottom 103 100 !! boundary layer trend 104 !! - save the trends in tldfbbl/sldfbbl ('key_trdtra') 105 !! 106 !! References : 107 !! Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 108 !! 109 !! History : 110 !! 8.0 ! 96-06 (L. Mortier) Original code 111 !! 8.0 ! 97-11 (G. Madec) Optimization 112 !! 8.5 ! 02-08 (G. Madec) free form + modules 113 !! 9.0 ! 04-08 (C. Talandier) New trends organization 114 !!---------------------------------------------------------------------- 115 !! * Modules used 116 USE oce, ONLY : ztdta => ua, & ! use ua as 3D workspace 117 ztdsa => va ! use va as 3D workspace 118 USE eosbn2 ! equation of state 119 120 !! * Arguments 121 INTEGER, INTENT( in ) :: kt ! ocean time-step 122 123 !! * Local declarations 124 INTEGER :: ji, jj ! dummy loop indices 125 INTEGER :: ik 126 INTEGER :: ii0, ii1, ij0, ij1 ! temporary integers 101 !! - save the trends in ztrdt/ztrds ('key_trdtra') 102 !! 103 !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 104 !!---------------------------------------------------------------------- 105 USE oce, ONLY : ztrdt => ua ! use ua as 3D workspace 106 USE oce, ONLY : ztrds => va ! use va as 3D workspace 107 USE eosbn2 ! equation of state 108 !! 109 INTEGER, INTENT( in ) :: kt ! ocean time-step 110 !! 111 INTEGER :: ji, jj ! dummy loop indices 112 INTEGER :: ik 113 INTEGER :: ii0, ii1, ij0, ij1 ! temporary integers 127 114 INTEGER :: iku1, iku2, ikv1,ikv2 ! temporary intergers 128 115 REAL(wp) :: ze3u, ze3v ! temporary scalars 129 INTEGER :: iku, ikv116 INTEGER :: iku, ikv 130 117 REAL(wp) :: & 131 118 zsign, zt, zs, zh, zalbet, & ! temporary scalars 132 119 zgdrho, zbtr, zta, zsa 133 120 REAL(wp), DIMENSION(jpi,jpj) :: & 134 zki, zkj, zkw, zkx, zky, zkz, & ! temporaryworkspace arrays121 zki, zkj, zkw, zkx, zky, zkz, & ! 2D workspace arrays 135 122 ztnb, zsnb, zdep, & 136 123 ztbb, zsbb, zahu, zahv 137 REAL(wp) :: & 138 fsalbt, pft, pfs, pfh ! statement function 124 REAL(wp) :: fsalbt, pft, pfs, pfh ! statement function 139 125 !!---------------------------------------------------------------------- 140 126 ! ratio alpha/beta … … 161 147 IF( kt == nit000 ) CALL tra_bbl_init 162 148 163 ! Save ta and sa trends 164 IF( l_trdtra ) THEN 165 ztdta(:,:,:) = ta(:,:,:) 166 ztdsa(:,:,:) = sa(:,:,:) 149 IF( l_trdtra ) THEN ! Save ta and sa trends 150 ztrdt(:,:,:) = ta(:,:,:) 151 ztrds(:,:,:) = sa(:,:,:) 167 152 ENDIF 168 153 … … 170 155 ! ----------------------------------------------------------------- 171 156 ! mbathy= number of w-level, minimum value=1 (cf dommsk.F) 172 173 157 # if defined key_vectopt_loop && ! defined key_mpp_omp 174 158 jj = 1 … … 387 371 388 372 IF( cp_cfg == "orca" ) THEN 389 373 ! 390 374 SELECT CASE ( jp_cfg ) 391 375 ! ! ======================= … … 397 381 zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 398 382 zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 399 383 ! 400 384 ! Red Sea enhancement of BBL 401 385 ij0 = 88 ; ij1 = 88 … … 403 387 zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 10.e0 * zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 404 388 zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 10.e0 * zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 405 389 ! 406 390 ! ! ======================= 407 391 CASE ( 4 ) ! ORCA_R4 configuration … … 412 396 zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zkx( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 413 397 zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) = 4.e0 * zky( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) 414 398 ! 415 399 END SELECT 416 400 ! 417 401 ENDIF 418 402 … … 439 423 END DO 440 424 441 ! save the trends for diagnostic 442 ! BBL lateral diffusion tracers trends 443 IF( l_trdtra ) THEN 444 # if defined key_vectopt_loop && ! defined key_mpp_omp 445 jj = 1 446 DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) 447 # else 448 DO jj = 2, jpjm1 449 DO ji = 2, jpim1 450 # endif 451 ik = max( mbathy(ji,jj)-1, 1 ) 452 tldfbbl(ji,jj) = ta(ji,jj,ik) - ztdta(ji,jj,ik) 453 sldfbbl(ji,jj) = sa(ji,jj,ik) - ztdsa(ji,jj,ik) 454 # if ! defined key_vectopt_loop || defined key_mpp_omp 455 END DO 456 # endif 457 END DO 458 425 IF( l_trdtra ) THEN ! save the BBL lateral diffusion trends for diagnostic 426 ztrdt(:,:,:) = ta(:,:,:) - ztrdt(:,:,:) 427 ztrds(:,:,:) = sa(:,:,:) - ztrds(:,:,:) 428 CALL trd_mod(ztrdt, ztrds, jptra_trd_bbl, 'TRA', kt) 459 429 ENDIF 460 430 461 IF(ln_ctl) THEN 462 CALL prt_ctl(tab3d_1=ta, clinfo1=' bbl - Ta: ', mask1=tmask, & 463 & tab3d_2=sa, clinfo2=' Sa: ', mask2=tmask, clinfo3='tra') 464 ENDIF 465 431 IF(ln_ctl) CALL prt_ctl( tab3d_1=ta, clinfo1=' bbl - Ta: ', mask1=tmask, & 432 & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) 433 ! 466 434 END SUBROUTINE tra_bbl_dif 467 435 … … 489 457 !! ** Method : Read the nambbl namelist and check the parameters 490 458 !! called by tra_bbl at the first timestep (nit000) 491 !! 492 !! History : 493 !! 8.5 ! 02-08 (G. Madec) Original code 494 !!---------------------------------------------------------------------- 495 !! * Local declarations 459 !!---------------------------------------------------------------------- 496 460 INTEGER :: ji, jj ! dummy loop indices 497 461 REAL(wp), DIMENSION(jpi,jpj) :: zmbk 498 499 NAMELIST/nambbl/ atrbbl 500 !!---------------------------------------------------------------------- 501 502 ! Read Namelist nambbl : bottom boundary layer scheme 503 ! -------------------- 504 REWIND ( numnam ) 462 !!---------------------------------------------------------------------- 463 464 REWIND ( numnam ) ! Read Namelist nambbl : bottom boundary layer scheme 505 465 READ ( numnam, nambbl ) 506 466 507 508 ! Parameter control and print 509 ! --------------------------- 510 IF(lwp) THEN 467 IF(lwp) THEN ! Parameter control and print 511 468 WRITE(numout,*) 512 469 WRITE(numout,*) 'tra_bbl_init : ' 513 470 WRITE(numout,*) '~~~~~~~~~~~~' 514 IF (lk_trabbl_dif ) THEN 515 WRITE(numout,*) ' * Diffusive Bottom Boundary Layer' 516 ENDIF 517 IF( lk_trabbl_adv ) THEN 518 WRITE(numout,*) ' * Advective Bottom Boundary Layer' 519 ENDIF 520 WRITE(numout,*) ' Namelist nambbl : set bbl parameters' 521 WRITE(numout,*) 471 IF (lk_trabbl_dif ) WRITE(numout,*) ' * Diffusive Bottom Boundary Layer' 472 IF( lk_trabbl_adv ) WRITE(numout,*) ' * Advective Bottom Boundary Layer' 473 WRITE(numout,*) ' Namelist nambbl : set bbl parameters' 522 474 WRITE(numout,*) ' bottom boundary layer coef. atrbbl = ', atrbbl 523 WRITE(numout,*)524 475 ENDIF 525 476 … … 545 496 546 497 # if defined key_trabbl_adv 547 ! initialisation of w_bbl to zero 548 w_bbl(:,:,:) = 0.e0 498 w_bbl(:,:,:) = 0.e0 ! initialisation of w_bbl to zero 549 499 # endif 550 500 ! 551 501 END SUBROUTINE tra_bbl_init 552 502 … … 558 508 LOGICAL, PUBLIC, PARAMETER :: lk_trabbl_adv = .FALSE. !: adv bbl flag 559 509 CONTAINS 560 SUBROUTINE tra_bbl_dif (kt ) ! Empty routine 561 INTEGER, INTENT(in) :: kt 510 SUBROUTINE tra_bbl_dif( kt ) ! Empty routine 562 511 WRITE(*,*) 'tra_bbl_dif: You should not have seen this print! error?', kt 563 512 END SUBROUTINE tra_bbl_dif 564 SUBROUTINE tra_bbl_adv (kt ) ! Empty routine 565 INTEGER, INTENT(in) :: kt 513 SUBROUTINE tra_bbl_adv( kt ) ! Empty routine 566 514 WRITE(*,*) 'tra_bbl_adv: You should not have seen this print! error?', kt 567 515 END SUBROUTINE tra_bbl_adv
Note: See TracChangeset
for help on using the changeset viewer.