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

source: branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90 @ 7865

Last change on this file since 7865 was 7865, checked in by marc, 7 years ago

Adding extra arguments to ZPS_HDE

File size: 6.4 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 dom_oce, ONLY: e3w_n, gdep3w_n, gdept_n
17   USE trc             ! ocean passive tracers variables
18   USE trcnam_trp      ! passive tracers transport namelist variables
19   USE trabbl          ! bottom boundary layer               (trc_bbl routine)
20   USE trcbbl          ! bottom boundary layer               (trc_bbl routine)
21   USE zdfkpp          ! KPP non-local tracer fluxes         (trc_kpp routine)
22   USE trcdmp          ! internal damping                    (trc_dmp routine)
23   USE trcldf          ! lateral mixing                      (trc_ldf routine)
24   USE trcadv          ! advection                           (trc_adv routine)
25   USE trczdf          ! vertical diffusion                  (trc_zdf routine)
26   USE trcnxt          ! time-stepping                       (trc_nxt routine)
27   USE trcrad          ! positivity                          (trc_rad routine)
28   USE trcsbc          ! surface boundary condition          (trc_sbc routine)
29   USE zpshde          ! partial step: hor. derivative       (zps_hde routine)
30
31#if defined key_agrif
32   USE agrif_top_sponge ! tracers sponges
33   USE agrif_top_update ! tracers updates
34#endif
35
36   IMPLICIT NONE
37   PRIVATE
38
39   PUBLIC   trc_trp    ! called by trc_stp
40
41   !! * Substitutions
42#  include "top_substitute.h90"
43   !!----------------------------------------------------------------------
44   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
45   !! $Id$
46   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
47   !!----------------------------------------------------------------------
48
49CONTAINS
50
51   SUBROUTINE trc_trp( kstp )
52      !!----------------------------------------------------------------------
53      !!                     ***  ROUTINE trc_trp  ***
54      !!                     
55      !! ** Purpose :   Management of passive tracers transport
56      !!
57      !! ** Method  : - Compute the passive tracers trends
58      !!              - Update the passive tracers
59      !!----------------------------------------------------------------------
60      INTEGER, INTENT( in ) ::  kstp  ! ocean time-step index
61      !! ---------------------------------------------------------------------
62      !
63      IF( nn_timing == 1 )   CALL timing_start('trc_trp')
64      !
65      IF( .NOT. lk_c1d ) THEN
66         !
67                                CALL trc_sbc( kstp )            ! surface boundary condition
68         IF( lk_trabbl )        CALL trc_bbl( kstp )            ! advective (and/or diffusive) bottom boundary layer scheme
69         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
70         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only
71                                CALL trc_adv( kstp )            ! horizontal & vertical advection
72                                CALL trc_ldf( kstp )            ! lateral mixing
73         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
74            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
75#if defined key_agrif
76         IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc           ! tracers sponge
77#endif
78                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
79                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
80         IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations
81
82#if defined key_agrif
83      IF( .NOT. Agrif_Root())   CALL Agrif_Update_Trc( kstp )   ! Update tracer at AGRIF zoom boundaries : children only
84#endif
85
86         IF( ln_zps  .AND. .NOT. ln_isfcav)        &
87            &            CALL zps_hde    ( kstp, jptra, trn, e3w_n, gdept_n, &
88            &                              gtru, gtrv )   ! Partial steps: now horizontal gradient of passive
89         IF( ln_zps .AND.        ln_isfcav)        &
90            &            CALL zps_hde_isf( kstp, jptra, trn,                 &
91            &                              e3w_n, gdept_n, gdep3w_n,         &
92            &                              pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! Partial steps: now horizontal gradient of passive
93                                                                ! tracers at the bottom ocean level
94         !
95      ELSE                                               ! 1D vertical configuration
96                                CALL trc_sbc( kstp )            ! surface boundary condition
97         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
98            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
99                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
100                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
101          IF( ln_trcrad )       CALL trc_rad( kstp )            ! Correct artificial negative concentrations
102         !
103      END IF
104      !
105      IF( nn_timing == 1 )   CALL timing_stop('trc_trp')
106      !
107   END SUBROUTINE trc_trp
108
109#else
110   !!----------------------------------------------------------------------
111   !!   Dummy module :                                        No TOP models
112   !!----------------------------------------------------------------------
113CONTAINS
114   SUBROUTINE trc_trp( kstp )              ! Empty routine
115      INTEGER, INTENT(in) ::   kstp
116      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp
117   END SUBROUTINE trc_trp
118#endif
119   
120   !!======================================================================
121END MODULE trctrp
Note: See TracBrowser for help on using the repository browser.