tMakefile - cngf-pf-exp1 - experiments for first paper with continuum granular model
(HTM) git clone git://src.adamsgaard.dk/manus_continuum_granular1_exp
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
tMakefile (1394B)
---
1 BIN = ../cngf-pf/cngf-pf
2 FIG != basename $(PWD)
3
4 default: ../$(FIG).pdf
5
6 sim.output00000.txt: $(BIN)
7 /bin/sh -c '\
8 ./$(BIN) -L 8.0 \
9 -n 200e3 \
10 -s $$( echo "1000/(365*24*60*60)" | bc -l ) \
11 -d 1e-3 \
12 -A 1e-3 \
13 -F \
14 -k 2e-17 \
15 -O 100e3 \
16 -a 80e3 \
17 -q $$( echo "1.0/(3600*24)" | bc -l ) \
18 -I $$( echo "60*10" | bc -l ) \
19 -e $$( echo "3600*24*2" | bc -l ) sim'
20
21 timeseries.txt: sim.output00000.txt
22 /bin/sh -c '\
23 rm -f $@; \
24 for f in sim.output*.txt; do \
25 tail -n 1 "$$f" | cut -f2- >> $@; \
26 done'
27
28 max_strainrate_depth.txt: sim.output00000.txt
29 /bin/sh -c '\
30 rm -f $@; \
31 for f in sim.output*.txt; do \
32 awk " \
33 BEGIN{getline; depth=8.0; max=0.0} \
34 NF{ \
35 if (\$$6 >= max && \$$6+0 > 1e-300) \
36 { \
37 max=\$$6; \
38 depth=\$$1; \
39 } \
40 } \
41 END{ \
42 print depth,\"\t\",max \
43 }" \
44 "$$f" >> $@; \
45 done'
46
47 # central finite differences
48 sediment_flux.txt: sim.output00000.txt
49 /bin/sh -c '\
50 rm -f $@; \
51 for f in sim.output*.txt; do \
52 awk " \
53 BEGIN{getline; integral=0.0} \
54 NF{ \
55 if (NR > 1) \
56 { \
57 integral+=(\$$2+v_prev)/2.0*(\$$1-z_prev); \
58 } \
59 z_prev=\$$1; \
60 v_prev=\$$2; \
61 } \
62 END{ \
63 print integral \
64 }" \
65 "$$f" >> $@; \
66 done'
67
68 ../$(FIG).pdf: fig.gp timeseries.txt max_strainrate_depth.txt sediment_flux.txt
69 gnuplot fig.gp > $@
70
71 clean:
72 rm -f *.txt
73 rm -f ../$(FIG).pdf
74
75 .PHONY: default clean