gphys 1.1.1a
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +1777 -0
- data/LICENSE.txt +34 -0
- data/README +33 -0
- data/Rakefile +57 -0
- data/TODO_ep_flux +6 -0
- data/bin/gdir_client +27 -0
- data/bin/gdir_server +129 -0
- data/bin/gpaop +146 -0
- data/bin/gpcat +148 -0
- data/bin/gpcut +102 -0
- data/bin/gpedit +228 -0
- data/bin/gplist +68 -0
- data/bin/gpmath +120 -0
- data/bin/gpmaxmin +128 -0
- data/bin/gpprint +60 -0
- data/bin/gpvect +706 -0
- data/bin/gpview +704 -0
- data/bin/grads2nc_with_gphys +61 -0
- data/doc/attribute.html +19 -0
- data/doc/attributenetcdf.html +15 -0
- data/doc/axis.html +376 -0
- data/doc/coordmapping.html +111 -0
- data/doc/coordtransform.html +36 -0
- data/doc/derivative/gphys-derivative.html +80 -0
- data/doc/derivative/index.html +21 -0
- data/doc/derivative/index.rd +14 -0
- data/doc/derivative/math-doc/document/document.css +30 -0
- data/doc/derivative/math-doc/document/document.html +57 -0
- data/doc/derivative/math-doc/document/images.aux +1 -0
- data/doc/derivative/math-doc/document/images.log +385 -0
- data/doc/derivative/math-doc/document/images.pl +186 -0
- data/doc/derivative/math-doc/document/images.tex +364 -0
- data/doc/derivative/math-doc/document/img1.png +0 -0
- data/doc/derivative/math-doc/document/img10.png +0 -0
- data/doc/derivative/math-doc/document/img11.png +0 -0
- data/doc/derivative/math-doc/document/img12.png +0 -0
- data/doc/derivative/math-doc/document/img13.png +0 -0
- data/doc/derivative/math-doc/document/img14.png +0 -0
- data/doc/derivative/math-doc/document/img15.png +0 -0
- data/doc/derivative/math-doc/document/img16.png +0 -0
- data/doc/derivative/math-doc/document/img17.png +0 -0
- data/doc/derivative/math-doc/document/img18.png +0 -0
- data/doc/derivative/math-doc/document/img19.png +0 -0
- data/doc/derivative/math-doc/document/img2.png +0 -0
- data/doc/derivative/math-doc/document/img20.png +0 -0
- data/doc/derivative/math-doc/document/img21.png +0 -0
- data/doc/derivative/math-doc/document/img22.png +0 -0
- data/doc/derivative/math-doc/document/img23.png +0 -0
- data/doc/derivative/math-doc/document/img24.png +0 -0
- data/doc/derivative/math-doc/document/img25.png +0 -0
- data/doc/derivative/math-doc/document/img26.png +0 -0
- data/doc/derivative/math-doc/document/img27.png +0 -0
- data/doc/derivative/math-doc/document/img28.png +0 -0
- data/doc/derivative/math-doc/document/img29.png +0 -0
- data/doc/derivative/math-doc/document/img3.png +0 -0
- data/doc/derivative/math-doc/document/img30.png +0 -0
- data/doc/derivative/math-doc/document/img4.png +0 -0
- data/doc/derivative/math-doc/document/img5.png +0 -0
- data/doc/derivative/math-doc/document/img6.png +0 -0
- data/doc/derivative/math-doc/document/img7.png +0 -0
- data/doc/derivative/math-doc/document/img8.png +0 -0
- data/doc/derivative/math-doc/document/img9.png +0 -0
- data/doc/derivative/math-doc/document/index.html +57 -0
- data/doc/derivative/math-doc/document/labels.pl +13 -0
- data/doc/derivative/math-doc/document/next.png +0 -0
- data/doc/derivative/math-doc/document/next_g.png +0 -0
- data/doc/derivative/math-doc/document/node1.html +238 -0
- data/doc/derivative/math-doc/document/node2.html +75 -0
- data/doc/derivative/math-doc/document/prev.png +0 -0
- data/doc/derivative/math-doc/document/prev_g.png +0 -0
- data/doc/derivative/math-doc/document/up.png +0 -0
- data/doc/derivative/math-doc/document/up_g.png +0 -0
- data/doc/derivative/math-doc/document.pdf +0 -0
- data/doc/derivative/math-doc/document.tex +158 -0
- data/doc/derivative/numru-derivative.html +129 -0
- data/doc/ep_flux/ep_flux.html +469 -0
- data/doc/ep_flux/ggraph_on_merdional_section.html +71 -0
- data/doc/ep_flux/index.html +31 -0
- data/doc/ep_flux/index.rd +24 -0
- data/doc/ep_flux/math-doc/document/WARNINGS +1 -0
- data/doc/ep_flux/math-doc/document/contents.png +0 -0
- data/doc/ep_flux/math-doc/document/crossref.png +0 -0
- data/doc/ep_flux/math-doc/document/document.css +30 -0
- data/doc/ep_flux/math-doc/document/document.html +101 -0
- data/doc/ep_flux/math-doc/document/images.aux +1 -0
- data/doc/ep_flux/math-doc/document/images.log +1375 -0
- data/doc/ep_flux/math-doc/document/images.pl +1328 -0
- data/doc/ep_flux/math-doc/document/images.tex +1471 -0
- data/doc/ep_flux/math-doc/document/img1.png +0 -0
- data/doc/ep_flux/math-doc/document/img10.png +0 -0
- data/doc/ep_flux/math-doc/document/img100.png +0 -0
- data/doc/ep_flux/math-doc/document/img101.png +0 -0
- data/doc/ep_flux/math-doc/document/img102.png +0 -0
- data/doc/ep_flux/math-doc/document/img103.png +0 -0
- data/doc/ep_flux/math-doc/document/img104.png +0 -0
- data/doc/ep_flux/math-doc/document/img105.png +0 -0
- data/doc/ep_flux/math-doc/document/img106.png +0 -0
- data/doc/ep_flux/math-doc/document/img107.png +0 -0
- data/doc/ep_flux/math-doc/document/img108.png +0 -0
- data/doc/ep_flux/math-doc/document/img109.png +0 -0
- data/doc/ep_flux/math-doc/document/img11.png +0 -0
- data/doc/ep_flux/math-doc/document/img110.png +0 -0
- data/doc/ep_flux/math-doc/document/img111.png +0 -0
- data/doc/ep_flux/math-doc/document/img112.png +0 -0
- data/doc/ep_flux/math-doc/document/img113.png +0 -0
- data/doc/ep_flux/math-doc/document/img114.png +0 -0
- data/doc/ep_flux/math-doc/document/img115.png +0 -0
- data/doc/ep_flux/math-doc/document/img116.png +0 -0
- data/doc/ep_flux/math-doc/document/img117.png +0 -0
- data/doc/ep_flux/math-doc/document/img118.png +0 -0
- data/doc/ep_flux/math-doc/document/img119.png +0 -0
- data/doc/ep_flux/math-doc/document/img12.png +0 -0
- data/doc/ep_flux/math-doc/document/img120.png +0 -0
- data/doc/ep_flux/math-doc/document/img121.png +0 -0
- data/doc/ep_flux/math-doc/document/img122.png +0 -0
- data/doc/ep_flux/math-doc/document/img123.png +0 -0
- data/doc/ep_flux/math-doc/document/img124.png +0 -0
- data/doc/ep_flux/math-doc/document/img125.png +0 -0
- data/doc/ep_flux/math-doc/document/img126.png +0 -0
- data/doc/ep_flux/math-doc/document/img127.png +0 -0
- data/doc/ep_flux/math-doc/document/img128.png +0 -0
- data/doc/ep_flux/math-doc/document/img129.png +0 -0
- data/doc/ep_flux/math-doc/document/img13.png +0 -0
- data/doc/ep_flux/math-doc/document/img130.png +0 -0
- data/doc/ep_flux/math-doc/document/img131.png +0 -0
- data/doc/ep_flux/math-doc/document/img132.png +0 -0
- data/doc/ep_flux/math-doc/document/img133.png +0 -0
- data/doc/ep_flux/math-doc/document/img134.png +0 -0
- data/doc/ep_flux/math-doc/document/img135.png +0 -0
- data/doc/ep_flux/math-doc/document/img136.png +0 -0
- data/doc/ep_flux/math-doc/document/img137.png +0 -0
- data/doc/ep_flux/math-doc/document/img138.png +0 -0
- data/doc/ep_flux/math-doc/document/img139.png +0 -0
- data/doc/ep_flux/math-doc/document/img14.png +0 -0
- data/doc/ep_flux/math-doc/document/img140.png +0 -0
- data/doc/ep_flux/math-doc/document/img141.png +0 -0
- data/doc/ep_flux/math-doc/document/img142.png +0 -0
- data/doc/ep_flux/math-doc/document/img143.png +0 -0
- data/doc/ep_flux/math-doc/document/img144.png +0 -0
- data/doc/ep_flux/math-doc/document/img145.png +0 -0
- data/doc/ep_flux/math-doc/document/img146.png +0 -0
- data/doc/ep_flux/math-doc/document/img147.png +0 -0
- data/doc/ep_flux/math-doc/document/img148.png +0 -0
- data/doc/ep_flux/math-doc/document/img149.png +0 -0
- data/doc/ep_flux/math-doc/document/img15.png +0 -0
- data/doc/ep_flux/math-doc/document/img150.png +0 -0
- data/doc/ep_flux/math-doc/document/img151.png +0 -0
- data/doc/ep_flux/math-doc/document/img152.png +0 -0
- data/doc/ep_flux/math-doc/document/img153.png +0 -0
- data/doc/ep_flux/math-doc/document/img154.png +0 -0
- data/doc/ep_flux/math-doc/document/img155.png +0 -0
- data/doc/ep_flux/math-doc/document/img156.png +0 -0
- data/doc/ep_flux/math-doc/document/img157.png +0 -0
- data/doc/ep_flux/math-doc/document/img158.png +0 -0
- data/doc/ep_flux/math-doc/document/img159.png +0 -0
- data/doc/ep_flux/math-doc/document/img16.png +0 -0
- data/doc/ep_flux/math-doc/document/img160.png +0 -0
- data/doc/ep_flux/math-doc/document/img161.png +0 -0
- data/doc/ep_flux/math-doc/document/img162.png +0 -0
- data/doc/ep_flux/math-doc/document/img163.png +0 -0
- data/doc/ep_flux/math-doc/document/img164.png +0 -0
- data/doc/ep_flux/math-doc/document/img165.png +0 -0
- data/doc/ep_flux/math-doc/document/img166.png +0 -0
- data/doc/ep_flux/math-doc/document/img167.png +0 -0
- data/doc/ep_flux/math-doc/document/img168.png +0 -0
- data/doc/ep_flux/math-doc/document/img169.png +0 -0
- data/doc/ep_flux/math-doc/document/img17.png +0 -0
- data/doc/ep_flux/math-doc/document/img170.png +0 -0
- data/doc/ep_flux/math-doc/document/img171.png +0 -0
- data/doc/ep_flux/math-doc/document/img172.png +0 -0
- data/doc/ep_flux/math-doc/document/img173.png +0 -0
- data/doc/ep_flux/math-doc/document/img174.png +0 -0
- data/doc/ep_flux/math-doc/document/img175.png +0 -0
- data/doc/ep_flux/math-doc/document/img176.png +0 -0
- data/doc/ep_flux/math-doc/document/img177.png +0 -0
- data/doc/ep_flux/math-doc/document/img178.png +0 -0
- data/doc/ep_flux/math-doc/document/img179.png +0 -0
- data/doc/ep_flux/math-doc/document/img18.png +0 -0
- data/doc/ep_flux/math-doc/document/img180.png +0 -0
- data/doc/ep_flux/math-doc/document/img181.png +0 -0
- data/doc/ep_flux/math-doc/document/img182.png +0 -0
- data/doc/ep_flux/math-doc/document/img183.png +0 -0
- data/doc/ep_flux/math-doc/document/img184.png +0 -0
- data/doc/ep_flux/math-doc/document/img185.png +0 -0
- data/doc/ep_flux/math-doc/document/img186.png +0 -0
- data/doc/ep_flux/math-doc/document/img187.png +0 -0
- data/doc/ep_flux/math-doc/document/img188.png +0 -0
- data/doc/ep_flux/math-doc/document/img189.png +0 -0
- data/doc/ep_flux/math-doc/document/img19.png +0 -0
- data/doc/ep_flux/math-doc/document/img190.png +0 -0
- data/doc/ep_flux/math-doc/document/img191.png +0 -0
- data/doc/ep_flux/math-doc/document/img192.png +0 -0
- data/doc/ep_flux/math-doc/document/img193.png +0 -0
- data/doc/ep_flux/math-doc/document/img194.png +0 -0
- data/doc/ep_flux/math-doc/document/img195.png +0 -0
- data/doc/ep_flux/math-doc/document/img196.png +0 -0
- data/doc/ep_flux/math-doc/document/img197.png +0 -0
- data/doc/ep_flux/math-doc/document/img198.png +0 -0
- data/doc/ep_flux/math-doc/document/img199.png +0 -0
- data/doc/ep_flux/math-doc/document/img2.png +0 -0
- data/doc/ep_flux/math-doc/document/img20.png +0 -0
- data/doc/ep_flux/math-doc/document/img200.png +0 -0
- data/doc/ep_flux/math-doc/document/img21.png +0 -0
- data/doc/ep_flux/math-doc/document/img22.png +0 -0
- data/doc/ep_flux/math-doc/document/img23.png +0 -0
- data/doc/ep_flux/math-doc/document/img24.png +0 -0
- data/doc/ep_flux/math-doc/document/img25.png +0 -0
- data/doc/ep_flux/math-doc/document/img26.png +0 -0
- data/doc/ep_flux/math-doc/document/img27.png +0 -0
- data/doc/ep_flux/math-doc/document/img28.png +0 -0
- data/doc/ep_flux/math-doc/document/img29.png +0 -0
- data/doc/ep_flux/math-doc/document/img3.png +0 -0
- data/doc/ep_flux/math-doc/document/img30.png +0 -0
- data/doc/ep_flux/math-doc/document/img31.png +0 -0
- data/doc/ep_flux/math-doc/document/img32.png +0 -0
- data/doc/ep_flux/math-doc/document/img33.png +0 -0
- data/doc/ep_flux/math-doc/document/img34.png +0 -0
- data/doc/ep_flux/math-doc/document/img35.png +0 -0
- data/doc/ep_flux/math-doc/document/img36.png +0 -0
- data/doc/ep_flux/math-doc/document/img37.png +0 -0
- data/doc/ep_flux/math-doc/document/img38.png +0 -0
- data/doc/ep_flux/math-doc/document/img39.png +0 -0
- data/doc/ep_flux/math-doc/document/img4.png +0 -0
- data/doc/ep_flux/math-doc/document/img40.png +0 -0
- data/doc/ep_flux/math-doc/document/img41.png +0 -0
- data/doc/ep_flux/math-doc/document/img42.png +0 -0
- data/doc/ep_flux/math-doc/document/img43.png +0 -0
- data/doc/ep_flux/math-doc/document/img44.png +0 -0
- data/doc/ep_flux/math-doc/document/img45.png +0 -0
- data/doc/ep_flux/math-doc/document/img46.png +0 -0
- data/doc/ep_flux/math-doc/document/img47.png +0 -0
- data/doc/ep_flux/math-doc/document/img48.png +0 -0
- data/doc/ep_flux/math-doc/document/img49.png +0 -0
- data/doc/ep_flux/math-doc/document/img5.png +0 -0
- data/doc/ep_flux/math-doc/document/img50.png +0 -0
- data/doc/ep_flux/math-doc/document/img51.png +0 -0
- data/doc/ep_flux/math-doc/document/img52.png +0 -0
- data/doc/ep_flux/math-doc/document/img53.png +0 -0
- data/doc/ep_flux/math-doc/document/img54.png +0 -0
- data/doc/ep_flux/math-doc/document/img55.png +0 -0
- data/doc/ep_flux/math-doc/document/img56.png +0 -0
- data/doc/ep_flux/math-doc/document/img57.png +0 -0
- data/doc/ep_flux/math-doc/document/img58.png +0 -0
- data/doc/ep_flux/math-doc/document/img59.png +0 -0
- data/doc/ep_flux/math-doc/document/img6.png +0 -0
- data/doc/ep_flux/math-doc/document/img60.png +0 -0
- data/doc/ep_flux/math-doc/document/img61.png +0 -0
- data/doc/ep_flux/math-doc/document/img62.png +0 -0
- data/doc/ep_flux/math-doc/document/img63.png +0 -0
- data/doc/ep_flux/math-doc/document/img64.png +0 -0
- data/doc/ep_flux/math-doc/document/img65.png +0 -0
- data/doc/ep_flux/math-doc/document/img66.png +0 -0
- data/doc/ep_flux/math-doc/document/img67.png +0 -0
- data/doc/ep_flux/math-doc/document/img68.png +0 -0
- data/doc/ep_flux/math-doc/document/img69.png +0 -0
- data/doc/ep_flux/math-doc/document/img7.png +0 -0
- data/doc/ep_flux/math-doc/document/img70.png +0 -0
- data/doc/ep_flux/math-doc/document/img71.png +0 -0
- data/doc/ep_flux/math-doc/document/img72.png +0 -0
- data/doc/ep_flux/math-doc/document/img73.png +0 -0
- data/doc/ep_flux/math-doc/document/img74.png +0 -0
- data/doc/ep_flux/math-doc/document/img75.png +0 -0
- data/doc/ep_flux/math-doc/document/img76.png +0 -0
- data/doc/ep_flux/math-doc/document/img77.png +0 -0
- data/doc/ep_flux/math-doc/document/img78.png +0 -0
- data/doc/ep_flux/math-doc/document/img79.png +0 -0
- data/doc/ep_flux/math-doc/document/img8.png +0 -0
- data/doc/ep_flux/math-doc/document/img80.png +0 -0
- data/doc/ep_flux/math-doc/document/img81.png +0 -0
- data/doc/ep_flux/math-doc/document/img82.png +0 -0
- data/doc/ep_flux/math-doc/document/img83.png +0 -0
- data/doc/ep_flux/math-doc/document/img84.png +0 -0
- data/doc/ep_flux/math-doc/document/img85.png +0 -0
- data/doc/ep_flux/math-doc/document/img86.png +0 -0
- data/doc/ep_flux/math-doc/document/img87.png +0 -0
- data/doc/ep_flux/math-doc/document/img88.png +0 -0
- data/doc/ep_flux/math-doc/document/img89.png +0 -0
- data/doc/ep_flux/math-doc/document/img9.png +0 -0
- data/doc/ep_flux/math-doc/document/img90.png +0 -0
- data/doc/ep_flux/math-doc/document/img91.png +0 -0
- data/doc/ep_flux/math-doc/document/img92.png +0 -0
- data/doc/ep_flux/math-doc/document/img93.png +0 -0
- data/doc/ep_flux/math-doc/document/img94.png +0 -0
- data/doc/ep_flux/math-doc/document/img95.png +0 -0
- data/doc/ep_flux/math-doc/document/img96.png +0 -0
- data/doc/ep_flux/math-doc/document/img97.png +0 -0
- data/doc/ep_flux/math-doc/document/img98.png +0 -0
- data/doc/ep_flux/math-doc/document/img99.png +0 -0
- data/doc/ep_flux/math-doc/document/index.html +101 -0
- data/doc/ep_flux/math-doc/document/internals.pl +258 -0
- data/doc/ep_flux/math-doc/document/labels.pl +265 -0
- data/doc/ep_flux/math-doc/document/next.png +0 -0
- data/doc/ep_flux/math-doc/document/next_g.png +0 -0
- data/doc/ep_flux/math-doc/document/node1.html +104 -0
- data/doc/ep_flux/math-doc/document/node10.html +164 -0
- data/doc/ep_flux/math-doc/document/node11.html +86 -0
- data/doc/ep_flux/math-doc/document/node12.html +166 -0
- data/doc/ep_flux/math-doc/document/node13.html +897 -0
- data/doc/ep_flux/math-doc/document/node14.html +1065 -0
- data/doc/ep_flux/math-doc/document/node15.html +72 -0
- data/doc/ep_flux/math-doc/document/node16.html +81 -0
- data/doc/ep_flux/math-doc/document/node2.html +82 -0
- data/doc/ep_flux/math-doc/document/node3.html +91 -0
- data/doc/ep_flux/math-doc/document/node4.html +149 -0
- data/doc/ep_flux/math-doc/document/node5.html +330 -0
- data/doc/ep_flux/math-doc/document/node6.html +99 -0
- data/doc/ep_flux/math-doc/document/node7.html +98 -0
- data/doc/ep_flux/math-doc/document/node8.html +83 -0
- data/doc/ep_flux/math-doc/document/node9.html +140 -0
- data/doc/ep_flux/math-doc/document/prev.png +0 -0
- data/doc/ep_flux/math-doc/document/prev_g.png +0 -0
- data/doc/ep_flux/math-doc/document/up.png +0 -0
- data/doc/ep_flux/math-doc/document/up_g.png +0 -0
- data/doc/ep_flux/math-doc/document.pdf +0 -0
- data/doc/ep_flux/math-doc/document.tex +2018 -0
- data/doc/gdir.html +412 -0
- data/doc/gdir_client.html +16 -0
- data/doc/gdir_connect_ftp-like.html +61 -0
- data/doc/gdir_server.html +45 -0
- data/doc/ggraph.html +1615 -0
- data/doc/gpcat.html +44 -0
- data/doc/gpcut.html +41 -0
- data/doc/gphys.html +532 -0
- data/doc/gphys_fft.html +324 -0
- data/doc/gphys_grads_io.html +69 -0
- data/doc/gphys_grib_io.html +82 -0
- data/doc/gphys_io.html +120 -0
- data/doc/gphys_io_common.html +18 -0
- data/doc/gphys_netcdf_io.html +283 -0
- data/doc/gplist.html +24 -0
- data/doc/gpmath.html +51 -0
- data/doc/gpmaxmin.html +31 -0
- data/doc/gpprint.html +34 -0
- data/doc/gpview.html +270 -0
- data/doc/grads2nc_with_gphys.html +21 -0
- data/doc/grads_gridded.html +307 -0
- data/doc/grib.html +144 -0
- data/doc/grid.html +212 -0
- data/doc/index.html +133 -0
- data/doc/index.rd +127 -0
- data/doc/netcdf_convention.html +136 -0
- data/doc/unumeric.html +176 -0
- data/doc/update +64 -0
- data/doc/varray.html +299 -0
- data/doc/varraycomposite.html +67 -0
- data/ext_coord.c +209 -0
- data/ext_init.c +7 -0
- data/extconf.rb +42 -0
- data/install.rb +130 -0
- data/interpo.c +497 -0
- data/lib/numru/dcl_mouse.rb +71 -0
- data/lib/numru/dclext_datetime_ax.rb +220 -0
- data/lib/numru/derivative.rb +348 -0
- data/lib/numru/ganalysis/covariance.rb +154 -0
- data/lib/numru/ganalysis/eof.rb +298 -0
- data/lib/numru/ganalysis/histogram.rb +252 -0
- data/lib/numru/ganalysis/met.rb +317 -0
- data/lib/numru/ganalysis/planet.rb +182 -0
- data/lib/numru/ganalysis.rb +7 -0
- data/lib/numru/gdir.rb +1038 -0
- data/lib/numru/gdir_connect_ftp-like.rb +149 -0
- data/lib/numru/ggraph.rb +5838 -0
- data/lib/numru/ggraph_on_merdional_section.rb +178 -0
- data/lib/numru/gphys/assoccoords.rb +359 -0
- data/lib/numru/gphys/attribute.rb +129 -0
- data/lib/numru/gphys/attributenetcdf.rb +80 -0
- data/lib/numru/gphys/axis.rb +963 -0
- data/lib/numru/gphys/coordmapping.rb +286 -0
- data/lib/numru/gphys/coordtransform.rb +209 -0
- data/lib/numru/gphys/derivative.rb +314 -0
- data/lib/numru/gphys/ep_flux.rb +868 -0
- data/lib/numru/gphys/gpcommon.rb +52 -0
- data/lib/numru/gphys/gphys.rb +1207 -0
- data/lib/numru/gphys/gphys_fft.rb +886 -0
- data/lib/numru/gphys/gphys_grads_io.rb +212 -0
- data/lib/numru/gphys/gphys_grib_io.rb +214 -0
- data/lib/numru/gphys/gphys_gtool3_io.rb +162 -0
- data/lib/numru/gphys/gphys_hdfeos5_io.rb +672 -0
- data/lib/numru/gphys/gphys_io.rb +452 -0
- data/lib/numru/gphys/gphys_io_common.rb +126 -0
- data/lib/numru/gphys/gphys_netcdf_io.rb +800 -0
- data/lib/numru/gphys/gphys_nusdas_io.rb +132 -0
- data/lib/numru/gphys/grads_gridded.rb +1638 -0
- data/lib/numru/gphys/grib.rb +2049 -0
- data/lib/numru/gphys/grib_params.rb +1465 -0
- data/lib/numru/gphys/grid.rb +723 -0
- data/lib/numru/gphys/gtool3.rb +771 -0
- data/lib/numru/gphys/interpolate.rb +854 -0
- data/lib/numru/gphys/narray_ext.rb +34 -0
- data/lib/numru/gphys/netcdf_convention.rb +406 -0
- data/lib/numru/gphys/subsetmapping.rb +332 -0
- data/lib/numru/gphys/unumeric.rb +522 -0
- data/lib/numru/gphys/varray.rb +1109 -0
- data/lib/numru/gphys/varraycomposite.rb +415 -0
- data/lib/numru/gphys/varraygrads.rb +225 -0
- data/lib/numru/gphys/varraygrib.rb +177 -0
- data/lib/numru/gphys/varraygtool3.rb +226 -0
- data/lib/numru/gphys/varrayhdfeos5.rb +451 -0
- data/lib/numru/gphys/varraynetcdf.rb +350 -0
- data/lib/numru/gphys/varraynusdas.rb +59 -0
- data/lib/numru/gphys.rb +9 -0
- data/lib/numru/htdir.rb +170 -0
- data/multibitIO.c +567 -0
- data/sample/cira86_to_nc.rb +122 -0
- data/sample/druby_cli1.rb +21 -0
- data/sample/druby_cli2.rb +34 -0
- data/sample/druby_serv1.rb +30 -0
- data/sample/druby_serv2.rb +64 -0
- data/sample/ep_flux/demo_NCEP_1.rb +48 -0
- data/sample/ep_flux/demo_NCEP_2.rb +57 -0
- data/sample/ep_flux/demo_NCEP_3.rb +81 -0
- data/sample/ggraph_latlon_labelling_dr002690.rb +159 -0
- data/sample/ggraph_mapfit-axes_dr002687.rb +131 -0
- data/sample/map_projection.rb +121 -0
- data/sample/ncep_theta_coord.rb +79 -0
- data/test/eof_slp.rb +28 -0
- data/test/mltbit.dat +0 -0
- data/test/test_ep_flux.rb +533 -0
- data/test/test_multibitIO.rb +19 -0
- data/testdata/T.jan.ctl +12 -0
- data/testdata/T.jan.dat +0 -0
- data/testdata/T.jan.grib +0 -0
- data/testdata/T.jan.nc +0 -0
- data/testdata/T.jan.packed.withmiss.nc +0 -0
- data/testdata/UV.jan.nc +0 -0
- data/testdata/assoc_crds.nc +0 -0
- data/testdata/cira86.dat +1332 -0
- metadata +621 -0
@@ -0,0 +1,317 @@
|
|
1
|
+
# = NumRu::GAnalysis::Met : Meteorological analysis
|
2
|
+
|
3
|
+
require "numru/gphys"
|
4
|
+
require 'numru/ganalysis/planet'
|
5
|
+
|
6
|
+
module NumRu
|
7
|
+
|
8
|
+
module GAnalysis
|
9
|
+
|
10
|
+
# Meteorological analysis
|
11
|
+
#
|
12
|
+
# USEFUL METHODS
|
13
|
+
# * temp2theta
|
14
|
+
# * pv_on_theta
|
15
|
+
# * interpolate_onto_theta
|
16
|
+
module Met
|
17
|
+
|
18
|
+
#< Themodynamic constants for the Earth's atmosphere >
|
19
|
+
|
20
|
+
R = UNumeric[287.04,"J.kg-1.K-1"] # Gas constant of dry air
|
21
|
+
Rv = UNumeric[461.50,"J.kg-1.K-1"] # Gas constant of water vapor
|
22
|
+
Cp = UNumeric[1004.6,"J.kg-1.K-1"] # heat capacity at constant pressure for dry air
|
23
|
+
Cpv = UNumeric[1870.0,"J.kg-1.K-1"] # heat capacity at constant pressure for water vapor
|
24
|
+
Kappa = (R/Cp).to_f # = 2.0/7.0
|
25
|
+
T0 = UNumeric[273.15,"K"] # K - Celcius
|
26
|
+
Lat0 = UNumeric[2.500780e6,"J.kg-1"] # Latent heat of vaporization at 0 degC
|
27
|
+
|
28
|
+
#< Earth's parameters >
|
29
|
+
@@g = UNumeric[9.8,"m.s-2"] # adjustable: e.g., 9.7 m.s-2 for stratosphere
|
30
|
+
P00 = UNumeric[1e5,"Pa"]
|
31
|
+
|
32
|
+
module_function
|
33
|
+
|
34
|
+
#< module parameters >
|
35
|
+
|
36
|
+
# Sets gravity acceleration in the module (default: 9.8 ms-1).
|
37
|
+
#
|
38
|
+
# ARGUMENT
|
39
|
+
# * g [UNumeric]
|
40
|
+
# EXAMPLE
|
41
|
+
# Met::set_g( UNumeric[9.7,"m.s-2"] )
|
42
|
+
# RETURN VALUE
|
43
|
+
# * The argument g
|
44
|
+
def set_g(g)
|
45
|
+
@@g = g # e.g., un[9.8,"m.s-2"]
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
# Returns gravity acceleration in the module (default: 9.8 ms-1).
|
50
|
+
def g
|
51
|
+
@@g.dup
|
52
|
+
end
|
53
|
+
|
54
|
+
#< potential temperature >
|
55
|
+
|
56
|
+
# Convert temperature into potential temperature
|
57
|
+
#
|
58
|
+
# ARGUMENTS
|
59
|
+
# * temp [UNumeric or GPhys or VArray, which supports method "units"] :
|
60
|
+
# temperature
|
61
|
+
# * prs [UNumeric or GPhys or VArray, which supports method "units"] :
|
62
|
+
# pressure
|
63
|
+
# RETURN VALUE
|
64
|
+
# * potential temperature [UNumeric or GPhys or VArray,...] in Kelvin
|
65
|
+
#
|
66
|
+
def temp2theta(temp, prs=nil)
|
67
|
+
prs = get_prs(temp) if !prs
|
68
|
+
prs = convert_units2Pa(prs)
|
69
|
+
if ( !(temp.units === Units["K"]) )
|
70
|
+
temp = convert_units(temp,"K")
|
71
|
+
end
|
72
|
+
theta = temp * (prs/P00)**(-Kappa)
|
73
|
+
if theta.respond_to?(:long_name) # VArray or GPhys
|
74
|
+
theta.name = "theta"
|
75
|
+
theta.long_name = "potential temperature"
|
76
|
+
end
|
77
|
+
theta
|
78
|
+
end
|
79
|
+
|
80
|
+
#< for isentropic coordinate >
|
81
|
+
|
82
|
+
# Inverse of the "sigma" density in the theta coordinate:
|
83
|
+
#
|
84
|
+
# ARGUMENTS
|
85
|
+
# * theta [GPhys or VArray] potential temperature
|
86
|
+
# * dim [Integer] : the pressure dimension. If theta is a GPhys,
|
87
|
+
# this argument can be omitted, in which case a pressure dimension
|
88
|
+
# is searched internally by find_prs_d.
|
89
|
+
# * prs [GPhys or VArray] : the pressure values. Internally searched
|
90
|
+
# if omitted.
|
91
|
+
# RETURN VALUE
|
92
|
+
# * 1 / sigma = -g d\theta/dp [GPhys]
|
93
|
+
#
|
94
|
+
def sigma_inv(theta, dim=nil, prs=nil)
|
95
|
+
dim = find_prs_d(theta) if !dim
|
96
|
+
prs = get_prs(theta) if !prs
|
97
|
+
prs = convert_units2Pa(prs)
|
98
|
+
dtheta_dp = df_dx(theta, prs, dim)
|
99
|
+
sig_inv = dtheta_dp * (-@@g)
|
100
|
+
if sig_inv.respond_to?(:long_name) # VArray or GPhys
|
101
|
+
sig_inv.name = "sig_inv"
|
102
|
+
sig_inv.long_name = "1/sigma"
|
103
|
+
end
|
104
|
+
sig_inv
|
105
|
+
end
|
106
|
+
|
107
|
+
# Interpolate onto the potential temperature coordinate
|
108
|
+
#
|
109
|
+
# ARGUMENTS
|
110
|
+
# * gphys [GPhys] a gphys object that have a pressure dimension
|
111
|
+
# * theta [GPhys] potential temperature defined on the same grid
|
112
|
+
# as gphys
|
113
|
+
# * theta_vals : 1D NArray or Array
|
114
|
+
def interpolate_onto_theta(gphys, theta, theta_levs)
|
115
|
+
theta_levs = NArray[*theta_levs].to_f if Array === theta_levs
|
116
|
+
th_crd = VArray.new( theta_levs,
|
117
|
+
{"units"=>"K", "long_name"=>"potential temperature"}, "theta" )
|
118
|
+
gphys.set_assoc_coords([theta])
|
119
|
+
pdnm = gphys.coord(find_prs_d(gphys)).name
|
120
|
+
gphys.interpolate(pdnm=>th_crd)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Derive Ertel's potential vorticity on the theta (isentropic)
|
124
|
+
# coordinate
|
125
|
+
#
|
126
|
+
# ARGUMENTS
|
127
|
+
# * u [GPhys] : zonal wind on pressure coordinate
|
128
|
+
# (u, v, and theta must share same coordinates)
|
129
|
+
# * v [GPhys] : meridional wind on pressure coordinate
|
130
|
+
# * theta [GPhys] : potential temperature on pressure coordinate
|
131
|
+
# * theta_levs [NArray or Array] : one dimensional array of
|
132
|
+
# potential temperature values (Kelvin) on which PV is derived.
|
133
|
+
#
|
134
|
+
# RETURN VALUE
|
135
|
+
# * potential temperature [GPhys] on a theta coordinate, where
|
136
|
+
# levels are set to theta_levs
|
137
|
+
def pv_on_theta(u, v, theta, theta_levs)
|
138
|
+
sigi = GAnalysis::Met.sigma_inv(theta)
|
139
|
+
uth = GAnalysis::Met.interpolate_onto_theta(u, theta, theta_levs)
|
140
|
+
vth = GAnalysis::Met.interpolate_onto_theta(v, theta, theta_levs)
|
141
|
+
sigith = GAnalysis::Met.interpolate_onto_theta(sigi, theta, theta_levs)
|
142
|
+
avorth = GAnalysis::Planet.absvor_s(uth,vth)
|
143
|
+
pv = avorth*sigith
|
144
|
+
pv.long_name = "potential vorticity"
|
145
|
+
pv.name = "PV"
|
146
|
+
pv
|
147
|
+
end
|
148
|
+
|
149
|
+
# Find a pressure coordinate in a GPhys object
|
150
|
+
#
|
151
|
+
# ARGUMENT
|
152
|
+
# * gphys [GPhys]
|
153
|
+
# * error [nil/false or true] change the behavior if a
|
154
|
+
# pressure coordinate is not found. Default: returns nil;
|
155
|
+
# if error is true, an exception is raised.
|
156
|
+
# RETURN VALUE
|
157
|
+
# * Integer to indicate the dimension of the pressure coordinate,
|
158
|
+
# or nil if not found by default (see above)
|
159
|
+
def find_prs_d(gphys, error=nil)
|
160
|
+
pa = Units.new("Pa")
|
161
|
+
(gphys.rank-1).downto(0) do |d|
|
162
|
+
un = gphys.axis(d).pos.units
|
163
|
+
if ( un =~ pa or un.to_s=="millibar" )
|
164
|
+
return(d)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
if error
|
168
|
+
raise("Could not find a pressure coordinate.")
|
169
|
+
else
|
170
|
+
nil
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Find and return a pressure coordinate in a GPhys object
|
175
|
+
#
|
176
|
+
# ARGUMENT
|
177
|
+
# * gphys [GPhys]
|
178
|
+
#
|
179
|
+
# RETURN VALUE
|
180
|
+
# * pressure in a 1D GPhys object created from the pressure
|
181
|
+
# axis in the GPhys object or a UNumeric object if the pressure
|
182
|
+
# coordinated has been deleted by subsetting.
|
183
|
+
def get_prs(gphys)
|
184
|
+
begin
|
185
|
+
prs = gphys.axis( find_prs_d(gphys, true) ).to_gphys
|
186
|
+
rescue
|
187
|
+
regexp = /([\d\.]+) *(millibar|hPa)/
|
188
|
+
cand = gphys.lost_axes.grep(regexp)
|
189
|
+
if (str=cand[0]) # substitution, not ==
|
190
|
+
regexp =~ str
|
191
|
+
hpa = $1.to_f
|
192
|
+
prs = UNumeric[hpa*100,"Pa"]
|
193
|
+
else
|
194
|
+
raise "No pressure axis was found"
|
195
|
+
end
|
196
|
+
end
|
197
|
+
prs
|
198
|
+
end
|
199
|
+
|
200
|
+
# Convert units into Pa. To deal with old versions of NumRu::Units
|
201
|
+
# that do not support "millibar".
|
202
|
+
#
|
203
|
+
# ARGUMENT
|
204
|
+
# * prs [GPhys and UNumeric]
|
205
|
+
def convert_units2Pa(prs)
|
206
|
+
pa = Units["Pa"]
|
207
|
+
un = prs.units
|
208
|
+
if ((un =~ pa) and !(un === pa))
|
209
|
+
prs = convert_units(prs, pa)
|
210
|
+
elsif un.to_s=="millibar"
|
211
|
+
if UNumeric === prs
|
212
|
+
ret = UNumeric[prs.val*100, "Pa"]
|
213
|
+
else
|
214
|
+
ret = prs*100
|
215
|
+
ret.units = "Pa"
|
216
|
+
end
|
217
|
+
ret
|
218
|
+
else
|
219
|
+
prs
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
#< misc >
|
224
|
+
|
225
|
+
# Unit conversion good to both GPhys and UNumeric
|
226
|
+
def convert_units(obj, un)
|
227
|
+
begin
|
228
|
+
obj.convert_units(un) # for GPhys etc
|
229
|
+
rescue
|
230
|
+
obj.convert2(un) # for UNumeric etc
|
231
|
+
end
|
232
|
+
end
|
233
|
+
private :convert_units # this method should be defined somewhere else
|
234
|
+
|
235
|
+
# numerical derivative good to both GPhys and UNumeric
|
236
|
+
def df_dx(f, x, dim)
|
237
|
+
if GPhys === f
|
238
|
+
mdl = NumRu::GPhys::Derivative
|
239
|
+
mdl.threepoint_O2nd_deriv(f, dim, mdl::LINEAR_EXT, x)
|
240
|
+
else
|
241
|
+
mdl = NumRu::Derivative
|
242
|
+
mdl.threepoint_O2nd_deriv(f, x, dim, mdl::LINEAR_EXT)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
private :df_dx # this method should be defined somewhere else
|
246
|
+
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
################################################
|
252
|
+
##### test part ######
|
253
|
+
if $0 == __FILE__
|
254
|
+
require "numru/ggraph"
|
255
|
+
include NumRu
|
256
|
+
|
257
|
+
#< data >
|
258
|
+
|
259
|
+
temp = GPhys::IO.open("../../../testdata/T.jan.nc","T")
|
260
|
+
u = GPhys::IO.open("../../../testdata/UV.jan.nc","U")
|
261
|
+
v = GPhys::IO.open("../../../testdata/UV.jan.nc","V")
|
262
|
+
|
263
|
+
#< theta >
|
264
|
+
|
265
|
+
print "***** test theta *****\n\n"
|
266
|
+
|
267
|
+
theta = GAnalysis::Met.temp2theta(temp)
|
268
|
+
p theta
|
269
|
+
DCL.swpset('iwidth',800)
|
270
|
+
DCL.swpset('iheight',800)
|
271
|
+
DCL.sgscmn(10) # set colomap
|
272
|
+
DCL.gropn(1)
|
273
|
+
DCL.sgpset('isub', 96) # control character of subscription: '_' --> '`'
|
274
|
+
DCL.glpset('lmiss',true)
|
275
|
+
DCL.sldiv("y",2,2)
|
276
|
+
GGraph::set_fig "itr"=>2
|
277
|
+
#GGraph::tone_and_contour temp.mean(0)
|
278
|
+
GGraph::tone_and_contour theta.mean(0)
|
279
|
+
|
280
|
+
p temp.coord(2).val[3]
|
281
|
+
t = temp[0..1,0,3]
|
282
|
+
p t.val
|
283
|
+
p GAnalysis::Met.temp2theta(t).val
|
284
|
+
p GAnalysis::Met.temp2theta(t,UNumeric[4e4,"Pa"]).val
|
285
|
+
p GAnalysis::Met.temp2theta(UNumeric[20,"degC"],UNumeric[850,"hPa"]).val
|
286
|
+
|
287
|
+
#< isentropic coordinate >
|
288
|
+
|
289
|
+
print "\n***** test isentropic coordinate *****\n\n"
|
290
|
+
sig_inv = GAnalysis::Met.sigma_inv(theta)
|
291
|
+
GGraph::tone_and_contour 1/sig_inv.mean(0),true,"log"=>true,"title"=>"sigma"
|
292
|
+
p( (sig_inv.units**(-1)).reduce5.to_s )
|
293
|
+
|
294
|
+
theta_rg = theta.regrid(u)
|
295
|
+
|
296
|
+
theta_levs = [320.0, 350.0, 400.0, 600.0, 800.0]
|
297
|
+
u_th = GAnalysis::Met.interpolate_onto_theta(u, theta_rg, theta_levs)
|
298
|
+
p u_th
|
299
|
+
|
300
|
+
# DCL.grfrm
|
301
|
+
GGraph::tone u.mean(0)
|
302
|
+
GGraph::contour theta_rg.mean(0), false, "levels"=>theta_levs,"index"=>[3]
|
303
|
+
GGraph::color_bar
|
304
|
+
GGraph::set_fig "itr"=>1
|
305
|
+
GGraph::tone_and_contour u_th.mean(0),true,"keep"=>true
|
306
|
+
GGraph::color_bar
|
307
|
+
|
308
|
+
#< isentropic potential vorticity >
|
309
|
+
pv = GAnalysis::Met.pv_on_theta(u, v, theta_rg, theta_levs)
|
310
|
+
p pv.units
|
311
|
+
GGraph::tone_and_contour pv.mean(0),true
|
312
|
+
GGraph::tone pv.cut("theta"=>320),true,"nlev"=>20,"color_bar"=>true
|
313
|
+
GGraph::tone pv.cut("theta"=>600),true,"nlev"=>20,"color_bar"=>true
|
314
|
+
|
315
|
+
#< finish >
|
316
|
+
DCL.grcls
|
317
|
+
end
|
@@ -0,0 +1,182 @@
|
|
1
|
+
# = NumRu::GAnalysis::Planet : Library for spherical planets (default: Earth)
|
2
|
+
#
|
3
|
+
# ASSUMPTIONS
|
4
|
+
# * longitude is assumed to increase in the eastward direction.
|
5
|
+
# * latitude is assumed to increase in the northward direction,
|
6
|
+
# and it is zero at the equator.
|
7
|
+
|
8
|
+
require "numru/gphys"
|
9
|
+
require 'numru/gphys/derivative'
|
10
|
+
|
11
|
+
module NumRu
|
12
|
+
module GAnalysis
|
13
|
+
|
14
|
+
module Planet
|
15
|
+
module_function
|
16
|
+
|
17
|
+
#< Pre-defined planets >
|
18
|
+
|
19
|
+
Earth = "Earth"
|
20
|
+
def init(planet)
|
21
|
+
case planet
|
22
|
+
when Earth
|
23
|
+
@@R = UNumeric[6.37e6, "m"]
|
24
|
+
@@Ome = UNumeric[2*Math::PI/8.64e4,"s-1"]
|
25
|
+
else
|
26
|
+
raise "Unsupported predefined planet: #{planet}."
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
init(Earth) ###### default setting as the Earth ######
|
31
|
+
|
32
|
+
#< Adjustable planetary settings >
|
33
|
+
|
34
|
+
def radius=(r); @@R = r; end
|
35
|
+
def omega=(o); @@Ome = o; end
|
36
|
+
def radius; @@R; end
|
37
|
+
def omega; @@Ome; end
|
38
|
+
|
39
|
+
#< Class variables regarding lon & lat >
|
40
|
+
|
41
|
+
@@lonbc = GPhys::Derivative::CYCLIC_OR_LINEAR # this should be always fine
|
42
|
+
@@latbc = GPhys::Derivative::LINEAR_EXT # this should be always fine
|
43
|
+
|
44
|
+
@@lam = nil # lambda (lon in radian) obtaiend lately (see get_lonlat)
|
45
|
+
@@phi = nil # phi (lat in radian) obtaiend lately (see get_lonlat)
|
46
|
+
|
47
|
+
#< Differentian at the planets's near surface. With suffix "_s" >
|
48
|
+
|
49
|
+
def rot_s(u,v)
|
50
|
+
lond, latd, lam, phi = get_lonlat(u)
|
51
|
+
cos_phi = phi.cos
|
52
|
+
dv_dlam = v.cderiv(lond,@@lonbc,lam)
|
53
|
+
duc_dphi = (u*cos_phi).cderiv(latd,@@latbc,phi)
|
54
|
+
rot = (dv_dlam - duc_dphi) / (@@R*cos_phi)
|
55
|
+
rot.long_name = "rot(#{u.name},#{v.name})"
|
56
|
+
rot.name = "rot"
|
57
|
+
rot
|
58
|
+
end
|
59
|
+
|
60
|
+
def div_s(u,v)
|
61
|
+
lond, latd, lam, phi = get_lonlat(u)
|
62
|
+
cos_phi = phi.cos
|
63
|
+
du_dlam = u.cderiv(lond,@@lonbc,lam)
|
64
|
+
dvc_dphi = (v*cos_phi).cderiv(latd,@@latbc,phi)
|
65
|
+
rot = (du_dlam + dvc_dphi) / (@@R*cos_phi)
|
66
|
+
rot.long_name = "div(#{u.name},#{v.name})"
|
67
|
+
rot.name = "div"
|
68
|
+
rot
|
69
|
+
end
|
70
|
+
|
71
|
+
def vor_s(u,v)
|
72
|
+
vor = rot_s(u,v)
|
73
|
+
vor.long_name = "Relative Vorticity"
|
74
|
+
vor.name = "vor"
|
75
|
+
vor
|
76
|
+
end
|
77
|
+
|
78
|
+
def absvor_s(u,v)
|
79
|
+
avor = vor_s(u,v) + @@phi.sin * (2*@@Ome)
|
80
|
+
avor.long_name = "Absolute Vorticity"
|
81
|
+
avor.name = "avor"
|
82
|
+
avor
|
83
|
+
end
|
84
|
+
|
85
|
+
def grad_s(s)
|
86
|
+
lond, latd, lam, phi = get_lonlat(s)
|
87
|
+
cos_phi = phi.cos
|
88
|
+
xs = s.cderiv(lond,@@lonbc,lam) / (@@R*cos_phi)
|
89
|
+
ys = s.cderiv(latd,@@latbc,phi) / @@R
|
90
|
+
xs.long_name = "xgrad(#{s.name})"
|
91
|
+
xs.name = "xgrad"
|
92
|
+
ys.long_name = "ygrad(#{s.name})"
|
93
|
+
ys.name = "ygrad"
|
94
|
+
[xs,ys]
|
95
|
+
end
|
96
|
+
|
97
|
+
#< helper methods >
|
98
|
+
|
99
|
+
def get_lonlat(gp)
|
100
|
+
lond, latd = find_lon_lat_dims(gp, true)
|
101
|
+
lam = gp.axis(lond).to_gphys.convert_units("rad") # lambda (lon in rad)
|
102
|
+
lam.units = "" # treat as non-dim
|
103
|
+
phi = gp.axis(latd).to_gphys.convert_units("rad") # phi (lat in rad)
|
104
|
+
phi.units = "" # treat as non-dim
|
105
|
+
@@lam = lam
|
106
|
+
@@phi = phi
|
107
|
+
[lond, latd, lam, phi]
|
108
|
+
end
|
109
|
+
|
110
|
+
def find_lon_lat_dims(gp, err_raise=false)
|
111
|
+
lond = nil
|
112
|
+
latd = nil
|
113
|
+
(0...gp.rank).each do |dim|
|
114
|
+
if /^degrees?_east$/i =~ gp.coord(dim).get_att("units")
|
115
|
+
lond = dim
|
116
|
+
break
|
117
|
+
elsif /^longitude$/i =~ gp.coord(dim).long_name
|
118
|
+
lond = dim
|
119
|
+
break
|
120
|
+
end
|
121
|
+
end
|
122
|
+
(0...gp.rank).each do |dim|
|
123
|
+
if /^degrees?_north$/i =~ gp.coord(dim).get_att("units")
|
124
|
+
latd = dim
|
125
|
+
break
|
126
|
+
elsif /^latitude$/i =~ gp.coord(dim).long_name
|
127
|
+
latd = dim
|
128
|
+
break
|
129
|
+
end
|
130
|
+
end
|
131
|
+
if err_raise
|
132
|
+
raise("Longitude dimension was not found") if !lond
|
133
|
+
raise("Latitude dimension was not found") if !latd
|
134
|
+
end
|
135
|
+
[lond,latd]
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
################################################
|
145
|
+
##### test part ######
|
146
|
+
if $0 == __FILE__
|
147
|
+
require "numru/ggraph"
|
148
|
+
include NumRu
|
149
|
+
u = GPhys::IO.open("../../../testdata/UV.jan.nc","U")
|
150
|
+
v = GPhys::IO.open("../../../testdata/UV.jan.nc","V")
|
151
|
+
##i = 3
|
152
|
+
##u = GPhys::IO.open("/mnt/disk2/horinout/ncep/daily/pressure/uwnd.2008.nc","uwnd")[{0..-1=>i},{1..-2=>i},true,0]
|
153
|
+
##v = GPhys::IO.open("/mnt/disk2/horinout/ncep/daily/pressure/vwnd.2008.nc","vwnd")[{0..-1=>i},{1..-2=>i},true,0]
|
154
|
+
rot = GAnalysis::Planet.rot_s(u,v)
|
155
|
+
avor = GAnalysis::Planet.absvor_s(u,v)
|
156
|
+
div = GAnalysis::Planet.div_s(u,v)
|
157
|
+
print "*** test ***\n"
|
158
|
+
p rot
|
159
|
+
p rot.units
|
160
|
+
p rot.max,rot.min
|
161
|
+
|
162
|
+
DCL.swpset('iwidth',700)
|
163
|
+
DCL.swpset('iheight',700)
|
164
|
+
DCL.sgscmn(10) # set colomap
|
165
|
+
DCL.gropn(1)
|
166
|
+
DCL.sgpset('isub', 96) # control character of subscription: '_' --> '`'
|
167
|
+
DCL.glpset('lmiss',true)
|
168
|
+
DCL.sldiv("y",1,2)
|
169
|
+
DCL.sgpset("lfull",true)
|
170
|
+
GGraph::set_fig "itr"=>10,"viewport"=>[0.1, 0.8, 0.05, 0.4]
|
171
|
+
GGraph::set_map "coast_world"=>true
|
172
|
+
iz = 4
|
173
|
+
GGraph::vector u[false,iz], v[false,iz],true #,"fact"=>2
|
174
|
+
#GGraph::tone u[false,iz],true,"color_bar"=>true
|
175
|
+
GGraph::tone rot[false,iz],true,"max"=>2e-5,"min"=>-2e-5,"int"=>2e-6
|
176
|
+
##GGraph::tone rot[false,iz],true,"max"=>1e-4,"min"=>-1e-4,"int"=>1e-5
|
177
|
+
GGraph::tone avor[false,iz],true,"max"=>2e-4,"min"=>-2e-4,"int"=>2e-5
|
178
|
+
GGraph::color_bar
|
179
|
+
GGraph::tone div[false,iz],true,"max"=>0.5e-5,"min"=>-0.5e-5,"int"=>0.5e-6
|
180
|
+
GGraph::color_bar
|
181
|
+
DCL.grcls
|
182
|
+
end
|