Commit 57f04691 authored by Knut's avatar Knut
Browse files

ss_nn_MUDFLAT: smooth_bvf_[hor|ver]

parent db87cf58
......@@ -310,6 +310,12 @@
<avhback>
0.0
</avhback>
<smooth_bvf_hor>
False
</smooth_bvf_hor>
<smooth_bvf_ver>
False
</smooth_bvf_ver>
<ip_method>
1
</ip_method>
......
......@@ -467,6 +467,8 @@
<element name="calc_salt" type="bool" label="solve salinity equation"/>
<element name="avmback" type="float" label="background viscosity" unit="m²/s"/>
<element name="avhback" type="float" label="background diffusivity" unit="m²/s"/>
<element name="smooth_bvf_hor" type="bool" label="smooth buoyancy frequency in the horizontal"/>
<element name="smooth_bvf_ver" type="bool" label="smooth buoyancy frequency in the vertical"/>
<element name="ip_method" type="int" label="internal pressure method">
<options>
<option value="1" label="Blumberg and Mellor"/>
......
......@@ -74,6 +74,7 @@
#ifndef _OLD_BVF_
use variables_3d, only: alpha,beta
#endif
use m3d, only: smooth_bvf_hor,smooth_bvf_ver
use getm_timers, only: tic, toc, TIM_NN
!$ use omp_lib
IMPLICIT NONE
......@@ -86,9 +87,7 @@
REALTYPE :: dz,NNc,ttt
REALTYPE :: NNe,NNw,NNn,NNs
REALTYPE, parameter :: small_bvf = 1.d-10
#ifdef _SMOOTH_BVF_VERT_
REALTYPE :: below,center,above
#endif
REALTYPE,dimension(I2DFIELD) :: below,center,above
!EOP
!-----------------------------------------------------------------------
!BOC
......@@ -127,26 +126,29 @@
end if
NN(i,j,k)= NNc
end do
#ifdef _SMOOTH_BVF_VERT_
if ( kmax .ge. 4 ) then
below = NN(i,j,1)
center = NN(i,j,2)
above = NN(i,j,3)
do k= 2,kmax-2
center = _HALF_ * center + _QUART_ * (below+above)
below = NN(i,j,k)
NN(i,j,k) = center
center = NN(i,j,k+1)
above = NN(i,j,k+2)
end do
end if
#endif
end if
end do
end do
!$OMP END DO
!$OMP SINGLE
#ifdef SMOOTH_BVF_HORI
if (smooth_bvf_ver) then
if ( kmax .ge. 4 ) then
below = NN(:,:,1)
center = NN(:,:,2)
above = NN(:,:,3)
do k= 2,kmax-2
center = _HALF_ * center + _QUART_ * (below+above)
below = NN(:,:,k)
NN(:,:,k) = center
center = NN(:,:,k+1)
above = NN(:,:,k+2)
end do
end if
end if
if (smooth_bvf_hor) then
!$OMP END SINGLE
!$OMP DO SCHEDULE(RUNTIME)
do j=jmin,jmax
do i=imin,imax
......@@ -179,7 +181,8 @@
end do
end do
!$OMP END DO
#endif
!$OMP SINGLE
end if
#ifdef SLICE_MODEL
do k=1,kmax-1
......
......@@ -56,6 +56,8 @@
integer :: turb_adv_split=0
integer :: turb_adv_hor=0
integer :: turb_adv_ver=0
logical :: smooth_bvf_hor=.false.
logical :: smooth_bvf_ver=.false.
logical :: calc_temp=.true.
logical :: calc_salt=.true.
logical :: bdy3d=.false.
......@@ -125,7 +127,7 @@
vel3d_adv_split,vel3d_adv_hor,vel3d_adv_ver, &
turb_adv_split,turb_adv_hor,turb_adv_ver, &
calc_temp,calc_salt, &
avmback,avhback, &
avmback,avhback,smooth_bvf_hor,smooth_bvf_ver, &
ip_method,ip_ramp, &
vel_check,min_vel,max_vel
!EOP
......@@ -204,6 +206,26 @@
end if
#endif
#ifdef SMOOTH_BVF_HOR
if (.not. smooth_bvf_hor) then
LEVEL2 "reset smooth_bvf_hor=T because of obsolete"
LEVEL2 "SMOOTH_BVF_HOR macro. Note that this"
LEVEL2 "behaviour will be removed in the future."
smooth_bvf_hor = .true.
end if
#endif
LEVEL2 "smooth_bvf_hor = ",smooth_bvf_hor
#ifdef _SMOOTH_BVF_VERT_
if (.not. smooth_bvf_ver) then
LEVEL2 "reset smooth_bvf_ver=T because of obsolete"
LEVEL2 "_SMOOTH_BVF_VERT_ macro. Note that this"
LEVEL2 "behaviour will be removed in the future."
smooth_bvf_ver = .true.
end if
#endif
LEVEL2 "smooth_bvf_ver = ",smooth_bvf_ver
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment