s***e 发帖数: 911 | 1 SUBROUTINE rkdumb(vstart,nvar,x1,x2,nstep,derivs)
INTEGER nstep,nvar,NMAX,NSTPMX
PARAMETER (NMAX=50,NSTPMX=200)
REAL x1,x2,vstart(nvar),xx(NSTPMX),y(NMAX,NSTPMX)
EXTERNAL derivs
COMMON /path/ xx,y
CU USES rk4
INTEGER i,k
REAL h,x,dv(NMAX),v(NMAX)
do 11 i=1,nvar
v(i)=vstart(i)
y(i,1)=v(i)
11 continue
xx(1)=x1
x=x1
h=(x2-x1)/nstep
do 13 k=1,nstep
call derivs(x,v,dv)
call rk4(v,dv,nva | j**n 发帖数: 20 | 2 go to www.nr.com....
they have electronic form of Numerical Recipes...and codes written in
both C and Fortran is available....
but the pages are all in pdf format... so you will need to either buy the
source code from the publisher or use some tools to extract the codes from
the pdf files. |
|