subroutine vmatrix(u,dtau,gf,dgf,fj,ntau,fup,fdn,VA,VB,VC) implicit double precision (a-h,o-z) parameter (zero=0.d0,half=0.5d0,one=1.d0,two=2.d0) dimension dtau(1),gf(1),dgf(1),fj(1),VA(1),VB(1),VC(1) u2 = u*u C --------------------------------------------------------- C Upper Boundary C --------------------------------------------------------- jt = 1 gfb=gf(jt) gfc=gf(jt+1) gfp=half*(gfb+gfc) dtp=gfp*dtau(jt) rdb=dgf(jt) rdc=dgf(jt+1) alpha = two*u2*(fj(jt+1)-fj(jt))/dtp**2 beta = u*(fdn-fj(jt))/dtp bdn = (alpha+beta)/gfp VA(jt)=zero VB(jt)=rdb*bdn VC(jt)=rdc*bdn C --------------------------------------------------------- C Middle C --------------------------------------------------------- do jt = 2, ntau-1 gfa = gfb gfb = gfc gfc = gf(jt+1) gfm = gfp gfp = half*(gfb+gfc) dtm = dtp dtp = gfp*dtau(jt) dta = half*(dtm+dtp) rda = rdb rdb = rdc rdc = dgf(jt+1) alpha = u2*(fj(jt-1)-fj(jt))/dtm/dta gamma = u2*(fj(jt+1)-fj(jt))/dtp/dta beta = alpha + gamma adn = half*(alpha+half*beta*dtm/dta)/gfm cdn = half*(gamma+half*beta*dtp/dta)/gfp VA(jt) = rda*adn VB(jt) = rdb*(adn + cdn) VC(jt) = rdc*cdn enddo C --------------------------------------------------------- C Lower Boundary C --------------------------------------------------------- jt = ntau gfm = gfp dtm=dtp rda=rdb rdb=rdc alpha = two*u2*(fj(jt-1)-fj(jt))/dtm**2 beta = u*(fup-fj(jt))/dtm bdn = (alpha+beta)/gfm VA(jt)=rda*bdn VB(jt)=rdb*bdn VC(jt)=zero return end