commit 0977c09b1cb03d622dfef2f4bd1b4ddf320dc134
parent 9a39fad954d80c80431d784c3be874ac9d09ab59
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 7 Jul 2019 09:29:02 +0200
Add awk script to extract depth of max deformation
Diffstat:
3 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/fig2/Makefile b/fig2/Makefile
@@ -18,7 +18,22 @@ timeseries.txt: sim.output00000.txt
tail -n 1 "$$f" | cut -f2- >> $@; \
done'
-../$(FIG).pdf: fig.gp timeseries.txt
+max_strainrate_depth.txt: sim.output00000.txt
+ /bin/sh -c '\
+ for f in sim.output*.txt; do \
+ awk " \
+ BEGIN{getline;depth=max=-1} \
+ NF{ \
+ if (\$$6 >= max) \
+ { \
+ max=\$$6; \
+ depth=\$$1; \
+ } \
+ } \
+ END{print depth,\"\t\",max}" "$$f" >> $@; \
+ done'
+
+../$(FIG).pdf: fig.gp timeseries.txt max_strainrate_depth.txt
gnuplot $< > $@
clean:
diff --git a/fig2/fig.gp b/fig2/fig.gp
@@ -8,7 +8,7 @@ set terminal pdfcairo color size 7.5 cm, 8.0 cm
# set key top left #samplen 0.9
-set multiplot layout 2,1 \
+set multiplot layout 3,1 \
margins 0.19,0.95,0.23,0.95 \
spacing 0.03,0.03
@@ -20,11 +20,19 @@ plot \
"timeseries.txt" u ($0/1008*7):($2/1000) w l lw 2 lc "black" t "effective normal stress", \
"" u ($0/1008*7):($3/1000) w l lw 2 lc "blue" dt "-" t "water pressure"
-set xtics
+#set xtics
+unset xtics
#unset yrange
set yrange [0:7.5]
-set xlabel "Time [d]"
+#set xlabel "Time [d]"
set ylabel "Shear velocity [km/d]"
plot "" u ($0/1008*7):($1*60*60*24/1000) w l lw 2 lc "red" t ""
+set xtics
+#unset yrange
+set yrange [0:2]
+set xlabel "Time [d]"
+set ylabel "Depth of max. deformation [m]"
+plot "" u ($0/1008*7):(2.0 - $1) w l lw 2 lc "black" t ""
+
unset multiplot
diff --git a/fig3/Makefile b/fig3/Makefile
@@ -18,7 +18,22 @@ timeseries.txt: sim.output00000.txt
tail -n 1 "$$f" | cut -f2- >> $@; \
done'
-../$(FIG).pdf: fig.gp timeseries.txt
+max_strainrate_depth.txt: sim.output00000.txt
+ /bin/sh -c '\
+ for f in sim.output*.txt; do \
+ awk " \
+ BEGIN{getline;depth=max=-1} \
+ NF{ \
+ if (\$$6 >= max) \
+ { \
+ max=\$$6; \
+ depth=\$$1; \
+ } \
+ } \
+ END{print depth,\"\t\",max}" "$$f" >> $@; \
+ done'
+
+../$(FIG).pdf: fig.gp timeseries.txt max_strainrate_depth.txt
gnuplot $< > $@
clean: