Re: CVF compiler question, program giving inconsistent results



Thank you for the incredibly quick reply, Brooks.

Run time error checking for "Array and string bounds" is turned on.

There is no Monte Carlo stuff in this code. Although there is a
routine in a support library (not mine) that generates a "random"
starting vector for some iterative calculations. An earlier version of
this program compiled with Powerstation 4.0 does return identical
results on repeated calls.

I've done some more digging, and I think it might be that random vector
generator. In the generator routine a hardcoded seed is used only when
a logical "INITS" variable is TRUE. This is a local variable - not an
argument passed in. Right after the LOGICAL INITS declaration there is
SAVE INITS line.

At this point I'm fairly confident this explains what is happening.
I'm going to have to be very careful, however, about changing this
because it is buried deep in a support library, but there are some
reasons why I need to change this.

So I guess the mystery here is why did Powerstation evidently run this
code differently. I may or may not dig into it to verify that is the
precise reason for the difference.

Cheers,

Brian


Brooks Moses wrote:
bmurphy@xxxxxxxxxxx wrote:
I am using Compaq Visual Fortran 6.0. (CVF).

I have a routine that returns slightly different numerical results when
I call it repeatedly with indentical inputs.

Is it doing a Monte Carlo routine or something that involves random
numbers? (I assume not, but it's the "is it plugged in?" question....)

If not, this is definitely something going wrong.

Are there any compiler switches that might have something to do with
this?

I have the compiler set to generate warnings for the use of
unintialized variables, and I don't get any such warnings.

In general (though I don't know about CVF6 in particular), these don't
always catch everything. Arrays are particularly tricky, because it
could be that you've initialized most of the array but missed one or two
spaces.

Another check that you should definitely enable is the check for
out-of-range array accesses.

- Brooks


--
The "bmoses-nospam" address is valid; no unmunging needed.

.



Relevant Pages

  • Speed versus memory
    ... My initial impulse was to use vector processes everywhere. ... an absurd amount of memory. ... Such a routine only has two input arrays ... and one output array but goes through ten intermediate arrays all of ...
    (comp.lang.fortran)
  • Re: Routine Interfering with Clipboard
    ... Otherwise use the temporary array, eg open one wb, assign the values ... file in created Inst2 that from its Open event starts a new routine called ... The macro therefore takes 25mins to run. ... instance of Excel and then open a second hidden instance to do all the ...
    (microsoft.public.excel.programming)
  • Re: Passing an array to a sub routine
    ... FileHandle, Array, Hash, Method, Regex}? ... The LoadDataFile routine works correctly, but the SaveDataFile ... > sub LoadDataFile ...
    (comp.lang.perl.misc)
  • Re: A question about OOP in Fortran?
    ... routine that will work with any class. ... So you can declare a hash table with any base type. ... If you want a heterogenous collection (array, string, list, ...
    (comp.lang.fortran)
  • Data analysis from Monte Carlo Simulations using Ocean
    ... I have been doing some data analysis using the ocean Monte Carlo ... At the end of my simulations I would like to make a nice ... myexpressions = monteGetExprs;This would be similar to ... but would output a list or an array instead of text ...
    (comp.cad.cadence)

Loading