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/trunk/src/TOP/TRP – NEMO

source: NEMO/trunk/src/TOP/TRP/trcbbl.F90 @ 14335

Last change on this file since 14335 was 14086, checked in by cetlod, 3 years ago

Adding AGRIF branches into the trunk

  • Property svn:keywords set to Id
File size: 5.1 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   !!----------------------------------------------------------------------
[14086]22   USE par_trc        ! need jptra, number of passive tracers
[12377]23   USE oce_trc        ! ocean dynamics and passive tracers variables
[9019]24   USE trc            ! ocean passive tracers variables
25   USE trd_oce        ! trends: ocean variables
26   USE trdtra         ! tracer trends
27   USE trabbl         ! bottom boundary layer
[13286]28   USE prtctl         ! Print control for debbuging
[941]29
[9019]30   PUBLIC   trc_bbl   !  routine called by trctrp.F90
[941]31
32   !!----------------------------------------------------------------------
[9598]33   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
[7753]34   !! $Id$
[10068]35   !! Software governed by the CeCILL license (see ./LICENSE)
[941]36   !!----------------------------------------------------------------------
37CONTAINS
38
[12377]39   SUBROUTINE trc_bbl( kt, Kbb, Kmm, ptr, Krhs )
[941]40      !!----------------------------------------------------------------------
[2528]41      !!                  ***  ROUTINE bbl  ***
42      !!                   
43      !! ** Purpose :   Compute the before tracer (t & s) trend associated
44      !!     with the bottom boundary layer and add it to the general trend
45      !!     of tracer equations.
[941]46      !!
[2528]47      !!---------------------------------------------------------------------- 
[12377]48      INTEGER,                                    INTENT( in  ) :: kt              ! ocean time-step
49      INTEGER,                                    INTENT( in  ) :: Kbb, Kmm, Krhs  ! time level indices
50      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) :: ptr             ! passive tracers and RHS of tracer equation
[9927]51      INTEGER :: jn                   ! loop index
[941]52      CHARACTER (len=22) :: charout
[9125]53      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd
[941]54      !!----------------------------------------------------------------------
[3294]55      !
[9124]56      IF( ln_timing )   CALL timing_start('trc_bbl')
[3294]57      !
[12377]58      IF( .NOT. l_offline ) THEN
59         CALL bbl( kt, nittrc000, 'TRC', Kbb, Kmm )  ! 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
[9125]64         ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends
[12377]65         ztrtrd(:,:,:,:)  = ptr(:,:,:,:,Krhs)
[1175]66      ENDIF
[941]67
[2528]68      !* Diffusive bbl :
69      IF( nn_bbl_ldf == 1 ) THEN
70         !
[12377]71         CALL tra_bbl_dif( ptr(:,:,:,:,Kbb), ptr(:,:,:,:,Krhs), jptra, Kmm ) 
72         IF( sn_cfctl%l_prttrc )   THEN
[13286]73            WRITE(charout, FMT="(' bbl_dif')")  ;  CALL prt_ctl_info( charout, cdcomp = 'top' )
74            CALL prt_ctl( tab4d_1=ptr(:,:,:,:,Krhs), mask1=tmask, clinfo=ctrcnm, clinfo3='trd' )
[2528]75         ENDIF
76         !
[9019]77      ENDIF
[941]78
[2528]79      !* Advective bbl : bbl upstream advective trends added to the tracer trends
80      IF( nn_bbl_adv /= 0 ) THEN
81         !
[12377]82         CALL tra_bbl_adv( ptr(:,:,:,:,Kbb), ptr(:,:,:,:,Krhs), jptra, Kmm ) 
83         IF( sn_cfctl%l_prttrc )   THEN
[13286]84            WRITE(charout, FMT="(' bbl_adv')")  ;  CALL prt_ctl_info( charout, cdcomp = 'top' )
85            CALL prt_ctl( tab4d_1=ptr(:,:,:,:,Krhs), mask1=tmask, clinfo=ctrcnm, clinfo3='trd' )
[2528]86         ENDIF
87         !
[9019]88      ENDIF
[941]89
[2528]90      IF( l_trdtrc )   THEN                      ! save the horizontal diffusive trends for further diagnostics
91        DO jn = 1, jptra
[12377]92           ztrtrd(:,:,:,jn) = ptr(:,:,:,jn,Krhs) - ztrtrd(:,:,:,jn)
93           CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_bbl, ztrtrd(:,:,:,jn) )
[941]94        END DO
[9125]95        DEALLOCATE( ztrtrd ) ! temporary save of trends
[941]96      ENDIF
[2528]97      !
[9124]98      IF( ln_timing )   CALL timing_stop('trc_bbl')
[3294]99      !
[2528]100   END SUBROUTINE trc_bbl
[941]101
102#endif
103
104   !!======================================================================
105END MODULE trcbbl
Note: See TracBrowser for help on using the repository browser.