-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.csh
395 lines (286 loc) · 11.4 KB
/
config.csh
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
#!/bin/csh
rm -f Makefile >& /dev/null
######
###### QUESTION #1
######
echo "################################################################################"
echo "Do you want a diatomic (diat) fit, a triatomic (triat) or tetratomic (tetra) ?"
echo "################################################################################"
set MOL=$<
if ( $MOL == "diat" ) then
# echo "diatomic"
else if ( $MOL == "triat" ) then
# echo "triatomic"
else if ( $MOL == "tetra" ) then
# echo "tetratomic"
else
echo "Please, provide a valid parameter: "diat" for diatomics, "triat" for triatomics or "tetra" for tetratomics"
exit
endif
######
###### QUESTION #2
######
echo "################################################################################"
echo "gfortran is used by default. Do you agree ? [y/n]"
echo "################################################################################"
set COMPTYP=$<
if ( $COMPTYP == "y" ) then
set FC="gfortran"
set CFLAGS="-g -O3"
#
# set CFLAGS="-g -O3 -Wall -Wextra -pedantic -fimplicit-none -fcheck=all -fbacktrace" # for debug
#
set LDFLAGS="-g"
else if ( $COMPTYP == "n" ) then
set FC="XXX"
set CFLAGS="XXX"
set LDFLAGS="XXX"
echo "Please, configure latter the Makefile with your compiler options"
else
echo "Please, provide a proper answer: yes (y) or no (n)"
exit
endif
######
###### QUESTION #3
######
echo "################################################################################"
echo "Is a basis set calibration (bas) planned, a polynomial fit (pol) or a direct fit (dirfit)?"
echo "################################################################################"
set JOB=$<
if ( $JOB == "bas" ) then
else if ( $JOB == "pol" ) then
else if ( $JOB == "dirfit" ) then
else
echo "Please, provide a proper answer: "bas" for basis set calibration, "pol" for polynomial fit or "dirfit" for direct fit"
exit
endif
######
###### QUESTION #4
######
echo "################################################################################"
echo "Are additional subroutines to be included into the program ? [y/n]"
echo "################################################################################"
set ADDSUB=$<
if ( $ADDSUB == "y" ) then
echo "################################################################################"
echo "If yes, specify its name, e.g., XXX.f or XXX.f90"
echo "################################################################################"
set ADDSUBNAME=$<
if ($ADDSUBNAME:e == "f" || $ADDSUBNAME:e == "f90" || $ADDSUBNAME:e == "c") then
else
echo "Please, provide a valid name for the additional module, e.g., XXX.f or XXX.f90"
exit
endif
if (-e $ADDSUBNAME) then
else
echo "Please, check if this module is in this directory"
exit
exit
endif
else if ( $ADDSUB == "n" ) then
set ADDSUBNAME=" "
else
echo "Please, provide a proper answer: yes (y) or no (n)"
exit
endif
######
###### LOCATING MODULES
######
set i = 0
set ARGVFILE = (`seq 1 1 23`)
set DIRFILE = (`seq 1 1 23`)
foreach FILE (MODULE_COMMON_VAR.f90 MAIN.f90 READING.f90 TOFIT.f90 LSFIT.f90 LMDIF.f CHIPR_DIAT.f90 CHIPR_TRIAT.f90 CHIPR_TETRA.f90 BASIS_SET.f90 WEIGHT_FUNC.f90 SUM2BD.f90 SUM23BD.f90 FINAL_ANALYSIS.f90 PROP_DIAT.f90 PROP_TRIAT.f90 PROP_TETRA.f90 STRAT_RMSD.f90 SA.f HARM_VIB_SA.f90 DIRECT_FIT.f90 LEVEL.f $ADDSUBNAME)
@ i = $i + 1
set ARGVFILE[$i] = $FILE
#echo "$ARGVFILE[$i]"
if ( -e $ARGVFILE[$i] ) then
echo "################################################################################"
echo "$ARGVFILE[$i] will be set as the one contained in this directory"
echo "################################################################################"
set DIRFILE[$i] = "./$ARGVFILE[$i]:r"
# echo "$DIRFILE[$i]"
else if ( ! -e $ARGVFILE[$i] ) then
set DIRFILE[$i] = "../CHIPR-4.0_SOURCE_CODE/$ARGVFILE[$i]:r"
# echo "$DIRFILE[$i]"
endif
end
echo ""
if ($JOB == "bas" && $MOL == "diat") then
echo "################################################################################"
echo "Please, make sure that you have in this directory the following files"
echo "################################################################################"
echo "1). coeffs_guess.txt"
echo "2). PLOT_BASIS_OPT_CHIPR_DIAT.gnu"
# echo "3). Any additional subroutine, e.g., XXX.f90, you want to include or replace locally with any one contained in ../#CHIPR-4.0_SOURCE_CODE"
else if ($JOB == "pol" && $MOL == "diat") then
echo "################################################################################"
echo "Please, make sure that you have in this directory the following files"
echo "################################################################################"
echo "1). coeffs_guess.txt"
echo "2). abinitio_data.txt"
echo "3). mol_gm_guess.txt"
echo "4). PLOT_POL_OPT_CHIPR_DIATOM.gnu"
echo "5). "WEIGHT_FUNC.f90" if you want to set weights automatically"
# echo "6). Any additional subroutine, e.g., XXX.f90, you want to include or replace locally with any one contained in ../#CHIPR-4.0_SOURCE_CODE"
else if ($JOB == "dirfit" && $MOL == "diat") then
echo "################################################################################"
echo "Please, make sure that you have in this directory the following files"
echo "################################################################################"
echo "1). coeffs_guess.txt"
echo "2). abinitio_data.txt"
echo "3). mol_gm_guess.txt"
echo "4). spec_data.txt"
echo "5). PLOT_POL_OPT_CHIPR_DIATOM.gnu"
echo "6). "WEIGHT_FUNC.f90" if you want to set weights automatically"
# echo "7). Any additional subroutine, e.g., XXX.f90, you want to include or replace locally with any one contained in ../#CHIPR-4.0_SOURCE_CODE"
else if ($JOB == "bas" && $MOL == "triat") then
echo "################################################################################"
echo "Please, make sure that you have in this directory the following files"
echo "################################################################################"
echo "1). coeffs_guess.txt"
echo "2). PLOT_BASIS_OPT_CHIPR_TRIAT.gnu"
echo "3). "SUM2BD.f90""
echo "4). Any additional subroutine, e.g., XXX.f90, you want to include or replace locally with any one contained in ../CHIPR-4.0_SOURCE_CODE"
else if ($JOB == "pol" && $MOL == "triat") then
echo "################################################################################"
echo "Please, make sure that you have in this directory the following files"
echo "################################################################################"
echo "1). coeffs_guess.txt"
echo "2). abinitio_data.txt"
echo "3). mol_gm_guess.txt"
echo "4). PLOT_POL_OPT_CHIPR_TRIATOM.gnu"
echo "5). "SUM2BD.f90""
echo "6). "WEIGHT_FUNC.f90" if you want to set weights automatically"
echo "7). Any additional subroutine, e.g., XXX.f90, you want to include or replace locally with any one contained in ../CHIPR-4.0_SOURCE_CODE"
else if ($JOB == "bas" && $MOL == "tetra") then
echo "################################################################################"
echo "Please, make sure that you have in this directory the following files"
echo "################################################################################"
echo "1). coeffs_guess.txt"
echo "2). PLOT_BASIS_OPT_CHIPR_TETRA.gnu"
echo "3). "SUM23BD.f90""
echo "4). Any additional subroutine, e.g., XXX.f90, you want to include or replace locally with any one contained in ../CHIPR-4.0_SOURCE_CODE"
else if ($JOB == "pol" && $MOL == "tetra") then
echo "################################################################################"
echo "Make sure that you have in this directory the following files"
echo "################################################################################"
echo "1). coeffs_guess.txt"
echo "2). abinitio_data.txt"
echo "3). mol_gm_guess.txt"
echo "4). PLOT_POL_OPT_CHIPR_TETRA.gnu"
echo "5). "SUM23BD.f90""
echo "6). "WEIGHT_FUNC.f90" if you want to set weights automatically"
echo "7). Any additional subroutine, e.g., XXX.f90, you want to include or replace locally with any one contained in ../CHIPR-4.0_SOURCE_CODE"
endif
echo ""
echo "################################################################################"
echo "Read to compile..."
echo "################################################################################"
echo "First, take a look in the Makefile so generated."
echo "If it is OK, then proceed to the compilation by typing the commands:"
echo "1). make"
echo "2). make clean"
echo "################################################################################"
echo "################################################################################"
cat << EOF > Makefile
FC=$FC
CFLAGS=$CFLAGS
LDFLAGS=$LDFLAGS
OBJS= $ARGVFILE[1]:r.o \
$ARGVFILE[2]:r.o \
$ARGVFILE[3]:r.o \
$ARGVFILE[4]:r.o \
$ARGVFILE[5]:r.o \
$ARGVFILE[6]:r.o \
$ARGVFILE[7]:r.o \
$ARGVFILE[8]:r.o \
$ARGVFILE[9]:r.o \
$ARGVFILE[10]:r.o \
$ARGVFILE[11]:r.o \
$ARGVFILE[12]:r.o \
$ARGVFILE[13]:r.o \
$ARGVFILE[14]:r.o \
$ARGVFILE[15]:r.o \
$ARGVFILE[16]:r.o \
$ARGVFILE[17]:r.o \
$ARGVFILE[18]:r.o \
$ARGVFILE[19]:r.o \
$ARGVFILE[20]:r.o \
$ARGVFILE[21]:r.o \
$ARGVFILE[22]:r.o \
EOF
if ( $ADDSUB == "y" ) then
echo " $ARGVFILE[23]" >> Makefile
endif
cat << EOF >> Makefile
CHIPR.x : \$(OBJS)
\$(FC) \$(LDFLAGS) \$(OBJS) -o \$@
MODULE_COMMON_VAR.o : $DIRFILE[1].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[1].f90
MAIN.o : $DIRFILE[2].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[2].f90
READING.o : $DIRFILE[3].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[3].f90
TOFIT.o :: $DIRFILE[4].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[4].f90
LSFIT.o :: $DIRFILE[5].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[5].f90
LMDIF.o : $DIRFILE[6].f
\$(FC) \$(CFLAGS) -c $DIRFILE[6].f
CHIPR_DIAT.o :: $DIRFILE[7].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[7].f90
CHIPR_TRIAT.o :: $DIRFILE[8].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[8].f90
CHIPR_TETRA.o :: $DIRFILE[9].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[9].f90
BASIS_SET.o : $DIRFILE[10].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[10].f90
WEIGHT_FUNC.o : $DIRFILE[11].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[11].f90
SUM2BD.o :: $DIRFILE[12].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[12].f90
SUM23BD.o :: $DIRFILE[13].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[13].f90
FINAL_ANALYSIS.o :: $DIRFILE[14].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[14].f90
PROP_DIAT.o : $DIRFILE[15].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[15].f90
PROP_TRIAT.o : $DIRFILE[16].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[16].f90
PROP_TETRA.o : $DIRFILE[17].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[17].f90
STRAT_RMSD.o : $DIRFILE[18].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[18].f90
SA.o : $DIRFILE[19].f
\$(FC) \$(CFLAGS) -c $DIRFILE[19].f
HARM_VIB_SA.o : $DIRFILE[20].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[20].f90
DIRECT_FIT.o : $DIRFILE[21].f90
\$(FC) \$(CFLAGS) -c $DIRFILE[21].f90
LEVEL.o : $DIRFILE[22].f
\$(FC) \$(CFLAGS) -c $DIRFILE[22].f
clean :
rm $ARGVFILE[1]:r.o \
$ARGVFILE[2]:r.o \
$ARGVFILE[3]:r.o \
$ARGVFILE[4]:r.o \
$ARGVFILE[5]:r.o \
$ARGVFILE[6]:r.o \
$ARGVFILE[7]:r.o \
$ARGVFILE[8]:r.o \
$ARGVFILE[9]:r.o \
$ARGVFILE[10]:r.o \
$ARGVFILE[11]:r.o \
$ARGVFILE[12]:r.o \
$ARGVFILE[13]:r.o \
$ARGVFILE[14]:r.o \
$ARGVFILE[15]:r.o \
$ARGVFILE[16]:r.o \
$ARGVFILE[17]:r.o \
$ARGVFILE[18]:r.o \
$ARGVFILE[19]:r.o \
$ARGVFILE[20]:r.o \
$ARGVFILE[21]:r.o \
$ARGVFILE[22]:r.o
EOF
exit