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

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

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

set proper svn properties to all files...

  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1MODULE dynldf_lap
2   !!======================================================================
3   !!                       ***  MODULE  dynldf_lap  ***
4   !! Ocean dynamics:  lateral viscosity trend
5   !!======================================================================
6
7   !!----------------------------------------------------------------------
8   !!   dyn_ldf_lap  : update the momentum trend with the lateral diffusion
9   !!                  using an iso-level harmonic operator
10   !!----------------------------------------------------------------------
11   !! * Modules used
12   USE oce             ! ocean dynamics and tracers
13   USE dom_oce         ! ocean space and time domain
14   USE ldfdyn_oce      ! ocean dynamics: lateral physics
15   USE zdf_oce         ! ocean vertical physics
16   USE in_out_manager  ! I/O manager
17   USE trdmod          ! ocean dynamics trends
18   USE trdmod_oce      ! ocean variables trends
19   USE ldfslp          ! iso-neutral slopes
20
21   IMPLICIT NONE
22   PRIVATE
23
24   !! * Routine accessibility
25   PUBLIC dyn_ldf_lap  ! called by step.F90
26
27   !! * Substitutions
28#  include "domzgr_substitute.h90"
29#  include "ldfdyn_substitute.h90"
30#  include "vectopt_loop_substitute.h90"
31   !!----------------------------------------------------------------------
32   !!   OPA 9.0 , LOCEAN-IPSL (2005)
33   !! $Id$
34   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
35   !!----------------------------------------------------------------------
36
37CONTAINS
38
39   SUBROUTINE dyn_ldf_lap( kt )
40      !!----------------------------------------------------------------------
41      !!                     ***  ROUTINE dyn_ldf_lap  ***
42      !!                       
43      !! ** Purpose :   Compute the before horizontal tracer (t & s) diffusive
44      !!      trend and add it to the general trend of tracer equation.
45      !!
46      !! ** Method  :   The before horizontal momentum diffusion trend is an
47      !!      harmonic operator (laplacian type) which separates the divergent
48      !!      and rotational parts of the flow.
49      !!      Its horizontal components are computed as follow:
50      !!         difu = 1/e1u di[ahmt hdivb] - 1/(e2u*e3u) dj-1[e3f ahmf rotb]
51      !!         difv = 1/e2v dj[ahmt hdivb] + 1/(e1v*e3v) di-1[e3f ahmf rotb]
52      !!      in the rotational part of the diffusion.
53      !!      Add this before trend to the general trend (ua,va):
54      !!            (ua,va) = (ua,va) + (diffu,diffv)
55      !!      'key_trddyn' activated: the two components of the horizontal
56      !!                                 diffusion trend are saved.
57      !!
58      !! ** Action : - Update (ua,va) with the before iso-level harmonic
59      !!               mixing trend.
60      !!
61      !! History :
62      !!        !  90-09 (G. Madec) Original code
63      !!        !  91-11 (G. Madec)
64      !!        !  96-01 (G. Madec) statement function for e3 and ahm
65      !!   8.5  !  02-06 (G. Madec)  F90: Free form and module
66      !!   9.0  !  04-08 (C. Talandier) New trends organization
67      !!----------------------------------------------------------------------
68      !! * Arguments
69      INTEGER, INTENT( in ) ::   kt       ! ocean time-step index
70
71      !! * Local declarations
72      INTEGER  ::   ji, jj, jk            ! dummy loop indices
73      REAL(wp) ::   &
74         zua, zva, ze2u, ze1v             ! temporary 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
83      !                                                ! ===============
84      DO jk = 1, jpkm1                                 ! Horizontal slab
85         !                                             ! ===============
86         DO jj = 2, jpjm1
87            DO ji = fs_2, fs_jpim1   ! vector opt.
88               ze2u = rotb (ji,jj,jk)*fsahmf(ji,jj,jk)*fse3f(ji,jj,jk)
89               ze1v = hdivb(ji,jj,jk)*fsahmt(ji,jj,jk)
90               ! horizontal diffusive trends
91               zua = - ( ze2u - rotb (ji,jj-1,jk)*fsahmf(ji,jj-1,jk)*fse3f(ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) )   &
92                     + ( hdivb(ji+1,jj,jk)*fsahmt(ji+1,jj,jk) - ze1v                   ) / e1u(ji,jj)
93
94               zva = + ( ze2u - rotb (ji-1,jj,jk)*fsahmf(ji-1,jj,jk)*fse3f(ji-1,jj,jk) ) / ( e1v(ji,jj) * fse3v(ji,jj,jk) )   &
95                     + ( hdivb(ji,jj+1,jk)*fsahmt(ji,jj+1,jk) - ze1v                   ) / e2v(ji,jj)
96
97               ! add it to the general momentum trends
98               ua(ji,jj,jk) = ua(ji,jj,jk) + zua
99               va(ji,jj,jk) = va(ji,jj,jk) + zva
100            END DO
101         END DO
102         !                                             ! ===============
103      END DO                                           !   End of slab
104      !                                                ! ===============
105
106   END SUBROUTINE dyn_ldf_lap
107
108   !!======================================================================
109END MODULE dynldf_lap
Note: See TracBrowser for help on using the repository browser.