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.
dynldf_lap.F90 in branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap.F90 @ 4460

Last change on this file since 4460 was 4427, checked in by trackstand2, 10 years ago

First files changed on last FINISS work package. Stephen's work although
commited by Andy P.

  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1MODULE dynldf_lap
2   !!======================================================================
3   !!                       ***  MODULE  dynldf_lap  ***
4   !! Ocean dynamics:  lateral viscosity trend
5   !!======================================================================
6   !! History :  OPA  ! 1990-09 (G. Madec) Original code
7   !!            4.0  ! 1991-11 (G. Madec)
8   !!            6.0  ! 1996-01 (G. Madec) statement function for e3 and ahm
9   !!   NEMO     1.0  ! 2002-06 (G. Madec)  F90: Free form and module
10   !!             -   ! 2004-08 (C. Talandier) New trends organization
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!   dyn_ldf_lap  : update the momentum trend with the lateral diffusion
15   !!                  using an iso-level harmonic operator
16   !!----------------------------------------------------------------------
17   USE oce             ! ocean dynamics and tracers
18   USE dom_oce         ! ocean space and time domain
19   USE ldfdyn_oce      ! ocean dynamics: lateral physics
20   USE zdf_oce         ! ocean vertical physics
21   USE in_out_manager  ! I/O manager
22   USE trdmod          ! ocean dynamics trends
23   USE trdmod_oce      ! ocean variables trends
24   USE ldfslp          ! iso-neutral slopes
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC dyn_ldf_lap  ! called by step.F90
30
31   !! * Control permutation of array indices
32#  include "oce_ftrans.h90"
33#  include "dom_oce_ftrans.h90"
34#  include "ldfdyn_oce_ftrans.h90"
35#  include "zdf_oce_ftrans.h90"
36#  include "ldfslp_ftrans.h90"
37
38   !! * Substitutions
39#  include "domzgr_substitute.h90"
40#  include "ldfdyn_substitute.h90"
41#  include "vectopt_loop_substitute.h90"
42   !!----------------------------------------------------------------------
43   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
44   !! $Id$
45   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
46   !!----------------------------------------------------------------------
47CONTAINS
48
49   SUBROUTINE dyn_ldf_lap( kt )
50      !!----------------------------------------------------------------------
51      !!                     ***  ROUTINE dyn_ldf_lap  ***
52      !!                       
53      !! ** Purpose :   Compute the before horizontal tracer (t & s) diffusive
54      !!      trend and add it to the general trend of tracer equation.
55      !!
56      !! ** Method  :   The before horizontal momentum diffusion trend is an
57      !!      harmonic operator (laplacian type) which separates the divergent
58      !!      and rotational parts of the flow.
59      !!      Its horizontal components are computed as follow:
60      !!         difu = 1/e1u di[ahmt hdivb] - 1/(e2u*e3u) dj-1[e3f ahmf rotb]
61      !!         difv = 1/e2v dj[ahmt hdivb] + 1/(e1v*e3v) di-1[e3f ahmf rotb]
62      !!      in the rotational part of the diffusion.
63      !!      Add this before trend to the general trend (ua,va):
64      !!            (ua,va) = (ua,va) + (diffu,diffv)
65      !!      'key_trddyn' activated: the two components of the horizontal
66      !!                                 diffusion trend are saved.
67      !!
68      !! ** Action : - Update (ua,va) with the before iso-level harmonic
69      !!               mixing trend.
70      !!----------------------------------------------------------------------
71      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
72      !
73      INTEGER  ::   ji, jj, jk             ! dummy loop indices
74      REAL(wp) ::   zua, zva, ze2u, ze1v   ! local scalars
75      !!----------------------------------------------------------------------
76      !
77      IF( kt == nit000 ) THEN
78         IF(lwp) WRITE(numout,*)
79         IF(lwp) WRITE(numout,*) 'dyn_ldf : iso-level harmonic (laplacian) operator'
80         IF(lwp) WRITE(numout,*) '~~~~~~~ '
81      ENDIF
82#if defined key_z_first
83      DO jj = 2, jpjm1
84         DO ji = 2, jpim1
85            DO jk = 1, mbkmax(ji,jj)-1
86#else
87      !                                                ! ===============
88      DO jk = 1, jpkm1                                 ! Horizontal slab
89         !                                             ! ===============
90         DO jj = 2, jpjm1
91            DO ji = fs_2, fs_jpim1   ! vector opt.
92#endif
93               ze2u = rotb (ji,jj,jk) * fsahmf(ji,jj,jk) * fse3f(ji,jj,jk)
94               ze1v = hdivb(ji,jj,jk) * fsahmt(ji,jj,jk)
95               ! horizontal diffusive trends
96               zua = - ( ze2u - rotb (ji,jj-1,jk)*fsahmf(ji,jj-1,jk)*fse3f(ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) )   &
97                     + ( hdivb(ji+1,jj,jk)*fsahmt(ji+1,jj,jk) - ze1v                   ) / e1u(ji,jj)
98
99               zva = + ( ze2u - rotb (ji-1,jj,jk)*fsahmf(ji-1,jj,jk)*fse3f(ji-1,jj,jk) ) / ( e1v(ji,jj) * fse3v(ji,jj,jk) )   &
100                     + ( hdivb(ji,jj+1,jk)*fsahmt(ji,jj+1,jk) - ze1v                   ) / e2v(ji,jj)
101
102               ! add it to the general momentum trends
103               ua(ji,jj,jk) = ua(ji,jj,jk) + zua
104               va(ji,jj,jk) = va(ji,jj,jk) + zva
105            END DO
106         END DO
107         !                                             ! ===============
108      END DO                                           !   End of slab
109      !                                                ! ===============
110   END SUBROUTINE dyn_ldf_lap
111
112   !!======================================================================
113END MODULE dynldf_lap
Note: See TracBrowser for help on using the repository browser.