/
shread.html
88 lines (77 loc) · 5.16 KB
/
shread.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>SHTOOLS - Spherical harmonic I/O and storage routines</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../css/sh.css">
<link rel="icon" type="image/vnd.microsoft.icon" href="../../images/favicon.ico">
</head>
<body>
<div class="main">
<p class="centeredimage"><img src="../../images/logo.jpg" width=894 height=135 alt="SHTOOLS --- Tools for working with spherical harmonics"></p>
<table class="menu">
<tbody>
<tr>
<td><a href="../../../index.html">HOME</a></td>
<td><a href="https://github.com/SHTOOLS/SHTOOLS/releases">DOWNLOAD</a></td>
<td class="selected"><a href="../../documentation.html">DOCUMENTATION</a></td>
<td><a href="../../faq.html">FAQ</a> </td>
</tr>
</tbody>
</table>
<p class="dir">
> <a href="../../../index.html" class="dir">Home</a> > <a href="../../documentation.html" class="dir">Documentation</a> > <a href="../../f95-routines.html" class="dir">Fortran 95</a> > <a href="../../io.html" class="dir">Spherical Harmonic I/O and Storage</a></p>
<h1 id="shread">SHRead</h1>
<p>Read spherical harmonic coefficients from an ascii-formatted file.</p>
<h1 id="usage">Usage</h1>
<p>call SHRead (<code>filename</code>, <code>cilm</code>, <code>lmax</code>, <code>skip</code>, <code>header</code>, <code>error</code>, <code>exitstatus</code>)</p>
<h1 id="parameters">Parameters</h1>
<dl>
<dt><code>filename</code> : input, character(:)</dt>
<dd>The filename of the ascii file containing the spherical harmonic coefficients.
</dd>
<dt><code>cilm</code> : output, real*8, dimension (2, <code>lmax</code>+1, <code>lmax</code>+1)</dt>
<dd>The spherical harmonic coefficients contained in <code>filename</code>.
</dd>
<dt><code>lmax</code> : output, integer</dt>
<dd>The maximum spherical harmonic degree of <code>cilm</code>. This is the minimum of the maximum spherical harmonic degree of <code>filename</code> and the dimension of <code>cilm</code>-1.
</dd>
<dt><code>skip</code> : input, optional, integer</dt>
<dd>The number of lines to skip before parsing <code>filename</code>.
</dd>
<dt><code>header</code> : output, optional, real*8 dimension (<code>n</code>)</dt>
<dd>A vector containing the first <code>n</code> numbers in the first line of the file (following any skipped lines).
</dd>
<dt><code>error</code> : output, optional, real*8 dimension (2, <code>lmax</code>+1, <code>lmax</code>+1)</dt>
<dd>The errors corresponding to the spherical harmonic coefficients <code>cilm</code>.
</dd>
<dt><code>exitstatus</code> : output, optional, integer</dt>
<dd>If present, instead of executing a STOP when an error is encountered, the variable exitstatus will be returned describing the error. 0 = No errors; 1 = Improper dimensions of input array; 2 = Improper bounds for input variable; 3 = Error allocating memory; 4 = File IO error.
</dd>
</dl>
<h1 id="description">Description</h1>
<p><code>SHRead</code> will read spherical harmonic coefficients from an ascii-formatted file into an array <code>cilm</code>. The maximum spherical harmonic degree that is read is determined by the minimum of the dimension of the input array <code>cilm</code>-1 and the maximum degree of the coefficients in the file. If the optional array <code>skip</code> is specified, parsing of the file will commence after the first <code>skip</code> lines. If the optional array <code>header</code> is specified, then the first <code>n</code> elements after the skipped lines will be output, where <code>n</code> is the length of the array <code>header</code>.</p>
<p>The spherical harmonic coefficients in the file are assumed to be ordered by increasing degree <code>l</code> and angular order <code>m</code> according to the format</p>
<p><code>l, m, cilm(1,l+1,m+1), cilm(2,l+1,m+1)</code></p>
<p>The actual delimeters (commas, spaces, or tabs) are unimportant. If the optional array <code>error</code> is specified, then the error for each coefficient will be read according to the format</p>
<p><code>l, m, cilm(1,l+1,m+1), cilm(2,l+1,m+1), error(1,l+1,m+1), error(2,l+1,m+1)</code></p>
<p>The ordering of the file is explcitly given by</p>
<p><code>l, 0 / l, 1 / l, 2 /l, ... / l, m / l+1, 0 / l+1, 1 / ...</code></p>
<p>The first spherical harmonic degree of the filename does not have to be 0; this is determined from the first element after the <code>skip</code> and <code>header</code> lines.</p>
<h1 id="see-also">See also</h1>
<p><a href="shread2.html">shread2</a>, <a href="shreadjpl.html">shreadjpl</a></p>
<p class="dir">
> <a href="../../../index.html" class="dir">Home</a> > <a href="../../documentation.html" class="dir">Documentation</a> > <a href="../../f95-routines.html" class="dir">Fortran 95</a> > <a href="../../io.html" class="dir">Spherical Harmonic I/O</a></p>
<table class="footer2">
<tbody>
<tr>
<td class="c1"><a href="https://lagrange.oca.eu/?lang=en">Laboratoire Lagrange</a></td>
<td class="c2"><a href="https://www.oca.eu/?lang=en">Observatoire de la Côte d'Azur</a></td>
<td class="c3">© 2017 <a href="https://github.com/SHTOOLS">SHTOOLS</a></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>