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/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90 @ 8213

Last change on this file since 8213 was 8213, checked in by jpalmier, 7 years ago

JPALM -- split trcbio - mergeable-ish MEDUSA branch

File size: 6.6 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 trcrst
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   IMPLICIT NONE
40   PRIVATE
41
42   PUBLIC   trc_trp    ! called by trc_stp
43
44   !! * Substitutions
45#  include "top_substitute.h90"
46   !!----------------------------------------------------------------------
47   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
48   !! $Id$
49   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
50   !!----------------------------------------------------------------------
51
52CONTAINS
53
54   SUBROUTINE trc_trp( kstp )
55      !!----------------------------------------------------------------------
56      !!                     ***  ROUTINE trc_trp  ***
57      !!                     
58      !! ** Purpose :   Management of passive tracers transport
59      !!
60      !! ** Method  : - Compute the passive tracers trends
61      !!              - Update the passive tracers
62      !!----------------------------------------------------------------------
63      INTEGER, INTENT( in ) ::  kstp  ! ocean time-step index
64      !! ---------------------------------------------------------------------
65      !
66      IF( nn_timing == 1 )   CALL timing_start('trc_trp')
67      !
68      IF( .NOT. lk_c1d ) THEN
69         !
70                                CALL trc_sbc( kstp )            ! surface boundary condition
71# if defined key_debug_medusa
72         IF(lwp) WRITE(numout,*) ' MEDUSA trc_trp after trc_sbc at kt =', kstp
73         CALL trc_rst_tra_stat
74         CALL flush(numout)
75# endif
76         IF( lk_trabbl )        CALL trc_bbl( kstp )            ! advective (and/or diffusive) bottom boundary layer scheme
77         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
78         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only
79                                CALL trc_adv( kstp )            ! horizontal & vertical advection
80                                CALL trc_ldf( kstp )            ! lateral mixing
81         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
82            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
83#if defined key_agrif
84         IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc           ! tracers sponge
85#endif
86                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
87                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
88# if defined key_debug_medusa
89         IF(lwp) WRITE(numout,*) ' MEDUSA trc_trp after trc_nxt at kt =', kstp
90         CALL trc_rst_tra_stat
91         CALL flush(numout)
92# endif
93         IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations
94
95#if defined key_agrif
96      IF( .NOT. Agrif_Root())   CALL Agrif_Update_Trc( kstp )   ! Update tracer at AGRIF zoom boundaries : children only
97#endif
98
99         IF( ln_zps  .AND. .NOT. ln_isfcav)        &
100            &            CALL zps_hde    ( kstp, jptra, trn, gtru, gtrv )   ! Partial steps: now horizontal gradient of passive
101         IF( ln_zps .AND.        ln_isfcav)        &
102            &            CALL zps_hde_isf( kstp, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! Partial steps: now horizontal gradient of passive
103                                                                ! tracers at the bottom ocean level
104         !
105      ELSE                                               ! 1D vertical configuration
106                                CALL trc_sbc( kstp )            ! surface boundary condition
107         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
108            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
109                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
110                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
111          IF( ln_trcrad )       CALL trc_rad( kstp )            ! Correct artificial negative concentrations
112         !
113      END IF
114      !
115      IF( nn_timing == 1 )   CALL timing_stop('trc_trp')
116      !
117   END SUBROUTINE trc_trp
118
119#else
120   !!----------------------------------------------------------------------
121   !!   Dummy module :                                        No TOP models
122   !!----------------------------------------------------------------------
123CONTAINS
124   SUBROUTINE trc_trp( kstp )              ! Empty routine
125      INTEGER, INTENT(in) ::   kstp
126      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp
127   END SUBROUTINE trc_trp
128#endif
129   
130   !!======================================================================
131END MODULE trctrp
Note: See TracBrowser for help on using the repository browser.