For Programmers: Free Programming Magazines  


Home > Archive > Fortran > November 2005 > Re: the problem of declaring a function in the interface









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: the problem of declaring a function in the interface
Jurang

2005-11-21, 7:01 pm

As Richard suggested, I separated two modules in different files and
try not to use "use" and took out unnessary part now.


------------- Error Messsge
----------------------------------------------
xlf95 -c -qmoddir=MODDIR -IMODDIR def_fncs.f

"def_fncs.f", 1514-199 (S) Array a is a deferred-shape array but does
not have the POINTER or ALLOCATABLE attributes.
** def_fncs === End of Compilation 1 ===
1501-511 Compilation failed for file def_fncs.f.


----------------- functions.f ---------------------------------------
module functions
INTEGER, PARAMETER :: DP = KIND(1.0D0)
implicit none
contains
function A(x)
implicit none
real(dp), dimension(:), intent(in) :: x
real(dp), dimension(:), allocatable :: A
end function A
end module functions

----- def_fncs.f
odule def_fncs
interface
function A(x)
INTEGER, PARAMETER :: DP = KIND(1.0D0)
implicit none
real(dp), dimension(:), intent(in) :: x
real(dp), dimension(:), allocatable :: A
end function A
end interface
end module def_fncs
---------------------------------------------------------------------------------------------------

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com