Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions src/meanflow/extpressure.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ subroutine extpressure(method,nlev)
! For details of this method, see \cite{Burchard99}.
!
! !USES:
use meanflow, only: u,v,h
use meanflow, only: u,v,h,z
use observations, only: dpdx,dpdy,h_press
!
IMPLICIT NONE
Expand All @@ -54,22 +54,27 @@ subroutine extpressure(method,nlev)
!
! !LOCAL VARIABLES:
integer :: i
REALTYPE :: z(0:nlev)
REALTYPE :: rat,uint,vint,hint
!
!-----------------------------------------------------------------------
!BOC
select case (method)
case (1)
! current measurement at h_press above bed
z(1)=0.5*h(1)
i =0
222 i=i+1
z(i+1)=z(i)+0.5*(h(i)+h(i+1))
if ((z(i+1).lt.h_press%value).and.(i.lt.nlev)) goto 222
rat=(h_press%value-z(i))/(z(i+1)-z(i))
uint=rat*u(i+1)+(1-rat)*u(i)
vint=rat*v(i+1)+(1-rat)*v(i)
do i=1,nlev
if ( h_press%value .lt. z(i) ) exit
end do
if (i .eq. 1) then
uint = u(1)
vint = v(1)
else if ( i .eq. nlev+1 ) then
uint = u(nlev)
vint = v(nlev)
else
rat = (h_press%value-z(i-1))/(z(i)-z(i-1))
uint = rat*u(i) + (1-rat)*u(i-1)
vint = rat*v(i) + (1-rat)*v(i-1)
end if
do i=1,nlev
u(i)=u(i)+dpdx%value-uint
v(i)=v(i)+dpdy%value-vint
Expand Down