Re: Common block file
- From: Catherine Rees Lay <catherine.news@xxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 10:20:44 +0000
Shawn wrote:
At least if it is one file you know that the variables have the same
name in all routines using that file. Are the declaration statements
for those variables also in the include file?
-- glen
The include file is basically a large globals variable declaration
list. The bulk of the files are auto declared using the i-n option
with character vars being explicitly declared. The actual program
uses this list with very little variable passing otherwise. Or did I
miss the question?
Shawn
In that case you are going to have to keep the common statement inside the module - because it's the only declaration of the variables. That doesn't hurt, but it will make it a bit more awkward to make some other modernisations/improvements (such as making some of the arrays allocatable, allowing greater flexibility in the size of problem you can consider) - you can't do that with an array in common, but you can with an array in a module. Now of course you can remove the arrays from the COMMON statements (they must already be declared elsewhere to dimension them) but if the common blocks also contain scalar variables, you'll have to do it on an individual basis. If your code contains any use of EQUIVALENCE, you'll need to be very wary at this point, and run a bunch of before-and-after test cases to check for any storage association which this has screwed up.
Otherwise what I would suggest as a next step would be simply to remove the COMMON line(s), leaving the module containing just variable declarations.
--
Catherine Rees Lay
Polyhedron Software Ltd. Registered Office: Linden House,
93 High St, Standlake, Witney, OX29 7RH, United Kingdom.
Registered in England No.2541693. Vat Reg No. GB 537 3214 57
.
- References:
- Common block file
- From: Shawn
- Re: Common block file
- From: glen herrmannsfeldt
- Re: Common block file
- From: Shawn
- Common block file
- Prev by Date: Re: passing a pointer to a function using iso_c_binding
- Next by Date: Fortran 2008 draft: EXECUTE_COMMAND_LINE
- Previous by thread: Re: Common block file
- Next by thread: Assistance Reading Binary Data
- Index(es):
Relevant Pages
|