New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 2443 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90 – NEMO

Ignore:
Timestamp:
2010-11-29T08:52:36+01:00 (13 years ago)
Author:
gm
Message:

v3.3beta: #766 share the deepest ocean level indices (mbkt, mbku & mbkv)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90

    r2287 r2443  
    44   !! Ocean physics :  advective and/or diffusive bottom boundary layer scheme 
    55   !!============================================================================== 
    6    !! History :  OPA  !  1996-06  (L. Mortier)  Original code 
    7    !!            8.0  !  1997-11  (G. Madec)    Optimization 
    8    !!   NEMO     1.0  !  2002-08  (G. Madec)  free form + modules 
    9    !!             -   !  2004-01  (A. de Miranda, G. Madec, J.M. Molines ) add advective bbl 
    10    !!            3.3  !  2009-11  (G. Madec)  merge trabbl and trabbl_adv + style + optimization  
    11    !!             -   !  2010-04  (G. Madec)  Campin & Goosse advective bbl  
    12    !!             -   !  2010-06  (C. Ethe, G. Madec)  merge TRA-TRC 
     6   !! History :  OPA  ! 1996-06  (L. Mortier)  Original code 
     7   !!            8.0  ! 1997-11  (G. Madec)    Optimization 
     8   !!   NEMO     1.0  ! 2002-08  (G. Madec)  free form + modules 
     9   !!             -   ! 2004-01  (A. de Miranda, G. Madec, J.M. Molines ) add advective bbl 
     10   !!            3.3  ! 2009-11  (G. Madec)  merge trabbl and trabbl_adv + style + optimization  
     11   !!             -   ! 2010-04  (G. Madec)  Campin & Goosse advective bbl  
     12   !!             -   ! 2010-06  (C. Ethe, G. Madec)  merge TRA-TRC 
     13   !!             -   ! 2010-11  (G. Madec) add mbk. arrays associated to the deepest ocean level 
    1314   !!---------------------------------------------------------------------- 
    1415#if   defined key_trabbl   ||   defined key_esopa 
     
    2425   USE oce            ! ocean dynamics and active tracers 
    2526   USE dom_oce        ! ocean space and time domain 
    26    USE phycst         !  
     27   USE phycst         ! physical constant 
    2728   USE eosbn2         ! equation of state 
    28    USE trdmod_oce     ! ocean space and time domain 
    29    USE trdtra         ! ocean active tracers trends 
     29   USE trdmod_oce     ! trends: ocean variables 
     30   USE trdtra         ! trends: active tracers 
    3031   USE iom            ! IOM server                
    3132   USE in_out_manager ! I/O manager 
     
    3839   PUBLIC   tra_bbl       !  routine called by step.F90 
    3940   PUBLIC   tra_bbl_init  !  routine called by opa.F90 
    40    PUBLIC   tra_bbl_dif   !  routine called by tra_bbl and trc_bbl 
     41   PUBLIC   tra_bbl_dif   !  routine called by trcbbl.F90 
    4142   PUBLIC   tra_bbl_adv   !  -          -          -              - 
    42    PUBLIC   bbl           !  -          -          -              - 
     43   PUBLIC   bbl           !  routine called by trcbbl.F90 and dtadyn.F90 
    4344 
    4445# if defined key_trabbl 
     
    4849# endif 
    4950 
    50    !                                         !!* Namelist nambbl *  
    51    INTEGER , PUBLIC ::   nn_bbl_ldf = 0       !: =1   : diffusive bbl or not (=0) 
    52    INTEGER , PUBLIC ::   nn_bbl_adv = 0       !: =1/2 : advective bbl or not (=0) 
    53    !                                          !  =1 : advective bbl using the bottom ocean velocity 
    54    !                                          !  =2 :     -      -  using utr_bbl proportional to grad(rho) 
    55    REAL(wp), PUBLIC ::   rn_ahtbbl  = 1.e+3   !: along slope bbl diffusive coefficient [m2/s] 
    56    REAL(wp), PUBLIC ::   rn_gambbl  = 10.e0   !: lateral coeff. for bottom boundary layer scheme [s] 
     51   !                                           !!* Namelist nambbl *  
     52   INTEGER , PUBLIC ::   nn_bbl_ldf = 0         !: =1   : diffusive bbl or not (=0) 
     53   INTEGER , PUBLIC ::   nn_bbl_adv = 0         !: =1/2 : advective bbl or not (=0) 
     54   !                                            !  =1 : advective bbl using the bottom ocean velocity 
     55   !                                            !  =2 :     -      -  using utr_bbl proportional to grad(rho) 
     56   REAL(wp), PUBLIC ::   rn_ahtbbl  = 1.e3_wp   !: along slope bbl diffusive coefficient [m2/s] 
     57   REAL(wp), PUBLIC ::   rn_gambbl  = 10.0_wp   !: lateral coeff. for bottom boundary layer scheme [s] 
    5758 
    5859   REAL(wp), DIMENSION(jpi,jpj), PUBLIC ::   utr_bbl  , vtr_bbl   ! u- (v-) transport in the bottom boundary layer 
    5960 
    60    INTEGER , DIMENSION(jpi,jpj) ::   mbkt                   ! vertical index of the bottom ocean T-level 
    61    INTEGER , DIMENSION(jpi,jpj) ::   mbku     , mbkv        ! vertical index of the (upper) bottom ocean U/V-level 
    6261   INTEGER , DIMENSION(jpi,jpj) ::   mbku_d   , mbkv_d      ! vertical index of the "lower" bottom ocean U/V-level 
    6362   INTEGER , DIMENSION(jpi,jpj) ::   mgrhu    , mgrhv       ! = +/-1, sign of grad(H) in u-(v-)direction 
     
    7473   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    7574   !! $Id$ 
    76    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    77    !!---------------------------------------------------------------------- 
    78  
     75   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     76   !!---------------------------------------------------------------------- 
    7977CONTAINS 
    80  
    8178 
    8279   SUBROUTINE tra_bbl( kt ) 
     
    8582      !!                    
    8683      !! ** Purpose :   Compute the before tracer (t & s) trend associated  
    87       !!     with the bottom boundary layer and add it to the general trend 
    88       !!     of tracer equations. 
     84      !!              with the bottom boundary layer and add it to the general 
     85      !!              trend of tracer equations. 
    8986      !! 
    9087      !! ** Method  :   Depending on namtra_bbl namelist parameters the bbl 
     
    218215      !!                       transport proportional to the along-slope density gradient                    
    219216      !! 
    220       !! 
    221217      !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 
    222218      !!              Campin, J.-M., and H. Goosse, 1999, Tellus, 412-430. 
    223       !! 
    224219      !!----------------------------------------------------------------------   
    225220      INTEGER                              , INTENT(in   ) ::   kjpt    ! number of tracers 
     
    233228      REAL(wp) ::   zu_bbl, zv_bbl           !   -      - 
    234229      !!---------------------------------------------------------------------- 
    235  
     230      ! 
    236231      !                                                          ! =========== 
    237232      DO jn = 1, kjpt                                            ! tracer loop 
     
    547542      e1e2t_r(:,:) = 1.0 / ( e1t(:,:) * e2t(:,:) ) 
    548543       
    549       !                             !* vertical index of bottom t-, u- and v-points 
    550       DO jj = 1, jpj                      ! bottom k-index of T-level 
    551          DO ji = 1, jpi 
    552             mbkt(ji,jj) = MAX( mbathy(ji,jj) - 1, 1 ) 
     544      !                             !* vertical index of  "deep" bottom u- and v-points 
     545      DO jj = 1, jpjm1                    ! (the "shelf" bottom k-indices are mbku and mbkv) 
     546         DO ji = 1, jpim1 
     547            mbku_d(ji,jj) = MAX(  mbkt(ji+1,jj  ) , mbkt(ji,jj)  )   ! >= 1 as mbkt=1 over land 
     548            mbkv_d(ji,jj) = MAX(  mbkt(ji  ,jj+1) , mbkt(ji,jj)  ) 
    553549         END DO 
    554550      END DO 
    555       DO jj = 1, jpjm1                    ! bottom k-index of u- (v-) level (shelf and deep) 
    556          DO ji = 1, jpim1 
    557             mbku  (ji,jj) = MAX( MIN( mbathy(ji+1,jj  ), mbathy(ji,jj) ) - 1, 1 )   ! "shelf" 
    558             mbkv  (ji,jj) = MAX( MIN( mbathy(ji  ,jj+1), mbathy(ji,jj) ) - 1, 1 ) 
    559             mbku_d(ji,jj) = MAX( MAX( mbathy(ji+1,jj  ), mbathy(ji,jj) ) - 1, 1 )   ! "deep" 
    560             mbkv_d(ji,jj) = MAX( MAX( mbathy(ji  ,jj+1), mbathy(ji,jj) ) - 1, 1 ) 
    561          END DO 
    562       END DO 
    563       zmbk(:,:) = FLOAT( mbku  (:,:) )   ;   CALL lbc_lnk(zmbk,'U',1.)   ;   mbku  (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
    564       zmbk(:,:) = FLOAT( mbkv  (:,:) )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv  (:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
    565       zmbk(:,:) = FLOAT( mbku_d(:,:) )   ;   CALL lbc_lnk(zmbk,'U',1.)   ;   mbku_d(:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
    566       zmbk(:,:) = FLOAT( mbkv_d(:,:) )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv_d(:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
     551      ! converte into REAL to use lbc_lnk ; impose a min value of 1 as a zero can be set in lbclnk  
     552      zmbk(:,:) = REAL( mbku_d(:,:), wp )   ;   CALL lbc_lnk(zmbk,'U',1.)   ;   mbku_d(:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
     553      zmbk(:,:) = REAL( mbkv_d(:,:), wp )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv_d(:,:) = MAX( INT( zmbk(:,:) ), 1 ) 
    567554 
    568555                                        !* sign of grad(H) at u- and v-points 
Note: See TracChangeset for help on using the changeset viewer.