|
qinit.f90.html |
|
|
Source file: qinit.f90
|
|
Directory: /Users/rjl/git/clawpack/classic/examples/acoustics_1d_example1
|
|
Converted: Wed Dec 28 2016 at 22:28:08
using clawcode2html
|
|
This documentation file will
not reflect any later changes in the source file.
|
subroutine qinit(meqn,mbc,mx,xlower,dx,q,maux,aux)
! Set initial conditions for the q array.
! This default version prints an error message since it should
! not be used directly. Copy this to an application directory and
! loop over all grid cells to set values of q(1:meqn, 1:mx).
implicit none
integer, intent(in) :: meqn,mbc,mx,maux
real(kind=8), intent(in) :: xlower,dx
real(kind=8), intent(in) :: aux(maux,1-mbc:mx+mbc)
real(kind=8), intent(inout) :: q(meqn,1-mbc:mx+mbc)
integer :: i
real(kind=8) :: beta, xcell
common /cqinit/ beta
do i=1,mx
xcell = xlower + (i-0.5d0)*dx
q(1,i) = dexp(-beta * (xcell-0.3d0)**2)
q(2,i) = 0.d0
enddo
end subroutine qinit