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.F90 in NEMO/branches/UKMO/NEMO_4.0.1_biharmonic_GM/src/OCE/DYN – NEMO

source: NEMO/branches/UKMO/NEMO_4.0.1_biharmonic_GM/src/OCE/DYN/dynldf.F90 @ 12532

Last change on this file since 12532 was 12532, checked in by davestorkey, 4 years ago

UKMO/NEMO_4.0.1_biharmonic_GM: science changes.

File size: 5.8 KB
Line 
1MODULE dynldf
2   !!======================================================================
3   !!                       ***  MODULE  dynldf  ***
4   !! Ocean physics:  lateral diffusivity trends
5   !!=====================================================================
6   !! History :  2.0  ! 2005-11  (G. Madec)  Original code (new step architecture)
7   !!            3.7  ! 2014-01  (F. Lemarie, G. Madec)  restructuration/simplification of ahm specification,
8   !!                 !                                  add velocity dependent coefficient and optional read in file
9   !!            4.0  ! 2020-02  (C. Wilson, ...) add bi-Laplacian GM implementation via momentum     
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   dyn_ldf      : update the dynamics trend with the lateral diffusion
14   !!   dyn_ldf_init : initialization, namelist read, and parameters control
15   !!----------------------------------------------------------------------
16   USE oce            ! ocean dynamics and tracers
17   USE dom_oce        ! ocean space and time domain
18   USE phycst         ! physical constants
19   USE ldfdyn         ! lateral diffusion: eddy viscosity coef.
20   USE dynldf_lap_blp ! lateral mixing   (dyn_ldf_lap & dyn_ldf_blp routines)
21   USE dynldf_iso     ! lateral mixing                 (dyn_ldf_iso routine )
22   USE trd_oce        ! trends: ocean variables
23   USE trddyn         ! trend manager: dynamics   (trd_dyn      routine)
24   !
25   USE prtctl         ! Print control
26   USE in_out_manager ! I/O manager
27   USE lib_mpp        ! distribued memory computing library
28   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
29   USE timing         ! Timing
30
31   IMPLICIT NONE
32   PRIVATE
33
34   PUBLIC   dyn_ldf       ! called by step module
35   PUBLIC   dyn_ldf_init  ! called by opa  module
36
37   !! * Substitutions
38#  include "vectopt_loop_substitute.h90"
39   !!----------------------------------------------------------------------
40   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
41   !! $Id: dynldf.F90 10068 2018-08-28 14:09:04Z nicolasmartin $
42   !! Software governed by the CeCILL license (see ./LICENSE)
43   !!----------------------------------------------------------------------
44CONTAINS
45
46   SUBROUTINE dyn_ldf( kt )
47      !!----------------------------------------------------------------------
48      !!                  ***  ROUTINE dyn_ldf  ***
49      !!
50      !! ** Purpose :   compute the lateral ocean dynamics physics.
51      !!----------------------------------------------------------------------
52      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
53      !
54      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdu, ztrdv
55      !!----------------------------------------------------------------------
56      !
57      IF( ln_timing )   CALL timing_start('dyn_ldf')
58      !
59      IF( l_trddyn )   THEN                      ! temporary save of momentum trends
60         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) )
61         ztrdu(:,:,:) = ua(:,:,:) 
62         ztrdv(:,:,:) = va(:,:,:) 
63      ENDIF
64
65      SELECT CASE ( nldf_dyn )                   ! compute lateral mixing trend and add it to the general trend
66      !
67      CASE ( np_lap   )    ;   CALL dyn_ldf_lap( kt, ub, vb, ua, va, 1 )      ! iso-level    laplacian
68      CASE ( np_lap_i )    ;   CALL dyn_ldf_iso( kt )                         ! rotated      laplacian
69      CASE ( np_bgm )  ;       CALL dyn_ldf_bgm( kt, ub, vb, ua, va)  ! bi-Laplacian GM parameterisation
70      CASE ( np_blp   )    ;   CALL dyn_ldf_blp( kt, ub, vb, ua, va    )      ! iso-level bi-laplacian
71      !
72      END SELECT
73
74      IF( l_trddyn ) THEN                        ! save the horizontal diffusive trends for further diagnostics
75         ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
76         ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
77         CALL trd_dyn( ztrdu, ztrdv, jpdyn_ldf, kt )
78         DEALLOCATE ( ztrdu , ztrdv )
79      ENDIF
80      !                                          ! print sum trends (used for debugging)
81      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' ldf  - Ua: ', mask1=umask,   &
82         &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
83      !
84      IF( ln_timing )   CALL timing_stop('dyn_ldf')
85      !
86   END SUBROUTINE dyn_ldf
87
88
89   SUBROUTINE dyn_ldf_init
90      !!----------------------------------------------------------------------
91      !!                  ***  ROUTINE dyn_ldf_init  ***
92      !!
93      !! ** Purpose :   initializations of the horizontal ocean dynamics physics
94      !!----------------------------------------------------------------------
95      !
96      IF(lwp) THEN                     !==  Namelist print  ==!
97         WRITE(numout,*)
98         WRITE(numout,*) 'dyn_ldf_init : Choice of the lateral diffusive operator on dynamics'
99         WRITE(numout,*) '~~~~~~~~~~~~'
100         WRITE(numout,*) '   Namelist namdyn_ldf: already read in ldfdyn module'
101         WRITE(numout,*) '      see ldf_dyn_init report for lateral mixing parameters'
102         WRITE(numout,*)
103         !
104         SELECT CASE( nldf_dyn )             ! print the choice of operator
105         CASE( np_no_ldf )   ;   WRITE(numout,*) '   ==>>>   NO lateral viscosity'
106         CASE( np_lap    )   ;   WRITE(numout,*) '   ==>>>   iso-level laplacian operator'
107         CASE( np_lap_i  )   ;   WRITE(numout,*) '   ==>>>   rotated laplacian operator with iso-level background'
108         CASE( np_bgm )      ;   WRITE(numout,*) '   ==>>>   bi-Laplacian GM parameterisation via momentum equation'
109         CASE( np_blp    )   ;   WRITE(numout,*) '   ==>>>   iso-level bi-laplacian operator'
110         END SELECT
111      ENDIF
112      !
113   END SUBROUTINE dyn_ldf_init
114
115   !!======================================================================
116END MODULE dynldf
Note: See TracBrowser for help on using the repository browser.