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 @ 789

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

Suppress jki routines and associated key_mpp_omp

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 KB
RevLine 
[456]1MODULE dynzdf
2   !!==============================================================================
3   !!                 ***  MODULE  dynzdf  ***
4   !! Ocean dynamics :  vertical component of the momentum mixing trend
5   !!==============================================================================
[503]6   !! History :  9.0  !  05-11  (G. Madec)  Original code
[456]7   !!----------------------------------------------------------------------
[503]8
9   !!----------------------------------------------------------------------
[456]10   !!   dyn_zdf      : Update the momentum trend with the vertical diffusion
[503]11   !!       zdf_ctl  : initializations of the vertical diffusion scheme
[456]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
[503]29   PUBLIC   dyn_zdf    !  routine called by step.F90
[456]30
[503]31   INTEGER  ::   nzdf = 0              ! type vertical diffusion algorithm used
[456]32      !                                ! defined from ln_zdf...  namlist logicals)
33
[503]34   REAL(wp) ::   r2dt                  ! time-step, = 2 rdttra
35      !                                ! except at nit000 (=rdttra) if neuler=0
[456]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)
[719]43   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/DYN/dynzdf.F90,v 1.3 2007/06/05 11:00:28 opalod Exp $
[503]44   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
[456]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
[503]56      !!
57      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
[456]58      !!---------------------------------------------------------------------
59
60      IF( kt == nit000 )   CALL zdf_ctl          ! initialisation & control of options
61
62      !                                          ! set time step
[503]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)
[456]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
[503]73      !
74      CASE ( 0 )   ;   CALL dyn_zdf_exp    ( kt, r2dt )      ! explicit scheme
[789]75      CASE ( 1 )   ;   CALL dyn_zdf_imp    ( kt, r2dt )      ! implicit scheme
[503]76      !
77      CASE ( -1 )                                      ! esopa: test all possibility with control print
[684]78                       CALL dyn_zdf_exp    ( kt, r2dt )
79                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf0 - Ua: ', mask1=umask,               &
[503]80            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
[684]81                       CALL dyn_zdf_imp    ( kt, r2dt )
82                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf1 - Ua: ', mask1=umask,               &
[503]83            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
[456]84      END SELECT
85
[503]86      IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
[456]87         ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
88         ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
[503]89         CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_zdf, 'DYN', kt )
[456]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' )
[503]94      !
[456]95   END SUBROUTINE dyn_zdf
96
97
98   SUBROUTINE zdf_ctl
99      !!----------------------------------------------------------------------
100      !!                 ***  ROUTINE zdf_ctl  ***
101      !!
[503]102      !! ** Purpose :   initializations of the vertical diffusion scheme
[456]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
[503]112      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme
113      ELSE                   ;   nzdf = 1           ! use implicit scheme
[456]114      ENDIF
115
116      ! Force implicit schemes
[503]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
[456]120
[503]121      IF( lk_esopa )    nzdf = -1                   ! Esopa key: All schemes used
[456]122
[503]123      IF(lwp) THEN                                  ! Print the choice
[456]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
[503]131      !
[456]132   END SUBROUTINE zdf_ctl
133
134   !!==============================================================================
135END MODULE dynzdf
Note: See TracBrowser for help on using the repository browser.