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

Last change on this file since 5601 was 5601, checked in by cbricaud, 9 years ago

commit changes/bugfix/... for crs ; ok with time-splitting/fixed volume

  • Property svn:keywords set to Id
File size: 8.0 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 trabbl_crs      ! bottom boundary layer               (trc_bbl routine)
20   USE trcbbl          ! bottom boundary layer               (trc_bbl routine)
21   USE trcbbl_crs      ! bottom boundary layer               (trc_bbl routine)
22   USE zdfkpp          ! KPP non-local tracer fluxes         (trc_kpp routine)
23   USE trcdmp          ! internal damping                    (trc_dmp routine)
24   USE trcldf          ! lateral mixing                      (trc_ldf routine)
25   USE trcldf_crs      ! lateral mixing                      (trc_ldf routine)
26   USE trcadv          ! advection                           (trc_adv routine)
27   USE trcadv_crs      ! advection                           (trc_adv routine)
28   USE trczdf          ! vertical diffusion                  (trc_zdf routine)
29   USE trczdf_crs      ! vertical diffusion                  (trc_zdf routine
30   USE trcnxt          ! time-stepping                       (trc_nxt routine)
31   USE trcrad          ! positivity                          (trc_rad routine)
32   USE trcsbc          ! surface boundary condition          (trc_sbc routine)
33   USE trcsbc_crs      ! 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_crs
37   USE crs     , ONLY : jpi_crs,jpj_crs,wn_crs,ln_crs_top !cbr
38   USE ldfslp_crs
39
40#if defined key_agrif
41   USE agrif_top_sponge ! tracers sponges
42   USE agrif_top_update ! tracers updates
43#endif
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         IF( ln_crs_top ) THEN ;    CALL trc_sbc_crs( kstp )
79         ELSE              ;    CALL trc_sbc( kstp )
80         ENDIF
81         IF( ln_crs_top ) THEN ;    CALL trc_bbl_crs( kstp )
82         ELSE              ;    CALL trc_bbl( kstp )
83         ENDIF
84         IF( ln_trcdmp )        CALL trc_dmp( kstp )            ! internal damping trends
85
86         IF( ln_crs_top ) THEN ;    CALL trc_adv_crs( kstp )
87         ELSE              ;    CALL trc_adv( kstp )
88         ENDIF
89
90         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kstp )        ! internal damping trends on closed seas only
91         IF( ln_crs_top ) THEN ;    CALL trc_ldf_crs( kstp )
92         ELSE              ;    CALL trc_ldf( kstp )
93         ENDIF
94         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
95            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
96#if defined key_agrif
97         IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_trc           ! tracers sponge
98#endif
99         IF( ln_crs_top ) THEN ;    CALL trc_zdf_crs( kstp )
100         ELSE              ;    CALL trc_zdf( kstp )
101         ENDIF
102                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
103         IF( ln_trcrad )        CALL trc_rad( kstp )            ! Correct artificial negative concentrations
104
105#if defined key_agrif
106      IF( .NOT. Agrif_Root())   CALL Agrif_Update_Trc( kstp )   ! Update tracer at AGRIF zoom boundaries : children only
107#endif
108          ! Partial steps: now horizontal gradient of passive
109         IF( ln_zps    )THEN
110         IF( ln_crs_top ) THEN ;    CALL zps_hde_crs( kstp, jptra, trn, gtru, gtrv )
111         ELSE              ;    CALL zps_hde( kstp, jptra, trn, pgtu=gtru, pgtv=gtrv, sgtu=gtrui, sgtv=gtrvi )
112         ENDIF
113         ENDIF
114                                                                ! tracers at the bottom ocean level
115         !
116      ELSE                                               ! 1D vertical configuration
117                                CALL trc_sbc( kstp )            ! surface boundary condition
118         IF( .NOT. lk_offline .AND. lk_zdfkpp )    &
119            &                   CALL trc_kpp( kstp )            ! KPP non-local tracer fluxes
120                                CALL trc_zdf( kstp )            ! vertical mixing and after tracer fields
121                                CALL trc_nxt( kstp )            ! tracer fields at next time step     
122          IF( ln_trcrad )       CALL trc_rad( kstp )            ! Correct artificial negative concentrations
123         !
124      END IF
125      !
126      IF( nn_timing == 1 )   CALL timing_stop('trc_trp')
127      !
128   END SUBROUTINE trc_trp
129   SUBROUTINE test(kt,i)
130   INTEGER,INTENT(IN) :: kt,i
131   REAL(wp)::zmin,zmax
132   INTEGER :: ii,jj,kk
133   zmin=MINVAL( trb(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_min(zmin)
134   zmax=MAXVAL( trb(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_max(zmax)
135   IF(lwp)WRITE(numout,*)"trctrp b ",kt,i,zmin,zmax   
136   zmin=MINVAL( trn(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_min(zmin)
137   zmax=MAXVAL( trn(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_max(zmax)
138   IF(lwp)WRITE(numout,*)"trctrp n ",kt,i,zmin,zmax   
139   zmin=MINVAL( tra(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_min(zmin)
140   zmax=MAXVAL( tra(2:jpi-1,2:jpj-1,:,1),mask=(tmask(2:jpi-1,2:jpj-1,:)==1)) ; CALL mpp_max(zmax)
141   IF(lwp)WRITE(numout,*)"trctrp a ",kt,i,zmin,zmax   
142   zmin=MINVAL( tra(2:jpi-1,2:jpj-1,30,1),mask=(tmask(2:jpi-1,2:jpj-1,30)==1)) ; CALL mpp_min(zmin)
143   zmax=MAXVAL( tra(2:jpi-1,2:jpj-1,30,1),mask=(tmask(2:jpi-1,2:jpj-1,30)==1)) ; CALL mpp_max(zmax)
144
145   END SUBROUTINE test
146#else
147   !!----------------------------------------------------------------------
148   !!   Dummy module :                                        No TOP models
149   !!----------------------------------------------------------------------
150CONTAINS
151   SUBROUTINE trc_trp( kstp )              ! Empty routine
152      INTEGER, INTENT(in) ::   kstp
153      WRITE(*,*) 'trc_trp: You should not have seen this print! error?', kstp
154   END SUBROUTINE trc_trp
155#endif
156   
157   !!======================================================================
158END MODULE trctrp
Note: See TracBrowser for help on using the repository browser.