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 branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90 @ 6004

Last change on this file since 6004 was 5845, checked in by gm, 9 years ago

#1613: vvl by default: suppression of domzgr_substitute.h90

  • Property svn:keywords set to Id
File size: 5.9 KB
RevLine 
[456]1MODULE dynzdf
2   !!==============================================================================
3   !!                 ***  MODULE  dynzdf  ***
4   !! Ocean dynamics :  vertical component of the momentum mixing trend
5   !!==============================================================================
[2528]6   !! History :  1.0  !  2005-11  (G. Madec)  Original code
7   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase
[456]8   !!----------------------------------------------------------------------
[503]9
10   !!----------------------------------------------------------------------
[5836]11   !!   dyn_zdf       : Update the momentum trend with the vertical diffusion
12   !!   dyn_zdf_init  : initializations of the vertical diffusion scheme
[456]13   !!----------------------------------------------------------------------
[5836]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   USE dynzdf_exp     ! vertical diffusion: explicit (dyn_zdf_exp     routine)
18   USE dynzdf_imp     ! vertical diffusion: implicit (dyn_zdf_imp     routine)
19   USE ldfdyn         ! lateral diffusion: eddy viscosity coef.
20   USE trd_oce        ! trends: ocean variables
21   USE trddyn         ! trend manager: dynamics
22   !
23   USE in_out_manager ! I/O manager
24   USE lib_mpp        ! MPP library
25   USE prtctl         ! Print control
26   USE wrk_nemo       ! Memory Allocation
27   USE timing         ! Timing
[456]28
29   IMPLICIT NONE
30   PRIVATE
31
[2528]32   PUBLIC   dyn_zdf       !  routine called by step.F90
33   PUBLIC   dyn_zdf_init  !  routine called by opa.F90
[456]34
[2528]35   INTEGER  ::   nzdf = 0   ! type vertical diffusion algorithm used, defined from ln_zdf... namlist logicals
36   REAL(wp) ::   r2dt       ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0
[456]37
38   !! * Substitutions
39#  include "vectopt_loop_substitute.h90"
40   !!----------------------------------------------------------------------
[2528]41   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
[1152]42   !! $Id$
[2528]43   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
[456]44   !!----------------------------------------------------------------------
45
46CONTAINS
47   
48   SUBROUTINE dyn_zdf( kt )
49      !!----------------------------------------------------------------------
50      !!                  ***  ROUTINE dyn_zdf  ***
51      !!
52      !! ** Purpose :   compute the vertical ocean dynamics physics.
53      !!---------------------------------------------------------------------
[2715]54      !!
[456]55      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
[3294]56      !
57      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
[456]58      !!---------------------------------------------------------------------
[3294]59      !
[5836]60      IF( nn_timing == 1 )   CALL timing_start('dyn_zdf')
[3294]61      !
[456]62      !                                          ! set time step
[2528]63      IF( neuler == 0 .AND. kt == nit000     ) THEN   ;   r2dt =      rdt   ! = rdtra (restart 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
[3294]68         CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) 
[456]69         ztrdu(:,:,:) = ua(:,:,:)
70         ztrdv(:,:,:) = va(:,:,:)
71      ENDIF
72
73      SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend
[503]74      !
[2528]75      CASE ( 0 )   ;   CALL dyn_zdf_exp( kt, r2dt )      ! explicit scheme
76      CASE ( 1 )   ;   CALL dyn_zdf_imp( kt, r2dt )      ! implicit scheme
[503]77      !
[456]78      END SELECT
79
[503]80      IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
[456]81         ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
82         ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
[4990]83         CALL trd_dyn( ztrdu, ztrdv, jpdyn_zdf, kt )
[3294]84         CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) 
[456]85      ENDIF
86      !                                          ! print mean trends (used for debugging)
87      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf  - Ua: ', mask1=umask,               &
[5836]88         &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
89         !
90      IF( nn_timing == 1 )   CALL timing_stop('dyn_zdf')
[503]91      !
[456]92   END SUBROUTINE dyn_zdf
93
94
[2528]95   SUBROUTINE dyn_zdf_init
[456]96      !!----------------------------------------------------------------------
[2528]97      !!                 ***  ROUTINE dyn_zdf_init  ***
[456]98      !!
[503]99      !! ** Purpose :   initializations of the vertical diffusion scheme
[456]100      !!
101      !! ** Method  :   implicit (euler backward) scheme (default)
102      !!                explicit (time-splitting) scheme if ln_zdfexp=T
103      !!----------------------------------------------------------------------
104      USE zdftke
[2528]105      USE zdfgls
[456]106      !!----------------------------------------------------------------------
[2528]107      !
[456]108      ! Choice from ln_zdfexp read in namelist in zdfini
[503]109      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme
110      ELSE                   ;   nzdf = 1           ! use implicit scheme
[456]111      ENDIF
[2528]112      !
[456]113      ! Force implicit schemes
[5836]114      IF( lk_zdftke .OR. lk_zdfgls   )   nzdf = 1   ! TKE or GLS physics
115      IF( ln_dynldf_iso              )   nzdf = 1   ! iso-neutral lateral physics
116      IF( ln_dynldf_hor .AND. ln_sco )   nzdf = 1   ! horizontal lateral physics in s-coordinate
[2528]117      !
[503]118      IF(lwp) THEN                                  ! Print the choice
[456]119         WRITE(numout,*)
[2528]120         WRITE(numout,*) 'dyn_zdf_init : vertical dynamics physics scheme'
[456]121         WRITE(numout,*) '~~~~~~~~~~~'
122         IF( nzdf ==  0 )   WRITE(numout,*) '              Explicit time-splitting scheme'
123         IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme'
124      ENDIF
[503]125      !
[2528]126   END SUBROUTINE dyn_zdf_init
[456]127
128   !!==============================================================================
129END MODULE dynzdf
Note: See TracBrowser for help on using the repository browser.