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

Last change on this file since 11872 was 11872, checked in by acc, 11 months ago

Branch 2019/fix_sn_cfctl_ticket2328. See #2328. Replacement of ln_ctl and activation of full functionality with
sn_cfctl structure. These changes rename structure components l_mppout and l_mpptop as l_prtctl and l_prttrc
and introduce l_glochk to activate former ln_ctl code in stpctl.F90 to perform global location of min and max
checks. Also added is l_allon which can be used to activate all output (much like the former ln_ctl). If l_allon
is .false. then l_config decides whether or not the suboptions are used.

   sn_cfctl%l_glochk = .FALSE.    ! Range sanity checks are local (F) or global (T). Set T for debugging only
   sn_cfctl%l_allon  = .FALSE.    ! IF T activate all options. If F deactivate all unless l_config is T
   sn_cfctl%l_config = .TRUE.     ! IF .true. then control which reports are written with the remaining options

Note, these changes pass SETTE tests but all references to ln_ctl need to be removed from the sette scripts.

  • Property svn:keywords set to Id
File size: 4.6 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 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
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 )
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 :: jn                   ! loop index
49      CHARACTER (len=22) :: charout
50      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrtrd
51      !!----------------------------------------------------------------------
52      !
53      IF( ln_timing )   CALL timing_start('trc_bbl')
54      !
55      IF( .NOT. l_offline .AND. nn_dttrc == 1 ) THEN
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
58      ENDIF
59
60      IF( l_trdtrc )  THEN
61         ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends
62         ztrtrd(:,:,:,:)  = tra(:,:,:,:)
63      ENDIF
64
65      !* Diffusive bbl :
66      IF( nn_bbl_ldf == 1 ) THEN
67         !
68         CALL tra_bbl_dif( trb, tra, jptra ) 
69         IF( sn_cfctl%l_prttrc )   THEN
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         !
74      ENDIF
75
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 ) 
80         IF( sn_cfctl%l_prttrc )   THEN
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         !
85      ENDIF
86
87      IF( l_trdtrc )   THEN                      ! save the horizontal diffusive trends for further diagnostics
88        DO jn = 1, jptra
89           ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn)
90           CALL trd_tra( kt, 'TRC', jn, jptra_bbl, ztrtrd(:,:,:,jn) )
91        END DO
92        DEALLOCATE( ztrtrd ) ! temporary save of trends
93      ENDIF
94      !
95      IF( ln_timing )   CALL timing_stop('trc_bbl')
96      !
97   END SUBROUTINE trc_bbl
98
99#endif
100
101   !!======================================================================
102END MODULE trcbbl
Note: See TracBrowser for help on using the repository browser.