Skip to content

Commit a092065

Browse files
authored
Merge pull request #311 from mandli/fix-interface-advection-example
Fix Bug in `qinit` in `advection_2d_inflow` Example
2 parents 686c733 + 7314cef commit a092065

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

examples/advection_2d_inflow/qinit.f90

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@ subroutine qinit(meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux)
55
! q = 1.0 if 0.1 < x < 0.6 and 0.1 < y < 0.6
66
! 0.1 otherwise
77

8+
implicit none
9+
810
integer, intent(in) :: meqn, mbc, mx, my, maux
911
real(kind=8), intent(in) :: xlower, ylower, dx, dy
1012
real(kind=8), intent(in out) :: q(meqn, 1-mbc:mx+mbc, 1-mbc:my+mbc)
1113
real(kind=8), intent(in out) :: aux(maux, 1-mbc:mx+mbc, 1-mbc:my+mbc)
1214

13-
real(kind=8), external :: qtrue
15+
integer :: i, j
16+
real(kind=8) :: xi, yj
17+
18+
! True solution for BCs
19+
interface
20+
real(kind=8) pure function qtrue(x, y ,t)
21+
implicit none
22+
real(kind=8), intent(in) :: x, y ,t
23+
end function qtrue
24+
end interface
1425

1526
! set concentration profile
1627
do j=1,my
@@ -21,4 +32,4 @@ subroutine qinit(meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux)
2132
end do
2233
end do
2334

24-
end subroutine qinit
35+
end subroutine qinit

0 commit comments

Comments
 (0)