Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Inheritance of modules

drb
Principiante
764 Visualizações
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
0 Kudos
2 Respostas
Steven_L_Intel1
Funcionário
765 Visualizações
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.
drb
Principiante
765 Visualizações

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