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.
dynzdf.F90 in trunk/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: trunk/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90 @ 2528

Last change on this file since 2528 was 2528, checked in by rblod, 13 years ago

Update NEMOGCM from branch nemo_v3_3_beta

  • Property svn:keywords set to Id
File size: 6.5 KB
Line 
1MODULE dynzdf
2   !!==============================================================================
3   !!                 ***  MODULE  dynzdf  ***
4   !! Ocean dynamics :  vertical component of the momentum mixing trend
5   !!==============================================================================
6   !! History :  1.0  !  2005-11  (G. Madec)  Original code
7   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
8   !!----------------------------------------------------------------------
9
10   !!----------------------------------------------------------------------
11   !!   dyn_zdf      : Update the momentum trend with the vertical diffusion
12   !!   dyn_zdf_init : initializations of the vertical diffusion scheme
13   !!----------------------------------------------------------------------
14   USE oce             ! ocean dynamics and tracers variables
15   USE dom_oce         ! ocean space and time domain variables
16   USE zdf_oce         ! ocean vertical physics variables
17
18   USE dynzdf_exp      ! vertical diffusion: explicit (dyn_zdf_exp     routine)
19   USE dynzdf_imp      ! vertical diffusion: implicit (dyn_zdf_imp     routine)
20
21   USE ldfdyn_oce      ! ocean dynamics: lateral physics
22   USE trdmod          ! ocean active dynamics and tracers trends
23   USE trdmod_oce      ! ocean variables trends
24   USE in_out_manager  ! I/O manager
25   USE prtctl          ! Print control
26
27   IMPLICIT NONE
28   PRIVATE
29
30   PUBLIC   dyn_zdf       !  routine called by step.F90
31   PUBLIC   dyn_zdf_init  !  routine called by opa.F90
32
33   INTEGER  ::   nzdf = 0   ! type vertical diffusion algorithm used, defined from ln_zdf... namlist logicals
34   REAL(wp) ::   r2dt       ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0
35
36   !! * Substitutions
37#  include "domzgr_substitute.h90"
38#  include "zdfddm_substitute.h90"
39#  include "vectopt_loop_substitute.h90"
40   !!----------------------------------------------------------------------
41   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
42   !! $Id$
43   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
44   !!----------------------------------------------------------------------
45
46CONTAINS
47   
48   SUBROUTINE dyn_zdf( kt )
49      !!----------------------------------------------------------------------
50      !!                  ***  ROUTINE dyn_zdf  ***
51      !!
52      !! ** Purpose :   compute the vertical ocean dynamics physics.
53      !!---------------------------------------------------------------------
54      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
55      !!
56      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
57      !!---------------------------------------------------------------------
58
59      !                                          ! set time step
60      IF( neuler == 0 .AND. kt == nit000     ) THEN   ;   r2dt =      rdt   ! = rdtra (restart with Euler time stepping)
61      ELSEIF(               kt <= nit000 + 1 ) THEN   ;   r2dt = 2. * rdt   ! = 2 rdttra (leapfrog)
62      ENDIF
63
64      IF( l_trddyn )   THEN                      ! temporary save of ta and sa trends
65         ztrdu(:,:,:) = ua(:,:,:)
66         ztrdv(:,:,:) = va(:,:,:)
67      ENDIF
68
69      SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend
70      !
71      CASE ( 0 )   ;   CALL dyn_zdf_exp( kt, r2dt )      ! explicit scheme
72      CASE ( 1 )   ;   CALL dyn_zdf_imp( kt, r2dt )      ! implicit scheme
73      !
74      CASE ( -1 )                                      ! esopa: test all possibility with control print
75                       CALL dyn_zdf_exp( kt, r2dt )
76                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf0 - Ua: ', mask1=umask,               &
77            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
78                       CALL dyn_zdf_imp( kt, r2dt )
79                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf1 - Ua: ', mask1=umask,               &
80            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
81      END SELECT
82
83      IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
84         ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
85         ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
86         CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_zdf, 'DYN', kt )
87      ENDIF
88      !                                          ! print mean trends (used for debugging)
89      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf  - Ua: ', mask1=umask,               &
90            &                    tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
91      !
92   END SUBROUTINE dyn_zdf
93
94
95   SUBROUTINE dyn_zdf_init
96      !!----------------------------------------------------------------------
97      !!                 ***  ROUTINE dyn_zdf_init  ***
98      !!
99      !! ** Purpose :   initializations of the vertical diffusion scheme
100      !!
101      !! ** Method  :   implicit (euler backward) scheme (default)
102      !!                explicit (time-splitting) scheme if ln_zdfexp=T
103      !!----------------------------------------------------------------------
104      USE zdftke
105      USE zdfgls
106      USE zdfkpp
107      !!----------------------------------------------------------------------
108      !
109      ! Choice from ln_zdfexp read in namelist in zdfini
110      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme
111      ELSE                   ;   nzdf = 1           ! use implicit scheme
112      ENDIF
113      !
114      ! Force implicit schemes
115      IF( lk_zdftke .OR. lk_zdfgls .OR. lk_zdfkpp )   nzdf = 1   ! TKE, GLS or KPP physics
116      IF( ln_dynldf_iso                           )   nzdf = 1   ! iso-neutral lateral physics
117      IF( ln_dynldf_hor .AND. ln_sco              )   nzdf = 1   ! horizontal lateral physics in s-coordinate
118      !
119      IF( lk_esopa )    nzdf = -1                   ! Esopa key: All schemes used
120      !
121      IF(lwp) THEN                                  ! Print the choice
122         WRITE(numout,*)
123         WRITE(numout,*) 'dyn_zdf_init : vertical dynamics physics scheme'
124         WRITE(numout,*) '~~~~~~~~~~~'
125         IF( nzdf == -1 )   WRITE(numout,*) '              ESOPA test All scheme used'
126         IF( nzdf ==  0 )   WRITE(numout,*) '              Explicit time-splitting scheme'
127         IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme'
128      ENDIF
129      !
130   END SUBROUTINE dyn_zdf_init
131
132   !!==============================================================================
133END MODULE dynzdf
Note: See TracBrowser for help on using the repository browser.