-1

I write code that uses the module structure.

The module consisted of subroutine and function. Some of them are called by the main prog and others are called by subroutines that placed in the module.

Here is the important part of the module which related to my problem:

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)

The module placed with the Main program in the same code. The above subroutine is independent of the main program and function is just employed in the module subroutine.

When I BUILD this code, it shows this warning:

WARNING the following symbols are missing

And when I run the code, it shows this error:

run-time error: Call to missing routine

Error is back to the function which was called in the module subroutine.

This program is run in PLATO (Fortran 95).

I will appreciate any comments that give me a little help and forgive me for writing shortcomings.

Ian Bush
  • 6,996
  • 1
  • 21
  • 27
ALIN
  • 62
  • 1
  • 6
  • What are the exact warnings, we don't see which symbols are missing. What is in the main program? – albert Dec 30 '20 at 15:26
  • @albert what I showed here is a part of a very long code. The main prog calls other subroutines and also mentioned subroutine is called by other module subroutines. Other symbols are also functions which called by module subroutines. I mentioned the problem briefly. – ALIN Dec 30 '20 at 15:32
  • Best is to create a small MWE that shows the problem and at least the first set of names of the missing symbols. Also good to specify who you build and link. – albert Dec 30 '20 at 15:50
  • @albert Thank you for your attention. I don't know what is MWE. Also, other symbols are functions that are employed by the module subroutines, like above. – ALIN Dec 31 '20 at 07:34
  • The standard text: Please, take the [tour](https://stackoverflow.com/tour) and learn [How to Ask](https://stackoverflow.com/questions/how-to-ask). Then, present us a clear description of what are you trying to do, what you got wrong and what you expected to get, along with a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – albert Dec 31 '20 at 10:36
  • I highly suggest to avoid `kind=3`. Use named constansts. Many compilers will this kind value 3. See https://stackoverflow.com/questions/3170239/fortran-integer4-vs-integer4-vs-integerkind-4 for more – Vladimir F Героям слава Jan 02 '21 at 16:16
  • @VladimirF I highly suggest to you before stick [DUPLICATE] tag to my question, read the answer mentioned below. – ALIN Jan 03 '21 at 16:15
  • @ALIN I **HIGHLY** suggest, before complaining to anyone to 1. read who actually closed the question (hint: it wasn't me) 2. to read the linked question and its answers, 3. to read the site rules very carefuly. The question was closed correctly, albeit not by me. – Vladimir F Героям слава Jan 03 '21 at 16:30
  • @VladimirF PAPERWORK: either the code is not complete or the instructions are not fully read. Someone humbly gives a COMPLETE answer but was not welcomed. This is truth. – ALIN Jan 03 '21 at 18:40
  • @VladimirF I frequently used your answers here. Forgive me for my tone. I shouldn't use this to speak with you. But, my previous comment is a truth which should I tell to tagger person. – ALIN Jan 03 '21 at 19:14

1 Answers1

0

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.

ALIN
  • 62
  • 1
  • 6