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.
trczdf.F90 in NEMO/trunk/src/TOP/TRP – NEMO

source: NEMO/trunk/src/TOP/TRP/trczdf.F90 @ 12489

Last change on this file since 12489 was 12489, checked in by davestorkey, 4 years ago

Preparation for new timestepping scheme #2390.
Main changes:

  1. Initial euler timestep now handled in stp and not in TRA/DYN routines.
  2. Renaming of all timestep parameters. In summary, the namelist parameter is now rn_Dt and the current timestep is rDt (and rDt_ice, rDt_trc etc).
  3. Renaming of a few miscellaneous parameters, eg. atfp -> rn_atfp (namelist parameter used everywhere) and rau0 -> rho0.

This version gives bit-comparable results to the previous version of the trunk.

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1MODULE trczdf
2   !!==============================================================================
3   !!                 ***  MODULE  trczdf  ***
4   !! Ocean Passive tracers : vertical diffusive trends
5   !!=====================================================================
6   !! History :  9.0  ! 2005-11  (G. Madec)  Original code
7   !!       NEMO 3.0  ! 2008-01  (C. Ethe, G. Madec)  merge TRC-TRA
8   !!            4.0  ! 2017-04  (G. Madec)  remove the explicit case
9   !!----------------------------------------------------------------------
10#if defined key_top
11   !!----------------------------------------------------------------------
12   !!   'key_top'                                                TOP models
13   !!----------------------------------------------------------------------
14   !!   trc_zdf      : update the tracer trend with the vertical diffusion
15   !!----------------------------------------------------------------------
16   USE trc           ! ocean passive tracers variables
17   USE oce_trc       ! ocean dynamics and active tracers
18   USE trd_oce       ! trends: ocean variables
19   USE trazdf        ! tracer: vertical diffusion
20!!gm do we really need this ?
21   USE trcldf        ! passive tracers: lateral diffusion
22!!gm
23   USE trdtra        ! trends manager: tracers
24   USE prtctl_trc    ! Print control
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   trc_zdf         ! called by step.F90
30   
31   !!----------------------------------------------------------------------
32   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
33   !! $Id$
34   !! Software governed by the CeCILL license (see ./LICENSE)
35   !!----------------------------------------------------------------------
36CONTAINS
37
38   SUBROUTINE trc_zdf( kt, Kbb, Kmm, Krhs, ptr, Kaa )
39      !!----------------------------------------------------------------------
40      !!                  ***  ROUTINE trc_zdf  ***
41      !!
42      !! ** Purpose :   compute the vertical ocean tracer physics using
43      !!              an implicit time-stepping scheme.
44      !!---------------------------------------------------------------------
45      INTEGER                                   , INTENT(in   ) ::   kt                   ! ocean time-step index
46      INTEGER                                   , INTENT(in   ) ::   Kbb, Kmm, Krhs, Kaa  ! ocean time level indices
47      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) ::   ptr                  ! passive tracers and RHS of tracer equation
48      !
49      INTEGER               ::  jk, jn
50      CHARACTER (len=22)    :: charout
51      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) ::   ztrtrd   ! 4D workspace
52      !!---------------------------------------------------------------------
53      !
54      IF( ln_timing )   CALL timing_start('trc_zdf')
55      !
56      IF( l_trdtrc )   ztrtrd(:,:,:,:)  = ptr(:,:,:,:,Krhs)
57      !
58      CALL tra_zdf_imp( kt, nittrc000, 'TRC', rDt_trc, Kbb, Kmm, Krhs, ptr, Kaa, jptra )    !   implicit scheme         
59      !
60      IF( l_trdtrc )   THEN                      ! save the vertical diffusive trends for further diagnostics
61         DO jn = 1, jptra
62            DO jk = 1, jpkm1
63               ztrtrd(:,:,jk,jn) = ( ( ptr(:,:,jk,jn,Kaa) - ptr(:,:,jk,jn,Kbb) ) / rDt_trc ) - ztrtrd(:,:,jk,jn)
64            END DO
65            CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) )
66         END DO
67      ENDIF
68      !                                          ! print mean trends (used for debugging)
69      IF( sn_cfctl%l_prttrc )   THEN
70         WRITE(charout, FMT="('zdf ')")
71         CALL prt_ctl_trc_info(charout)
72         CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kaa), mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
73      END IF
74      !
75      IF( ln_timing )  CALL timing_stop('trc_zdf')
76      !
77   END SUBROUTINE trc_zdf
78   
79#else
80   !!----------------------------------------------------------------------
81   !!   Default option                                         Empty module
82   !!----------------------------------------------------------------------
83CONTAINS
84   SUBROUTINE trc_zdf( kt )
85      INTEGER, INTENT(in) :: kt 
86      WRITE(*,*) 'trc_zdf: You should not have seen this print! error?', kt
87   END SUBROUTINE trc_zdf
88#endif
89   !!==============================================================================
90END MODULE trczdf
Note: See TracBrowser for help on using the repository browser.