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.
trctrp.F90 in branches/UKMO/dev_r5518_GO6_under_ice_relax_dr_hook/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/UKMO/dev_r5518_GO6_under_ice_relax_dr_hook/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90 @ 11738

Last change on this file since 11738 was 11738, checked in by marc, 5 years ago

The Dr Hook changes from my perl code.

File size: 7.2 KB
Line 
1MODULE trctrp
2   !!======================================================================
3   !!                       ***  MODULE trctrp  ***
4   !! Ocean Physics    : manage the passive tracer transport
5   !!======================================================================
6   !! History :   1.0  !  2004-03 (C. Ethe) Original code
7   !!             3.3  !  2010-07 (C. Ethe) Merge TRA-TRC
8   !!----------------------------------------------------------------------
9#if defined key_top
10   !!----------------------------------------------------------------------
11   !!   'key_top'                                                TOP models
12   !!----------------------------------------------------------------------
13   !!   trc_trp        : passive tracer transport
14   !!----------------------------------------------------------------------
15   USE oce_trc         ! ocean dynamics and active tracers variables
16   USE trc             ! ocean passive tracers variables
17   USE trcnam_trp      ! passive tracers transport namelist variables
18   USE trabbl          ! bottom boundary layer               (trc_bbl routine)
19   USE trcbbl          ! bottom boundary layer               (trc_bbl routine)
20   USE zdfkpp          ! KPP non-local tracer fluxes         (trc_kpp routine)
21   USE trcdmp          ! internal damping                    (trc_dmp routine)
22   USE trcldf          ! lateral mixing                      (trc_ldf routine)
23   USE trcadv          ! advection                           (trc_adv routine)
24   USE trczdf          ! vertical diffusion                  (trc_zdf routine)
25   USE trcnxt          ! time-stepping                       (trc_nxt routine)
26   USE trcrad          ! positivity                          (trc_rad routine)
27   USE trcsbc          ! surface boundary condition          (trc_sbc routine)
28   USE zpshde          ! partial step: hor. derivative       (zps_hde routine)
29# if defined key_debug_medusa
30   USE trcstat
31# endif
32
33
34#if defined key_agrif
35   USE agrif_top_sponge ! tracers sponges
36   USE agrif_top_update ! tracers updates
37#endif
38
39   USE yomhook, ONLY: lhook, dr_hook
40   USE parkind1, ONLY: jprb, jpim
41
42   IMPLICIT NONE
43   PRIVATE
44
45   PUBLIC   trc_trp    ! called by trc_stp
46
47   !! * Substitutions
48#  include "top_substitute.h90"
49   !!----------------------------------------------------------------------
50   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
51   !! $Id$
52   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
53   !!----------------------------------------------------------------------
54
55CONTAINS
56
57   SUBROUTINE trc_trp( kstp )
58      !!----------------------------------------------------------------------
59      !!                     ***  ROUTINE trc_trp  ***
60      !!                     
61      !! ** Purpose :   Management of passive tracers transport
62      !!
63      !! ** Method  : - Compute the passive tracers trends
64      !!              - Update the passive tracers
65      !!----------------------------------------------------------------------
66      INTEGER, INTENT( in ) ::  kstp  ! ocean time-step index
67      INTEGER(KIND=jpim), PARAMETER :: zhook_in = 0
68      INTEGER(KIND=jpim), PARAMETER :: zhook_out = 1
69      REAL(KIND=jprb)               :: zhook_handle
70
71      CHARACTER(LEN=*), PARAMETER :: RoutineName='TRC_TRP'
72
73      IF (lhook) CALL dr_hook(RoutineName,zhook_in,zhook_handle)
74
75      !! ---------------------------------------------------------------------
76      !
77      IF( nn_timing == 1 )   CALL timing_start('trc_trp')
78      !
79      IF( .NOT. lk_c1d ) THEN
80         !
81                                CALL trc_sbc( kstp )            ! surface boundary condition
82# if defined key_debug_medusa
83         IF(lwp) WRITE(numout,*) ' MEDUSA trc_trp after trc_sbc at kt =', kstp
84         CALL trc_rst_tra_stat
85         CALL flush(numout)
86# endif
87         IF( lk_trabbl )        CALL trc_bbl( kstp )            ! advective (and/or diffusive) bottom boundary layer scheme
88         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
89                                CALL trc_adv( kstp )            ! horizontal & vertical advection
90         IF( ln_zps ) THEN
91           IF( ln_isfcav ) THEN ; CALL zps_hde_isf( kstp, jptra, trb, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! both top & bottom
92           ELSE                 ; CALL zps_hde    ( kstp, jptra, trb, gtru, gtrv )                                      !  only bottom
93           ENDIF
94         ENDIF
95                                CALL trc_ldf( kstp )            ! lateral mixing
96         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
97            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
98#if defined key_agrif
99         IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc           ! tracers sponge
100#endif
101                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
102                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
103# if defined key_debug_medusa
104         IF(lwp) WRITE(numout,*) ' MEDUSA trc_trp after trc_nxt at kt =', kstp
105         CALL trc_rst_tra_stat
106         CALL flush(numout)
107# endif
108         IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations
109         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only
110
111#if defined key_agrif
112      IF( .NOT. Agrif_Root())   CALL Agrif_Update_Trc( kstp )   ! Update tracer at AGRIF zoom boundaries : children only
113#endif
114
115      ELSE                                               ! 1D vertical configuration
116                                CALL trc_sbc( kstp )            ! surface boundary condition
117         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
118            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
119                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
120                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
121          IF( ln_trcrad )       CALL trc_rad( kstp )            ! Correct artificial negative concentrations
122         !
123      END IF
124      !
125      IF( nn_timing == 1 )   CALL timing_stop('trc_trp')
126      !
1279400  FORMAT(a25,i4,D23.16)
128      !
129      IF (lhook) CALL dr_hook(RoutineName,zhook_out,zhook_handle)
130   END SUBROUTINE trc_trp
131
132#else
133   !!----------------------------------------------------------------------
134   !!   Dummy module :                                        No TOP models
135   !!----------------------------------------------------------------------
136CONTAINS
137   SUBROUTINE trc_trp( kstp )              ! Empty routine
138      INTEGER, INTENT(in) ::   kstp
139      INTEGER(KIND=jpim), PARAMETER :: zhook_in = 0
140      INTEGER(KIND=jpim), PARAMETER :: zhook_out = 1
141      REAL(KIND=jprb)               :: zhook_handle
142
143      CHARACTER(LEN=*), PARAMETER :: RoutineName='TRC_TRP'
144
145      IF (lhook) CALL dr_hook(RoutineName,zhook_in,zhook_handle)
146
147      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp
148      IF (lhook) CALL dr_hook(RoutineName,zhook_out,zhook_handle)
149   END SUBROUTINE trc_trp
150#endif
151   
152   !!======================================================================
153END MODULE trctrp
Note: See TracBrowser for help on using the repository browser.