Makefile (1407B)
1 BIN = ../1d_fd_simple_shear/1d_fd_simple_shear 2 FIG = $(shell basename $(CURDIR)) 3 4 FACTOR=0.1 5 6 default: ../$(FIG)-$(FACTOR).pdf 7 8 # --stress-ratio 0.40 \ 9 10 sim-$(FACTOR).output00000.txt: $(BIN) 11 ./$< --length 8.0 \ 12 --normal-stress 200e3 \ 13 --set-shear-velocity $$( awk 'BEGIN { print 1000/(365*24*60*60) }') \ 14 --fluid \ 15 --fluid-permeability $$( awk 'BEGIN { print 2e-17*$(FACTOR) }') \ 16 --fluid-pressure-top 100e3 \ 17 --fluid-pressure-ampl 80e3 \ 18 --fluid-pressure-freq $$( awk 'BEGIN { print $(FACTOR)*1.0/(3600*24) }') \ 19 --file-interval $$( awk 'BEGIN { print 60*10/$(FACTOR) }') \ 20 --time-end $$( awk 'BEGIN { print 3600*24*7/$(FACTOR) }') sim-$(FACTOR) 21 22 timeseries-$(FACTOR).txt: sim-$(FACTOR).output00000.txt 23 /bin/sh -c '\ 24 rm -f $@; \ 25 for f in sim-$(FACTOR).output*.txt; do \ 26 tail -n 1 "$$f" | cut -f2- >> $@; \ 27 done' 28 29 max_strainrate_depth-$(FACTOR).txt: sim-$(FACTOR).output00000.txt 30 /bin/sh -c '\ 31 rm -f $@; \ 32 for f in sim-$(FACTOR).output*.txt; do \ 33 awk " \ 34 BEGIN{getline; depth=8.0; max=0.0} \ 35 NF{ \ 36 if (\$$6 >= max && \$$6+0 > 1e-300) \ 37 { \ 38 max=\$$6; \ 39 depth=\$$1; \ 40 } \ 41 } \ 42 END{ \ 43 print depth,\"\t\",max \ 44 }" \ 45 "$$f" >> $@; \ 46 done' 47 48 ../$(FIG)-$(FACTOR).pdf: fig.gp timeseries-$(FACTOR).txt max_strainrate_depth-$(FACTOR).txt 49 gnuplot -e "factor='$(FACTOR)'" $< > $@ 50 51 clean: 52 $(RM) *.txt 53 $(RM) ../$(FIG)-$(FACTOR).pdf 54 55 .PHONY: default clean