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

Last change on this file since 12377 was 12377, checked in by acc, 8 months 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.3 KB
Line 
1MODULE dynzad
2   !!======================================================================
3   !!                       ***  MODULE  dynzad  ***
4   !! Ocean dynamics : vertical advection trend
5   !!======================================================================
6   !! History :  OPA  ! 1991-01  (G. Madec) Original code
7   !!   NEMO     0.5  ! 2002-07  (G. Madec) Free form, F90
8   !!----------------------------------------------------------------------
9   
10   !!----------------------------------------------------------------------
11   !!   dyn_zad       : vertical advection momentum trend
12   !!----------------------------------------------------------------------
13   USE oce            ! ocean dynamics and tracers
14   USE dom_oce        ! ocean space and time domain
15   USE sbc_oce        ! surface boundary condition: ocean
16   USE trd_oce        ! trends: ocean variables
17   USE trddyn         ! trend manager: dynamics
18   !
19   USE in_out_manager ! I/O manager
20   USE lib_mpp        ! MPP library
21   USE prtctl         ! Print control
22   USE timing         ! Timing
23
24   IMPLICIT NONE
25   PRIVATE
26   
27   PUBLIC   dyn_zad       ! routine called by dynadv.F90
28
29   !! * Substitutions
30#  include "do_loop_substitute.h90"
31   !!----------------------------------------------------------------------
32   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
33   !! $Id$
34   !! Software governed by the CeCILL license (see ./LICENSE)
35   !!----------------------------------------------------------------------
36CONTAINS
37
38   SUBROUTINE dyn_zad ( kt, Kmm, puu, pvv, Krhs )
39      !!----------------------------------------------------------------------
40      !!                  ***  ROUTINE dynzad  ***
41      !!
42      !! ** Purpose :   Compute the now vertical momentum advection trend and
43      !!      add it to the general trend of momentum equation.
44      !!
45      !! ** Method  :   The now vertical advection of momentum is given by:
46      !!         w dz(u) = u(rhs) + 1/(e1e2u*e3u) mk+1[ mi(e1e2t*ww) dk(u) ]
47      !!         w dz(v) = v(rhs) + 1/(e1e2v*e3v) mk+1[ mj(e1e2t*ww) dk(v) ]
48      !!      Add this trend to the general trend (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)):
49      !!         (u(rhs),v(rhs)) = (u(rhs),v(rhs)) + w dz(u,v)
50      !!
51      !! ** Action  : - Update (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) with the vert. momentum adv. trends
52      !!              - Send the trends to trddyn for diagnostics (l_trddyn=T)
53      !!----------------------------------------------------------------------
54      INTEGER                             , INTENT( in )  ::  kt               ! ocean time-step inedx
55      INTEGER                             , INTENT( in )  ::  Kmm, Krhs        ! ocean time level indices
56      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv         ! ocean velocities and RHS of momentum equation
57      !
58      INTEGER  ::   ji, jj, jk   ! dummy loop indices
59      REAL(wp) ::   zua, zva     ! local scalars
60      REAL(wp), DIMENSION(jpi,jpj)     ::   zww
61      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zwuw, zwvw
62      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdu, ztrdv
63      !!----------------------------------------------------------------------
64      !
65      IF( ln_timing )   CALL timing_start('dyn_zad')
66      !
67      IF( kt == nit000 ) THEN
68         IF(lwp) WRITE(numout,*)
69         IF(lwp) WRITE(numout,*) 'dyn_zad : 2nd order vertical advection scheme'
70      ENDIF
71
72      IF( l_trddyn )   THEN         ! Save puu(:,:,:,Krhs) and pvv(:,:,:,Krhs) trends
73         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) ) 
74         ztrdu(:,:,:) = puu(:,:,:,Krhs) 
75         ztrdv(:,:,:) = pvv(:,:,:,Krhs) 
76      ENDIF
77     
78      DO jk = 2, jpkm1              ! Vertical momentum advection at level w and u- and v- vertical
79         DO_2D_01_01
80            zww(ji,jj) = 0.25_wp * e1e2t(ji,jj) * ww(ji,jj,jk)
81         END_2D
82         DO_2D_00_00
83            zwuw(ji,jj,jk) = ( zww(ji+1,jj  ) + zww(ji,jj) ) * ( puu(ji,jj,jk-1,Kmm) - puu(ji,jj,jk,Kmm) )
84            zwvw(ji,jj,jk) = ( zww(ji  ,jj+1) + zww(ji,jj) ) * ( pvv(ji,jj,jk-1,Kmm) - pvv(ji,jj,jk,Kmm) )
85         END_2D
86      END DO
87      !
88      ! Surface and bottom advective fluxes set to zero
89      DO_2D_00_00
90         zwuw(ji,jj, 1 ) = 0._wp
91         zwvw(ji,jj, 1 ) = 0._wp
92         zwuw(ji,jj,jpk) = 0._wp
93         zwvw(ji,jj,jpk) = 0._wp
94      END_2D
95      !
96      DO_3D_00_00( 1, jpkm1 )
97         puu(ji,jj,jk,Krhs) = puu(ji,jj,jk,Krhs) - ( zwuw(ji,jj,jk) + zwuw(ji,jj,jk+1) ) * r1_e1e2u(ji,jj) / e3u(ji,jj,jk,Kmm)
98         pvv(ji,jj,jk,Krhs) = pvv(ji,jj,jk,Krhs) - ( zwvw(ji,jj,jk) + zwvw(ji,jj,jk+1) ) * r1_e1e2v(ji,jj) / e3v(ji,jj,jk,Kmm)
99      END_3D
100
101      IF( l_trddyn ) THEN           ! save the vertical advection trends for diagnostic
102         ztrdu(:,:,:) = puu(:,:,:,Krhs) - ztrdu(:,:,:)
103         ztrdv(:,:,:) = pvv(:,:,:,Krhs) - ztrdv(:,:,:)
104         CALL trd_dyn( ztrdu, ztrdv, jpdyn_zad, kt, Kmm )
105         DEALLOCATE( ztrdu, ztrdv ) 
106      ENDIF
107      !                             ! Control print
108      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=puu(:,:,:,Krhs), clinfo1=' zad  - Ua: ', mask1=umask,   &
109         &                                  tab3d_2=pvv(:,:,:,Krhs), clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
110      !
111      IF( ln_timing )   CALL timing_stop('dyn_zad')
112      !
113   END SUBROUTINE dyn_zad
114
115   !!======================================================================
116END MODULE dynzad
Note: See TracBrowser for help on using the repository browser.