- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi,
This is really a general Fortran question, but seems to be only a problem using the Intel compiler. Anyway, we have a number of modules in our mixed F90 and C code. Each module may use other modules, which in turn contain subroutines etc.
For example, I havea module A, which contains a number of subroutines, and some other variable declarations. If I want to access these subroutines or variables in another module, then I need to use the module in my other module (module B, say).
However, the compiler cannot resolve the variables or subroutine calls in the subroutines contained in module Aif I do:
MODULE B
USE A
contains
subroutine BA
end subroutine BA
subroutine BB
end subroutine BB
end MODULE
So, my question is really, what is the correct way of doing this? To compile with the Linux Intel compiler I need to use A in each subroutine in module B, whereas with other compilers this is not required, and the USE statement at the top of the module is sufficient.
Thanks in advance
Ben
- Marcas:
- Intel® Fortran Compiler
Link copiado
2 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
The way you have it is correct and I do this all the time in my code using Intel Fortran. What version of the compiler are you using?
If you think you have found a problem in the compiler, please report it to Premier Support and include a real example.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Thanks for the quick response.
I'll see if I can reproduce it with a smaller code than our main one, then submit to the support. I just needed to check that what we have is standard fortran, and not something that other compilers will let us get away with !
Ben

Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora