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 @ 7256

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

phaze NEMO routines in CRS branch with nemo_v3_6_STABLE branch at rev 7213 (09-09-2016) (merge -r 5519:7213 )

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