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

Last change on this file since 12377 was 12377, checked in by acc, 7 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: 6.8 KB
Line 
1MODULE dynadv_cen2
2   !!======================================================================
3   !!                       ***  MODULE  dynadv  ***
4   !! Ocean dynamics: Update the momentum trend with the flux form advection
5   !!                 using a 2nd order centred scheme
6   !!======================================================================
7   !! History :  2.0  ! 2006-08  (G. Madec, S. Theetten)  Original code
8   !!            3.2  ! 2009-07  (R. Benshila)  Suppression of rigid-lid option
9   !!----------------------------------------------------------------------
10
11   !!----------------------------------------------------------------------
12   !!   dyn_adv_cen2  : flux form momentum advection (ln_dynadv_cen2=T) using a 2nd order centred scheme 
13   !!----------------------------------------------------------------------
14   USE oce            ! ocean dynamics and tracers
15   USE dom_oce        ! ocean space and time domain
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
23   IMPLICIT NONE
24   PRIVATE
25
26   PUBLIC   dyn_adv_cen2   ! routine called by step.F90
27
28   !! * Substitutions
29#  include "do_loop_substitute.h90"
30   !!----------------------------------------------------------------------
31   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
32   !! $Id$
33   !! Software governed by the CeCILL license (see ./LICENSE)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE dyn_adv_cen2( kt, Kmm, puu, pvv, Krhs )
38      !!----------------------------------------------------------------------
39      !!                  ***  ROUTINE dyn_adv_cen2  ***
40      !!
41      !! ** Purpose :   Compute the now momentum advection trend in flux form
42      !!              and the general trend of the momentum equation.
43      !!
44      !! ** Method  :   Trend evaluated using now fields (centered in time)
45      !!
46      !! ** Action  :   (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) updated with the now vorticity term trend
47      !!----------------------------------------------------------------------
48      INTEGER                             , INTENT( in )  ::  kt           ! ocean time-step index
49      INTEGER                             , INTENT( in )  ::  Kmm, Krhs    ! ocean time level indices
50      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv     ! ocean velocities and RHS of momentum equation
51      !
52      INTEGER  ::   ji, jj, jk   ! dummy loop indices
53      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfu_t, zfu_f, zfu_uw, zfu
54      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zfv_t, zfv_f, zfv_vw, zfv, zfw
55      !!----------------------------------------------------------------------
56      !
57      IF( kt == nit000 .AND. lwp ) THEN
58         WRITE(numout,*)
59         WRITE(numout,*) 'dyn_adv_cen2 : 2nd order flux form momentum advection'
60         WRITE(numout,*) '~~~~~~~~~~~~'
61      ENDIF
62      !
63      IF( l_trddyn ) THEN           ! trends: store the input trends
64         zfu_uw(:,:,:) = puu(:,:,:,Krhs)
65         zfv_vw(:,:,:) = pvv(:,:,:,Krhs)
66      ENDIF
67      !
68      !                             !==  Horizontal advection  ==!
69      !
70      DO jk = 1, jpkm1                    ! horizontal transport
71         zfu(:,:,jk) = 0.25_wp * e2u(:,:) * e3u(:,:,jk,Kmm) * puu(:,:,jk,Kmm)
72         zfv(:,:,jk) = 0.25_wp * e1v(:,:) * e3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm)
73         DO_2D_10_10
74            zfu_t(ji+1,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji+1,jj,jk) ) * ( puu(ji,jj,jk,Kmm) + puu(ji+1,jj  ,jk,Kmm) )
75            zfv_f(ji  ,jj  ,jk) = ( zfv(ji,jj,jk) + zfv(ji+1,jj,jk) ) * ( puu(ji,jj,jk,Kmm) + puu(ji  ,jj+1,jk,Kmm) )
76            zfu_f(ji  ,jj  ,jk) = ( zfu(ji,jj,jk) + zfu(ji,jj+1,jk) ) * ( pvv(ji,jj,jk,Kmm) + pvv(ji+1,jj  ,jk,Kmm) )
77            zfv_t(ji  ,jj+1,jk) = ( zfv(ji,jj,jk) + zfv(ji,jj+1,jk) ) * ( pvv(ji,jj,jk,Kmm) + pvv(ji  ,jj+1,jk,Kmm) )
78         END_2D
79         DO_2D_00_00
80            puu(ji,jj,jk,Krhs) = puu(ji,jj,jk,Krhs) - (  zfu_t(ji+1,jj,jk) - zfu_t(ji,jj  ,jk)    &
81               &                           + zfv_f(ji  ,jj,jk) - zfv_f(ji,jj-1,jk)  ) * r1_e1e2u(ji,jj) / e3u(ji,jj,jk,Kmm)
82            pvv(ji,jj,jk,Krhs) = pvv(ji,jj,jk,Krhs) - (  zfu_f(ji,jj  ,jk) - zfu_f(ji-1,jj,jk)    &
83               &                           + zfv_t(ji,jj+1,jk) - zfv_t(ji  ,jj,jk)  ) * r1_e1e2v(ji,jj) / e3v(ji,jj,jk,Kmm)
84         END_2D
85      END DO
86      !
87      IF( l_trddyn ) THEN           ! trends: send trend to trddyn for diagnostic
88         zfu_uw(:,:,:) = puu(:,:,:,Krhs) - zfu_uw(:,:,:)
89         zfv_vw(:,:,:) = pvv(:,:,:,Krhs) - zfv_vw(:,:,:)
90         CALL trd_dyn( zfu_uw, zfv_vw, jpdyn_keg, kt, Kmm )
91         zfu_t(:,:,:) = puu(:,:,:,Krhs)
92         zfv_t(:,:,:) = pvv(:,:,:,Krhs)
93      ENDIF
94      !
95      !                             !==  Vertical advection  ==!
96      !
97      DO_2D_00_00
98         zfu_uw(ji,jj,jpk) = 0._wp   ;   zfv_vw(ji,jj,jpk) = 0._wp
99         zfu_uw(ji,jj, 1 ) = 0._wp   ;   zfv_vw(ji,jj, 1 ) = 0._wp
100      END_2D
101      IF( ln_linssh ) THEN                ! linear free surface: advection through the surface
102         DO_2D_00_00
103            zfu_uw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * ww(ji,jj,1) + e1e2t(ji+1,jj) * ww(ji+1,jj,1) ) * puu(ji,jj,1,Kmm)
104            zfv_vw(ji,jj,1) = 0.5_wp * ( e1e2t(ji,jj) * ww(ji,jj,1) + e1e2t(ji,jj+1) * ww(ji,jj+1,1) ) * pvv(ji,jj,1,Kmm)
105         END_2D
106      ENDIF
107      DO jk = 2, jpkm1                    ! interior advective fluxes
108         DO_2D_01_01
109            zfw(ji,jj,jk) = 0.25_wp * e1e2t(ji,jj) * ww(ji,jj,jk)
110         END_2D
111         DO_2D_00_00
112            zfu_uw(ji,jj,jk) = ( zfw(ji,jj,jk) + zfw(ji+1,jj  ,jk) ) * ( puu(ji,jj,jk,Kmm) + puu(ji,jj,jk-1,Kmm) )
113            zfv_vw(ji,jj,jk) = ( zfw(ji,jj,jk) + zfw(ji  ,jj+1,jk) ) * ( pvv(ji,jj,jk,Kmm) + pvv(ji,jj,jk-1,Kmm) )
114         END_2D
115      END DO
116      DO_3D_00_00( 1, jpkm1 )
117         puu(ji,jj,jk,Krhs) = puu(ji,jj,jk,Krhs) - ( zfu_uw(ji,jj,jk) - zfu_uw(ji,jj,jk+1) ) * r1_e1e2u(ji,jj) / e3u(ji,jj,jk,Kmm)
118         pvv(ji,jj,jk,Krhs) = pvv(ji,jj,jk,Krhs) - ( zfv_vw(ji,jj,jk) - zfv_vw(ji,jj,jk+1) ) * r1_e1e2v(ji,jj) / e3v(ji,jj,jk,Kmm)
119      END_3D
120      !
121      IF( l_trddyn ) THEN                 ! trends: send trend to trddyn for diagnostic
122         zfu_t(:,:,:) = puu(:,:,:,Krhs) - zfu_t(:,:,:)
123         zfv_t(:,:,:) = pvv(:,:,:,Krhs) - zfv_t(:,:,:)
124         CALL trd_dyn( zfu_t, zfv_t, jpdyn_zad, kt, Kmm )
125      ENDIF
126      !                                   ! Control print
127      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=puu(:,:,:,Krhs), clinfo1=' cen2 adv - Ua: ', mask1=umask,   &
128         &                                  tab3d_2=pvv(:,:,:,Krhs), clinfo2=           ' Va: ', mask2=vmask, clinfo3='dyn' )
129      !
130   END SUBROUTINE dyn_adv_cen2
131
132   !!==============================================================================
133END MODULE dynadv_cen2
Note: See TracBrowser for help on using the repository browser.