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 branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

source: branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90 @ 7953

Last change on this file since 7953 was 7953, checked in by gm, 7 years ago

#1880 (HPC-09): add zdfphy (the ZDF manager) + remove all key_...

  • Property svn:keywords set to Id
File size: 3.9 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_exp    ! vertical diffusion: explicit (tra_zdf_exp     routine)
20   USE trazdf_imp    ! vertical diffusion: implicit (tra_zdf_imp     routine)
21   USE trcldf        ! passive tracers: lateral diffusion
22   USE trdtra        ! trends manager: tracers
23   USE prtctl_trc    ! Print control
24
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   trc_zdf         ! called by step.F90
29   
30   !!----------------------------------------------------------------------
31   !! NEMO/TOP 3.7 , NEMO Consortium (2015)
32   !! $Id$
33   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE trc_zdf( kt )
38      !!----------------------------------------------------------------------
39      !!                  ***  ROUTINE trc_zdf  ***
40      !!
41      !! ** Purpose :   compute the vertical ocean tracer physics using
42      !!              an implicit time-stepping scheme.
43      !!---------------------------------------------------------------------
44      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index
45      !
46      INTEGER               ::  jk, jn
47      CHARACTER (len=22)    :: charout
48      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) ::   ztrtrd   ! 4D workspace
49      !!---------------------------------------------------------------------
50      !
51      IF( nn_timing == 1 )  CALL timing_start('trc_zdf')
52      !
53      IF( l_trdtrc )   ztrtrd(:,:,:,:)  = tra(:,:,:,:)
54      !
55      CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra )    !   implicit scheme         
56      !
57      IF( l_trdtrc )   THEN                      ! save the vertical diffusive trends for further diagnostics
58         DO jn = 1, jptra
59            DO jk = 1, jpkm1
60               ztrtrd(:,:,jk,jn) = ( ( tra(:,:,jk,jn) - trb(:,:,jk,jn) ) / r2dttrc ) - ztrtrd(:,:,jk,jn)
61            END DO
62            CALL trd_tra( kt, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) )
63         END DO
64      ENDIF
65      !                                          ! print mean trends (used for debugging)
66      IF( ln_ctl )   THEN
67         WRITE(charout, FMT="('zdf ')")
68         CALL prt_ctl_trc_info(charout)
69         CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
70      END IF
71      !
72      IF( nn_timing == 1 )  CALL timing_stop('trc_zdf')
73      !
74   END SUBROUTINE trc_zdf
75   
76#else
77   !!----------------------------------------------------------------------
78   !!   Default option                                         Empty module
79   !!----------------------------------------------------------------------
80CONTAINS
81   SUBROUTINE trc_zdf( kt )
82      INTEGER, INTENT(in) :: kt 
83      WRITE(*,*) 'trc_zdf: You should not have seen this print! error?', kt
84   END SUBROUTINE trc_zdf
85#endif
86   !!==============================================================================
87END MODULE trczdf
Note: See TracBrowser for help on using the repository browser.