informational question: compile time of large DATA arrays
Daniel Franke
franke.daniel@gmail.com
Mon Sep 11 15:56:00 GMT 2006
2006/9/11, Richard E Maine <Richard.Maine@nasa.gov>:
> On Sep 7, 2006, at 3:05 AM, Daniel Franke wrote:
>
> > MODULE foo
> > REAL :: grid(0: 50 , 0: 10000 )
> > DATA grid( 0 , 0 ) / 1.000000 /
> > DATA grid( 0 , 1 ) / 0.9999750 /
> > DATA grid( 0 , 2 ) / 0.9999000 /
> > [ ... ]
> > CONTAINS
> > [a simple function working on the grid]
> > END MODULE
> I can't comment on gfortran specifically, but be aware that code like
> this causes problems with many compilers.
Richard,
the only one I could give a try was ifort - I had to abort the
compilation after six hours , gfortran finished in four and a half
hours ...
> I've been known to do workarounds such as initializing a small array
> with the non-zero values and then copy that small array to the right
> places in the big one with executable code that is executed only on
> the first call. Yes, it adds a little complication (though not much),
> but it makes the code run well on pretty much any compiler.
Here, I tried to fill the grid completely with precomputed values, the
(generated) source file had 500.000+ lines. I am all ears (or eyes) if
you or someone else could suggest a better way to initialize such an
array?!
Regards
Daniel
More information about the Fortran
mailing list