uu_momentum_3d - -momentum eq. (Source File: uu_momentum_3d.F90)

**INTERFACE:**

subroutine uu_momentum_3d(n,bdy3d)

Here, the budget equation for layer-averaged momentum in eastern direction, , is calculated. The physical equation is given as equation (1), the layer-integrated equation as (26), and after curvilinear transformation as (38). In this routine, first the Coriolis rotation term, is calculated, either as direct transport averaging, or following Espelid et al. (2000) by using velocity averages (in case the compiler option NEW_CORI is set).

As a next step, explicit forcing terms (advection, diffusion, internal pressure gradient, surface stresses) are added up (into the variable ex(k)), the eddy viscosity is horizontally interpolated to the U-point, and the barotropic pressure gradient is calculated (the latter includes the pressure gradient correction for drying points, see section 5.5). Afterwards, the matrix is set up for each water column, and it is solved by means of a tri-diagonal matrix solver.

In case that the compiler option STRUCTURE_FRICTION is switched on, the frictional effect of structures in the water column is calculated by adding the quadratic frictional term (with a minus sign on the right hand side) numerically implicitly to the -equation, with the friction coefficient . The explicit part of this term, , is calculated in the routine structure_friction_3d.F90.

Finally, the new velocity profile is shifted such that its vertical integral is identical to the time integral of the vertically integrated transport. If the compiler option MUDFLAT is defined, this fitting of profiles is made with respect to the new surface elevation, otherwise to the old surface elevation.

When GETM is run as a slice model (compiler option SLICE_MODEL
is activated), the result for is copied to .
**USES:**

use exceptions use parameters, only: g,avmmol,rho_0 use domain, only: imin,imax,jmin,jmax,kmax,H,HU,min_depth use domain, only: dry_u,coru,au,av,az #if defined CURVILINEAR || defined SPHERICAL use domain, only: dxu,arud1,dxx,dyc,dyx,dxc #else use domain, only: dx,dy #endif use variables_2d, only: Uint,D use bdy_3d, only: do_bdy_3d use variables_3d, only: dt,cnpar,kumin,uu,vv,huo,hun,hvo,uuEx,ww,hvn use variables_3d, only: num,nuh,sseo,ssun,rru use variables_3d, only: ssuo #ifdef _MOMENTUM_TERMS_ use variables_3d, only: tdv_u,cor_u,ipg_u,epg_u,vsd_u,hsd_u,adv_u #endif #ifdef STRUCTURE_FRICTION use variables_3d, only: sf #endif #ifndef NO_BAROCLINIC use variables_3d, only: idpdx #endif use halo_zones, only: update_3d_halo,wait_halo,U_TAG use meteo, only: tausx,airp use m3d, only: ip_fac use m3d, only: vel_check,min_vel,max_vel use getm_timers, only: tic, toc, TIM_UUMOMENTUM, TIM_UUMOMENTUMH $ use omp_lib IMPLICIT NONE

integer, intent(in) :: n logical, intent(in) :: bdy3d

Original author(s): Hans Burchard & Karsten Bolding

integer :: i,j,k,rc #ifdef NEW_CORI REALTYPE,dimension(I3DFIELD) :: work3d #endif REALTYPE, POINTER :: dif(:) REALTYPE, POINTER :: auxn(:),auxo(:) REALTYPE, POINTER :: a1(:),a2(:) REALTYPE, POINTER :: a3(:),a4(:) REALTYPE, POINTER :: Res(:),ex(:) REALTYPE :: zp,zm,zx,ResInt,Diff,Vloc REALTYPE :: gamma=g*rho_0 REALTYPE :: cord_curv=_ZERO_ REALTYPE :: gammai,rho_0i integer :: status