- 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
Explicitly initialize everything.
Message Edited by emc-nyc on 11-30-2005 04:21 PM
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might have two different named variables. One with the leading "_" and one without. Or, as I experienced recently, If you are compiling with OpenMP the variables declared in a module have the module name pre-pended to the variable:
module mod_foo
real :: fooArray(1000)
...
(With OpenMP)
creates
MOD_FOO_mp_fooArray
Then if you have additionaly compiled a source file without OpenMP your program will also contain "_fooArray". One of the two get initialized.
If you are not compiling with OpenMP you may have other similar problems.
What you could do to track this down is to insert a little test subroutine in the source module that initializes the data. Something like
Code:
module YourModule real :: YourData(someSize) ... end module YourModule contains subroutine CheckYourData(suspicious) real :: suspicious(*) if(loc(YourData(1)) .ne. loc(suspicious(1))) then write(*,*) "(loc(YourData(1)) .ne. loc(suspicious(1)))" stop endif end subroutine CheckYourData .... Then in the source module that exhibits the un-initialized data insert call CheckYourData(YourData)
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
include 'gi.fh'
- 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
The luhah is defined in gi.fh (global), it's a integer, I initialized it in bdhaha to 5. At using place, using "external bdhaha"
Best Regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My experience is that if a BLOCK DATA routine is missing, the linker won't generate a warning. If you have multiple BLOCK DATAs with the same (or no) name, this may also be confusing the linker.
My suggestions, then, are:
1) Listen to tim18; use more module variables, vs common.
2) If you can't do that, put all your BLOCK DATAs are in a file with executable code -- say your main program. If you have multiple BLOCK DATAs, give them each distinct names which are also distinct from the names of any subroutines, functions, and common blocks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>At using place, using "external bdhaha"
sorry, but I think this doesn't replace theredefinition of the common defined in gi.fh. (common /com1/ luhah)
With this your sample runs at me.
Hans
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks emc!
David

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