gphys 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +7414 -0
  3. data/LICENSE.txt +1 -1
  4. data/Rakefile +0 -2
  5. data/doc/derivative/math-doc/document/images.log +385 -0
  6. data/doc/ep_flux/math-doc/document/images.log +1375 -0
  7. data/doc/ganalysis/doc/NumRu.html +203 -0
  8. data/doc/ganalysis/doc/NumRu/GAnalysis.html +931 -0
  9. data/doc/ganalysis/doc/NumRu/GAnalysis/BetaPlane.html +574 -0
  10. data/doc/ganalysis/doc/NumRu/GAnalysis/Fitting.html +576 -0
  11. data/doc/ganalysis/doc/NumRu/GAnalysis/LogP.html +425 -0
  12. data/doc/ganalysis/doc/NumRu/GAnalysis/Met.html +2021 -0
  13. data/doc/ganalysis/doc/NumRu/GAnalysis/MetZ.html +524 -0
  14. data/doc/ganalysis/doc/NumRu/GAnalysis/Planet.html +1047 -0
  15. data/doc/ganalysis/doc/NumRu/GAnalysis/QG.html +794 -0
  16. data/doc/ganalysis/doc/NumRu/GAnalysis/QG/Uninitialized.html +215 -0
  17. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_common.html +603 -0
  18. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere.html +760 -0
  19. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere_common.html +251 -0
  20. data/doc/ganalysis/doc/NumRu/GAnalysis/QG_sphere_div.html +424 -0
  21. data/doc/ganalysis/doc/NumRu/GAnalysis/SigmaCoord.html +321 -0
  22. data/doc/ganalysis/doc/NumRu/GGraph.html +334 -0
  23. data/doc/ganalysis/doc/NumRu/GPhys.html +579 -0
  24. data/doc/ganalysis/doc/Object.html +210 -0
  25. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/beta_plane_rb.html +60 -0
  26. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/covariance_rb.html +56 -0
  27. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/eof_rb.html +64 -0
  28. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/fitting_rb.html +54 -0
  29. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/histogram_rb.html +58 -0
  30. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/log_p_rb.html +60 -0
  31. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/met_rb.html +60 -0
  32. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/met_z_rb.html +58 -0
  33. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/planet_rb.html +58 -0
  34. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/qg_rb.html +64 -0
  35. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis/sigma_coord_rb.html +56 -0
  36. data/doc/ganalysis/doc/__/__/lib/numru/ganalysis_rb.html +98 -0
  37. data/doc/ganalysis/doc/created.rid +13 -0
  38. data/doc/ganalysis/doc/images/brick.png +0 -0
  39. data/doc/ganalysis/doc/images/brick_link.png +0 -0
  40. data/doc/ganalysis/doc/images/bug.png +0 -0
  41. data/doc/ganalysis/doc/images/bullet_black.png +0 -0
  42. data/doc/ganalysis/doc/images/bullet_toggle_minus.png +0 -0
  43. data/doc/ganalysis/doc/images/bullet_toggle_plus.png +0 -0
  44. data/doc/ganalysis/doc/images/date.png +0 -0
  45. data/doc/ganalysis/doc/images/find.png +0 -0
  46. data/doc/ganalysis/doc/images/loadingAnimation.gif +0 -0
  47. data/doc/ganalysis/doc/images/macFFBgHack.png +0 -0
  48. data/doc/ganalysis/doc/images/package.png +0 -0
  49. data/doc/ganalysis/doc/images/page_green.png +0 -0
  50. data/doc/ganalysis/doc/images/page_white_text.png +0 -0
  51. data/doc/ganalysis/doc/images/page_white_width.png +0 -0
  52. data/doc/ganalysis/doc/images/plugin.png +0 -0
  53. data/doc/ganalysis/doc/images/ruby.png +0 -0
  54. data/doc/ganalysis/doc/images/tag_green.png +0 -0
  55. data/doc/ganalysis/doc/images/wrench.png +0 -0
  56. data/doc/ganalysis/doc/images/wrench_orange.png +0 -0
  57. data/doc/ganalysis/doc/images/zoom.png +0 -0
  58. data/doc/ganalysis/doc/index.html +383 -0
  59. data/doc/ganalysis/doc/js/darkfish.js +118 -0
  60. data/doc/ganalysis/doc/js/jquery.js +32 -0
  61. data/doc/ganalysis/doc/js/quicksearch.js +114 -0
  62. data/doc/ganalysis/doc/js/thickbox-compressed.js +10 -0
  63. data/doc/ganalysis/doc/rdoc.css +763 -0
  64. data/ext/numru/gphys/ext_init.c +1 -0
  65. data/ext/numru/gphys/quad_mesh_sample.c +478 -0
  66. data/gphys.gemspec +2 -2
  67. data/lib/numru/dclext.rb +394 -14
  68. data/lib/numru/derivative.rb +6 -0
  69. data/lib/numru/ganalysis/qg.rb +6 -4
  70. data/lib/numru/ggraph.rb +41 -8
  71. data/lib/numru/gphys/gphys.rb +62 -14
  72. data/lib/numru/gphys/gphys_io.rb +4 -4
  73. data/lib/numru/gphys/version.rb +2 -2
  74. metadata +84 -79
  75. data/.gitignore +0 -14
  76. data/TODO_ep_flux +0 -6
  77. data/gphys-bigmem.gemspec +0 -44
  78. data/install.rb +0 -130
  79. data/sample/cira86_to_nc.rb +0 -122
  80. data/sample/druby_cli1.rb +0 -23
  81. data/sample/druby_cli2.rb +0 -28
  82. data/sample/druby_serv1.rb +0 -30
  83. data/sample/druby_serv2.rb +0 -51
  84. data/sample/ep_flux/demo_NCEP_1.rb +0 -48
  85. data/sample/ep_flux/demo_NCEP_2.rb +0 -57
  86. data/sample/ep_flux/demo_NCEP_3.rb +0 -81
  87. data/sample/ggraph_latlon_labelling_dr002690.rb +0 -159
  88. data/sample/ggraph_mapfit-axes_dr002687.rb +0 -131
  89. data/sample/map_projection.rb +0 -121
  90. data/sample/ncep_theta_coord.rb +0 -79
  91. data/test_old/eof_slp.rb +0 -28
  92. data/test_old/mltbit.dat +0 -0
  93. data/test_old/test_ep_flux.rb +0 -533
  94. data/test_old/test_multibitIO.rb +0 -19
@@ -0,0 +1,215 @@
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>Class: NumRu::GAnalysis::QG::Uninitialized</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="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="../../../index.html">Home</a>
25
+ <a href="../../../index.html#classes">Classes</a>
26
+ <a href="../../../index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="../../../__/__/lib/numru/ganalysis/qg_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="../../lib/numru/ganalysis/qg.rb">../../lib/numru/ganalysis/qg.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link"><a href="../../../Object.html">Object</a></p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-i-method_missing">#method_missing</a></li>
69
+
70
+ </ul>
71
+ </div>
72
+
73
+
74
+
75
+ </div>
76
+
77
+ <div id="project-metadata">
78
+
79
+
80
+
81
+ <div id="classindex-section" class="section project-section">
82
+ <h3 class="section-header">Class/Module Index
83
+ <span class="search-toggle"><img src="../../../images/find.png"
84
+ height="16" width="16" alt="[+]"
85
+ title="show/hide quicksearch" /></span></h3>
86
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
87
+ <fieldset>
88
+ <legend>Quicksearch</legend>
89
+ <input type="text" name="quicksearch" value=""
90
+ class="quicksearch-field" />
91
+ </fieldset>
92
+ </form>
93
+
94
+ <ul class="link-list">
95
+
96
+ <li><a href="../../../NumRu.html">NumRu</a></li>
97
+
98
+ <li><a href="../../../NumRu/GAnalysis.html">NumRu::GAnalysis</a></li>
99
+
100
+ <li><a href="../../../NumRu/GAnalysis/BetaPlane.html">NumRu::GAnalysis::BetaPlane</a></li>
101
+
102
+ <li><a href="../../../NumRu/GAnalysis/Fitting.html">NumRu::GAnalysis::Fitting</a></li>
103
+
104
+ <li><a href="../../../NumRu/GAnalysis/LogP.html">NumRu::GAnalysis::LogP</a></li>
105
+
106
+ <li><a href="../../../NumRu/GAnalysis/Met.html">NumRu::GAnalysis::Met</a></li>
107
+
108
+ <li><a href="../../../NumRu/GAnalysis/MetZ.html">NumRu::GAnalysis::MetZ</a></li>
109
+
110
+ <li><a href="../../../NumRu/GAnalysis/Planet.html">NumRu::GAnalysis::Planet</a></li>
111
+
112
+ <li><a href="../../../NumRu/GAnalysis/QG.html">NumRu::GAnalysis::QG</a></li>
113
+
114
+ <li><a href="../../../NumRu/GAnalysis/QG/Uninitialized.html">NumRu::GAnalysis::QG::Uninitialized</a></li>
115
+
116
+ <li><a href="../../../NumRu/GAnalysis/QG_common.html">NumRu::GAnalysis::QG_common</a></li>
117
+
118
+ <li><a href="../../../NumRu/GAnalysis/QG_sphere.html">NumRu::GAnalysis::QG_sphere</a></li>
119
+
120
+ <li><a href="../../../NumRu/GAnalysis/QG_sphere_common.html">NumRu::GAnalysis::QG_sphere_common</a></li>
121
+
122
+ <li><a href="../../../NumRu/GAnalysis/QG_sphere_div.html">NumRu::GAnalysis::QG_sphere_div</a></li>
123
+
124
+ <li><a href="../../../NumRu/GAnalysis/SigmaCoord.html">NumRu::GAnalysis::SigmaCoord</a></li>
125
+
126
+ <li><a href="../../../NumRu/GGraph.html">NumRu::GGraph</a></li>
127
+
128
+ <li><a href="../../../NumRu/GPhys.html">NumRu::GPhys</a></li>
129
+
130
+ <li><a href="../../../Object.html">Object</a></li>
131
+
132
+ </ul>
133
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
134
+ </div>
135
+
136
+
137
+ </div>
138
+ </div>
139
+
140
+ <div id="documentation">
141
+ <h1 class="class">NumRu::GAnalysis::QG::Uninitialized</h1>
142
+
143
+ <div id="description" class="description">
144
+
145
+ <p>This class is for internal use only</p>
146
+
147
+ </div><!-- description -->
148
+
149
+
150
+
151
+
152
+ <div id="5Buntitled-5D" class="documentation-section">
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ <!-- Methods -->
162
+
163
+ <div id="public-instance-method-details" class="method-section section">
164
+ <h3 class="section-header">Public Instance Methods</h3>
165
+
166
+
167
+ <div id="method_missing-method" class="method-detail ">
168
+ <a name="method-i-method_missing"></a>
169
+
170
+
171
+ <div class="method-heading">
172
+ <span class="method-name">method_missing</span><span
173
+ class="method-args">(method_name)</span>
174
+ <span class="method-click-advice">click to toggle source</span>
175
+ </div>
176
+
177
+
178
+ <div class="method-description">
179
+
180
+
181
+
182
+
183
+
184
+ <div class="method-source-code" id="method_missing-source">
185
+ <pre>
186
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 253</span>
187
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method_name</span>)
188
+ <span class="ruby-identifier">raise</span>(<span class="ruby-string">&quot;Reference latitude has not been set. Call QG::set_lat0 to use the module QG.&quot;</span>)
189
+ <span class="ruby-keyword">end</span></pre>
190
+ </div><!-- method_missing-source -->
191
+
192
+ </div>
193
+
194
+
195
+
196
+
197
+ </div><!-- method_missing-method -->
198
+
199
+
200
+ </div><!-- public-instance-method-details -->
201
+
202
+ </div><!-- 5Buntitled-5D -->
203
+
204
+
205
+ </div><!-- documentation -->
206
+
207
+ <div id="validator-badges">
208
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
209
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
210
+ Rdoc Generator</a> 2</small>.</p>
211
+ </div>
212
+
213
+ </body>
214
+ </html>
215
+
@@ -0,0 +1,603 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+
8
+ <title>Module: NumRu::GAnalysis::QG_common</title>
9
+
10
+ <link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../../js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="../../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="module">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="../../index.html">Home</a>
25
+ <a href="../../index.html#classes">Classes</a>
26
+ <a href="../../index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="../../__/__/lib/numru/ganalysis/qg_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="../../lib/numru/ganalysis/qg.rb">../../lib/numru/ganalysis/qg.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+
50
+
51
+
52
+
53
+
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-cut_bottom">::cut_bottom</a></li>
61
+
62
+ <li><a href="#method-c-extend_bottom">::extend_bottom</a></li>
63
+
64
+ <li><a href="#method-c-gp2gpref">::gp2gpref</a></li>
65
+
66
+ <li><a href="#method-c-gpd2qzz">::gpd2qzz</a></li>
67
+
68
+ <li><a href="#method-c-gph2gpd_gpref">::gph2gpd_gpref</a></li>
69
+
70
+ <li><a href="#method-c-gph2gpref">::gph2gpref</a></li>
71
+
72
+ <li><a href="#method-c-gpref2n2">::gpref2n2</a></li>
73
+
74
+ <li><a href="#method-i-div_waf">#div_waf</a></li>
75
+
76
+ </ul>
77
+ </div>
78
+
79
+
80
+
81
+ </div>
82
+
83
+ <div id="project-metadata">
84
+
85
+
86
+
87
+ <div id="classindex-section" class="section project-section">
88
+ <h3 class="section-header">Class/Module Index
89
+ <span class="search-toggle"><img src="../../images/find.png"
90
+ height="16" width="16" alt="[+]"
91
+ title="show/hide quicksearch" /></span></h3>
92
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
93
+ <fieldset>
94
+ <legend>Quicksearch</legend>
95
+ <input type="text" name="quicksearch" value=""
96
+ class="quicksearch-field" />
97
+ </fieldset>
98
+ </form>
99
+
100
+ <ul class="link-list">
101
+
102
+ <li><a href="../../NumRu.html">NumRu</a></li>
103
+
104
+ <li><a href="../../NumRu/GAnalysis.html">NumRu::GAnalysis</a></li>
105
+
106
+ <li><a href="../../NumRu/GAnalysis/BetaPlane.html">NumRu::GAnalysis::BetaPlane</a></li>
107
+
108
+ <li><a href="../../NumRu/GAnalysis/Fitting.html">NumRu::GAnalysis::Fitting</a></li>
109
+
110
+ <li><a href="../../NumRu/GAnalysis/LogP.html">NumRu::GAnalysis::LogP</a></li>
111
+
112
+ <li><a href="../../NumRu/GAnalysis/Met.html">NumRu::GAnalysis::Met</a></li>
113
+
114
+ <li><a href="../../NumRu/GAnalysis/MetZ.html">NumRu::GAnalysis::MetZ</a></li>
115
+
116
+ <li><a href="../../NumRu/GAnalysis/Planet.html">NumRu::GAnalysis::Planet</a></li>
117
+
118
+ <li><a href="../../NumRu/GAnalysis/QG.html">NumRu::GAnalysis::QG</a></li>
119
+
120
+ <li><a href="../../NumRu/GAnalysis/QG/Uninitialized.html">NumRu::GAnalysis::QG::Uninitialized</a></li>
121
+
122
+ <li><a href="../../NumRu/GAnalysis/QG_common.html">NumRu::GAnalysis::QG_common</a></li>
123
+
124
+ <li><a href="../../NumRu/GAnalysis/QG_sphere.html">NumRu::GAnalysis::QG_sphere</a></li>
125
+
126
+ <li><a href="../../NumRu/GAnalysis/QG_sphere_common.html">NumRu::GAnalysis::QG_sphere_common</a></li>
127
+
128
+ <li><a href="../../NumRu/GAnalysis/QG_sphere_div.html">NumRu::GAnalysis::QG_sphere_div</a></li>
129
+
130
+ <li><a href="../../NumRu/GAnalysis/SigmaCoord.html">NumRu::GAnalysis::SigmaCoord</a></li>
131
+
132
+ <li><a href="../../NumRu/GGraph.html">NumRu::GGraph</a></li>
133
+
134
+ <li><a href="../../NumRu/GPhys.html">NumRu::GPhys</a></li>
135
+
136
+ <li><a href="../../Object.html">Object</a></li>
137
+
138
+ </ul>
139
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
140
+ </div>
141
+
142
+
143
+ </div>
144
+ </div>
145
+
146
+ <div id="documentation">
147
+ <h1 class="module">NumRu::GAnalysis::QG_common</h1>
148
+
149
+ <div id="description" class="description">
150
+
151
+ <p><a href="QG_common.html">QG_common</a>: collection of common methods for <a
152
+ href="QG.html">QG</a>, <a href="QG_sphere.html">QG_sphere</a>, and <a
153
+ href="QG_sphere_div.html">QG_sphere_div</a>.</p>
154
+
155
+ </div><!-- description -->
156
+
157
+
158
+
159
+
160
+ <div id="5Buntitled-5D" class="documentation-section">
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+ <!-- Methods -->
170
+
171
+ <div id="public-class-method-details" class="method-section section">
172
+ <h3 class="section-header">Public Class Methods</h3>
173
+
174
+
175
+ <div id="cut_bottom-method" class="method-detail ">
176
+ <a name="method-c-cut_bottom"></a>
177
+
178
+
179
+ <div class="method-heading">
180
+ <span class="method-name">cut_bottom</span><span
181
+ class="method-args">(z)</span>
182
+ <span class="method-click-advice">click to toggle source</span>
183
+ </div>
184
+
185
+
186
+ <div class="method-description">
187
+
188
+
189
+
190
+
191
+
192
+ <div class="method-source-code" id="cut_bottom-source">
193
+ <pre>
194
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 154</span>
195
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">cut_bottom</span>(<span class="ruby-identifier">z</span>)
196
+ <span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">z</span>)
197
+ <span class="ruby-identifier">plev</span> = <span class="ruby-identifier">z</span>.<span class="ruby-identifier">coord</span>(<span class="ruby-identifier">pdim</span>).<span class="ruby-identifier">val</span>
198
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">plev</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">plev</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
199
+ <span class="ruby-identifier">z</span>[ *([<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span> <span class="ruby-operator">+</span> [<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>,<span class="ruby-keyword">false</span>]) ]
200
+ <span class="ruby-keyword">else</span>
201
+ <span class="ruby-identifier">z</span>[ *([<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span> <span class="ruby-operator">+</span> [<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>,<span class="ruby-keyword">false</span>]) ]
202
+ <span class="ruby-keyword">end</span>
203
+ <span class="ruby-keyword">end</span></pre>
204
+ </div><!-- cut_bottom-source -->
205
+
206
+ </div>
207
+
208
+
209
+
210
+
211
+ </div><!-- cut_bottom-method -->
212
+
213
+
214
+ <div id="extend_bottom-method" class="method-detail ">
215
+ <a name="method-c-extend_bottom"></a>
216
+
217
+
218
+ <div class="method-heading">
219
+ <span class="method-name">extend_bottom</span><span
220
+ class="method-args">(z, val_extended=nil)</span>
221
+ <span class="method-click-advice">click to toggle source</span>
222
+ </div>
223
+
224
+
225
+ <div class="method-description">
226
+
227
+ <pre>def gpd2qzz(gp, b)
228
+ pdim = Met.find_prs_d(gp)
229
+ p = gp.axis(pdim).to_gphys
230
+ gp_z = LogP.pcdata_dz( gp )
231
+ qzz = LogP.pcdata_dz( gp_z * (p/b) ) / p
232
+ qzz.name = &quot;qzz&quot;
233
+ qzz.long_name = &quot;z-deriv term in QG PV&quot;
234
+ qzz
235
+ end</pre>
236
+
237
+ <p># Extend the bottom pressure level by the lowest thickness # (a
238
+ hypothetical “Under-ground” level is created) # If value of the extended
239
+ bottom level is set to # val_extended (Numeric or NArray etc), if it is
240
+ specified (non nil). # If nil, the value at the original bottom level is
241
+ simply copied.</p>
242
+
243
+
244
+
245
+ <div class="method-source-code" id="extend_bottom-source">
246
+ <pre>
247
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 127</span>
248
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">extend_bottom</span>(<span class="ruby-identifier">z</span>, <span class="ruby-identifier">val_extended</span>=<span class="ruby-keyword">nil</span>)
249
+ <span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">z</span>)
250
+ <span class="ruby-identifier">plev</span> = <span class="ruby-identifier">z</span>.<span class="ruby-identifier">coord</span>(<span class="ruby-identifier">pdim</span>).<span class="ruby-identifier">val</span>
251
+ <span class="ruby-identifier">raise</span>(<span class="ruby-string">&quot;Only one pressure level is found; 2 or more needed&quot;</span>) <span class="ruby-keyword">if</span> (<span class="ruby-identifier">plev</span><span class="ruby-operator">==</span><span class="ruby-value">1</span>)
252
+ <span class="ruby-identifier">bottom_first</span> = ( <span class="ruby-identifier">plev</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">plev</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> )
253
+ <span class="ruby-identifier">np</span> = <span class="ruby-identifier">z</span>.<span class="ruby-identifier">shape</span>[<span class="ruby-identifier">pdim</span>]
254
+ <span class="ruby-identifier">idx</span> = (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">np</span>).<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>}
255
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">bottom_first</span> <span class="ruby-comment"># The first level is the bottom one</span>
256
+ <span class="ruby-identifier">idx</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-value">0</span>) <span class="ruby-comment"># idx =&gt; [0,0,1,2,...,np-1]</span>
257
+ <span class="ruby-identifier">ihb</span> = <span class="ruby-value">0</span> <span class="ruby-comment"># index of the extended bottom level</span>
258
+ <span class="ruby-identifier">dp</span> = <span class="ruby-identifier">plev</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">plev</span>[<span class="ruby-value">1</span>]
259
+ <span class="ruby-identifier">phb</span> = <span class="ruby-identifier">plev</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">dp</span> <span class="ruby-comment"># pressure of the extended bottom level</span>
260
+ <span class="ruby-keyword">else</span> <span class="ruby-comment"># The last level is the bottom one</span>
261
+ <span class="ruby-identifier">idx</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">np</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>) <span class="ruby-comment"># idx =&gt; [0,1,2,...,np-1,np-1]</span>
262
+ <span class="ruby-identifier">ihb</span> = <span class="ruby-identifier">np</span> <span class="ruby-comment"># index of the extended bottom level</span>
263
+ <span class="ruby-identifier">dp</span> = <span class="ruby-identifier">plev</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">plev</span>[<span class="ruby-value">-2</span>]
264
+ <span class="ruby-identifier">phb</span> = <span class="ruby-identifier">plev</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">dp</span> <span class="ruby-comment"># pressure of the extended bottom level</span>
265
+ <span class="ruby-keyword">end</span>
266
+ <span class="ruby-identifier">ze</span> = <span class="ruby-identifier">z</span>[ *([<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">idx</span>,<span class="ruby-keyword">false</span>]) ].<span class="ruby-identifier">copy</span> <span class="ruby-comment"># add one level below</span>
267
+ <span class="ruby-identifier">ze</span>.<span class="ruby-identifier">coord</span>(<span class="ruby-identifier">pdim</span>)[<span class="ruby-identifier">ihb</span>] = <span class="ruby-identifier">phb</span>
268
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">val_extended</span>
269
+ <span class="ruby-identifier">ze</span>[ *([<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">ihb</span>,<span class="ruby-keyword">false</span>]) ] = <span class="ruby-identifier">val_extended</span>
270
+ <span class="ruby-keyword">end</span>
271
+ <span class="ruby-identifier">ze</span>
272
+ <span class="ruby-keyword">end</span></pre>
273
+ </div><!-- extend_bottom-source -->
274
+
275
+ </div>
276
+
277
+
278
+
279
+
280
+ </div><!-- extend_bottom-method -->
281
+
282
+
283
+ <div id="gp2gpref-method" class="method-detail ">
284
+ <a name="method-c-gp2gpref"></a>
285
+
286
+
287
+ <div class="method-heading">
288
+ <span class="method-name">gp2gpref</span><span
289
+ class="method-args">(gp)</span>
290
+ <span class="method-click-advice">click to toggle source</span>
291
+ </div>
292
+
293
+
294
+ <div class="method-description">
295
+
296
+ <p>geopotential (multi-D) -&gt; reference geopotential profile (1D)</p>
297
+
298
+
299
+
300
+ <div class="method-source-code" id="gp2gpref-source">
301
+ <pre>
302
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 24</span>
303
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">gp2gpref</span>(<span class="ruby-identifier">gp</span>)
304
+ <span class="ruby-identifier">gpref</span> = <span class="ruby-constant">Planet</span><span class="ruby-operator">::</span><span class="ruby-identifier">ave_s</span>(<span class="ruby-identifier">gp</span>) <span class="ruby-comment"># horizontal ave (spherical)</span>
305
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">gpref</span>.<span class="ruby-identifier">rank</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">2</span>
306
+ <span class="ruby-comment"># likely a time sequence. need to reduce more.</span>
307
+ <span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gpref</span>)
308
+ <span class="ruby-identifier">idxs</span> = (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">gpref</span>.<span class="ruby-identifier">rank</span>).<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>}
309
+ <span class="ruby-identifier">idxs</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">pdim</span>)
310
+ <span class="ruby-identifier">gpref</span> = <span class="ruby-identifier">gpref</span>.<span class="ruby-identifier">mean</span>(*<span class="ruby-identifier">idxs</span>)
311
+ <span class="ruby-keyword">end</span>
312
+ <span class="ruby-identifier">gpref</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">&quot;gpref&quot;</span>
313
+ <span class="ruby-identifier">gpref</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">&quot;Reference geopotential&quot;</span>
314
+ <span class="ruby-identifier">gpref</span>
315
+ <span class="ruby-keyword">end</span></pre>
316
+ </div><!-- gp2gpref-source -->
317
+
318
+ </div>
319
+
320
+
321
+
322
+
323
+ </div><!-- gp2gpref-method -->
324
+
325
+
326
+ <div id="gpd2qzz-method" class="method-detail ">
327
+ <a name="method-c-gpd2qzz"></a>
328
+
329
+
330
+ <div class="method-heading">
331
+ <span class="method-name">gpd2qzz</span><span
332
+ class="method-args">(gp, b)</span>
333
+ <span class="method-click-advice">click to toggle source</span>
334
+ </div>
335
+
336
+
337
+ <div class="method-description">
338
+
339
+ <p>[ (p/b) gp_z ]_z /p</p>
340
+
341
+
342
+
343
+ <div class="method-source-code" id="gpd2qzz-source">
344
+ <pre>
345
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 65</span>
346
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">gpd2qzz</span>(<span class="ruby-identifier">gp</span>, <span class="ruby-identifier">b</span>)
347
+ <span class="ruby-identifier">bunits</span> = <span class="ruby-constant">Units</span>[<span class="ruby-string">&quot;s-2&quot;</span>] <span class="ruby-comment"># this is assumed!</span>
348
+ <span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">gp</span>)
349
+ <span class="ruby-identifier">p</span> = <span class="ruby-identifier">gp</span>.<span class="ruby-identifier">coord</span>(<span class="ruby-identifier">pdim</span>)
350
+ <span class="ruby-identifier">z</span> = <span class="ruby-constant">LogP</span>.<span class="ruby-identifier">p2z</span>(<span class="ruby-identifier">p</span>)
351
+ <span class="ruby-identifier">zunits</span> = <span class="ruby-identifier">z</span>.<span class="ruby-identifier">units</span>
352
+ <span class="ruby-identifier">g</span> = <span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-identifier">b_expand_linear_ext</span>( <span class="ruby-identifier">gp</span>.<span class="ruby-identifier">val</span>, <span class="ruby-identifier">pdim</span> )
353
+ <span class="ruby-identifier">z</span> = <span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-identifier">b_expand_linear_ext</span>( <span class="ruby-identifier">z</span>.<span class="ruby-identifier">val</span>, <span class="ruby-value">0</span> )
354
+ <span class="ruby-identifier">p</span> = <span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-identifier">b_expand_linear_ext</span>( <span class="ruby-identifier">p</span>.<span class="ruby-identifier">val</span>, <span class="ruby-value">0</span> )
355
+ <span class="ruby-identifier">b</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">val</span>
356
+ <span class="ruby-identifier">b</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_na</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_na</span>) <span class="ruby-comment"># likely a NArrayMiss</span>
357
+ <span class="ruby-identifier">b</span> = <span class="ruby-constant">Derivative</span><span class="ruby-operator">::</span><span class="ruby-identifier">b_expand_linear_ext</span>( <span class="ruby-identifier">b</span>, <span class="ruby-value">0</span> )
358
+ <span class="ruby-identifier">pb</span> = <span class="ruby-identifier">p</span><span class="ruby-operator">/</span><span class="ruby-identifier">b</span>
359
+
360
+ <span class="ruby-identifier">pbm</span> = (<span class="ruby-identifier">pb</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">pb</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]) <span class="ruby-operator">/</span> <span class="ruby-value">2.0</span> <span class="ruby-comment"># pb_{i+1/2} (for i=0..-2)</span>
361
+ <span class="ruby-identifier">pbm01</span> = <span class="ruby-identifier">pbm</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>] <span class="ruby-comment"># pb_{i-1/2} (for i=1..-2)</span>
362
+ <span class="ruby-identifier">pbm12</span> = <span class="ruby-identifier">pbm</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] <span class="ruby-comment"># pb_{i+1/2} (for i=1..-2)</span>
363
+ <span class="ruby-identifier">dz20</span> = <span class="ruby-identifier">z</span>[<span class="ruby-value">2</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">z</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-3</span>] <span class="ruby-comment"># z_{i+1} - z_{i-1} (for i=1..-2)</span>
364
+ <span class="ruby-identifier">dz21</span> = <span class="ruby-identifier">z</span>[<span class="ruby-value">2</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">z</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>] <span class="ruby-comment"># z_{i+1} - z_{i} (for i=1..-2)</span>
365
+ <span class="ruby-identifier">dz10</span> = <span class="ruby-identifier">z</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">z</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-3</span>] <span class="ruby-comment"># z_{i} - x_{i-1} (for i=1..-2)</span>
366
+ <span class="ruby-identifier">pc</span> = <span class="ruby-identifier">p</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>] <span class="ruby-comment"># p_{i} (for i=1..-2)</span>
367
+
368
+ <span class="ruby-identifier">a2</span> = <span class="ruby-value">2</span>*<span class="ruby-identifier">pbm12</span><span class="ruby-operator">/</span>(<span class="ruby-identifier">dz21</span>*<span class="ruby-identifier">dz20</span>)<span class="ruby-operator">/</span><span class="ruby-identifier">pc</span>
369
+ <span class="ruby-identifier">a0</span> = <span class="ruby-value">2</span>*<span class="ruby-identifier">pbm01</span><span class="ruby-operator">/</span>(<span class="ruby-identifier">dz10</span>*<span class="ruby-identifier">dz20</span>)<span class="ruby-operator">/</span><span class="ruby-identifier">pc</span>
370
+ <span class="ruby-identifier">a1</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">a2</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">a0</span>
371
+
372
+ <span class="ruby-identifier">to_rankD</span> = [<span class="ruby-value">1</span>]*<span class="ruby-identifier">pdim</span> <span class="ruby-operator">+</span> [<span class="ruby-keyword">true</span>] <span class="ruby-operator">+</span> [<span class="ruby-value">1</span>]*(<span class="ruby-identifier">gp</span>.<span class="ruby-identifier">rank</span><span class="ruby-operator">-</span><span class="ruby-identifier">pdim</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)
373
+ <span class="ruby-identifier">a2</span> = <span class="ruby-identifier">a2</span>.<span class="ruby-identifier">reshape</span>(*<span class="ruby-identifier">to_rankD</span>)
374
+ <span class="ruby-identifier">a1</span> = <span class="ruby-identifier">a1</span>.<span class="ruby-identifier">reshape</span>(*<span class="ruby-identifier">to_rankD</span>)
375
+ <span class="ruby-identifier">a0</span> = <span class="ruby-identifier">a0</span>.<span class="ruby-identifier">reshape</span>(*<span class="ruby-identifier">to_rankD</span>)
376
+
377
+ <span class="ruby-identifier">vqzz</span> = <span class="ruby-identifier">g</span>[ *([<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span><span class="ruby-operator">+</span>[<span class="ruby-value">2</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>,<span class="ruby-keyword">false</span>]) ] * <span class="ruby-identifier">a2</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">g</span>[ *([<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span><span class="ruby-operator">+</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>,<span class="ruby-keyword">false</span>]) ] * <span class="ruby-identifier">a1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">g</span>[ *([<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span><span class="ruby-operator">+</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-3</span>,<span class="ruby-keyword">false</span>]) ] * <span class="ruby-identifier">a0</span>
378
+
379
+ <span class="ruby-identifier">qzz</span> = <span class="ruby-identifier">gp</span>.<span class="ruby-identifier">copy</span>
380
+ <span class="ruby-identifier">qzz</span>.<span class="ruby-identifier">data</span>.<span class="ruby-identifier">replace_val</span>(<span class="ruby-identifier">vqzz</span>)
381
+ <span class="ruby-identifier">qzz</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">&quot;qzz&quot;</span>
382
+ <span class="ruby-identifier">qzz</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">&quot;z-deriv term in QG PV&quot;</span>
383
+ <span class="ruby-identifier">qzz</span>.<span class="ruby-identifier">units</span> = <span class="ruby-identifier">qzz</span>.<span class="ruby-identifier">units</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">zunits</span><span class="ruby-operator">**</span><span class="ruby-value">2</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">bunits</span>
384
+ <span class="ruby-identifier">qzz</span>
385
+ <span class="ruby-keyword">end</span></pre>
386
+ </div><!-- gpd2qzz-source -->
387
+
388
+ </div>
389
+
390
+
391
+
392
+
393
+ </div><!-- gpd2qzz-method -->
394
+
395
+
396
+ <div id="gph2gpd_gpref-method" class="method-detail ">
397
+ <a name="method-c-gph2gpd_gpref"></a>
398
+
399
+
400
+ <div class="method-heading">
401
+ <span class="method-name">gph2gpd_gpref</span><span
402
+ class="method-args">(gph)</span>
403
+ <span class="method-click-advice">click to toggle source</span>
404
+ </div>
405
+
406
+
407
+ <div class="method-description">
408
+
409
+ <p>geopotential height to geopotential deviation from the global&amp;time mean</p>
410
+
411
+
412
+
413
+ <div class="method-source-code" id="gph2gpd_gpref-source">
414
+ <pre>
415
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 40</span>
416
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">gph2gpd_gpref</span>(<span class="ruby-identifier">gph</span>)
417
+ <span class="ruby-identifier">gp</span> = <span class="ruby-identifier">gph</span> * <span class="ruby-constant">Met</span><span class="ruby-operator">::</span><span class="ruby-identifier">g</span>
418
+ <span class="ruby-identifier">gpref</span> = <span class="ruby-identifier">gp2gpref</span>(<span class="ruby-identifier">gp</span>)
419
+ <span class="ruby-identifier">gpd</span> = <span class="ruby-identifier">gp</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">gpref</span>
420
+ <span class="ruby-identifier">gpd</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">&quot;gpd&quot;</span>
421
+ <span class="ruby-identifier">gpd</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">&quot;Geopotential deviation&quot;</span>
422
+ [<span class="ruby-identifier">gpd</span>, <span class="ruby-identifier">gpref</span>]
423
+ <span class="ruby-keyword">end</span></pre>
424
+ </div><!-- gph2gpd_gpref-source -->
425
+
426
+ </div>
427
+
428
+
429
+
430
+
431
+ </div><!-- gph2gpd_gpref-method -->
432
+
433
+
434
+ <div id="gph2gpref-method" class="method-detail ">
435
+ <a name="method-c-gph2gpref"></a>
436
+
437
+
438
+ <div class="method-heading">
439
+ <span class="method-name">gph2gpref</span><span
440
+ class="method-args">(gph)</span>
441
+ <span class="method-click-advice">click to toggle source</span>
442
+ </div>
443
+
444
+
445
+ <div class="method-description">
446
+
447
+ <p>geopotential height (multi-D) -&gt; reference geopotential profile (1D)</p>
448
+
449
+
450
+
451
+ <div class="method-source-code" id="gph2gpref-source">
452
+ <pre>
453
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 18</span>
454
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">gph2gpref</span>(<span class="ruby-identifier">gph</span>)
455
+ <span class="ruby-identifier">gp2gpref</span>(<span class="ruby-identifier">gph</span>) * <span class="ruby-constant">Met</span><span class="ruby-operator">::</span><span class="ruby-identifier">g</span>
456
+ <span class="ruby-keyword">end</span></pre>
457
+ </div><!-- gph2gpref-source -->
458
+
459
+ </div>
460
+
461
+
462
+
463
+
464
+ </div><!-- gph2gpref-method -->
465
+
466
+
467
+ <div id="gpref2n2-method" class="method-detail ">
468
+ <a name="method-c-gpref2n2"></a>
469
+
470
+
471
+ <div class="method-heading">
472
+ <span class="method-name">gpref2n2</span><span
473
+ class="method-args">(gpref)</span>
474
+ <span class="method-click-advice">click to toggle source</span>
475
+ </div>
476
+
477
+
478
+ <div class="method-description">
479
+
480
+ <p>reference geopotential -&gt; buoyancy frequency squared</p>
481
+
482
+
483
+
484
+ <div class="method-source-code" id="gpref2n2-source">
485
+ <pre>
486
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 51</span>
487
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">gpref2n2</span>(<span class="ruby-identifier">gpref</span>)
488
+ <span class="ruby-identifier">gp_z</span> = <span class="ruby-constant">LogP</span>.<span class="ruby-identifier">pcdata_dz</span>( <span class="ruby-identifier">gpref</span> )
489
+ <span class="ruby-identifier">gp_zz</span> = <span class="ruby-constant">LogP</span>.<span class="ruby-identifier">pcdata_dz2</span>( <span class="ruby-identifier">gpref</span> )
490
+ <span class="ruby-identifier">gp_zz</span>[<span class="ruby-value">0</span>] = <span class="ruby-identifier">gp_zz</span>[<span class="ruby-value">1</span>] <span class="ruby-comment"># At boundary, it's safer to extend lapse rate</span>
491
+ <span class="ruby-identifier">gp_zz</span>[<span class="ruby-value">-1</span>] = <span class="ruby-identifier">gp_zz</span>[<span class="ruby-value">-2</span>] <span class="ruby-comment"># At boundary, it's safer to extend lapse rate</span>
492
+ <span class="ruby-identifier">n2</span> = <span class="ruby-identifier">gp_zz</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">gp_z</span> * (<span class="ruby-constant">Met</span><span class="ruby-operator">::</span><span class="ruby-constant">Kappa</span> <span class="ruby-operator">/</span> <span class="ruby-constant">LogP</span>.<span class="ruby-identifier">h</span>)
493
+ <span class="ruby-identifier">n2</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">&quot;N2&quot;</span>
494
+ <span class="ruby-identifier">n2</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-string">&quot;N**2 (log-p)&quot;</span>
495
+ <span class="ruby-comment">#p &quot;@@@@@ N2 @@@@&quot;,n2.coord(0).val.to_a, n2.val.sqrt.to_a</span>
496
+ <span class="ruby-identifier">n2</span>
497
+ <span class="ruby-keyword">end</span></pre>
498
+ </div><!-- gpref2n2-source -->
499
+
500
+ </div>
501
+
502
+
503
+
504
+
505
+ </div><!-- gpref2n2-method -->
506
+
507
+
508
+ </div><!-- public-class-method-details -->
509
+
510
+ <div id="public-instance-method-details" class="method-section section">
511
+ <h3 class="section-header">Public Instance Methods</h3>
512
+
513
+
514
+ <div id="div_waf-method" class="method-detail ">
515
+ <a name="method-i-div_waf"></a>
516
+
517
+
518
+ <div class="method-heading">
519
+ <span class="method-name">div_waf</span><span
520
+ class="method-args">(fx, fy, fz, bottom_treatment=true)</span>
521
+ <span class="method-click-advice">click to toggle source</span>
522
+ </div>
523
+
524
+
525
+ <div class="method-description">
526
+
527
+ <p>div of WAF</p>
528
+
529
+ <p>(p cos_phi)^-1 div(p waf) = (cos_phi)^-1 ( div_h(fx,fy) + p^-1 d_z (p fz) )</p>
530
+ <ul><li>
531
+ <p>fx, fy, fz (<a href="../GPhys.html">GPhys</a>) : the x, y and z components
532
+ of waf</p>
533
+ </li><li>
534
+ <p>bottom_treatment (true (==default) or false) : If true, the lowest level
535
+ vertical divergence is computed by assuming that fz is zero at the
536
+ extended “underground” level. The thickness assumed (=<a
537
+ href="http://1">p</a>-<a href="http://0">p</a>) is consistent with the
538
+ ((&lt;<a
539
+ href="QG_common.html#method-c-extend_bottom">extend_bottom</a>&gt;))
540
+ method.</p>
541
+ </li></ul>
542
+
543
+
544
+
545
+ <div class="method-source-code" id="div_waf-source">
546
+ <pre>
547
+ <span class="ruby-comment"># File ../../lib/numru/ganalysis/qg.rb, line 185</span>
548
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">div_waf</span>(<span class="ruby-identifier">fx</span>, <span class="ruby-identifier">fy</span>, <span class="ruby-identifier">fz</span>, <span class="ruby-identifier">bottom_treatment</span>=<span class="ruby-keyword">true</span>)
549
+ <span class="ruby-identifier">cosphi</span> = <span class="ruby-identifier">cos_phi</span>(<span class="ruby-identifier">fx</span>)
550
+ <span class="ruby-identifier">p</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">get_prs</span>(<span class="ruby-identifier">fx</span>)
551
+
552
+ <span class="ruby-identifier">fz_z</span> = <span class="ruby-constant">LogP</span>.<span class="ruby-identifier">pcdata_dz</span>( <span class="ruby-identifier">fz</span>*<span class="ruby-identifier">p</span> ) <span class="ruby-operator">/</span> <span class="ruby-identifier">p</span>
553
+
554
+ <span class="ruby-comment">#&gt;&gt;&gt;&gt;&gt;&gt; the lowest layer treatment consistent with qb, in which</span>
555
+ <span class="ruby-comment"># geopotential (or stream function) is extended by extend_bottom. </span>
556
+ <span class="ruby-comment"># Assumption: the first level is the lowest (bottom) one</span>
557
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">bottom_treatment</span>
558
+ <span class="ruby-comment"># using the relation p^{-1} d/dz = -H^{-1} d/dp </span>
559
+ <span class="ruby-comment"># and assuming fz=0 below the bottom (the &quot;underground&quot; level),</span>
560
+ <span class="ruby-comment"># p^{-1} d/dz (p fz) = -H^{-1} d/dp (p fz),</span>
561
+ <span class="ruby-comment"># which is H^{-1} p fz / delta_p, at the lowest level with a</span>
562
+ <span class="ruby-comment"># &quot;thickness&quot; of delta_p. </span>
563
+ <span class="ruby-identifier">w</span> = <span class="ruby-identifier">p</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>].<span class="ruby-identifier">val</span>
564
+ <span class="ruby-identifier">dp</span> = <span class="ruby-identifier">w</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">w</span>[<span class="ruby-value">0</span>]
565
+ <span class="ruby-identifier">p0</span> = <span class="ruby-identifier">w</span>[<span class="ruby-value">0</span>]
566
+ <span class="ruby-identifier">pdim</span> = <span class="ruby-constant">Met</span>.<span class="ruby-identifier">find_prs_d</span>(<span class="ruby-identifier">fz</span>)
567
+ <span class="ruby-identifier">sel0</span> = [<span class="ruby-keyword">true</span>]*<span class="ruby-identifier">pdim</span> <span class="ruby-operator">+</span> [<span class="ruby-value">0</span>,<span class="ruby-keyword">false</span>] <span class="ruby-comment"># to specify the first level</span>
568
+ <span class="ruby-identifier">fz_z</span>[*<span class="ruby-identifier">sel0</span>] = <span class="ruby-identifier">fz</span>[*<span class="ruby-identifier">sel0</span>]*<span class="ruby-identifier">p0</span> <span class="ruby-operator">/</span> (<span class="ruby-constant">LogP</span>.<span class="ruby-identifier">h</span>*<span class="ruby-identifier">dp</span>)
569
+ <span class="ruby-keyword">end</span>
570
+ <span class="ruby-comment">#&lt;&lt;&lt;&lt;&lt;&lt;</span>
571
+
572
+ <span class="ruby-identifier">divh</span> = ( <span class="ruby-identifier">div_h</span>(<span class="ruby-identifier">fx</span>, <span class="ruby-identifier">fy</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">fz_z</span> ) <span class="ruby-operator">/</span> <span class="ruby-identifier">cosphi</span>
573
+ <span class="ruby-comment"># ^ div_h is defined in QG, QG_sphere,..., but not in QG_common</span>
574
+ <span class="ruby-identifier">divh</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">&quot;divwaf&quot;</span>
575
+ <span class="ruby-identifier">divh</span>.<span class="ruby-identifier">long_name</span> = <span class="ruby-node">&quot;div of waf (#{fx.name},..)&quot;</span>
576
+ <span class="ruby-identifier">divh</span>
577
+ <span class="ruby-keyword">end</span></pre>
578
+ </div><!-- div_waf-source -->
579
+
580
+ </div>
581
+
582
+
583
+
584
+
585
+ </div><!-- div_waf-method -->
586
+
587
+
588
+ </div><!-- public-instance-method-details -->
589
+
590
+ </div><!-- 5Buntitled-5D -->
591
+
592
+
593
+ </div><!-- documentation -->
594
+
595
+ <div id="validator-badges">
596
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
597
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
598
+ Rdoc Generator</a> 2</small>.</p>
599
+ </div>
600
+
601
+ </body>
602
+ </html>
603
+