I recently started working on Mac OS and discovered that you cannot simply ulimit -S unlimited to pretend the stack is system RAM sized.
This forced me to make a bunch of routines with large internal working arrays changed over to allocatable. Of course I hate allocating memory, so I wrote a simple arena allocator to handle real variables: GitHub - dacarnazzola/farena: simple Fortran arena allocator for real arrays · GitHub
It is set up to provide contiguous space for real(kind=c_double) variables, but that can be reconfigured at the top by pointing wp at something else. It supports arrays from rank 1-15, and will take either 32-bit or 64-bit integer dimensions for 1D requests. For any dimension higher than 1, I only wrote interfaces for 32-bit inputs.