Hi,
I was running into the same problems with gfortran in Ventura. Then I found a simple recommendation, that doesn't require installing anything, to change using gfortran from "Apple clang version 15.0.0) to using gfortran (GNU Fortran (GCC) 10.2.0). The PDF can be found at https://yiqingxu.org/public/BigSurError.pdf
If "%> which gfortran" returns "/usr/local/bin/gfortran" then change your PATH to include /usr/local/gfortran/bin
%> export PATH="/usr/local/gfortran/bin:$PATH"
This will avoid using clang version, that doesn't run well for Big Sur and newer OS versions.
According to the recommendations in the site you might need also to include in the call of gfortran
-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib
(be careful here because it may be darwin20 instead of darwin19 in your system).
I was still running into the same trouble when I read the "ld" help and decided to use also the -ld_classic option.
This solved my problems. I included other options that eliminated a lot of warnings, the critical one was -ld_classic.
%> gfortran -ld_classic -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/gfortran/lib -ffixed-line-length-none -fdefault-real-8 -std=legacy -fd-lines-as-comments program_name.f -o program_name
I hope it helps you guys too.
Best wishes, w.