Re: undefined variable problem
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 20:22:31 GMT
On 2007-03-30 16:53:48 -0300, Bart Vandewoestyne <MyFirstName.MyLastName@xxxxxxxxxx> said:
On 2007-03-30, John Appleyard <spamtrap@xxxxxxxxxxxxxx> wrote:
Check out Catherine's reply again. I think you may have misunderstood
what the compiler means by "undefined". It doesn't mean "not allocated"
or "not declared" or "not associated". It means "used before set" -
i.e. no value has been assigned to a since it was created (by allocation
or whatever). It is an error to use the value of a variable if it has
never been given a value, and that is what the compiler is complaining
about.
Hmm... now that I think of it... i've fixed a problem that made
the error go away... maybe it is what you are mentioning here...
The situation I have basically boils down to the following: I
allocated a rank 2 array (representing a matrix), and i only
assigned values to the *lower triangular part*. My application
required the *upper triangular part without the diagonal* to be
zero... but i forgot to
explicitly set that part to zero... so after allocation and setting
the lower triangular part, I couldn't be sure that the values in the
upper triangular part were zero...
Could it be that the NAGWare f95 compiler was smart enough to
detect that the *upper triangular part* of the rank2 array
(matrix) that I was using was not initialised and therefore
reported the error?
Best wishes,
Bart
For NAGWare as of version 5
f95 -free -gline -O0 -time -v -o PLU_Main.exe PLU_Main.f90
will get you an unchecked run with no optimization
f95 -C=all -free -gline -O0 -time -v -o PLU_Main.exe PLU_Main.f90
will get subscript checking and a lot more of that ilk
f95 -C=undefined -free -gline -O0 -time -v -o PLU_Main.exe PLU_Main.f90
will get undefined checking without subscript checking
f95 -C=all -C=undefined -free -gline -O0 -time -v -o PLU_Main.exe PLU_Main.f90
will get the whole works all at once.
On my desktop G5 PowerMac NAGWare runs through the GCC backend. GCC is a memory
hog on good days and subscript checking makes it worse, undefined checking drives
it totally bananas and together I just go get a coffee! With inadequate memory it
just pages to a slow death. When I have made snide remarks to the NAG support
folks, who are very responsive in my experience, I seemed to have learned that
it much the same on other systems. (But 35 seconds for 30000 lines - 23000
if comments are not counted - says that expectations have gotten rather high!)
It sounds like you have the "-C=undefined" selected (or maybe someone has it
selected for you).
When V5 came out with undefined variable checking I switched to NAGWare
instantly as I have long since learned that good debugging tools go a long
way to helping find cut and paste type errors, which I am an expert at
making. ;-(
There are other vendors with undefined checking but not for MacOsX.
.
- References:
- undefined variable problem
- From: Bart Vandewoestyne
- Re: undefined variable problem
- From: Bart Vandewoestyne
- Re: undefined variable problem
- From: John Appleyard
- Re: undefined variable problem
- From: Bart Vandewoestyne
- undefined variable problem
- Prev by Date: Re: undefined variable problem
- Next by Date: Re: Sample polling program code?
- Previous by thread: Re: undefined variable problem
- Next by thread: Re: undefined variable problem
- Index(es):