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

source: branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90 @ 7990

Last change on this file since 7990 was 7990, checked in by gm, 7 years ago

#1880 (HPC-09): OPA remove avmu, avmv from zdf modules + move CALL tke(gls)_rst & gls_rst in zdftke(gls) + rename zdftmx and zdfqiao

  • Property svn:keywords set to Id
File size: 5.8 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
[456]36
37   !! * Substitutions
38#  include "vectopt_loop_substitute.h90"
39   !!----------------------------------------------------------------------
[2528]40   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
[1152]41   !! $Id$
[2528]42   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
[456]43   !!----------------------------------------------------------------------
44CONTAINS
45   
46   SUBROUTINE dyn_zdf( kt )
47      !!----------------------------------------------------------------------
48      !!                  ***  ROUTINE dyn_zdf  ***
49      !!
50      !! ** Purpose :   compute the vertical ocean dynamics physics.
51      !!---------------------------------------------------------------------
52      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
[3294]53      !
54      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
[456]55      !!---------------------------------------------------------------------
[3294]56      !
[5836]57      IF( nn_timing == 1 )   CALL timing_start('dyn_zdf')
[3294]58      !
[456]59      !                                          ! set time step
[6140]60      IF( neuler == 0 .AND. kt == nit000     ) THEN   ;   r2dt =      rdt   ! = rdt (restart with Euler time stepping)
61      ELSEIF(               kt <= nit000 + 1 ) THEN   ;   r2dt = 2. * rdt   ! = 2 rdt (leapfrog)
[456]62      ENDIF
63
64      IF( l_trddyn )   THEN                      ! temporary save of ta and sa trends
[3294]65         CALL wrk_alloc( jpi, jpj, jpk, ztrdu, ztrdv ) 
[7753]66         ztrdu(:,:,:) = ua(:,:,:)
67         ztrdv(:,:,:) = va(:,:,:)
[456]68      ENDIF
69
70      SELECT CASE ( nzdf )                       ! compute lateral mixing trend and add it to the general trend
[503]71      !
[2528]72      CASE ( 0 )   ;   CALL dyn_zdf_exp( kt, r2dt )      ! explicit scheme
73      CASE ( 1 )   ;   CALL dyn_zdf_imp( kt, r2dt )      ! implicit scheme
[503]74      !
[456]75      END SELECT
76
[503]77      IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
[7753]78         ztrdu(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) / r2dt - ztrdu(:,:,:)
79         ztrdv(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) / r2dt - ztrdv(:,:,:)
[4990]80         CALL trd_dyn( ztrdu, ztrdv, jpdyn_zdf, kt )
[3294]81         CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) 
[456]82      ENDIF
83      !                                          ! print mean trends (used for debugging)
84      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf  - Ua: ', mask1=umask,               &
[5836]85         &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
86         !
87      IF( nn_timing == 1 )   CALL timing_stop('dyn_zdf')
[503]88      !
[456]89   END SUBROUTINE dyn_zdf
90
91
[2528]92   SUBROUTINE dyn_zdf_init
[456]93      !!----------------------------------------------------------------------
[2528]94      !!                 ***  ROUTINE dyn_zdf_init  ***
[456]95      !!
[7953]96      !! ** Purpose :   initialization of the vertical diffusion scheme
[456]97      !!
98      !! ** Method  :   implicit (euler backward) scheme (default)
99      !!                explicit (time-splitting) scheme if ln_zdfexp=T
100      !!----------------------------------------------------------------------
101      USE zdftke
[2528]102      USE zdfgls
[456]103      !!----------------------------------------------------------------------
[2528]104      !
[7953]105      ! Choice from ln_zdfexp (namzdf namelist variable read in zdfphy module)
[503]106      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme
107      ELSE                   ;   nzdf = 1           ! use implicit scheme
[456]108      ENDIF
[2528]109      !
[456]110      ! Force implicit schemes
[7953]111      IF( ln_zdftke .OR. ln_zdfgls   )   nzdf = 1   ! TKE or GLS physics
[5836]112      IF( ln_dynldf_iso              )   nzdf = 1   ! iso-neutral lateral physics
113      IF( ln_dynldf_hor .AND. ln_sco )   nzdf = 1   ! horizontal lateral physics in s-coordinate
[2528]114      !
[503]115      IF(lwp) THEN                                  ! Print the choice
[456]116         WRITE(numout,*)
[2528]117         WRITE(numout,*) 'dyn_zdf_init : vertical dynamics physics scheme'
[456]118         WRITE(numout,*) '~~~~~~~~~~~'
[7646]119         IF( nzdf ==  0 )   WRITE(numout,*) '      ===>>   Explicit time-splitting scheme'
120         IF( nzdf ==  1 )   WRITE(numout,*) '      ===>>   Implicit (euler backward) scheme'
[456]121      ENDIF
[503]122      !
[2528]123   END SUBROUTINE dyn_zdf_init
[456]124
125   !!==============================================================================
126END MODULE dynzdf
Note: See TracBrowser for help on using the repository browser.