[Mesa-users] length of cell
Francis Timmes
fxt44 at mac.com
Sat Jul 4 04:42:21 EDT 2020
the arrays run from i=1 to i=nz.
trying to access an array at i=0 or i=nz+1 would produce an out of bounds error.
examine your part3_h1 expression when i=1 and i=nz ;
do they access array positions that are invalid?
fxt
> On Jul 3, 2020, at 11:16 PM, Ebrahim Hassani via Mesa-users <mesa-users at lists.mesastar.org> wrote:
>
> Dear Mesa-user
>
> I need to calculate the length of each cell and then multiply the result to the radius of the star at the position of each cell. The piece of code that I used in 'run_star_extras.f' file is :
>
> part3_h1 = 0
> do i = s% nz, 1, -1
> part3_h1 = (s% r(i)) * ( (s% r(i)) - (s% r(i+1)) )
> end do
>
> but it gives the below error:
>
> Fortran runtime error: Index '875' of dimension 1 of array 's%r' above upper bound of 874
>
> Is there any other way to calculate the length of each cell?
> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users
>
More information about the Mesa-users
mailing list