subroutine bcxa(ax,ay,xmax,ymax,jdim,jmax,ldim,lmax,x,y,t,io, & a,b) c General information: c Subroutine bcxa returns an artificial boundary condition for c the left hand boundary x = xmax for the convection equation c u_t + ax u_x + ay u_y =0 c on a rectangular region of size xmax by ymax. c The boundary condition is returned in the form of the coefficients c of an equation. In particular, if u(j,l) is the mesh-value of the c unknown u at an arbitrary mesh point (j,l), a boundary condition c that bcxa can handle is of the general form c sum (j = 0 to jmax) a(j) u(j,l) = b(l) for l = 0, 1, ..., lmax c where vector a is independent of y and time. c Subroutine bcxa returns the vector a and the right hand sides c b(l) of the equations for all l values. c The present implementation of bcxa finds the boundary point by c linear extrapolation from the interior: c u(jmax,l) = 2 u(jmax-1,l) - u(jmax-2,l) c Copyright 1997 Leon van Dommelen c Version 1.0 Leon van Dommelen 1/10/97 c Arguments: c Avoid typos: implicit none c Input: components of the convection velocity in the x and y directions: double precision ax,ay c Input: x- and y-sizes of the rectangular domain: double precision xmax,ymax c Input: declared maximum indices in the x- and y-directions: integer jdim,ldim c Input: actual maximum indices in the x- and y-directions: integer jmax,lmax c Input: the x- and y-values of the mesh points: double precision x(0:jdim),y(0:ldim) c Input: the time at which to return the boundary condition: double precision t c Input: Fortran I/O unit to do output on: integer io c Output: the coefficients of the artificial boundary condition: double precision a(0:jdim) c Output: the right hand sides of the artificial boundary condition: double precision b(0:ldim) c External variables and info for compiling or changing subroutine bcxa: c It may be noted that if you change boundary condition bcxa, for c example to use mirror points or staggering, you may also have to c change subroutine ini which generates the mesh-point x-values. c Local variables: c Index in the x-direction: integer j c Index in the y-direction: integer l c Constants, defined to simplify changing precision: double precision zero,one,two parameter (zero=0.d0,one=1.d0,two=2.d0) c Executable statements: c Check the mesh size: if(jmax.lt.2)then print*,'*** bcyx: the number of mesh intervals '// & 'in x-direction must be at least 2,' print*,' but is:',jmax stop endif c Set the coefficients a(j) in the equation: do 100 j=0,jmax-3 a(j)=zero 100 continue a(jmax-2)=one a(jmax-1)=-two a(jmax)=one c The right hand sides: do 200 l=0,lmax b(l)=zero 200 continue c All done: goto 900 c Exit: 900 return end