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

source: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90 @ 2281

Last change on this file since 2281 was 2281, checked in by smasson, 14 years ago

set proper svn properties to all files...

  • Property svn:keywords set to Id
File size: 6.5 KB
RevLine 
[456]1MODULE dynzdf
2   !!==============================================================================
3   !!                 ***  MODULE  dynzdf  ***
4   !! Ocean dynamics :  vertical component of the momentum mixing trend
5   !!==============================================================================
[2104]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   !!----------------------------------------------------------------------
[456]11   !!   dyn_zdf      : Update the momentum trend with the vertical diffusion
[2104]12   !!   dyn_zdf_init : initializations of the vertical diffusion scheme
[456]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
[2027]30   PUBLIC   dyn_zdf       !  routine called by step.F90
31   PUBLIC   dyn_zdf_init  !  routine called by opa.F90
[456]32
[2104]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
[456]35
36   !! * Substitutions
37#  include "domzgr_substitute.h90"
38#  include "zdfddm_substitute.h90"
39#  include "vectopt_loop_substitute.h90"
40   !!----------------------------------------------------------------------
[2104]41   !! NEMO/OPA 3,3 , LOCEAN-IPSL (2010)
[1152]42   !! $Id$
[2236]43   !! Software governed by the CeCILL licence  (NEMOGCM/License_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      !!---------------------------------------------------------------------
54      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
[503]55      !!
56      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ztrdu, ztrdv   ! 3D workspace
[456]57      !!---------------------------------------------------------------------
58
59      !                                          ! set time step
[2104]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)
[456]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
[503]70      !
[2104]71      CASE ( 0 )   ;   CALL dyn_zdf_exp( kt, r2dt )      ! explicit scheme
72      CASE ( 1 )   ;   CALL dyn_zdf_imp( kt, r2dt )      ! implicit scheme
[503]73      !
74      CASE ( -1 )                                      ! esopa: test all possibility with control print
[2104]75                       CALL dyn_zdf_exp( kt, r2dt )
[684]76                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf0 - Ua: ', mask1=umask,               &
[503]77            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
[2104]78                       CALL dyn_zdf_imp( kt, r2dt )
[684]79                       CALL prt_ctl( tab3d_1=ua, clinfo1=' zdf1 - Ua: ', mask1=umask,               &
[503]80            &                        tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
[456]81      END SELECT
82
[503]83      IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
[456]84         ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
85         ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
[503]86         CALL trd_mod( ztrdu, ztrdv, jpdyn_trd_zdf, 'DYN', kt )
[456]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' )
[503]91      !
[456]92   END SUBROUTINE dyn_zdf
93
94
[2027]95   SUBROUTINE dyn_zdf_init
[456]96      !!----------------------------------------------------------------------
[2027]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      !!----------------------------------------------------------------------
[1533]104      USE zdftke_old
[456]105      USE zdftke
[2236]106      USE zdfgls
[456]107      USE zdfkpp
108      !!----------------------------------------------------------------------
[2104]109      !
[456]110      ! Choice from ln_zdfexp read in namelist in zdfini
[503]111      IF( ln_zdfexp ) THEN   ;   nzdf = 0           ! use explicit scheme
112      ELSE                   ;   nzdf = 1           ! use implicit scheme
[456]113      ENDIF
[2104]114      !
[456]115      ! Force implicit schemes
[2236]116      IF( lk_zdftke_old .OR. lk_zdftke .OR. lk_zdfgls .OR. lk_zdfkpp )   nzdf = 1   ! TKE, GLS or KPP physics
117      IF( ln_dynldf_iso                                              )   nzdf = 1   ! iso-neutral lateral physics
118      IF( ln_dynldf_hor .AND. ln_sco                                 )   nzdf = 1   ! horizontal lateral physics in s-coordinate
[2104]119      !
[503]120      IF( lk_esopa )    nzdf = -1                   ! Esopa key: All schemes used
[2104]121      !
[503]122      IF(lwp) THEN                                  ! Print the choice
[456]123         WRITE(numout,*)
[2027]124         WRITE(numout,*) 'dyn_zdf_init : vertical dynamics physics scheme'
[456]125         WRITE(numout,*) '~~~~~~~~~~~'
126         IF( nzdf == -1 )   WRITE(numout,*) '              ESOPA test All scheme used'
127         IF( nzdf ==  0 )   WRITE(numout,*) '              Explicit time-splitting scheme'
128         IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme'
129      ENDIF
[503]130      !
[2027]131   END SUBROUTINE dyn_zdf_init
[456]132
133   !!==============================================================================
134END MODULE dynzdf
Note: See TracBrowser for help on using the repository browser.