- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My co-developer reports that, contrary to his expectations, Intel Fortran seems to be initializing local numeric variables, both scalar and array, to 0 or 0.0
I should note that In our application, all local variables are saved, and all arrays are pre-allocated (sizes are explicit in the code). No arrays or structures are allocated at run-time, and no local variables are recursive.
Is his generalization correct?
Jay
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By default the Debug build implies -init=zero (-Qinit=zero), Release build does not. The Fortran standard states the value of uninitialized variables are undefined. Do not rely on what "seems to be initialized". Explicitly add the option for initialization, however, note the section in the option descriptions as to what is NOT initialized with this option.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please disregard my post. I now have a better idea of what my colleague was reporting, based on a small test case that I asked him to send me. When I get a better handle on the unexpected behavior, I will create a new post with an appropriate title.
Jay

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