root/trunk/modules/mc/hc/README.TXT

Revision 460, 8.3 kB (checked in by becker, 7 months ago)

Updated HC.

Line 
1 INSTALLATION
2
3 The code should compile on any basic UNIX/Linux system with the GMT
4 tools (by default, version > 4.2.1) and libraries installed. See the
5 Makefile for comments and what to modify.
6
7
8 What is described below is the hc Hager & O'Connell (1981) forward
9 flow and geoid computation. For plate velocity inversions following
10 the Ricard & Vigny (1989) method, see the hcplates subdirectory and
11 the README there.
12
13 The Makefile assumes that the following environment variables are
14 predefined:
15
16 1) GMTHOME: needs to point to the base directory of the GMT installation,
17 e.g.
18         /usr/local/src/GMTdev/GMT3.4.5/
19
20 if you installed GMT yourself, or
21
22         /usr/lib/gmt
23
24 if you installed GMT with a package manager.
25
26 2) NETCDFHOME: for the netcdf libraries.  This could be e.g.
27
28    /usr/local/src/netcdf-3.5.0/
29
30 or
31
32    /usr
33
34 3) HC_HOME: By default, the object files and binaries will be
35    installed in the "objects/" and "bin/" directories in the current
36    directory.  If HC_HOME is set (e.g. /usr/local/), then they will
37    be installed in $HC_HOME/objects and $HC_HOME/bin.
38
39 4) ARCH: If you like, you can put the object files and binaries in
40    different directories depending on your architecture.  This may be
41    useful if your directories are NFS mounted on different machines.
42    One way is to use the output of uname
43
44      setenv ARCH `uname -m | gawk '{print(tolower($1))}'`      # sh/tcsh
45      export ARCH=`uname -m | gawk '{print(tolower($1))}'`      # bash
46
47    On a 32 bit Intel machine, this will put the binaries in bin/i686.
48
49 Also, the Makefile uses the commonly defined compiler variables CC,
50 F90, CFLAGS, LD, and LDFLAGS.  So to make static executables, set
51 LDFLAGS="-static"
52
53 By default, the Makefile is set up for the new syntax of GMT version
54 4.1.2 and higher. The alternative is to use GMT3, which can be done by
55 defining -DUSE_GMT3 and modifying the two corresponding lines in the
56 Makefile.include.
57
58 With all things set up, you should be able to type
59
60 make all
61
62 to compile the programs.
63
64
65
66 HC CODE usage
67
68 Described in the help page that is displayed for "hc -h" as below.
69 Also see http://geosys.usc.edu/projects/seatree/ for a graphical user
70 interface, and example plotting scripts as provided below.
71
72 >>>
73
74 bin/hc - perform Hager & O'Connell flow computation
75
76 This code can compute velocities, tractions, and geoid for simple density distributions
77 and plate velocities using the semi-analytical approach of Hager & O'Connell (1981).
78 This particular implementation illustrates one possible way to combine the HC solver routines.
79 Based on code by Brad Hager, Richard O'Connell, and Bernhard Steinberger.
80 This version by Thorsten Becker and Craig O'Neill
81
82 usage example:
83
84 bin/hc -vvv
85
86 Compute mantle flow solution using the default input files:
87   viscosity profile visc.dat
88   density profile   dens.sh.dat
89   earth model       prem/prem.dat
90 and provide lots of output. Default setting is quiet operation.
91
92 See README.TXT in the installation directory for example for how to plot output, and
93 http://geosys.usc.edu/projects/seatree/ for a graphical user interface.
94
95 density anomaly options:
96 -dens   name    use name as a SH density anomaly model (dens.sh.dat)
97                 All density anomalies are in units of 1% of PREM, all SH coefficients
98                 in Dahlen & Tromp convention.
99 -dshs           use the short, Becker & Boschi (2002) format for the SH density model (OFF)
100 -ds             density scaling factor (0.2)
101 -dnp            do not scale density anomalies with PREM but rather mean density (OFF)
102 -dsf    file    read depth dependent density scaling from file
103                 (overrides -ds, OFF), use pdens.py to edit
104
105 Earth model options:
106 -prem   name    set Earth model to name (prem/prem.dat)
107 -vf     name    viscosity structure filename (visc.dat), use pvisc.py to edit
108                 This file is in non_dim_radius viscosity[Pas] format
109                 if name is "visc_scan", will loop through a four layer viscosity scan
110
111 boundary condition options:
112 -fs             perform free slip computation (ON)
113 -ns             perform no slip computation (OFF)
114 -pvel   name    set prescribed surface velocities from file name (OFF)
115                 The file (e.g. pvel.sh.dat) is based on a DT expansion of cm/yr velocity fields.
116
117 solution procedure and I/O options:
118 -ng             do not compute and print the geoid (1)
119 -ag             compute geoid at all layer depths, as opposed to the surface only
120 -rg     name    compute correlation of surface geoid with that in file "name",
121                 this will not print out the geoid file, but only correlations (OFF)
122 -pptsol         print pol[6] and tor[2] solution vectors (OFF)
123 -px             print the spatial solution to file (OFF)
124 -rtrac          compute srr,srt,srp tractions [MPa] instead of velocities [cm/yr] (default: vel)
125 -htrac          compute stt,stp,spp tractions [MPa] instead of velocities [cm/yr] (default: vel)
126 -v      -vv     -vvv: verbosity levels (0)
127
128
129
130
131 <<<
132
133 SPHERICAL HARMONICS FORMAT
134
135
136 (A) Regular (long) format, which allows for both scalar and vector
137 harmonics
138                                    
139 All single layer spherical harmonics are in the fully normalized,
140 physical convention, e.g. Dahlen & Tromp (1998).
141
142                                    
143 All spherical harmonics files have an SH_HEADER
144
145                lmax layer_i zlabel_i nlayer nrset type
146
147 lmax: maximum l of expansion
148 layer_i:      layer number, from 0....nlayer
149 zlabel_i:     depth label of this layer, in km (positive, from 0: surface
150                      to 2871 for CMB)
151 nlayer:       number of layers
152 nrset:        number of spherical harmonic coefficient sets   
153 type:         0 for Rick, 1 for HealPix etc. (will determine only the
154                 internal representation, external all is physical
155                 convention)
156
157 1) Scalar fields with layers (e.g.: hc_assign_density, which calls:
158    sh_read_parameters, sh_init_expansion, sh_read_coefficients)
159
160
161 SH_HEADER (see above), with nrset == 1
162 a00 b00
163 a10 b10
164 a11 b11
165 a20 b20
166 a21 b21
167 ....
168
169
170
171 Unformatted file.
172
173
174
175 2) Surface velocity fields
176
177 SH_HEADER, e.g: 127 0 0 1 2 0 (nrset == 2 for poloidal and toroidal fields)
178 a00p b00p a00t b00t
179 a10p b10p a10t b10t
180 ...
181
182
183 (B) Short format
184
185 As above, but will only expect a single integer, lmax, as the header
186 for a spherical harmonic expansion.
187
188
189
190
191 OTHER INPUT FILE FORMATS
192
193 1) Viscosity structure (hc_assign_viscosity)
194
195 r_i e_i
196
197 Unformatted list of radii (radius of layer/Earth radius) and viscosity
198 (in Pas) values, reads until end of file. Values determine each layer
199 viscosity upward until the next entry. Use the graphical tool
200 pvisc.py to edit such files.
201 2) Depth dependent density scaling file
202
203 r_i d_i
204
205 Format as for the viscosity file, but d_i are the depth-dependent
206 scaling factors (this overridings -ds). Use the graphical tool
207 pdens.py to edit such files.
208
209
210
211 OUTPUT FILES
212
213 After a regular run, file sol.bin will have the velocity solution
214 (cm/yr) in binary format. This file can be extracted using
215 hc_extract_sh_layer (see below).
216
217 File geoid.ab will have the geoid in meters in a spherical harmonic
218 expansion.
219
220
221
222 USING THE OUTPUT
223
224 1) Extracting spherical harmonics solutions.
225
226    a) extract SH expansion of radial velocity at layer 2
227
228       hc_extract_sh_layer vel.sol.bin 2 1
229
230    b) extract SH expansion of radial velocity at layer 2 and convert
231       to spatial expansion
232
233       hc_extract_sh_layer vel.sol.bin 2 1 0 | sh_syn 
234
235    c) extract SH expansion of poloidal and toroidal velocity at layer 5 and convert
236       to spatial expansion of v_theta v_phi
237
238       hc_extract_sh_layer vel.sol.bin 5 2 0 | sh_syn
239
240
241
242       Also see the script calc_vel_and_plot for some suggestions on
243       how to convert the output.
244
245
246
247 USING THE SPHERICAL HARMONICS TOOLS AS STANDALONE
248
249
250 1) Convert scalar values from a GMT/Netcdf grd file into a spherical
251    harmonics expansion of degree 31
252
253
254    a) obtain scalar data at the Gaussian intergration points
255
256       sh_ana -127 | grdtrack -Lx -G$datadir/etopo5/etopo5.1.grd > etopo5.dat
257
258
259    b) expand
260
261        cat etopo5.dat | sh_ana 127 > etopo5.ab
262
263    c) Alternative: use the grd file directly
264
265    sh_ana 127 $datadir/etopo5/etopo5.1.grd
266
267 2) convert spherical harmonics to spatial expansion
268
269       cat etopo5.ab | sh_syn > etopo5.127.dat
270
271
272 Note that sh_syn and sh_ana are only example implementations of the
273 subroutines, there's very limited actual functionality. For a more
274 useful spherical harmonics package, see shansyn at
275
276 http://geodynamics.usc.edu/~becker/sdata.html
277
278
279 That being said, also note helper programs sh_corr and sh_power.
280
281
282 SEATREE
283
284 HC is a module of the Solid Earth Teaching and Research Environment
285 (SEATREE) which provides a graphical user interface to flow
286 computations and plotting.
287
288 https://geosys.usc.edu/projects/seatree/wiki/
289      
290
291
292                                    
293
Note: See TracBrowser for help on using the browser.