[Mesa-users] length of cell

Francis Timmes fxt44 at mac.com
Sun Jul 5 03:47:03 EDT 2020


assuming you are doing a sum as an approximation to an integral,
your do loop is still not correct; you want something like

integral= 0.0
do loop over i
 integral = integral + expression for cell i
end do
integral = integral + expression for special case(s)

fxt






> On Jul 4, 2020, at 11:24 PM, Ebrahim Hassani <ee.haji at gmail.com> wrote:
> 
> Dear Mesa-users
> 
> Thank you for your responses to my question.
> 
> I guessed there might be a parameter in the 'star_data.inc' file that represents the length of each cell. But as you mentioned there is not.
> To solve my problem I followed Dr. Marchant's advice and calculated the length of the last cell outside the do loop as follow:
> 
>       part3_h1 = 0
>       do i = s% nz, 2, -1
>       part3_h1 = (s% r(i)) * ( (s% r(i-1)) - (s% r(i)) )
>       end do
>       part3_h1 = part3_h1 + (s% r(1)) * ((s% r(1)) - (s% r(2)))
> 
> In fact, I do the loop from i = s%nz until i = 2 (a cell before the last cell) and then calculated the length of the last cell after the do loop.
> 
> This time the star evolved without any error.
> 
> Thank you again for your time and assistance.
> 
> Sincerely yours,
> Ebrahim
> 



More information about the Mesa-users mailing list