program mvm
use m1
use m2
implicit none
integer l, n, mxmv, ldw, info
double precision  x(1484), rhs(1484), tol
logical   okprint,nonzero
character*3   typestop
double precision  work(1484,9)
integer   lmax
parameter(lmax=2)
double precision rwork(lmax+1,3+2*(lmax+1))
integer i

okprint=.true.
nonzero=.false.
l=2
n=1484

open(20,file='cx.dat')
open(21,file='bigb.dat')

do i=1,n
read(20,*)x(i)
read(21,*)rhs(i)
end do

tol=0.01
typestop='rel'
mxmv=1000
ldw=100

call bicgstab2 (okprint,l, n, x, rhs,matvec, nonzero, tol,typestop,mxmv, work, ldw, info)

end program
