- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do not use the "initialize local variables to NaN". (That is an old description - it should be called something different in current versions.) That option doesn't do anything useful.
For zero initialization, you must also change the "local variable allocation" to "All variables SAVE".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To my understanding, "All variables SAVE" is to variables having static storage. How would I doif I just need to set local variables using automatic storage to be initialized to zero? Thanks for your help.
- 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
Yes, I agree with you that initializing variables using assignment. But it will be better having a catch-all situation that if anything is missed. In the Properties dialog box, I tried to use default setting with little modifications to itfor project settings. But I know the default settings may not be the best settings. Do you have any suggestions about how to set the properties?
Willthe settings"All variables SAVE" + setting "Initialize local saved scalar top zero" to "YES"cause any problems with COMMOM block? Is this the better settings for catch-all situation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That setting has no effect on common blocks - note that the description says local saved scalar - COMMON is not "local".
I'd suggest you try enabling uninitialized variable checking under "Run-Time" in your debug configuration. It doesn't catch all cases but it's better than nothing. I also recommend using "Warn for undeclared variables" if you're not in the habit of putting in IMPLICIT NONE everywhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
For arrys defined locally, the following trick is useful I think. Atleast in our software we are happy with this way of detecting unitiliazied arrays.
http://softwareforums.intel.com/en-us/forums//topic/42123
Hope this is useful for you!
Lars Petter

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