- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I try to compile a module where a class is defined as
type, abstract, extends(CSteadySol)::CUnsteadySol contains procedure::init_solution=>init_solution_Unsteady procedure::solve=>solve_Unsteady procedure::UpdateTime=>UpdateTime_Unsteady end type
all procedures are module procedures and a submodule is used to define the body of there subroutines. But a error returned, as following in the submodule file
D:\FEA\BFREM1_6\FEA\src\temporal_solver\CTemporalSol_smod.f90(814): error #6406: Conflicting attributes or multiple declaration of name. [CUNSTEADYSOL_INIT] D:\FEA\BFREM1_6\FEA\src\temporal_solver\CTemporalSol_smod.f90(859): error #6115: A separate interface body must have been declared in the program unit or an ancestor of the program unit for the separate module procedure. [INIT_SOLUTION_UNSTEADY] xfortcom: Fatal: There has been an internal compiler error (C0000005).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error suggests an interface block is missing in your module. The procedures that are implemented in a submodule must be declared in the module by means of an interface. For instance:
interface
module subroutine init_solution_Unsteady
...
end subroutine init_solution_Unsteady
![same for the other procedures implemented in the submodule]
end interface
- 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
But I found that if I declare init_solution_Unsteady as a private function, it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please show the exact code of the parent module containing the type definition and the interface block as well as the corresponding submodule (not the whole implementation, just the lines where the submodule and your subroutines are declared)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This part is in the mod file:
------------------------------------------------------------------------------
this part is in the submodule file:
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page