UPDATE: I had Gemini copy formatting from my dp implementation and added support for integer(kind=c_int32_t) (i32), integer(kind=c_int64_t) (i64), and real(kind=c_float) (sp). To support this, init64 accepting 64-bit integer array sizes had to be separately named. Otherwise the all-optional-arguments signatures are ambiguous between i32 and i64 versions.
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.