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/trunk/src/OCE/DYN – NEMO

source: NEMO/trunk/src/OCE/DYN/dynldf.F90 @ 12377

Last change on this file since 12377 was 12377, checked in by acc, 4 years ago

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

  • Property svn:keywords set to Id
File size: 5.9 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   !!----------------------------------------------------------------------
10
11   !!----------------------------------------------------------------------
12   !!   dyn_ldf      : update the dynamics trend with the lateral diffusion
13   !!   dyn_ldf_init : initialization, namelist read, and parameters control
14   !!----------------------------------------------------------------------
15   USE oce            ! ocean dynamics and tracers
16   USE dom_oce        ! ocean space and time domain
17   USE phycst         ! physical constants
18   USE ldfdyn         ! lateral diffusion: eddy viscosity coef.
19   USE dynldf_lap_blp ! lateral mixing   (dyn_ldf_lap & dyn_ldf_blp routines)
20   USE dynldf_iso     ! lateral mixing                 (dyn_ldf_iso routine )
21   USE trd_oce        ! trends: ocean variables
22   USE trddyn         ! trend manager: dynamics   (trd_dyn      routine)
23   !
24   USE prtctl         ! Print control
25   USE in_out_manager ! I/O manager
26   USE lib_mpp        ! distribued memory computing library
27   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
28   USE timing         ! Timing
29
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC   dyn_ldf       ! called by step module
34   PUBLIC   dyn_ldf_init  ! called by opa  module
35
36   !!----------------------------------------------------------------------
37   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
38   !! $Id$
39   !! Software governed by the CeCILL license (see ./LICENSE)
40   !!----------------------------------------------------------------------
41CONTAINS
42
43   SUBROUTINE dyn_ldf( kt, Kbb, Kmm, puu, pvv, Krhs )
44      !!----------------------------------------------------------------------
45      !!                  ***  ROUTINE dyn_ldf  ***
46      !!
47      !! ** Purpose :   compute the lateral ocean dynamics physics.
48      !!----------------------------------------------------------------------
49      INTEGER                             , INTENT( in )  ::  kt               ! ocean time-step index
50      INTEGER                             , INTENT( in )  ::  Kbb, Kmm, Krhs   ! ocean time level indices
51      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv         ! ocean velocities and RHS of momentum equation
52      !
53      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdu, ztrdv
54      !!----------------------------------------------------------------------
55      !
56      IF( ln_timing )   CALL timing_start('dyn_ldf')
57      !
58      IF( l_trddyn )   THEN                      ! temporary save of momentum trends
59         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) )
60         ztrdu(:,:,:) = puu(:,:,:,Krhs) 
61         ztrdv(:,:,:) = pvv(:,:,:,Krhs) 
62      ENDIF
63
64      SELECT CASE ( nldf_dyn )                   ! compute lateral mixing trend and add it to the general trend
65      !
66      CASE ( np_lap   ) 
67         CALL dyn_ldf_lap( kt, Kbb, Kmm, puu(:,:,:,Kbb), pvv(:,:,:,Kbb), puu(:,:,:,Krhs), pvv(:,:,:,Krhs), 1 ) ! iso-level    laplacian
68      CASE ( np_lap_i ) 
69         CALL dyn_ldf_iso( kt, Kbb, Kmm, puu, pvv, Krhs    )                                                   ! rotated      laplacian
70      CASE ( np_blp   ) 
71         CALL dyn_ldf_blp( kt, Kbb, Kmm, puu(:,:,:,Kbb), pvv(:,:,:,Kbb), puu(:,:,:,Krhs), pvv(:,:,:,Krhs)    ) ! iso-level bi-laplacian
72      !
73      END SELECT
74
75      IF( l_trddyn ) THEN                        ! save the horizontal diffusive trends for further diagnostics
76         ztrdu(:,:,:) = puu(:,:,:,Krhs) - ztrdu(:,:,:)
77         ztrdv(:,:,:) = pvv(:,:,:,Krhs) - ztrdv(:,:,:)
78         CALL trd_dyn( ztrdu, ztrdv, jpdyn_ldf, kt, Kmm )
79         DEALLOCATE ( ztrdu , ztrdv )
80      ENDIF
81      !                                          ! print sum trends (used for debugging)
82      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=puu(:,:,:,Krhs), clinfo1=' ldf  - Ua: ', mask1=umask,   &
83         &                                  tab3d_2=pvv(:,:,:,Krhs), clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
84      !
85      IF( ln_timing )   CALL timing_stop('dyn_ldf')
86      !
87   END SUBROUTINE dyn_ldf
88
89
90   SUBROUTINE dyn_ldf_init
91      !!----------------------------------------------------------------------
92      !!                  ***  ROUTINE dyn_ldf_init  ***
93      !!
94      !! ** Purpose :   initializations of the horizontal ocean dynamics physics
95      !!----------------------------------------------------------------------
96      !
97      IF(lwp) THEN                     !==  Namelist print  ==!
98         WRITE(numout,*)
99         WRITE(numout,*) 'dyn_ldf_init : Choice of the lateral diffusive operator on dynamics'
100         WRITE(numout,*) '~~~~~~~~~~~~'
101         WRITE(numout,*) '   Namelist namdyn_ldf: already read in ldfdyn module'
102         WRITE(numout,*) '      see ldf_dyn_init report for lateral mixing parameters'
103         WRITE(numout,*)
104         !
105         SELECT CASE( nldf_dyn )             ! print the choice of operator
106         CASE( np_no_ldf )   ;   WRITE(numout,*) '   ==>>>   NO lateral viscosity'
107         CASE( np_lap    )   ;   WRITE(numout,*) '   ==>>>   iso-level laplacian operator'
108         CASE( np_lap_i  )   ;   WRITE(numout,*) '   ==>>>   rotated laplacian operator with iso-level background'
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.