# generic gfortran compiler options for OSX installed with macport, http://www.macports.org/
#
#   Prerequisite softwares installed with MacPorts :
#     sudo port install gcc9
#     sudo port install gcc_select
#     sudo port select --set gcc mp-gcc9
#     sudo port install mpich-gcc9
#     sudo port install mpi_select
#     sudo port select --set mpi mpich-gcc9-fortran
#     sudo port install hdf5 +gcc9 +mpich +szip
#     sudo port install netcdf +gcc9 +mpich
#     sudo port install netcdf-fortran +gcc9 +mpich
#     sudo port install p5.30-uri
#
#     $ port select --show mpi
#     The currently selected version for 'mpi' is 'mpich-gcc9-fortran'.
#     $ port select --show gcc
#     The currently selected version for 'gcc' is 'mp-gcc9'.
#
# Note that:
#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
#  - fcm variables are starting with a % (and not a $)
#
%NCDF_HOME           /opt/local
%HDF5_HOME           /opt/local
%XIOS_HOME           /Users/$( whoami )/xios-2.5
%OASIS_HOME          /not/defined

%NCDF_INC            -I%NCDF_HOME/include -I%HDF5_HOME/include
%NCDF_LIB            -L%NCDF_HOME/lib -lnetcdff -lnetcdf
%XIOS_INC            -I%XIOS_HOME/inc 
%XIOS_LIB            -L%XIOS_HOME/lib -lxios -lstdc++ 
%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip

%CPP	             cpp -Dkey_nosignedzero 
%FC	             mpif90 
%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer -ffree-line-length-none
%FFLAGS              %FCFLAGS
%LD                  %FC
%LDFLAGS             
%FPPFLAGS            -P -traditional
%AR                  ar
%ARFLAGS             rs
%MK                  make
%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB

%CC                  cc
%CFLAGS              -O0
