- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CHARACTER*(16) TAG
INTEGER*4 BASEADD(3) /0,0,0/
BYTE TYPE /14/
END STRUCTURE
Is this because TAG doesn't have an initialiser? What should such an initialiser look like? Sorry - it's been years since I did any serious FORTRAN...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following works:
[plain]BLOCK DATAIdeally, the STRUCTURE, variable and COMMON declarations would come from an INCLUDE file. Elsewhere in the program you'd just use the INCLUDE.
STRUCTURE /LOCAL_POINT/
CHARACTER*(16) TAG
INTEGER*4 BASEADD(3)
BYTE TYPE
END STRUCTURE
RECORD /LOCAL_POINT/ eN2B15S23
COMMON /MYC/ eN2B15S23
data eN2B15S23 /LOCAL_POINT('',[0,0,0],14)/
end[/plain]
I will admit that I am a bit puzzled by this error and perhaps this should be a standards warning rather than an error. I will investigate.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could give some more info? Using only this piece of code, I couldn't reproduce your error, as it worked flawlessly. Also, the inicializationis just fine. Is your structure inside any type definition, module, or whatever?
Roger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could give some more info? Using only this piece of code, I couldn't reproduce your error, as it worked flawlessly. Also, the inicializationis just fine. Is your structure inside any type definition, module, or whatever?
Roger
The variable I create appears in a common block, which is giving the problem. Here's all I need to reproduce the error:
PROGRAM TEST
STRUCTURE /LOCAL_POINT/
CHARACTER*(16) TAG
INTEGER*4 BASEADD(3) /0,0,0/
BYTE TYPE /14/
END STRUCTURE
RECORD /LOCAL_POINT/ eN2B15S23
COMMON /MYC/ eN2B15S23
END PROGRAM
Any help would be appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following works:
[plain]BLOCK DATAIdeally, the STRUCTURE, variable and COMMON declarations would come from an INCLUDE file. Elsewhere in the program you'd just use the INCLUDE.
STRUCTURE /LOCAL_POINT/
CHARACTER*(16) TAG
INTEGER*4 BASEADD(3)
BYTE TYPE
END STRUCTURE
RECORD /LOCAL_POINT/ eN2B15S23
COMMON /MYC/ eN2B15S23
data eN2B15S23 /LOCAL_POINT('',[0,0,0],14)/
end[/plain]
I will admit that I am a bit puzzled by this error and perhaps this should be a standards warning rather than an error. I will investigate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm running into this same problem in Intel Parallel Sutdio XE 2011 (version 12.0). The workaround suggested does work, but I'm not excited about fixing the 1000+ places were our legacy code has used this incorrect definition. You said "I will admit that I am a bit puzzled by this error and perhaps this should be a standards warning rather than an error. I will investigate." Is there a way to reduce this error to a warning?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no way to prevent this diagnostic from aborting the compilation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am migrating Compaq Visual Fortran code to Intel Visual Fortran.
The code has a derived-type array pointer in COMMON block and that creates the same problem.
Error #6005: A derived type object in a COMMON block shall not have default initialization [ XYplots ]:
is given for the following code:
MODULE test
TYPE Axis
SEQUENCE
integer:: parm = 1
END TYPE Axis
TYPE XYplotsData
SEQUENCE
real, pointer:: plot(:)
TYPE (Axis):: X_axis
END TYPE XYplotsData
TYPE (XYplotsData), pointer:: XYplots (: )
COMMON /data1/ XYplots
END MODULE
There are no compilation errors if default initialization parm = 1 is taken off.
In the real (not simplified) code structure 'Axis' has many elements that have default initializations and I would like to keep it that way.
How do I define correctly this common block while keeping default initialization in Axis definition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take out the COMMON declaration. You don't need it for module variables.

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