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,425 @@
|
|
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::LogP</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/log_p_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="../../lib/numru/ganalysis/log_p.rb">../../lib/numru/ganalysis/log_p.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
|
+
|
54
|
+
|
55
|
+
<!-- Method Quickref -->
|
56
|
+
<div id="method-list-section" class="section">
|
57
|
+
<h3 class="section-header">Methods</h3>
|
58
|
+
<ul class="link-list">
|
59
|
+
|
60
|
+
<li><a href="#method-i-h">#h</a></li>
|
61
|
+
|
62
|
+
<li><a href="#method-i-p2z">#p2z</a></li>
|
63
|
+
|
64
|
+
<li><a href="#method-i-pcdata_dz">#pcdata_dz</a></li>
|
65
|
+
|
66
|
+
<li><a href="#method-i-pcdata_dz2">#pcdata_dz2</a></li>
|
67
|
+
|
68
|
+
<li><a href="#method-i-pcdata_pi_dz_p_dz">#pcdata_pi_dz_p_dz</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-i-set_h">#set_h</a></li>
|
71
|
+
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="project-metadata">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<div id="classindex-section" class="section project-section">
|
84
|
+
<h3 class="section-header">Class/Module Index
|
85
|
+
<span class="search-toggle"><img src="../../images/find.png"
|
86
|
+
height="16" width="16" alt="[+]"
|
87
|
+
title="show/hide quicksearch" /></span></h3>
|
88
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
89
|
+
<fieldset>
|
90
|
+
<legend>Quicksearch</legend>
|
91
|
+
<input type="text" name="quicksearch" value=""
|
92
|
+
class="quicksearch-field" />
|
93
|
+
</fieldset>
|
94
|
+
</form>
|
95
|
+
|
96
|
+
<ul class="link-list">
|
97
|
+
|
98
|
+
<li><a href="../../NumRu.html">NumRu</a></li>
|
99
|
+
|
100
|
+
<li><a href="../../NumRu/GAnalysis.html">NumRu::GAnalysis</a></li>
|
101
|
+
|
102
|
+
<li><a href="../../NumRu/GAnalysis/BetaPlane.html">NumRu::GAnalysis::BetaPlane</a></li>
|
103
|
+
|
104
|
+
<li><a href="../../NumRu/GAnalysis/Fitting.html">NumRu::GAnalysis::Fitting</a></li>
|
105
|
+
|
106
|
+
<li><a href="../../NumRu/GAnalysis/LogP.html">NumRu::GAnalysis::LogP</a></li>
|
107
|
+
|
108
|
+
<li><a href="../../NumRu/GAnalysis/Met.html">NumRu::GAnalysis::Met</a></li>
|
109
|
+
|
110
|
+
<li><a href="../../NumRu/GAnalysis/MetZ.html">NumRu::GAnalysis::MetZ</a></li>
|
111
|
+
|
112
|
+
<li><a href="../../NumRu/GAnalysis/Planet.html">NumRu::GAnalysis::Planet</a></li>
|
113
|
+
|
114
|
+
<li><a href="../../NumRu/GAnalysis/QG.html">NumRu::GAnalysis::QG</a></li>
|
115
|
+
|
116
|
+
<li><a href="../../NumRu/GAnalysis/QG/Uninitialized.html">NumRu::GAnalysis::QG::Uninitialized</a></li>
|
117
|
+
|
118
|
+
<li><a href="../../NumRu/GAnalysis/QG_common.html">NumRu::GAnalysis::QG_common</a></li>
|
119
|
+
|
120
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere.html">NumRu::GAnalysis::QG_sphere</a></li>
|
121
|
+
|
122
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere_common.html">NumRu::GAnalysis::QG_sphere_common</a></li>
|
123
|
+
|
124
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere_div.html">NumRu::GAnalysis::QG_sphere_div</a></li>
|
125
|
+
|
126
|
+
<li><a href="../../NumRu/GAnalysis/SigmaCoord.html">NumRu::GAnalysis::SigmaCoord</a></li>
|
127
|
+
|
128
|
+
<li><a href="../../NumRu/GGraph.html">NumRu::GGraph</a></li>
|
129
|
+
|
130
|
+
<li><a href="../../NumRu/GPhys.html">NumRu::GPhys</a></li>
|
131
|
+
|
132
|
+
<li><a href="../../Object.html">Object</a></li>
|
133
|
+
|
134
|
+
</ul>
|
135
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div id="documentation">
|
143
|
+
<h1 class="module">NumRu::GAnalysis::LogP</h1>
|
144
|
+
|
145
|
+
<div id="description" class="description">
|
146
|
+
|
147
|
+
<p>module <a href="LogP.html">LogP</a> : log-pressure coordinate support</p>
|
148
|
+
|
149
|
+
</div><!-- description -->
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<!-- Constants -->
|
161
|
+
<div id="constants-list" class="section">
|
162
|
+
<h3 class="section-header">Constants</h3>
|
163
|
+
<dl>
|
164
|
+
|
165
|
+
<dt><a name="P00">P00</a></dt>
|
166
|
+
|
167
|
+
<dd class="description"><p><a href="LogP.html#P00">P00</a> = 1e5 Pa (1000 hPa)</p></dd>
|
168
|
+
|
169
|
+
|
170
|
+
</dl>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<!-- Methods -->
|
177
|
+
|
178
|
+
<div id="public-instance-method-details" class="method-section section">
|
179
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
180
|
+
|
181
|
+
|
182
|
+
<div id="h-method" class="method-detail ">
|
183
|
+
<a name="method-i-h"></a>
|
184
|
+
|
185
|
+
|
186
|
+
<div class="method-heading">
|
187
|
+
<span class="method-name">h</span><span
|
188
|
+
class="method-args">()</span>
|
189
|
+
<span class="method-click-advice">click to toggle source</span>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
|
195
|
+
<p>returns the current value of the log-p scale height (in UNumeric)</p>
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<div class="method-source-code" id="h-source">
|
200
|
+
<pre>
|
201
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/log_p.rb, line 27</span>
|
202
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">h</span>
|
203
|
+
<span class="ruby-identifier">@@H</span>.<span class="ruby-identifier">clone</span>
|
204
|
+
<span class="ruby-keyword">end</span></pre>
|
205
|
+
</div><!-- h-source -->
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</div><!-- h-method -->
|
213
|
+
|
214
|
+
|
215
|
+
<div id="p2z-method" class="method-detail ">
|
216
|
+
<a name="method-i-p2z"></a>
|
217
|
+
|
218
|
+
|
219
|
+
<div class="method-heading">
|
220
|
+
<span class="method-name">p2z</span><span
|
221
|
+
class="method-args">(p)</span>
|
222
|
+
<span class="method-click-advice">click to toggle source</span>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
|
226
|
+
<div class="method-description">
|
227
|
+
|
228
|
+
<p>convert pressure to log-p height</p>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<div class="method-source-code" id="p2z-source">
|
233
|
+
<pre>
|
234
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/log_p.rb, line 32</span>
|
235
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">p2z</span>(<span class="ruby-identifier">p</span>)
|
236
|
+
<span class="ruby-identifier">z</span> = (<span class="ruby-identifier">p</span><span class="ruby-operator">/</span><span class="ruby-constant">P00</span>).<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"1"</span>).<span class="ruby-identifier">log</span> * (<span class="ruby-operator">-</span><span class="ruby-identifier">@@H</span>)
|
237
|
+
<span class="ruby-identifier">z</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"z"</span>
|
238
|
+
<span class="ruby-identifier">z</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"log-p z"</span>
|
239
|
+
<span class="ruby-identifier">z</span>.<span class="ruby-identifier">del_att</span>(<span class="ruby-string">"positive"</span>)
|
240
|
+
<span class="ruby-identifier">z</span>
|
241
|
+
<span class="ruby-keyword">end</span></pre>
|
242
|
+
</div><!-- p2z-source -->
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
</div><!-- p2z-method -->
|
250
|
+
|
251
|
+
|
252
|
+
<div id="pcdata_dz-method" class="method-detail ">
|
253
|
+
<a name="method-i-pcdata_dz"></a>
|
254
|
+
|
255
|
+
|
256
|
+
<div class="method-heading">
|
257
|
+
<span class="method-name">pcdata_dz</span><span
|
258
|
+
class="method-args">(gphys, pdim=nil)</span>
|
259
|
+
<span class="method-click-advice">click to toggle source</span>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
|
263
|
+
<div class="method-description">
|
264
|
+
|
265
|
+
<p>del/delz applied to data with the p coordinate</p>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
<div class="method-source-code" id="pcdata_dz-source">
|
270
|
+
<pre>
|
271
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/log_p.rb, line 41</span>
|
272
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pcdata_dz</span>(<span class="ruby-identifier">gphys</span>, <span class="ruby-identifier">pdim</span>=<span class="ruby-keyword">nil</span>)
|
273
|
+
<span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gphys</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">pdim</span>
|
274
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">axis</span>(<span class="ruby-identifier">pdim</span>).<span class="ruby-identifier">to_gphys</span>
|
275
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">p2z</span>(<span class="ruby-identifier">p</span>.<span class="ruby-identifier">data</span>)
|
276
|
+
<span class="ruby-identifier">bc</span> = <span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-constant">LINEAR_EXT</span>
|
277
|
+
<span class="ruby-identifier">delz</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-identifier">pdim</span>, <span class="ruby-identifier">bc</span>, <span class="ruby-identifier">z</span>)
|
278
|
+
<span class="ruby-identifier">delz</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">name</span><span class="ruby-operator">+</span><span class="ruby-string">"_z"</span>
|
279
|
+
<span class="ruby-identifier">delz</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-node">"del/delz (#{gphys.long_name})"</span>
|
280
|
+
<span class="ruby-identifier">delz</span>
|
281
|
+
<span class="ruby-keyword">end</span></pre>
|
282
|
+
</div><!-- pcdata_dz-source -->
|
283
|
+
|
284
|
+
</div>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
</div><!-- pcdata_dz-method -->
|
290
|
+
|
291
|
+
|
292
|
+
<div id="pcdata_dz2-method" class="method-detail ">
|
293
|
+
<a name="method-i-pcdata_dz2"></a>
|
294
|
+
|
295
|
+
|
296
|
+
<div class="method-heading">
|
297
|
+
<span class="method-name">pcdata_dz2</span><span
|
298
|
+
class="method-args">(gphys, pdim=nil)</span>
|
299
|
+
<span class="method-click-advice">click to toggle source</span>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
<div class="method-description">
|
304
|
+
|
305
|
+
<p>del2/del2z applied to data with the p coordinate</p>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
<div class="method-source-code" id="pcdata_dz2-source">
|
310
|
+
<pre>
|
311
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/log_p.rb, line 53</span>
|
312
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pcdata_dz2</span>(<span class="ruby-identifier">gphys</span>, <span class="ruby-identifier">pdim</span>=<span class="ruby-keyword">nil</span>)
|
313
|
+
<span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gphys</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">pdim</span>
|
314
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">axis</span>(<span class="ruby-identifier">pdim</span>).<span class="ruby-identifier">to_gphys</span>
|
315
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">p2z</span>(<span class="ruby-identifier">p</span>.<span class="ruby-identifier">data</span>)
|
316
|
+
<span class="ruby-identifier">bc</span> = <span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-constant">LINEAR_EXT</span>
|
317
|
+
<span class="ruby-identifier">delz</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">deriv2nd</span>(<span class="ruby-identifier">pdim</span>, <span class="ruby-identifier">bc</span>, <span class="ruby-identifier">z</span>)
|
318
|
+
<span class="ruby-identifier">delz</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">name</span><span class="ruby-operator">+</span><span class="ruby-string">"_zz"</span>
|
319
|
+
<span class="ruby-identifier">delz</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-node">"del2/del2z (#{gphys.long_name})"</span>
|
320
|
+
<span class="ruby-identifier">delz</span>
|
321
|
+
<span class="ruby-keyword">end</span></pre>
|
322
|
+
</div><!-- pcdata_dz2-source -->
|
323
|
+
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</div><!-- pcdata_dz2-method -->
|
330
|
+
|
331
|
+
|
332
|
+
<div id="pcdata_pi_dz_p_dz-method" class="method-detail ">
|
333
|
+
<a name="method-i-pcdata_pi_dz_p_dz"></a>
|
334
|
+
|
335
|
+
|
336
|
+
<div class="method-heading">
|
337
|
+
<span class="method-name">pcdata_pi_dz_p_dz</span><span
|
338
|
+
class="method-args">(gphys, pdim=nil)</span>
|
339
|
+
<span class="method-click-advice">click to toggle source</span>
|
340
|
+
</div>
|
341
|
+
|
342
|
+
|
343
|
+
<div class="method-description">
|
344
|
+
|
345
|
+
<p>p^{-1} del_z ( p del_z self ) where del_z = del/del z</p>
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
<div class="method-source-code" id="pcdata_pi_dz_p_dz-source">
|
350
|
+
<pre>
|
351
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/log_p.rb, line 66</span>
|
352
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pcdata_pi_dz_p_dz</span>(<span class="ruby-identifier">gphys</span>, <span class="ruby-identifier">pdim</span>=<span class="ruby-keyword">nil</span>)
|
353
|
+
<span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gphys</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">pdim</span>
|
354
|
+
<span class="ruby-identifier">p</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">axis</span>(<span class="ruby-identifier">pdim</span>).<span class="ruby-identifier">to_gphys</span>
|
355
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">p2z</span>(<span class="ruby-identifier">p</span>.<span class="ruby-identifier">data</span>)
|
356
|
+
<span class="ruby-identifier">bc</span> = <span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-constant">LINEAR_EXT</span>
|
357
|
+
<span class="ruby-identifier">p_dz</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-identifier">pdim</span>, <span class="ruby-identifier">bc</span>, <span class="ruby-identifier">z</span>) * <span class="ruby-identifier">p</span>
|
358
|
+
<span class="ruby-identifier">pi_dz_p_p_dz</span> = <span class="ruby-identifier">p_dz</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-identifier">pdim</span>, <span class="ruby-identifier">bc</span>, <span class="ruby-identifier">z</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">p</span>
|
359
|
+
<span class="ruby-identifier">pi_dz_p_p_dz</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-node">"1/p del_z (p del_z #{gphys.name})"</span>
|
360
|
+
<span class="ruby-identifier">pi_dz_p_p_dz</span>
|
361
|
+
<span class="ruby-keyword">end</span></pre>
|
362
|
+
</div><!-- pcdata_pi_dz_p_dz-source -->
|
363
|
+
|
364
|
+
</div>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
</div><!-- pcdata_pi_dz_p_dz-method -->
|
370
|
+
|
371
|
+
|
372
|
+
<div id="set_h-method" class="method-detail ">
|
373
|
+
<a name="method-i-set_h"></a>
|
374
|
+
|
375
|
+
|
376
|
+
<div class="method-heading">
|
377
|
+
<span class="method-name">set_h</span><span
|
378
|
+
class="method-args">(h)</span>
|
379
|
+
<span class="method-click-advice">click to toggle source</span>
|
380
|
+
</div>
|
381
|
+
|
382
|
+
|
383
|
+
<div class="method-description">
|
384
|
+
|
385
|
+
<p>set the constant log-p scale height (default 7e3 m)</p>
|
386
|
+
|
387
|
+
<p>Argument</p>
|
388
|
+
<ul><li>
|
389
|
+
<p>h [Unumeric]</p>
|
390
|
+
</li></ul>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
<div class="method-source-code" id="set_h-source">
|
395
|
+
<pre>
|
396
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/log_p.rb, line 22</span>
|
397
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_h</span>(<span class="ruby-identifier">h</span>)
|
398
|
+
<span class="ruby-identifier">@@H</span> = <span class="ruby-identifier">h</span>
|
399
|
+
<span class="ruby-keyword">end</span></pre>
|
400
|
+
</div><!-- set_h-source -->
|
401
|
+
|
402
|
+
</div>
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
</div><!-- set_h-method -->
|
408
|
+
|
409
|
+
|
410
|
+
</div><!-- public-instance-method-details -->
|
411
|
+
|
412
|
+
</div><!-- 5Buntitled-5D -->
|
413
|
+
|
414
|
+
|
415
|
+
</div><!-- documentation -->
|
416
|
+
|
417
|
+
<div id="validator-badges">
|
418
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
419
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
420
|
+
Rdoc Generator</a> 2</small>.</p>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
</body>
|
424
|
+
</html>
|
425
|
+
|
@@ -0,0 +1,2021 @@
|
|
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::Met</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/met_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="../../lib/numru/ganalysis/met.rb">../../lib/numru/ganalysis/met.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
|
+
|
54
|
+
|
55
|
+
<!-- Method Quickref -->
|
56
|
+
<div id="method-list-section" class="section">
|
57
|
+
<h3 class="section-header">Methods</h3>
|
58
|
+
<ul class="link-list">
|
59
|
+
|
60
|
+
<li><a href="#method-c-e_sat_ice">::e_sat_ice</a></li>
|
61
|
+
|
62
|
+
<li><a href="#method-i-consider_ice">#consider_ice</a></li>
|
63
|
+
|
64
|
+
<li><a href="#method-i-consider_ice-3D">#consider_ice=</a></li>
|
65
|
+
|
66
|
+
<li><a href="#method-i-convert_units2Pa">#convert_units2Pa</a></li>
|
67
|
+
|
68
|
+
<li><a href="#method-i-df_dx_vialogscale">#df_dx_vialogscale</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-i-e2q">#e2q</a></li>
|
71
|
+
|
72
|
+
<li><a href="#method-i-e2r">#e2r</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-e_sat">#e_sat</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-e_sat_bolton">#e_sat_bolton</a></li>
|
77
|
+
|
78
|
+
<li><a href="#method-i-e_sat_emanuel_ice">#e_sat_emanuel_ice</a></li>
|
79
|
+
|
80
|
+
<li><a href="#method-i-e_sat_emanuel_water">#e_sat_emanuel_water</a></li>
|
81
|
+
|
82
|
+
<li><a href="#method-i-find_prs_d">#find_prs_d</a></li>
|
83
|
+
|
84
|
+
<li><a href="#method-i-frontogenesis_func">#frontogenesis_func</a></li>
|
85
|
+
|
86
|
+
<li><a href="#method-i-g">#g</a></li>
|
87
|
+
|
88
|
+
<li><a href="#method-i-get_prs">#get_prs</a></li>
|
89
|
+
|
90
|
+
<li><a href="#method-i-ice_thres">#ice_thres</a></li>
|
91
|
+
|
92
|
+
<li><a href="#method-i-ice_thres-3D">#ice_thres=</a></li>
|
93
|
+
|
94
|
+
<li><a href="#method-i-interpolate_onto_theta">#interpolate_onto_theta</a></li>
|
95
|
+
|
96
|
+
<li><a href="#method-i-lat">#lat</a></li>
|
97
|
+
|
98
|
+
<li><a href="#method-i-pv_on_p">#pv_on_p</a></li>
|
99
|
+
|
100
|
+
<li><a href="#method-i-pv_on_theta">#pv_on_theta</a></li>
|
101
|
+
|
102
|
+
<li><a href="#method-i-q2e">#q2e</a></li>
|
103
|
+
|
104
|
+
<li><a href="#method-i-q2r">#q2r</a></li>
|
105
|
+
|
106
|
+
<li><a href="#method-i-r2e">#r2e</a></li>
|
107
|
+
|
108
|
+
<li><a href="#method-i-r2q">#r2q</a></li>
|
109
|
+
|
110
|
+
<li><a href="#method-i-rh2e">#rh2e</a></li>
|
111
|
+
|
112
|
+
<li><a href="#method-i-set_e_sat_water">#set_e_sat_water</a></li>
|
113
|
+
|
114
|
+
<li><a href="#method-i-set_g">#set_g</a></li>
|
115
|
+
|
116
|
+
<li><a href="#method-i-sigma_inv">#sigma_inv</a></li>
|
117
|
+
|
118
|
+
<li><a href="#method-i-temp2theta">#temp2theta</a></li>
|
119
|
+
|
120
|
+
<li><a href="#method-i-theta_e">#theta_e</a></li>
|
121
|
+
|
122
|
+
<li><a href="#method-i-theta_es">#theta_es</a></li>
|
123
|
+
|
124
|
+
<li><a href="#method-i-z2geostrophic_wind">#z2geostrophic_wind</a></li>
|
125
|
+
|
126
|
+
</ul>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div id="project-metadata">
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<div id="classindex-section" class="section project-section">
|
138
|
+
<h3 class="section-header">Class/Module Index
|
139
|
+
<span class="search-toggle"><img src="../../images/find.png"
|
140
|
+
height="16" width="16" alt="[+]"
|
141
|
+
title="show/hide quicksearch" /></span></h3>
|
142
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
143
|
+
<fieldset>
|
144
|
+
<legend>Quicksearch</legend>
|
145
|
+
<input type="text" name="quicksearch" value=""
|
146
|
+
class="quicksearch-field" />
|
147
|
+
</fieldset>
|
148
|
+
</form>
|
149
|
+
|
150
|
+
<ul class="link-list">
|
151
|
+
|
152
|
+
<li><a href="../../NumRu.html">NumRu</a></li>
|
153
|
+
|
154
|
+
<li><a href="../../NumRu/GAnalysis.html">NumRu::GAnalysis</a></li>
|
155
|
+
|
156
|
+
<li><a href="../../NumRu/GAnalysis/BetaPlane.html">NumRu::GAnalysis::BetaPlane</a></li>
|
157
|
+
|
158
|
+
<li><a href="../../NumRu/GAnalysis/Fitting.html">NumRu::GAnalysis::Fitting</a></li>
|
159
|
+
|
160
|
+
<li><a href="../../NumRu/GAnalysis/LogP.html">NumRu::GAnalysis::LogP</a></li>
|
161
|
+
|
162
|
+
<li><a href="../../NumRu/GAnalysis/Met.html">NumRu::GAnalysis::Met</a></li>
|
163
|
+
|
164
|
+
<li><a href="../../NumRu/GAnalysis/MetZ.html">NumRu::GAnalysis::MetZ</a></li>
|
165
|
+
|
166
|
+
<li><a href="../../NumRu/GAnalysis/Planet.html">NumRu::GAnalysis::Planet</a></li>
|
167
|
+
|
168
|
+
<li><a href="../../NumRu/GAnalysis/QG.html">NumRu::GAnalysis::QG</a></li>
|
169
|
+
|
170
|
+
<li><a href="../../NumRu/GAnalysis/QG/Uninitialized.html">NumRu::GAnalysis::QG::Uninitialized</a></li>
|
171
|
+
|
172
|
+
<li><a href="../../NumRu/GAnalysis/QG_common.html">NumRu::GAnalysis::QG_common</a></li>
|
173
|
+
|
174
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere.html">NumRu::GAnalysis::QG_sphere</a></li>
|
175
|
+
|
176
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere_common.html">NumRu::GAnalysis::QG_sphere_common</a></li>
|
177
|
+
|
178
|
+
<li><a href="../../NumRu/GAnalysis/QG_sphere_div.html">NumRu::GAnalysis::QG_sphere_div</a></li>
|
179
|
+
|
180
|
+
<li><a href="../../NumRu/GAnalysis/SigmaCoord.html">NumRu::GAnalysis::SigmaCoord</a></li>
|
181
|
+
|
182
|
+
<li><a href="../../NumRu/GGraph.html">NumRu::GGraph</a></li>
|
183
|
+
|
184
|
+
<li><a href="../../NumRu/GPhys.html">NumRu::GPhys</a></li>
|
185
|
+
|
186
|
+
<li><a href="../../Object.html">Object</a></li>
|
187
|
+
|
188
|
+
</ul>
|
189
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
</div>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
<div id="documentation">
|
197
|
+
<h1 class="module">NumRu::GAnalysis::Met</h1>
|
198
|
+
|
199
|
+
<div id="description" class="description">
|
200
|
+
|
201
|
+
<p>Meteorological analysis</p>
|
202
|
+
|
203
|
+
<p>USEFUL METHODS</p>
|
204
|
+
<ul><li>
|
205
|
+
<p>temp2theta</p>
|
206
|
+
</li><li>
|
207
|
+
<p><a href="Met.html#method-i-pv_on_theta">pv_on_theta</a></p>
|
208
|
+
</li><li>
|
209
|
+
<p><a
|
210
|
+
href="Met.html#method-i-interpolate_onto_theta">interpolate_onto_theta</a></p>
|
211
|
+
</li></ul>
|
212
|
+
|
213
|
+
</div><!-- description -->
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
<!-- Constants -->
|
225
|
+
<div id="constants-list" class="section">
|
226
|
+
<h3 class="section-header">Constants</h3>
|
227
|
+
<dl>
|
228
|
+
|
229
|
+
<dt><a name="Cp">Cp</a></dt>
|
230
|
+
|
231
|
+
<dd class="description"></dd>
|
232
|
+
|
233
|
+
|
234
|
+
<dt><a name="Cpv">Cpv</a></dt>
|
235
|
+
|
236
|
+
<dd class="description"></dd>
|
237
|
+
|
238
|
+
|
239
|
+
<dt><a name="Kappa">Kappa</a></dt>
|
240
|
+
|
241
|
+
<dd class="description"></dd>
|
242
|
+
|
243
|
+
|
244
|
+
<dt><a name="Lat0">Lat0</a></dt>
|
245
|
+
|
246
|
+
<dd class="description"></dd>
|
247
|
+
|
248
|
+
|
249
|
+
<dt><a name="P00">P00</a></dt>
|
250
|
+
|
251
|
+
<dd class="description"></dd>
|
252
|
+
|
253
|
+
|
254
|
+
<dt><a name="R">R</a></dt>
|
255
|
+
|
256
|
+
<dd class="description"><p>< Themodynamic constants for the Earth’s atmosphere ></p></dd>
|
257
|
+
|
258
|
+
|
259
|
+
<dt><a name="Rv">Rv</a></dt>
|
260
|
+
|
261
|
+
<dd class="description"></dd>
|
262
|
+
|
263
|
+
|
264
|
+
<dt><a name="T0">T0</a></dt>
|
265
|
+
|
266
|
+
<dd class="description"></dd>
|
267
|
+
|
268
|
+
|
269
|
+
</dl>
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
<!-- Methods -->
|
276
|
+
|
277
|
+
<div id="public-class-method-details" class="method-section section">
|
278
|
+
<h3 class="section-header">Public Class Methods</h3>
|
279
|
+
|
280
|
+
|
281
|
+
<div id="e_sat_ice-method" class="method-detail method-alias">
|
282
|
+
<a name="method-c-e_sat_ice"></a>
|
283
|
+
|
284
|
+
|
285
|
+
<div class="method-heading">
|
286
|
+
<span class="method-name">e_sat_ice</span><span
|
287
|
+
class="method-args">(temp, mask=nil)</span>
|
288
|
+
<span class="method-click-advice">click to toggle source</span>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
|
292
|
+
<div class="method-description">
|
293
|
+
|
294
|
+
<p>currently, only a single formula is avilable for ice</p>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
</div>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
<div class="aliases">
|
304
|
+
Alias for: <a href="Met.html#method-i-e_sat_emanuel_ice">e_sat_emanuel_ice</a>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
</div><!-- e_sat_ice-method -->
|
308
|
+
|
309
|
+
|
310
|
+
</div><!-- public-class-method-details -->
|
311
|
+
|
312
|
+
<div id="public-instance-method-details" class="method-section section">
|
313
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
314
|
+
|
315
|
+
|
316
|
+
<div id="consider_ice-method" class="method-detail ">
|
317
|
+
<a name="method-i-consider_ice"></a>
|
318
|
+
|
319
|
+
|
320
|
+
<div class="method-heading">
|
321
|
+
<span class="method-name">consider_ice</span><span
|
322
|
+
class="method-args">()</span>
|
323
|
+
<span class="method-click-advice">click to toggle source</span>
|
324
|
+
</div>
|
325
|
+
|
326
|
+
|
327
|
+
<div class="method-description">
|
328
|
+
|
329
|
+
<p>whether or not ice is considered in the water phase change</p>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
<div class="method-source-code" id="consider_ice-source">
|
334
|
+
<pre>
|
335
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 458</span>
|
336
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">consider_ice</span>
|
337
|
+
<span class="ruby-identifier">@@consider_ice</span>
|
338
|
+
<span class="ruby-keyword">end</span></pre>
|
339
|
+
</div><!-- consider_ice-source -->
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
</div><!-- consider_ice-method -->
|
347
|
+
|
348
|
+
|
349
|
+
<div id="consider_ice-3D-method" class="method-detail ">
|
350
|
+
<a name="method-i-consider_ice-3D"></a>
|
351
|
+
|
352
|
+
|
353
|
+
<div class="method-heading">
|
354
|
+
<span class="method-name">consider_ice=</span><span
|
355
|
+
class="method-args">(t_or_f)</span>
|
356
|
+
<span class="method-click-advice">click to toggle source</span>
|
357
|
+
</div>
|
358
|
+
|
359
|
+
|
360
|
+
<div class="method-description">
|
361
|
+
|
362
|
+
<p>set whether or not ice is considered in the water phase change</p>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
<div class="method-source-code" id="consider_ice-3D-source">
|
367
|
+
<pre>
|
368
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 463</span>
|
369
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">consider_ice=</span>(<span class="ruby-identifier">t_or_f</span>)
|
370
|
+
<span class="ruby-identifier">@@consider_ice</span>=<span class="ruby-identifier">t_or_f</span>
|
371
|
+
<span class="ruby-keyword">end</span></pre>
|
372
|
+
</div><!-- consider_ice-3D-source -->
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</div><!-- consider_ice-3D-method -->
|
380
|
+
|
381
|
+
|
382
|
+
<div id="convert_units2Pa-method" class="method-detail ">
|
383
|
+
<a name="method-i-convert_units2Pa"></a>
|
384
|
+
|
385
|
+
|
386
|
+
<div class="method-heading">
|
387
|
+
<span class="method-name">convert_units2Pa</span><span
|
388
|
+
class="method-args">(prs)</span>
|
389
|
+
<span class="method-click-advice">click to toggle source</span>
|
390
|
+
</div>
|
391
|
+
|
392
|
+
|
393
|
+
<div class="method-description">
|
394
|
+
|
395
|
+
<p>Convert units into Pa. To deal with old versions of NumRu::Units that do
|
396
|
+
not support “millibar”.</p>
|
397
|
+
|
398
|
+
<p>ARGUMENT</p>
|
399
|
+
<ul><li>
|
400
|
+
<p>prs [<a href="../GPhys.html">GPhys</a> and UNumeric]</p>
|
401
|
+
</li></ul>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
<div class="method-source-code" id="convert_units2Pa-source">
|
406
|
+
<pre>
|
407
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 398</span>
|
408
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">convert_units2Pa</span>(<span class="ruby-identifier">prs</span>)
|
409
|
+
<span class="ruby-identifier">pa</span> = <span class="ruby-constant">Units</span>[<span class="ruby-string">"Pa"</span>]
|
410
|
+
<span class="ruby-identifier">un</span> = <span class="ruby-identifier">prs</span>.<span class="ruby-identifier">units</span>
|
411
|
+
<span class="ruby-keyword">if</span> ((<span class="ruby-identifier">un</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">pa</span>) <span class="ruby-keyword">and</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">un</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">pa</span>))
|
412
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">convert_units</span>(<span class="ruby-identifier">prs</span>, <span class="ruby-identifier">pa</span>)
|
413
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">un</span>.<span class="ruby-identifier">to_s</span><span class="ruby-operator">==</span><span class="ruby-string">"millibar"</span>
|
414
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">UNumeric</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">prs</span>
|
415
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-constant">UNumeric</span>[<span class="ruby-identifier">prs</span>.<span class="ruby-identifier">val</span>*<span class="ruby-value">100</span>, <span class="ruby-string">"Pa"</span>]
|
416
|
+
<span class="ruby-keyword">else</span>
|
417
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-identifier">prs</span>*<span class="ruby-value">100</span>
|
418
|
+
<span class="ruby-identifier">ret</span>.<span class="ruby-identifier">units</span> = <span class="ruby-string">"Pa"</span>
|
419
|
+
<span class="ruby-keyword">end</span>
|
420
|
+
<span class="ruby-identifier">ret</span>
|
421
|
+
<span class="ruby-keyword">else</span>
|
422
|
+
<span class="ruby-identifier">prs</span>
|
423
|
+
<span class="ruby-keyword">end</span>
|
424
|
+
<span class="ruby-keyword">end</span></pre>
|
425
|
+
</div><!-- convert_units2Pa-source -->
|
426
|
+
|
427
|
+
</div>
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
</div><!-- convert_units2Pa-method -->
|
433
|
+
|
434
|
+
|
435
|
+
<div id="df_dx_vialogscale-method" class="method-detail ">
|
436
|
+
<a name="method-i-df_dx_vialogscale"></a>
|
437
|
+
|
438
|
+
|
439
|
+
<div class="method-heading">
|
440
|
+
<span class="method-name">df_dx_vialogscale</span><span
|
441
|
+
class="method-args">(f, x, dim)</span>
|
442
|
+
<span class="method-click-advice">click to toggle source</span>
|
443
|
+
</div>
|
444
|
+
|
445
|
+
|
446
|
+
<div class="method-description">
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
<div class="method-source-code" id="df_dx_vialogscale-source">
|
453
|
+
<pre>
|
454
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 440</span>
|
455
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">df_dx_vialogscale</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">x</span>, <span class="ruby-identifier">dim</span>)
|
456
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">log</span>(<span class="ruby-identifier">x</span>)
|
457
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">GPhys</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">f</span>
|
458
|
+
<span class="ruby-identifier">mdl</span> = <span class="ruby-constant">NumRu</span><span class="ruby-operator">::</span><span class="ruby-constant">GPhys</span><span class="ruby-operator">::</span><span class="ruby-constant">Derivative</span>
|
459
|
+
<span class="ruby-identifier">dfdz</span> = <span class="ruby-identifier">mdl</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">dim</span>, <span class="ruby-identifier">mdl</span><span class="ruby-operator">::</span><span class="ruby-constant">LINEAR_EXT</span>, <span class="ruby-identifier">z</span>)
|
460
|
+
<span class="ruby-keyword">else</span>
|
461
|
+
<span class="ruby-identifier">mdl</span> = <span class="ruby-constant">NumRu</span><span class="ruby-operator">::</span><span class="ruby-constant">Derivative</span>
|
462
|
+
<span class="ruby-identifier">dfdz</span> = <span class="ruby-identifier">mdl</span>.<span class="ruby-identifier">threepoint_O2nd_deriv</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">z</span>, <span class="ruby-identifier">dim</span>, <span class="ruby-identifier">mdl</span><span class="ruby-operator">::</span><span class="ruby-constant">LINEAR_EXT</span>)
|
463
|
+
<span class="ruby-keyword">end</span>
|
464
|
+
<span class="ruby-identifier">dfdz</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">x</span>
|
465
|
+
<span class="ruby-keyword">end</span></pre>
|
466
|
+
</div><!-- df_dx_vialogscale-source -->
|
467
|
+
|
468
|
+
</div>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
</div><!-- df_dx_vialogscale-method -->
|
474
|
+
|
475
|
+
|
476
|
+
<div id="e2q-method" class="method-detail ">
|
477
|
+
<a name="method-i-e2q"></a>
|
478
|
+
|
479
|
+
|
480
|
+
<div class="method-heading">
|
481
|
+
<span class="method-name">e2q</span><span
|
482
|
+
class="method-args">(e,prs=nil)</span>
|
483
|
+
<span class="method-click-advice">click to toggle source</span>
|
484
|
+
</div>
|
485
|
+
|
486
|
+
|
487
|
+
<div class="method-description">
|
488
|
+
|
489
|
+
<p>water vapor pressure -> specific humidity</p>
|
490
|
+
|
491
|
+
<p>ARGUMENTS</p>
|
492
|
+
<ul><li>
|
493
|
+
<p>e: water vapor pressure</p>
|
494
|
+
</li><li>
|
495
|
+
<p>prs: pressure</p>
|
496
|
+
</li></ul>
|
497
|
+
|
498
|
+
<p>RETURN VALUE</p>
|
499
|
+
<ul><li>
|
500
|
+
<p>q: specific humidity</p>
|
501
|
+
</li></ul>
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
<div class="method-source-code" id="e2q-source">
|
506
|
+
<pre>
|
507
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 567</span>
|
508
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">e2q</span>(<span class="ruby-identifier">e</span>,<span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
509
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">e</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">prs</span>
|
510
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">convert_units</span>(<span class="ruby-identifier">prs</span>,<span class="ruby-identifier">e</span>.<span class="ruby-identifier">units</span>)
|
511
|
+
<span class="ruby-identifier">rratio</span> = <span class="ruby-constant">R</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Rv</span>
|
512
|
+
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">rratio</span> * <span class="ruby-identifier">e</span> <span class="ruby-operator">/</span> (<span class="ruby-identifier">prs</span><span class="ruby-operator">-</span>(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">rratio</span>)*<span class="ruby-identifier">e</span>)
|
513
|
+
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"q"</span>
|
514
|
+
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"specific humidity"</span>
|
515
|
+
<span class="ruby-identifier">q</span>
|
516
|
+
<span class="ruby-keyword">end</span></pre>
|
517
|
+
</div><!-- e2q-source -->
|
518
|
+
|
519
|
+
</div>
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
</div><!-- e2q-method -->
|
525
|
+
|
526
|
+
|
527
|
+
<div id="e2r-method" class="method-detail ">
|
528
|
+
<a name="method-i-e2r"></a>
|
529
|
+
|
530
|
+
|
531
|
+
<div class="method-heading">
|
532
|
+
<span class="method-name">e2r</span><span
|
533
|
+
class="method-args">(e,prs=nil)</span>
|
534
|
+
<span class="method-click-advice">click to toggle source</span>
|
535
|
+
</div>
|
536
|
+
|
537
|
+
|
538
|
+
<div class="method-description">
|
539
|
+
|
540
|
+
<p>water vapor pressure -> mixing ratio</p>
|
541
|
+
|
542
|
+
<p>ARGUMENTS</p>
|
543
|
+
<ul><li>
|
544
|
+
<p>e: water vapor pressure</p>
|
545
|
+
</li><li>
|
546
|
+
<p>prs: pressure</p>
|
547
|
+
</li></ul>
|
548
|
+
|
549
|
+
<p>RETURN VALUE</p>
|
550
|
+
<ul><li>
|
551
|
+
<p>r: mixing ratio</p>
|
552
|
+
</li></ul>
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
<div class="method-source-code" id="e2r-source">
|
557
|
+
<pre>
|
558
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 531</span>
|
559
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">e2r</span>(<span class="ruby-identifier">e</span>,<span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
560
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">e</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">prs</span>
|
561
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">convert_units</span>(<span class="ruby-identifier">prs</span>,<span class="ruby-identifier">e</span>.<span class="ruby-identifier">units</span>)
|
562
|
+
<span class="ruby-identifier">rratio</span> = <span class="ruby-constant">R</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Rv</span>
|
563
|
+
<span class="ruby-identifier">r</span> = <span class="ruby-identifier">rratio</span> * <span class="ruby-identifier">e</span> <span class="ruby-operator">/</span> (<span class="ruby-identifier">prs</span><span class="ruby-operator">-</span><span class="ruby-identifier">e</span>)
|
564
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"r"</span>
|
565
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"mixing ratio"</span>
|
566
|
+
<span class="ruby-identifier">r</span>
|
567
|
+
<span class="ruby-keyword">end</span></pre>
|
568
|
+
</div><!-- e2r-source -->
|
569
|
+
|
570
|
+
</div>
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
</div><!-- e2r-method -->
|
576
|
+
|
577
|
+
|
578
|
+
<div id="e_sat-method" class="method-detail ">
|
579
|
+
<a name="method-i-e_sat"></a>
|
580
|
+
|
581
|
+
|
582
|
+
<div class="method-heading">
|
583
|
+
<span class="method-name">e_sat</span><span
|
584
|
+
class="method-args">(temp)</span>
|
585
|
+
<span class="method-click-advice">click to toggle source</span>
|
586
|
+
</div>
|
587
|
+
|
588
|
+
|
589
|
+
<div class="method-description">
|
590
|
+
|
591
|
+
<p>Calculates saturation water vapor pressure using enhanced</p>
|
592
|
+
|
593
|
+
<p>ARGUMENTS</p>
|
594
|
+
<ul><li>
|
595
|
+
<p>temp: temperature</p>
|
596
|
+
</li></ul>
|
597
|
+
|
598
|
+
<p>RETURN VALUE</p>
|
599
|
+
<ul><li>
|
600
|
+
<p>es: saturation water vapor pressure</p>
|
601
|
+
</li></ul>
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
<div class="method-source-code" id="e_sat-source">
|
606
|
+
<pre>
|
607
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 695</span>
|
608
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">e_sat</span>(<span class="ruby-identifier">temp</span>)
|
609
|
+
|
610
|
+
<span class="ruby-identifier">ice</span> = <span class="ruby-identifier">@@consider_ice</span> <span class="ruby-operator">&&</span> ( <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">lt</span>(<span class="ruby-identifier">@@ice_thres</span>) )
|
611
|
+
<span class="ruby-comment">#ice = ice.to_na</span>
|
612
|
+
<span class="ruby-identifier">water</span> = <span class="ruby-operator">!</span><span class="ruby-identifier">@@consider_ice</span> <span class="ruby-operator">||</span> ( (<span class="ruby-identifier">ice</span><span class="ruby-operator">==</span><span class="ruby-keyword">true</span><span class="ruby-operator">||</span><span class="ruby-identifier">ice</span><span class="ruby-operator">==</span><span class="ruby-keyword">false</span>) <span class="ruby-operator">?</span> <span class="ruby-operator">!</span><span class="ruby-identifier">ice</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">ice</span>.<span class="ruby-identifier">not</span>)
|
613
|
+
|
614
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">water</span>
|
615
|
+
<span class="ruby-identifier">es</span> = <span class="ruby-identifier">e_sat_water</span>(<span class="ruby-identifier">temp</span>)
|
616
|
+
<span class="ruby-keyword">end</span>
|
617
|
+
|
618
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">ice</span>
|
619
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">true</span>
|
620
|
+
<span class="ruby-identifier">es</span> = <span class="ruby-identifier">e_sat_ice</span>(<span class="ruby-identifier">temp</span>)
|
621
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">NArray</span>, <span class="ruby-constant">NArrayMiss</span>
|
622
|
+
<span class="ruby-identifier">es</span>[<span class="ruby-identifier">ice</span>] = <span class="ruby-identifier">e_sat_ice</span>(<span class="ruby-identifier">temp</span>,<span class="ruby-identifier">ice</span>).<span class="ruby-identifier">val</span>[<span class="ruby-identifier">ice</span>]
|
623
|
+
<span class="ruby-keyword">end</span>
|
624
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"e_sat"</span>
|
625
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"e_sat"</span>
|
626
|
+
<span class="ruby-identifier">es</span>
|
627
|
+
<span class="ruby-keyword">end</span></pre>
|
628
|
+
</div><!-- e_sat-source -->
|
629
|
+
|
630
|
+
</div>
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
</div><!-- e_sat-method -->
|
636
|
+
|
637
|
+
|
638
|
+
<div id="e_sat_bolton-method" class="method-detail ">
|
639
|
+
<a name="method-i-e_sat_bolton"></a>
|
640
|
+
|
641
|
+
|
642
|
+
<div class="method-heading">
|
643
|
+
<span class="method-name">e_sat_bolton</span><span
|
644
|
+
class="method-args">(temp)</span>
|
645
|
+
<span class="method-click-advice">click to toggle source</span>
|
646
|
+
</div>
|
647
|
+
|
648
|
+
|
649
|
+
<div class="method-description">
|
650
|
+
|
651
|
+
<p>Bolton formula for saturation water vapor pressure against water</p>
|
652
|
+
|
653
|
+
<p>ARGUMENTS</p>
|
654
|
+
<ul><li>
|
655
|
+
<p>temp: temperature</p>
|
656
|
+
</li></ul>
|
657
|
+
|
658
|
+
<p>RETURN VALUE</p>
|
659
|
+
<ul><li>
|
660
|
+
<p>es: saturation water vapor pressure [Pa]</p>
|
661
|
+
</li></ul>
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
<div class="method-source-code" id="e_sat_bolton-source">
|
666
|
+
<pre>
|
667
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 601</span>
|
668
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">e_sat_bolton</span>(<span class="ruby-identifier">temp</span>)
|
669
|
+
<span class="ruby-identifier">tempC</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"degC"</span>)
|
670
|
+
<span class="ruby-identifier">es</span> = <span class="ruby-constant">UNumeric</span>[<span class="ruby-value">6.112e2</span>,<span class="ruby-string">"Pa"</span>] *
|
671
|
+
<span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">exp</span>( <span class="ruby-value">17.67</span> * <span class="ruby-identifier">tempC</span> <span class="ruby-operator">/</span> (<span class="ruby-identifier">tempC</span> <span class="ruby-operator">+</span> <span class="ruby-constant">UNumeric</span>[<span class="ruby-value">243.5</span>,<span class="ruby-string">"degC"</span>] ) )
|
672
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"e_sat"</span>
|
673
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"e_sat_water bolton"</span>
|
674
|
+
<span class="ruby-identifier">es</span>
|
675
|
+
<span class="ruby-keyword">end</span></pre>
|
676
|
+
</div><!-- e_sat_bolton-source -->
|
677
|
+
|
678
|
+
</div>
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
</div><!-- e_sat_bolton-method -->
|
684
|
+
|
685
|
+
|
686
|
+
<div id="e_sat_emanuel_ice-method" class="method-detail ">
|
687
|
+
<a name="method-i-e_sat_emanuel_ice"></a>
|
688
|
+
|
689
|
+
|
690
|
+
<div class="method-heading">
|
691
|
+
<span class="method-name">e_sat_emanuel_ice</span><span
|
692
|
+
class="method-args">(temp, mask=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>Saturation water vapor pressure against ice.</p>
|
700
|
+
|
701
|
+
<p>Emanuel (1994) eq.(4.4.15)</p>
|
702
|
+
|
703
|
+
<p>ARGUMENTS</p>
|
704
|
+
<ul><li>
|
705
|
+
<p>temp: temperature</p>
|
706
|
+
</li></ul>
|
707
|
+
|
708
|
+
<p>RETURN VALUE</p>
|
709
|
+
<ul><li>
|
710
|
+
<p>es: saturation water vapor pressure [Pa]</p>
|
711
|
+
</li></ul>
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
<div class="method-source-code" id="e_sat_emanuel_ice-source">
|
716
|
+
<pre>
|
717
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 646</span>
|
718
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">e_sat_emanuel_ice</span>(<span class="ruby-identifier">temp</span>, <span class="ruby-identifier">mask</span>=<span class="ruby-keyword">nil</span>)
|
719
|
+
<span class="ruby-identifier">es</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">copy</span>
|
720
|
+
<span class="ruby-identifier">tempK</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"K"</span>).<span class="ruby-identifier">val</span> <span class="ruby-comment"># units removed</span>
|
721
|
+
<span class="ruby-identifier">tempK</span> = <span class="ruby-identifier">tempK</span>[<span class="ruby-identifier">mask</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">mask</span>
|
722
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-value">23.33086</span> <span class="ruby-operator">-</span> <span class="ruby-value">6111.72784</span><span class="ruby-operator">/</span><span class="ruby-identifier">tempK</span> <span class="ruby-operator">+</span> <span class="ruby-value">0.15215</span> * <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">log</span>(<span class="ruby-identifier">tempK</span>)
|
723
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">mask</span>
|
724
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">replace_val</span>( <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">exp</span>(<span class="ruby-identifier">e</span>) * <span class="ruby-value">100.0</span> )
|
725
|
+
<span class="ruby-keyword">else</span>
|
726
|
+
<span class="ruby-identifier">es</span>[<span class="ruby-keyword">false</span>] = <span class="ruby-value">0</span>
|
727
|
+
<span class="ruby-identifier">es</span>[<span class="ruby-identifier">mask</span>] = <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">exp</span>(<span class="ruby-identifier">e</span>) * <span class="ruby-value">100.0</span>
|
728
|
+
<span class="ruby-keyword">end</span>
|
729
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">units</span> = <span class="ruby-string">"Pa"</span>
|
730
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"e_sat_ice"</span>
|
731
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"e_sat_ice emanuel"</span>
|
732
|
+
<span class="ruby-identifier">es</span>
|
733
|
+
<span class="ruby-keyword">end</span></pre>
|
734
|
+
</div><!-- e_sat_emanuel_ice-source -->
|
735
|
+
|
736
|
+
</div>
|
737
|
+
|
738
|
+
|
739
|
+
<div class="aliases">
|
740
|
+
Also aliased as: <a href="Met.html#method-i-e_sat_ice">e_sat_ice</a>
|
741
|
+
</div>
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
</div><!-- e_sat_emanuel_ice-method -->
|
746
|
+
|
747
|
+
|
748
|
+
<div id="e_sat_emanuel_water-method" class="method-detail ">
|
749
|
+
<a name="method-i-e_sat_emanuel_water"></a>
|
750
|
+
|
751
|
+
|
752
|
+
<div class="method-heading">
|
753
|
+
<span class="method-name">e_sat_emanuel_water</span><span
|
754
|
+
class="method-args">(temp, mask=nil)</span>
|
755
|
+
<span class="method-click-advice">click to toggle source</span>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
|
759
|
+
<div class="method-description">
|
760
|
+
|
761
|
+
<p>saturation water vapor pressure against ice.</p>
|
762
|
+
|
763
|
+
<p>Emanuel (1994) eq.(4.4.15)</p>
|
764
|
+
|
765
|
+
<p>ARGUMENTS</p>
|
766
|
+
<ul><li>
|
767
|
+
<p>temp: temperature</p>
|
768
|
+
</li></ul>
|
769
|
+
|
770
|
+
<p>RETURN VALUE</p>
|
771
|
+
<ul><li>
|
772
|
+
<p>es: saturation water vapor pressure [Pa]</p>
|
773
|
+
</li></ul>
|
774
|
+
|
775
|
+
|
776
|
+
|
777
|
+
<div class="method-source-code" id="e_sat_emanuel_water-source">
|
778
|
+
<pre>
|
779
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 619</span>
|
780
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">e_sat_emanuel_water</span>(<span class="ruby-identifier">temp</span>, <span class="ruby-identifier">mask</span>=<span class="ruby-keyword">nil</span>)
|
781
|
+
<span class="ruby-identifier">es</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">copy</span>
|
782
|
+
<span class="ruby-identifier">tempK</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"K"</span>).<span class="ruby-identifier">val</span> <span class="ruby-comment"># units removed</span>
|
783
|
+
<span class="ruby-identifier">tempK</span> = <span class="ruby-identifier">tempK</span>[<span class="ruby-identifier">mask</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">mask</span>
|
784
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-value">53.67957</span> <span class="ruby-operator">-</span> <span class="ruby-value">6743.769</span><span class="ruby-operator">/</span><span class="ruby-identifier">tempK</span> <span class="ruby-operator">-</span> <span class="ruby-value">4.8451</span> * <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">log</span>(<span class="ruby-identifier">tempK</span>)
|
785
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">mask</span>
|
786
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">replace_val</span>( <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">exp</span>(<span class="ruby-identifier">e</span>) * <span class="ruby-value">100.0</span> )
|
787
|
+
<span class="ruby-keyword">else</span>
|
788
|
+
<span class="ruby-identifier">es</span>[<span class="ruby-keyword">false</span>] = <span class="ruby-value">0</span>
|
789
|
+
<span class="ruby-identifier">es</span>[<span class="ruby-identifier">mask</span>] = <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">exp</span>(<span class="ruby-identifier">e</span>) * <span class="ruby-value">100.0</span>
|
790
|
+
<span class="ruby-keyword">end</span>
|
791
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">units</span> = <span class="ruby-string">"Pa"</span>
|
792
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"e_sat_ice"</span>
|
793
|
+
<span class="ruby-identifier">es</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"e_sat_ice emanuel"</span>
|
794
|
+
<span class="ruby-identifier">es</span>
|
795
|
+
<span class="ruby-keyword">end</span></pre>
|
796
|
+
</div><!-- e_sat_emanuel_water-source -->
|
797
|
+
|
798
|
+
</div>
|
799
|
+
|
800
|
+
|
801
|
+
|
802
|
+
|
803
|
+
</div><!-- e_sat_emanuel_water-method -->
|
804
|
+
|
805
|
+
|
806
|
+
<div id="find_prs_d-method" class="method-detail ">
|
807
|
+
<a name="method-i-find_prs_d"></a>
|
808
|
+
|
809
|
+
|
810
|
+
<div class="method-heading">
|
811
|
+
<span class="method-name">find_prs_d</span><span
|
812
|
+
class="method-args">(gphys, error=nil)</span>
|
813
|
+
<span class="method-click-advice">click to toggle source</span>
|
814
|
+
</div>
|
815
|
+
|
816
|
+
|
817
|
+
<div class="method-description">
|
818
|
+
|
819
|
+
<pre>def frontogenesis_eulerian(theta, u, v, w=nil, fstodr=true )
|
820
|
+
thx, thy = GAnalysis::Planet.grad_s( theta )
|
821
|
+
uthxx, uthxy = GAnalysis::Planet.grad_s( u*thx )
|
822
|
+
vthyx, vthyy = GAnalysis::Planet.grad_s( v*thy )
|
823
|
+
va = GAnalysis::Planet.weight_tanphi( v, 1, -1 )
|
824
|
+
frgf = - (uthxx+vthyx)*thx - (uthxy+vthyy)*thy
|
825
|
+
frgf.name = "thgrd_tend"
|
826
|
+
frgf.long_name = "Eluerian grad-theta tendency"
|
827
|
+
if w
|
828
|
+
zdim = 2
|
829
|
+
if (wun=w.units) !~ (ztun = theta.coord(zdim).units * Units["s-1"])
|
830
|
+
raise "w in #{wun} is inconsistent with the vertical coordinate of theta in #{ztun}"
|
831
|
+
else
|
832
|
+
w = w.convert_units(ztun) # For example, Pa/s -> hPa/s
|
833
|
+
end
|
834
|
+
z = theta.axis(zdim).to_gphys
|
835
|
+
if z.units =~ Units["Pa"]
|
836
|
+
thz = df_dx_vialogscale(theta, z, zdim)
|
837
|
+
else
|
838
|
+
thz = df_dx(theta, z, zdim)
|
839
|
+
end
|
840
|
+
wthzx, wthzy = GAnalysis::Planet.grad_s( w*thz )
|
841
|
+
frgf -= wthzx*thx + wthzy*thy
|
842
|
+
end
|
843
|
+
if fstodr
|
844
|
+
frgf /= (thx**2 + thy**2).sqrt
|
845
|
+
else
|
846
|
+
frgf *= 2
|
847
|
+
end
|
848
|
+
frgf
|
849
|
+
end</pre>
|
850
|
+
|
851
|
+
<p># Find a pressure coordinate in a <a href="../GPhys.html">GPhys</a> object
|
852
|
+
# # ARGUMENT # * gphys [GPhys] # * error [nil/false or true] change the
|
853
|
+
behavior if a # pressure coordinate is not found. Default: returns nil; #
|
854
|
+
if error is true, an exception is raised. # RETURN VALUE # * Integer to
|
855
|
+
indicate the dimension of the pressure coordinate, # or nil if not found
|
856
|
+
by default (see above)</p>
|
857
|
+
|
858
|
+
|
859
|
+
|
860
|
+
<div class="method-source-code" id="find_prs_d-source">
|
861
|
+
<pre>
|
862
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 352</span>
|
863
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gphys</span>, <span class="ruby-identifier">error</span>=<span class="ruby-keyword">nil</span>)
|
864
|
+
<span class="ruby-identifier">pa</span> = <span class="ruby-constant">Units</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"Pa"</span>)
|
865
|
+
(<span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">rank</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>).<span class="ruby-identifier">downto</span>(<span class="ruby-value">0</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
|
866
|
+
<span class="ruby-identifier">un</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">axis</span>(<span class="ruby-identifier">d</span>).<span class="ruby-identifier">pos</span>.<span class="ruby-identifier">units</span>
|
867
|
+
<span class="ruby-keyword">if</span> ( <span class="ruby-identifier">un</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">pa</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">un</span>.<span class="ruby-identifier">to_s</span><span class="ruby-operator">==</span><span class="ruby-string">"millibar"</span> )
|
868
|
+
<span class="ruby-keyword">return</span>(<span class="ruby-identifier">d</span>)
|
869
|
+
<span class="ruby-keyword">end</span>
|
870
|
+
<span class="ruby-keyword">end</span>
|
871
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">error</span>
|
872
|
+
<span class="ruby-identifier">raise</span>(<span class="ruby-string">"Could not find a pressure coordinate."</span>)
|
873
|
+
<span class="ruby-keyword">else</span>
|
874
|
+
<span class="ruby-keyword">nil</span>
|
875
|
+
<span class="ruby-keyword">end</span>
|
876
|
+
<span class="ruby-keyword">end</span></pre>
|
877
|
+
</div><!-- find_prs_d-source -->
|
878
|
+
|
879
|
+
</div>
|
880
|
+
|
881
|
+
|
882
|
+
|
883
|
+
|
884
|
+
</div><!-- find_prs_d-method -->
|
885
|
+
|
886
|
+
|
887
|
+
<div id="frontogenesis_func-method" class="method-detail ">
|
888
|
+
<a name="method-i-frontogenesis_func"></a>
|
889
|
+
|
890
|
+
|
891
|
+
<div class="method-heading">
|
892
|
+
<span class="method-name">frontogenesis_func</span><span
|
893
|
+
class="method-args">(theta, u, v, w=nil, fstodr=true, full_adv = true)</span>
|
894
|
+
<span class="method-click-advice">click to toggle source</span>
|
895
|
+
</div>
|
896
|
+
|
897
|
+
|
898
|
+
<div class="method-description">
|
899
|
+
|
900
|
+
<p>Adiabatic frontogenesis function over the sphere. – D/Dt(|gradH theta|) or
|
901
|
+
D/Dt(|gradH theta|^2), where gradH express the horizontal component of
|
902
|
+
gradient.</p>
|
903
|
+
|
904
|
+
<p>if full_adv is true (default),</p>
|
905
|
+
|
906
|
+
<pre>D/Dt(|gradH theta|) =
|
907
|
+
[ -(ux-va)*thetax^2 - (vx+uy)*thetax*thetay - vy*thetay^2
|
908
|
+
- (wx*thetax + wy*thetay)*theta_z ]
|
909
|
+
/ |gradH theta|</pre>
|
910
|
+
|
911
|
+
<p>or else,</p>
|
912
|
+
|
913
|
+
<pre>(\del/\del t + u gradx + v grady )(|gradH theta|) =
|
914
|
+
[ -(ux-va)*thetax^2 - (vx+uy)*thetax*thetay - vy*thetay^2
|
915
|
+
- (w*theta_z)_x*thetax - (w*theta_z)_y*thetay ]
|
916
|
+
/ |gradH theta|</pre>
|
917
|
+
|
918
|
+
<p>Here, the 2nd line (vertical advection) is optional;</p>
|
919
|
+
<dl class="rdoc-list"><dt>vx, vy</dt>
|
920
|
+
<dd>
|
921
|
+
<h1>gradH v; [thetax, thetay] = gradH theta;</h1>
|
922
|
+
</dd><dt>ux, uy</dt>
|
923
|
+
<dd>
|
924
|
+
<h1>cos_phi * gradH (u/cos_phi)</h1>
|
925
|
+
</dd></dl>
|
926
|
+
|
927
|
+
<p>va = v*tan_phi/a (a=radius). z and w is the vertical coordinate and the
|
928
|
+
lagrangian “velocity” in that coordinate — Typically they are p and omega,
|
929
|
+
or log-p height and log-p w.</p>
|
930
|
+
|
931
|
+
<p>This formulation is adiabatic; the diabatic heating effect can be easily
|
932
|
+
included if needed.</p>
|
933
|
+
|
934
|
+
<p>ARGUMENTS</p>
|
935
|
+
<ul><li>
|
936
|
+
<p>theta [GPhys] : potential temperature</p>
|
937
|
+
</li><li>
|
938
|
+
<p>u [GPhys] : zonal wind</p>
|
939
|
+
</li><li>
|
940
|
+
<p>v [GPhys] : meridional wind</p>
|
941
|
+
</li><li>
|
942
|
+
<p>w [nil (default) or GPhys] : (optional) “vertical wind”, which must be
|
943
|
+
dimensionally consistent with the vertical coordiante (e.g., omega for the
|
944
|
+
pressure coordinate). If w is given, the vertical cooridnate is assumed to
|
945
|
+
be the 3rd one (dim=2).</p>
|
946
|
+
</li><li>
|
947
|
+
<p>fstodr [true (default) or false] (optional) if true D/Dt(|NablaH theta|)
|
948
|
+
returned; if false D/Dt(|NablaH theta|^2) is returned.</p>
|
949
|
+
</li><li>
|
950
|
+
<p>full_adv [true (default) or false] : whether to calculate full lagrangian
|
951
|
+
tendency or lagragian tendency only in horizontal direction</p>
|
952
|
+
</li></ul>
|
953
|
+
|
954
|
+
<p>RETURN VALUE</p>
|
955
|
+
<ul><li>
|
956
|
+
<p>frontogenesis function [GPhys]</p>
|
957
|
+
</li></ul>
|
958
|
+
|
959
|
+
|
960
|
+
|
961
|
+
<div class="method-source-code" id="frontogenesis_func-source">
|
962
|
+
<pre>
|
963
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 268</span>
|
964
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">frontogenesis_func</span>(<span class="ruby-identifier">theta</span>, <span class="ruby-identifier">u</span>, <span class="ruby-identifier">v</span>, <span class="ruby-identifier">w</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">fstodr</span>=<span class="ruby-keyword">true</span>, <span class="ruby-identifier">full_adv</span> = <span class="ruby-keyword">true</span>)
|
965
|
+
<span class="ruby-identifier">thx</span>, <span class="ruby-identifier">thy</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_s</span>( <span class="ruby-identifier">theta</span> )
|
966
|
+
<span class="ruby-identifier">ux</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_sx</span>( <span class="ruby-identifier">u</span> )
|
967
|
+
<span class="ruby-identifier">uy</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_sy_cosphifact</span>( <span class="ruby-identifier">u</span>, <span class="ruby-value">-1</span> )
|
968
|
+
<span class="ruby-identifier">vx</span>, <span class="ruby-identifier">vy</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_s</span>( <span class="ruby-identifier">v</span> )
|
969
|
+
<span class="ruby-identifier">va</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">weight_tanphi</span>( <span class="ruby-identifier">v</span>, <span class="ruby-value">1</span>, <span class="ruby-value">-1</span> )
|
970
|
+
<span class="ruby-identifier">frgf</span> = <span class="ruby-operator">-</span> (<span class="ruby-identifier">ux</span><span class="ruby-operator">-</span><span class="ruby-identifier">va</span>)*<span class="ruby-identifier">thx</span>*<span class="ruby-identifier">thx</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">vx</span><span class="ruby-operator">+</span><span class="ruby-identifier">uy</span>)*<span class="ruby-identifier">thx</span>*<span class="ruby-identifier">thy</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">vy</span>*<span class="ruby-identifier">thy</span>*<span class="ruby-identifier">thy</span>
|
971
|
+
<span class="ruby-identifier">frgf</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"frgen"</span>
|
972
|
+
<span class="ruby-identifier">frgf</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"frontogenesis function"</span>
|
973
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">w</span>
|
974
|
+
<span class="ruby-identifier">zdim</span> = <span class="ruby-value">2</span>
|
975
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-identifier">wun</span>=<span class="ruby-identifier">w</span>.<span class="ruby-identifier">units</span>) <span class="ruby-operator">!~</span> (<span class="ruby-identifier">ztun</span> = <span class="ruby-identifier">theta</span>.<span class="ruby-identifier">coord</span>(<span class="ruby-identifier">zdim</span>).<span class="ruby-identifier">units</span> * <span class="ruby-constant">Units</span>[<span class="ruby-string">"s-1"</span>])
|
976
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"w in #{wun} is inconsistent with the vertical coordinate of theta in #{ztun}"</span>
|
977
|
+
<span class="ruby-keyword">else</span>
|
978
|
+
<span class="ruby-identifier">w</span> = <span class="ruby-identifier">w</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-identifier">ztun</span>) <span class="ruby-comment"># For example, Pa/s -> hPa/s</span>
|
979
|
+
<span class="ruby-keyword">end</span>
|
980
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">theta</span>.<span class="ruby-identifier">axis</span>(<span class="ruby-identifier">zdim</span>).<span class="ruby-identifier">to_gphys</span>
|
981
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">z</span>.<span class="ruby-identifier">units</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">Units</span>[<span class="ruby-string">"Pa"</span>]
|
982
|
+
<span class="ruby-identifier">thz</span> = <span class="ruby-identifier">df_dx_vialogscale</span>(<span class="ruby-identifier">theta</span>, <span class="ruby-identifier">z</span>, <span class="ruby-identifier">zdim</span>)
|
983
|
+
<span class="ruby-keyword">else</span>
|
984
|
+
<span class="ruby-identifier">thz</span> = <span class="ruby-identifier">df_dx</span>(<span class="ruby-identifier">theta</span>, <span class="ruby-identifier">z</span>, <span class="ruby-identifier">zdim</span>)
|
985
|
+
<span class="ruby-keyword">end</span>
|
986
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">full_adv</span>
|
987
|
+
<span class="ruby-comment"># full lagragian tendency of theta-gradient strength</span>
|
988
|
+
<span class="ruby-identifier">wx</span>, <span class="ruby-identifier">wy</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_s</span>( <span class="ruby-identifier">w</span> )
|
989
|
+
<span class="ruby-identifier">frgf</span> <span class="ruby-operator">-=</span> (<span class="ruby-identifier">wx</span>*<span class="ruby-identifier">thx</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">wy</span>*<span class="ruby-identifier">thy</span>)*<span class="ruby-identifier">thz</span>
|
990
|
+
<span class="ruby-keyword">else</span>
|
991
|
+
<span class="ruby-comment"># lagragian tendency only in horizontal direction</span>
|
992
|
+
<span class="ruby-identifier">wthzx</span>, <span class="ruby-identifier">wthzy</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_s</span>( <span class="ruby-identifier">w</span>*<span class="ruby-identifier">thz</span> )
|
993
|
+
<span class="ruby-identifier">frgf</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">wthzx</span>*<span class="ruby-identifier">thx</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">wthzy</span>*<span class="ruby-identifier">thy</span>
|
994
|
+
<span class="ruby-keyword">end</span>
|
995
|
+
<span class="ruby-keyword">end</span>
|
996
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">fstodr</span>
|
997
|
+
<span class="ruby-identifier">frgf</span> <span class="ruby-operator">/=</span> (<span class="ruby-identifier">thx</span><span class="ruby-operator">**</span><span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">thy</span><span class="ruby-operator">**</span><span class="ruby-value">2</span>).<span class="ruby-identifier">sqrt</span>
|
998
|
+
<span class="ruby-keyword">else</span>
|
999
|
+
<span class="ruby-identifier">frgf</span> <span class="ruby-operator">*=</span> <span class="ruby-value">2</span>
|
1000
|
+
<span class="ruby-keyword">end</span>
|
1001
|
+
<span class="ruby-identifier">frgf</span>
|
1002
|
+
<span class="ruby-keyword">end</span></pre>
|
1003
|
+
</div><!-- frontogenesis_func-source -->
|
1004
|
+
|
1005
|
+
</div>
|
1006
|
+
|
1007
|
+
|
1008
|
+
|
1009
|
+
|
1010
|
+
</div><!-- frontogenesis_func-method -->
|
1011
|
+
|
1012
|
+
|
1013
|
+
<div id="g-method" class="method-detail ">
|
1014
|
+
<a name="method-i-g"></a>
|
1015
|
+
|
1016
|
+
|
1017
|
+
<div class="method-heading">
|
1018
|
+
<span class="method-name">g</span><span
|
1019
|
+
class="method-args">()</span>
|
1020
|
+
<span class="method-click-advice">click to toggle source</span>
|
1021
|
+
</div>
|
1022
|
+
|
1023
|
+
|
1024
|
+
<div class="method-description">
|
1025
|
+
|
1026
|
+
<p>Returns gravity acceleration in the module (default: 9.8 ms-1).</p>
|
1027
|
+
|
1028
|
+
|
1029
|
+
|
1030
|
+
<div class="method-source-code" id="g-source">
|
1031
|
+
<pre>
|
1032
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 60</span>
|
1033
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">g</span>
|
1034
|
+
<span class="ruby-identifier">@@g</span>.<span class="ruby-identifier">dup</span>
|
1035
|
+
<span class="ruby-keyword">end</span></pre>
|
1036
|
+
</div><!-- g-source -->
|
1037
|
+
|
1038
|
+
</div>
|
1039
|
+
|
1040
|
+
|
1041
|
+
|
1042
|
+
|
1043
|
+
</div><!-- g-method -->
|
1044
|
+
|
1045
|
+
|
1046
|
+
<div id="get_prs-method" class="method-detail ">
|
1047
|
+
<a name="method-i-get_prs"></a>
|
1048
|
+
|
1049
|
+
|
1050
|
+
<div class="method-heading">
|
1051
|
+
<span class="method-name">get_prs</span><span
|
1052
|
+
class="method-args">(gphys)</span>
|
1053
|
+
<span class="method-click-advice">click to toggle source</span>
|
1054
|
+
</div>
|
1055
|
+
|
1056
|
+
|
1057
|
+
<div class="method-description">
|
1058
|
+
|
1059
|
+
<p>Find and return a pressure coordinate in a <a
|
1060
|
+
href="../GPhys.html">GPhys</a> object</p>
|
1061
|
+
|
1062
|
+
<p>ARGUMENT</p>
|
1063
|
+
<ul><li>
|
1064
|
+
<p>gphys [GPhys]</p>
|
1065
|
+
</li></ul>
|
1066
|
+
|
1067
|
+
<p>RETURN VALUE</p>
|
1068
|
+
<ul><li>
|
1069
|
+
<p>pressure in a 1D <a href="../GPhys.html">GPhys</a> object created from the
|
1070
|
+
pressure axis in the <a href="../GPhys.html">GPhys</a> object or a
|
1071
|
+
UNumeric object if the pressure coordinated has been deleted by subsetting.</p>
|
1072
|
+
</li></ul>
|
1073
|
+
|
1074
|
+
|
1075
|
+
|
1076
|
+
<div class="method-source-code" id="get_prs-source">
|
1077
|
+
<pre>
|
1078
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 376</span>
|
1079
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">gphys</span>)
|
1080
|
+
<span class="ruby-keyword">begin</span>
|
1081
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">axis</span>( <span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gphys</span>, <span class="ruby-keyword">true</span>) ).<span class="ruby-identifier">to_gphys</span>
|
1082
|
+
<span class="ruby-keyword">rescue</span>
|
1083
|
+
<span class="ruby-identifier">regexp</span> = <span class="ruby-regexp">/([\d\.]+) *(millibar|hPa)/</span>
|
1084
|
+
<span class="ruby-identifier">cand</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">lost_axes</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-identifier">regexp</span>)
|
1085
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-identifier">str</span>=<span class="ruby-identifier">cand</span>[<span class="ruby-value">0</span>]) <span class="ruby-comment"># substitution, not ==</span>
|
1086
|
+
<span class="ruby-identifier">regexp</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">str</span>
|
1087
|
+
<span class="ruby-identifier">hpa</span> = <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_f</span>
|
1088
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-constant">UNumeric</span>[<span class="ruby-identifier">hpa</span>*<span class="ruby-value">100</span>,<span class="ruby-string">"Pa"</span>]
|
1089
|
+
<span class="ruby-keyword">else</span>
|
1090
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">"No pressure axis was found"</span>
|
1091
|
+
<span class="ruby-keyword">end</span>
|
1092
|
+
<span class="ruby-keyword">end</span>
|
1093
|
+
<span class="ruby-identifier">prs</span>
|
1094
|
+
<span class="ruby-keyword">end</span></pre>
|
1095
|
+
</div><!-- get_prs-source -->
|
1096
|
+
|
1097
|
+
</div>
|
1098
|
+
|
1099
|
+
|
1100
|
+
|
1101
|
+
|
1102
|
+
</div><!-- get_prs-method -->
|
1103
|
+
|
1104
|
+
|
1105
|
+
<div id="ice_thres-method" class="method-detail ">
|
1106
|
+
<a name="method-i-ice_thres"></a>
|
1107
|
+
|
1108
|
+
|
1109
|
+
<div class="method-heading">
|
1110
|
+
<span class="method-name">ice_thres</span><span
|
1111
|
+
class="method-args">()</span>
|
1112
|
+
<span class="method-click-advice">click to toggle source</span>
|
1113
|
+
</div>
|
1114
|
+
|
1115
|
+
|
1116
|
+
<div class="method-description">
|
1117
|
+
|
1118
|
+
<p>the threshold temperature for liquid/ice-phase treatment</p>
|
1119
|
+
|
1120
|
+
|
1121
|
+
|
1122
|
+
<div class="method-source-code" id="ice_thres-source">
|
1123
|
+
<pre>
|
1124
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 468</span>
|
1125
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ice_thres</span>
|
1126
|
+
<span class="ruby-identifier">@@ice_thres</span>
|
1127
|
+
<span class="ruby-keyword">end</span></pre>
|
1128
|
+
</div><!-- ice_thres-source -->
|
1129
|
+
|
1130
|
+
</div>
|
1131
|
+
|
1132
|
+
|
1133
|
+
|
1134
|
+
|
1135
|
+
</div><!-- ice_thres-method -->
|
1136
|
+
|
1137
|
+
|
1138
|
+
<div id="ice_thres-3D-method" class="method-detail ">
|
1139
|
+
<a name="method-i-ice_thres-3D"></a>
|
1140
|
+
|
1141
|
+
|
1142
|
+
<div class="method-heading">
|
1143
|
+
<span class="method-name">ice_thres=</span><span
|
1144
|
+
class="method-args">(temp)</span>
|
1145
|
+
<span class="method-click-advice">click to toggle source</span>
|
1146
|
+
</div>
|
1147
|
+
|
1148
|
+
|
1149
|
+
<div class="method-description">
|
1150
|
+
|
1151
|
+
<p>set the threshold temperature for liquid/ice-phase treatment (default: O
|
1152
|
+
degC)</p>
|
1153
|
+
|
1154
|
+
|
1155
|
+
|
1156
|
+
<div class="method-source-code" id="ice_thres-3D-source">
|
1157
|
+
<pre>
|
1158
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 473</span>
|
1159
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ice_thres=</span>(<span class="ruby-identifier">temp</span>)
|
1160
|
+
<span class="ruby-identifier">@@ice_thres</span>=<span class="ruby-identifier">temp</span>
|
1161
|
+
<span class="ruby-keyword">end</span></pre>
|
1162
|
+
</div><!-- ice_thres-3D-source -->
|
1163
|
+
|
1164
|
+
</div>
|
1165
|
+
|
1166
|
+
|
1167
|
+
|
1168
|
+
|
1169
|
+
</div><!-- ice_thres-3D-method -->
|
1170
|
+
|
1171
|
+
|
1172
|
+
<div id="interpolate_onto_theta-method" class="method-detail ">
|
1173
|
+
<a name="method-i-interpolate_onto_theta"></a>
|
1174
|
+
|
1175
|
+
|
1176
|
+
<div class="method-heading">
|
1177
|
+
<span class="method-name">interpolate_onto_theta</span><span
|
1178
|
+
class="method-args">(gphys, theta, theta_levs)</span>
|
1179
|
+
<span class="method-click-advice">click to toggle source</span>
|
1180
|
+
</div>
|
1181
|
+
|
1182
|
+
|
1183
|
+
<div class="method-description">
|
1184
|
+
|
1185
|
+
<p>Interpolate onto the potential temperature coordinate</p>
|
1186
|
+
|
1187
|
+
<p>ARGUMENTS</p>
|
1188
|
+
<ul><li>
|
1189
|
+
<p>gphys [GPhys] a gphys object that have a pressure dimension</p>
|
1190
|
+
</li><li>
|
1191
|
+
<p>theta [GPhys] potential temperature defined on the same grid as gphys</p>
|
1192
|
+
</li><li>
|
1193
|
+
<p>theta_vals : 1D NArray or Array</p>
|
1194
|
+
</li></ul>
|
1195
|
+
|
1196
|
+
|
1197
|
+
|
1198
|
+
<div class="method-source-code" id="interpolate_onto_theta-source">
|
1199
|
+
<pre>
|
1200
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 125</span>
|
1201
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">interpolate_onto_theta</span>(<span class="ruby-identifier">gphys</span>, <span class="ruby-identifier">theta</span>, <span class="ruby-identifier">theta_levs</span>)
|
1202
|
+
<span class="ruby-identifier">theta_levs</span> = <span class="ruby-constant">NArray</span>[*<span class="ruby-identifier">theta_levs</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Array</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">theta_levs</span>
|
1203
|
+
<span class="ruby-identifier">th_crd</span> = <span class="ruby-constant">VArray</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">theta_levs</span>,
|
1204
|
+
{<span class="ruby-string">"units"</span>=<span class="ruby-operator">></span><span class="ruby-string">"K"</span>, <span class="ruby-string">"long_name"</span>=<span class="ruby-operator">></span><span class="ruby-string">"potential temperature"</span>}, <span class="ruby-string">"theta"</span> )
|
1205
|
+
<span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">set_assoc_coords</span>([<span class="ruby-identifier">theta</span>])
|
1206
|
+
<span class="ruby-identifier">pdnm</span> = <span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">coord</span>(<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gphys</span>)).<span class="ruby-identifier">name</span>
|
1207
|
+
<span class="ruby-identifier">gphys</span>.<span class="ruby-identifier">interpolate</span>(<span class="ruby-identifier">pdnm</span>=<span class="ruby-operator">></span><span class="ruby-identifier">th_crd</span>)
|
1208
|
+
<span class="ruby-keyword">end</span></pre>
|
1209
|
+
</div><!-- interpolate_onto_theta-source -->
|
1210
|
+
|
1211
|
+
</div>
|
1212
|
+
|
1213
|
+
|
1214
|
+
|
1215
|
+
|
1216
|
+
</div><!-- interpolate_onto_theta-method -->
|
1217
|
+
|
1218
|
+
|
1219
|
+
<div id="lat-method" class="method-detail ">
|
1220
|
+
<a name="method-i-lat"></a>
|
1221
|
+
|
1222
|
+
|
1223
|
+
<div class="method-heading">
|
1224
|
+
<span class="method-name">lat</span><span
|
1225
|
+
class="method-args">(temp)</span>
|
1226
|
+
<span class="method-click-advice">click to toggle source</span>
|
1227
|
+
</div>
|
1228
|
+
|
1229
|
+
|
1230
|
+
<div class="method-description">
|
1231
|
+
|
1232
|
+
<p>temperature –> latent heat [J.kg-1]</p>
|
1233
|
+
|
1234
|
+
<p>good for -100<T<50</p>
|
1235
|
+
|
1236
|
+
<p>ARGUMENTS</p>
|
1237
|
+
<ul><li>
|
1238
|
+
<p>temp: temperature</p>
|
1239
|
+
</li></ul>
|
1240
|
+
|
1241
|
+
<p>RETURN VALUE</p>
|
1242
|
+
<ul><li>
|
1243
|
+
<p>lat: latent heat</p>
|
1244
|
+
</li></ul>
|
1245
|
+
|
1246
|
+
|
1247
|
+
|
1248
|
+
<div class="method-source-code" id="lat-source">
|
1249
|
+
<pre>
|
1250
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 586</span>
|
1251
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">lat</span>(<span class="ruby-identifier">temp</span>)
|
1252
|
+
<span class="ruby-identifier">tempK</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"K"</span>)
|
1253
|
+
<span class="ruby-identifier">lat</span> = <span class="ruby-constant">Lat0</span>*(<span class="ruby-constant">T0</span><span class="ruby-operator">/</span><span class="ruby-identifier">tempK</span>)<span class="ruby-operator">**</span>(<span class="ruby-value">0.167</span><span class="ruby-operator">+</span><span class="ruby-identifier">tempK</span>.<span class="ruby-identifier">val</span>*<span class="ruby-value">3.67E-4</span>)
|
1254
|
+
<span class="ruby-identifier">lat</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"L"</span>
|
1255
|
+
<span class="ruby-identifier">lat</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"Latent heat"</span>
|
1256
|
+
<span class="ruby-identifier">lat</span>
|
1257
|
+
<span class="ruby-keyword">end</span></pre>
|
1258
|
+
</div><!-- lat-source -->
|
1259
|
+
|
1260
|
+
</div>
|
1261
|
+
|
1262
|
+
|
1263
|
+
|
1264
|
+
|
1265
|
+
</div><!-- lat-method -->
|
1266
|
+
|
1267
|
+
|
1268
|
+
<div id="pv_on_p-method" class="method-detail ">
|
1269
|
+
<a name="method-i-pv_on_p"></a>
|
1270
|
+
|
1271
|
+
|
1272
|
+
<div class="method-heading">
|
1273
|
+
<span class="method-name">pv_on_p</span><span
|
1274
|
+
class="method-args">(u, v, theta)</span>
|
1275
|
+
<span class="method-click-advice">click to toggle source</span>
|
1276
|
+
</div>
|
1277
|
+
|
1278
|
+
|
1279
|
+
<div class="method-description">
|
1280
|
+
|
1281
|
+
<p>Derive Ertel’s potential vorticity on the pressure coordinate</p>
|
1282
|
+
|
1283
|
+
<p>ARGUMENTS</p>
|
1284
|
+
<ul><li>
|
1285
|
+
<p>u [GPhys] : zonal wind on pressure coordinate (u, v, and theta must share
|
1286
|
+
same coordinates)</p>
|
1287
|
+
</li><li>
|
1288
|
+
<p>v [GPhys] : meridional wind on pressure coordinate</p>
|
1289
|
+
</li><li>
|
1290
|
+
<p>theta [GPhys] : potential temperature on pressure coordinate</p>
|
1291
|
+
</li></ul>
|
1292
|
+
|
1293
|
+
<p>RETURN VALUE</p>
|
1294
|
+
<ul><li>
|
1295
|
+
<p>potential vorticity [GPhys] on the same grid as the inputs</p>
|
1296
|
+
</li></ul>
|
1297
|
+
|
1298
|
+
|
1299
|
+
|
1300
|
+
<div class="method-source-code" id="pv_on_p-source">
|
1301
|
+
<pre>
|
1302
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 173</span>
|
1303
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pv_on_p</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">v</span>, <span class="ruby-identifier">theta</span>)
|
1304
|
+
<span class="ruby-identifier">up</span>,<span class="ruby-identifier">vp</span>,<span class="ruby-identifier">thp</span> = <span class="ruby-identifier">del_ngp</span>(<span class="ruby-identifier">u</span>,<span class="ruby-identifier">v</span>,<span class="ruby-identifier">theta</span>) <span class="ruby-comment"># -g del/del p</span>
|
1305
|
+
<span class="ruby-identifier">pv</span> = <span class="ruby-constant">Planet</span>.<span class="ruby-identifier">absvor_s</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">v</span>) * <span class="ruby-identifier">thp</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">vp</span> * <span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_sx</span>(<span class="ruby-identifier">theta</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">up</span> * <span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_sy</span>(<span class="ruby-identifier">theta</span>)
|
1306
|
+
<span class="ruby-identifier">pv</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"potential vorticity"</span>
|
1307
|
+
<span class="ruby-identifier">pv</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"PV"</span>
|
1308
|
+
<span class="ruby-identifier">pv</span>.<span class="ruby-identifier">units</span> = <span class="ruby-identifier">pv</span>.<span class="ruby-identifier">units</span>.<span class="ruby-identifier">reduce5</span> <span class="ruby-comment"># express in the MKS fundamental units</span>
|
1309
|
+
<span class="ruby-identifier">pv</span>
|
1310
|
+
<span class="ruby-keyword">end</span></pre>
|
1311
|
+
</div><!-- pv_on_p-source -->
|
1312
|
+
|
1313
|
+
</div>
|
1314
|
+
|
1315
|
+
|
1316
|
+
|
1317
|
+
|
1318
|
+
</div><!-- pv_on_p-method -->
|
1319
|
+
|
1320
|
+
|
1321
|
+
<div id="pv_on_theta-method" class="method-detail ">
|
1322
|
+
<a name="method-i-pv_on_theta"></a>
|
1323
|
+
|
1324
|
+
|
1325
|
+
<div class="method-heading">
|
1326
|
+
<span class="method-name">pv_on_theta</span><span
|
1327
|
+
class="method-args">(u, v, theta, theta_levs)</span>
|
1328
|
+
<span class="method-click-advice">click to toggle source</span>
|
1329
|
+
</div>
|
1330
|
+
|
1331
|
+
|
1332
|
+
<div class="method-description">
|
1333
|
+
|
1334
|
+
<p>Derive Ertel’s potential vorticity on the theta (isentropic) coordinate</p>
|
1335
|
+
|
1336
|
+
<p>ARGUMENTS</p>
|
1337
|
+
<ul><li>
|
1338
|
+
<p>u [GPhys] : zonal wind on pressure coordinate (u, v, and theta must share
|
1339
|
+
same coordinates)</p>
|
1340
|
+
</li><li>
|
1341
|
+
<p>v [GPhys] : meridional wind on pressure coordinate</p>
|
1342
|
+
</li><li>
|
1343
|
+
<p>theta [GPhys] : potential temperature on pressure coordinate</p>
|
1344
|
+
</li><li>
|
1345
|
+
<p>theta_levs [NArray or Array] : one dimensional array of potential
|
1346
|
+
temperature values (Kelvin) on which PV is derived.</p>
|
1347
|
+
</li></ul>
|
1348
|
+
|
1349
|
+
<p>RETURN VALUE</p>
|
1350
|
+
<ul><li>
|
1351
|
+
<p>potential voticity [GPhys] on a theta coordinate, where levels are set to
|
1352
|
+
theta_levs</p>
|
1353
|
+
</li></ul>
|
1354
|
+
|
1355
|
+
|
1356
|
+
|
1357
|
+
<div class="method-source-code" id="pv_on_theta-source">
|
1358
|
+
<pre>
|
1359
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 148</span>
|
1360
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pv_on_theta</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">v</span>, <span class="ruby-identifier">theta</span>, <span class="ruby-identifier">theta_levs</span>)
|
1361
|
+
<span class="ruby-identifier">sigi</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Met</span>.<span class="ruby-identifier">sigma_inv</span>(<span class="ruby-identifier">theta</span>)
|
1362
|
+
<span class="ruby-identifier">uth</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Met</span>.<span class="ruby-identifier">interpolate_onto_theta</span>(<span class="ruby-identifier">u</span>, <span class="ruby-identifier">theta</span>, <span class="ruby-identifier">theta_levs</span>)
|
1363
|
+
<span class="ruby-identifier">vth</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Met</span>.<span class="ruby-identifier">interpolate_onto_theta</span>(<span class="ruby-identifier">v</span>, <span class="ruby-identifier">theta</span>, <span class="ruby-identifier">theta_levs</span>)
|
1364
|
+
<span class="ruby-identifier">sigith</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Met</span>.<span class="ruby-identifier">interpolate_onto_theta</span>(<span class="ruby-identifier">sigi</span>, <span class="ruby-identifier">theta</span>, <span class="ruby-identifier">theta_levs</span>)
|
1365
|
+
<span class="ruby-identifier">avorth</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">absvor_s</span>(<span class="ruby-identifier">uth</span>,<span class="ruby-identifier">vth</span>)
|
1366
|
+
<span class="ruby-identifier">pv</span> = <span class="ruby-identifier">avorth</span>*<span class="ruby-identifier">sigith</span>
|
1367
|
+
<span class="ruby-identifier">pv</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"potential vorticity"</span>
|
1368
|
+
<span class="ruby-identifier">pv</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"PV"</span>
|
1369
|
+
<span class="ruby-identifier">pv</span>
|
1370
|
+
<span class="ruby-keyword">end</span></pre>
|
1371
|
+
</div><!-- pv_on_theta-source -->
|
1372
|
+
|
1373
|
+
</div>
|
1374
|
+
|
1375
|
+
|
1376
|
+
|
1377
|
+
|
1378
|
+
</div><!-- pv_on_theta-method -->
|
1379
|
+
|
1380
|
+
|
1381
|
+
<div id="q2e-method" class="method-detail ">
|
1382
|
+
<a name="method-i-q2e"></a>
|
1383
|
+
|
1384
|
+
|
1385
|
+
<div class="method-heading">
|
1386
|
+
<span class="method-name">q2e</span><span
|
1387
|
+
class="method-args">(q,prs=nil)</span>
|
1388
|
+
<span class="method-click-advice">click to toggle source</span>
|
1389
|
+
</div>
|
1390
|
+
|
1391
|
+
|
1392
|
+
<div class="method-description">
|
1393
|
+
|
1394
|
+
<p>specific humidity -> water vapor pressure</p>
|
1395
|
+
|
1396
|
+
<p>ARGUMENTS</p>
|
1397
|
+
<ul><li>
|
1398
|
+
<p>q: specific <a href="http://g/g">humidity</a></p>
|
1399
|
+
</li><li>
|
1400
|
+
<p>prs: <a href="http://hPa">pressure</a></p>
|
1401
|
+
</li></ul>
|
1402
|
+
|
1403
|
+
<p>RETURN VALUE</p>
|
1404
|
+
<ul><li>
|
1405
|
+
<p>e: water vapor pressure</p>
|
1406
|
+
</li></ul>
|
1407
|
+
|
1408
|
+
|
1409
|
+
|
1410
|
+
<div class="method-source-code" id="q2e-source">
|
1411
|
+
<pre>
|
1412
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 549</span>
|
1413
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">q2e</span>(<span class="ruby-identifier">q</span>,<span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
1414
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">q</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">prs</span>
|
1415
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">convert_units2Pa</span>(<span class="ruby-identifier">prs</span>)
|
1416
|
+
<span class="ruby-identifier">rratio</span> = <span class="ruby-constant">R</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Rv</span>
|
1417
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-identifier">prs</span>*<span class="ruby-identifier">q</span><span class="ruby-operator">/</span>(<span class="ruby-identifier">rratio</span><span class="ruby-operator">+</span>(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">rratio</span>)*<span class="ruby-identifier">q</span>) <span class="ruby-comment"># water vapor pertial pressure</span>
|
1418
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"e"</span>
|
1419
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"water vapor pressure"</span>
|
1420
|
+
<span class="ruby-identifier">e</span>
|
1421
|
+
<span class="ruby-keyword">end</span></pre>
|
1422
|
+
</div><!-- q2e-source -->
|
1423
|
+
|
1424
|
+
</div>
|
1425
|
+
|
1426
|
+
|
1427
|
+
|
1428
|
+
|
1429
|
+
</div><!-- q2e-method -->
|
1430
|
+
|
1431
|
+
|
1432
|
+
<div id="q2r-method" class="method-detail ">
|
1433
|
+
<a name="method-i-q2r"></a>
|
1434
|
+
|
1435
|
+
|
1436
|
+
<div class="method-heading">
|
1437
|
+
<span class="method-name">q2r</span><span
|
1438
|
+
class="method-args">(q)</span>
|
1439
|
+
<span class="method-click-advice">click to toggle source</span>
|
1440
|
+
</div>
|
1441
|
+
|
1442
|
+
|
1443
|
+
<div class="method-description">
|
1444
|
+
|
1445
|
+
<p>specific humidity -> mixing ratio</p>
|
1446
|
+
|
1447
|
+
<p>ARGUMENTS</p>
|
1448
|
+
<ul><li>
|
1449
|
+
<p>q: specific humidty</p>
|
1450
|
+
</li></ul>
|
1451
|
+
|
1452
|
+
<p>RETURN VALUE</p>
|
1453
|
+
<ul><li>
|
1454
|
+
<p>r: mixing ratio</p>
|
1455
|
+
</li></ul>
|
1456
|
+
|
1457
|
+
|
1458
|
+
|
1459
|
+
<div class="method-source-code" id="q2r-source">
|
1460
|
+
<pre>
|
1461
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 484</span>
|
1462
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">q2r</span>(<span class="ruby-identifier">q</span>)
|
1463
|
+
<span class="ruby-identifier">r</span> = <span class="ruby-identifier">q</span><span class="ruby-operator">/</span>(<span class="ruby-value">1.0</span><span class="ruby-operator">-</span><span class="ruby-identifier">q</span>)
|
1464
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"r"</span>
|
1465
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"mixing ratio"</span>
|
1466
|
+
<span class="ruby-identifier">r</span>
|
1467
|
+
<span class="ruby-keyword">end</span></pre>
|
1468
|
+
</div><!-- q2r-source -->
|
1469
|
+
|
1470
|
+
</div>
|
1471
|
+
|
1472
|
+
|
1473
|
+
|
1474
|
+
|
1475
|
+
</div><!-- q2r-method -->
|
1476
|
+
|
1477
|
+
|
1478
|
+
<div id="r2e-method" class="method-detail ">
|
1479
|
+
<a name="method-i-r2e"></a>
|
1480
|
+
|
1481
|
+
|
1482
|
+
<div class="method-heading">
|
1483
|
+
<span class="method-name">r2e</span><span
|
1484
|
+
class="method-args">(r,prs=nil)</span>
|
1485
|
+
<span class="method-click-advice">click to toggle source</span>
|
1486
|
+
</div>
|
1487
|
+
|
1488
|
+
|
1489
|
+
<div class="method-description">
|
1490
|
+
|
1491
|
+
<p>water vapor mixing ratio -> water vapor pressure</p>
|
1492
|
+
|
1493
|
+
<p>ARGUMENTS</p>
|
1494
|
+
<ul><li>
|
1495
|
+
<p>r: water vapor mixing ratio</p>
|
1496
|
+
</li><li>
|
1497
|
+
<p>prs: pressure</p>
|
1498
|
+
</li></ul>
|
1499
|
+
|
1500
|
+
<p>RETURN VALUE</p>
|
1501
|
+
<ul><li>
|
1502
|
+
<p>e: water vapor pressure</p>
|
1503
|
+
</li></ul>
|
1504
|
+
|
1505
|
+
|
1506
|
+
|
1507
|
+
<div class="method-source-code" id="r2e-source">
|
1508
|
+
<pre>
|
1509
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 513</span>
|
1510
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">r2e</span>(<span class="ruby-identifier">r</span>,<span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
1511
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">r</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">prs</span>
|
1512
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">convert_units2Pa</span>(<span class="ruby-identifier">prs</span>)
|
1513
|
+
<span class="ruby-identifier">rratio</span> = <span class="ruby-constant">R</span> <span class="ruby-operator">/</span> <span class="ruby-constant">Rv</span>
|
1514
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-identifier">prs</span>*<span class="ruby-identifier">r</span><span class="ruby-operator">/</span>(<span class="ruby-identifier">rratio</span><span class="ruby-operator">+</span><span class="ruby-identifier">r</span>) <span class="ruby-comment"># water vapor pertial pressure</span>
|
1515
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"e"</span>
|
1516
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"water vapor pressure"</span>
|
1517
|
+
<span class="ruby-identifier">e</span>
|
1518
|
+
<span class="ruby-keyword">end</span></pre>
|
1519
|
+
</div><!-- r2e-source -->
|
1520
|
+
|
1521
|
+
</div>
|
1522
|
+
|
1523
|
+
|
1524
|
+
|
1525
|
+
|
1526
|
+
</div><!-- r2e-method -->
|
1527
|
+
|
1528
|
+
|
1529
|
+
<div id="r2q-method" class="method-detail ">
|
1530
|
+
<a name="method-i-r2q"></a>
|
1531
|
+
|
1532
|
+
|
1533
|
+
<div class="method-heading">
|
1534
|
+
<span class="method-name">r2q</span><span
|
1535
|
+
class="method-args">(r)</span>
|
1536
|
+
<span class="method-click-advice">click to toggle source</span>
|
1537
|
+
</div>
|
1538
|
+
|
1539
|
+
|
1540
|
+
<div class="method-description">
|
1541
|
+
|
1542
|
+
<p>mixing ratio -> specific humidity</p>
|
1543
|
+
|
1544
|
+
<p>ARGUMENTS</p>
|
1545
|
+
<ul><li>
|
1546
|
+
<p>r: mixing ratio</p>
|
1547
|
+
</li></ul>
|
1548
|
+
|
1549
|
+
<p>RETURN VALUE</p>
|
1550
|
+
<ul><li>
|
1551
|
+
<p>q: specific humidty</p>
|
1552
|
+
</li></ul>
|
1553
|
+
|
1554
|
+
|
1555
|
+
|
1556
|
+
<div class="method-source-code" id="r2q-source">
|
1557
|
+
<pre>
|
1558
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 498</span>
|
1559
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">r2q</span>(<span class="ruby-identifier">r</span>)
|
1560
|
+
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">r</span><span class="ruby-operator">/</span>(<span class="ruby-value">1.0</span><span class="ruby-operator">+</span><span class="ruby-identifier">r</span>)
|
1561
|
+
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"q"</span>
|
1562
|
+
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"specific humidity"</span>
|
1563
|
+
<span class="ruby-identifier">q</span>
|
1564
|
+
<span class="ruby-keyword">end</span></pre>
|
1565
|
+
</div><!-- r2q-source -->
|
1566
|
+
|
1567
|
+
</div>
|
1568
|
+
|
1569
|
+
|
1570
|
+
|
1571
|
+
|
1572
|
+
</div><!-- r2q-method -->
|
1573
|
+
|
1574
|
+
|
1575
|
+
<div id="rh2e-method" class="method-detail ">
|
1576
|
+
<a name="method-i-rh2e"></a>
|
1577
|
+
|
1578
|
+
|
1579
|
+
<div class="method-heading">
|
1580
|
+
<span class="method-name">rh2e</span><span
|
1581
|
+
class="method-args">(rh,temp)</span>
|
1582
|
+
<span class="method-click-advice">click to toggle source</span>
|
1583
|
+
</div>
|
1584
|
+
|
1585
|
+
|
1586
|
+
<div class="method-description">
|
1587
|
+
|
1588
|
+
<p>relative humidity -> water vapor pressure</p>
|
1589
|
+
|
1590
|
+
<p>ARGUMENTS</p>
|
1591
|
+
<ul><li>
|
1592
|
+
<p>rh: relative humidity</p>
|
1593
|
+
</li><li>
|
1594
|
+
<p>temp: temperature</p>
|
1595
|
+
</li></ul>
|
1596
|
+
|
1597
|
+
<p>RETURN VALUE</p>
|
1598
|
+
<ul><li>
|
1599
|
+
<p>e: water vapor pressure</p>
|
1600
|
+
</li></ul>
|
1601
|
+
|
1602
|
+
|
1603
|
+
|
1604
|
+
<div class="method-source-code" id="rh2e-source">
|
1605
|
+
<pre>
|
1606
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 724</span>
|
1607
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">rh2e</span>(<span class="ruby-identifier">rh</span>,<span class="ruby-identifier">temp</span>)
|
1608
|
+
<span class="ruby-identifier">es</span> = <span class="ruby-identifier">e_sat</span>(<span class="ruby-identifier">temp</span>)
|
1609
|
+
<span class="ruby-identifier">rh</span> = <span class="ruby-identifier">rh</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"1"</span>)
|
1610
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-identifier">es</span> * <span class="ruby-identifier">rh</span>
|
1611
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"e"</span>
|
1612
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"water vapor pressure"</span>
|
1613
|
+
<span class="ruby-identifier">e</span>
|
1614
|
+
<span class="ruby-keyword">end</span></pre>
|
1615
|
+
</div><!-- rh2e-source -->
|
1616
|
+
|
1617
|
+
</div>
|
1618
|
+
|
1619
|
+
|
1620
|
+
|
1621
|
+
|
1622
|
+
</div><!-- rh2e-method -->
|
1623
|
+
|
1624
|
+
|
1625
|
+
<div id="set_e_sat_water-method" class="method-detail ">
|
1626
|
+
<a name="method-i-set_e_sat_water"></a>
|
1627
|
+
|
1628
|
+
|
1629
|
+
<div class="method-heading">
|
1630
|
+
<span class="method-name">set_e_sat_water</span><span
|
1631
|
+
class="method-args">(formula=nil)</span>
|
1632
|
+
<span class="method-click-advice">click to toggle source</span>
|
1633
|
+
</div>
|
1634
|
+
|
1635
|
+
|
1636
|
+
<div class="method-description">
|
1637
|
+
|
1638
|
+
<p>Selector of the formulat to compute saturation water vapor pressure against
|
1639
|
+
water (default: Bolton)</p>
|
1640
|
+
|
1641
|
+
<p>ARGUMENTS</p>
|
1642
|
+
<ul><li>
|
1643
|
+
<p>formula: nil(default), “bolton”, “emanuel”</p>
|
1644
|
+
</li></ul>
|
1645
|
+
|
1646
|
+
<p>RETURN VALUE</p>
|
1647
|
+
<ul><li>
|
1648
|
+
<p>nil</p>
|
1649
|
+
</li></ul>
|
1650
|
+
|
1651
|
+
|
1652
|
+
|
1653
|
+
<div class="method-source-code" id="set_e_sat_water-source">
|
1654
|
+
<pre>
|
1655
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 671</span>
|
1656
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_e_sat_water</span>(<span class="ruby-identifier">formula</span>=<span class="ruby-keyword">nil</span>)
|
1657
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">formula</span>
|
1658
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>,<span class="ruby-string">"bolton"</span>
|
1659
|
+
<span class="ruby-keyword">alias</span> <span class="ruby-value">:e_sat_water</span> <span class="ruby-operator">:</span><span class="ruby-identifier">e_sat_bolton</span>
|
1660
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">"emanuel"</span>
|
1661
|
+
<span class="ruby-keyword">alias</span> <span class="ruby-value">:e_sat_water</span> <span class="ruby-operator">:</span><span class="ruby-identifier">e_sat_emanuel_water</span>
|
1662
|
+
<span class="ruby-identifier">module_function</span> <span class="ruby-value">:e_sat_water</span>
|
1663
|
+
<span class="ruby-keyword">end</span>
|
1664
|
+
<span class="ruby-keyword">nil</span>
|
1665
|
+
<span class="ruby-keyword">end</span></pre>
|
1666
|
+
</div><!-- set_e_sat_water-source -->
|
1667
|
+
|
1668
|
+
</div>
|
1669
|
+
|
1670
|
+
|
1671
|
+
|
1672
|
+
|
1673
|
+
</div><!-- set_e_sat_water-method -->
|
1674
|
+
|
1675
|
+
|
1676
|
+
<div id="set_g-method" class="method-detail ">
|
1677
|
+
<a name="method-i-set_g"></a>
|
1678
|
+
|
1679
|
+
|
1680
|
+
<div class="method-heading">
|
1681
|
+
<span class="method-name">set_g</span><span
|
1682
|
+
class="method-args">(g)</span>
|
1683
|
+
<span class="method-click-advice">click to toggle source</span>
|
1684
|
+
</div>
|
1685
|
+
|
1686
|
+
|
1687
|
+
<div class="method-description">
|
1688
|
+
|
1689
|
+
<p>Sets gravity acceleration in the module (default: 9.8 ms-1).</p>
|
1690
|
+
|
1691
|
+
<p>ARGUMENT</p>
|
1692
|
+
<ul><li>
|
1693
|
+
<p>g [UNumeric]</p>
|
1694
|
+
</li></ul>
|
1695
|
+
|
1696
|
+
<p>EXAMPLE</p>
|
1697
|
+
|
1698
|
+
<pre>Met::set_g( UNumeric[9.7,"m.s-2"] )</pre>
|
1699
|
+
|
1700
|
+
<p>RETURN VALUE</p>
|
1701
|
+
<ul><li>
|
1702
|
+
<p>The argument g</p>
|
1703
|
+
</li></ul>
|
1704
|
+
|
1705
|
+
|
1706
|
+
|
1707
|
+
<div class="method-source-code" id="set_g-source">
|
1708
|
+
<pre>
|
1709
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 54</span>
|
1710
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_g</span>(<span class="ruby-identifier">g</span>)
|
1711
|
+
<span class="ruby-identifier">@@g</span> = <span class="ruby-identifier">g</span> <span class="ruby-comment"># e.g., un[9.8,"m.s-2"]</span>
|
1712
|
+
<span class="ruby-keyword">end</span></pre>
|
1713
|
+
</div><!-- set_g-source -->
|
1714
|
+
|
1715
|
+
</div>
|
1716
|
+
|
1717
|
+
|
1718
|
+
|
1719
|
+
|
1720
|
+
</div><!-- set_g-method -->
|
1721
|
+
|
1722
|
+
|
1723
|
+
<div id="sigma_inv-method" class="method-detail ">
|
1724
|
+
<a name="method-i-sigma_inv"></a>
|
1725
|
+
|
1726
|
+
|
1727
|
+
<div class="method-heading">
|
1728
|
+
<span class="method-name">sigma_inv</span><span
|
1729
|
+
class="method-args">(theta, dim=nil, prs=nil)</span>
|
1730
|
+
<span class="method-click-advice">click to toggle source</span>
|
1731
|
+
</div>
|
1732
|
+
|
1733
|
+
|
1734
|
+
<div class="method-description">
|
1735
|
+
|
1736
|
+
<p>Inverse of the “sigma” density in the theta coordinate:</p>
|
1737
|
+
|
1738
|
+
<p>ARGUMENTS</p>
|
1739
|
+
<ul><li>
|
1740
|
+
<p>theta [<a href="../GPhys.html">GPhys</a> or VArray] potential temperature</p>
|
1741
|
+
</li><li>
|
1742
|
+
<p>dim [Integer] : the pressure dimension. If theta is a <a
|
1743
|
+
href="../GPhys.html">GPhys</a>, this argument can be omitted, in which case
|
1744
|
+
a pressure dimension is searched internally by find_prs_d.</p>
|
1745
|
+
</li><li>
|
1746
|
+
<p>prs [<a href="../GPhys.html">GPhys</a> or VArray] : the pressure values.
|
1747
|
+
Internally searched if omitted.</p>
|
1748
|
+
</li></ul>
|
1749
|
+
|
1750
|
+
<p>RETURN VALUE</p>
|
1751
|
+
<ul><li>
|
1752
|
+
<p>1 / sigma = -g dtheta/dp [GPhys]</p>
|
1753
|
+
</li></ul>
|
1754
|
+
|
1755
|
+
|
1756
|
+
|
1757
|
+
<div class="method-source-code" id="sigma_inv-source">
|
1758
|
+
<pre>
|
1759
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 104</span>
|
1760
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sigma_inv</span>(<span class="ruby-identifier">theta</span>, <span class="ruby-identifier">dim</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
1761
|
+
<span class="ruby-identifier">dim</span> = <span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">theta</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">dim</span>
|
1762
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">theta</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">prs</span>
|
1763
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">convert_units2Pa</span>(<span class="ruby-identifier">prs</span>)
|
1764
|
+
<span class="ruby-comment">#dtheta_dp = df_dx(theta, prs, dim)</span>
|
1765
|
+
<span class="ruby-identifier">dtheta_dp</span> = <span class="ruby-identifier">df_dx_vialogscale</span>(<span class="ruby-identifier">theta</span>, <span class="ruby-identifier">prs</span>, <span class="ruby-identifier">dim</span>)
|
1766
|
+
<span class="ruby-identifier">sig_inv</span> = <span class="ruby-identifier">dtheta_dp</span> * (<span class="ruby-operator">-</span><span class="ruby-identifier">@@g</span>)
|
1767
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">sig_inv</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:long_name</span>) <span class="ruby-comment"># VArray or GPhys</span>
|
1768
|
+
<span class="ruby-identifier">sig_inv</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"sig_inv"</span>
|
1769
|
+
<span class="ruby-identifier">sig_inv</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"1/sigma"</span>
|
1770
|
+
<span class="ruby-keyword">end</span>
|
1771
|
+
<span class="ruby-identifier">sig_inv</span>
|
1772
|
+
<span class="ruby-keyword">end</span></pre>
|
1773
|
+
</div><!-- sigma_inv-source -->
|
1774
|
+
|
1775
|
+
</div>
|
1776
|
+
|
1777
|
+
|
1778
|
+
|
1779
|
+
|
1780
|
+
</div><!-- sigma_inv-method -->
|
1781
|
+
|
1782
|
+
|
1783
|
+
<div id="temp2theta-method" class="method-detail ">
|
1784
|
+
<a name="method-i-temp2theta"></a>
|
1785
|
+
|
1786
|
+
|
1787
|
+
<div class="method-heading">
|
1788
|
+
<span class="method-name">temp2theta</span><span
|
1789
|
+
class="method-args">(temp, prs=nil)</span>
|
1790
|
+
<span class="method-click-advice">click to toggle source</span>
|
1791
|
+
</div>
|
1792
|
+
|
1793
|
+
|
1794
|
+
<div class="method-description">
|
1795
|
+
|
1796
|
+
<p>Convert temperature into potential temperature</p>
|
1797
|
+
|
1798
|
+
<p>ARGUMENTS</p>
|
1799
|
+
<ul><li>
|
1800
|
+
<p>temp [UNumeric or <a href="../GPhys.html">GPhys</a> or VArray, which
|
1801
|
+
supports method “units”] : temperature</p>
|
1802
|
+
</li><li>
|
1803
|
+
<p>prs [UNumeric or <a href="../GPhys.html">GPhys</a> or VArray, which
|
1804
|
+
supports method “units”] : pressure</p>
|
1805
|
+
</li></ul>
|
1806
|
+
|
1807
|
+
<p>RETURN VALUE</p>
|
1808
|
+
<ul><li>
|
1809
|
+
<p>potential temperature [UNumeric or <a href="../GPhys.html">GPhys</a> or
|
1810
|
+
VArray,…] in Kelvin</p>
|
1811
|
+
</li></ul>
|
1812
|
+
|
1813
|
+
|
1814
|
+
|
1815
|
+
<div class="method-source-code" id="temp2theta-source">
|
1816
|
+
<pre>
|
1817
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 76</span>
|
1818
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">temp2theta</span>(<span class="ruby-identifier">temp</span>, <span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
1819
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">temp</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">prs</span>
|
1820
|
+
<span class="ruby-identifier">prs</span> = <span class="ruby-identifier">convert_units2Pa</span>(<span class="ruby-identifier">prs</span>)
|
1821
|
+
<span class="ruby-keyword">if</span> ( <span class="ruby-operator">!</span>(<span class="ruby-identifier">temp</span>.<span class="ruby-identifier">units</span> <span class="ruby-operator">===</span> <span class="ruby-constant">Units</span>[<span class="ruby-string">"K"</span>]) )
|
1822
|
+
<span class="ruby-identifier">temp</span> = <span class="ruby-identifier">convert_units</span>(<span class="ruby-identifier">temp</span>,<span class="ruby-string">"K"</span>)
|
1823
|
+
<span class="ruby-keyword">end</span>
|
1824
|
+
<span class="ruby-identifier">theta</span> = <span class="ruby-identifier">temp</span> * (<span class="ruby-identifier">prs</span><span class="ruby-operator">/</span><span class="ruby-constant">P00</span>)<span class="ruby-operator">**</span>(<span class="ruby-operator">-</span><span class="ruby-constant">Kappa</span>)
|
1825
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">theta</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:long_name</span>) <span class="ruby-comment"># VArray or GPhys</span>
|
1826
|
+
<span class="ruby-identifier">theta</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"theta"</span>
|
1827
|
+
<span class="ruby-identifier">theta</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"potential temperature"</span>
|
1828
|
+
<span class="ruby-keyword">end</span>
|
1829
|
+
<span class="ruby-identifier">theta</span>
|
1830
|
+
<span class="ruby-keyword">end</span></pre>
|
1831
|
+
</div><!-- temp2theta-source -->
|
1832
|
+
|
1833
|
+
</div>
|
1834
|
+
|
1835
|
+
|
1836
|
+
|
1837
|
+
|
1838
|
+
</div><!-- temp2theta-method -->
|
1839
|
+
|
1840
|
+
|
1841
|
+
<div id="theta_e-method" class="method-detail ">
|
1842
|
+
<a name="method-i-theta_e"></a>
|
1843
|
+
|
1844
|
+
|
1845
|
+
<div class="method-heading">
|
1846
|
+
<span class="method-name">theta_e</span><span
|
1847
|
+
class="method-args">(temp,q,prs=nil)</span>
|
1848
|
+
<span class="method-click-advice">click to toggle source</span>
|
1849
|
+
</div>
|
1850
|
+
|
1851
|
+
|
1852
|
+
<div class="method-description">
|
1853
|
+
|
1854
|
+
<p>Derive equivalent potential temperature</p>
|
1855
|
+
|
1856
|
+
<p>ARGUMENTS</p>
|
1857
|
+
<ul><li>
|
1858
|
+
<p>temp [GPhys] : temperature (ok whether degC or K)</p>
|
1859
|
+
</li><li>
|
1860
|
+
<p>q [GPhys] : specific humidity</p>
|
1861
|
+
</li><li>
|
1862
|
+
<p>prs [<a href="../GPhys.html">GPhys</a> or VArray] : the pressure values.
|
1863
|
+
If nil, searched from coordinates (for data on the pressure coordinate)</p>
|
1864
|
+
</li></ul>
|
1865
|
+
|
1866
|
+
<p>RETURN VALUE</p>
|
1867
|
+
<ul><li>
|
1868
|
+
<p><a href="Met.html#method-i-theta_e">theta_e</a>: equivalent potential
|
1869
|
+
temperature</p>
|
1870
|
+
</li></ul>
|
1871
|
+
|
1872
|
+
|
1873
|
+
|
1874
|
+
<div class="method-source-code" id="theta_e-source">
|
1875
|
+
<pre>
|
1876
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 744</span>
|
1877
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">theta_e</span>(<span class="ruby-identifier">temp</span>,<span class="ruby-identifier">q</span>,<span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
1878
|
+
<span class="ruby-identifier">tempK</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"K"</span>)
|
1879
|
+
<span class="ruby-identifier">theta</span> = <span class="ruby-identifier">temp2theta</span>(<span class="ruby-identifier">tempK</span>, <span class="ruby-identifier">prs</span>)
|
1880
|
+
<span class="ruby-identifier">theta_e</span> = <span class="ruby-identifier">theta</span> * <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">exp</span>( <span class="ruby-identifier">lat</span>(<span class="ruby-identifier">tempK</span>)*<span class="ruby-identifier">q</span><span class="ruby-operator">/</span>(<span class="ruby-constant">Cp</span>*<span class="ruby-identifier">tempK</span>) )
|
1881
|
+
<span class="ruby-identifier">theta_e</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"theta_e"</span>
|
1882
|
+
<span class="ruby-identifier">theta_e</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"equivalent potential temperature"</span>
|
1883
|
+
<span class="ruby-identifier">theta_e</span>
|
1884
|
+
<span class="ruby-keyword">end</span></pre>
|
1885
|
+
</div><!-- theta_e-source -->
|
1886
|
+
|
1887
|
+
</div>
|
1888
|
+
|
1889
|
+
|
1890
|
+
|
1891
|
+
|
1892
|
+
</div><!-- theta_e-method -->
|
1893
|
+
|
1894
|
+
|
1895
|
+
<div id="theta_es-method" class="method-detail ">
|
1896
|
+
<a name="method-i-theta_es"></a>
|
1897
|
+
|
1898
|
+
|
1899
|
+
<div class="method-heading">
|
1900
|
+
<span class="method-name">theta_es</span><span
|
1901
|
+
class="method-args">(temp,prs=nil)</span>
|
1902
|
+
<span class="method-click-advice">click to toggle source</span>
|
1903
|
+
</div>
|
1904
|
+
|
1905
|
+
|
1906
|
+
<div class="method-description">
|
1907
|
+
|
1908
|
+
<p>Derive the saturation equivalent potential temperature</p>
|
1909
|
+
|
1910
|
+
<p>ARGUMENTS</p>
|
1911
|
+
<ul><li>
|
1912
|
+
<p>temp [GPhys] : temperature (ok whether degC or K)</p>
|
1913
|
+
</li><li>
|
1914
|
+
<p>prs [<a href="../GPhys.html">GPhys</a> or VArray] : the pressure values.
|
1915
|
+
If nil, searched from coordinates (for data on the pressure coordinate)</p>
|
1916
|
+
</li></ul>
|
1917
|
+
|
1918
|
+
<p>RETURN VALUE</p>
|
1919
|
+
<ul><li>
|
1920
|
+
<p><a href="Met.html#method-i-theta_es">theta_es</a>: saturation equivalent
|
1921
|
+
potential temperature</p>
|
1922
|
+
</li></ul>
|
1923
|
+
|
1924
|
+
|
1925
|
+
|
1926
|
+
<div class="method-source-code" id="theta_es-source">
|
1927
|
+
<pre>
|
1928
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 763</span>
|
1929
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">theta_es</span>(<span class="ruby-identifier">temp</span>,<span class="ruby-identifier">prs</span>=<span class="ruby-keyword">nil</span>)
|
1930
|
+
<span class="ruby-identifier">tempK</span> = <span class="ruby-identifier">temp</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"K"</span>)
|
1931
|
+
<span class="ruby-identifier">theta</span> = <span class="ruby-identifier">temp2theta</span>(<span class="ruby-identifier">tempK</span>, <span class="ruby-identifier">prs</span>)
|
1932
|
+
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">e_sat</span>(<span class="ruby-identifier">temp</span>).<span class="ruby-identifier">e2q</span>(<span class="ruby-identifier">prs</span>)
|
1933
|
+
<span class="ruby-identifier">theta_e</span> = <span class="ruby-identifier">theta</span> * <span class="ruby-constant">Misc</span><span class="ruby-operator">::</span><span class="ruby-constant">EMath</span>.<span class="ruby-identifier">exp</span>( <span class="ruby-identifier">lat</span>(<span class="ruby-identifier">tempK</span>)*<span class="ruby-identifier">q</span><span class="ruby-operator">/</span>(<span class="ruby-constant">Cp</span>*<span class="ruby-identifier">tempK</span>) )
|
1934
|
+
<span class="ruby-identifier">theta_e</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"theta_es"</span>
|
1935
|
+
<span class="ruby-identifier">theta_e</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"theta_e sat"</span>
|
1936
|
+
<span class="ruby-identifier">theta_e</span>
|
1937
|
+
<span class="ruby-keyword">end</span></pre>
|
1938
|
+
</div><!-- theta_es-source -->
|
1939
|
+
|
1940
|
+
</div>
|
1941
|
+
|
1942
|
+
|
1943
|
+
|
1944
|
+
|
1945
|
+
</div><!-- theta_es-method -->
|
1946
|
+
|
1947
|
+
|
1948
|
+
<div id="z2geostrophic_wind-method" class="method-detail ">
|
1949
|
+
<a name="method-i-z2geostrophic_wind"></a>
|
1950
|
+
|
1951
|
+
|
1952
|
+
<div class="method-heading">
|
1953
|
+
<span class="method-name">z2geostrophic_wind</span><span
|
1954
|
+
class="method-args">(z, f=nil)</span>
|
1955
|
+
<span class="method-click-advice">click to toggle source</span>
|
1956
|
+
</div>
|
1957
|
+
|
1958
|
+
|
1959
|
+
<div class="method-description">
|
1960
|
+
|
1961
|
+
<p>Derive geostrophic wind from geopotential hight (spherical but fixed f)</p>
|
1962
|
+
|
1963
|
+
<p>ARGUMENTS</p>
|
1964
|
+
<ul><li>
|
1965
|
+
<p>z [GPhys] : geopotential height on the pressure (or log-pressure)
|
1966
|
+
coordinate</p>
|
1967
|
+
</li><li>
|
1968
|
+
<p>f [nil or Numeric of UNumeric] : the constant f value (Coriolis
|
1969
|
+
parameter). If nil, the value at the north pole is assumed. If Numeric,
|
1970
|
+
units are assumed to be “s-1”.</p>
|
1971
|
+
</li></ul>
|
1972
|
+
|
1973
|
+
|
1974
|
+
|
1975
|
+
<div class="method-source-code" id="z2geostrophic_wind-source">
|
1976
|
+
<pre>
|
1977
|
+
<span class="ruby-comment"># File ../../lib/numru/ganalysis/met.rb, line 204</span>
|
1978
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">z2geostrophic_wind</span>(<span class="ruby-identifier">z</span>, <span class="ruby-identifier">f</span>=<span class="ruby-keyword">nil</span>)
|
1979
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">nil?</span>
|
1980
|
+
<span class="ruby-identifier">f</span> = <span class="ruby-value">2</span> * <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">omega</span>
|
1981
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Numeric</span>)
|
1982
|
+
<span class="ruby-identifier">f</span> = <span class="ruby-constant">UNumeric</span>[<span class="ruby-identifier">f</span>,<span class="ruby-string">"s-1"</span>]
|
1983
|
+
<span class="ruby-keyword">end</span>
|
1984
|
+
<span class="ruby-identifier">z</span> = <span class="ruby-identifier">z</span>.<span class="ruby-identifier">convert_units</span>(<span class="ruby-string">"m"</span>)
|
1985
|
+
<span class="ruby-identifier">gx</span>, <span class="ruby-identifier">gy</span> = <span class="ruby-constant">GAnalysis</span><span class="ruby-operator">::</span><span class="ruby-constant">Planet</span>.<span class="ruby-identifier">grad_s</span>( <span class="ruby-identifier">z</span> * (<span class="ruby-identifier">g</span><span class="ruby-operator">/</span><span class="ruby-identifier">f</span>) )
|
1986
|
+
<span class="ruby-identifier">u</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">gy</span>
|
1987
|
+
<span class="ruby-identifier">v</span> = <span class="ruby-identifier">gx</span>
|
1988
|
+
<span class="ruby-identifier">u</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"u"</span>
|
1989
|
+
<span class="ruby-identifier">u</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"geostrophic U"</span>
|
1990
|
+
<span class="ruby-identifier">u</span>.<span class="ruby-identifier">put_att</span>(<span class="ruby-string">"assumed_f"</span>,<span class="ruby-identifier">f</span>.<span class="ruby-identifier">to_s</span>)
|
1991
|
+
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">"v"</span>
|
1992
|
+
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">"geostrophic V"</span>
|
1993
|
+
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">put_att</span>(<span class="ruby-string">"assumed_f"</span>,<span class="ruby-identifier">f</span>.<span class="ruby-identifier">to_s</span>)
|
1994
|
+
[<span class="ruby-identifier">u</span>, <span class="ruby-identifier">v</span>]
|
1995
|
+
<span class="ruby-keyword">end</span></pre>
|
1996
|
+
</div><!-- z2geostrophic_wind-source -->
|
1997
|
+
|
1998
|
+
</div>
|
1999
|
+
|
2000
|
+
|
2001
|
+
|
2002
|
+
|
2003
|
+
</div><!-- z2geostrophic_wind-method -->
|
2004
|
+
|
2005
|
+
|
2006
|
+
</div><!-- public-instance-method-details -->
|
2007
|
+
|
2008
|
+
</div><!-- 5Buntitled-5D -->
|
2009
|
+
|
2010
|
+
|
2011
|
+
</div><!-- documentation -->
|
2012
|
+
|
2013
|
+
<div id="validator-badges">
|
2014
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
2015
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
2016
|
+
Rdoc Generator</a> 2</small>.</p>
|
2017
|
+
</div>
|
2018
|
+
|
2019
|
+
</body>
|
2020
|
+
</html>
|
2021
|
+
|