- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
In Fortran v 10.1, I would like to create a module with a defined type and declare a set of subroutine interfaces that have anargument of the declared type. I cannot "use" the module in the interface declaration, and I get an unrecognized type error if I leave it out.
MODULEX
TYPE X_t
INTEGER :: XXX
END TYPE X_t
INTERFACE
SUBROUTINE XX(Obj)
! USE X
TYPE(X_t), INTENT(INOUT) :: Obj
END SUBROUTINE
END INTERFACE
END MODULE X
How do Imake the type visible in the interface?
MODULEX
TYPE X_t
INTEGER :: XXX
END TYPE X_t
INTERFACE
SUBROUTINE XX(Obj)
! USE X
TYPE(X_t), INTENT(INOUT) :: Obj
END SUBROUTINE
END INTERFACE
END MODULE X
How do Imake the type visible in the interface?
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
2 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Quoting - mattsdad
In Fortran v 10.1, I would like to create a module with a defined type and declare a set of subroutine interfaces that have anargument of the declared type. I cannot "use" the module in the interface declaration, and I get an unrecognized type error if I leave it out.
MODULEX
TYPE X_t
INTEGER :: XXX
END TYPE X_t
INTERFACE
SUBROUTINE XX(Obj)
! USE X
TYPE(X_t), INTENT(INOUT) :: Obj
END SUBROUTINE
END INTERFACE
END MODULE X
How do Imake the type visible in the interface?
MODULEX
TYPE X_t
INTEGER :: XXX
END TYPE X_t
INTERFACE
SUBROUTINE XX(Obj)
! USE X
TYPE(X_t), INTENT(INOUT) :: Obj
END SUBROUTINE
END INTERFACE
END MODULE X
How do Imake the type visible in the interface?
I believe you should remove "USE X" and instead type: "IMPORT :: X_t". This will make the type X_t visible from within the interface block.
Hope this helps!
Olivier
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla