gphys 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +7414 -0
- data/LICENSE.txt +1 -1
- data/Rakefile +0 -2
- data/doc/derivative/math-doc/document/images.log +385 -0
- data/doc/ep_flux/math-doc/document/images.log +1375 -0
- data/doc/ganalysis/doc/NumRu.html +203 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis.html +931 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/BetaPlane.html +574 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/Fitting.html +576 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/LogP.html +425 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/Met.html +2021 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/MetZ.html +524 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/Planet.html +1047 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/QG.html +794 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/QG/Uninitialized.html +215 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/QG_common.html +603 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere.html +760 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere_common.html +251 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere_div.html +424 -0
- data/doc/ganalysis/doc/NumRu/GAnalysis/SigmaCoord.html +321 -0
- data/doc/ganalysis/doc/NumRu/GGraph.html +334 -0
- data/doc/ganalysis/doc/NumRu/GPhys.html +579 -0
- data/doc/ganalysis/doc/Object.html +210 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/beta_plane_rb.html +60 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/covariance_rb.html +56 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/eof_rb.html +64 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/fitting_rb.html +54 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/histogram_rb.html +58 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/log_p_rb.html +60 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/met_rb.html +60 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/met_z_rb.html +58 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/planet_rb.html +58 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/qg_rb.html +64 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/sigma_coord_rb.html +56 -0
- data/doc/ganalysis/doc/__/__/lib/numru/ganalysis_rb.html +98 -0
- data/doc/ganalysis/doc/created.rid +13 -0
- data/doc/ganalysis/doc/images/brick.png +0 -0
- data/doc/ganalysis/doc/images/brick_link.png +0 -0
- data/doc/ganalysis/doc/images/bug.png +0 -0
- data/doc/ganalysis/doc/images/bullet_black.png +0 -0
- data/doc/ganalysis/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/ganalysis/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/ganalysis/doc/images/date.png +0 -0
- data/doc/ganalysis/doc/images/find.png +0 -0
- data/doc/ganalysis/doc/images/loadingAnimation.gif +0 -0
- data/doc/ganalysis/doc/images/macFFBgHack.png +0 -0
- data/doc/ganalysis/doc/images/package.png +0 -0
- data/doc/ganalysis/doc/images/page_green.png +0 -0
- data/doc/ganalysis/doc/images/page_white_text.png +0 -0
- data/doc/ganalysis/doc/images/page_white_width.png +0 -0
- data/doc/ganalysis/doc/images/plugin.png +0 -0
- data/doc/ganalysis/doc/images/ruby.png +0 -0
- data/doc/ganalysis/doc/images/tag_green.png +0 -0
- data/doc/ganalysis/doc/images/wrench.png +0 -0
- data/doc/ganalysis/doc/images/wrench_orange.png +0 -0
- data/doc/ganalysis/doc/images/zoom.png +0 -0
- data/doc/ganalysis/doc/index.html +383 -0
- data/doc/ganalysis/doc/js/darkfish.js +118 -0
- data/doc/ganalysis/doc/js/jquery.js +32 -0
- data/doc/ganalysis/doc/js/quicksearch.js +114 -0
- data/doc/ganalysis/doc/js/thickbox-compressed.js +10 -0
- data/doc/ganalysis/doc/rdoc.css +763 -0
- data/ext/numru/gphys/ext_init.c +1 -0
- data/ext/numru/gphys/quad_mesh_sample.c +478 -0
- data/gphys.gemspec +2 -2
- data/lib/numru/dclext.rb +394 -14
- data/lib/numru/derivative.rb +6 -0
- data/lib/numru/ganalysis/qg.rb +6 -4
- data/lib/numru/ggraph.rb +41 -8
- data/lib/numru/gphys/gphys.rb +62 -14
- data/lib/numru/gphys/gphys_io.rb +4 -4
- data/lib/numru/gphys/version.rb +2 -2
- metadata +84 -79
- data/.gitignore +0 -14
- data/TODO_ep_flux +0 -6
- data/gphys-bigmem.gemspec +0 -44
- data/install.rb +0 -130
- data/sample/cira86_to_nc.rb +0 -122
- data/sample/druby_cli1.rb +0 -23
- data/sample/druby_cli2.rb +0 -28
- data/sample/druby_serv1.rb +0 -30
- data/sample/druby_serv2.rb +0 -51
- data/sample/ep_flux/demo_NCEP_1.rb +0 -48
- data/sample/ep_flux/demo_NCEP_2.rb +0 -57
- data/sample/ep_flux/demo_NCEP_3.rb +0 -81
- data/sample/ggraph_latlon_labelling_dr002690.rb +0 -159
- data/sample/ggraph_mapfit-axes_dr002687.rb +0 -131
- data/sample/map_projection.rb +0 -121
- data/sample/ncep_theta_coord.rb +0 -79
- data/test_old/eof_slp.rb +0 -28
- data/test_old/mltbit.dat +0 -0
- data/test_old/test_ep_flux.rb +0 -533
- data/test_old/test_multibitIO.rb +0 -19
@@ -0,0 +1,794 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: NumRu::GAnalysis::QG</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../../js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="../../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="module">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="../../index.html">Home</a>
|
25
|
+
<a href="../../index.html#classes">Classes</a>
|
26
|
+
<a href="../../index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="../../__/__/lib/numru/ganalysis/qg_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="../../lib/numru/ganalysis/qg.rb">../../lib/numru/ganalysis/qg.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
<!-- Namespace Contents -->
|
54
|
+
<div id="namespace-list-section" class="section">
|
55
|
+
<h3 class="section-header">Namespace</h3>
|
56
|
+
<ul class="link-list">
|
57
|
+
|
58
|
+
<li><span class="type">CLASS</span> <a href="QG/Uninitialized.html">NumRu::GAnalysis::QG::Uninitialized</a></li>
|
59
|
+
|
60
|
+
</ul>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<!-- Method Quickref -->
|
66
|
+
<div id="method-list-section" class="section">
|
67
|
+
<h3 class="section-header">Methods</h3>
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
<li><a href="#method-i-bp">#bp</a></li>
|
71
|
+
|
72
|
+
<li><a href="#method-i-div_h">#div_h</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-f0">#f0</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-gph2psi">#gph2psi</a></li>
|
77
|
+
|
78
|
+
<li><a href="#method-i-gph2psi_gpref">#gph2psi_gpref</a></li>
|
79
|
+
|
80
|
+
<li><a href="#method-i-gph2q">#gph2q</a></li>
|
81
|
+
|
82
|
+
<li><a href="#method-i-gph2qb">#gph2qb</a></li>
|
83
|
+
|
84
|
+
<li><a href="#method-i-gph2ug_vg">#gph2ug_vg</a></li>
|
85
|
+
|
86
|
+
<li><a href="#method-i-grad_h">#grad_h</a></li>
|
87
|
+
|
88
|
+
<li><a href="#method-i-psi2Qvector">#psi2Qvector</a></li>
|
89
|
+
|
90
|
+
<li><a href="#method-i-psi2q">#psi2q</a></li>
|
91
|
+
|
92
|
+
<li><a href="#method-i-psi2qb">#psi2qb</a></li>
|
93
|
+
|
94
|
+
<li><a href="#method-i-psi2ug_vg">#psi2ug_vg</a></li>
|
95
|
+
|
96
|
+
<li><a href="#method-i-psi_T2Qvector">#psi_T2Qvector</a></li>
|
97
|
+
|
98
|
+
<li><a href="#method-i-set_lat0">#set_lat0</a></li>
|
99
|
+
|
100
|
+
</ul>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<div id="project-metadata">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<div id="classindex-section" class="section project-section">
|
112
|
+
<h3 class="section-header">Class/Module Index
|
113
|
+
<span class="search-toggle"><img src="../../images/find.png"
|
114
|
+
height="16" width="16" alt="[+]"
|
115
|
+
title="show/hide quicksearch" /></span></h3>
|
116
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
117
|
+
<fieldset>
|
118
|
+
<legend>Quicksearch</legend>
|
119
|
+
<input type="text" name="quicksearch" value=""
|
120
|
+
class="quicksearch-field" />
|
121
|
+
</fieldset>
|
122
|
+
</form>
|
123
|
+
|
124
|
+
<ul class="link-list">
|
125
|
+
|
126
|
+
<li><a href="../../NumRu.html">NumRu</a></li>
|
127
|
+
|
128
|
+
<li><a href="../../NumRu/GAnalysis.html">NumRu::GAnalysis</a></li>
|
129
|
+
|
130
|
+
<li><a href="../../NumRu/GAnalysis/BetaPlane.html">NumRu::GAnalysis::BetaPlane</a></li>
|
131
|
+
|
132
|
+
<li><a href="../../NumRu/GAnalysis/Fitting.html">NumRu::GAnalysis::Fitting</a></li>
|
133
|
+
|
134
|
+
<li><a href="../../NumRu/GAnalysis/LogP.html">NumRu::GAnalysis::LogP</a></li>
|
135
|
+
|
136
|
+
<li><a href="../../NumRu/GAnalysis/Met.html">NumRu::GAnalysis::Met</a></li>
|
137
|
+
|
138
|
+
<li><a href="../../NumRu/GAnalysis/MetZ.html">NumRu::GAnalysis::MetZ</a></li>
|
139
|
+
|
140
|
+
<li><a href="../../NumRu/GAnalysis/Planet.html">NumRu::GAnalysis::Planet</a></li>
|
141
|
+
|
142
|
+
<li><a href="../../NumRu/GAnalysis/QG.html">NumRu::GAnalysis::QG</a></li>
|
143
|
+
|
144
|
+
<li><a href="../../NumRu/GAnalysis/QG/Uninitialized.html">NumRu::GAnalysis::QG::Uninitialized</a></li>
|
145
|
+
|
146
|
+
<li><a href="../../NumRu/GAnalysis/QG_common.html">NumRu::GAnalysis::QG_common</a></li>
|
147
|
+
|
148
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere.html">NumRu::GAnalysis::QG_sphere</a></li>
|
149
|
+
|
150
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere_common.html">NumRu::GAnalysis::QG_sphere_common</a></li>
|
151
|
+
|
152
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere_div.html">NumRu::GAnalysis::QG_sphere_div</a></li>
|
153
|
+
|
154
|
+
<li><a href="../../NumRu/GAnalysis/SigmaCoord.html">NumRu::GAnalysis::SigmaCoord</a></li>
|
155
|
+
|
156
|
+
<li><a href="../../NumRu/GGraph.html">NumRu::GGraph</a></li>
|
157
|
+
|
158
|
+
<li><a href="../../NumRu/GPhys.html">NumRu::GPhys</a></li>
|
159
|
+
|
160
|
+
<li><a href="../../Object.html">Object</a></li>
|
161
|
+
|
162
|
+
</ul>
|
163
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div id="documentation">
|
171
|
+
<h1 class="module">NumRu::GAnalysis::QG</h1>
|
172
|
+
|
173
|
+
<div id="description" class="description">
|
174
|
+
|
175
|
+
<p>module QG: quasi-geostrophic analysis module for Cartesian coordinates</p>
|
176
|
+
|
177
|
+
</div><!-- description -->
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
<!-- Methods -->
|
192
|
+
|
193
|
+
<div id="public-instance-method-details" class="method-section section">
|
194
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
195
|
+
|
196
|
+
|
197
|
+
<div id="bp-method" class="method-detail ">
|
198
|
+
<a name="method-i-bp"></a>
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method-heading">
|
202
|
+
<span class="method-name">bp</span><span
|
203
|
+
class="method-args">()</span>
|
204
|
+
<span class="method-click-advice">click to toggle source</span>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
<div class="method-description">
|
209
|
+
|
210
|
+
<p>returns the <a href="BetaPlane.html">BetaPlane</a> object created by
|
211
|
+
initialization (((<<a
|
212
|
+
href="QG.html#method-i-set_lat0">set_lat0</a>>)))</p>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<div class="method-source-code" id="bp-source">
|
217
|
+
<pre>
|
218
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 266</span>
|
219
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">bp</span>
|
220
|
+
<span class="ruby-identifier">@@bp</span>
|
221
|
+
<span class="ruby-keyword">end</span></pre>
|
222
|
+
</div><!-- bp-source -->
|
223
|
+
|
224
|
+
</div>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
</div><!-- bp-method -->
|
230
|
+
|
231
|
+
|
232
|
+
<div id="div_h-method" class="method-detail ">
|
233
|
+
<a name="method-i-div_h"></a>
|
234
|
+
|
235
|
+
|
236
|
+
<div class="method-heading">
|
237
|
+
<span class="method-name">div_h</span><span
|
238
|
+
class="method-args">(gphys_u, gphys_v)</span>
|
239
|
+
<span class="method-click-advice">click to toggle source</span>
|
240
|
+
</div>
|
241
|
+
|
242
|
+
|
243
|
+
<div class="method-description">
|
244
|
+
|
245
|
+
<p>horizontal divergence (Cartesian)</p>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<div class="method-source-code" id="div_h-source">
|
250
|
+
<pre>
|
251
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 414</span>
|
252
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">div_h</span>(<span class="ruby-identifier">gphys_u</span>, <span class="ruby-identifier">gphys_v</span>)
|
253
|
+
<span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">div_h</span>(<span class="ruby-identifier">gphys_u</span>, <span class="ruby-identifier">gphys_v</span>)
|
254
|
+
<span class="ruby-keyword">end</span></pre>
|
255
|
+
</div><!-- div_h-source -->
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</div><!-- div_h-method -->
|
263
|
+
|
264
|
+
|
265
|
+
<div id="f0-method" class="method-detail ">
|
266
|
+
<a name="method-i-f0"></a>
|
267
|
+
|
268
|
+
|
269
|
+
<div class="method-heading">
|
270
|
+
<span class="method-name">f0</span><span
|
271
|
+
class="method-args">()</span>
|
272
|
+
<span class="method-click-advice">click to toggle source</span>
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
<div class="method-description">
|
277
|
+
|
278
|
+
<p>Returns the current f0 (the Coriolis parameter at the reference latitude)</p>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<div class="method-source-code" id="f0-source">
|
283
|
+
<pre>
|
284
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 271</span>
|
285
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">f0</span>; <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">f0</span>; <span class="ruby-keyword">end</span></pre>
|
286
|
+
</div><!-- f0-source -->
|
287
|
+
|
288
|
+
</div>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
</div><!-- f0-method -->
|
294
|
+
|
295
|
+
|
296
|
+
<div id="gph2psi-method" class="method-detail ">
|
297
|
+
<a name="method-i-gph2psi"></a>
|
298
|
+
|
299
|
+
|
300
|
+
<div class="method-heading">
|
301
|
+
<span class="method-name">gph2psi</span><span
|
302
|
+
class="method-args">(gph, gpref)</span>
|
303
|
+
<span class="method-click-advice">click to toggle source</span>
|
304
|
+
</div>
|
305
|
+
|
306
|
+
|
307
|
+
<div class="method-description">
|
308
|
+
|
309
|
+
<p>geopotential height -> <a href="QG.html">QG</a> stream function</p>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
<div class="method-source-code" id="gph2psi-source">
|
314
|
+
<pre>
|
315
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 305</span>
|
316
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">gph2psi</span>(<span class="ruby-identifier">gph</span>, <span class="ruby-identifier">gpref</span>)
|
317
|
+
<span class="ruby-identifier">gpd</span> = <span class="ruby-identifier">gph</span> * <span class="ruby-constant">Met</span><span class="ruby-operator">::</span><span class="ruby-identifier">g</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">gpref</span>
|
318
|
+
<span class="ruby-identifier">psi</span> = <span class="ruby-identifier">gpd</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">f0</span>
|
319
|
+
<span class="ruby-identifier">psi</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"psi"</span>
|
320
|
+
<span class="ruby-identifier">psi</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"QG stream function"</span>
|
321
|
+
<span class="ruby-identifier">psi</span>
|
322
|
+
<span class="ruby-keyword">end</span></pre>
|
323
|
+
</div><!-- gph2psi-source -->
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
</div><!-- gph2psi-method -->
|
331
|
+
|
332
|
+
|
333
|
+
<div id="gph2psi_gpref-method" class="method-detail ">
|
334
|
+
<a name="method-i-gph2psi_gpref"></a>
|
335
|
+
|
336
|
+
|
337
|
+
<div class="method-heading">
|
338
|
+
<span class="method-name">gph2psi_gpref</span><span
|
339
|
+
class="method-args">(gph)</span>
|
340
|
+
<span class="method-click-advice">click to toggle source</span>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
<div class="method-description">
|
345
|
+
|
346
|
+
<p>geopotential height -> <a href="QG.html">QG</a> stream function and the
|
347
|
+
reference geopotential</p>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<div class="method-source-code" id="gph2psi_gpref-source">
|
352
|
+
<pre>
|
353
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 296</span>
|
354
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">gph2psi_gpref</span>(<span class="ruby-identifier">gph</span>)
|
355
|
+
<span class="ruby-identifier">gpd</span>, <span class="ruby-identifier">gpref</span> = <span class="ruby-identifier">gph2gpd_gpref</span>(<span class="ruby-identifier">gph</span>)
|
356
|
+
<span class="ruby-identifier">psi</span> = <span class="ruby-identifier">gpd</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">f0</span>
|
357
|
+
<span class="ruby-identifier">psi</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"psi"</span>
|
358
|
+
<span class="ruby-identifier">psi</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"QG stream function"</span>
|
359
|
+
[<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">gpref</span>]
|
360
|
+
<span class="ruby-keyword">end</span></pre>
|
361
|
+
</div><!-- gph2psi_gpref-source -->
|
362
|
+
|
363
|
+
</div>
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
</div><!-- gph2psi_gpref-method -->
|
369
|
+
|
370
|
+
|
371
|
+
<div id="gph2q-method" class="method-detail ">
|
372
|
+
<a name="method-i-gph2q"></a>
|
373
|
+
|
374
|
+
|
375
|
+
<div class="method-heading">
|
376
|
+
<span class="method-name">gph2q</span><span
|
377
|
+
class="method-args">(gph)</span>
|
378
|
+
<span class="method-click-advice">click to toggle source</span>
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
<div class="method-description">
|
383
|
+
|
384
|
+
<p>geopotential height to quasi-geostrophic potential vorticity (QGPV)</p>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
<div class="method-source-code" id="gph2q-source">
|
389
|
+
<pre>
|
390
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 276</span>
|
391
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">gph2q</span>(<span class="ruby-identifier">gph</span>)
|
392
|
+
<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">gpref</span> = <span class="ruby-identifier">gph2psi_gpref</span>(<span class="ruby-identifier">gph</span>)
|
393
|
+
<span class="ruby-identifier">n2</span> = <span class="ruby-identifier">gpref2n2</span>(<span class="ruby-identifier">gpref</span>)
|
394
|
+
<span class="ruby-identifier">psi2q</span>(<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">n2</span>)
|
395
|
+
<span class="ruby-keyword">end</span></pre>
|
396
|
+
</div><!-- gph2q-source -->
|
397
|
+
|
398
|
+
</div>
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
</div><!-- gph2q-method -->
|
404
|
+
|
405
|
+
|
406
|
+
<div id="gph2qb-method" class="method-detail ">
|
407
|
+
<a name="method-i-gph2qb"></a>
|
408
|
+
|
409
|
+
|
410
|
+
<div class="method-heading">
|
411
|
+
<span class="method-name">gph2qb</span><span
|
412
|
+
class="method-args">(gph)</span>
|
413
|
+
<span class="method-click-advice">click to toggle source</span>
|
414
|
+
</div>
|
415
|
+
|
416
|
+
|
417
|
+
<div class="method-description">
|
418
|
+
|
419
|
+
<p>same as gph2q, but the QGPV is extended to reflect the lowest-level
|
420
|
+
temperature anomalies</p>
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
<div class="method-source-code" id="gph2qb-source">
|
425
|
+
<pre>
|
426
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 283</span>
|
427
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">gph2qb</span>(<span class="ruby-identifier">gph</span>)
|
428
|
+
<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">gpref</span> = <span class="ruby-identifier">gph2psi_gpref</span>(<span class="ruby-identifier">gph</span>)
|
429
|
+
<span class="ruby-identifier">n2</span> = <span class="ruby-identifier">gpref2n2</span>(<span class="ruby-identifier">gpref</span>)
|
430
|
+
<span class="ruby-identifier">psi2qb</span>(<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">n2</span>)
|
431
|
+
<span class="ruby-keyword">end</span></pre>
|
432
|
+
</div><!-- gph2qb-source -->
|
433
|
+
|
434
|
+
</div>
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
</div><!-- gph2qb-method -->
|
440
|
+
|
441
|
+
|
442
|
+
<div id="gph2ug_vg-method" class="method-detail ">
|
443
|
+
<a name="method-i-gph2ug_vg"></a>
|
444
|
+
|
445
|
+
|
446
|
+
<div class="method-heading">
|
447
|
+
<span class="method-name">gph2ug_vg</span><span
|
448
|
+
class="method-args">(gph)</span>
|
449
|
+
<span class="method-click-advice">click to toggle source</span>
|
450
|
+
</div>
|
451
|
+
|
452
|
+
|
453
|
+
<div class="method-description">
|
454
|
+
|
455
|
+
<p>geopotential height -> geostrophic winds</p>
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
<div class="method-source-code" id="gph2ug_vg-source">
|
460
|
+
<pre>
|
461
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 290</span>
|
462
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">gph2ug_vg</span>(<span class="ruby-identifier">gph</span>)
|
463
|
+
<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">gpref</span> = <span class="ruby-identifier">gph2psi_gpref</span>(<span class="ruby-identifier">gph</span>)
|
464
|
+
<span class="ruby-identifier">psi2ug_vg</span>(<span class="ruby-identifier">psi</span>)
|
465
|
+
<span class="ruby-keyword">end</span></pre>
|
466
|
+
</div><!-- gph2ug_vg-source -->
|
467
|
+
|
468
|
+
</div>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
</div><!-- gph2ug_vg-method -->
|
474
|
+
|
475
|
+
|
476
|
+
<div id="grad_h-method" class="method-detail ">
|
477
|
+
<a name="method-i-grad_h"></a>
|
478
|
+
|
479
|
+
|
480
|
+
<div class="method-heading">
|
481
|
+
<span class="method-name">grad_h</span><span
|
482
|
+
class="method-args">(gphys)</span>
|
483
|
+
<span class="method-click-advice">click to toggle source</span>
|
484
|
+
</div>
|
485
|
+
|
486
|
+
|
487
|
+
<div class="method-description">
|
488
|
+
|
489
|
+
<p>horizontal gradient (Cartesian)</p>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
<div class="method-source-code" id="grad_h-source">
|
494
|
+
<pre>
|
495
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 409</span>
|
496
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">grad_h</span>(<span class="ruby-identifier">gphys</span>)
|
497
|
+
<span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">grad_h</span>(<span class="ruby-identifier">gphys</span>)
|
498
|
+
<span class="ruby-keyword">end</span></pre>
|
499
|
+
</div><!-- grad_h-source -->
|
500
|
+
|
501
|
+
</div>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
</div><!-- grad_h-method -->
|
507
|
+
|
508
|
+
|
509
|
+
<div id="psi2Qvector-method" class="method-detail ">
|
510
|
+
<a name="method-i-psi2Qvector"></a>
|
511
|
+
|
512
|
+
|
513
|
+
<div class="method-heading">
|
514
|
+
<span class="method-name">psi2Qvector</span><span
|
515
|
+
class="method-args">(psi)</span>
|
516
|
+
<span class="method-click-advice">click to toggle source</span>
|
517
|
+
</div>
|
518
|
+
|
519
|
+
|
520
|
+
<div class="method-description">
|
521
|
+
|
522
|
+
<p><a href="QG.html">QG</a> stream function -> the Q-vector</p>
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
<div class="method-source-code" id="psi2Qvector-source">
|
527
|
+
<pre>
|
528
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 358</span>
|
529
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">psi2Qvector</span>(<span class="ruby-identifier">psi</span>)
|
530
|
+
<span class="ruby-identifier">bc</span> = <span class="ruby-constant">GPhys</span><span class="ruby-operator">::</span><span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-constant">CYCLIC_OR_LINEAR</span>
|
531
|
+
<span class="ruby-identifier">f0</span> = <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">f0</span>
|
532
|
+
<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span> = <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">get_x_y</span>(<span class="ruby-identifier">psi</span>)
|
533
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">psi</span>).<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"Pa"</span>)
|
534
|
+
<span class="ruby-identifier">psi_x</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">x</span>)
|
535
|
+
<span class="ruby-identifier">psi_y</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
536
|
+
<span class="ruby-identifier">psi_xp</span> = <span class="ruby-identifier">psi_x</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">2</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">p</span>)
|
537
|
+
<span class="ruby-identifier">psi_yp</span> = <span class="ruby-identifier">psi_y</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">2</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">p</span>)
|
538
|
+
<span class="ruby-identifier">psi_xy</span> = <span class="ruby-identifier">psi_x</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
539
|
+
<span class="ruby-identifier">psi_xx</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">deriv2nd</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">x</span>)
|
540
|
+
<span class="ruby-identifier">psi_yy</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">deriv2nd</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
541
|
+
<span class="ruby-identifier">q1</span> = (<span class="ruby-operator">-</span><span class="ruby-identifier">psi_xy</span>*<span class="ruby-identifier">psi_xp</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">psi_xx</span>*<span class="ruby-identifier">psi_yp</span>) * <span class="ruby-identifier">f0</span>
|
542
|
+
<span class="ruby-identifier">q2</span> = (<span class="ruby-operator">-</span><span class="ruby-identifier">psi_yy</span>*<span class="ruby-identifier">psi_xp</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">psi_xy</span>*<span class="ruby-identifier">psi_yp</span>) * <span class="ruby-identifier">f0</span>
|
543
|
+
<span class="ruby-identifier">q1</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">q1</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"Q1"</span>
|
544
|
+
<span class="ruby-identifier">q2</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">q2</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"Q2"</span>
|
545
|
+
[<span class="ruby-identifier">q1</span>,<span class="ruby-identifier">q2</span>]
|
546
|
+
<span class="ruby-keyword">end</span></pre>
|
547
|
+
</div><!-- psi2Qvector-source -->
|
548
|
+
|
549
|
+
</div>
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
</div><!-- psi2Qvector-method -->
|
555
|
+
|
556
|
+
|
557
|
+
<div id="psi2q-method" class="method-detail ">
|
558
|
+
<a name="method-i-psi2q"></a>
|
559
|
+
|
560
|
+
|
561
|
+
<div class="method-heading">
|
562
|
+
<span class="method-name">psi2q</span><span
|
563
|
+
class="method-args">(psi, n2, perturbation=false)</span>
|
564
|
+
<span class="method-click-advice">click to toggle source</span>
|
565
|
+
</div>
|
566
|
+
|
567
|
+
|
568
|
+
<div class="method-description">
|
569
|
+
|
570
|
+
<p><a href="QG.html">QG</a> stream function -> QGPV</p>
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
<div class="method-source-code" id="psi2q-source">
|
575
|
+
<pre>
|
576
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 314</span>
|
577
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">psi2q</span>(<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">n2</span>, <span class="ruby-identifier">perturbation</span>=<span class="ruby-keyword">false</span>)
|
578
|
+
<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span> = <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">get_x_y</span>(<span class="ruby-identifier">psi</span>)
|
579
|
+
<span class="ruby-identifier">bc</span> = <span class="ruby-constant">GPhys</span><span class="ruby-operator">::</span><span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-constant">CYCLIC_OR_LINEAR</span>
|
580
|
+
<span class="ruby-identifier">f0</span> = <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">f0</span>
|
581
|
+
<span class="ruby-identifier">vor</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">deriv2nd</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">x</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">deriv2nd</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
582
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">perturbation</span>
|
583
|
+
<span class="ruby-identifier">avor</span> = <span class="ruby-identifier">vor</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">f0</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">beta</span>*<span class="ruby-identifier">y</span>)
|
584
|
+
<span class="ruby-identifier">avor</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"qgavor"</span>
|
585
|
+
<span class="ruby-identifier">avor</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"QG abs vor"</span>
|
586
|
+
<span class="ruby-keyword">else</span>
|
587
|
+
<span class="ruby-identifier">vor</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"qgvor"</span>
|
588
|
+
<span class="ruby-identifier">vor</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"QG vorticity"</span>
|
589
|
+
<span class="ruby-identifier">avor</span> = <span class="ruby-identifier">vor</span>
|
590
|
+
<span class="ruby-keyword">end</span>
|
591
|
+
<span class="ruby-identifier">qzz</span> = <span class="ruby-identifier">gpd2qzz</span>(<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">n2</span>) * (<span class="ruby-identifier">f0</span>*<span class="ruby-identifier">f0</span>)
|
592
|
+
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">avor</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">qzz</span>
|
593
|
+
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"q"</span>
|
594
|
+
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"QG PV"</span>
|
595
|
+
|
596
|
+
[<span class="ruby-identifier">q</span>, <span class="ruby-identifier">avor</span>, <span class="ruby-identifier">qzz</span>]
|
597
|
+
<span class="ruby-keyword">end</span></pre>
|
598
|
+
</div><!-- psi2q-source -->
|
599
|
+
|
600
|
+
</div>
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
</div><!-- psi2q-method -->
|
606
|
+
|
607
|
+
|
608
|
+
<div id="psi2qb-method" class="method-detail ">
|
609
|
+
<a name="method-i-psi2qb"></a>
|
610
|
+
|
611
|
+
|
612
|
+
<div class="method-heading">
|
613
|
+
<span class="method-name">psi2qb</span><span
|
614
|
+
class="method-args">(psi, n2, perturbation=false)</span>
|
615
|
+
<span class="method-click-advice">click to toggle source</span>
|
616
|
+
</div>
|
617
|
+
|
618
|
+
|
619
|
+
<div class="method-description">
|
620
|
+
|
621
|
+
<p>same as psi2q, but the QGPV is extended to reflect the lowest-level
|
622
|
+
temperature anomalies</p>
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
<div class="method-source-code" id="psi2qb-source">
|
627
|
+
<pre>
|
628
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 337</span>
|
629
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">psi2qb</span>(<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">n2</span>, <span class="ruby-identifier">perturbation</span>=<span class="ruby-keyword">false</span>)
|
630
|
+
<span class="ruby-identifier">psie</span> = <span class="ruby-identifier">extend_bottom</span>(<span class="ruby-identifier">psi</span>, <span class="ruby-keyword">nil</span>)
|
631
|
+
<span class="ruby-identifier">n2e</span> = <span class="ruby-identifier">extend_bottom</span>(<span class="ruby-identifier">n2</span>, <span class="ruby-keyword">nil</span>)
|
632
|
+
<span class="ruby-identifier">results</span> = <span class="ruby-identifier">psi2q</span>(<span class="ruby-identifier">psie</span>, <span class="ruby-identifier">n2e</span>, <span class="ruby-identifier">perturbation</span>)
|
633
|
+
<span class="ruby-identifier">results</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">z</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cut_bottom</span>(<span class="ruby-identifier">z</span>)}
|
634
|
+
<span class="ruby-keyword">end</span></pre>
|
635
|
+
</div><!-- psi2qb-source -->
|
636
|
+
|
637
|
+
</div>
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
</div><!-- psi2qb-method -->
|
643
|
+
|
644
|
+
|
645
|
+
<div id="psi2ug_vg-method" class="method-detail ">
|
646
|
+
<a name="method-i-psi2ug_vg"></a>
|
647
|
+
|
648
|
+
|
649
|
+
<div class="method-heading">
|
650
|
+
<span class="method-name">psi2ug_vg</span><span
|
651
|
+
class="method-args">(psi)</span>
|
652
|
+
<span class="method-click-advice">click to toggle source</span>
|
653
|
+
</div>
|
654
|
+
|
655
|
+
|
656
|
+
<div class="method-description">
|
657
|
+
|
658
|
+
<p><a href="QG.html">QG</a> stream function -> geostrophic winds</p>
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
<div class="method-source-code" id="psi2ug_vg-source">
|
663
|
+
<pre>
|
664
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 345</span>
|
665
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">psi2ug_vg</span>(<span class="ruby-identifier">psi</span>)
|
666
|
+
<span class="ruby-identifier">bc</span> = <span class="ruby-constant">GPhys</span><span class="ruby-operator">::</span><span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-constant">CYCLIC_OR_LINEAR</span>
|
667
|
+
<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span> = <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">get_x_y</span>(<span class="ruby-identifier">psi</span>)
|
668
|
+
<span class="ruby-identifier">vg</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">cderiv</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">x</span>)
|
669
|
+
<span class="ruby-identifier">ug</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">psi</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
670
|
+
<span class="ruby-identifier">ug</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"ug"</span>
|
671
|
+
<span class="ruby-identifier">vg</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"vg"</span>
|
672
|
+
<span class="ruby-identifier">ug</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"ug"</span>
|
673
|
+
<span class="ruby-identifier">vg</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"vg"</span>
|
674
|
+
[<span class="ruby-identifier">ug</span>, <span class="ruby-identifier">vg</span>]
|
675
|
+
<span class="ruby-keyword">end</span></pre>
|
676
|
+
</div><!-- psi2ug_vg-source -->
|
677
|
+
|
678
|
+
</div>
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
</div><!-- psi2ug_vg-method -->
|
684
|
+
|
685
|
+
|
686
|
+
<div id="psi_T2Qvector-method" class="method-detail ">
|
687
|
+
<a name="method-i-psi_T2Qvector"></a>
|
688
|
+
|
689
|
+
|
690
|
+
<div class="method-heading">
|
691
|
+
<span class="method-name">psi_T2Qvector</span><span
|
692
|
+
class="method-args">(psi, temp, p=nil)</span>
|
693
|
+
<span class="method-click-advice">click to toggle source</span>
|
694
|
+
</div>
|
695
|
+
|
696
|
+
|
697
|
+
<div class="method-description">
|
698
|
+
|
699
|
+
<p>same as psi2Qvector, but temperature is given independently</p>
|
700
|
+
|
701
|
+
<p>p (nil or UNumeric or VArray or..) : specify pressure if the input data
|
702
|
+
does not have a pressure axis</p>
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
<div class="method-source-code" id="psi_T2Qvector-source">
|
707
|
+
<pre>
|
708
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 381</span>
|
709
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">psi_T2Qvector</span>(<span class="ruby-identifier">psi</span>, <span class="ruby-identifier">temp</span>, <span class="ruby-identifier">p</span>=<span class="ruby-keyword">nil</span>)
|
710
|
+
<span class="ruby-identifier">bc</span> = <span class="ruby-constant">GPhys</span><span class="ruby-operator">::</span><span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-constant">CYCLIC_OR_LINEAR</span>
|
711
|
+
<span class="ruby-identifier">f0</span> = <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">f0</span>
|
712
|
+
<span class="ruby-identifier">x</span>, <span class="ruby-identifier">y</span> = <span class="ruby-identifier">@@bp</span>.<span class="ruby-identifier">get_x_y</span>(<span class="ruby-identifier">psi</span>)
|
713
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">p</span>
|
714
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:convert_units</span>)
|
715
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-identifier">p</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"Pa"</span>)
|
716
|
+
<span class="ruby-keyword">else</span>
|
717
|
+
<span class="ruby-comment"># UNumeric</span>
|
718
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-identifier">p</span>.<span class="ruby-identifier">convert2</span>(<span class="ruby-string">"Pa"</span>)
|
719
|
+
<span class="ruby-keyword">end</span>
|
720
|
+
<span class="ruby-keyword">else</span>
|
721
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-constant">LogP</span>.<span class="ruby-identifier">get_p</span>(<span class="ruby-identifier">psi</span>).<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"Pa"</span>)
|
722
|
+
<span class="ruby-keyword">end</span>
|
723
|
+
<span class="ruby-identifier">psi_xy</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">x</span>).<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
724
|
+
<span class="ruby-identifier">psi_xx</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">deriv2nd</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">x</span>)
|
725
|
+
<span class="ruby-identifier">psi_yy</span> = <span class="ruby-identifier">psi</span>.<span class="ruby-identifier">deriv2nd</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
726
|
+
<span class="ruby-identifier">t_x</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">0</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">x</span>)
|
727
|
+
<span class="ruby-identifier">t_y</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-value">1</span>,<span class="ruby-identifier">bc</span>,<span class="ruby-identifier">y</span>)
|
728
|
+
<span class="ruby-identifier">q1</span> = (<span class="ruby-identifier">psi_xy</span>*<span class="ruby-identifier">t_x</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">psi_xx</span>*<span class="ruby-identifier">t_y</span>) * (<span class="ruby-constant">Met</span><span class="ruby-operator">::</span><span class="ruby-constant">R</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">p</span>)
|
729
|
+
<span class="ruby-identifier">q2</span> = (<span class="ruby-identifier">psi_yy</span>*<span class="ruby-identifier">t_x</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">psi_xy</span>*<span class="ruby-identifier">t_y</span>) * (<span class="ruby-constant">Met</span><span class="ruby-operator">::</span><span class="ruby-constant">R</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">p</span>)
|
730
|
+
<span class="ruby-comment">#puts "@@@ psi_T2Qvector @@@", psi.units, psi_xx.units, t_x.units, q1.units </span>
|
731
|
+
<span class="ruby-identifier">q1</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">q1</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"Q1"</span>
|
732
|
+
<span class="ruby-identifier">q2</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">q2</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"Q2"</span>
|
733
|
+
[<span class="ruby-identifier">q1</span>,<span class="ruby-identifier">q2</span>]
|
734
|
+
<span class="ruby-keyword">end</span></pre>
|
735
|
+
</div><!-- psi_T2Qvector-source -->
|
736
|
+
|
737
|
+
</div>
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
|
742
|
+
</div><!-- psi_T2Qvector-method -->
|
743
|
+
|
744
|
+
|
745
|
+
<div id="set_lat0-method" class="method-detail ">
|
746
|
+
<a name="method-i-set_lat0"></a>
|
747
|
+
|
748
|
+
|
749
|
+
<div class="method-heading">
|
750
|
+
<span class="method-name">set_lat0</span><span
|
751
|
+
class="method-args">(lat0_or_latary)</span>
|
752
|
+
<span class="method-click-advice">click to toggle source</span>
|
753
|
+
</div>
|
754
|
+
|
755
|
+
|
756
|
+
<div class="method-description">
|
757
|
+
|
758
|
+
<p>Initialize the <a href="QG.html">QG</a> module by setting a reference
|
759
|
+
latitude.</p>
|
760
|
+
|
761
|
+
|
762
|
+
|
763
|
+
<div class="method-source-code" id="set_lat0-source">
|
764
|
+
<pre>
|
765
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 261</span>
|
766
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_lat0</span>(<span class="ruby-identifier">lat0_or_latary</span>)
|
767
|
+
<span class="ruby-identifier">@@bp</span> = <span class="ruby-constant">BetaPlane</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">lat0_or_latary</span>)
|
768
|
+
<span class="ruby-keyword">end</span></pre>
|
769
|
+
</div><!-- set_lat0-source -->
|
770
|
+
|
771
|
+
</div>
|
772
|
+
|
773
|
+
|
774
|
+
|
775
|
+
|
776
|
+
</div><!-- set_lat0-method -->
|
777
|
+
|
778
|
+
|
779
|
+
</div><!-- public-instance-method-details -->
|
780
|
+
|
781
|
+
</div><!-- 5Buntitled-5D -->
|
782
|
+
|
783
|
+
|
784
|
+
</div><!-- documentation -->
|
785
|
+
|
786
|
+
<div id="validator-badges">
|
787
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
788
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
789
|
+
Rdoc Generator</a> 2</small>.</p>
|
790
|
+
</div>
|
791
|
+
|
792
|
+
</body>
|
793
|
+
</html>
|
794
|
+
|