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/trabbc.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/trabbc.F90

    r2337 r2443  
    88   !!             -   ! 2002-11 (A. Bozec)  tra_bbc_init: original code 
    99   !!            3.3  ! 2010-10 (G. Madec)  dynamical allocation + suppression of key_trabbc 
     10   !!             -   ! 2010-11 (G. Madec)  use mbkt array (deepest ocean t-level) 
    1011   !!---------------------------------------------------------------------- 
    1112 
     13   !!---------------------------------------------------------------------- 
    1214   !!   tra_bbc      : update the tracer trend at ocean bottom  
    1315   !!   tra_bbc_init : initialization of geothermal heat flux trend 
    1416   !!---------------------------------------------------------------------- 
    15    USE oce             ! ocean dynamics and active tracers 
    16    USE dom_oce         ! ocean space and time domain 
     17   USE oce             ! ocean variables 
     18   USE dom_oce         ! domain: ocean 
    1719   USE phycst          ! physical constants 
    18    USE trdmod_oce      ! ocean trends  
    19    USE trdtra      ! ocean trends  
     20   USE trdmod_oce      ! trends: ocean variables  
     21   USE trdtra          ! trends: active tracers  
    2022   USE in_out_manager  ! I/O manager 
    2123   USE prtctl          ! Print control 
     
    3234   REAL(wp)        ::   rn_geoflx_cst = 86.4e-3_wp   !  Constant value of geothermal heat flux 
    3335 
    34    INTEGER , DIMENSION(:,:), ALLOCATABLE ::   nbotlevt   ! ocean bottom level index at T-pt 
    3536   REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   qgh_trd0   ! geothermal heating trend 
    3637  
     
    5758      !!       ocean bottom can be computed once and is added to the temperature 
    5859      !!       trend juste above the bottom at each time step: 
    59       !!            ta = ta + Qsf / (rau0 rcp e3T) for k= mbathy -1 
     60      !!            ta = ta + Qsf / (rau0 rcp e3T) for k= mbkt 
    6061      !!       Where Qsf is the geothermal heat flux. 
    6162      !! 
     
    6667      !!              Emile-Geay and Madec, 2009, Ocean Science. 
    6768      !!---------------------------------------------------------------------- 
    68       !! 
    6969      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
    7070      !! 
    7171      INTEGER  ::   ji, jj, ik    ! dummy loop indices 
    72       REAL(wp) ::   zqgh_trd  ! geothermal heat flux trend 
     72      REAL(wp) ::   zqgh_trd      ! geothermal heat flux trend 
    7373      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt 
    7474      !!---------------------------------------------------------------------- 
    75  
     75      ! 
    7676      IF( l_trdtra )   THEN         ! Save ta and sa trends 
    7777         ALLOCATE( ztrdt(jpi,jpj,jpk) )     ;   ztrdt(:,:,:) = tsa(:,:,:,jp_tem) 
    7878      ENDIF 
    79  
     79      ! 
    8080      !                             !  Add the geothermal heat flux trend on temperature 
    8181#if defined key_vectopt_loop 
     
    8686         DO ji = 2, jpim1 
    8787#endif 
    88             ik = nbotlevt(ji,jj) 
     88            ik = mbkt(ji,jj) 
    8989            zqgh_trd = qgh_trd0(ji,jj) / fse3t(ji,jj,ik) 
    9090            tsa(ji,jj,ik,jp_tem) = tsa(ji,jj,ik,jp_tem) + zqgh_trd 
    9191         END DO 
    9292      END DO 
    93  
     93      ! 
    9494      IF( l_trdtra ) THEN        ! Save the geothermal heat flux trend for diagnostics 
    9595         ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 
     
    117117      !! 
    118118      !! ** Action  : - read/fix the geothermal heat qgh_trd0 
    119       !!              - compute the bottom ocean level nbotlevt 
    120119      !!---------------------------------------------------------------------- 
    121120      USE iom 
     
    127126      !!---------------------------------------------------------------------- 
    128127 
    129       REWIND ( numnam )              ! Read Namelist nambbc : bottom momentum boundary condition 
    130       READ   ( numnam, nambbc ) 
     128      REWIND( numnam )                 ! Read Namelist nambbc : bottom momentum boundary condition 
     129      READ  ( numnam, nambbc ) 
    131130 
    132131      IF(lwp) THEN                     ! Control print 
     
    143142      IF( ln_trabbc ) THEN             !==  geothermal heating  ==! 
    144143         ! 
    145          ALLOCATE( nbotlevt(jpi,jpj) )    ! allocation 
    146          ALLOCATE( qgh_trd0(jpi,jpj) )      
    147          !              
    148          DO jj = 1, jpj                   ! level of the ocean bottom at T-point 
    149             DO ji = 1, jpi 
    150                nbotlevt(ji,jj) = MAX( mbathy(ji,jj)-1, 1 ) 
    151             END DO 
    152          END DO 
     144         ALLOCATE( qgh_trd0(jpi,jpj) )    ! allocation 
    153145         ! 
    154146         SELECT CASE ( nn_geoflx )        ! geothermal heat flux / (rauO * Cp) 
     
    172164         ! 
    173165      ELSE 
    174             IF(lwp) WRITE(numout,*) '      *** no geothermal heat flux' 
     166         IF(lwp) WRITE(numout,*) '      *** no geothermal heat flux' 
    175167      ENDIF 
    176168      ! 
Note: See TracChangeset for help on using the changeset viewer.