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/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/TOP/TRP – NEMO

source: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/TOP/TRP/trczdf.F90 @ 14219

Last change on this file since 14219 was 14219, checked in by mcastril, 4 years ago

Add Mixed Precision support by Oriol Tintó

  • 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 par_trc        ! need jptra, number of passive tracers
17   USE trc           ! ocean passive tracers variables
18   USE oce_trc       ! ocean dynamics and active tracers
19   USE trd_oce       ! trends: ocean variables
20   USE trazdf        ! tracer: vertical diffusion
21   USE trdtra        ! trends manager: tracers
22   USE prtctl        ! Print control
23
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC   trc_zdf         ! called by step.F90
28   
29#  include "single_precision_substitute.h90"
30   !!----------------------------------------------------------------------
31   !! NEMO/TOP 4.0 , NEMO Consortium (2018)
32   !! $Id$
33   !! Software governed by the CeCILL license (see ./LICENSE)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE trc_zdf( kt, Kbb, Kmm, Krhs, ptr, Kaa )
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      INTEGER                                   , INTENT(in   ) ::   Kbb, Kmm, Krhs, Kaa  ! ocean time level indices
46      REAL(dp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) ::   ptr                  ! passive tracers and RHS of tracer equation
47      !
48      INTEGER               ::  jk, jn
49      CHARACTER (len=22)    :: charout
50      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) ::   ztrtrd   ! 4D workspace
51      !!---------------------------------------------------------------------
52      !
53      IF( ln_timing )   CALL timing_start('trc_zdf')
54      !
55      IF( l_trdtrc )   ztrtrd(:,:,:,:)  = ptr(:,:,:,:,Krhs)
56      !
57      CALL tra_zdf_imp( kt, nittrc000, 'TRC', rDt_trc, Kbb, Kmm, Krhs, ptr, Kaa, jptra )    !   implicit scheme         
58      !
59      IF( l_trdtrc )   THEN                      ! save the vertical diffusive trends for further diagnostics
60         DO jn = 1, jptra
61            DO jk = 1, jpkm1
62               ztrtrd(:,:,jk,jn) = ( ( ptr(:,:,jk,jn,Kaa) - ptr(:,:,jk,jn,Kbb) ) / rDt_trc ) - ztrtrd(:,:,jk,jn)
63            END DO
64            CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) )
65         END DO
66      ENDIF
67      !                                          ! print mean trends (used for debugging)
68      IF( sn_cfctl%l_prttrc )   THEN
69         WRITE(charout, FMT="('zdf ')")
70         CALL prt_ctl_info( charout, cdcomp = 'top' )
71         CALL prt_ctl( tab4d_1=CASTWP(tr(:,:,:,:,Kaa)), mask1=tmask, clinfo=ctrcnm, clinfo3='trd' )
72      END IF
73      !
74      IF( ln_timing )  CALL timing_stop('trc_zdf')
75      !
76   END SUBROUTINE trc_zdf
77   
78#else
79   !!----------------------------------------------------------------------
80   !!   Default option                                         Empty module
81   !!----------------------------------------------------------------------
82CONTAINS
83   SUBROUTINE trc_zdf( kt )
84      INTEGER, INTENT(in) :: kt 
85      WRITE(*,*) 'trc_zdf: You should not have seen this print! error?', kt
86   END SUBROUTINE trc_zdf
87#endif
88   !!==============================================================================
89END MODULE trczdf
Note: See TracBrowser for help on using the repository browser.