⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stoerm.for

📁 Numerical Recipes一书中例子的源码所用到的函数集,William H. Press 和 Saul A. Teukolsky 所著
💻 FOR
字号:
      SUBROUTINE stoerm(y,d2y,nv,xs,htot,nstep,yout,derivs)
      INTEGER nstep,nv,NMAX
      REAL htot,xs,d2y(nv),y(nv),yout(nv)
      EXTERNAL derivs
      PARAMETER (NMAX=50)
CU    USES derivs
      INTEGER i,n,neqns,nn
      REAL h,h2,halfh,x,ytemp(NMAX)
      h=htot/nstep
      halfh=0.5*h
      neqns=nv/2
      do 11 i=1,neqns
        n=neqns+i
        ytemp(n)=h*(y(n)+halfh*d2y(i))
        ytemp(i)=y(i)+ytemp(n)
11    continue
      x=xs+h
      call derivs(x,ytemp,yout)
      h2=h*h
      do 13 nn=2,nstep
        do 12 i=1,neqns
          n=neqns+i
          ytemp(n)=ytemp(n)+h2*yout(i)
          ytemp(i)=ytemp(i)+ytemp(n)
12      continue
        x=x+h
        call derivs(x,ytemp,yout)
13    continue
      do 14 i=1,neqns
        n=neqns+i
        yout(n)=ytemp(n)/h+halfh*yout(i)
        yout(i)=ytemp(i)
14    continue
      return
      END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -