module - 警告缺少以下符号
问题描述
我编写使用模块结构的代码。
该模块由子程序和函数组成。其中一些由主程序调用,另一些由放置在模块中的子例程调用。
这是与我的问题相关的模块的重要部分:
module de
implicit none
public :: dsftdw ...
Private :: dless ...
contains
.
.
.
subroutine dsftdw ( l, u, k, lda, a, MAAP )
implicit none
integer(kind =3) :: lda
integer(kind =3) :: k
integer(kind =3) :: l
integer(kind =3) :: MAAP(:)
integer(kind =3) :: u
real(kind =3) :: a(lda,*)
logical :: dless
integer(kind =3) :: i
integer(kind =3) :: j
integer(kind =3) :: t
i = l
j = 2 * i
t = MAAP(i)
do
if ( u < j ) then
exit
end if
if ( j < u ) then
if ( dless ( k, a(1,maap(j)), a(1,maap(j+1)) ) ) then
j = j + 1
end if
end if
if ( dless ( k, a(1,maap(j)), a(1,t)) ) then
exit
end if
MAAP(i) = MAAP(j)
i = j
j = 2 * i
end do
MAAP(i) = t
end subroutine
.
.
.
function dless ( k, p, q )
implicit none
real(kind =3) :: cmax
logical :: dless
integer(kind =3) :: i
integer(kind =3) k
real(kind =3) :: p(k)
real(kind =3) :: q(k)
real(kind =3) :: tol
tol = 100.0D+00 * epsilon ( tol )
do i = 1, k
cmax = max ( abs ( p(i) ), abs ( q(i) ) )
if ( abs ( p(i) - q(i) ) <= tol * cmax .or. cmax <= tol ) then
cycle
end if
if ( p(i) < q(i) ) then
dless = .true.
else
dless = .false.
end if
return
end do
dless = .false.
end function
.
.
.
end module
(MAIN PROG BLOCK)
该模块放置在与 Main 程序相同的代码中。上述子程序独立于主程序,功能只在模块子程序中使用。
当我构建此代码时,它会显示以下警告:
警告缺少以下符号
当我运行代码时,它显示了这个错误:
运行时错误:调用缺少的例程
错误返回到在模块子例程中调用的函数。
该程序在 PLATO (Fortran 95) 中运行。
我会感谢任何给我一点帮助的评论,并原谅我写的缺点。
解决方案
See the mentioned details in 1. In summary:
This local declaration overrides the module function within this subroutine. Thus the subsequent reference is looking for an external function of that name, which apparently does not exist, and if it did, then you would not be computing what you think you are computing. Just remove this declaration to fix your problem.
推荐阅读
- c - 当“str”作为参数输入函数时,为什么 sizeof(str) 返回不同的输出?
- php - 控制配置文件修改所需的最小密码大小
- c# - C# 从 C++ DLL 编组 unsigned char* 数组
- python - 如何使用 django 将 docker compose 应用程序连接到私有 AWS RDS postgres 数据库
- c++ - C 系统调用 popen() 返回指向流的有效指针,但将 errno 设置为“没有这样的文件或目录”
- javascript - jQuery Selector 和 JS 可以在本地服务器上工作,但不能在 Web 服务器上工作
- kotlin - BiometricPrompt 与 Jetpack Compose
- docusignapi - 跳过 DocuSign 信封中的可选 TemplateRole
- javascript - 如果对象 B 中存在属性,则替换对象 A 中的匹配值
- math - 在一条直线的垂线上找到一个点