- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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).
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
But I found that if I declare init_solution_Unsteady as a private function, it works.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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)?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
This part is in the mod file:
------------------------------------------------------------------------------
this part is in the submodule file:
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable