【发布时间】:2019-04-09 10:36:59
【问题描述】:
我正在使用 IMSL Fortran 库中的函数 NEQNF 来求解非线性方程组并得到 3 个错误。我在 x64 系统上使用 Visual Studio 2017。错误说明如下:
Error #7061: The characterístic of dummy argument 1 of the associated actual procedure differ from the characteristics of dummy argument 1 of the dummy procedure [FCN_SS]
Error #7062: The characterístic of dummy argument 2 of the associated actual procedure differ from the characteristics of dummy argument 2 of the dummy procedure [FCN_SS]
Error #7063: The characterístic of dummy argument 3 of the associated actual procedure differ from the characteristics of dummy argument 3 of the dummy procedure [FCN_SS]
代码是:
include 'link_fnl_shared.h'
use neqnf_int
use umach_int
implicit none
!Declaring variables
.
.
.
Contains
subroutine solve_ss(x, fnorm)
integer n
parameter (n=2)
integer k, nout
real(dp) :: fnorm, x(n), xguess(n)
data xguess/1.0_dp, 0.3_dp/ !guess for total output in units
call umach (2, nout)
call neqnf (fcn_ss, x, xguess=xguess, fnorm=fnorm)
end subroutine solve_ss
subroutine fcn_ss(x, f, n)
implicit none
!specification
integer n
real(dp) :: x(n), f(n)
.
.
.
F(1)=...
F(2)=...
end subroutine fcn_ss
我不确定错误是什么,因为solve_ss 和fcn_ss 中的变量声明是相同的。
【问题讨论】:
-
尝试调用
D_NEQNF而不是NEQNF(最终也可以使用DNEQNF)。最好制作一个可编译的minimal reproducible example。 -
您拥有 IMSL 包含文件夹中模块 neqnf_int 的源代码。我不再有权访问它,但它是 NUMERICAL_LIBRARIES_F90.f90 或类似的东西。在文本编辑器(或 Visual Studio)中打开它,找到 NEQNF 的声明及其细节,并与您的 FCN_SS 进行比较。