-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
271 lines (225 loc) · 7.36 KB
/
Makefile
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
default : GITM
include Makefile.def
ABDIR = srcSphereAB
EIEDIR = ${EMPIRICALIEDIR}
EUADIR = ${EMPIRICALUADIR}
IODIR = ${DATAREADINDICESDIR}
MAINDIR = src
GLDIR = srcGlow
SAMIDIR = srcSAMI
PLANET=earth
src/ModSize.f90:
cp src/ModSize.f90.orig src/ModSize.f90
INSTALLFILES = src/Makefile.DEPEND \
src/Makefile.RULES \
srcInterface/Makefile.DEPEND
install: src/ModSize.f90
touch ${INSTALLFILES}
# cd src; make DYNAMIC
#
# General Housekeeping
#
NOMPI:
@echo "will make NOMPI"
@echo ${NOMPIDIR}
@cd ${NOMPIDIR}; make LIB
GITM:
@cd ${SHAREDIR}; make LIB
@cd $(ABDIR); make LIB
@cd $(EIEDIR); make LIB
@cd ${EUADIR}; make LIB
@cd $(IODIR); make LIB
@cd $(GLDIR); make LIB
@cd $(MAINDIR); make GITM
SAMI:
@cd ${SHAREDIR}; make LIB MEM=-mcmodel=large
@cd $(ABDIR); make LIB MEM=-mcmodel=large
@cd $(EIEDIR); make LIB MEM=-mcmodel=large
@cd ${EUADIR}; make LIB MEM=-mcmodel=large
@cd $(IODIR); make LIB MEM=-mcmodel=large
@cd $(GLDIR); make LIB MEM=-mcmodel=large
@cd $(SAMIDIR); make LIB MEM=-mcmodel=large
@cd $(MAINDIR); make SAMI MEM=-mcmodel=large
POST:
@cd $(MAINDIR); make POST
GITM = ${DIR}/UA/GITM
LIB:
cd $(ABDIR) ; make LIB
cd $(GLDIR) ; make LIBPREV=${GITM}/${ABDIR}/libSphere.a LIBADD
cd $(MAINDIR) ; make LIBPREV=${GITM}/${GLDIR}/libUPTOGL.a libGITM.a
cd srcInterface ; make LIBPREV=${GITM}/${MAINDIR}/libUA.a LIB
nompirun:
make GITM
cd ${RUNDIR}; ./GITM.exe
clean:
@touch ${INSTALLFILES}
cd $(ABDIR); make clean
cd $(MAINDIR); make clean
cd $(GLDIR); make clean
cd srcInterface; make clean
if [ -d share ]; then cd share; make cleanall; fi;
if [ -d util ]; then cd util; make cleanall; fi;
if [ -d srcSAMI ]; then cd srcSAMI; make clean; fi;
distclean:
./Config.pl -uninstall
allclean:
@touch ${INSTALLFILES}
@cd $(ABDIR); make clean
@cd $(MAINDIR); make distclean
@cd srcInterface;make distclean
rm -f *~ srcData/UAM.in
# If util and share were moved because of GITM being
# used in SWMF component mode, put them back.
if [ -d component_util]; then mv component_util util; fi
if [ -d component_share]; then mv component_share share; fi
#
# Create run directories
#
rundir:
@echo ${RUNDIR}
mkdir -p ${RUNDIR}/UA
if [ -d srcSAMI ]; then \
mkdir -p ${RUNDIR}/PS; \
cd ${RUNDIR}/PS; \
mkdir restartOUT output; \
ln -s restartOUT restartIN; \
ln -s ${UADIR}/srcSAMI/srcInputs ./input; \
fi
cd ${RUNDIR}; \
if [ ! -e "EIE/README" ]; then \
ln -s ${EMPIRICALIEDIR}/data EIE;\
fi;
cd ${RUNDIR}; rm -f ./PostGITM.exe ; ln -s ${UADIR}/src/PostProcess.exe ./PostGITM.exe
cd ${RUNDIR}/UA; \
mkdir restartOUT data DataIn; \
ln -s restartOUT restartIN; \
ln -s ${UADIR}/src/pGITM .; \
ln -s ${UADIR}/srcData/* DataIn; rm -f DataIn/CVS; \
ln -s ${UADIR}/data/* DataIn; rm -f DataIn/CVS
cd ${RUNDIR} ; \
if [ -e ${BINDIR}/GITM.exe ]; then \
ln -s ${BINDIR}/GITM.exe . ; \
cp UA/DataIn/UAM.in . ; \
fi
cd ${RUNDIR} ; \
if [ -e ${BINDIR}/GITMSAMI.exe ]; then \
ln -s ${BINDIR}/GITMSAMI.exe . ; \
cp UA/DataIn/UAM.in.Sami3Couple ./UAM.in ; \
cp PS/input/sami3-2.20.namelist.GitmCouple ./sami3-2.20.namelist ; \
fi
cd ${RUNDIR} ; \
touch core ; chmod 444 core ; \
ln -s UA/* .
TESTDIR = run_test
MPIRUN = mpirun -np 2
test:
echo "GITM is not tested nightly" > notest.diff
test_ignored:
-@(make test_earth)
-@(make test_mars)
ls -l *.diff
test_earth:
@echo "test_earth_compile..." > test_earth.diff
make test_earth_compile
@echo "test_earth_rundir..." >> test_earth.diff
make test_earth_rundir
@echo "test_earth_run..." >> test_earth.diff
make test_earth_run
@echo "test_earth_check..." >> test_earth.diff
make test_earth_check
test_earth_compile:
./Config.pl -Earth
./Config.pl -g=9,9,50,4
make GITM
test_earth_rundir:
rm -rf ${TESTDIR}
make rundir RUNDIR=${TESTDIR} STANDALONE=YES UADIR=`pwd`
cd ${TESTDIR}; cp UA/DataIn/UAM.in.test.noAPEX UAM.in
test_earth_run:
cd ${TESTDIR}; ${MPIRUN} ./GITM.exe > runlog
test_earth_check:
-(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat \
srcData/log00000002.dat.noAPEX >& test_earth.diff)
ls -l test_earth.diff
#-----------------------------------------------------------------------------
# AGB: Two tests to verify GITM compilation with RCMR data assimilation.
# One tests whether compilation occured correctly by comparing the logfile
# after a low-resolution, 5 minute run. The second runs a longer test
# case to ensure that the RCMR routine is behaving as expected.
# Test proper RCMR compilation. Test was run on Earth.
test_rcmr_quick:
@echo "test_earth_compile..." > test_rcmr_quick.diff
make test_earth_compile
@echo "test_rcmr_quick_rundir..." >> test_rcmr_quick.diff
make test_rcmr_quick_rundir
@echo "test_rcmr_quick_run..." >> test_rcmr_quick.diff
make test_rcmr_quick_run
@echo "test_rcmr_quick_check..." >> test_rcmr_quick.diff
make test_rcmr_quick_check
test_rcmr_quick_rundir:
rm -rf ${TESTDIR}
make rundir RUNDIR=${TESTDIR} STANDALONE=YES UADIR=`pwd`
cp ${TESTDIR}/UA/DataIn/UAM.in.test.rcmr_quick ${TESTDIR}/UAM.in
cp ${TESTDIR}/UA/DataIn/grace.test.rcmr_quick ${TESTDIR}/grace.dat
cp ${TESTDIR}/UA/DataIn/champ.test.rcmr_quick ${TESTDIR}/champ.dat
cp ${TESTDIR}/UA/DataIn/power.test.rcmr_quick ${TESTDIR}/power.dat
cp ${TESTDIR}/UA/DataIn/imf.test.rcmr_quick ${TESTDIR}/imf.dat
test_rcmr_quick_run:
cd ${TESTDIR}; ${MPIRUN} ./GITM.exe > runlog
test_rcmr_quick_check:
-(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat \
srcData/log00000002.dat.rcmr_quick >& test_rcmr_quick.diff)
ls -l test_rcmr_quick.diff
# End RCMR tests
test_mars:
@echo "test_mars_compile..." > test_mars.diff
make test_mars_compile
@echo "test_mars_rundir..." >> test_mars.diff
make test_mars_rundir
@echo "test_mars_run..." >> test_mars.diff
make test_mars_run
@echo "test_mars_check..." >> test_mars.diff
make test_mars_check
test_mars_compile:
./Config.pl -Mars
./Config.pl -g=1,1,90,1
make GITM
test_mars_rundir:
rm -rf ${TESTDIR}
make rundir RUNDIR=${TESTDIR} STANDALONE=YES UADIR=`pwd`
cd ${TESTDIR}; cp UA/DataIn/UAM.in.Mars UAM.in
test_mars_run:
cd ${TESTDIR}; ${MPIRUN} ./GITM.exe > runlog
test_mars_check:
-(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat \
srcData/log00000002.dat.Mars >& test_mars.diff)
ls -l test_mars.diff
# DSO: Test to run HIME
test_hime:
@echo "test_hime_compile..." > test_hime.diff
make test_hime_compile
@echo "test_hime_rundir..." >> test_hime.diff
make test_hime_rundir
@echo "test_hime_run..." >> test_hime.diff
make test_hime_run
test_hime_compile:
./Config.pl -Earth
./Config.pl -g=9,9,50,1
make GITM
test_hime_rundir:
rm -rf ${TESTDIR}
make rundir RUNDIR=${TESTDIR} STANDALONE=YES UADIR=`pwd`
mkdir ${TESTDIR}/inputs
cp srcData/UAM.in.hime ${TESTDIR}/UAM.in
cp srcData/HIME/b20170302_0626UTto0629UT_sample.npfisr ${TESTDIR}/inputs/
cp srcData/HIME/imf20170302.dat ${TESTDIR}/inputs/
test_hime_run:
cd ${TESTDIR}; ${MPIRUN} ./GITM.exe > runlog
dist:
make distclean
tar cvzf gitm_`date "+%y%m%d"`.tgz Makefile* Config.pl get_info.pl \
share util src srcData srcDoc srcGlow srcIDL srcInterface \
srcPython srcMake srcSphereAB srcUser Copyright