what is the reason for n o t allocating f and df in run.f90 dynamically,
whereas this is done in start.f90?
The dimensions are in both cases the same.
Cheers,
M. Rheinhardt
On Fri, Dec 17, 2010 at 14:13, Matthias Rheinhardt
<mrein...@nordita.org> wrote:
> what is the reason for n o t allocating f and df in run.f90 dynamically,
> whereas this is done in start.f90?
> The dimensions are in both cases the same.
We use dynamic allocation as little as possible, because only for
statically allocated arrays we get lots of compiler and runtime checks
(if we compile with the appropriate options).
In start.f90, we were forced to use dynamic allocation in order to
avoid out-of-memory problems. Pencilizing start.f90 would probably
have worked as well, but that would make many initial conditions
difficult to code.
W o l f ga n g
> We use dynamic allocation as little as possible, because only for
> statically allocated arrays we get lots of compiler and runtime checks
> (if we compile with the appropriate options).
With respect to run-time issues: I checked the according options of the
GNU compiler
and found the only relevant to be -fbounds-check. But this is working both
for
statically and dynamically allocated arrays. (checked both gfortran and
g95)
Which compilers do not behave so?
And what compile-time issues are of importance here?
Cheers,
Matthias
Experience tells that none of the checks works in all cases. So making
checking easier is a good thing.
> And what compile-time issues are of importance here?
For example, well, array bound checks. It is much better to find
array-out-of-bounds cases at compile time than at runtime.
With the Pencil Code, I have not seen a segmentation fault for years.
Until we started to use dynamic allocation in a few places.
W o l f g a n g