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

fpp inside a module

Naomi_Greenberg
Beginner
681 Views
I have a variable inside a fortran module that I would like to define based on a defined variable:

module xyz

#if defined BUFSIZE
#define NMWords BUFSIZE
#else
#define NMWords 20
#endif

integer :: NMW = NMWords

end module xyz

Is this legal? In the makefile for this module, I have defined BUFSIZE. When I run this code, NMWords always is 20, even though BUFSIZE should be defined. Any help appreciated!

Never mind. I found the problem. This is legal.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
681 Views
Glad to hear you figured it out.
0 Kudos
Reply