# Configuration for the fortran gfortran-mp-6 compiler (Mac OS X 10.12): # Compiler names: F90 = gfortran-mp-6 # Setting the path for the netcdf libraries: NETCDF_PATH = /opt/local # Compiler flags: COMPILER_FLAGS_BASIC = -O3 -J${MOD_PATH} -Wall -ffree-line-length-none COMPILER_FLAGS_CHECK = -fbounds-check -fcheck-array-temporaries COMPILER_FLAGS_NETCDF = -I${NETCDF_PATH}/include COMPILER_FLAGS_PROFILE = -p COMPILER_FLAGS_VALGRIND = -g # Compiler flag combination choices: F90FLAGS_CHOICE_1 = ${COMPILER_FLAGS_BASIC} ${COMPILER_FLAGS_CHECK} ${COMPILER_FLAGS_NETCDF} F90FLAGS_CHOICE_2 = ${COMPILER_FLAGS_BASIC} ${COMPILER_FLAGS_CHECK} ${COMPILER_FLAGS_NETCDF} ${COMPILER_FLAGS_PROFILE} F90FLAGS_CHOICE_3 = ${COMPILER_FLAGS_BASIC} ${COMPILER_FLAGS_CHECK} ${COMPILER_FLAGS_NETCDF} ${COMPILER_FLAGS_VALGRIND} # Compiling options concern including the profiling or the valgrind debugging mode: F90FLAGS = ${F90FLAGS_CHOICE_2} # Linking flags of libaries: LINK_FLAGS_NETCDF = -L${NETCDF_PATH}/lib -lnetcdf -lnetcdff LDFLAGS = ${LINK_FLAGS_NETCDF} # Compiler flags Specification # # -O3 is the optimalisation flag (causing faster executables) # -J${MOD_PATH} is the path of the directory with all the *.mod files # -Wall is the optimalisation flag # -ffree-line-length-none is the -ffree-line-length-n, sets n columns after which characters are ignored # -ffree-line-length-none = -ffree-line-length-0 # -fbounds-check is the flag for checking array boundaries # -fcheck-array-temporaries is the flag for checking array substitution # -I${NETCDF_PATH}/include is the path to the netcdf include files # -p is the flag for profiling with gmon (sometimes better to turn off if using valgrind) # -g is the flag which should be turned on if the valgrind debugger is used # # Linking flags of libaries: # -L${NETCDF_PATH}/lib is the netcdf libary path # -lnetcdf is the netcdf c libary # -lnetcdff is the netcdf fortran libary # Other gfortran compiler flags (for better checks with compilation): # -Wuninitialized -O -ftrapv -fno-automatic -fimplicit-none # Linking the fortran compiler with -g -w for debugging with valgrind but omit profiling while using valgrind: # valgrind --log-file=log-valgrind-gcm_to_im.bug --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes --track-origins=yes ./src/oblimap_gcm_to_im_program config-files/oblimap/ccsm-to-im/config_oblimap_ccsm_to_im_greenland # valgrind --log-file=log-valgrind-im_to_gcm.bug --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes --track-origins=yes ./src/oblimap_im_to_gcm_program config-files/oblimap/im-to-ccsm/config_oblimap_im_to_ccsm_greenland