Thank you very much for your suggestion and reply @wiremoons ! Awesome!
I do not have M1 at hand, but I remember when I use
-O0 -fcheck=all -fbacktrace
the M1 did give segment 11 error. However there is no traceback information.
I suspect there may be some array out of bounds or something. Yeah, I tried using gfortran on Ubuntu with you flag without
-pedantic, because I use the ODEPACK which needs -std=legacy, and with
-pedantic it seems will turn some warnings in ODEPACK to error and then I cannot finish the compile. So anyway, I use
gfortran -fcheck=all -Og -g -fbacktrace -Wall -Wextra
It runs and I did not see error or warning.
I also tried some additional flags on my Ubuntu machine,
-Warray-temporaries -ffree-line-length-0 -ffpe-trap=invalid,zero,overflow,underflow, -finit-real=nan
It did catch some some underflow issue, I have some
tiny(1.0)**2 operations stuff which is unnecessary I think, should just use 0.0 instead of ```tiny(1.0)’’’, I may begin with these places, to see if there are underflow, overflow, nan etc.
Since I use some other people’s Fortran ODE solver, besides ODEPACK, also use Hairer’s and FLINT.
Then I will try to turn off these ODE solvers on M1 and do further check to locate where the problem may be.