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

flexapprox.sh 1.8 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
  1. #!/usr/bin/env bash
  2. #
  3. # Compute approximate flexure over disc, compare to results from Matlab
  4. # using results flex_analytical.txt produced by flex_analytical.m
  5. ps=flexapprox.ps
  6. # Parameters for disc load
  7. gmt set GMT_FFT kiss
  8. h=4000
  9. r=15000
  10. rhom=3300
  11. rhol=2800
  12. rhoi=2400
  13. rhow=1000
  14. Te=10000
  15. # Make disc load
  16. echo 0 0 $r $h | gmt grdseamount -R-511000/511000/-511000/511000 -I2000 -Cd -Gload.nc
  17. # Because the grid representation of a disc is not exact (the disc is built from lots of prisms)
  18. # we compute the ratio of the exact and approximate volumes and adjust the flexure for this difference.
  19. # Do this by counting number of nonzero entries, multiply by prism volumes dx*dx*h
  20. gmt grdmath load.nc 0 NAN = tmp.nc
  21. n_nan=$(gmt grdinfo -M tmp.nc -C | cut -f16)
  22. disc_vol_grid=$(gmt math -Q 512 512 MUL $n_nan SUB 2000 2000 MUL MUL $h MUL =)
  23. disc_vol_exact=$(gmt math -Q $r $r MUL PI MUL $h MUL =)
  24. scale=$(gmt math -Q $disc_vol_exact $disc_vol_grid DIV =)
  25. # Traditional rhoi = rhol
  26. gmt gravfft load.nc -Gflex_a.nc -Q -Nf+l -T$Te/$rhol/$rhom/$rhow
  27. z0=$(echo -511000 -511000 | gmt grdtrack -Gflex_a.nc -o2)
  28. gmt grdmath flex_a.nc $z0 SUB = flex_a.nc
  29. # Approximate rhoi < rhol
  30. gmt gravfft load.nc -Gflex_c.nc -Q -Nf+l -T$Te/$rhol/$rhom/$rhow/$rhoi
  31. z0=$(echo -511000 -511000 | gmt grdtrack -Gflex_c.nc -o2)
  32. gmt grdmath flex_c.nc $z0 SUB = flex_c.nc
  33. gmt grdtrack -Gflex_a.nc+Uk -Gflex_c.nc+Uk -ELM/RM > result.txt
  34. # Plot the exact single-domain case
  35. gmt psxy -R0/256/-1100/50 -JX6i/4i -Xc -P -Bafg10000 @flex_analytical.txt -i0,1 -Sc0.04i -Ggreen -K > $ps
  36. gmt psxy -R -J -O -K result.txt -i0,2+s$scale -W0.25p,red >> $ps
  37. # Plot the exact double-domain data and the approximations
  38. gmt psxy -R -J -O -K -Bafg10000 @flex_analytical.txt -i0,2 -Sc0.04i -Ggreen -Y4.75i >> $ps
  39. gmt psxy -R -J -O -K @flex_analytical.txt -i0,3 -W0.25p >> $ps
  40. gmt psxy -R -J -O result.txt -i0,3+s$scale -W0.25p,red,- >> $ps
Tip!

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

Comments

Loading...