-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmodel_run.sh
executable file
·49 lines (41 loc) · 1.07 KB
/
model_run.sh
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
#!/bin/bash
# This is the script which controls the simulated annealing routine.
# It takes one parameter, -o (either true or false) indicating if
# you want to run the optimization or just the model using existing paramters.
# model setup directory
script_dir=`pwd`
usage() {
echo "Usage: $0 [ -o optimize: true or false ]" 1>&2
exit 1
}
while getopts ":o:" options; do
case "${options}" in
o) optimize=${OPTARG};;
*) usage;;
esac
done
# remove old files if they exist
files="phenograss *.mod *.txt "
for i in $files;
do
if [ -a $i ]; then
rm $i
fi
done
# fresh compile code
gfortran -ffree-form \
-ffree-line-length-200 \
-g func.f90 inc.f90 phenograss.f90 sann.f90 main.f90 \
-o phenograss
# select routine
if [ "$optimize" == "true" ];then
# run the optimization routine
# full parameter output is stored in
# summarizing_parameters.txt in the main
# directory, either pick the last ones or
# do weighted scheme
./phenograss ./parameters/sites.txt o
else
# run the model
./phenograss ./parameters/sites.txt r
fi