I'm getting the same error message executing a FORTRAN program compiled with gfortran-mp-devel installed with MacPorts, and definitely that program has a large static array. It happens on any AppleSilicon Mac I had a chance to try (Mac mini M1 with 16 GB of RAM, MacBookPro with M1 Max and 64 GB RAM, all with Monterey OS.).
But that program compiles and executes properly on any Intel Mac with any gfortran version I tried, and does so on Linux hardware as well. I could even use it on a Linux Virtual Machine with just 8 GB of RAM assigned, compiling it with option -mcmodel=large.
Unfortunately, trying -mcmodel=large on a M1 Mac (but also on Intel Mac) doesn't produce an executable. Just a ton of error messages at compile (or link?) time like this
/var/folders/72/b_3786ns6ld1z4n6k6cfsx7w0000gn/T//ccTHZMDC.s:11:15: error: invalid variant 'BLEAH'
adrp x0, lC0@BLEAH
where BLEAH is pointed as the error. But there's nothing named BLEAH in my program. Any suggestion on how to solve this issue?
Thanks!