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 @ 12377

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

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1MODULE trcbbl
2  !!======================================================================
3   !!                       ***  MODULE  trcbbl  ***
4   !! Ocean passive tracers physics :  advective and/or diffusive bottom boundary
5   !!                                  layer scheme
6   !!======================================================================
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
14   !!            4.0  !  2017-04  (G. Madec)  ln_trabbl namelist variable instead of a CPP key
15   !!----------------------------------------------------------------------
16#if  defined key_top
17   !!----------------------------------------------------------------------
18   !!   'key_top'                                                TOP models
19   !!----------------------------------------------------------------------
20   !!    trc_bbl      : update the tracer trends due to the bottom boundary layer (advective and/or diffusive)
21   !!----------------------------------------------------------------------
22   USE oce_trc        ! ocean dynamics and passive 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
28
29   PUBLIC   trc_bbl   !  routine called by trctrp.F90
30
31   !!----------------------------------------------------------------------
32   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
33   !! $Id$
34   !! Software governed by the CeCILL license (see ./LICENSE)
35   !!----------------------------------------------------------------------
36CONTAINS
37
38   SUBROUTINE trc_bbl( kt, Kbb, Kmm, ptr, Krhs )
39      !!----------------------------------------------------------------------
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.
45      !!
46      !!---------------------------------------------------------------------- 
47      INTEGER,                                    INTENT( in  ) :: kt              ! ocean time-step
48      INTEGER,                                    INTENT( in  ) :: Kbb, Kmm, Krhs  ! time level indices
49      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) :: ptr             ! passive tracers and RHS of tracer equation
50      INTEGER :: jn                   ! loop index
51      CHARACTER (len=22) :: charout
52      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd
53      !!----------------------------------------------------------------------
54      !
55      IF( ln_timing )   CALL timing_start('trc_bbl')
56      !
57      IF( .NOT. l_offline ) THEN
58         CALL bbl( kt, nittrc000, 'TRC', Kbb, Kmm )  ! Online coupling with dynamics  : Computation of bbl coef and bbl transport
59         l_bbl = .FALSE.                             ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files
60      ENDIF
61
62      IF( l_trdtrc )  THEN
63         ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends
64         ztrtrd(:,:,:,:)  = ptr(:,:,:,:,Krhs)
65      ENDIF
66
67      !* Diffusive bbl :
68      IF( nn_bbl_ldf == 1 ) THEN
69         !
70         CALL tra_bbl_dif( ptr(:,:,:,:,Kbb), ptr(:,:,:,:,Krhs), jptra, Kmm ) 
71         IF( sn_cfctl%l_prttrc )   THEN
72            WRITE(charout, FMT="(' bbl_dif')")  ;  CALL prt_ctl_trc_info(charout)
73            CALL prt_ctl_trc( tab4d=ptr(:,:,:,:,Krhs), mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
74         ENDIF
75         !
76      ENDIF
77
78      !* Advective bbl : bbl upstream advective trends added to the tracer trends
79      IF( nn_bbl_adv /= 0 ) THEN
80         !
81         CALL tra_bbl_adv( ptr(:,:,:,:,Kbb), ptr(:,:,:,:,Krhs), jptra, Kmm ) 
82         IF( sn_cfctl%l_prttrc )   THEN
83            WRITE(charout, FMT="(' bbl_adv')")  ;  CALL prt_ctl_trc_info(charout)
84            CALL prt_ctl_trc( tab4d=ptr(:,:,:,:,Krhs), mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
85         ENDIF
86         !
87      ENDIF
88
89      IF( l_trdtrc )   THEN                      ! save the horizontal diffusive trends for further diagnostics
90        DO jn = 1, jptra
91           ztrtrd(:,:,:,jn) = ptr(:,:,:,jn,Krhs) - ztrtrd(:,:,:,jn)
92           CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_bbl, ztrtrd(:,:,:,jn) )
93        END DO
94        DEALLOCATE( ztrtrd ) ! temporary save of trends
95      ENDIF
96      !
97      IF( ln_timing )   CALL timing_stop('trc_bbl')
98      !
99   END SUBROUTINE trc_bbl
100
101#endif
102
103   !!======================================================================
104END MODULE trcbbl
Note: See TracBrowser for help on using the repository browser.