2008-11-04 13:08:01 -06:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# include configuration
|
|
|
|
#
|
|
|
|
ifeq ($(wildcard make.config),make.config)
|
|
|
|
$(info )
|
|
|
|
$(info Using customized "$(wildcard make.config)" file.)
|
|
|
|
$(info )
|
|
|
|
include make.config
|
|
|
|
else
|
|
|
|
$(info )
|
|
|
|
$(info Could not find the customized "make.config" file!)
|
|
|
|
$(info )
|
|
|
|
$(info Copy "make.default" to "make.config" and customize it, if you do not want the default configuration.)
|
|
|
|
$(info )
|
|
|
|
$(shell sleep 5)
|
|
|
|
include make.default
|
|
|
|
endif
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# host variables
|
|
|
|
#
|
|
|
|
HOST := $(shell hostname -f)
|
|
|
|
OS := $(shell uname)
|
|
|
|
DATE := $(shell date +%Y%m%d%H%M)
|
|
|
|
|
|
|
|
include hosts/default
|
|
|
|
ifeq ($(wildcard hosts/$(HOST)),hosts/$(HOST))
|
|
|
|
$(info Using compiler setup from "hosts/$(HOST)" file.)
|
|
|
|
$(info )
|
|
|
|
include hosts/$(HOST)
|
|
|
|
endif
|
|
|
|
|
2010-02-28 18:35:57 -03:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# check flag conditions
|
|
|
|
#
|
2010-12-03 16:29:28 -02:00
|
|
|
ifeq ($(EQS),HYDRO)
|
|
|
|
ifeq ($(FLUX),HLLD)
|
|
|
|
FLUX = HLLC
|
2011-04-24 09:59:45 -03:00
|
|
|
endif
|
2010-12-03 16:29:28 -02:00
|
|
|
ifeq ($(EOS),ISO)
|
|
|
|
FLUX = HLL
|
|
|
|
endif
|
|
|
|
endif
|
2010-02-28 18:35:57 -03:00
|
|
|
ifeq ($(EQS),MHD)
|
|
|
|
ifeq ($(FLUX),HLLC)
|
2010-12-03 16:29:28 -02:00
|
|
|
FLUX = HLLD
|
2010-02-28 18:35:57 -03:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2008-11-04 13:08:01 -06:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#
|
2008-12-08 15:31:35 -06:00
|
|
|
# pass additional flags to the compiler
|
2008-11-04 13:08:01 -06:00
|
|
|
#
|
2011-06-07 16:51:52 -03:00
|
|
|
# compiler
|
|
|
|
#
|
|
|
|
FFLAGS += -D${COMPILER}
|
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# number of dimensions
|
|
|
|
#
|
|
|
|
FFLAGS += -DNDIMS=${NDIMS}
|
2008-12-18 12:18:36 -06:00
|
|
|
ifeq ($(SHAPE),Y)
|
|
|
|
FFLAGS += -DSHAPE
|
|
|
|
endif
|
2011-03-10 01:08:00 -03:00
|
|
|
ifeq ($(REFINE),Y)
|
|
|
|
FFLAGS += -DREFINE
|
|
|
|
endif
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2010-12-06 16:58:00 -02:00
|
|
|
# check if reconstruction is TVD
|
|
|
|
#
|
|
|
|
ifeq ($(SPACE),MINMOD)
|
|
|
|
FFLAGS += -DTVD
|
|
|
|
endif
|
|
|
|
ifeq ($(SPACE),LF)
|
|
|
|
FFLAGS += -DTVD
|
|
|
|
endif
|
2010-12-07 10:08:30 -02:00
|
|
|
ifeq ($(SPACE),MP5)
|
|
|
|
FFLAGS += -DMP
|
|
|
|
endif
|
|
|
|
ifeq ($(SPACE),MP7)
|
|
|
|
FFLAGS += -DMP
|
|
|
|
endif
|
|
|
|
ifeq ($(SPACE),MP9)
|
|
|
|
FFLAGS += -DMP
|
|
|
|
endif
|
2010-12-06 16:58:00 -02:00
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# output data format
|
|
|
|
#
|
|
|
|
FFLAGS += -D${OUTPUT}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2010-10-11 01:39:15 -03:00
|
|
|
# compression
|
|
|
|
#
|
2011-03-26 13:31:52 -03:00
|
|
|
ifneq ($(COMPRESS),NONE)
|
|
|
|
FFLAGS += -DCOMPRESS -D${COMPRESS}
|
2010-10-11 01:39:15 -03:00
|
|
|
endif
|
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# precision
|
|
|
|
#
|
|
|
|
FFLAGS += -DPREC=${PREC}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# time integration method
|
|
|
|
#
|
|
|
|
FFLAGS += -D${TIME}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2010-12-05 00:24:56 -02:00
|
|
|
# spacial reconstruction method
|
|
|
|
#
|
|
|
|
FFLAGS += -D${SPACE}
|
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# set of equations
|
|
|
|
#
|
|
|
|
FFLAGS += -D${EQS}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# equation of state
|
|
|
|
#
|
|
|
|
FFLAGS += -D${EOS}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2011-04-30 11:45:48 -03:00
|
|
|
# fully conservative scheme
|
|
|
|
#
|
|
|
|
ifeq ($(CONSERVATIVE),Y)
|
|
|
|
FFLAGS += -DCONSERVATIVE
|
|
|
|
endif
|
|
|
|
|
2008-12-08 15:31:35 -06:00
|
|
|
# flux approximation method
|
|
|
|
#
|
|
|
|
FFLAGS += -D${FLUX}
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2010-02-22 12:01:58 -03:00
|
|
|
# electromotive force approximation method
|
|
|
|
#
|
|
|
|
ifeq ($(EQS),MHD)
|
|
|
|
FFLAGS += -D${FLUXEMF}
|
|
|
|
endif
|
|
|
|
|
2010-12-08 12:21:41 -02:00
|
|
|
# source terms
|
|
|
|
#
|
|
|
|
ifeq ($(FORCING),Y)
|
|
|
|
FFLAGS += -DFORCE
|
|
|
|
endif
|
2011-03-18 15:33:24 -03:00
|
|
|
ifeq ($(VISCOSITY),Y)
|
|
|
|
FFLAGS += -DVISCOSITY
|
|
|
|
endif
|
2011-03-22 17:24:28 -03:00
|
|
|
ifeq ($(EQS),MHD)
|
2010-12-10 15:38:17 -02:00
|
|
|
ifeq ($(RESISTIVITY),Y)
|
2011-03-22 17:24:28 -03:00
|
|
|
FFLAGS += -DRESISTIVITY
|
|
|
|
endif
|
2010-12-10 15:38:17 -02:00
|
|
|
endif
|
2010-12-08 12:21:41 -02:00
|
|
|
|
2008-11-04 13:08:01 -06:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
.SUFFIXES: .F90 .o
|
|
|
|
|
|
|
|
.F90.o:
|
|
|
|
$(FC) -c $(FFLAGS) $*.F90
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2011-04-25 13:44:34 -03:00
|
|
|
name = amun
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
default: $(name).x
|
|
|
|
|
2012-07-22 22:18:47 -03:00
|
|
|
sources = blocks.F90 boundaries.F90 config.F90 constants.F90 coordinates.F90 \
|
2012-07-27 16:18:02 -03:00
|
|
|
driver.F90 equations.F90 error.F90 evolution.F90 forcing.F90 \
|
2012-07-27 16:40:06 -03:00
|
|
|
integrals.F90 interpolations.F90 io.F90 mesh.F90 mpitools.F90 \
|
2012-07-27 19:27:42 -03:00
|
|
|
parameters.F90 problems.F90 random.F90 scheme.F90 timers.F90 \
|
2012-07-27 16:18:02 -03:00
|
|
|
variables.F90
|
2012-07-22 22:18:47 -03:00
|
|
|
objects = blocks.o boundaries.o config.o constants.o coordinates.o driver.o \
|
2012-07-27 16:18:02 -03:00
|
|
|
equations.o error.o evolution.o forcing.o integrals.o \
|
2012-07-27 19:27:42 -03:00
|
|
|
interpolations.o io.o mesh.o mpitools.o parameters.o problems.o \
|
2012-07-27 16:18:02 -03:00
|
|
|
random.o scheme.o timers.o variables.o
|
2008-11-04 13:08:01 -06:00
|
|
|
files = $(sources) makefile make.default config.in license.txt hosts
|
|
|
|
|
|
|
|
$(name).x: $(objects)
|
|
|
|
$(LD) $(LDFLAGS) $(objects) $(LIBS) -o $(name).x
|
|
|
|
|
|
|
|
arch: $(files)
|
|
|
|
tar czvf $(name)-$(DATE).tar.gz $(files)
|
|
|
|
|
2011-02-28 16:08:20 -03:00
|
|
|
clean-bak:
|
|
|
|
rm -rf *.bak *~
|
2008-11-04 13:08:01 -06:00
|
|
|
|
2011-02-28 16:08:20 -03:00
|
|
|
clean-data:
|
|
|
|
rm -rf *.dat *.h5
|
|
|
|
|
|
|
|
clean-exec:
|
|
|
|
rm -rf *.x
|
|
|
|
|
2011-04-28 12:04:22 -03:00
|
|
|
clean-logs:
|
|
|
|
rm -rf *.log
|
|
|
|
|
2011-02-28 16:08:20 -03:00
|
|
|
clean-modules:
|
|
|
|
rm -rf *.mod
|
|
|
|
|
|
|
|
clean-objects:
|
|
|
|
rm -rf *.o
|
|
|
|
|
|
|
|
clean: clean-bak clean-modules clean-objects
|
|
|
|
|
2011-04-28 12:04:22 -03:00
|
|
|
clean-all: clean-bak clean-data clean-exec clean-logs clean-modules \
|
|
|
|
clean-objects
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
|
2012-07-27 16:40:06 -03:00
|
|
|
blocks.o : blocks.F90 error.o
|
2012-07-27 17:18:24 -03:00
|
|
|
boundaries.o : boundaries.F90 blocks.o coordinates.o error.o \
|
|
|
|
interpolations.o mpitools.o variables.o
|
2012-07-27 16:40:06 -03:00
|
|
|
config.o : config.F90 error.o
|
|
|
|
constants.o : constants.F90
|
|
|
|
coordinates.o : coordinates.F90 parameters.o
|
|
|
|
driver.o : driver.F90 blocks.o config.o coordinates.o equations.o \
|
2012-07-27 16:46:36 -03:00
|
|
|
evolution.o forcing.o integrals.o interpolations.o io.o \
|
2012-07-27 21:13:43 -03:00
|
|
|
mesh.o mpitools.o parameters.o problems.o random.o
|
2012-07-27 16:40:06 -03:00
|
|
|
equations.o : equations.F90 parameters.o variables.o
|
|
|
|
error.o : error.F90
|
2012-07-27 19:23:11 -03:00
|
|
|
evolution.o : evolution.F90 blocks.o boundaries.o config.o coordinates.o \
|
2012-07-27 19:27:42 -03:00
|
|
|
forcing.o interpolations.o mesh.o mpitools.o problems.o \
|
2012-07-27 16:40:06 -03:00
|
|
|
scheme.o variables.o
|
2012-07-27 16:55:32 -03:00
|
|
|
forcing.o : forcing.F90 constants.o coordinates.o mpitools.o \
|
|
|
|
parameters.o random.o variables.o
|
2012-07-27 16:49:46 -03:00
|
|
|
integrals.o : integrals.F90 blocks.o coordinates.o evolution.o mpitools.o \
|
|
|
|
variables.o
|
2012-07-27 16:46:36 -03:00
|
|
|
interpolations.o : interpolations.F90 blocks.o coordinates.o parameters.o \
|
2012-07-27 16:40:06 -03:00
|
|
|
variables.o
|
2012-07-27 19:23:11 -03:00
|
|
|
io.o : io.F90 blocks.o config.o coordinates.o error.o evolution.o \
|
2012-07-27 16:40:06 -03:00
|
|
|
mpitools.o random.o scheme.o variables.o
|
|
|
|
mesh.o : mesh.F90 blocks.o coordinates.o error.o interpolations.o \
|
2012-07-27 19:27:42 -03:00
|
|
|
mpitools.o problems.o variables.o
|
2012-07-27 16:40:06 -03:00
|
|
|
mpitools.o : mpitools.F90 timers.o
|
|
|
|
parameters.o : parameters.F90 mpitools.o
|
2012-07-27 21:13:43 -03:00
|
|
|
problems.o : problems.F90 blocks.o boundaries.o coordinates.o \
|
|
|
|
equations.o error.o parameters.o scheme.o variables.o
|
2012-07-27 16:40:06 -03:00
|
|
|
scheme.o : scheme.F90 blocks.o coordinates.o interpolations.o \
|
|
|
|
variables.o
|
|
|
|
random.o : random.F90 mpitools.o parameters.o
|
|
|
|
timers.o : timers.F90
|
|
|
|
variables.o : variables.F90
|
2008-11-04 13:08:01 -06:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|