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 NEMO/branches/2019/fix_sn_cfctl_ticket2328/src/TOP/TRP – NEMO

source: NEMO/branches/2019/fix_sn_cfctl_ticket2328/src/TOP/TRP/trcbbl.F90 @ 11869

Last change on this file since 11869 was 11869, checked in by acc, 4 years ago

Branch 2019/fix_sn_cfctl_ticket2328. Changes to enable correct functionality for the sn_cfctl%l_mppout and sn_cfctl%l_mpptop options. These changes also introduce a sn_cfctl%l_oasout option to toggle the OASIS setup information (sbccpl.F90, only) which was yet another misuse of ln_ctl. The next step may be to remove most references to ln_ctl altogether and provide a single control mechanism. TBD. See ticket #2328

  • Property svn:keywords set to Id
File size: 4.7 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   !! History :  OPA  !  1996-06  (L. Mortier)  Original code
8   !!            8.0  !  1997-11  (G. Madec)    Optimization
9   !!   NEMO     1.0  !  2002-08  (G. Madec)  free form + modules
10   !!             -   !  2004-01  (A. de Miranda, G. Madec, J.M. Molines ) add advective bbl
11   !!            3.3  !  2009-11  (G. Madec)  merge trabbl and trabbl_adv + style + optimization
12   !!             -   !  2010-04  (G. Madec)  Campin & Goosse advective bbl
13   !!             -   !  2010-06  (C. Ethe, G. Madec)  merge TRA-TRC
[9019]14   !!            4.0  !  2017-04  (G. Madec)  ln_trabbl namelist variable instead of a CPP key
[941]15   !!----------------------------------------------------------------------
[9019]16#if  defined key_top
[941]17   !!----------------------------------------------------------------------
[9019]18   !!   'key_top'                                                TOP models
[941]19   !!----------------------------------------------------------------------
[9019]20   !!    trc_bbl      : update the tracer trends due to the bottom boundary layer (advective and/or diffusive)
[941]21   !!----------------------------------------------------------------------
[9019]22   USE oce_trc        ! ocean dynamics and active tracers variables
23   USE trc            ! ocean passive tracers variables
24   USE trd_oce        ! trends: ocean variables
25   USE trdtra         ! tracer trends
26   USE trabbl         ! bottom boundary layer
27   USE prtctl_trc     ! Print control for debbuging
[941]28
[9019]29   PUBLIC   trc_bbl   !  routine called by trctrp.F90
[941]30
31   !!----------------------------------------------------------------------
[9598]32   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
[7753]33   !! $Id$
[10068]34   !! Software governed by the CeCILL license (see ./LICENSE)
[941]35   !!----------------------------------------------------------------------
36CONTAINS
37
[2528]38   SUBROUTINE trc_bbl( kt )
[941]39      !!----------------------------------------------------------------------
[2528]40      !!                  ***  ROUTINE bbl  ***
41      !!                   
42      !! ** Purpose :   Compute the before tracer (t & s) trend associated
43      !!     with the bottom boundary layer and add it to the general trend
44      !!     of tracer equations.
[941]45      !!
[2528]46      !!---------------------------------------------------------------------- 
47      INTEGER, INTENT( in ) ::   kt   ! ocean time-step
[9927]48      INTEGER :: jn                   ! loop index
[941]49      CHARACTER (len=22) :: charout
[9125]50      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd
[941]51      !!----------------------------------------------------------------------
[3294]52      !
[9124]53      IF( ln_timing )   CALL timing_start('trc_bbl')
[3294]54      !
[7646]55      IF( .NOT. l_offline .AND. nn_dttrc == 1 ) THEN
[3294]56         CALL bbl( kt, nittrc000, 'TRC' )      ! Online coupling with dynamics  : Computation of bbl coef and bbl transport
57         l_bbl = .FALSE.                       ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files
[2528]58      ENDIF
[941]59
[2528]60      IF( l_trdtrc )  THEN
[9125]61         ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends
[7753]62         ztrtrd(:,:,:,:)  = tra(:,:,:,:)
[1175]63      ENDIF
[941]64
[2528]65      !* Diffusive bbl :
66      IF( nn_bbl_ldf == 1 ) THEN
67         !
68         CALL tra_bbl_dif( trb, tra, jptra ) 
[11869]69         IF( ln_ctl .OR. sn_cfctl%l_mpptop )   THEN
[2528]70            WRITE(charout, FMT="(' bbl_dif')")  ;  CALL prt_ctl_trc_info(charout)
71            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
72         ENDIF
73         !
[9019]74      ENDIF
[941]75
[2528]76      !* Advective bbl : bbl upstream advective trends added to the tracer trends
77      IF( nn_bbl_adv /= 0 ) THEN
78         !
79         CALL tra_bbl_adv( trb, tra, jptra ) 
[11869]80         IF( ln_ctl .OR. sn_cfctl%l_mpptop )   THEN
[2528]81            WRITE(charout, FMT="(' bbl_adv')")  ;  CALL prt_ctl_trc_info(charout)
82            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
83         ENDIF
84         !
[9019]85      ENDIF
[941]86
[2528]87      IF( l_trdtrc )   THEN                      ! save the horizontal diffusive trends for further diagnostics
88        DO jn = 1, jptra
[7753]89           ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn)
[4990]90           CALL trd_tra( kt, 'TRC', jn, jptra_bbl, ztrtrd(:,:,:,jn) )
[941]91        END DO
[9125]92        DEALLOCATE( ztrtrd ) ! temporary save of trends
[941]93      ENDIF
[2528]94      !
[9124]95      IF( ln_timing )   CALL timing_stop('trc_bbl')
[3294]96      !
[2528]97   END SUBROUTINE trc_bbl
[941]98
99#endif
100
101   !!======================================================================
102END MODULE trcbbl
Note: See TracBrowser for help on using the repository browser.