Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

firmoviscous2.sh 2.3 KB

You have to be logged in to leave a comment. Sign In
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  1. #!/usr/bin/env bash
  2. # Testing firmoviscous flexure code for asthenospheric layer A = 100km
  3. # and viscosity 2e20, with deep mantle viscosity of 1e22.
  4. ps=firmoviscous2.ps
  5. gmt set GMT_FFT kiss
  6. # Set densities
  7. rhol=2700
  8. rhom=3300
  9. rhos=2700
  10. rhow=1000
  11. # Create a truncated seamount load or 5km height
  12. gmt grdseamount -R-512/511/-512/511+uk -I1000 -Gsmt.nc+uk -Cg -Dk -E -F0.2 -Z-6000 << EOF
  13. 0 0 0 40 40 5000 75 73
  14. EOF
  15. # Select times for calculation
  16. cat << EOF > times.txt
  17. 3k red
  18. 10k orange
  19. 30k green
  20. 70k blue
  21. 1M black
  22. EOF
  23. rm -f flist
  24. while read t color; do
  25. gmt grdflexure smt.nc+uk -D${rhom}/${rhol}/${rhos}/${rhow} -E10k -F2e20/100k/1e22 -Gfv_%.12g.nc -Nf+a -T$t -L >> flist
  26. done < times.txt
  27. # Get cross-sections of all solutions
  28. gmt math -T-200/200/1 0 = t.txt
  29. gmt grdtrack t.txt -G+lflist > a.txt
  30. # Plot flexure(t)
  31. gmt psbasemap -R-200/200/-2000/100 -JX6.5i/2.75i -Bafg10000 -BWSne -P -K > $ps
  32. let col=2
  33. while read t color; do
  34. let c=2*col
  35. gmt psxy -R -J a.txt -i0,${col} -W0.5p,$color -O -K >> $ps
  36. y=$(gmt info a.txt -C -o${c})
  37. echo 0 $y $t | gmt pstext -R -J -O -K -F+f10p,+jCM -Gwhite >> $ps
  38. let col=col+1
  39. done < times.txt
  40. echo -200 -2000 FLEX | gmt pstext -R -J -O -K -F+f18p+jLB -Dj0.1i >> $ps
  41. # Plot load
  42. gmt psbasemap -R-200/200/-6000/0 -J -O -K -BWsne+glightblue -Baf -Y3i >> $ps
  43. gmt grdtrack -Gsmt.nc t.txt | gmt psxy -R -J -i0,2 -O -K -L+yb -Gbrown >> $ps
  44. echo -200 -6000 LOAD | gmt pstext -R -J -O -K -F+f18p+jLB -Dj0.1i >> $ps
  45. # Calc and plot gravity
  46. gmt set FONT_TITLE 20p,Helvetica,black
  47. gmt psbasemap -R-200/200/-40/200 -J -O -K -BWsne+t"T@-e@- = 10 km A = 100 km @~\150@~@-a@- = 2\26410@+20@+ Pa\264s @~\150@~@-m@- = 1\26410@+22@+ Pa\264s" -Bafg1000 -Y3i >> $ps
  48. drho=$(gmt math -Q ${rhol} ${rhow} SUB =)
  49. gmt gravfft smt.nc+uk -Gsmt_grav.nc -Nf+a -Ff -E4 -D${drho} -W6k
  50. paste flist times.txt > flist.txt
  51. drho=$(gmt math -Q ${rhom} ${rhos} SUB =)
  52. while read file t t2 color; do
  53. gmt gravfft ${file}+uk -Gflx_grav.nc -Nf+a -Ff -E2 -D${drho} -W13k
  54. gmt grdtrack t.txt -Gflx_grav.nc > b.txt
  55. gmt psxy -R -J -O -K -W0.25p,${color},- b.txt -i0,2 >> $ps
  56. gmt grdmath smt_grav.nc flx_grav.nc ADD = tmp.nc
  57. gmt grdtrack t.txt -Gtmp.nc > b.txt
  58. gmt psxy -R -J -O -K -W0.5p,${color} b.txt -i0,2 >> $ps
  59. done < flist.txt
  60. echo -200 -40 FAA | gmt pstext -R -J -O -K -F+f18p+jLB -Dj0.1i >> $ps
  61. gmt psxy -R -J -O -T >> $ps
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...