在您提供的源代码的第 473 行:
contrl - is the actual driver of the package. This routine contains the strategy for nonlinear equation solving.
此代码是用 Fortran 77 编写的,因此您无法从模块中受益。这意味着您可能需要从头开始创建一个主程序,准备参数以按特定顺序调用您需要的子例程,并将 Coldae 与您的主程序一起编译。认为自己很幸运,代码似乎有据可查。
我可以建议你,至少,遵循 Fortran 教程(StackOverflow 上有一个很好的文档)并仔细阅读源代码中的注释,作者还包含了他们的参考,所以你也应该看看,你可以如果您不知道代码来自何处,则不希望理解代码。
该代码为您提供了有关驱动程序中所需的用户子例程的非常详细的信息。一种可能的方法是选择一个简单的 DAE 问题,编写相应fsub的dfsub等,然后将它们插入到主子程序(您的驱动程序)中。
另外,看看这个例子(注意他们使用的软件不同,但用户子程序与 COLDAE 使用的非常相似)。
C ************* user supplied subroutines *************
C
C
C the following subroutines must be declared external in the
C main program which calls coldae.
C
C
C fsub - name of subroutine for evaluating f(x,z(u(x)),y(x)) =
C t
C (f ,...,f ) at a point x in (aleft,aright).
C 1 ncomp+ny
C
C dfsub - name of subroutine for evaluating the jacobian of
C f(x,z(u),y) at a point x.
C
C gsub - name of subroutine for evaluating the i-th component of
C g(x,z(u(x))) = g (zeta(i),z(u(zeta(i)))) at a point x =
C i
C zeta(i) where 1.le.i.le.mstar.
C
C dgsub - name of subroutine for evaluating the i-th row of
C the jacobian of g(x,z(u(x))).
C
C guess - name of subroutine to evaluate the initial
C approximation for z(u(x)), y(x) and for dmval(u(x))= vector
C of the mj-th derivatives of u(x).
C
C**********************************************************************