-
Notifications
You must be signed in to change notification settings - Fork 35
/
Make.Microphysics_extern
171 lines (136 loc) · 4.96 KB
/
Make.Microphysics_extern
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# This is the main include makefile for applications that want to use Microphysics
# You should set NETWORK_OUTPUT_PATH before including this file
# For HIP, inlining produces large kernels that seem to cause memory issues
ifeq ($(USE_HIP),TRUE)
EXTRACXXFLAGS += -mllvm -amdgpu-function-calls=true
endif
# for common code paths between simplified-SDC and true-SDC, we'll
# use the SDC define
ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
DEFINES += -DSIMPLIFIED_SDC
DEFINES += -DSDC
USE_ALL_SDC := TRUE
else ifeq ($(USE_TRUE_SDC), TRUE)
DEFINES += -DTRUE_SDC
DEFINES += -DSDC
USE_ALL_SDC := TRUE
else
DEFINES += -DSTRANG
endif
USE_NONAKA_PLOT ?= FALSE
ifeq ($(USE_NONAKA_PLOT),TRUE)
DEFINES += -DNONAKA_PLOT
endif
SCREEN_METHOD ?= screen5
ifeq ($(SCREEN_METHOD), null)
DEFINES += -DSCREEN_METHOD=SCREEN_METHOD_null
else ifeq ($(SCREEN_METHOD), screen5)
DEFINES += -DSCREEN_METHOD=SCREEN_METHOD_screen5
else ifeq ($(SCREEN_METHOD), chugunov2007)
DEFINES += -DSCREEN_METHOD=SCREEN_METHOD_chugunov2007
else ifeq ($(SCREEN_METHOD), chugunov2009)
DEFINES += -DSCREEN_METHOD=SCREEN_METHOD_chugunov2009
else ifeq ($(SCREEN_METHOD), chabrier1998)
DEFINES += -DSCREEN_METHOD=SCREEN_METHOD_chabrier1998
else
$(error Invalid value for SCREEN_METHOD)
endif
ifeq ($(EOS_DIR), gamma_law_general)
override EOS_DIR := gamma_law
$(warning gamma_law_general has been renamed gamma_law)
endif
EOS_PATH := $(MICROPHYSICS_HOME)/EOS/$(strip $(EOS_DIR))
NETWORK_PATH := $(MICROPHYSICS_HOME)/networks/$(strip $(NETWORK_DIR))
ifeq ($(USE_CONDUCTIVITY), TRUE)
CONDUCTIVITY_PATH := $(MICROPHYSICS_HOME)/conductivity/$(strip $(CONDUCTIVITY_DIR))
endif
# Problems can specify the input file for general_null by setting
# GENERAL_NET_INPUTS directly (full path) or just specifying the name
# of the inputs file as NETWORK_INPUTS and let us sort it out
ifndef GENERAL_NET_INPUTS
ifneq "$(wildcard $(NETWORK_INPUTS))" ""
GENERAL_NET_INPUTS := $(NETWORK_INPUTS)
else
GENERAL_NET_INPUTS := $(MICROPHYSICS_HOME)/networks/general_null/$(NETWORK_INPUTS)
endif
endif
# electron capture tables
NET_TABLES = $(wildcard $(NETWORK_PATH)/*_betadecay.dat) $(wildcard $(NETWORK_PATH)/*_electroncapture.dat)
ifneq "$(NET_TABLES)" ""
all: nettables
endif
nettables:
@echo linking network data files...
$(foreach t, $(NET_TABLES), $(shell if [ ! -f `basename $t` ]; then ln -s $(t) . ; fi))
EXTERN_CORE += $(EOS_HOME)
EXTERN_CORE += $(EOS_PATH)
# the helmholtz EOS has an include file -- also add a target to link
# the table into the problem directory.
ifeq ($(findstring helmholtz, $(EOS_DIR)), helmholtz)
all: table
endif
table:
@if [ ! -f helm_table.dat ]; then echo Linking helm_table.dat; ln -s $(EOS_PATH)/helm_table.dat .; fi
# USE_ALL_NSE will be used if any of the NSE techniques is applied
ifeq ($(USE_NSE_TABLE),TRUE)
USE_ALL_NSE := TRUE
endif
ifeq ($(USE_NSE_NET),TRUE)
USE_ALL_NSE := TRUE
endif
# NSE networks need the table
ifeq ($(USE_NSE_TABLE),TRUE)
NSE_TABULAR_HOME ?= $(MICROPHYSICS_HOME)/nse_tabular
EXTERN_CORE += $(NSE_TABULAR_HOME)
all: nsetable
endif
nsetable:
@if [ ! -f $(NSE_TABLE_NAME) ]; then echo Linking $(NSE_TABLE_NAME); ln -s $(NETWORK_PATH)/$(NSE_TABLE_NAME) .; fi
# include the network
EXTERN_CORE += $(NETWORK_PATH)
# Note that this should be located after the include of the EOS and
# Network includes since it has actions that depend on variables set
# there.
EXTERN_CORE += $(MICROPHYSICS_HOME)/EOS
EXTERN_CORE += $(MICROPHYSICS_HOME)/networks
EXTERN_CORE += $(MICROPHYSICS_HOME)/interfaces
# include the conductivity
ifeq ($(USE_CONDUCTIVITY),TRUE)
DEFINES += -DCONDUCTIVITY
EXTERN_CORE += $(CONDUCTIVITY_HOME)
EXTERN_CORE += $(CONDUCTIVITY_PATH)
endif
ifeq ($(USE_RAD), TRUE)
ifeq ($(Opacity_dir), null)
$(error The null opacity directory has been removed, please update to rad_power_law)
endif
EXTERN_CORE += $(MICROPHYSICS_HOME)/opacity
OPAC_PATH := $(MICROPHYSICS_HOME)/opacity/$(Opacity_dir)
EXTERN_CORE += $(OPAC_PATH)
endif
# fundamental constants
EXTERN_CORE += $(MICROPHYSICS_HOME)/constants
# self-consistent NSE solver for a network
ifeq ($(USE_NSE_NET), TRUE)
DEFINES += -DNSE_NET
DEFINES += -DNSE
EXTERN_CORE += $(MICROPHYSICS_HOME)/nse_solver
EXTERN_CORE += $(MICROPHYSICS_HOME)/util/hybrj
endif
EXTERN_CORE += $(MICROPHYSICS_HOME)/util/approx_math
# we can't have both NSE solvers
ifeq ($(USE_NSE_TABLE), TRUE)
ifeq ($(USE_NSE_NET), TRUE)
$(error USE_NSE_TABLE and USE_NSE_NET cannot be used together)
endif
endif
# Only allow null chabrier1998 screening with NSE_NET
ifeq ($(USE_NSE_NET),TRUE)
ifneq ($(or $(filter-out null chabrier1998,$(SCREEN_METHOD)),),)
$(error USE_NSE_NET can only be used with null or chabrier1998 screening)
endif
endif
clean::
@if [ -L helm_table.dat ]; then rm -f helm_table.dat; fi
@if [ -L reaclib_rate_metadata.dat ]; then rm -f reaclib_rate_metadata.dat; fi
$(foreach t, $(wildcard *_betadecay.dat *_electroncapture.dat nse*.tbl), $(shell if [ -L $t ]; then rm -f $t; fi))