View previous topic :: View next topic |
Author |
Message |
stfark1
Joined: 02 Sep 2008 Posts: 210
|
Posted: Sat Nov 08, 2008 7:23 pm Post subject: Common |
|
|
I have a large program consisting of several Fortran subroutines. One of the routines calls an entry point into another subroutine. I noticed that even though I have a number of variables declared as "common" in both routines, when I enter into the called entry point, the "common" variables do not have the values that I entered with. Do I also need to place the "common" block after the entry point to share the same values for all of the variable declared at the top of both subroutines? Please let em know, Sid Kraft. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sun Nov 09, 2008 5:39 pm Post subject: |
|
|
Hi Sid,
By any chance are the variables declared to be of different size (e.g. real*4 in one routine and real*8 in another)? Check that the common block(s) list variables of the same type and length - this can go wrong in old code when you use implicit type in one and explicit type in another, etc.
The common blocks must go before any executable statements, which pretty much rules out comining after an ENTRY.
Eddie |
|
Back to top |
|
|
|