[Mesa-users] Variable array sizes in s%

Mathijs Vanrespaille mathijs.vanrespaille at kuleuven.be
Mon Sep 7 19:51:17 UTC 2026


Dear MESA users and devs,

I have a question about the array sizes in MESA version 26.4.1. I noticed that the size of the arrays in s%, e.g. s% m changes between extras_start_step and extras_check_model even though the number of zones in s% nz remains unchanged in a rotating model based on the conserve_angular_momentum test case. Specifically, the sizes of the s% arrays alternate between increase by +2 in one step and decreasing by -2 again in the next step. Attached is a basic work directory that prints s% nz and size(s% m) at different stages of each time step to demonstrate this behaviour.
I thought the size of these arrays was meant to be mostly constant to avoid paying the computational cost of de-allocating and re-allocating them, hence why they are also initialised to be larger than s% nz. Is this variable size of the arrays in s% expected and/or desirable? If so, what is its purpose? If not, does anyone have any guesses what may cause it? I took a look in $MESA_DIR/star/private/alloc.f90 and $MESA_DIR/star/private/adjust_mesh.f90, but I didn't spot any obvious clues.

Kind regards,
Mathijs Vanrespaille
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20260907/e11b42f7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: work_dir_test_array_sizes.zip
Type: application/zip
Size: 177858 bytes
Desc: work_dir_test_array_sizes.zip
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20260907/e11b42f7/attachment.zip>


More information about the Mesa-users mailing list