|
| 1 | +# Copyright (C) 2002 Regents of the University of Michigan, |
| 2 | +# portions used with permission |
| 3 | +# For more information, see http://csem.engin.umich.edu/tools/swmf |
| 4 | + |
| 5 | +SHELL=/bin/sh |
| 6 | + |
| 7 | +# Fortran language related part of Makefile.conf: Makefile.Linux.gfortran |
| 8 | +# |
| 9 | +# Space Weather Modeling Framework (SWMF) |
| 10 | +# GNU gfortran (gfortran) Fortran 90/95 Compiler |
| 11 | +# |
| 12 | + |
| 13 | +COMPILE.f77 = ${CUSTOMPATH_F}gfortran |
| 14 | +COMPILE.f90 = ${CUSTOMPATH_F}gfortran |
| 15 | +LINK.f90 = ${CUSTOMPATH_MPI}mpif90 |
| 16 | +AR = ar -rs |
| 17 | + |
| 18 | +SINGLEPREC = -frecord-marker=4 |
| 19 | +DOUBLEPREC = -frecord-marker=4 -fdefault-real-8 -fdefault-double-8 |
| 20 | +PRECISION = ${DOUBLEPREC} ${MEM} |
| 21 | + |
| 22 | +MPILIB = |
| 23 | +#MPILIB = -L${LIBDIR} -lNOMPI |
| 24 | + |
| 25 | +# Define where modules are stored and add it to the search path |
| 26 | +# INCL_EXTRA can be defined to add more search directories. |
| 27 | +SEARCH = -J${INCLDIR} ${INCL_EXTRA} |
| 28 | + |
| 29 | +DEBUGFLAG = -C -g -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=all |
| 30 | +DEBUG = |
| 31 | + |
| 32 | +OPT0 = -O0 |
| 33 | +OPT1 = -O1 |
| 34 | +OPT2 = -O2 |
| 35 | +OPT3 = -O3 |
| 36 | +OPT4 = -O4 |
| 37 | + |
| 38 | +CFLAG = ${SEARCH} -c -w ${DEBUG} -fallow-argument-mismatch |
| 39 | + |
| 40 | +Cflag0 = ${CFLAG} ${PRECISION} ${OPT0} |
| 41 | +Cflag1 = ${CFLAG} ${PRECISION} ${OPT1} |
| 42 | +Cflag2 = ${CFLAG} ${PRECISION} ${OPT2} |
| 43 | +Cflag3 = ${CFLAG} ${PRECISION} ${OPT3} |
| 44 | +Cflag4 = ${CFLAG} ${PRECISION} ${OPT4} |
| 45 | + |
| 46 | +# Some codes only compile with the "-save" and single precision. |
| 47 | +# To compile with double precision, add PRECISION flag |
| 48 | +CFLAGS = ${CFLAG} -fno-automatic |
| 49 | + |
| 50 | +# Link with or without the MPI library |
| 51 | +Lflag1 = ${PRECISION} ${MPILIB} ${DEBUG} |
| 52 | +Lflag2 = ${PRECISION} ${DEBUG} |
| 53 | + |
| 54 | +# BLAS and LAPACK libraries |
| 55 | +LBLAS = |
| 56 | +BLAS = lapack.o blas.o |
| 57 | + |
| 58 | + |
| 59 | +# |
| 60 | +# General rules |
| 61 | +# |
| 62 | + |
| 63 | +.SUFFIXES: |
| 64 | +.SUFFIXES: .f90 .F90 .f .for .ftn .o |
| 65 | + |
| 66 | +.f90.o: |
| 67 | + ${COMPILE.f90} ${Cflag3} $< |
| 68 | + |
| 69 | +.F90.o: |
| 70 | + ${COMPILE.f90} -DsysLinux -DcompGFORTRAN ${Cflag3} $< |
| 71 | + |
| 72 | +.f.o: |
| 73 | + ${COMPILE.f77} ${Cflag3} -ffixed-line-length-132 $< |
| 74 | + |
| 75 | +.for.o: |
| 76 | + ${COMPILE.f77} ${Cflag3} -ffixed-line-length-132 $< |
| 77 | + |
| 78 | +.ftn.o: |
| 79 | + ${COMPILE.f77} ${Cflag3} -ffixed-line-length-132 $< |
| 80 | + |
| 81 | +clean: |
| 82 | + rm -f *~ core *.o *.mod fort.* a.out *.exe *.a *.so *.protex |
| 83 | + |
| 84 | + |
| 85 | +# keep this line |
0 commit comments