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.
trcbbl.F90 in branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90 @ 3116

Last change on this file since 3116 was 3116, checked in by cetlod, 13 years ago

dev_NEMO_MERGE_2011: add in changes dev_NOC_UKMO_MERGE developments

  • Property svn:keywords set to Id
File size: 4.9 KB
RevLine 
[941]1MODULE trcbbl
[2528]2  !!======================================================================
[941]3   !!                       ***  MODULE  trcbbl  ***
4   !! Ocean passive tracers physics :  advective and/or diffusive bottom boundary
5   !!                                  layer scheme
[1175]6   !!======================================================================
[2528]7   !!==============================================================================
8   !! History :  OPA  !  1996-06  (L. Mortier)  Original code
9   !!            8.0  !  1997-11  (G. Madec)    Optimization
10   !!   NEMO     1.0  !  2002-08  (G. Madec)  free form + modules
11   !!             -   !  2004-01  (A. de Miranda, G. Madec, J.M. Molines ) add advective bbl
12   !!            3.3  !  2009-11  (G. Madec)  merge trabbl and trabbl_adv + style + optimization
13   !!             -   !  2010-04  (G. Madec)  Campin & Goosse advective bbl
14   !!             -   !  2010-06  (C. Ethe, G. Madec)  merge TRA-TRC
[941]15   !!----------------------------------------------------------------------
[2528]16#if  defined key_top &&  defined key_trabbl 
[941]17   !!----------------------------------------------------------------------
[2528]18   !!   'key_trabbl                      diffusive or/and adevective bottom boundary layer
[941]19   !!----------------------------------------------------------------------
[2528]20   !!    trc_bbl       : update the tracer trends due to the bottom boundary layer (advective and/or diffusive)
[941]21   !!----------------------------------------------------------------------
22   USE oce_trc             ! ocean dynamics and active tracers variables
[1175]23   USE trc                 ! ocean passive tracers variables
[2528]24   USE trcnam_trp      ! passive tracers transport namelist variables
25   USE trabbl              !
[941]26   USE prtctl_trc          ! Print control for debbuging
[2528]27   USE trdmod_oce
28   USE trdtra
[941]29
[2528]30   PUBLIC   trc_bbl       !  routine called by step.F90
[941]31
32
33   !! * Substitutions
34#  include "top_substitute.h90"
35   !!----------------------------------------------------------------------
[2528]36   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
37   !! $Id$
38   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
[941]39   !!----------------------------------------------------------------------
40
41CONTAINS
42
[2528]43
44   SUBROUTINE trc_bbl( kt )
[941]45      !!----------------------------------------------------------------------
[2528]46      !!                  ***  ROUTINE bbl  ***
47      !!                   
48      !! ** Purpose :   Compute the before tracer (t & s) trend associated
49      !!     with the bottom boundary layer and add it to the general trend
50      !!     of tracer equations.
[941]51      !!
[2528]52      !!---------------------------------------------------------------------- 
53      INTEGER, INTENT( in ) ::   kt   ! ocean time-step
[941]54      CHARACTER (len=22) :: charout
[2528]55      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   ztrtrd
[941]56      !!----------------------------------------------------------------------
57
[3116]58      IF( .NOT. lk_offline .AND. nn_dttrc == 1 ) THEN
59         CALL bbl( kt, nittrc000, 'TRC' )      ! Online coupling with dynamics  : Computation of bbl coef and bbl transport
60         l_bbl = .FALSE.                       ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files
[2528]61      ENDIF
[941]62
[2528]63      IF( l_trdtrc )  THEN
[3116]64         ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends
[2528]65         ztrtrd(:,:,:,:)  = tra(:,:,:,:)
[1175]66      ENDIF
[941]67
[2528]68      !* Diffusive bbl :
69      IF( nn_bbl_ldf == 1 ) THEN
70         !
71         CALL tra_bbl_dif( trb, tra, jptra ) 
72         IF( ln_ctl )   THEN
73            WRITE(charout, FMT="(' bbl_dif')")  ;  CALL prt_ctl_trc_info(charout)
74            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
75         ENDIF
76         !
77      END IF
[941]78
[2528]79      !* Advective bbl : bbl upstream advective trends added to the tracer trends
80      IF( nn_bbl_adv /= 0 ) THEN
81         !
82         CALL tra_bbl_adv( trb, tra, jptra ) 
83         IF( ln_ctl )   THEN
84            WRITE(charout, FMT="(' bbl_adv')")  ;  CALL prt_ctl_trc_info(charout)
85            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
86         ENDIF
87         !
88      END IF
[941]89
[2528]90      IF( l_trdtrc )   THEN                      ! save the horizontal diffusive trends for further diagnostics
91        DO jn = 1, jptra
92           ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn)
93           CALL trd_tra( kt, 'TRC', jn, jptra_trd_ldf, ztrtrd(:,:,:,jn) )
[941]94        END DO
[2528]95        DEALLOCATE( ztrtrd )
[941]96      ENDIF
[2528]97      !
98   END SUBROUTINE trc_bbl
[941]99
100#else
101   !!----------------------------------------------------------------------
102   !!   Dummy module :                      No bottom boundary layer scheme
103   !!----------------------------------------------------------------------
104CONTAINS
[2528]105   SUBROUTINE trc_bbl( kt )              ! Empty routine
106      WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt
107   END SUBROUTINE trc_bbl
[941]108#endif
109
110   !!======================================================================
111END MODULE trcbbl
Note: See TracBrowser for help on using the repository browser.