I really appreciate this exchange because I've been struggling to get a large fortran program compiled and running using homebrew versions of openmpi, gfortran and fftw3 (also HDF5).
ADR