I run ROMS on Sierra with Macports. One thing I learned is that you need to use the same compiler for everything. So for a gfortran build, the command to install all dependencies using gcc5 would be something like:
Code: Select all
sudo port install hdf5 +fortran +gcc5 +hl +szip +cxx netcdf +gcc5 +netcdf4 netcdf-fortran +gcc5 +dap
I also have to make sure the correct gfortran is selected in my case, so I do:
Code: Select all
sudo ln -s /opt/local/bin/gfortran-mp-5 /opt/local/bin/gfortran
I'm not sure if this is the best way, but it works. Then make sure you have your build.bash and Darwin-gfortran.mk set correctly as Kate mentioned above. Hope this helps.
EDIT: Sorry missed that you were using ifort. If you prefer to use ifort instead of gfortran, then I think you might need to compile netcdf, etc. with ifort. There is no ifort variant for netcdf in Macports, so you may need to compile from source. Otherwise, just use gfortran. Macports also has mpich and openmpi variants for netcdf.