MODULE dynzdf_iso !!============================================================================== !! *** MODULE dynzdf_iso *** !! Ocean dynamics: vertical component(s) of the momentum mixing trend !!============================================================================== #if defined key_ldfslp || defined key_esopa !!---------------------------------------------------------------------- !! 'key_ldfslp' rotation of the mixing tensor !!---------------------------------------------------------------------- !! dyn_zdf_iso : update the momentum trend with the vertical diffusion !! (vertical mixing + vertical component of lateral !! mixing) (rotated lateral operator case) !!---------------------------------------------------------------------- !! * Modules used USE oce ! ocean dynamics and tracers USE dom_oce ! ocean space and time domain USE phycst ! physical constants USE zdf_oce ! ocean vertical physics USE in_out_manager ! I/O manager USE taumod ! surface ocean stress USE trddyn_oce ! dynamics trends diagnostics variables IMPLICIT NONE PRIVATE !! * Routine accessibility PUBLIC dyn_zdf_iso ! called by step.F90 !! * Substitutions # include "domzgr_substitute.h90" # include "vectopt_loop_substitute.h90" !!---------------------------------------------------------------------- !! OPA 9.0 , LODYC-IPSL (2003) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE dyn_zdf_iso( kt ) !!---------------------------------------------------------------------- !! *** ROUTINE dyn_zdf_iso *** !! !! ** Purpose : !! Compute the vertical momentum trend due to both vertical and !! lateral mixing (only for second order lateral operator, for !! fourth order it is already computed and add to the general trend !! in dynldf.F) and the surface forcing, and add it to the general !! trend of the momentum equations. !! !! ** Method : !! The vertical component of the lateral diffusive trends is !! provided by a 2nd order operator rotated along neural or geopo- !! tential surfaces to which an eddy induced advection can be added !! It is computed using before fields (forward in time) and isopyc- !! nal or geopotential slopes computed in routine ldfslp. !! !! First part: vertical trends associated with the lateral mixing !! ========== (excluding the vertical flux proportional to dk[U] ) !! vertical fluxes associated with the rotated lateral mixing: !! zfuw =-ahm { e2t*mi(wslpi) di[ mi(mk(ub)) ] !! + e1t*mj(wslpj) dj[ mj(mk(ub)) ] } !! update and save in zavt the vertical eddy viscosity coefficient: !! avmu = avmu + mi(wslpi)^2 + mj(wslj)^2 !! take the horizontal divergence of the fluxes: !! diffu = 1/(e1u*e2u*e3u) dk[ zfuw ] !! Add this trend to the general trend (ta,sa): !! ua = ua + difft !! !! Second part: vertical trend associated with the vertical physics !! =========== (including the vertical flux proportional to dk[U] !! associated with the lateral mixing, through the !! update of avmu) !! The vertical diffusion of momentum is given by: !! diffu = dz( avmu dz(u) ) = 1/e3u dk+1( avmu/e3uw dk(ua) ) !! using a backward (implicit) time stepping. !! Bottom boundary conditions : bottom stress (cf zdfbfr.F) !! Add this trend to the general trend ua : !! ua = ua + dz( avmu dz(u) ) !! !! 'key_trddyn' defined: trend saved for futher diagnostics. !! !! macro-tasked on vertical slab (jj-loop) !! !! ** Action : !! /comaft/ ua, va : general momentum trend increased !! by the after vertical diffusive trend !! /comtra/ utrd,vtrd: after vertical momentum diffusive !! trend ('key_trddyn' defined) !! !! History : !! original : 90-10 (B. Blanke) !! addition : 97-05 (G. Madec) vertical component of isopycnal !!--------------------------------------------------------------------- !! * Modules used USE ldfslp , ONLY : wslpi, wslpj USE ldftra_oce, ONLY : aht0 !! * Arguments INTEGER, INTENT( in ) :: kt ! ocean time-step index !! * Local declarations INTEGER :: ji, jj, jk ! dummy loop indices INTEGER :: & ikst, ikenm2, ikstp1 ! temporary integers REAL(wp) :: & zrau0r, z2dt, & ! temporary scalars z2dtf, zua, zva, zcoef, zzws REAL(wp) :: & zcoef0, zcoef3, zcoef4, zbu, zbv, zmkt, zmkf, & zuav, zvav, zuwslpi, zuwslpj, zvwslpi, zvwslpj REAL(wp), DIMENSION(jpi,jpk) :: & zwx, zwy, zwz & ! workspace , zwd, zws, zwi, zwt REAL(wp), DIMENSION(jpi,jpk) :: & zfuw, zdiu, zdju, zdj1u, & ! workspace zfvw, zdiv, zdjv, zdj1v #if defined key_trddyn INTEGER :: & ikbu, ikbum1 , ikbv, ikbvm1 ! temporary integers #endif !!---------------------------------------------------------------------- IF( kt == nit000 ) THEN IF(lwp) WRITE(numout,*) IF(lwp) WRITE(numout,*) 'dyn_zdf_iso : vertical momentum diffusion isopycnal operator' IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ ' ENDIF ! 0. Local constant initialization ! -------------------------------- ! inverse of the reference density zrau0r = 1. / rau0 ! Leap-frog environnement z2dt = 2. * rdt ! Euler time stepping when starting from rest IF ( neuler == 0 .AND. kt == nit000 ) z2dt = rdt ! ! =============== DO jj = 2, jpjm1 ! Vertical slab ! ! =============== ! I. vertical trends associated with the lateral mixing ! ===================================================== ! (excluding the vertical flux proportional to dk[t] ! I.1 horizontal momentum gradient ! -------------------------------- DO jk = 1, jpk DO ji = 2, jpi ! i-gradient of u at jj zdiu (ji,jk) = tmask(ji,jj ,jk) * ( ub(ji,jj ,jk) - ub(ji-1,jj ,jk) ) ! j-gradient of u and v at jj zdju (ji,jk) = fmask(ji,jj ,jk) * ( ub(ji,jj+1,jk) - ub(ji ,jj ,jk) ) zdjv (ji,jk) = tmask(ji,jj ,jk) * ( vb(ji,jj ,jk) - vb(ji ,jj-1,jk) ) ! j-gradient of u and v at jj+1 zdj1u(ji,jk) = fmask(ji,jj-1,jk) * ( ub(ji,jj ,jk) - ub(ji ,jj-1,jk) ) zdj1v(ji,jk) = tmask(ji,jj+1,jk) * ( vb(ji,jj+1,jk) - vb(ji ,jj ,jk) ) END DO END DO DO jk = 1, jpk DO ji = 1, jpim1 ! i-gradient of v at jj zdiv (ji,jk) = fmask(ji,jj ,jk) * ( vb(ji+1,jj,jk) - vb(ji ,jj ,jk) ) END DO END DO ! I.2 Vertical fluxes ! ------------------- ! Surface and bottom vertical fluxes set to zero DO ji = 1, jpi zfuw(ji, 1 ) = 0.e0 zfvw(ji, 1 ) = 0.e0 zfuw(ji,jpk) = 0.e0 zfvw(ji,jpk) = 0.e0 END DO ! interior (2=