Re: problematic array assignment in double precision (ifort, windows)
- From: mvukovic@xxxxxxxxxxxx
- Date: 31 Aug 2006 12:20:26 -0700
Richard E Maine wrote:
<mvukovic@xxxxxxxxxxxx> wrote:
In the first version of my program, I was calling the function
rn_points_on_sphere() as an argument of another subroutine.
Caution on confusing terminology here. The function is not actually the
argument. Your actual argument is the result of evaluating the function.
Those things might sound similar, but they are majorly different. You
briefly had me thinking that I had a suggestion to help, because passing
the function as an actual argument would require an interface body for
the corresponding dummy... but that turns out not to be what you are
doing.
Now this procedure (new_particle) is in a module whose header is:[elided]
This header *does not* have an interface declaration for the subroutine
new_particle. So, the compiler could not know about the argument type.
NO! NO! NO! This is related to the mistake I was mentioning to Steve. If
the procedure is in this module, then you do *NOT* also put an interface
body in the header part of the module. Doing so will be
counter-productive (and should cause compilation to fail). If the
procedure is in the module, then the compiler does have the information
- from the procedure itself. I still haven't figured out where your
problem lies, but this is the wrong direction to look.
... unless, perhaps, there is another terminology confusion here and you
mean that the function is referenced in the module instead of being in
the module. Adding that one word "referenced" would make it a completely
different matter - so different that I'd pretty much need to go back to
the beginning, pretend I forgot everything said so far, and start over.
At that point, I got an out-of-bounds warning. In the loop where iPart
was supposed to go from 1 to 3, it actually got a value of 4, and
outside the range of self%vParticles. Something was getting corrupted
somewhere.
At that point I started putting in diagnostic statements, and noticed
that the outputs of the rn_points_on_sphere did not make sense. That
is when I posted my original email.
I wonder if you might have cause and effect reversed. Posssibly the
corruption (from unknown source) was messing up rn_points_on_sphere.
trying to make it explicit that I was dealing with a 3-element vector.
Not needed. The explicit interface (from the USE statement) has that
information. If it was needed, this would not achieve the effect anyway.
To declare something about the function, you actualy have to declare it
about the function - not about some other thing that hapens to be used
in the same vicinity. Note that
a_three_element_array = a_scalar
is perfectly fine Fortran; thus declaring the thing on the left-hand
side of the assignment to be an array doesn't even add an implication
that the thing on the right-hand side is.
The problem still remained, until I stumbled upon the last version of
my program, where instead of vSomeOtherVariableName I use vV.
Well, I guess I don't have to understand, but I have at least some
concern that if you didn't really understand the problem, you might not
have really fixed it. I'm still seeing a lot of stuff above that goes in
wrong directions and I'm not understanding what you think the actual
problem was (just changing a variable name? though maybe that avoided a
name conflict or misdeclaration or something?)
--
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
Thanks Richard.
I think I am accumulating experience here (new code, not really
familiar with the language, complex code design, all symptoms of
boundless optimism).
If what you say is true, and I don't have reason to doubt it, then I
too am puzzled as to the code failure. What I plan to do is a bit of a
re-write and simplification, and then I'll see where that takes me.
I'll keep you guys posted on any new insights.
I could post the whole thing on-line, but I think it would take a long
time for you guys to un-tangle.
Mirko
.
- References:
- problematic array assignment in double precision (ifort, windows)
- From: mvukovic
- Re: problematic array assignment in double precision (ifort, windows)
- From: mvukovic
- Re: problematic array assignment in double precision (ifort, windows)
- From: mvukovic
- Re: problematic array assignment in double precision (ifort, windows)
- From: Steve Lionel
- Re: problematic array assignment in double precision (ifort, windows)
- From: mvukovic
- Re: problematic array assignment in double precision (ifort, windows)
- From: Richard E Maine
- problematic array assignment in double precision (ifort, windows)
- Prev by Date: Re: problematic array assignment in double precision (ifort, windows)
- Next by Date: Fortran code styles
- Previous by thread: Re: problematic array assignment in double precision (ifort, windows)
- Next by thread: best way to use the USE statement
- Index(es):
Relevant Pages
|