On 1/1/21 8:26 AM,
ali_n...@yahoo.com wrote:
> subroutine dsftdw ( l, u, k, lda, a, MAAP )
[...]
> logical :: dless
[...]
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.
Here are some other general comments about your code.
It is problematic to use integer literals for kind values. You should
instead use parameters. Don't use the same parameter for the integer and
real kinds, even if they happen to have the same value for your compiler.
integer, parameter :: ip = 3, wp = 3 ! this could be in the de
! module or in its own module.
[...[
integer(ip) :: lda
[...]
real(wp) :: a(lda,*)
[...]
This way, when you change compilers, or change precision, you only need
to change one line, not dozens (or thousands or millions) of lines.
I suggest that you not use mixed precision arithmetic without reason.
Instead of
tol = 100.0D+00 * epsilon ( tol )
write something like
tol = 100.0_wp * epsilon ( tol )
instead. Also, tol could itself be a parameter, since its value does not
change.
real(wp), parameter :: tol = 100.0_wp * epsilon ( tol )
You have a multiline if block
if ( p(i) < q(i) ) then
dless = .true.
else
dless = .false.
end if
that could be written simply as
dless = p(i) < q(i)
Why make it complicated for you or for others to understand later?
$.02 -Ron Shepard