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

source: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90 @ 7217

Last change on this file since 7217 was 7217, checked in by cbricaud, 7 years ago

CRS branch: code cleaning

  • Property svn:keywords set to Id
File size: 7.1 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 crs, ONLY: fmmflx_crs
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 trabbl_crs      ! bottom boundary layer               (trc_bbl routine)
21   USE trcbbl          ! bottom boundary layer               (trc_bbl routine)
22   USE trcbbl_crs      ! bottom boundary layer               (trc_bbl routine)
23   USE zdfkpp          ! KPP non-local tracer fluxes         (trc_kpp routine)
24   USE trcdmp          ! internal damping                    (trc_dmp routine)
25   USE trcldf          ! lateral mixing                      (trc_ldf routine)
26   USE trcldf_crs      ! lateral mixing                      (trc_ldf routine)
27   USE trcadv          ! advection                           (trc_adv routine)
28   USE trcadv_crs      ! advection                           (trc_adv routine)
29   USE trczdf          ! vertical diffusion                  (trc_zdf routine)
30   USE trczdf_crs      ! vertical diffusion                  (trc_zdf routine
31   USE trcnxt          ! time-stepping                       (trc_nxt routine)
32   USE trcrad          ! positivity                          (trc_rad routine)
33   USE trcsbc          ! surface boundary condition          (trc_sbc routine)
34   USE zpshde          ! partial step: hor. derivative       (zps_hde routine)
35   USE zpshde_crs      ! partial step: hor. derivative       (zps_hde routine)
36   USE dom_oce , ONLY : ln_isfcav
37   USE crs     , ONLY : jpi_crs,jpj_crs,wn_crs,ln_crs_top,sbc_trc_crs,sbc_trc_b_crs
38   USE ldfslp_crs
39#if defined key_agrif
40   USE agrif_top_sponge ! tracers sponges
41   USE agrif_top_update ! tracers updates
42#endif
43   USE ieee_arithmetic
44
45   IMPLICIT NONE
46   PRIVATE
47
48   PUBLIC   trc_trp    ! called by trc_stp
49
50   !! * Substitutions
51#  include "top_substitute.h90"
52   !!----------------------------------------------------------------------
53   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
54   !! $Id$
55   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
56   !!----------------------------------------------------------------------
57
58CONTAINS
59
60   SUBROUTINE trc_trp( kstp )
61      !!----------------------------------------------------------------------
62      !!                     ***  ROUTINE trc_trp  ***
63      !!                     
64      !! ** Purpose :   Management of passive tracers transport
65      !!
66      !! ** Method  : - Compute the passive tracers trends
67      !!              - Update the passive tracers
68      !!----------------------------------------------------------------------
69      INTEGER, INTENT( in ) ::  kstp  ! ocean time-step index
70      REAL(wp) :: zmin,zmax
71      INTEGER :: ji,jj,jk
72      !! ---------------------------------------------------------------------
73      !
74      IF( nn_timing == 1 )   CALL timing_start('trc_trp')
75      !
76      IF( .NOT. lk_c1d ) THEN
77         !
78                               CALL trc_sbc( kstp )
79         IF( ln_crs_top ) THEN ;    CALL trc_bbl_crs( kstp )
80         ELSE              ;    CALL trc_bbl( kstp )
81         ENDIF
82         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
83
84         IF( ln_crs_top ) THEN ;    CALL trc_adv_crs( kstp )
85         ELSE              ;    CALL trc_adv( kstp )
86         ENDIF
87
88         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only
89         IF( ln_crs_top ) THEN ;    CALL trc_ldf_crs( kstp )
90         ELSE              ;    CALL trc_ldf( kstp )
91         ENDIF
92         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
93            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
94#if defined key_agrif
95         IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc           ! tracers sponge
96#endif
97         IF( ln_crs_top ) THEN ;    CALL trc_zdf_crs( kstp )
98         ELSE              ;    CALL trc_zdf( kstp )
99         ENDIF
100
101                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
102         IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations
103
104#if defined key_agrif
105      IF( .NOT. Agrif_Root())   CALL Agrif_Update_Trc( kstp )   ! Update tracer at AGRIF zoom boundaries : children only
106#endif
107          ! Partial steps: now horizontal gradient of passive
108         IF( ln_zps    )THEN
109            IF( ln_crs_top ) THEN 
110               CALL zps_hde_crs( kstp, jptra, trn, gtru, gtrv )
111            ELSE
112               IF( ln_isfcav )THEN
113                  CALL zps_hde_isf( kstp, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! Partial steps: now horizontal gradient of passive
114               ELSE
115                  CALL zps_hde    ( kstp, jptra, trn, gtru, gtrv )   ! Partial steps: now horizontal gradient of passive
116               ENDIF
117            ENDIF
118         ENDIF
119                                                                ! tracers at the bottom ocean level
120         !
121      ELSE                                               ! 1D vertical configuration
122                                CALL trc_sbc( kstp )            ! surface boundary condition
123         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
124            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
125                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
126                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
127          IF( ln_trcrad )       CALL trc_rad( kstp )            ! Correct artificial negative concentrations
128         !
129      END IF
130      !
131      IF( nn_timing == 1 )   CALL timing_stop('trc_trp')
132      !
133   END SUBROUTINE trc_trp
134
135#else
136   !!----------------------------------------------------------------------
137   !!   Dummy module :                                        No TOP models
138   !!----------------------------------------------------------------------
139CONTAINS
140   SUBROUTINE trc_trp( kstp )              ! Empty routine
141      INTEGER, INTENT(in) ::   kstp
142      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp
143   END SUBROUTINE trc_trp
144#endif
145   
146   !!======================================================================
147END MODULE trctrp
Note: See TracBrowser for help on using the repository browser.