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/NEMO/OPA_SRC/DYN – NEMO

source: trunk/NEMO/OPA_SRC/DYN/dynzdf.F90 @ 1146

Last change on this file since 1146 was 1146, checked in by rblod, 16 years ago

Add svn Id (first try), see ticket #210

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