-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exec_TDOF
executable file
·69 lines (55 loc) · 1.45 KB
/
Exec_TDOF
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
#!/bin/bash
#FILE: Exec_TDOF
#DATE: 16 SEP 2020
#AUTH: G. E. Deschaines
#DESC: Execute ./bin/TDOF.exe with specified namelist file.
function remove_geoc_symlink() {
if [ -h ./TDOF_geoc.dat ]
then
rm -f ./TDOF_geoc.dat
fi
}
# Check command line parameter
if [ $# -lt 1 ]
then
echo "usage: Exec_TDOF name"
echo "where: name - name of input namelist .txt file."
exit -1
fi
name=$1
# Check if TDOF executable exists.
if [ ! -e ./bin/TDOF.exe ]
then
echo "error: executable ./bin/TDOF.exe does not exist."
echo " Create in ./bin subdirectory with gfortran"
echo " as shown in following command expression."
echo " "
echo " gfortran -std=legacy -w -o ./bin/TDOF.exe ./src/TDOF.f"
exit -2
fi
# Check if input namelist file exists.
ifile="./txt/${name}.txt"
if [ ! -e ${ifile} ]
then
echo "error: namelist file ${ifile} does not exist."
exit -2
fi
# Assemble standard output & geodesy data filenames.
ofile="./out/TDOF_${name}.out"
dfile="./dat/TDOF_geoc_${name}.dat"
# Remove previous symbolic link ./TDOF_geoc.dat (if it
# exists) and create symbolic link to specified geodesy
# data file as ./TDOF_geoc.dat.
if [ ! -e ${dfile} ]
then
touch ${dfile}
fi
remove_geoc_symlink
ln -s ${dfile} ./TDOF_geoc.dat
# Initiate execution of TDOF.
./bin/TDOF.exe <${ifile} >${ofile}
echo "Standard output written to ${ofile}"
echo "Geodesy output data written to ${dfile}"
# Remove symbolic link.
remove_geoc_symlink
exit 0