Re: type/rank mismatch error
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Fri, 29 Jun 2007 01:01:24 -0700
Jugoslav Dujic <jdujic@xxxxxxxxx> wrote:
estevino@xxxxxxxxx wrote:....[module calulate, which defines some_op]
| MODULE various
| USE calculate
| CONTAINS
| SUBROUTINE number1(x,y,some_op)
| ...
| END SUBROUTINE number1
| SUBROUTINE number2(x,y,some_op)
| ...
| END SUBROUTINE number2
| END MODULE various
I must say I'm confused as to the intent of the code. The code, as shown,
violates the simple rule that
*Any formal (dummy) argument of a routine must be declared locally
in the routine, not elsewhere*
Um. I'm confused by that "rule". I think I know what you mean, but the
expression of it confuses me. You can, of course, define things of that
same name elsewhere all you want.That just doesn't constitute defining
the dummy argument.
in other words, if you defined some_op in the module "calculate", you
must not redefine some_op elsewhere (at least, not in a scope which
USEs the module "calculate")
True, but the code shown doesn't do that. It defines some_op in module
procedures that are *NOT* in the same scope as the USE statement. It
makes a huge difference. See host association. The use of those names as
dummy arguments blocks the host association of the name imported by the
USE.
I actually think I agree with some of your subsequent guesses about the
likely intent of the code. Anyway, they seem plausible. I'm just
quibbling about the above stuff.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: type/rank mismatch error
- From: Jugoslav Dujic
- Re: type/rank mismatch error
- References:
- type/rank mismatch error
- From: estevino
- Re: type/rank mismatch error
- From: Jugoslav Dujic
- type/rank mismatch error
- Prev by Date: Re: reading an external text file
- Next by Date: Re: Need Help: compiling old Fortran program
- Previous by thread: Re: type/rank mismatch error
- Next by thread: Re: type/rank mismatch error
- Index(es):