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

source: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap.F90

Last change on this file was 11101, checked in by frrh, 5 years ago

Merge changes from Met Office GMED ticket 450 to reduce unnecessary
text output from NEMO.
This output, which is typically not switchable, is rarely of interest
in normal (non-debugging) runs and simply redunantley consumes extra
file space.
Further, the presence of this text output has been shown to
significantly degrade performance of models which are run during
Met Office HPC RAID (disk) checks.
The new code introduces switches which are configurable via the
changes made in the associated Met Office MOCI ticket 399.

File size: 4.9 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   !
22   USE in_out_manager  ! I/O manager
23   USE timing          ! Timing
24
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC dyn_ldf_lap  ! called by step.F90
29
30   !! * Substitutions
31#  include "domzgr_substitute.h90"
32#  include "ldfdyn_substitute.h90"
33#  include "vectopt_loop_substitute.h90"
34   !!----------------------------------------------------------------------
35   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
36   !! $Id$
37   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
38   !!----------------------------------------------------------------------
39CONTAINS
40
41   SUBROUTINE dyn_ldf_lap( kt )
42      !!----------------------------------------------------------------------
43      !!                     ***  ROUTINE dyn_ldf_lap  ***
44      !!                       
45      !! ** Purpose :   Compute the before horizontal tracer (t & s) diffusive
46      !!      trend and add it to the general trend of tracer equation.
47      !!
48      !! ** Method  :   The before horizontal momentum diffusion trend is an
49      !!      harmonic operator (laplacian type) which separates the divergent
50      !!      and rotational parts of the flow.
51      !!      Its horizontal components are computed as follow:
52      !!         difu = 1/e1u di[ahmt hdivb] - 1/(e2u*e3u) dj-1[e3f ahmf rotb]
53      !!         difv = 1/e2v dj[ahmt hdivb] + 1/(e1v*e3v) di-1[e3f ahmf rotb]
54      !!      in the rotational part of the diffusion.
55      !!      Add this before trend to the general trend (ua,va):
56      !!            (ua,va) = (ua,va) + (diffu,diffv)
57      !!
58      !! ** Action : - Update (ua,va) with the iso-level harmonic mixing trend
59      !!----------------------------------------------------------------------
60      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
61      !
62      INTEGER  ::   ji, jj, jk             ! dummy loop indices
63      REAL(wp) ::   zua, zva, ze2u, ze1v   ! local scalars
64      !!----------------------------------------------------------------------
65      !
66      IF( nn_timing == 1 )  CALL timing_start('dyn_ldf_lap')
67      !
68      IF( kt == nit000 ) THEN
69         IF(lwp) WRITE(numout,*)
70         IF(lwp) WRITE(numout,*) 'dyn_ldf : iso-level harmonic (laplacian) operator'
71         IF(lwp) WRITE(numout,*) '~~~~~~~ '
72         IF(lflush) CALL flush(numout)
73      ENDIF
74      !                                                ! ===============
75      DO jk = 1, jpkm1                                 ! Horizontal slab
76         !                                             ! ===============
77         DO jj = 2, jpjm1
78            DO ji = fs_2, fs_jpim1   ! vector opt.
79               ze2u = rotb (ji,jj,jk) * fsahmf(ji,jj,jk) * fse3f(ji,jj,jk)
80               ze1v = hdivb(ji,jj,jk) * fsahmt(ji,jj,jk)
81               ! horizontal diffusive trends
82               zua = - ( ze2u - rotb (ji,jj-1,jk)*fsahmf(ji,jj-1,jk)*fse3f(ji,jj-1,jk) ) / ( e2u(ji,jj) * fse3u(ji,jj,jk) )   &
83                     + ( hdivb(ji+1,jj,jk)*fsahmt(ji+1,jj,jk) - ze1v                   ) / e1u(ji,jj)
84
85               zva = + ( ze2u - rotb (ji-1,jj,jk)*fsahmf(ji-1,jj,jk)*fse3f(ji-1,jj,jk) ) / ( e1v(ji,jj) * fse3v(ji,jj,jk) )   &
86                     + ( hdivb(ji,jj+1,jk)*fsahmt(ji,jj+1,jk) - ze1v                   ) / e2v(ji,jj)
87
88               ! add it to the general momentum trends
89               ua(ji,jj,jk) = ua(ji,jj,jk) + zua
90               va(ji,jj,jk) = va(ji,jj,jk) + zva
91            END DO
92         END DO
93         !                                             ! ===============
94      END DO                                           !   End of slab
95      !                                                ! ===============
96      IF( nn_timing == 1 )  CALL timing_stop('dyn_ldf_lap')
97      !
98   END SUBROUTINE dyn_ldf_lap
99
100   !!======================================================================
101END MODULE dynldf_lap
Note: See TracBrowser for help on using the repository browser.