- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I try to reference a function of derived data type,I get error compiling the referencing subroutine. Note, no errors compiling function itself and module where derived data type is defined. Interestingly, when I turn off interface routine checking the error goes away and code compiles and performs as expected. Is it compiler bug or smth wrong with my code? Below is text of error and the code. Thanks for any ideas.
-----
Error 1 error #7977: The type of the function reference does not match the type of the function definition. [FUNCUNIT] D:\\Data\\Project\\EngineModel\\Fortran\\ver5.0\\ver5libNew\\engn\\mainUnit.f 8
-----
The derived data type is set in the module unit as follows:
ccc
MODULE TypeDefinitions
type GasProperties
Real Pt,Tt,FA, W
end type
end module
ccc
The function is defined as follows:
ccc
function funcUnit(StaIn) result(StaOut)
use TypeDefinitions
type (GasProperties) StaIn, StaOut
StaOut = StaIn
StaOut.Pt = StaIn.Pt * 2
end function
ccc
The function is referenced in the following subroutine:
ccc
SUBROUTINE mainUnit(StaIn,StaOut)
use TypeDefinitions
IMPLICIT NONE
c ....declare derived data types and functions
type (GasProperties) funcUnit, StaIn, StaOut
StaOut = funcUnit(StaIn)
RETURN
END
ccc
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have escalated this as issue DPD200157843.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page