forked from AMReX-Astro/Microphysics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Make.Microphysics_extern
145 lines (115 loc) · 4.13 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
# This is the main include makefile for applications that want to use Microphysics
# You should set NETWORK_OUTPUT_PATH before including this file
ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
DEFINES += -DSIMPLIFIED_SDC
else ifeq ($(USE_TRUE_SDC), TRUE)
DEFINES += -DTRUE_SDC
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=0
else ifeq ($(SCREEN_METHOD), screen5)
DEFINES += -DSCREEN_METHOD=1
else ifeq ($(SCREEN_METHOD), chugunov2007)
DEFINES += -DSCREEN_METHOD=2
else ifeq ($(SCREEN_METHOD), chugunov2009)
DEFINES += -DSCREEN_METHOD=3
else ifeq ($(SCREEN_METHOD), chabrier1998)
DEFINES += -DSCREEN_METHOD=4
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
# NSE networks need the table
ifeq ($(USE_NSE_TABLE),TRUE)
NSE_TABULAR_HOME ?= $(MICROPHYSICS_HOME)/nse_tabular
EXTERN_CORE += $(NSE_TABULAR_HOME)
ifeq ($(findstring aprox19, $(NETWORK_DIR)), aprox19)
all: nsetable
endif
endif
nsetable:
@if [ ! -f nse.tbl ]; then echo Linking nse.tbl; ln -s $(NETWORK_PATH)/nse.tbl .; 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
# 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
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
@if [ ! -f nse19.tbl ]; then rm -f nse19.tbl; fi
$(foreach t, $(NET_TABLES), $(shell if [ ! -L `basename $t` ]; then rm -f `basename $t` ; fi))