- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page