gphys 1.1.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (369) hide show
  1. data/.gitignore +17 -0
  2. data/ChangeLog +221 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +18 -30
  5. data/README +23 -26
  6. data/README.md +29 -0
  7. data/Rakefile +1 -56
  8. data/bin/gpaop +2 -1
  9. data/bin/gpcut +3 -2
  10. data/bin/gpedit +6 -2
  11. data/bin/gpmath +3 -2
  12. data/bin/gpmaxmin +3 -2
  13. data/bin/gpprint +2 -1
  14. data/bin/gpvect +28 -5
  15. data/bin/gpview +43 -5
  16. data/extconf.rb +5 -6
  17. data/gphys.gemspec +34 -0
  18. data/interpo.c +63 -24
  19. data/lib/gphys.rb +2 -0
  20. data/lib/numru/dclext.rb +2636 -0
  21. data/lib/numru/derivative.rb +53 -12
  22. data/lib/numru/ganalysis/eof.rb +4 -0
  23. data/lib/numru/ganalysis/histogram.rb +73 -5
  24. data/lib/numru/ganalysis/met.rb +163 -2
  25. data/lib/numru/ganalysis/planet.rb +230 -20
  26. data/lib/numru/ggraph.rb +147 -2247
  27. data/lib/numru/gphys/assoccoords.rb +19 -3
  28. data/lib/numru/gphys/axis.rb +1 -1
  29. data/lib/numru/gphys/coordmapping.rb +2 -2
  30. data/lib/numru/gphys/derivative.rb +56 -13
  31. data/lib/numru/gphys/gphys.rb +17 -1
  32. data/lib/numru/gphys/gphys_grads_io.rb +6 -5
  33. data/lib/numru/gphys/gphys_grib_io.rb +6 -6
  34. data/lib/numru/gphys/gphys_io.rb +25 -6
  35. data/lib/numru/gphys/grads_gridded.rb +31 -29
  36. data/lib/numru/gphys/grib.rb +13 -9
  37. data/lib/numru/gphys/interpolate.rb +153 -29
  38. data/lib/numru/gphys/unumeric.rb +29 -6
  39. data/lib/numru/gphys/varray.rb +9 -0
  40. data/lib/numru/gphys/varraygrib.rb +70 -8
  41. data/lib/version.rb +3 -0
  42. metadata +247 -531
  43. data/doc/attribute.html +0 -19
  44. data/doc/attributenetcdf.html +0 -15
  45. data/doc/axis.html +0 -376
  46. data/doc/coordmapping.html +0 -111
  47. data/doc/coordtransform.html +0 -36
  48. data/doc/derivative/gphys-derivative.html +0 -80
  49. data/doc/derivative/index.html +0 -21
  50. data/doc/derivative/index.rd +0 -14
  51. data/doc/derivative/math-doc/document/document.css +0 -30
  52. data/doc/derivative/math-doc/document/document.html +0 -57
  53. data/doc/derivative/math-doc/document/images.aux +0 -1
  54. data/doc/derivative/math-doc/document/images.log +0 -385
  55. data/doc/derivative/math-doc/document/images.pl +0 -186
  56. data/doc/derivative/math-doc/document/images.tex +0 -364
  57. data/doc/derivative/math-doc/document/img1.png +0 -0
  58. data/doc/derivative/math-doc/document/img10.png +0 -0
  59. data/doc/derivative/math-doc/document/img11.png +0 -0
  60. data/doc/derivative/math-doc/document/img12.png +0 -0
  61. data/doc/derivative/math-doc/document/img13.png +0 -0
  62. data/doc/derivative/math-doc/document/img14.png +0 -0
  63. data/doc/derivative/math-doc/document/img15.png +0 -0
  64. data/doc/derivative/math-doc/document/img16.png +0 -0
  65. data/doc/derivative/math-doc/document/img17.png +0 -0
  66. data/doc/derivative/math-doc/document/img18.png +0 -0
  67. data/doc/derivative/math-doc/document/img19.png +0 -0
  68. data/doc/derivative/math-doc/document/img2.png +0 -0
  69. data/doc/derivative/math-doc/document/img20.png +0 -0
  70. data/doc/derivative/math-doc/document/img21.png +0 -0
  71. data/doc/derivative/math-doc/document/img22.png +0 -0
  72. data/doc/derivative/math-doc/document/img23.png +0 -0
  73. data/doc/derivative/math-doc/document/img24.png +0 -0
  74. data/doc/derivative/math-doc/document/img25.png +0 -0
  75. data/doc/derivative/math-doc/document/img26.png +0 -0
  76. data/doc/derivative/math-doc/document/img27.png +0 -0
  77. data/doc/derivative/math-doc/document/img28.png +0 -0
  78. data/doc/derivative/math-doc/document/img29.png +0 -0
  79. data/doc/derivative/math-doc/document/img3.png +0 -0
  80. data/doc/derivative/math-doc/document/img30.png +0 -0
  81. data/doc/derivative/math-doc/document/img4.png +0 -0
  82. data/doc/derivative/math-doc/document/img5.png +0 -0
  83. data/doc/derivative/math-doc/document/img6.png +0 -0
  84. data/doc/derivative/math-doc/document/img7.png +0 -0
  85. data/doc/derivative/math-doc/document/img8.png +0 -0
  86. data/doc/derivative/math-doc/document/img9.png +0 -0
  87. data/doc/derivative/math-doc/document/index.html +0 -57
  88. data/doc/derivative/math-doc/document/labels.pl +0 -13
  89. data/doc/derivative/math-doc/document/next.png +0 -0
  90. data/doc/derivative/math-doc/document/next_g.png +0 -0
  91. data/doc/derivative/math-doc/document/node1.html +0 -238
  92. data/doc/derivative/math-doc/document/node2.html +0 -75
  93. data/doc/derivative/math-doc/document/prev.png +0 -0
  94. data/doc/derivative/math-doc/document/prev_g.png +0 -0
  95. data/doc/derivative/math-doc/document/up.png +0 -0
  96. data/doc/derivative/math-doc/document/up_g.png +0 -0
  97. data/doc/derivative/math-doc/document.pdf +0 -0
  98. data/doc/derivative/math-doc/document.tex +0 -158
  99. data/doc/derivative/numru-derivative.html +0 -129
  100. data/doc/ep_flux/ep_flux.html +0 -469
  101. data/doc/ep_flux/ggraph_on_merdional_section.html +0 -71
  102. data/doc/ep_flux/index.html +0 -31
  103. data/doc/ep_flux/index.rd +0 -24
  104. data/doc/ep_flux/math-doc/document/WARNINGS +0 -1
  105. data/doc/ep_flux/math-doc/document/contents.png +0 -0
  106. data/doc/ep_flux/math-doc/document/crossref.png +0 -0
  107. data/doc/ep_flux/math-doc/document/document.css +0 -30
  108. data/doc/ep_flux/math-doc/document/document.html +0 -101
  109. data/doc/ep_flux/math-doc/document/images.aux +0 -1
  110. data/doc/ep_flux/math-doc/document/images.log +0 -1375
  111. data/doc/ep_flux/math-doc/document/images.pl +0 -1328
  112. data/doc/ep_flux/math-doc/document/images.tex +0 -1471
  113. data/doc/ep_flux/math-doc/document/img1.png +0 -0
  114. data/doc/ep_flux/math-doc/document/img10.png +0 -0
  115. data/doc/ep_flux/math-doc/document/img100.png +0 -0
  116. data/doc/ep_flux/math-doc/document/img101.png +0 -0
  117. data/doc/ep_flux/math-doc/document/img102.png +0 -0
  118. data/doc/ep_flux/math-doc/document/img103.png +0 -0
  119. data/doc/ep_flux/math-doc/document/img104.png +0 -0
  120. data/doc/ep_flux/math-doc/document/img105.png +0 -0
  121. data/doc/ep_flux/math-doc/document/img106.png +0 -0
  122. data/doc/ep_flux/math-doc/document/img107.png +0 -0
  123. data/doc/ep_flux/math-doc/document/img108.png +0 -0
  124. data/doc/ep_flux/math-doc/document/img109.png +0 -0
  125. data/doc/ep_flux/math-doc/document/img11.png +0 -0
  126. data/doc/ep_flux/math-doc/document/img110.png +0 -0
  127. data/doc/ep_flux/math-doc/document/img111.png +0 -0
  128. data/doc/ep_flux/math-doc/document/img112.png +0 -0
  129. data/doc/ep_flux/math-doc/document/img113.png +0 -0
  130. data/doc/ep_flux/math-doc/document/img114.png +0 -0
  131. data/doc/ep_flux/math-doc/document/img115.png +0 -0
  132. data/doc/ep_flux/math-doc/document/img116.png +0 -0
  133. data/doc/ep_flux/math-doc/document/img117.png +0 -0
  134. data/doc/ep_flux/math-doc/document/img118.png +0 -0
  135. data/doc/ep_flux/math-doc/document/img119.png +0 -0
  136. data/doc/ep_flux/math-doc/document/img12.png +0 -0
  137. data/doc/ep_flux/math-doc/document/img120.png +0 -0
  138. data/doc/ep_flux/math-doc/document/img121.png +0 -0
  139. data/doc/ep_flux/math-doc/document/img122.png +0 -0
  140. data/doc/ep_flux/math-doc/document/img123.png +0 -0
  141. data/doc/ep_flux/math-doc/document/img124.png +0 -0
  142. data/doc/ep_flux/math-doc/document/img125.png +0 -0
  143. data/doc/ep_flux/math-doc/document/img126.png +0 -0
  144. data/doc/ep_flux/math-doc/document/img127.png +0 -0
  145. data/doc/ep_flux/math-doc/document/img128.png +0 -0
  146. data/doc/ep_flux/math-doc/document/img129.png +0 -0
  147. data/doc/ep_flux/math-doc/document/img13.png +0 -0
  148. data/doc/ep_flux/math-doc/document/img130.png +0 -0
  149. data/doc/ep_flux/math-doc/document/img131.png +0 -0
  150. data/doc/ep_flux/math-doc/document/img132.png +0 -0
  151. data/doc/ep_flux/math-doc/document/img133.png +0 -0
  152. data/doc/ep_flux/math-doc/document/img134.png +0 -0
  153. data/doc/ep_flux/math-doc/document/img135.png +0 -0
  154. data/doc/ep_flux/math-doc/document/img136.png +0 -0
  155. data/doc/ep_flux/math-doc/document/img137.png +0 -0
  156. data/doc/ep_flux/math-doc/document/img138.png +0 -0
  157. data/doc/ep_flux/math-doc/document/img139.png +0 -0
  158. data/doc/ep_flux/math-doc/document/img14.png +0 -0
  159. data/doc/ep_flux/math-doc/document/img140.png +0 -0
  160. data/doc/ep_flux/math-doc/document/img141.png +0 -0
  161. data/doc/ep_flux/math-doc/document/img142.png +0 -0
  162. data/doc/ep_flux/math-doc/document/img143.png +0 -0
  163. data/doc/ep_flux/math-doc/document/img144.png +0 -0
  164. data/doc/ep_flux/math-doc/document/img145.png +0 -0
  165. data/doc/ep_flux/math-doc/document/img146.png +0 -0
  166. data/doc/ep_flux/math-doc/document/img147.png +0 -0
  167. data/doc/ep_flux/math-doc/document/img148.png +0 -0
  168. data/doc/ep_flux/math-doc/document/img149.png +0 -0
  169. data/doc/ep_flux/math-doc/document/img15.png +0 -0
  170. data/doc/ep_flux/math-doc/document/img150.png +0 -0
  171. data/doc/ep_flux/math-doc/document/img151.png +0 -0
  172. data/doc/ep_flux/math-doc/document/img152.png +0 -0
  173. data/doc/ep_flux/math-doc/document/img153.png +0 -0
  174. data/doc/ep_flux/math-doc/document/img154.png +0 -0
  175. data/doc/ep_flux/math-doc/document/img155.png +0 -0
  176. data/doc/ep_flux/math-doc/document/img156.png +0 -0
  177. data/doc/ep_flux/math-doc/document/img157.png +0 -0
  178. data/doc/ep_flux/math-doc/document/img158.png +0 -0
  179. data/doc/ep_flux/math-doc/document/img159.png +0 -0
  180. data/doc/ep_flux/math-doc/document/img16.png +0 -0
  181. data/doc/ep_flux/math-doc/document/img160.png +0 -0
  182. data/doc/ep_flux/math-doc/document/img161.png +0 -0
  183. data/doc/ep_flux/math-doc/document/img162.png +0 -0
  184. data/doc/ep_flux/math-doc/document/img163.png +0 -0
  185. data/doc/ep_flux/math-doc/document/img164.png +0 -0
  186. data/doc/ep_flux/math-doc/document/img165.png +0 -0
  187. data/doc/ep_flux/math-doc/document/img166.png +0 -0
  188. data/doc/ep_flux/math-doc/document/img167.png +0 -0
  189. data/doc/ep_flux/math-doc/document/img168.png +0 -0
  190. data/doc/ep_flux/math-doc/document/img169.png +0 -0
  191. data/doc/ep_flux/math-doc/document/img17.png +0 -0
  192. data/doc/ep_flux/math-doc/document/img170.png +0 -0
  193. data/doc/ep_flux/math-doc/document/img171.png +0 -0
  194. data/doc/ep_flux/math-doc/document/img172.png +0 -0
  195. data/doc/ep_flux/math-doc/document/img173.png +0 -0
  196. data/doc/ep_flux/math-doc/document/img174.png +0 -0
  197. data/doc/ep_flux/math-doc/document/img175.png +0 -0
  198. data/doc/ep_flux/math-doc/document/img176.png +0 -0
  199. data/doc/ep_flux/math-doc/document/img177.png +0 -0
  200. data/doc/ep_flux/math-doc/document/img178.png +0 -0
  201. data/doc/ep_flux/math-doc/document/img179.png +0 -0
  202. data/doc/ep_flux/math-doc/document/img18.png +0 -0
  203. data/doc/ep_flux/math-doc/document/img180.png +0 -0
  204. data/doc/ep_flux/math-doc/document/img181.png +0 -0
  205. data/doc/ep_flux/math-doc/document/img182.png +0 -0
  206. data/doc/ep_flux/math-doc/document/img183.png +0 -0
  207. data/doc/ep_flux/math-doc/document/img184.png +0 -0
  208. data/doc/ep_flux/math-doc/document/img185.png +0 -0
  209. data/doc/ep_flux/math-doc/document/img186.png +0 -0
  210. data/doc/ep_flux/math-doc/document/img187.png +0 -0
  211. data/doc/ep_flux/math-doc/document/img188.png +0 -0
  212. data/doc/ep_flux/math-doc/document/img189.png +0 -0
  213. data/doc/ep_flux/math-doc/document/img19.png +0 -0
  214. data/doc/ep_flux/math-doc/document/img190.png +0 -0
  215. data/doc/ep_flux/math-doc/document/img191.png +0 -0
  216. data/doc/ep_flux/math-doc/document/img192.png +0 -0
  217. data/doc/ep_flux/math-doc/document/img193.png +0 -0
  218. data/doc/ep_flux/math-doc/document/img194.png +0 -0
  219. data/doc/ep_flux/math-doc/document/img195.png +0 -0
  220. data/doc/ep_flux/math-doc/document/img196.png +0 -0
  221. data/doc/ep_flux/math-doc/document/img197.png +0 -0
  222. data/doc/ep_flux/math-doc/document/img198.png +0 -0
  223. data/doc/ep_flux/math-doc/document/img199.png +0 -0
  224. data/doc/ep_flux/math-doc/document/img2.png +0 -0
  225. data/doc/ep_flux/math-doc/document/img20.png +0 -0
  226. data/doc/ep_flux/math-doc/document/img200.png +0 -0
  227. data/doc/ep_flux/math-doc/document/img21.png +0 -0
  228. data/doc/ep_flux/math-doc/document/img22.png +0 -0
  229. data/doc/ep_flux/math-doc/document/img23.png +0 -0
  230. data/doc/ep_flux/math-doc/document/img24.png +0 -0
  231. data/doc/ep_flux/math-doc/document/img25.png +0 -0
  232. data/doc/ep_flux/math-doc/document/img26.png +0 -0
  233. data/doc/ep_flux/math-doc/document/img27.png +0 -0
  234. data/doc/ep_flux/math-doc/document/img28.png +0 -0
  235. data/doc/ep_flux/math-doc/document/img29.png +0 -0
  236. data/doc/ep_flux/math-doc/document/img3.png +0 -0
  237. data/doc/ep_flux/math-doc/document/img30.png +0 -0
  238. data/doc/ep_flux/math-doc/document/img31.png +0 -0
  239. data/doc/ep_flux/math-doc/document/img32.png +0 -0
  240. data/doc/ep_flux/math-doc/document/img33.png +0 -0
  241. data/doc/ep_flux/math-doc/document/img34.png +0 -0
  242. data/doc/ep_flux/math-doc/document/img35.png +0 -0
  243. data/doc/ep_flux/math-doc/document/img36.png +0 -0
  244. data/doc/ep_flux/math-doc/document/img37.png +0 -0
  245. data/doc/ep_flux/math-doc/document/img38.png +0 -0
  246. data/doc/ep_flux/math-doc/document/img39.png +0 -0
  247. data/doc/ep_flux/math-doc/document/img4.png +0 -0
  248. data/doc/ep_flux/math-doc/document/img40.png +0 -0
  249. data/doc/ep_flux/math-doc/document/img41.png +0 -0
  250. data/doc/ep_flux/math-doc/document/img42.png +0 -0
  251. data/doc/ep_flux/math-doc/document/img43.png +0 -0
  252. data/doc/ep_flux/math-doc/document/img44.png +0 -0
  253. data/doc/ep_flux/math-doc/document/img45.png +0 -0
  254. data/doc/ep_flux/math-doc/document/img46.png +0 -0
  255. data/doc/ep_flux/math-doc/document/img47.png +0 -0
  256. data/doc/ep_flux/math-doc/document/img48.png +0 -0
  257. data/doc/ep_flux/math-doc/document/img49.png +0 -0
  258. data/doc/ep_flux/math-doc/document/img5.png +0 -0
  259. data/doc/ep_flux/math-doc/document/img50.png +0 -0
  260. data/doc/ep_flux/math-doc/document/img51.png +0 -0
  261. data/doc/ep_flux/math-doc/document/img52.png +0 -0
  262. data/doc/ep_flux/math-doc/document/img53.png +0 -0
  263. data/doc/ep_flux/math-doc/document/img54.png +0 -0
  264. data/doc/ep_flux/math-doc/document/img55.png +0 -0
  265. data/doc/ep_flux/math-doc/document/img56.png +0 -0
  266. data/doc/ep_flux/math-doc/document/img57.png +0 -0
  267. data/doc/ep_flux/math-doc/document/img58.png +0 -0
  268. data/doc/ep_flux/math-doc/document/img59.png +0 -0
  269. data/doc/ep_flux/math-doc/document/img6.png +0 -0
  270. data/doc/ep_flux/math-doc/document/img60.png +0 -0
  271. data/doc/ep_flux/math-doc/document/img61.png +0 -0
  272. data/doc/ep_flux/math-doc/document/img62.png +0 -0
  273. data/doc/ep_flux/math-doc/document/img63.png +0 -0
  274. data/doc/ep_flux/math-doc/document/img64.png +0 -0
  275. data/doc/ep_flux/math-doc/document/img65.png +0 -0
  276. data/doc/ep_flux/math-doc/document/img66.png +0 -0
  277. data/doc/ep_flux/math-doc/document/img67.png +0 -0
  278. data/doc/ep_flux/math-doc/document/img68.png +0 -0
  279. data/doc/ep_flux/math-doc/document/img69.png +0 -0
  280. data/doc/ep_flux/math-doc/document/img7.png +0 -0
  281. data/doc/ep_flux/math-doc/document/img70.png +0 -0
  282. data/doc/ep_flux/math-doc/document/img71.png +0 -0
  283. data/doc/ep_flux/math-doc/document/img72.png +0 -0
  284. data/doc/ep_flux/math-doc/document/img73.png +0 -0
  285. data/doc/ep_flux/math-doc/document/img74.png +0 -0
  286. data/doc/ep_flux/math-doc/document/img75.png +0 -0
  287. data/doc/ep_flux/math-doc/document/img76.png +0 -0
  288. data/doc/ep_flux/math-doc/document/img77.png +0 -0
  289. data/doc/ep_flux/math-doc/document/img78.png +0 -0
  290. data/doc/ep_flux/math-doc/document/img79.png +0 -0
  291. data/doc/ep_flux/math-doc/document/img8.png +0 -0
  292. data/doc/ep_flux/math-doc/document/img80.png +0 -0
  293. data/doc/ep_flux/math-doc/document/img81.png +0 -0
  294. data/doc/ep_flux/math-doc/document/img82.png +0 -0
  295. data/doc/ep_flux/math-doc/document/img83.png +0 -0
  296. data/doc/ep_flux/math-doc/document/img84.png +0 -0
  297. data/doc/ep_flux/math-doc/document/img85.png +0 -0
  298. data/doc/ep_flux/math-doc/document/img86.png +0 -0
  299. data/doc/ep_flux/math-doc/document/img87.png +0 -0
  300. data/doc/ep_flux/math-doc/document/img88.png +0 -0
  301. data/doc/ep_flux/math-doc/document/img89.png +0 -0
  302. data/doc/ep_flux/math-doc/document/img9.png +0 -0
  303. data/doc/ep_flux/math-doc/document/img90.png +0 -0
  304. data/doc/ep_flux/math-doc/document/img91.png +0 -0
  305. data/doc/ep_flux/math-doc/document/img92.png +0 -0
  306. data/doc/ep_flux/math-doc/document/img93.png +0 -0
  307. data/doc/ep_flux/math-doc/document/img94.png +0 -0
  308. data/doc/ep_flux/math-doc/document/img95.png +0 -0
  309. data/doc/ep_flux/math-doc/document/img96.png +0 -0
  310. data/doc/ep_flux/math-doc/document/img97.png +0 -0
  311. data/doc/ep_flux/math-doc/document/img98.png +0 -0
  312. data/doc/ep_flux/math-doc/document/img99.png +0 -0
  313. data/doc/ep_flux/math-doc/document/index.html +0 -101
  314. data/doc/ep_flux/math-doc/document/internals.pl +0 -258
  315. data/doc/ep_flux/math-doc/document/labels.pl +0 -265
  316. data/doc/ep_flux/math-doc/document/next.png +0 -0
  317. data/doc/ep_flux/math-doc/document/next_g.png +0 -0
  318. data/doc/ep_flux/math-doc/document/node1.html +0 -104
  319. data/doc/ep_flux/math-doc/document/node10.html +0 -164
  320. data/doc/ep_flux/math-doc/document/node11.html +0 -86
  321. data/doc/ep_flux/math-doc/document/node12.html +0 -166
  322. data/doc/ep_flux/math-doc/document/node13.html +0 -897
  323. data/doc/ep_flux/math-doc/document/node14.html +0 -1065
  324. data/doc/ep_flux/math-doc/document/node15.html +0 -72
  325. data/doc/ep_flux/math-doc/document/node16.html +0 -81
  326. data/doc/ep_flux/math-doc/document/node2.html +0 -82
  327. data/doc/ep_flux/math-doc/document/node3.html +0 -91
  328. data/doc/ep_flux/math-doc/document/node4.html +0 -149
  329. data/doc/ep_flux/math-doc/document/node5.html +0 -330
  330. data/doc/ep_flux/math-doc/document/node6.html +0 -99
  331. data/doc/ep_flux/math-doc/document/node7.html +0 -98
  332. data/doc/ep_flux/math-doc/document/node8.html +0 -83
  333. data/doc/ep_flux/math-doc/document/node9.html +0 -140
  334. data/doc/ep_flux/math-doc/document/prev.png +0 -0
  335. data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
  336. data/doc/ep_flux/math-doc/document/up.png +0 -0
  337. data/doc/ep_flux/math-doc/document/up_g.png +0 -0
  338. data/doc/ep_flux/math-doc/document.pdf +0 -0
  339. data/doc/ep_flux/math-doc/document.tex +0 -2018
  340. data/doc/gdir.html +0 -412
  341. data/doc/gdir_client.html +0 -16
  342. data/doc/gdir_connect_ftp-like.html +0 -61
  343. data/doc/gdir_server.html +0 -45
  344. data/doc/ggraph.html +0 -1615
  345. data/doc/gpcat.html +0 -44
  346. data/doc/gpcut.html +0 -41
  347. data/doc/gphys.html +0 -532
  348. data/doc/gphys_fft.html +0 -324
  349. data/doc/gphys_grads_io.html +0 -69
  350. data/doc/gphys_grib_io.html +0 -82
  351. data/doc/gphys_io.html +0 -120
  352. data/doc/gphys_io_common.html +0 -18
  353. data/doc/gphys_netcdf_io.html +0 -283
  354. data/doc/gplist.html +0 -24
  355. data/doc/gpmath.html +0 -51
  356. data/doc/gpmaxmin.html +0 -31
  357. data/doc/gpprint.html +0 -34
  358. data/doc/gpview.html +0 -270
  359. data/doc/grads2nc_with_gphys.html +0 -21
  360. data/doc/grads_gridded.html +0 -307
  361. data/doc/grib.html +0 -144
  362. data/doc/grid.html +0 -212
  363. data/doc/index.html +0 -133
  364. data/doc/index.rd +0 -127
  365. data/doc/netcdf_convention.html +0 -136
  366. data/doc/unumeric.html +0 -176
  367. data/doc/update +0 -64
  368. data/doc/varray.html +0 -299
  369. data/doc/varraycomposite.html +0 -67
@@ -28,13 +28,12 @@ Module functions of Derivative Operater for NArray.
28
28
 
29
29
  ---threepoint_O2nd_deriv(z, x, dim, bc=LINEAR_EXT)
30
30
 
31
- Derivate (({z})) respect to (({dim})) th dimension with 2nd Order difference.
32
- return an NArray which result of the difference ((<z>)) divided difference
33
- (({x})) (in other wards,
34
- (s**2*z_{i+1} + (t**2 - s**2)*f_{i} - t**2*f_{i-1}) / (s*t*(s + t)):
35
- now s represents (x_{i} - x_{i-1}) ,t represents (x_{i+1} - x_{i})
36
- and _{i} represents the suffix of {i} th element in the ((<dim>)) th
37
- dimension of array. ).
31
+ Derivate of (({z})) with respect to (({dim})) th dim using a 2nd
32
+ order 3-point differentiation valid for non-uniform grid:
33
+ (s**2*z_{i+1} + (t**2 - s**2)*f_{i} - t**2*f_{i-1}) / (s*t*(s + t))
34
+ Here, s represents (x_{i} - x_{i-1}) ,t represents (x_{i+1} - x_{i})
35
+ and _{i} represents the suffix of {i} th element in the ((<dim>)) th
36
+ dimension of the array. ).
38
37
 
39
38
  ARGUMENTS
40
39
  * z (NArray): a NArray which you want to derivative.
@@ -59,11 +58,28 @@ Module functions of Derivative Operater for NArray.
59
58
 
60
59
  ---cderiv(z, x, dim, bc=LINEAR_EXT)
61
60
 
62
- Derivate (({z})) respect to (({dim})) th dimension with center difference.
63
- return an NArray which result of the difference ((<z>)) divided difference
64
- (({x})) ( in other wards, (z_{i+1} - z_{i-1}) / (x_{i+1} - x_{i-1}):
65
- now _{i} represents the suffix of {i} th element in the ((<dim>)) th
66
- dimension of array. ).
61
+ Derivate of (({z})) with respect to (({dim})) th dim using centeral
62
+ differenciation: (z_{i+1} - z_{i-1}) / (x_{i+1} - x_{i-1})
63
+
64
+ ARGUMENTS
65
+ * z (NArray): a NArray which you want to derivative.
66
+ * x (NArray): a NArray represents the dimension which derivative respect
67
+ to. z.rank must be 1.
68
+ * dim (Numeric): a Numeric represents the dimention which derivative
69
+ respect to. you can give number count backward (((<dim>))<0), but
70
+ ((<z.rank ��dim>)) must be > 0.
71
+ * bc (Numeric) : a Numeric to represent boundary condition.
72
+ See ((<threepoint_O2nd_deriv>)) for supported conditions.
73
+
74
+ RETURN VALUE
75
+ * cderiv_data (NArray): (z_{i+1} - z_{i-1}) / (x_{i+1} - x_{i-1})
76
+
77
+ ---deriv2nd(z, x, dim, bc=LINEAR_EXT)
78
+
79
+ 2nd Derivate of (({z})) with respect to (({dim}))-th dim
80
+ covering non-uniform grids. Based on:
81
+ ( (z_{i+1}-z_{i})/(x_{i+1}-x_{i}) - (z_{i}-z_{i-1})/(x_{i}-x_{i-1}) )
82
+ / ((x_{i+1}-x_{i-1})/2)
67
83
 
68
84
  ARGUMENTS
69
85
  * z (NArray): a NArray which you want to derivative.
@@ -169,6 +185,31 @@ module NumRu
169
185
  return dzdx
170
186
  end
171
187
 
188
+ # 2nd derivative covering uniform grids
189
+ def deriv2nd(z, x, dim, bc=LINEAR_EXT)
190
+ dim += z.rank if dim<0
191
+ if dim < 0 || dim >= z.rank
192
+ raise ArgumentError,"dim value(#{dim}) must be between 0 and (#{z.rank-1}"
193
+ end
194
+ raise ArgumentError,"rank of x (#{x.rank}) must be 1" if x.rank != 1
195
+ # <<expand boundaries>>
196
+ ze = b_expand(z,dim,bc)
197
+ xe = b_expand_linear_ext(x,0) # always linear extention
198
+ # <<differenciation>>
199
+ to_rankD = [1]*dim + [true] + [1]*(ze.rank-1-dim) # to exand 1D to rank D
200
+ dx20 = xe[2..-1] - xe[0..-3] # x_{i+1} - x_{i-1} (for i=1..-2)
201
+ dx21 = xe[2..-1] - xe[1..-2] # x_{i+1} - x_{i} (for i=1..-2)
202
+ dx10 = xe[1..-2] - xe[0..-3] # x_{i} - x_{i-1} (for i=1..-2)
203
+ a2 = 2/(dx21*dx20).reshape(*to_rankD)
204
+ a1 = (-2)/(dx21*dx10).reshape(*to_rankD)
205
+ a0 = 2/(dx10*dx20).reshape(*to_rankD)
206
+ d2zdx2 = ze[ *([true]*dim+[2..-1,false]) ] * a2 \
207
+ + ze[ *([true]*dim+[1..-2,false]) ] * a1 \
208
+ + ze[ *([true]*dim+[0..-3,false]) ] * a0
209
+ return d2zdx2
210
+ end
211
+
212
+
172
213
  def b_expand(z,dim,bc)
173
214
  case bc
174
215
  when LINEAR_EXT
@@ -11,6 +11,10 @@ module NumRu
11
11
  require "numru/lapack"
12
12
  @@EOF_engin = "lapack"
13
13
  rescue LoadError
14
+ begin
15
+ require "rubygems"
16
+ rescue LoadError
17
+ end
14
18
  begin
15
19
  require "gsl"
16
20
  @@EOF_engin = "gsl"
@@ -154,7 +154,7 @@ module NumRu
154
154
  module_function
155
155
 
156
156
  @@histogram_options = Misc::KeywordOptAutoHelp.new(
157
- ['window', [nil,nil,0,nil], "window bounds"],
157
+ ['window', [nil,nil,nil,nil], "window bounds"],
158
158
  ['title', "histogram", "window title"],
159
159
  ['exchange', false, "exchange x and y"],
160
160
  ['fill', false, "fill bars"]
@@ -170,30 +170,88 @@ module NumRu
170
170
  unless gphys.axis(0).cell?
171
171
  raise ArgumentError, "axis must be cell type"
172
172
  end
173
+ # if window is specified via GGraph#fig or GGraph#set_fig, use it.
173
174
  opts = @@histogram_options.interpret(options)
174
175
  exchange = opts["exchange"]
176
+ window = opts["window"] || @@fig['window']
175
177
  unless exchange
176
178
  x = gphys.axis(0).cell_bounds
177
179
  y = gphys
180
+ window[2] ||= 0
178
181
  else
179
182
  y = gphys.axis(0).cell_bounds
180
183
  x = gphys
184
+ window[0] ||= 0
181
185
  end
186
+ itr = @@fig['itr'] || DCL::sgpget("itr")
187
+ if (itr==2 || itr==4)
188
+ tmp = y.val
189
+ if tmp.min * tmp.max < 0
190
+ if tmp.min.abs < tmp.max
191
+ mask = tmp.lt(0)
192
+ else
193
+ mask = tmp.gt(0)
194
+ end
195
+ else
196
+ mask = tmp.ne(0)
197
+ end
198
+ if tmp.is_a?(NArrayMiss)
199
+ tmp.set_mask(mask * tmp.get_mask)
200
+ else
201
+ tmp = NArrayMiss.to_nam_no_dup(tmp, mask)
202
+ end
203
+ y.replace_val(tmp)
204
+ window[2] = tmp.abs.min * (tmp.min < 0 ? -1 : 1)
205
+ end
206
+ if (itr==3 || itr==4)
207
+ tmp = x.val
208
+ if tmp.min * tmp.max < 0
209
+ if tmp.min.abs < tmp.max
210
+ mask = tmp.lt(0)
211
+ else
212
+ mask = tmp.gt(0)
213
+ end
214
+ else
215
+ mask = tmp.ne(0)
216
+ end
217
+ if tmp.is_a?(NArrayMiss)
218
+ tmp.set_mask(mask * tmp.get_mask)
219
+ else
220
+ tmp = NArrayMiss.to_nam_no_dup(tmp, mask)
221
+ end
222
+ x.replace_val(tmp)
223
+ window[0] = tmp.abs.min * (tmp.min < 0 ? -1 : 1)
224
+ end
225
+ opts["window"] = window
226
+
182
227
  if newframe
183
228
  fig(x, y, "window"=>opts["window"])
184
229
  axes(x, y, "title"=>opts["title"])
185
230
  end
231
+ lmiss = DCL::gllget("lmiss")
232
+ DCL::gllset("lmiss", true)
186
233
  unless exchange
187
234
  if opts["fill"]
188
- DCL::uvbxa(x.val, [0]*y.length, y.val)
235
+ DCL::uvbxa(x.val, [window[2]] * y.length, y.val)
189
236
  end
190
- DCL::uvbxf(x.val, [0]*y.length, y.val)
237
+ if (itr == 2) || (itr == 4)
238
+ bottom = [y.val.min] * y.length
239
+ else
240
+ bottom = [window[2]] * y.length
241
+ end
242
+ DCL::uvbxf(x.val, bottom, y.val)
191
243
  else
192
244
  if opts["fill"]
193
- DCL::uhbxa([0]*x.length, x.val, y.val)
245
+ DCL::uhbxa([window[0]] * x.length, x.val, y.val)
194
246
  end
195
- DCL::uhbxf([0]*x.length, x.val, y.val)
247
+ if (itr == 3) || (itr == 4)
248
+ bottom = [x.val.min] * x.length
249
+ else
250
+ bottom = [window[0]] * x.length
251
+ end
252
+ DCL::uhbxf(bottom, x.val, y.val)
196
253
  end
254
+ DCL::gllset("lmiss", lmiss)
197
255
  return nil
198
256
  end
199
257
  alias :histogram1D :histogram
@@ -241,6 +299,16 @@ if $0 == __FILE__
241
299
  hist = GAnalysis.histogram(gphys1D)
242
300
  GGraph.histogram(hist)
243
301
 
302
+ GGraph.set_fig("itr"=>2)
303
+ GGraph.histogram(hist)
304
+
305
+ GGraph.set_fig("itr"=>3)
306
+ GGraph.histogram(hist)
307
+
308
+ GGraph.set_fig("itr"=>4)
309
+ GGraph.histogram(hist)
310
+
311
+ GGraph.set_fig("itr"=>1)
244
312
  hist = gphys1D.histogram("nbins"=>10)
245
313
  GGraph.histogram(hist, true, "title"=>"histogram 1D")
246
314
 
@@ -95,7 +95,8 @@ module NumRu
95
95
  dim = find_prs_d(theta) if !dim
96
96
  prs = get_prs(theta) if !prs
97
97
  prs = convert_units2Pa(prs)
98
- dtheta_dp = df_dx(theta, prs, dim)
98
+ #dtheta_dp = df_dx(theta, prs, dim)
99
+ dtheta_dp = df_dx_vialogscale(theta, prs, dim)
99
100
  sig_inv = dtheta_dp * (-@@g)
100
101
  if sig_inv.respond_to?(:long_name) # VArray or GPhys
101
102
  sig_inv.name = "sig_inv"
@@ -134,7 +135,7 @@ module NumRu
134
135
  # RETURN VALUE
135
136
  # * potential temperature [GPhys] on a theta coordinate, where
136
137
  # levels are set to theta_levs
137
- def pv_on_theta(u, v, theta, theta_levs)
138
+ def pv_on_theta(u, v, theta, theta_levs)
138
139
  sigi = GAnalysis::Met.sigma_inv(theta)
139
140
  uth = GAnalysis::Met.interpolate_onto_theta(u, theta, theta_levs)
140
141
  vth = GAnalysis::Met.interpolate_onto_theta(v, theta, theta_levs)
@@ -146,6 +147,154 @@ module NumRu
146
147
  pv
147
148
  end
148
149
 
150
+ # Derive geostrophic wind from geopotential hight (spherical but fixed f)
151
+ #
152
+ # ARGUMENTS
153
+ # * z [GPhys] : geopotential height on the pressure (or log-pressure)
154
+ # coordinate
155
+ # * f [nil or Numeric of UNumeric] : the constant f value
156
+ # (Coriolis parameter).
157
+ # If nil, the value at the north pole is assumed.
158
+ # If Numeric, units are assumed to be "s-1".
159
+ #
160
+ def z2geostrophic_wind(z, f=nil)
161
+ if f.nil?
162
+ f = 2 * GAnalysis::Planet.omega
163
+ elsif f.is_a?(Numeric)
164
+ f = UNumeric[f,"s-1"]
165
+ end
166
+ z = z.convert_units("m")
167
+ gx, gy = GAnalysis::Planet.grad_s( z * (g/f) )
168
+ u = -gy
169
+ v = gx
170
+ u.name = "u"
171
+ u.long_name = "geostrophic U"
172
+ u.put_att("assumed_f",f.to_s)
173
+ v.name = "v"
174
+ v.long_name = "geostrophic V"
175
+ v.put_att("assumed_f",f.to_s)
176
+ [u, v]
177
+ end
178
+
179
+ # Adiabatic frontogenesis function over the sphere. --
180
+ # D/Dt(|gradH theta|) or D/Dt(|gradH theta|^2), where gradH express
181
+ # the horizontal component of gradient.
182
+ #
183
+ # if full_adv is true (default),
184
+ # D/Dt(|gradH theta|) =
185
+ # [ -(ux-va)*thetax^2 - (vx+uy)*thetax*thetay - vy*thetay^2
186
+ # - (wx*thetax + wy*thetay)*theta_z ]
187
+ # / |gradH theta|
188
+ # or else,
189
+ # (\del/\del t + u gradx + v grady )(|gradH theta|) =
190
+ # [ -(ux-va)*thetax^2 - (vx+uy)*thetax*thetay - vy*thetay^2
191
+ # - (w*theta_z)_x*thetax - (w*theta_z)_y*thetay ]
192
+ # / |gradH theta|
193
+ #
194
+ # Here, the 2nd line (vertical advection) is optional;
195
+ # [vx, vy] = gradH v; [thetax, thetay] = gradH theta;
196
+ # [ux, uy] = cos_phi * gradH (u/cos_phi)
197
+ # va = v/tan_phi/a (a=radius).
198
+ # z and w is the vertical coordinate and the lagrangian
199
+ # "velocity" in that coordinate --- Typically they are
200
+ # p and omega, or log-p height and log-p w.
201
+ #
202
+ # This formulation is adiabatic; the diabatic heating effect
203
+ # can be easily included if needed.
204
+ #
205
+ # ARGUMENTS
206
+ # * theta [GPhys] : potential temperature
207
+ # * u [GPhys] : zonal wind
208
+ # * v [GPhys] : meridional wind
209
+ # * w [nil (default) or GPhys] : (optional) "vertical wind", which must
210
+ # be dimensionally consistent with the vertical coordiante
211
+ # (e.g., omega for the pressure coordinate).
212
+ # If w is given, the vertical cooridnate is assumed to be
213
+ # the 3rd one (dim=2).
214
+ # * fstodr [true (default) or false] (optional) if true
215
+ # D/Dt(|\NablaH theta|) returned; if false D/Dt(|\NablaH theta|^2)
216
+ # is returned.
217
+ # * full_adv [true (default) or false] : whether to calculate
218
+ # full lagrangian tendency or lagragian tendency only in
219
+ # horizontal direction
220
+ #
221
+ # RETURN VALUE
222
+ # * frontogenesis function [GPhys]
223
+ #
224
+ def frontogenesis_func(theta, u, v, w=nil, fstodr=true, full_adv = true)
225
+ thx, thy = GAnalysis::Planet.grad_s( theta )
226
+ ux = GAnalysis::Planet.grad_sx( u )
227
+ uy = GAnalysis::Planet.grad_sy_cosphifact( u, -1 )
228
+ vx, vy = GAnalysis::Planet.grad_s( v )
229
+ va = GAnalysis::Planet.weight_tanphi( v, 1, -1 )
230
+ frgf = - (ux-va)*thx*thx - (vx+uy)*thx*thy - vy*thy*thy
231
+ frgf.name = "frgen"
232
+ frgf.long_name = "frontogenesis function"
233
+ if w
234
+ zdim = 2
235
+ if (wun=w.units) !~ (ztun = theta.coord(zdim).units * Units["s-1"])
236
+ raise "w in #{wun} is inconsistent with the vertical coordinate of theta in #{ztun}"
237
+ else
238
+ w = w.convert_units(ztun) # For example, Pa/s -> hPa/s
239
+ end
240
+ z = theta.axis(zdim).to_gphys
241
+ if z.units =~ Units["Pa"]
242
+ thz = df_dx_vialogscale(theta, z, zdim)
243
+ else
244
+ thz = df_dx(theta, z, zdim)
245
+ end
246
+ if full_adv
247
+ # full lagragian tendency of theta-gradient strength
248
+ wx, wy = GAnalysis::Planet.grad_s( w )
249
+ frgf -= (wx*thx + wy*thy)*thz
250
+ else
251
+ # lagragian tendency only in horizontal direction
252
+ wthzx, wthzy = GAnalysis::Planet.grad_s( w*thz )
253
+ frgf -= wthzx*thx + wthzy*thy
254
+ end
255
+ end
256
+ if fstodr
257
+ frgf /= (thx**2 + thy**2).sqrt
258
+ else
259
+ frgf *= 2
260
+ end
261
+ frgf
262
+ end
263
+
264
+ =begin
265
+ def frontogenesis_eulerian(theta, u, v, w=nil, fstodr=true )
266
+ thx, thy = GAnalysis::Planet.grad_s( theta )
267
+ uthxx, uthxy = GAnalysis::Planet.grad_s( u*thx )
268
+ vthyx, vthyy = GAnalysis::Planet.grad_s( v*thy )
269
+ va = GAnalysis::Planet.weight_tanphi( v, 1, -1 )
270
+ frgf = - (uthxx+vthyx)*thx - (uthxy+vthyy)*thy
271
+ frgf.name = "thgrd_tend"
272
+ frgf.long_name = "Eluerian grad-theta tendency"
273
+ if w
274
+ zdim = 2
275
+ if (wun=w.units) !~ (ztun = theta.coord(zdim).units * Units["s-1"])
276
+ raise "w in #{wun} is inconsistent with the vertical coordinate of theta in #{ztun}"
277
+ else
278
+ w = w.convert_units(ztun) # For example, Pa/s -> hPa/s
279
+ end
280
+ z = theta.axis(zdim).to_gphys
281
+ if z.units =~ Units["Pa"]
282
+ thz = df_dx_vialogscale(theta, z, zdim)
283
+ else
284
+ thz = df_dx(theta, z, zdim)
285
+ end
286
+ wthzx, wthzy = GAnalysis::Planet.grad_s( w*thz )
287
+ frgf -= wthzx*thx + wthzy*thy
288
+ end
289
+ if fstodr
290
+ frgf /= (thx**2 + thy**2).sqrt
291
+ else
292
+ frgf *= 2
293
+ end
294
+ frgf
295
+ end
296
+ =end
297
+
149
298
  # Find a pressure coordinate in a GPhys object
150
299
  #
151
300
  # ARGUMENT
@@ -244,6 +393,18 @@ module NumRu
244
393
  end
245
394
  private :df_dx # this method should be defined somewhere else
246
395
 
396
+ def df_dx_vialogscale(f, x, dim)
397
+ z = Misc::EMath.log(x)
398
+ if GPhys === f
399
+ mdl = NumRu::GPhys::Derivative
400
+ dfdz = mdl.threepoint_O2nd_deriv(f, dim, mdl::LINEAR_EXT, z)
401
+ else
402
+ mdl = NumRu::Derivative
403
+ dfdz = mdl.threepoint_O2nd_deriv(f, z, dim, mdl::LINEAR_EXT)
404
+ end
405
+ dfdz / x
406
+ end
407
+
247
408
  end
248
409
  end
249
410
  end