module OW_taper_areal
!--------------------------------------------------
! Compute vref
!
use OW_parms_areal
implicit none
integer, private :: taptr
contains
subroutine owtaper_init(tapertr_in)
integer, optional :: tapertr_in
if (present(tapertr_in)) then
   taptr=tapertr_in
else
   taptr=tapertr
end if
end subroutine

subroutine owtaper(taper)

integer				:: i
real				:: taper(:),pi
pi=4*atan(1.)
taper=1.
do i=1,taptr
   taper(i)=(1+cos(pi*(taptr-i+1)/taptr))/2
   taper(size(taper)-i+1)=taper(i)
end do

end subroutine owtaper

end module
