Segmentation fault on macOS Big Sur due to CIA_read subroutine
After having updated to macOS Big Sur and having recompiled
petitRADTRANS (without any error), I ran into a segfault which occurs with the
CIA_read subroutine in
fort_input.f90. After some tests, it seems that the error appears when the first and second do loop reach the end of the
_final.dat files, respectively.
I could circumvent the issue by adding
if (i.eq.31) exit and
if (i.eq.5001) exit to the first and second loop, respectively, such that each loop is exited when the end of the file has been reached. This works fine because I am only using CIA of H2-H2 and H2-He (which have an equal amount of lines in the associated files) but this fix may not work for other molecules.