URI: 
       tMakefile - hansen-zoet-exp - comparison of lab and model results of sediment advection
  HTML git clone git://src.adamsgaard.dk/hansen-zoet-exp
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
       tMakefile (5273B)
       ---
            1 .POSIX:
            2 
            3 REPO = cngf-pf
            4 BIN = ${REPO}/cngf-pf
            5 PDFS = \
            6         fig-strain_distribution.pdf \
            7         fig-mohr_coulomb.pdf \
            8         fig-sediment_flux.pdf \
            9         fig-sediment_flux-100ma.pdf \
           10         fig-sediment_flux_daily.pdf \
           11         fig-skin_depth_diff.pdf \
           12         fig-stress_strain.pdf \
           13 
           14 stressvals_ != range -l -N 40 0.01 100
           15 stressvals_ += 8 22 50
           16 stressvals != echo ${stressvals_} | sort -n
           17 velvals = 3.169e-6 9.506e-6
           18 fluid_ampl_min = 1
           19 fluid_ampl_max = 30
           20 fluid_ampl_vals != range -N 16 ${fluid_ampl_min} ${fluid_ampl_max}
           21 fluid_freq_vals = 1.157e-5        # daily
           22 grain_size = 530.7e-6
           23 grain_friction = 0.6
           24 grain_cohesion = 0
           25 grain_nonlocal_ampl = 0.33
           26 grain_rate_dependence = 0.002
           27 # grain_nonlocal_ampl doubles -> scale factor doubles, stress exponent is constant at 1/3
           28 # sediment flux is proportional to cuberoot(N)
           29 # grain_nonlocal_ampl = 0.66 -> a = 2.62
           30 # grain_nonlocal_ampl = 0.33 -> a = 1.79
           31 time_end = 345600
           32 time_interval = 1800
           33 N = 64        # resolution for skin-depth figure
           34 
           35 default: ${PDFS}
           36 
           37 ${BIN}: ${REPO}/cngf-pf.c
           38         CFLAGS="-march=native -O3 -pipe" make -C ${REPO}
           39 
           40 ${REPO}/cngf-pf.c:
           41         git submodule update --init
           42 
           43 fig-stress_strain.pdf: strain_distribution_N50kPa_v3.169e-6ms.txt fig-stress_strain.gp
           44         sh -ec '\
           45         for f in strain_distribution_ampl*.output*.txt; do \
           46                 gnuplot -e "f=\"$$f\"" fig-stress_strain.gp >$$f.pdf && \
           47                 echo $$f.pdf; \
           48         done'
           49 
           50 strain_distribution_N50kPa_v3.169e-6ms.txt: ${BIN}
           51         sh -c '\
           52         for v in ${velvals}; do \
           53                 for P in ${stressvals}; do \
           54                         ./${BIN} \
           55                         -d ${grain_size} \
           56                         -m ${grain_friction} \
           57                         -c ${grain_cohesion} \
           58                         -s $${v} \
           59                         -L 0.11 \
           60                         -n $${P}e3 \
           61                         -A ${grain_nonlocal_ampl} \
           62                         -b ${grain_rate_dependence} \
           63                         >strain_distribution_N$${P}kPa_v$${v}ms.txt; \
           64         done; done'  # also close fit with lower A and higher b
           65         # higher values of L do not make a difference in flux
           66 
           67 max_depth_daily.txt: ${BIN}
           68         for freq in ${fluid_freq_vals}; do \
           69                 for ampl in $$(range -N 1000 ${fluid_ampl_min} ${fluid_ampl_max}); do \
           70                         printf '%ge3\t' $${ampl}; \
           71                         ./${REPO}/max_depth_simple_shear \
           72                         -D 1.5e-5 \
           73                         -q $${freq} \
           74                         -a $${ampl}e3; \
           75         done; done >$@
           76 
           77 strain_distribution_ampl1kPa_freq1.157e-5s.txt: ${BIN}
           78         sh -c '\
           79         for freq in ${fluid_freq_vals}; do \
           80                 for ampl in ${fluid_ampl_vals}; do \
           81                         ./${BIN} \
           82                         -d ${grain_size} \
           83                         -D 1.5e-5 \
           84                         -m ${grain_friction} \
           85                         -c ${grain_cohesion} \
           86                         -s 3.169e-6 \
           87                         -L 2.0 \
           88                         -n 85e3 \
           89                         -A ${grain_nonlocal_ampl} \
           90                         -b ${grain_rate_dependence} \
           91                         -F \
           92                         -e ${time_end} \
           93                         -I ${time_interval} \
           94                         -q $${freq} \
           95                         -a $${ampl}e3 \
           96                         -X 1e-4 \
           97                         -x 200000 \
           98                         strain_distribution_ampl$${ampl}kPa_freq$${freq}s \
           99                         >strain_distribution_ampl$${ampl}kPa_freq$${freq}s.txt & \
          100         done; done; wait'
          101 
          102 mohr_coulomb_v3.169e-6ms.txt: strain_distribution_N50kPa_v3.169e-6ms.txt
          103         sh -c '\
          104         rm -f mohr_coulomb_v*ms.txt; \
          105         for v in ${velvals}; do \
          106                 for P in ${stressvals}; do \
          107                         tail -n 1 strain_distribution_N$${P}kPa_v$${v}ms.txt >>mohr_coulomb_v$${v}ms.txt; \
          108         done; done'
          109 
          110 sediment_flux_v3.169e-6ms.txt: strain_distribution_N50kPa_v3.169e-6ms.txt
          111         sh -c '\
          112         rm -f sediment_flux_v*ms.txt; \
          113         for v in ${velvals}; do \
          114                 for P in ${stressvals}; do \
          115                         (printf "%ge3\t" $$P; ../cngf-pf/shear_flux <strain_distribution_N$${P}kPa_v$${v}ms.txt) >>sediment_flux_v$${v}ms.txt; \
          116                         echo sediment_flux_v$${v}ms.txt; \
          117         done; done'
          118 
          119 sediment_flux_freq1.157e-5s.txt: strain_distribution_ampl1kPa_freq1.157e-5s.txt
          120         rm -f sediment_flux_freq*s.txt
          121         for freq in ${fluid_freq_vals}; do \
          122                 for ampl in ${fluid_ampl_vals}; do \
          123                         awk -v time_end=${time_end} '{printf "%g\t%g\n", $$1, $$10/time_end}' \
          124                                 <strain_distribution_ampl$${ampl}kPa_freq$${freq}s.txt >strain_distribution_ampl$${ampl}kPa_freq$${freq}s_.txt; \
          125                         (printf '%g\t' $$ampl; ../cngf-pf/shear_flux <strain_distribution_ampl$${ampl}kPa_freq$${freq}s_.txt) >>sediment_flux_freq$${freq}s.txt; \
          126         done; done
          127 
          128 fig-strain_distribution.pdf: fig-strain_distribution.gp strain_distribution_N50kPa_v3.169e-6ms.txt
          129         gnuplot fig-strain_distribution.gp > $@
          130 
          131 fig-mohr_coulomb.pdf: fig-mohr_coulomb.gp mohr_coulomb_v3.169e-6ms.txt
          132         gnuplot fig-mohr_coulomb.gp > $@
          133 
          134 fig-sediment_flux.pdf: fig-sediment_flux.gp sediment_flux_v3.169e-6ms.txt
          135         gnuplot fig-sediment_flux.gp > $@
          136 
          137 fig-sediment_flux-100ma.pdf: fig-sediment_flux-100ma.gp sediment_flux_v3.169e-6ms.txt
          138         gnuplot fig-sediment_flux-100ma.gp > $@
          139 
          140 fig-sediment_flux_daily.pdf: fig-sediment_flux_daily.gp sediment_flux_freq1.157e-5s.txt max_depth_daily.txt
          141         skindepth=$$(awk '{print $$3; exit}' max_depth_daily.txt) &&\
          142         gnuplot -e "d_s=$${skindepth}; rho_s=2600; rho_f=1000; g=9.81" fig-sediment_flux_daily.gp > $@
          143 
          144 fig-skin_depth_diff.pdf: fig-skin_depth_diff.gp max_depth_ampl10e3.txt
          145         gnuplot fig-skin_depth_diff.gp > $@
          146 
          147 max_depth_ampl10e3.txt:
          148         for A_f in 1e3 10e3 100e3; do\
          149                 out=max_depth_ampl$${A_f}.txt;\
          150                 rm -f $$out;\
          151                 for D in $$(range -l -N ${N} 1e-9 1e-3); do\
          152                         for f in $$(range -l -N ${N} 1e-9 1e-3); do\
          153                                 printf '%g\t%g\t' $$f $$D >> $$out;\
          154                                 ./${REPO}/max_depth_simple_shear \
          155                                         -D $$D \
          156                                         -a $$A_f \
          157                                         -q $$f | \
          158                                         awk '{print $$1}' >> $$out;\
          159                         done;\
          160                         echo >> $$out;\
          161                 done;\
          162         done
          163 
          164 clean:
          165         rm -f strain_distribution_*.txt mohr_coulomb_*.txt sediment_flux_*.txt max_depth*.txt
          166         rm -f ${PDFS}
          167         make -C $(REPO)/ clean
          168 
          169 .PHONY: default clean