Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29429 Discussions

compiler switch to generate interface blocks

Ray_R_1
Beginner
1,529 Views
I'm trying out the compiler switch for generating interface blocks (10.0.027). I have used it to generate interfaces for external subroutines and functions and now I'm trying to use it to generate interface blocks (the source code) for the internal subroutines and functions of a module, it does not do it. It is my take on modules is that the compiler generates an explicit interface for module procedures, so why can't I get a source listing of thoses interfaces. If I add a subroutine after the module I do get the source code for that subroutine's interface. I want the source code so I can see what the compiler generated for those explicit interfaces.
example
MODULE MOD_A
REAL :: A, B, C, D
public Sub_1
contains
SUBROUTINE SUB_1 (F)
real :: F
B=2.0
WRITE (*,*) B,F
f=3.0
END SUBROUTINE SUB_1

END MODULE MOD_A

PROGRAM TEST
USE MOD_A
b=1.0
CALL SUB_1 (B)
CALL SUB_2 (B)
write(*,*)B
END PROGRAM TEST


subroutine Sub_2(x)
real :: X
write(*,*) X
x=x+1
write(*,*)x
return
End Subroutine Sub_2

I get
console3.exe
source1.obj
mod_a.mod
sub_2_mod.f90
sub_2_mod.mod

but no
mod_a_mod.f90

is there anyway to get this?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,529 Views
The purpose of this feature is to enable a diagnostic when you call a routine with incorrect arguments. This happens automatically with module procedures, so there's no need for generated interfaces. You'd also have to worry about qualifying the name since you could have a SUB_1 in two or more modules.

That we expose the source of the generated interfaces is a nice extra, but that's not the purpose of this feature. You couldn't call SUB_1 without using the module anyway, so what are you looking for?
0 Kudos
Ray_R_1
Beginner
1,529 Views
I want to use it for diagonistics. I would like to know what the compiler is producing for the argument list. I have been playing with the "Static Verification" switch and have been getting error of "argument 1 does not conform to dummy argument" and function "xxx" called as subroutine. I assume that these two errors are related. I do call function xxx in the module but as a function not a subroutine. I don't see anything wrong with my code, and it runs fine, just want to make sure that there is not something hiding that is going to bite me.
I'm trying to get the code approved for public release, if I get it pushed through I will send a copy to support to see if they get the same thing.
0 Kudos
Steven_L_Intel1
Employee
1,529 Views
For your module procedures, it should be using the interface as you wrote it in the code. There is nothing to generate.

The Static Verifier is known to make mistakes. If you believe that your code is ok, please do let us know at Intel Premier Support so that we can fix SV.
0 Kudos
Reply