Re: double confusion



On Mon, 17 Jul 2006 11:38:52 -0700, glen herrmannsfeldt wrote
(in article <9IydnUs_ic-CRCbZnZ2dnUVZ_sqdnZ2d@xxxxxxxxxxx>):

Gordon Sande wrote:

You could try to use an "IMPLICIT NONE" and see what happens.

Doesn't IMPLICIT have the same scoping problem as other declarations?

For implicit other than NONE, yes, but implicit none is different. Yes,
it has the same scope as any other implicit, but the way you use it is
different, which matters.

It is good for debugging, and it most definitely will help debug this
particular problem. Try it and see. If you use implicit none in the
main program, it will bitch about the type of the function being
undeclared. It is true that if you put implicit none in the function,
that won't automatically propagate to the main program, but that's not
how one uses implicit none.

In particular, if you mistakenly think, as the OP apparently did, that
declaring the type in the function will be sufficient, then implicit
none will catch that error. Will and has.

--
Richard Maine | Good judgment comes from
experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain

.



Relevant Pages

  • Re: Statement function host association
    ... > variable "shared" by host association, ... > get its implicit typing from (since the implicit typing rules can be ... there are no choices at all - there is only *one* possible scope to ... No other things described as "scoping units" ...
    (comp.lang.fortran)
  • Re: double confusion
    ... Doesn't IMPLICIT have the same scoping problem as other declarations? ... on file scope to apply to Fortran separate compilations. ... Fortran has no notion of file scope so the beginning is actually the ...
    (comp.lang.fortran)
  • Re: Statement function host association
    ... The wording in question appears in the section on how implicit typing ... If the same entity name appears in both the host scope and any contained ... the language in the standard that triggered this discussion ...
    (comp.lang.fortran)
  • Re: Scope of array initialization do loops
    ... > Rich Townsend wrote: ... >> Does the implied do loop have its own scope? ... reason NOT to use IMPLICIT NONE; I've seen just too many errors arising ... the first line of *every* subprogram I write, and in the codes of others. ...
    (comp.lang.fortran)
  • Re: double confusion
    ... If there had been an IMPLICIT NONE in the main there would have been ... of the main program as somehow the assumption was that declarations ... Sometimes it helps to point out that separate compilation can be ... As we know, Fortran doesn't do that. ...
    (comp.lang.fortran)