2012-03-02 01:04:42 +05:30
SHELL = /bin/sh
########################################################################################
# Makefile to compile the Material subroutine for BVP solution using spectral method
########################################################################################
# Be sure to remove all files compiled with different options by using "make clean"
########################################################################################
# OPTIONS = standard (alternative): meaning
#-------------------------------------------------------------
2014-12-03 03:19:33 +05:30
# F90 = ifort (gfortran): compiler type, choose Intel or GNU
2016-07-13 19:55:27 +05:30
# FCOMPILERNAME = name of the compiler executable (if not the same as the type), e.g. using mpich-g90 instead of ifort
2012-03-02 01:04:42 +05:30
# PORTABLE = TRUE (FALSE): decision, if executable is optimized for the machine on which it was built.
# OPTIMIZATION = DEFENSIVE (OFF,AGGRESSIVE,ULTRA): Optimization mode: O2, O0, O3 + further options for most files, O3 + further options for all files
# OPENMP = TRUE (FALSE): OpenMP multiprocessor support
2016-05-05 16:30:46 +05:30
# PREFIX = arbitrary prefix (before FCOMPILERNAME)
2013-09-14 16:29:35 +05:30
# OPTION = arbitrary option (just before file to compile)
# SUFFIX = arbitrary suffix (after file to compile)
2012-03-02 01:04:42 +05:30
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
########################################################################################
2015-11-13 15:46:35 +05:30
# including PETSc files. PETSC_ARCH is loaded from these files.
2016-01-28 14:26:12 +05:30
DAMASKVERSION := $( shell cat ../VERSION)
2016-01-27 22:18:27 +05:30
2015-11-13 15:46:35 +05:30
i n c l u d e $ { P E T S C _ D I R } / l i b / p e t s c / c o n f / v a r i a b l e s
i n c l u d e $ { P E T S C _ D I R } / l i b / p e t s c / c o n f / r u l e s
2014-01-24 18:00:27 +05:30
2016-10-24 17:47:26 +05:30
INCLUDE_DIRS := $( PETSC_FC_INCLUDES) -DPETSc
2014-12-03 06:11:12 +05:30
LIBRARIES := $( PETSC_WITH_EXTERNAL_LIB)
2016-05-05 16:30:46 +05:30
FCOMPILERNAME ?= $( FC)
2016-03-12 01:29:14 +05:30
CCOMPILERNAME ?= $( CC)
2014-08-25 03:37:53 +05:30
LINKERNAME ?= $( FLINKER)
2014-07-23 18:56:05 +05:30
2015-01-15 17:05:53 +05:30
# MPI compiler wrappers will tell if they are pointing to ifort or gfortran
2015-01-16 16:49:30 +05:30
COMPILEROUT := $( shell $( FC) -show)
2015-01-15 17:05:53 +05:30
# search in FC or COMPILEROUT for gfortran/ifort if not defined
2015-01-16 16:49:30 +05:30
i f e q ( $( strip $ ( F 90) ) , )
F90 := $( findstring gfortran,$( FC) $( COMPILEROUT) )
e n d i f
i f e q ( $( strip $ ( F 90) ) , )
F90 := $( findstring ifort,$( FC) $( COMPILEROUT) )
e n d i f
2014-12-03 06:11:12 +05:30
2012-03-02 01:04:42 +05:30
OPENMP ?= ON
OPTIMIZATION ?= DEFENSIVE
i f e q "$(OPTIMIZATION)" "OFF"
OPTI := OFF
MAXOPTI := OFF
e n d i f
i f e q "$(OPTIMIZATION)" "DEFENSIVE"
OPTI := DEFENSIVE
MAXOPTI := DEFENSIVE
e n d i f
i f e q "$(OPTIMIZATION)" "AGGRESSIVE"
OPTI := AGGRESSIVE
MAXOPTI := DEFENSIVE
e n d i f
i f e q "$(OPTIMIZATION)" "ULTRA"
OPTI := AGGRESSIVE
MAXOPTI := AGGRESSIVE
e n d i f
i f n d e f O P T I
OPTI := DEFENSIVE
MAXOPTI := DEFENSIVE
e n d i f
2015-11-08 15:13:43 +05:30
# settings for shared memory multicore support
2014-01-24 18:00:27 +05:30
i f e q "$(OPENMP)" "ON"
2016-10-21 18:35:34 +05:30
OPENMP_FLAG_ifort = -qopenmp -parallel
2014-01-24 18:00:27 +05:30
OPENMP_FLAG_gfortran = -fopenmp
e n d i f
2012-03-02 01:04:42 +05:30
i f d e f S T A N D A R D _ C H E C K
2012-06-15 21:40:21 +05:30
STANDARD_CHECK_ifort = $( STANDARD_CHECK)
STANDARD_CHECK_gfortran = $( STANDARD_CHECK)
2012-03-02 01:04:42 +05:30
e n d i f
2014-02-03 22:17:16 +05:30
STANDARD_CHECK_ifort ?= -stand f08 -standard-semantics
2015-01-15 16:26:15 +05:30
STANDARD_CHECK_gfortran ?= -std= f2008ts -pedantic-errors
2015-12-01 20:43:33 +05:30
2013-02-13 23:24:56 +05:30
#-pedantic: more strict on standard, enables some warnings
# -pedantic-errors: like pedantic, but errors instead of warnings
2012-03-02 01:04:42 +05:30
OPTIMIZATION_OFF_ifort := -O0 -no-ip
OPTIMIZATION_OFF_gfortran := -O0
OPTIMIZATION_DEFENSIVE_ifort := -O2
OPTIMIZATION_DEFENSIVE_gfortran := -O2
2015-12-03 01:32:19 +05:30
OPTIMIZATION_AGGRESSIVE_ifort := -ipo -O3 -no-prec-div -fp-model fast = 2 -xHost #-fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost
2015-12-02 18:51:17 +05:30
OPTIMIZATION_AGGRESSIVE_gfortran := -O3 -ffast-math -funroll-loops -ftree-vectorize
2012-03-02 01:04:42 +05:30
2012-03-20 17:56:21 +05:30
2014-04-30 19:43:21 +05:30
LINK_OPTIONS_ifort := -shared-intel
2016-01-27 22:18:27 +05:30
COMPILE_OPTIONS_ifort := -DDAMASKVERSION= \" ${ DAMASKVERSION } \" \
-fpp\
2012-10-19 14:14:21 +05:30
-ftz\
2015-12-02 18:51:17 +05:30
-assume byterecl,fpe_summary\
2014-02-04 01:00:28 +05:30
-diag-disable 5268\
2012-03-02 01:04:42 +05:30
-warn declarations\
-warn general\
-warn usage\
-warn interfaces\
-warn ignore_loc\
-warn alignments\
2013-12-19 14:19:47 +05:30
-warn unused
2015-12-01 20:43:33 +05:30
2013-02-08 21:13:15 +05:30
###################################################################################################
#COMPILE SWITCHES
2014-09-09 21:29:41 +05:30
#-shared-intel: Link against shared Intel libraries instead of static ones
2012-03-02 01:04:42 +05:30
#-fpp: preprocessor
2012-10-19 14:14:21 +05:30
#-ftz: flush unterflow to zero, automatically set if O<0,1,2,3> >0
2013-12-19 14:19:47 +05:30
#-assume byterecl record length is given in bytes (also set by -standard-semantics)
2016-01-07 18:28:19 +05:30
# fpe_summary print list of floating point exceptions occured during execution
2012-03-02 01:04:42 +05:30
#-fimplicit-none: assume "implicit-none" even if not present in source
2015-10-14 00:22:01 +05:30
#-diag-disable: disables warnings, where
2012-03-02 01:04:42 +05:30
# warning ID 5268: the text exceeds right hand column allowed on the line (we have only comments there)
#-warn: enables warnings, where
2013-03-28 13:10:30 +05:30
# declarations: any undeclared names (alternative name: -implicitnone)
2012-03-02 01:04:42 +05:30
# general: warning messages and informational messages are issued by the compiler
# usage: questionable programming practices
# interfaces: checks the interfaces of all SUBROUTINEs called and FUNCTIONs invoked in your compilation against an external set of interface blocks
# ignore_loc: %LOC is stripped from an actual argument
# alignments: data that is not naturally aligned
# unused: declared variables that are never used
2012-03-06 20:22:48 +05:30
# stderrors: warnings about Fortran standard violations are changed to errors (STANDARD_CHECK)
2012-03-02 01:04:42 +05:30
#
###################################################################################################
2013-02-08 21:13:15 +05:30
#MORE OPTIONS FOR DEBUGGING DURING COMPILATION
2012-03-02 01:04:42 +05:30
#-warn: enables warnings, where
# truncated_source: Determines whether warnings occur when source exceeds the maximum column width in fixed-format files. (too many warnings because we have comments beyond character 132)
# uncalled: Determines whether warnings occur when a statement function is never called
# all:
2013-03-28 13:10:30 +05:30
# -name as_is: case sensitive Fortran!
2013-02-08 21:13:15 +05:30
DEBUG_OPTIONS_ifort := -g\
-traceback\
-gen-interfaces\
-fp-stack-check\
2015-12-02 18:51:17 +05:30
-fp-model strict\
2013-02-13 23:24:56 +05:30
-check bounds,format,output_conversion,pointers,uninit\
2014-02-10 00:00:31 +05:30
-ftrapuv\
2013-12-19 14:19:47 +05:30
-fpe-all0\
2014-02-03 22:17:16 +05:30
-warn errors\
2014-02-06 16:11:34 +05:30
-warn stderrors\
-debug-parameters all
2014-02-03 22:17:16 +05:30
2013-02-08 21:13:15 +05:30
###################################################################################################
#COMPILE SWITCHES FOR RUNTIME DEBUGGING
2012-03-02 01:04:42 +05:30
#-g: Generate symbolic debugging information in the object file
#-traceback: Generate extra information in the object file to provide source file traceback information when a severe error occurs at run time.
2015-10-14 00:22:01 +05:30
#-gen-interfaces: Generate an interface block for each routine. http://software.intel.com/en-us/blogs/2012/01/05/doctor-fortran-gets-explicit-again/
2012-03-02 01:04:42 +05:30
#-fp-stack-check: Generate extra code after every function call to ensure that the floating-point (FP) stack is in the expected state.
2014-02-10 00:00:31 +05:30
#-ftrapuv Trap uninitalized variables
2015-10-14 00:22:01 +05:30
#-check: checks at runtime, where
2012-03-02 01:04:42 +05:30
# bounds: check if an array index is too small (<1) or too large!
# format: Checking for the data type of an item being formatted for output.
# output_conversion: Checking for the fit of data items within a designated format descriptor field.
# pointers: Checking for certain disassociated or uninitialized pointers or unallocated allocatable objects.
# uninit: Checking for uninitialized variables.
2012-10-19 14:14:21 +05:30
#-fpe-all0 capture all floating-point exceptions, sets -ftz automatically
2013-12-19 14:19:47 +05:30
#-warn: enables warnings, where
# errors: warnings are changed to errors
2014-02-03 22:17:16 +05:30
# stderrors: warnings about Fortran standard violations are changed to errors
2013-02-08 21:13:15 +05:30
# information on http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/
2012-03-02 01:04:42 +05:30
###################################################################################################
2013-02-08 21:13:15 +05:30
#MORE OPTIONS FOR RUNTIME DEBUGGING
#-heap-arrays: should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits
2015-10-14 00:22:01 +05:30
#-check: checks at runtime, where
2013-02-08 21:13:15 +05:30
# arg_temp_created: will cause a lot of warnings because we create a bunch of temporary arrays (performance?)
2013-03-28 13:10:30 +05:30
# stack:
2014-05-01 02:43:06 +05:30
LINK_OPTIONS_gfortran := -Wl,-undefined,dynamic_lookup
2016-01-27 22:18:27 +05:30
COMPILE_OPTIONS_gfortran := -DDAMASKVERSION= \" ${ DAMASKVERSION } \" \
-xf95-cpp-input\
2015-12-02 18:51:17 +05:30
-ffree-line-length-132\
2012-03-02 01:04:42 +05:30
-fimplicit-none\
2013-03-28 13:10:30 +05:30
-fmodule-private\
2012-03-02 01:04:42 +05:30
-Wall\
2012-12-15 21:51:10 +05:30
-Wextra\
2013-02-13 23:24:56 +05:30
-Wcharacter-truncation\
-Wunderflow\
2012-12-15 21:51:10 +05:30
-Wsuggest-attribute= pure\
-Wsuggest-attribute= noreturn\
2013-02-13 23:24:56 +05:30
-Wconversion-extra\
2015-05-28 22:32:23 +05:30
-Wimplicit-procedure\
-Wno-unused-parameter
2016-01-09 18:03:33 +05:30
#-ffpe-summary=all only for newer gfortran
2013-02-08 21:13:15 +05:30
###################################################################################################
#COMPILE SWITCHES
2014-04-29 22:13:59 +05:30
#-shared
#-Wl,-undefined,dynamic_lookup:ensure to link against dynamic libraries
2012-03-02 01:04:42 +05:30
#-xf95-cpp-input: preprocessor
#-ffree-line-length-132: restrict line length to the standard 132 characters
2016-01-07 18:28:19 +05:30
#-ffpe-summary: print summary of floating point exeptions (‘ invalid’ , ‘ zero’ , ‘ overflow’ , ‘ underflow’ , ‘ inexact’ and ‘ denormal’ )
2012-03-02 01:04:42 +05:30
#-fimplicit-none: assume "implicit-none" even if not present in source
2013-03-28 13:10:30 +05:30
#-fmodule-private: assume "private" even if not present in source
2012-03-02 01:04:42 +05:30
#-Wcharacter-truncation: warn if character expressions (strings) are truncated
#-Wunderflow: produce a warning when numerical constant expressions are encountered, which yield an UNDERFLOW during compilation
2013-02-13 23:24:56 +05:30
#-Wsuggest-attribute=pure:
2013-01-24 03:20:01 +05:30
#-Wsuggest-attribute=noreturn:
2013-02-13 23:24:56 +05:30
#-Wconversion-extra
#-Wimplicit-procedure
#-Wall: sets the following Fortran options:
# -Waliasing: warn about possible aliasing of dummy arguments. Specifically, it warns if the same actual argument is associated with a dummy argument with "INTENT(IN)" and a dummy argument with "INTENT(OUT)" in a call with an explicit interface.
2013-12-19 14:19:47 +05:30
# -Wampersand: checks if a character expression is continued proberly by an ampersand at the end of the line and at the beginning of the new line
# -Warray-bounds: checks if array reference is out of bounds at compile time. use -fcheck-bounds to also check during runtime
2013-02-13 23:24:56 +05:30
# -Wconversion: warn about implicit conversions between different type
# -Wsurprising: warn when "suspicious" code constructs are encountered. While technically legal these usually indicate that an error has been made.
# -Wc-binding-type:
# -Wintrinsics-std: only standard intrisics are available, e.g. "call flush(6)" will cause an error
# -Wno-tabs: do not allow tabs in source
# -Wintrinsic-shadow: warn if a user-defined procedure or module procedure has the same name as an intrinsic
# -Wline-truncation:
# -Wtarget-lifetime:
# -Wreal-q-constant: warn about real-literal-constants with 'q' exponent-letter
# -Wunused: a number of unused-xxx warnings
# these are general (non -Fortran options) implied by -Wall
2015-10-14 00:22:01 +05:30
# -Waddress
# -Warray-bounds (only with -O2)
# -Wc++11-compat
# -Wchar-subscripts
# -Wcomment
# -Wformat
# -Wmaybe-uninitialized
# -Wnonnull
# -Wparentheses
# -Wpointer-sign
# -Wreorder
# -Wreturn-type
# -Wsequence-point
# -Wstrict-aliasing
# -Wstrict-overflow=1
# -Wswitch
# -Wtrigraphs
# -Wuninitialized
# -Wunknown-pragmas
# -Wunused-function
# -Wunused-label
# -Wunused-value
# -Wunused-variable
# -Wvolatile-register-var
2013-02-13 23:24:56 +05:30
#-Wextra: sets the following Fortran options:
# -Wunuses-parameter:
# -Wcompare-reals:
# these are general (non -Fortran options) implied by -Wextra
2015-10-14 00:22:01 +05:30
# -Wclobbered
# -Wempty-body
# -Wignored-qualifiers
# -Wmissing-field-initializers
# -Woverride-init
# -Wsign-compare
# -Wtype-limits
# -Wuninitialized
2013-02-13 23:24:56 +05:30
# -Wunused-but-set-parameter (only with -Wunused or -Wall)
# -Wno-globals
2012-03-02 01:04:42 +05:30
###################################################################################################
2013-02-13 23:24:56 +05:30
#MORE OPTIONS FOR DEBUGGING DURING COMPILATION
2015-10-14 00:22:01 +05:30
#-Warray-temporarieswarnings: because we have many temporary arrays (performance issue?):
2013-02-13 23:24:56 +05:30
#-Wimplicit-interface: no interfaces for lapack routines
#-Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions.
#-Wstrict-overflow:
2013-02-08 21:13:15 +05:30
2016-08-25 21:30:10 +05:30
DEBUG_OPTIONS_gfortran := -g \
-fbacktrace \
-fdump-core \
-fcheck= all \
2013-02-08 21:13:15 +05:30
-ffpe-trap= invalid,zero,overflow
2013-02-13 23:24:56 +05:30
2013-02-08 21:13:15 +05:30
###################################################################################################
#COMPILE SWITCHES FOR RUNTIME DEBUGGING
2012-10-19 14:14:21 +05:30
#-ffpe-trap=invalid,\ stop execution if floating point exception is detected (NaN is silent)
# zero,\
2013-02-13 23:24:56 +05:30
# overflow
#-fcheck=all: sets the following Fortran options:
#array-temps
#bounds
#do
#mem
#pointer
#recursion
2013-02-08 21:13:15 +05:30
###################################################################################################
2013-02-13 23:24:56 +05:30
#MORE OPTIONS FOR RUNTIME DEBUGGING
2013-02-08 21:13:15 +05:30
#-ffpe-trap=precision,\
# denormal, \
# underflow
i f e q "$(DEBUG)" "ON"
2013-09-14 16:29:35 +05:30
COMPILE_OPTIONS_$(F90) += $( DEBUG_OPTIONS_$( F90) )
2016-01-07 18:28:19 +05:30
LINK_OPTIONS_$(F90) += $( DEBUG_OPTIONS_$( F90) )
2013-02-08 21:13:15 +05:30
e n d i f
2016-01-07 18:28:19 +05:30
LINK_OPTIONS_$(F90) += $( OPTIMIZATION_$( MAXOPTI) _$( F90) )
2015-12-02 18:51:17 +05:30
2012-08-28 21:38:17 +05:30
PRECISION_ifort := -real-size 64 -integer-size 32 -DFLOAT= 8 -DINT= 4
2012-11-08 23:56:10 +05:30
#-real-size 32: set precision to one of those 32/64/128 (= 4/8/16 bytes) for standard real (=8 for pReal)
#-integer-size 16: set precision to one of those 16/32/64 (= 2/4/8 bytes) for standard integer (=4 for pInt)
2012-08-29 10:49:35 +05:30
PRECISION_gfortran := -fdefault-real-8 -fdefault-double-8 -DFLOAT= 8 -DINT= 4
2012-11-08 23:56:10 +05:30
#-fdefault-real-8: set precision to 8 bytes for standard real (=8 for pReal). Will set size of double to 16 bytes as long as -fdefault-double-8 is not set
#-fdefault-double-8: set precision to 8 bytes for double real, would be 16 bytes because -fdefault-real-8 is used
#-fdefault-integer-8: Use it to set precision to 8 bytes for integer, don't use it for the standard case of pInt=4 (there is no -fdefault-integer-4)
2012-03-02 01:04:42 +05:30
2012-08-28 21:38:17 +05:30
###################################################################################################
2015-12-02 18:51:17 +05:30
COMPILE = $( OPENMP_FLAG_$( F90) ) $( STANDARD_CHECK_$( F90) ) $( OPTIMIZATION_$( OPTI) _$( F90) ) $( COMPILE_OPTIONS_$( F90) ) $( INCLUDE_DIRS) $( PRECISION_$( F90) )
COMPILE_MAXOPTI = $( OPENMP_FLAG_$( F90) ) $( STANDARD_CHECK_$( F90) ) $( OPTIMIZATION_$( MAXOPTI) _$( F90) ) $( COMPILE_OPTIONS_$( F90) ) $( INCLUDE_DIRS) $( PRECISION_$( F90) )
2012-03-02 01:04:42 +05:30
###################################################################################################
2015-05-28 22:32:23 +05:30
SOURCE_FILES = \
2016-08-25 21:30:10 +05:30
source_thermal_dissipation.o \
source_thermal_externalheat.o \
source_damage_isoBrittle.o \
source_damage_isoDuctile.o \
source_damage_anisoBrittle.o \
source_damage_anisoDuctile.o \
source_vacancy_phenoplasticity.o \
source_vacancy_irradiation.o \
source_vacancy_thermalfluc.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
KINEMATICS_FILES = \
2016-08-25 21:30:10 +05:30
kinematics_cleavage_opening.o \
kinematics_slipplane_opening.o \
2015-05-28 22:32:23 +05:30
kinematics_thermal_expansion.o \
2016-08-25 21:30:10 +05:30
kinematics_vacancy_strain.o \
kinematics_hydrogen_strain.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
PLASTIC_FILES = \
2016-08-25 21:30:10 +05:30
plastic_dislotwin.o \
plastic_disloUCLA.o \
plastic_isotropic.o \
plastic_phenopowerlaw.o \
plastic_titanmod.o \
plastic_nonlocal.o \
plastic_none.o \
2016-01-09 01:15:20 +05:30
plastic_phenoplus.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
THERMAL_FILES = \
2016-08-25 21:30:10 +05:30
thermal_isothermal.o \
thermal_adiabatic.o \
thermal_conduction.o
2015-05-28 22:32:23 +05:30
2014-09-03 22:42:06 +05:30
DAMAGE_FILES = \
2016-08-25 21:30:10 +05:30
damage_none.o \
damage_local.o \
damage_nonlocal.o
2014-09-22 23:45:19 +05:30
2015-05-28 22:32:23 +05:30
VACANCYFLUX_FILES = \
2016-08-25 21:30:10 +05:30
vacancyflux_isoconc.o \
vacancyflux_isochempot.o \
vacancyflux_cahnhilliard.o
2014-09-22 23:45:19 +05:30
2015-05-28 22:32:23 +05:30
POROSITY_FILES = \
2016-08-25 21:30:10 +05:30
porosity_none.o \
porosity_phasefield.o
2014-10-11 02:25:09 +05:30
2015-05-28 22:32:23 +05:30
HYDROGENFLUX_FILES = \
2016-08-25 21:30:10 +05:30
hydrogenflux_isoconc.o \
hydrogenflux_cahnhilliard.o
2014-09-23 16:08:20 +05:30
2014-08-25 03:37:53 +05:30
HOMOGENIZATION_FILES = \
2016-08-25 21:30:10 +05:30
homogenization_RGC.o \
homogenization_isostrain.o \
homogenization_none.o
2014-08-25 03:37:53 +05:30
#####################
# Spectral Solver
#####################
2014-09-11 15:21:38 +05:30
DAMASK_spectral.exe : IGNORE := \#
2015-03-18 22:48:43 +05:30
DAMASK_spectral.exe : COMPILE += -DSpectral
DAMASK_spectral.exe : COMPILE_MAXOPTI += -DSpectral
2014-08-25 03:37:53 +05:30
DAMASK_spectral.exe : MESHNAME := mesh .f 90
2016-01-25 02:35:36 +05:30
DAMASK_spectral.exe : INTERFACENAME := spectral_interface .f 90
2014-08-25 03:37:53 +05:30
2015-12-16 02:15:54 +05:30
DAMASK_spectral.o : IGNORE := \#
DAMASK_spectral.o : COMPILE += -DSpectral
DAMASK_spectral.o : COMPILE_MAXOPTI += -DSpectral
DAMASK_spectral.o : MESHNAME := mesh .f 90
2016-01-25 02:35:36 +05:30
DAMASK_spectral.o : INTERFACENAME := spectral_interface .f 90
2015-10-06 23:30:17 +05:30
2014-08-25 03:37:53 +05:30
2016-01-25 02:35:36 +05:30
SPECTRAL_SOLVER_FILES = spectral_mech_AL.o spectral_mech_Basic.o spectral_mech_Polarisation.o \
2015-06-03 23:00:31 +05:30
spectral_thermal.o spectral_damage.o
2015-05-28 22:32:23 +05:30
2016-08-25 21:30:10 +05:30
SPECTRAL_FILES = C_routines.o \
system_routines.o \
prec.o \
DAMASK_interface.o \
IO.o \
numerics.o \
debug.o \
math.o \
FEsolving.o \
mesh.o \
material.o \
lattice.o \
$( SOURCE_FILES) \
$( KINEMATICS_FILES) \
$( PLASTIC_FILES) \
constitutive.o \
2015-05-28 22:32:23 +05:30
crystallite.o \
2016-08-25 21:30:10 +05:30
$( THERMAL_FILES) \
$( DAMAGE_FILES) \
$( VACANCYFLUX_FILES) \
$( HYDROGENFLUX_FILES) \
$( POROSITY_FILES) \
2015-05-28 22:32:23 +05:30
$( HOMOGENIZATION_FILES) homogenization.o \
2016-01-17 20:33:54 +05:30
CPFEM2.o \
2015-12-16 02:15:54 +05:30
spectral_utilities.o \
2015-05-28 22:32:23 +05:30
$( SPECTRAL_SOLVER_FILES)
2012-08-29 00:49:47 +05:30
2015-12-16 02:15:54 +05:30
DAMASK_spectral.exe : DAMASK_spectral .o
2014-12-03 19:07:04 +05:30
$( PREFIX) $( LINKERNAME) $( OPENMP_FLAG_$( F90) ) $( LINK_OPTIONS_$( F90) ) $( STANDARD_CHECK_$( F90) ) $( OPTIMIZATION_$( MAXOPTI) _$( F90) ) \
2015-12-16 02:15:54 +05:30
-o DAMASK_spectral.exe DAMASK_spectral.o \
2015-01-23 19:14:16 +05:30
$( SPECTRAL_FILES) $( LIBRARIES) $( SUFFIX)
2015-10-14 00:22:01 +05:30
2015-12-16 02:15:54 +05:30
DAMASK_spectral.o : DAMASK_spectral .f 90 \
2015-05-28 22:32:23 +05:30
$( SPECTRAL_SOLVER_FILES)
2016-05-05 16:30:46 +05:30
$( PREFIX) $( FCOMPILERNAME) $( COMPILE_MAXOPTI) -c DAMASK_spectral.f90 $( SUFFIX)
2012-08-06 18:13:05 +05:30
2016-01-25 02:35:36 +05:30
spectral_mech_AL.o : spectral_mech_AL .f 90 \
2015-12-16 02:15:54 +05:30
spectral_utilities.o
2015-10-14 00:22:01 +05:30
2016-01-25 02:35:36 +05:30
spectral_mech_Polarisation.o : spectral_mech_Polarisation .f 90 \
2015-12-16 02:15:54 +05:30
spectral_utilities.o
2015-10-14 00:22:01 +05:30
2016-01-25 02:35:36 +05:30
spectral_mech_Basic.o : spectral_mech_Basic .f 90 \
2015-12-16 02:15:54 +05:30
spectral_utilities.o
2012-08-06 18:13:05 +05:30
2015-06-03 23:00:31 +05:30
spectral_thermal.o : spectral_thermal .f 90 \
2015-12-16 02:15:54 +05:30
spectral_utilities.o
2015-10-14 00:22:01 +05:30
2015-06-03 23:00:31 +05:30
spectral_damage.o : spectral_damage .f 90 \
2015-12-16 02:15:54 +05:30
spectral_utilities.o
2015-10-14 00:22:01 +05:30
2016-01-25 02:35:36 +05:30
spectral_utilities.o : spectral_utilities .f 90 \
2016-01-17 20:33:54 +05:30
CPFEM2.o
2014-08-25 03:37:53 +05:30
#####################
# FEM Solver
#####################
2014-09-11 15:21:38 +05:30
VPATH := ../private/FEM/code
2015-03-25 21:36:19 +05:30
DAMASK_FEM.exe : COMPILE += -DFEM
DAMASK_FEM.exe : COMPILE_MAXOPTI += -DFEM
2014-08-25 03:37:53 +05:30
DAMASK_FEM.exe : MESHNAME := ../private /FEM /code /meshFEM .f 90
DAMASK_FEM.exe : INTERFACENAME := ../private /FEM /code /DAMASK_FEM_interface .f 90
DAMASK_FEM.exe : INCLUDE_DIRS += -I ./
2015-05-28 22:32:23 +05:30
FEM_SOLVER_FILES = FEM_mech.o FEM_thermal.o FEM_damage.o FEM_vacancyflux.o FEM_porosity.o FEM_hydrogenflux.o
2016-08-25 21:30:10 +05:30
FEM_FILES = prec.o \
DAMASK_interface.o \
FEZoo.o \
IO.o \
numerics.o \
debug.o \
math.o \
FEsolving.o \
mesh.o \
material.o \
lattice.o \
$( SOURCE_FILES) \
$( KINEMATICS_FILES) \
$( PLASTIC_FILES) \
constitutive.o \
2015-05-28 22:32:23 +05:30
crystallite.o \
2016-08-25 21:30:10 +05:30
$( THERMAL_FILES) \
$( DAMAGE_FILES) \
$( VACANCYFLUX_FILES) \
$( HYDROGENFLUX_FILES) \
$( POROSITY_FILES) \
2015-05-28 22:32:23 +05:30
$( HOMOGENIZATION_FILES) homogenization.o \
CPFEM.o \
2016-08-25 21:30:10 +05:30
FEM_utilities.o \
$( FEM_SOLVER_FILES)
2014-08-25 03:37:53 +05:30
DAMASK_FEM.exe : DAMASK_FEM_driver .o
2015-05-28 22:32:23 +05:30
$( PREFIX) $( LINKERNAME) $( OPENMP_FLAG_$( F90) ) $( LINK_OPTIONS_$( F90) ) $( STANDARD_CHECK_$( F90) ) $( OPTIMIZATION_$( MAXOPTI) _$( F90) ) \
2014-08-25 03:37:53 +05:30
-o DAMASK_FEM.exe DAMASK_FEM_driver.o \
2015-01-23 19:14:16 +05:30
$( FEM_FILES) $( LIBRARIES) $( SUFFIX)
2014-08-25 03:37:53 +05:30
2015-05-28 22:32:23 +05:30
DAMASK_FEM_driver.o : DAMASK_FEM_driver .f 90 $( FEM_SOLVER_FILES )
2016-05-05 16:30:46 +05:30
$( PREFIX) $( FCOMPILERNAME) $( COMPILE_MAXOPTI) -c ../private/FEM/code/DAMASK_FEM_driver.f90 $( SUFFIX)
2014-08-25 03:37:53 +05:30
FEM_mech.o : FEM_mech .f 90 \
FEM_utilities.o
FEM_thermal.o : FEM_thermal .f 90 \
FEM_utilities.o
FEM_damage.o : FEM_damage .f 90 \
FEM_utilities.o
2015-05-28 22:32:23 +05:30
FEM_vacancyflux.o : FEM_vacancyflux .f 90 \
FEM_utilities.o
FEM_porosity.o : FEM_porosity .f 90 \
FEM_utilities.o
FEM_hydrogenflux.o : FEM_hydrogenflux .f 90 \
2014-11-08 02:10:54 +05:30
FEM_utilities.o
2014-08-25 03:37:53 +05:30
FEM_utilities.o : FEM_utilities .f 90 \
2015-10-14 00:22:01 +05:30
CPFEM.o
2014-08-25 03:37:53 +05:30
2014-09-11 15:21:38 +05:30
FEZoo.o : $( wildcard FEZoo .f 90) \
2014-08-25 03:37:53 +05:30
IO.o
2016-05-05 16:30:46 +05:30
$( IGNORE) $( PREFIX) $( FCOMPILERNAME) $( COMPILE) -c ../private/FEM/code/FEZoo.f90 $( SUFFIX)
2014-12-03 19:07:04 +05:30
touch FEZoo.o
2014-08-25 03:37:53 +05:30
2016-01-25 02:35:36 +05:30
CPFEM.o : CPFEM .f 90 \
2012-12-15 21:51:10 +05:30
homogenization.o
2012-03-02 01:04:42 +05:30
2016-01-25 02:35:36 +05:30
CPFEM2.o : CPFEM 2.f 90 \
2016-01-17 20:33:54 +05:30
homogenization.o
2016-01-25 02:35:36 +05:30
homogenization.o : homogenization .f 90 \
2015-05-28 22:32:23 +05:30
$( THERMAL_FILES) \
$( DAMAGE_FILES) \
$( VACANCYFLUX_FILES) \
$( POROSITY_FILES) \
$( HYDROGENFLUX_FILES) \
$( HOMOGENIZATION_FILES)
thermal_isothermal.o : thermal_isothermal .f 90 \
crystallite.o
thermal_adiabatic.o : thermal_adiabatic .f 90 \
crystallite.o
thermal_conduction.o : thermal_conduction .f 90 \
crystallite.o
damage_none.o : damage_none .f 90 \
crystallite.o
damage_local.o : damage_local .f 90 \
crystallite.o
damage_nonlocal.o : damage_nonlocal .f 90 \
crystallite.o
thermal_conduction.o : thermal_conduction .f 90 \
crystallite.o
vacancyflux_isoconc.o : vacancyflux_isoconc .f 90 \
crystallite.o
vacancyflux_isochempot.o : vacancyflux_isochempot .f 90 \
crystallite.o
vacancyflux_cahnhilliard.o : vacancyflux_cahnhilliard .f 90 \
crystallite.o
porosity_none.o : porosity_none .f 90 \
crystallite.o
porosity_phasefield.o : porosity_phasefield .f 90 \
crystallite.o
hydrogenflux_isoconc.o : hydrogenflux_isoconc .f 90 \
crystallite.o
hydrogenflux_cahnhilliard.o : hydrogenflux_cahnhilliard .f 90 \
crystallite.o
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
homogenization_RGC.o : homogenization_RGC .f 90 \
crystallite.o
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
homogenization_isostrain.o : homogenization_isostrain .f 90 \
crystallite.o
2012-03-02 01:04:42 +05:30
2014-03-14 04:50:50 +05:30
homogenization_none.o : homogenization_none .f 90 \
crystallite.o
2012-12-15 21:51:10 +05:30
crystallite.o : crystallite .f 90 \
2015-10-14 00:22:01 +05:30
constitutive.o
2012-12-15 21:51:10 +05:30
constitutive.o : constitutive .f 90 \
2015-05-28 22:32:23 +05:30
$( SOURCE_FILES) \
$( KINEMATICS_FILES) \
$( PLASTIC_FILES)
2012-03-02 01:04:42 +05:30
2015-05-28 22:32:23 +05:30
source_thermal_dissipation.o : source_thermal_dissipation .f 90 \
2015-01-15 16:26:15 +05:30
lattice.o
2015-07-27 16:39:37 +05:30
source_thermal_externalheat.o : source_thermal_externalheat .f 90 \
lattice.o
2015-05-28 22:32:23 +05:30
source_damage_isoBrittle.o : source_damage_isoBrittle .f 90 \
2012-12-15 21:51:10 +05:30
lattice.o
2012-03-02 01:04:42 +05:30
2015-05-28 22:32:23 +05:30
source_damage_isoDuctile.o : source_damage_isoDuctile .f 90 \
2012-12-15 21:51:10 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
source_damage_anisoBrittle.o : source_damage_anisoBrittle .f 90 \
2014-08-08 16:34:40 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
source_damage_anisoDuctile.o : source_damage_anisoDuctile .f 90 \
2012-12-15 21:51:10 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
source_vacancy_phenoplasticity.o : source_vacancy_phenoplasticity .f 90 \
2012-12-15 21:51:10 +05:30
lattice.o
2012-03-02 01:04:42 +05:30
2015-05-28 22:32:23 +05:30
source_vacancy_irradiation.o : source_vacancy_irradiation .f 90 \
2012-12-15 21:51:10 +05:30
lattice.o
2012-03-02 01:04:42 +05:30
2015-05-28 22:32:23 +05:30
source_vacancy_thermalfluc.o : source_vacancy_thermalfluc .f 90 \
2012-12-15 21:51:10 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
kinematics_cleavage_opening.o : kinematics_cleavage_opening .f 90 \
2014-08-01 20:24:57 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
kinematics_slipplane_opening.o : kinematics_slipplane_opening .f 90 \
2014-09-26 16:08:13 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
kinematics_thermal_expansion.o : kinematics_thermal_expansion .f 90 \
2014-10-10 18:12:12 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
kinematics_vacancy_strain.o : kinematics_vacancy_strain .f 90 \
2014-11-05 23:11:08 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
kinematics_hydrogen_strain.o : kinematics_hydrogen_strain .f 90 \
2014-11-25 22:53:37 +05:30
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
plastic_nonlocal.o : plastic_nonlocal .f 90 \
2014-10-15 20:32:29 +05:30
lattice.o
2014-09-26 16:08:13 +05:30
2015-05-28 22:32:23 +05:30
plastic_titanmod.o : plastic_titanmod .f 90 \
2014-07-04 16:16:23 +05:30
lattice.o
2014-06-25 04:48:39 +05:30
2015-05-28 22:32:23 +05:30
plastic_disloUCLA.o : plastic_disloUCLA .f 90 \
lattice.o
plastic_dislotwin.o : plastic_dislotwin .f 90 \
2014-10-11 02:25:09 +05:30
lattice.o
2015-05-28 22:32:23 +05:30
plastic_phenopowerlaw.o : plastic_phenopowerlaw .f 90 \
lattice.o
2015-10-14 00:22:01 +05:30
plastic_phenoplus.o : plastic_phenoplus .f 90 \
lattice.o
2016-01-09 01:15:20 +05:30
plastic_isotropic.o : plastic_isotropic .f 90 \
lattice.o
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
plastic_none.o : plastic_none .f 90 \
2014-10-11 02:25:09 +05:30
lattice.o
2015-07-02 10:39:07 +05:30
i f e q "$(F90)" "gfortran"
2012-12-15 21:51:10 +05:30
lattice.o : lattice .f 90 \
material.o
2016-05-05 16:30:46 +05:30
$( PREFIX) $( FCOMPILERNAME) $( COMPILE) -ffree-line-length-240 -c lattice.f90 $( SUFFIX)
2015-07-02 10:39:07 +05:30
# long lines for interaction matrix
e l s e
lattice.o : lattice .f 90 \
material.o
e n d i f
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
material.o : material .f 90 \
mesh.o
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
mesh.o : mesh .f 90 \
2014-08-25 11:50:25 +05:30
$( wildcard meshFEM.f90) \
2012-12-15 21:51:10 +05:30
FEsolving.o \
2014-08-25 03:37:53 +05:30
math.o \
2014-09-09 21:29:41 +05:30
FEZoo.o
2016-05-05 16:30:46 +05:30
$( PREFIX) $( FCOMPILERNAME) $( COMPILE) -c $( MESHNAME) -o mesh.o $( SUFFIX)
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
FEsolving.o : FEsolving .f 90 \
debug.o
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
math.o : math .f 90 \
debug.o
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
debug.o : debug .f 90 \
numerics.o
2012-03-02 01:04:42 +05:30
2012-12-15 21:51:10 +05:30
numerics.o : numerics .f 90 \
2013-04-16 18:15:12 +05:30
IO.o
2012-12-15 21:51:10 +05:30
IO.o : IO .f 90 \
2014-08-25 03:37:53 +05:30
DAMASK_interface.o
2013-04-16 18:15:12 +05:30
2016-01-25 02:35:36 +05:30
DAMASK_interface.o : spectral_interface .f 90 \
2014-08-25 11:50:25 +05:30
$( wildcard DAMASK_FEM_interface.f90) \
prec.o
2016-05-05 16:30:46 +05:30
$( PREFIX) $( FCOMPILERNAME) $( COMPILE) -c $( INTERFACENAME) -o DAMASK_interface.o $( SUFFIX)
2016-03-12 01:29:14 +05:30
2016-03-22 01:39:45 +05:30
i f e q "$(F90)" "gfortran"
prec.o : prec .f 90 \
system_routines.o
2016-05-05 16:30:46 +05:30
$( PREFIX) $( FCOMPILERNAME) $( COMPILE) -c prec.f90 -fno-range-check -fall-intrinsics -fno-fast-math $( SUFFIX)
2016-03-22 01:39:45 +05:30
# fno-range-check: Disable range checking on results of simplification of constant expressions during compilation
# --> allows the definition of DAMASK_NaN
#-fall-intrinsics: all intrinsic procedures (including the GNU-specific extensions) are accepted. -Wintrinsics-std will be ignored
# and no user-defined procedure with the same name as any intrinsic will be called except when it is explicitly declared external
# --> allows the use of 'isnan'
#-fno-fast-math:
# --> otherwise, when setting -ffast-math, isnan always evaluates to false (I would call it a bug)
e l s e
2016-03-12 01:29:14 +05:30
prec.o : prec .f 90 \
system_routines.o
2016-03-22 01:39:45 +05:30
e n d i f
2016-03-12 01:29:14 +05:30
2016-03-22 01:39:45 +05:30
system_routines.o : system_routines .f 90 \
C_routines.o
2016-03-12 01:29:14 +05:30
2016-03-22 01:39:45 +05:30
C_routines.o : C_routines .c
2016-03-12 01:29:14 +05:30
2012-03-02 01:04:42 +05:30
%.o : %.f 90
2016-05-05 16:30:46 +05:30
$( PREFIX) $( FCOMPILERNAME) $( COMPILE) -c $< $( SUFFIX)
2012-03-02 01:04:42 +05:30
2016-03-12 01:29:14 +05:30
%.o : %.c
$( CCOMPILERNAME) -c $<
2014-01-24 18:00:27 +05:30
.PHONY : tidy
tidy :
2014-12-03 19:07:04 +05:30
@rm -rf *.o
@rm -rf *.mod
2016-12-08 15:50:51 +05:30
@rm -rf *.optrpt
2015-11-14 15:17:18 +05:30
@rm -rf *.inst.f90 # for instrumentation
@rm -rf *.pomp.f90 # for instrumentation
@rm -rf *.pp.f90 # for instrumentation
2016-08-25 21:30:10 +05:30
@rm -rf *.pdb # for instrumentation
@rm -rf *.opari.inc # for instrumentation
2014-01-15 00:33:41 +05:30
2015-11-14 15:17:18 +05:30
.PHONY : cleanDAMASK
cleanDAMASK :
2014-12-03 19:07:04 +05:30
@rm -rf *.exe
@rm -rf *.marc
2015-11-14 15:17:18 +05:30
@rm -rf *.o
@rm -rf *.mod
2016-12-08 15:50:51 +05:30
@rm -rf *.optrpt
2015-11-13 15:46:35 +05:30
@rm -rf *.inst.f90 # for instrumentation
@rm -rf *.pomp.f90 # for instrumentation
@rm -rf *.pp.f90 # for instrumentation
2015-11-14 15:17:18 +05:30
@rm -rf *.pdb # for instrumentation
@rm -rf *.opari.inc # for instrumentation
2015-01-15 17:05:53 +05:30
.PHONY : help
help :
2015-01-16 16:49:30 +05:30
F90 = " $( F90) "
2016-05-05 16:30:46 +05:30
FCOMPILERNAME = " $( FCOMPILERNAME) "
2015-01-15 17:05:53 +05:30
COMPILEROUT = " $( COMPILEROUT) "