While I would not claim to be the greatest expert in these matters, I have had cause to use the ONLY argument 'in anger' when porting from f77 to f90/95.
Firstly, the concept of directionality in USING a module is basically incorrect. Essentially, the storage for the contents USE'd in other program sections is COMMON'ed. So, just as the standard argument pass in Fortran (in contrast to C) is by reference (not value); when you act on a variable in the module where you have used, you change the variable in both.
Secondly, I would *postulate* (without setting up to test - which you might do) that unless there *was indeed* an ONLY in both Modules B_1 and B_2 of your hypothetical example, *and* the contents of those two were mutually exclusive; the dual usage in Module C would be give errors on compilation.
Gary H
-----Original Message-----
From: Colin Millar [mailto:[log in to unmask]]
Sent: Monday, 21 July 2003 11:52 PM
To: [log in to unmask]
Subject: Re: Modules USEing modules (thread 2)
three modules are monodirectionally (i'm not sure if this is a word)
associated by USE statements i.e.
MODULE A
...
contains
SUBROUTINE mod_a_1 ( )
..
END SUBROUTINE mod_a_1
...
END MODULE A
MODULE B_1
use A
...
END MODULE B_1
MODULE B_2
use A
...
END MODULE B_2
MODULE C
use B_1
use B_2
...
END MODULE C
what are the implications if B_1 and B_2 use subsets of A via the ONLY
keyword.
??
Thanks in advance,
Colin.
************************************************************************
The information in this e-mail together with any attachments is
intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material.
Any form of review, disclosure, modification, distribution
and/or publication of this e-mail message is prohibited.
If you have received this message in error, you are asked to
inform the sender as quickly as possible and delete this message
and any copies of this message from your computer and/or your
computer system network.
************************************************************************
|