-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.test
206 lines (164 loc) · 6.57 KB
/
Makefile.test
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
#^CFG FILE TESTING
### TESTS FOR THE STAND-ALONE GITM ###
TIMINGFILE =./.test_file_timing.txt
STARTTIME =rm $(TIMINGFILE); date +%s |xargs printf >$(TIMINGFILE);printf "*-1+">>$(TIMINGFILE);
ENDTIME = date +%s >>$(TIMINGFILE); cat $(TIMINGFILE) | bc;
timing:
-@if([ "${TIMING}" ]); then $(STARTTIME) fi
-@if([ "${TIMING}" ]); then $(ENDTIME) fi
test:
echo "Tests do not work currently"
@rm -f *.diff
-@($(MAKE) test_gitm_earth)
-@($(MAKE) test_gitm_mars)
@ls -l *.diff
# All tests are done in this directory:
TESTDIR = run_test
# Reference solution is put into this directory when needed:
REFDIR = run_test_ref
test_help:
@echo " test (run all tests)"
@echo " test KEEP=y (run tests and keep run directories)"
@echo " test MPIRUN= (run tests serially)"
@echo " test NPFLAG=-n NP=3 (run tests with ${PARALLEL} -n 3)"
@echo " test PARALLEL='ibrun' (run tests with ibrun)"
@echo " test_gitm_earth (run Earth GITM test)"
@echo " test_gitm_mars (run Mars GITM test)"
test_rundir:
rm -rf ${TESTDIR}
$(MAKE) rundir RUNDIR=${TESTDIR} STANDALONE=YES
### EARTH GITM TEST ###
test_gitm_earth:
# $(MAKE) test_gitm_earth_1d
# $(MAKE) test_gitm_earth_eclipse
# $(MAKE) test_gitm_earth_3d
test_gitm_earth_1d:
@echo "test_gitm_earth_1d_compile..." > test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_compile
@echo "test_gitm_earth_1d_rundir..." >> test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_rundir
@echo "test_gitm_earth_1d_run..." >> test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_run
@echo "test_gitm_earth_1d_check..." >> test_gitm_earth_1d.diff
$(MAKE) test_gitm_earth_1d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi
test_gitm_earth_eclipse:
@echo "test_gitm_earth_eclipse_compile..." > test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_compile
@echo "test_gitm_earth_eclipse_rundir..." >> test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_rundir
@echo "test_gitm_earth_eclipse_run..." >> test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_run
@echo "test_gitm_earth_eclipse_check..." >> test_gitm_earth_eclipse.diff
$(MAKE) test_gitm_earth_eclipse_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi
test_gitm_earth_3d:
@echo "test_gitm_earth_3d_compile..." > test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_compile
@echo "test_gitm_earth_3d_rundir..." >> test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_rundir
@echo "test_gitm_earth_3d_run..." >> test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_run
@echo "test_gitm_earth_3d_check..." >> test_gitm_earth_3d.diff
$(MAKE) test_gitm_earth_3d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi
# ----------------------------------------------------
# 1D tests
# ----------------------------------------------------
# Plain 1D
test_gitm_earth_1d_compile:
./Config.pl -Earth -g=1,1,50,4
$(MAKE) GITM
test_gitm_earth_1d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.in.1d ./UAM.in
test_gitm_earth_1d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 1 ./GITM.exe > runlog_earth_1d
test_gitm_earth_1d_check:
@(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000004.1d.dat \
> test_gitm_earth_1d.diff)
ls -l test_gitm_earth_1d.diff
# Eclipse 1D
test_gitm_earth_eclipse_compile:
./Config.pl -Earth -g=1,1,50,4
$(MAKE) GITM
test_gitm_earth_eclipse_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.in.eclipse ./UAM.in
test_gitm_earth_eclipse_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 1 ./GITM.exe > runlog_earth_eclipse
test_gitm_earth_eclipse_check:
@(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000002.eclipse.dat \
> test_gitm_earth_eclipse.diff)
ls -l test_gitm_earth_eclipse.diff
# ----------------------------------------------------
# 3D tests
# ----------------------------------------------------
test_gitm_earth_3d_compile:
./Config.pl -Earth -g=9,9,50,4
$(MAKE) GITM
test_gitm_earth_3d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.in.3d ./UAM.in
test_gitm_earth_3d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 4 ./GITM.exe
test_gitm_earth_3d_check:
(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log00000002.dat ${TESTDIR}/UA/DataIn/log00000002.3d.dat \
> test_gitm_earth_3d.diff)
ls -l test_gitm_earth_3d.diff
### MARS GITM TEST ###
test_gitm_mars:
# make test_gitm_mars_1d
make test_gitm_mars_3d
test_gitm_mars_1d:
@echo "test_gitm_mars_1d_compile..." > test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_compile
@echo "test_gitm_mars_1d_rundir..." >> test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_rundir
@echo "test_gitm_mars_1d_run..." >> test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_run
@echo "test_gitm_mars_1d_check..." >> test_gitm_mars_1d.diff
$(MAKE) test_gitm_mars_1d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi
test_gitm_mars_3d:
@echo "test_gitm_mars_3d_compile..." > test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_compile
@echo "test_gitm_mars_3d_rundir..." >> test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_rundir
@echo "test_gitm_mars_3d_run..." >> test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_run
@echo "test_gitm_mars_3d_check..." >> test_gitm_mars_3d.diff
$(MAKE) test_gitm_mars_3d_check
@if([ "${KEEP}" ]); then rm -rf run_$@; mv ${TESTDIR} run_$@; fi
# ----------------------------------------------------
# 1D tests
# ----------------------------------------------------
test_gitm_mars_1d_compile:
./Config.pl -Mars
./Config.pl -g=1,1,120,4
$(MAKE) GITM
test_gitm_mars_1d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.mars.in.1d ./UAM.in
test_gitm_mars_1d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 1 ./GITM.exe > runlog_mars_1d
test_gitm_mars_1d_check:
@(${SCRIPTDIR}/DiffNum.pl -b -r=1e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000002.1d.dat.mars \
> test_gitm_mars_1d.diff)
ls -l test_gitm_mars_1d.diff
# ----------------------------------------------------
# 3D tests
# ----------------------------------------------------
test_gitm_mars_3d_compile:
./Config.pl -Mars
./Config.pl -g=8,4,120,4
$(MAKE) GITM
test_gitm_mars_3d_rundir: test_rundir
cd ${TESTDIR}; cp UA/DataIn/UAM.mars.in.3d ./UAM.in
test_gitm_mars_3d_run:
cd ${TESTDIR}; ${PARALLEL} ${NPFLAG} 4 ./GITM.exe > runlog_mars_3d
test_gitm_mars_3d_check:
(${SCRIPTDIR}/DiffNum.pl -b -r=2e-5 \
${TESTDIR}/UA/data/log0000000?.dat ${TESTDIR}/UA/DataIn/log00000002.3d.dat.mars \
> test_gitm_mars_3d.diff)
ls -l test_gitm_mars_3d.diff