impact-lbl/IMPACT-Z

array out of bounds error(-s)

Eothred opened this issue · 1 comments

I compiled impact-z with gfortran, using -fcheck=bounds (see #2 ), and running the examples I get array out of bounds errors.

The first one is:

At line 311 of file /.../impact-z/src/Contrl/Input.f90
Fortran runtime error: Index '0' of dimension 1 of array 'obtype' below lower bound of 1

Fixing this one (adding a goto when i==0), I find in example2:

At line 108 of file /.../impact-z/src/Appl/SolRF.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'blparams' (12/15)

In example3 it runs almost to end, then I get:

At line 104 of file /.../impact-z/src/Appl/CCL.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'blparams' (12/11)

In sum, it seems there could be a few of these, so I propose maybe someone who knows the code better could add bounds check to their compiler flags and see if it could be improved?

modified the beam element files to ensure that the array bound is matched.