forked from geodynamics/hc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_spectral_model
executable file
·48 lines (35 loc) · 943 Bytes
/
plot_spectral_model
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
#!/bin/bash
#
# plot an HC model run based on the spectral data in
# binary format sol.bin
#
layer=${1--1}
ifile=${2-sol.bin}
runcode=${3-0} # run HC?
pmode=2
rm vec_?.ps vec_?.grd spectral.v?.grd 2> /dev/null
if [ $runcode -eq 1 ];then # run the code anew?
rm $ifile
hc
fi
if [ ! -s $ifile ];then
echo $0: error, $ifile does not exist
exit
fi
# radial
hc_extract_sh_layer $ifile $layer 1 | \
gawk '{if(NR==1)print($1);else print($0)}'| \
shsyn 1 0 spectral.vr
# pol/tor
hc_extract_sh_layer $ifile $layer 2 | \
gawk '{if(NR==1)print($1);else print($0)}'| shsyn 1 1 3
mv vec_p.grd spectral.vp.grd
mv vec_t.grd spectral.vt.grd
# plot
for f in vr vt vp ;do
grd2map2 spectral.$f xx $f 2> /dev/null
done
epsmerge -par --print --postscript --orientation Portrait -x 1 -y 3 \
spectral.vr.ps spectral.vp.ps spectral.vt.ps \
> spectral.vec.ps 2> /dev/null
echo $0: output in spectral.vec.ps