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

Block data parameter value not recognize

philippe_bernier
Beginner
605 Views
Hello everyone,
I have a "Block Data" that looks like this:
BLOCK DATA BDA01
IMPLICIT INTEGER*4 (I-N)
INTEGER*4 IULIRC,IUSTAB,IULDFL,IUTRMI,IUTRMO,IUIMPO,
1IUCNDC,IUPLOT,IUDUMW,IUDUMR,IUREL1,IUREL2,IUINPR,
2IUINFM,ICTLOP,IUDICO,IUMANO,IUCNTL,IUPSAF,IUPUDM,IUPEQU
PARAMETER (IULIRC=8,IUSTAB=8,IULDFL=9,IUPLOT=10)
PARAMETER (IUTRMO=6,IUIMPO=6,IUCNDC=12,IUTRMI=5)
In a subroutine, if I use one of the parameter variable such asIULDFL, I do not get a value of 9 for it but I see zero instead.

What's going on ?
What compiler flag should I play with to have my code recognize this block of data ?
This code use to work under a previous fortran compiler.

Thank you

Philippe


0 Kudos
1 Reply
mecej4
Honored Contributor III
605 Views
There seems to be some confusion between BLOCK DATA and MODULE here.

Variables initialized in a BLOCK DATA subprogram need to be in one or more COMMON blocks in order to be accessible in other subprograms. Note that PARAMETER declarations, while useful for declaring several arrays with a common extent inside the BLOCK DATA subprogram, are not accessible outside that subprogram.

Alternatively, you may put the declarations and DATA statements in a module instead of BLOCK DATA, and USE the module in other subprograms. Named constants and variables can be used in this fashion.
0 Kudos
Reply