0

I have some problem with scipy.interpolate.splrep, so I have no choice by to dig into some very old Fortran77 code.

And one thing I can not understand is here: https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack/curfit.f#L257

it calls a subroutine 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)

where the wrk is one dimension array

and the signature of fpcurf is

      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)

you can find it at https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack/fpcurf.f

And obviously the signature doesn't match (since wrk is array, and wrk[xxx] is a scalar). Can anyone explain why? I noticed that there is a asterisk (*) here, does it mean anything special?

Maybe anyone familiar with Fortran could please take a look at this function and figure out why the call doesn't match the subroutine signature?

Ziqi Liu
  • 2,931
  • 5
  • 31
  • 64

0 Answers0