首页 > 解决方案 > Fortran77:子程序参数中的星号 (*) 是什么意思?

问题描述

我有一些问题scipy.interpolate.splrep,所以我别无选择,只能深入研究一些非常古老的 Fortran77 代码。

我无法理解的一件事是: https ://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack/curfit.f#L257

它调用一个子程序fpcurf

      call fpcurf(iopt,x,y,w,m,xb,xe,k,s,nest,tol,maxit,k1,k2,n,t,c,fp,
     * wrk(ifp),wrk(iz),wrk(ia),wrk(ib),wrk(ig),wrk(iq),iwrk,ier)

其中wrk是一维数组

的签名fpcurf

      subroutine fpcurf(iopt,x,y,w,m,xb,xe,k,s,nest,tol,maxit,k1,k2,
     * n,t,c,fp,fpint,z,a,b,g,q,nrdata,ier)
c  ..
c  ..scalar arguments..
      real*8 xb,xe,s,tol,fp
      integer iopt,m,k,nest,maxit,k1,k2,n,ier
c  ..array arguments..
      real*8 x(m),y(m),w(m),t(nest),c(nest),fpint(nest),
     * z(nest),a(nest,k1),b(nest,k2),g(nest,k2),q(m,k1)
      integer nrdata(nest)

你可以在https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack/fpcurf.f找到它

显然签名不匹配(因为wrk是数组,并且wrk[xxx]是标量)。谁能解释为什么?我注意到这里有一个星号(*),它有什么特别的含义吗?

也许熟悉 Fortran 的人可以看看这个函数并找出为什么调用与子例程签名不匹配?

标签: fortranfortran77

解决方案


推荐阅读