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_crs.F90 in branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl_crs.F90 @ 5105

Last change on this file since 5105 was 5105, checked in by cbricaud, 9 years ago

bug correction

  • Property svn:executable set to *
File size: 5.3 KB
Line 
1MODULE trcbbl_crs
2  !!======================================================================
3   !!                       ***  MODULE  trcbbl  ***
4   !! Ocean passive tracers physics :  advective and/or diffusive bottom boundary
5   !!                                  layer scheme
6   !!======================================================================
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
15   !!----------------------------------------------------------------------
16#if  defined key_top &&  defined key_trabbl 
17   !!----------------------------------------------------------------------
18   !!   'key_trabbl                      diffusive or/and adevective bottom boundary layer
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 active tracers variables
23   USE trc                 ! ocean passive tracers variables
24   USE trcnam_trp      ! passive tracers transport namelist variables
25   USE trabbl_crs              !
26   USE prtctl_trc          ! Print control for debbuging
27   USE trdmod_oce
28   USE trdtra
29
30   PUBLIC   trc_bbl_crs       !  routine called by step.F90
31
32
33   !! * Substitutions
34#  include "top_substitute.h90"
35   !!----------------------------------------------------------------------
36   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
37   !! $Id: trcbbl.F90 3294 2012-01-28 16:44:18Z rblod $
38   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
39   !!----------------------------------------------------------------------
40
41CONTAINS
42
43
44   SUBROUTINE trc_bbl_crs( kt )
45      !!----------------------------------------------------------------------
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.
51      !!
52      !!---------------------------------------------------------------------- 
53      INTEGER, INTENT( in ) ::   kt   ! ocean time-step
54      CHARACTER (len=22) :: charout
55      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   ztrtrd
56      !!----------------------------------------------------------------------
57      !
58!      WRITE(numout,*) '          nn_bbl_ldf_test     = ' , nn_bbl_ldf
59     
60      IF( nn_timing == 1 )  CALL timing_start('trc_bbl')
61      !
62      IF( .NOT. lk_offline .AND. nn_dttrc == 1 ) THEN
63         CALL bbl_crs( kt, nittrc000, 'TRC' )      ! Online coupling with dynamics  : Computation of bbl coef and bbl transport
64         l_bbl_crs = .FALSE.                       ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files
65      ENDIF
66
67      IF( l_trdtrc )  THEN
68         CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends
69         ztrtrd(:,:,:,:)  = tra(:,:,:,:)
70      ENDIF
71
72      !* Diffusive bbl :
73      IF( nn_bbl_ldf == 1 ) THEN
74 
75         CALL tra_bbl_dif_crs( trb, tra, jptra ) 
76         IF( ln_ctl )   THEN
77            WRITE(charout, FMT="(' bbl_dif')")  ;  CALL prt_ctl_trc_info(charout)
78            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
79         ENDIF
80         !
81      END IF
82
83      !* Advective bbl : bbl upstream advective trends added to the tracer trends
84      IF( nn_bbl_adv /= 0 ) THEN
85         !
86         CALL tra_bbl_adv_crs( trb, tra, jptra ) 
87         IF( ln_ctl )   THEN
88            WRITE(charout, FMT="(' bbl_adv')")  ;  CALL prt_ctl_trc_info(charout)
89            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
90         ENDIF
91         !
92      END IF
93
94      IF( l_trdtrc )   THEN                      ! save the horizontal diffusive trends for further diagnostics
95        DO jn = 1, jptra
96           ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn)
97           CALL trd_tra( kt, 'TRC', jn, jptra_trd_ldf, ztrtrd(:,:,:,jn) )
98        END DO
99        CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends
100      ENDIF
101      !
102      IF( nn_timing == 1 ) CALL timing_stop('trc_bbl')
103      !
104   END SUBROUTINE trc_bbl_crs
105
106#else
107   !!----------------------------------------------------------------------
108   !!   Dummy module :                      No bottom boundary layer scheme
109   !!----------------------------------------------------------------------
110CONTAINS
111   SUBROUTINE trc_bbl_crs( kt )              ! Empty routine
112      WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt
113   END SUBROUTINE trc_bbl_crs
114#endif
115
116   !!======================================================================
117END MODULE trcbbl_crs
Note: See TracBrowser for help on using the repository browser.