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,533 @@
|
|
1
|
+
=begin
|
2
|
+
=test.rb for module NumRu::GPhys::EP_Flux in ep_flux.rb
|
3
|
+
|
4
|
+
==todo
|
5
|
+
* add draw code.
|
6
|
+
=end
|
7
|
+
|
8
|
+
require 'narray'
|
9
|
+
require 'numru/gphys'
|
10
|
+
require 'numru/gphys/ep_flux'
|
11
|
+
require 'getopts' # to use option
|
12
|
+
|
13
|
+
include NumRu
|
14
|
+
include NMath
|
15
|
+
|
16
|
+
########################################################
|
17
|
+
######## Define Test Methods ########
|
18
|
+
|
19
|
+
## -----------------------------------------------------
|
20
|
+
# preparation GPhys objects for test
|
21
|
+
|
22
|
+
def gen_gphys__W_and_Temp_in_z_coordinate(na_u,na_v,na_w,na_t,
|
23
|
+
na_lon,na_lat,na_z)
|
24
|
+
## make GPhys
|
25
|
+
grid = make_grid_in_z(na_lon, na_lat, na_z)
|
26
|
+
gp_u = GPhys.new(grid, make_va_u( na_u ))
|
27
|
+
gp_v = GPhys.new(grid, make_va_v( na_v ))
|
28
|
+
gp_w = GPhys.new(grid, make_va_w( na_w ))
|
29
|
+
gp_t = GPhys.new(grid, make_va_t( na_t ))
|
30
|
+
return gp_u, gp_v, gp_w, gp_t
|
31
|
+
end
|
32
|
+
|
33
|
+
def gen_gphys__W_and_Temp_in_p_coordinate(na_u,na_v,na_w,na_t,
|
34
|
+
na_lon,na_lat,na_p)
|
35
|
+
## make GPhys
|
36
|
+
grid = make_grid_in_p(na_lon, na_lat, na_p)
|
37
|
+
gp_u = GPhys.new(grid, make_va_u( na_u ))
|
38
|
+
gp_v = GPhys.new(grid, make_va_v( na_v ))
|
39
|
+
gp_w = GPhys.new(grid, make_va_w( na_w ))
|
40
|
+
gp_t = GPhys.new(grid, make_va_t( na_t ))
|
41
|
+
return gp_u, gp_v, gp_w, gp_t
|
42
|
+
end
|
43
|
+
|
44
|
+
def gen_gphys__Omega_and_Theta_in_z_coordinate(na_u,na_v,na_omega,na_theta,
|
45
|
+
na_lon,na_lat,na_z)
|
46
|
+
## make GPhys
|
47
|
+
grid = make_grid_in_z(na_lon, na_lat, na_z)
|
48
|
+
gp_u = GPhys.new(grid, make_va_u( na_u ))
|
49
|
+
gp_v = GPhys.new(grid, make_va_v( na_v ))
|
50
|
+
gp_omega = GPhys.new(grid, make_va_omega( na_omega ))
|
51
|
+
gp_theta = GPhys.new(grid, make_va_theta( na_theta ))
|
52
|
+
return gp_u, gp_v, gp_omega, gp_theta
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
def make_grid_in_z(na_lon, na_lat, na_z)
|
57
|
+
va_lon = VArray.new( na_lon,
|
58
|
+
{"long_name"=>"longitude","units"=>"degrees"},
|
59
|
+
"lon" )
|
60
|
+
va_lat = VArray.new( na_lat,
|
61
|
+
{"long_name"=>"latitude","units"=>"degrees"},
|
62
|
+
"lat" )
|
63
|
+
va_z = VArray.new( na_z,
|
64
|
+
{"long_name"=>"altitude","units"=>"m"},
|
65
|
+
"alt" )
|
66
|
+
lon = Axis.new.set_pos(va_lon)
|
67
|
+
lat = Axis.new.set_pos(va_lat)
|
68
|
+
z = Axis.new.set_pos(va_z)
|
69
|
+
return Grid.new(lon, lat, z)
|
70
|
+
end
|
71
|
+
|
72
|
+
def make_grid_in_p(na_lon, na_lat, na_p)
|
73
|
+
va_lon = VArray.new( na_lon,
|
74
|
+
{"long_name"=>"longitude","units"=>"degrees"},
|
75
|
+
"lon" )
|
76
|
+
va_lat = VArray.new( na_lat,
|
77
|
+
{"long_name"=>"latitude","units"=>"degrees"},
|
78
|
+
"lat" )
|
79
|
+
va_p = VArray.new( na_p,
|
80
|
+
{"long_name"=>"pressure","units"=>"mb"},
|
81
|
+
"p" )
|
82
|
+
lon = Axis.new.set_pos(va_lon)
|
83
|
+
lat = Axis.new.set_pos(va_lat)
|
84
|
+
pres = Axis.new.set_pos(va_p)
|
85
|
+
return Grid.new(lon, lat, pres)
|
86
|
+
end
|
87
|
+
|
88
|
+
def make_va_u( na_u )
|
89
|
+
VArray.new( na_u, {"long_name"=>"U","units"=>"m/s"}, "u" )
|
90
|
+
end
|
91
|
+
def make_va_v( na_v )
|
92
|
+
VArray.new( na_v, {"long_name"=>"V","units"=>"m/s"}, "v" )
|
93
|
+
end
|
94
|
+
def make_va_w( na_w )
|
95
|
+
VArray.new( na_w, {"long_name"=>"W","units"=>"m/s"}, "w" )
|
96
|
+
end
|
97
|
+
def make_va_omega( na_omega )
|
98
|
+
VArray.new( na_omega,
|
99
|
+
{"long_name"=>"Omega","units"=>"mb/s"}, "Omega" )
|
100
|
+
end
|
101
|
+
def make_va_t( na_t )
|
102
|
+
VArray.new( na_t, {"long_name"=>"T","units"=>"K"}, "t" )
|
103
|
+
end
|
104
|
+
def make_va_theta( na_theta )
|
105
|
+
VArray.new( na_theta,
|
106
|
+
{"long_name"=>"Theta","units"=>"K"}, "theta" )
|
107
|
+
end
|
108
|
+
|
109
|
+
def gen_na_lon(nlon)
|
110
|
+
NArray.float(nlon).indgen! / (nlon) * 360.0 # [0, ..., (360 - 1/nlon)]
|
111
|
+
end
|
112
|
+
def gen_na_lat(nlat)
|
113
|
+
NArray.float(nlat).indgen! / (nlat - 1) * 180.0 - 90.0 # [90, .., -90]
|
114
|
+
end
|
115
|
+
def gen_na_z1(nz)
|
116
|
+
NArray.sfloat(nz).indgen!/(nz-1)
|
117
|
+
end
|
118
|
+
def gen_na_z2(nz)
|
119
|
+
1000 * 10 ** (-NArray.float(nz).indgen!/(nz-1)) # [1000, .., 100]
|
120
|
+
end
|
121
|
+
|
122
|
+
## -----------------------------------------------------
|
123
|
+
# output method for error check
|
124
|
+
|
125
|
+
def print_error_ratio_max_and_mean(numerical_na, analytical_na)
|
126
|
+
error_ratio = ((numerical_na - analytical_na).abs / ( analytical_na.abs ).max)
|
127
|
+
print " error_ratio max,mean (for each alt):\n"
|
128
|
+
for k in 0...error_ratio.shape[1]
|
129
|
+
printf("%4s%10.5e%4s%10.5e%s", "", error_ratio[true,k,false].max(0),
|
130
|
+
"", error_ratio[true,k,false].mean(0), "\n")
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
|
135
|
+
## -----------------------------------------------------
|
136
|
+
# output method for attribute check
|
137
|
+
|
138
|
+
def show_attr(gp)
|
139
|
+
case gp.data.rank
|
140
|
+
when 1
|
141
|
+
fm = "%-15s%-20s%-10s%s"
|
142
|
+
printf(fm, " <attr_name>", "<data>", "<axis>", "\n")
|
143
|
+
printf(fm, " name", gp.data.name, gp.axis(0).pos.name, "\n")
|
144
|
+
gp.data.att_names.each{|nm|
|
145
|
+
printf(fm, " "+nm, gp.data.get_att(nm).to_s,
|
146
|
+
gp.axis(0).pos.get_att(nm).to_s, "\n")
|
147
|
+
}
|
148
|
+
when 2
|
149
|
+
fm = "%-15s%-20s%-10s%-10s%s"
|
150
|
+
printf(fm, " <attr_name>", "<data>", "<axis_y>", "<axis_z>", "\n")
|
151
|
+
printf(fm, " name", gp.data.name,
|
152
|
+
gp.axis(0).pos.name,
|
153
|
+
gp.axis(1).pos.name,"\n")
|
154
|
+
gp.data.att_names.each{|nm|
|
155
|
+
printf(fm, " "+nm, gp.data.get_att(nm).to_s,
|
156
|
+
gp.axis(0).pos.get_att(nm).to_s,
|
157
|
+
gp.axis(1).pos.get_att(nm).to_s, "\n")
|
158
|
+
}
|
159
|
+
when 3
|
160
|
+
fm = "%-15s%-20s%-10s%-10s%-10s%s"
|
161
|
+
printf(fm, " <attr_name>","<data>","<axis_x>","<axis_y>","<axis_z>", "\n")
|
162
|
+
printf(fm, " name", gp.data.name,
|
163
|
+
gp.axis(0).pos.name,
|
164
|
+
gp.axis(1).pos.name,
|
165
|
+
gp.axis(2).pos.name,"\n")
|
166
|
+
gp.data.att_names.each{|nm|
|
167
|
+
printf(fm, " "+nm, gp.data.get_att(nm).to_s,
|
168
|
+
gp.axis(0).pos.get_att(nm).to_s,
|
169
|
+
gp.axis(1).pos.get_att(nm).to_s,
|
170
|
+
gp.axis(2).pos.get_att(nm).to_s, "\n")
|
171
|
+
}
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
########################################################
|
176
|
+
######## Main Routine ########
|
177
|
+
|
178
|
+
|
179
|
+
#############
|
180
|
+
## check netCDF output flag
|
181
|
+
|
182
|
+
unless getopts('n')
|
183
|
+
print "#{$0}:illegal options. \n"
|
184
|
+
exit 1
|
185
|
+
end
|
186
|
+
if $OPT_n
|
187
|
+
nc_output_flag = true # output test variable as NetCDF.
|
188
|
+
else
|
189
|
+
nc_output_flag = false # not output NetCDF.
|
190
|
+
end
|
191
|
+
|
192
|
+
|
193
|
+
p "##############################################################"
|
194
|
+
p "#### << Section 1 -- test accesor method >> ####"
|
195
|
+
|
196
|
+
# get DEFAULT constants
|
197
|
+
default_h = GPhys::EP_Flux::scale_height
|
198
|
+
default_radius = GPhys::EP_Flux::radius
|
199
|
+
default_rot = GPhys::EP_Flux::rot_period
|
200
|
+
default_g = GPhys::EP_Flux::g_forces
|
201
|
+
default_p00 = GPhys::EP_Flux::p00
|
202
|
+
default_cp = GPhys::EP_Flux::cp
|
203
|
+
default_gas_const = GPhys::EP_Flux::gas_const
|
204
|
+
|
205
|
+
# set module constants
|
206
|
+
GPhys::EP_Flux::scale_height = UNumeric.new(1, "m")
|
207
|
+
GPhys::EP_Flux::radius = UNumeric.new(1, "")
|
208
|
+
GPhys::EP_Flux::rot_period = UNumeric.new(10, "rad/s")
|
209
|
+
GPhys::EP_Flux::g_forces = UNumeric.new(1, "m.s-2")
|
210
|
+
GPhys::EP_Flux::p00 = UNumeric.new(1, "Pa")
|
211
|
+
GPhys::EP_Flux::cp = UNumeric.new(1, "")
|
212
|
+
GPhys::EP_Flux::gas_const = UNumeric.new(1, "")
|
213
|
+
|
214
|
+
# get GIVEN constants
|
215
|
+
h = GPhys::EP_Flux::scale_height
|
216
|
+
radius = GPhys::EP_Flux::radius
|
217
|
+
rot = GPhys::EP_Flux::rot_period
|
218
|
+
g = GPhys::EP_Flux::g_forces
|
219
|
+
p00 = GPhys::EP_Flux::p00
|
220
|
+
cp = GPhys::EP_Flux::cp
|
221
|
+
gas_const = GPhys::EP_Flux::gas_const
|
222
|
+
|
223
|
+
# compare default and given values.
|
224
|
+
fm = "%-15s%15s%17s%s" # format of output
|
225
|
+
|
226
|
+
p "*********** compare default and given values ***********"
|
227
|
+
printf(fm, " <name>", "<default value>", "<given value>","\n")
|
228
|
+
printf(fm, " scale_height", default_h.to_s, h.to_s, "\n")
|
229
|
+
printf(fm, " radius", default_radius.to_s, radius.to_s, "\n")
|
230
|
+
printf(fm, " rot_period", default_rot.to_s, rot.to_s, "\n")
|
231
|
+
printf(fm, " g_forces", default_g.to_s, g.to_s, "\n")
|
232
|
+
printf(fm, " p00", default_p00.to_s, p00.to_s, "\n")
|
233
|
+
printf(fm, " cp", default_cp.to_s, cp.to_s, "\n")
|
234
|
+
printf(fm, " gas_const", default_gas_const.to_s, gas_const.to_s, "\n")
|
235
|
+
|
236
|
+
# test ((<set_constants>)) and ((<get_constants>))
|
237
|
+
GPhys::EP_Flux::set_constants(default_h, default_radius, default_rot,
|
238
|
+
default_g, default_p00, default_cp,
|
239
|
+
default_gas_const)
|
240
|
+
# clean up after tests (backto default values)
|
241
|
+
h, radius, rot, g, p00, cp, gas_const = GPhys::EP_Flux::get_constants
|
242
|
+
p "*** test ((<set_constants>)) and ((<get_constants>)) ***"
|
243
|
+
printf(fm, " <name>", "<set_constants>", "<get_constants>", "\n")
|
244
|
+
printf(fm, " scale_height", default_h.to_s, h.to_s, "\n")
|
245
|
+
printf(fm, " radius", default_radius.to_s, radius.to_s, "\n")
|
246
|
+
printf(fm, " rot_period", default_rot.to_s, rot.to_s, "\n")
|
247
|
+
printf(fm, " g_forces", default_g.to_s, g.to_s, "\n")
|
248
|
+
printf(fm, " p00", default_p00.to_s, p00.to_s, "\n")
|
249
|
+
printf(fm, " cp", default_cp.to_s, cp.to_s, "\n")
|
250
|
+
printf(fm, " gas_const", default_gas_const.to_s, gas_const.to_s, "\n")
|
251
|
+
|
252
|
+
|
253
|
+
p "##############################################################"
|
254
|
+
p "#### << Section 2 -- test deriv method >> ####"
|
255
|
+
|
256
|
+
# preparate for testdata
|
257
|
+
n = 21
|
258
|
+
x = exp(-NArray.sfloat(n).indgen!/(n-1)) # un-uniform grid
|
259
|
+
f = NArray.sfloat(n).indgen!
|
260
|
+
ax = Axis.new.set_pos( VArray.new( x ,
|
261
|
+
{"long_name"=>"longitude", "units"=>"rad"},
|
262
|
+
"lon" ))
|
263
|
+
data = VArray.new( f,
|
264
|
+
{"long_name"=>"temperature", "units"=>"K"},
|
265
|
+
"t" )
|
266
|
+
gp = GPhys.new(Grid.new(ax), data)
|
267
|
+
|
268
|
+
# threepoint_O2nd_deriv
|
269
|
+
dgp_dx = GPhys::EP_Flux::deriv(gp, 0)
|
270
|
+
dgp_dx2 = GPhys::Derivative::threepoint_O2nd_deriv(gp, 0)
|
271
|
+
show_attr(dgp_dx)
|
272
|
+
err = ( dgp_dx.data.val - dgp_dx2.data.val )
|
273
|
+
p err.abs.max
|
274
|
+
|
275
|
+
# cderiv
|
276
|
+
GPhys::EP_Flux::set_deriv_method('cderiv')
|
277
|
+
dgp_dx = GPhys::EP_Flux::deriv(gp, 0)
|
278
|
+
dgp_dx2 = GPhys::Derivative::cderiv(gp, 0)
|
279
|
+
show_attr(dgp_dx)
|
280
|
+
err = ( dgp_dx.data.val - dgp_dx2.data.val )
|
281
|
+
p err.abs.max
|
282
|
+
|
283
|
+
GPhys::EP_Flux::set_deriv_method('cderiv') # backto default method
|
284
|
+
|
285
|
+
p "##############################################################"
|
286
|
+
p "#### << Section 3 -- test calculate method >> ####"
|
287
|
+
|
288
|
+
############
|
289
|
+
## setup for making testdata
|
290
|
+
|
291
|
+
### constants
|
292
|
+
GPhys::EP_Flux::scale_height = UNumeric.new(1, "m")
|
293
|
+
GPhys::EP_Flux::radius = UNumeric.new(1, "m")
|
294
|
+
h, radius, rot, g, = GPhys::EP_Flux::get_constants
|
295
|
+
h = h.val; radius = radius.val; rot = rot.val
|
296
|
+
p00_Pa = GPhys::EP_Flux::p00.val
|
297
|
+
p00 = GPhys::EP_Flux::p00.convert( Units.new("mb") ).val
|
298
|
+
kappa = (GPhys::EP_Flux::gas_const / GPhys::EP_Flux::cp).val
|
299
|
+
|
300
|
+
### make NArray of axis
|
301
|
+
nlon = 100; nlat = 50; nz = 10
|
302
|
+
na_lon = gen_na_lon(nlon)
|
303
|
+
na_lat = gen_na_lat(nlat)
|
304
|
+
na_z = gen_na_z1(nz)
|
305
|
+
na_p = gen_na_z2(nz)
|
306
|
+
na_lambda = PI/180.0*na_lon # convert deg => rad
|
307
|
+
na_phi = PI/180.0*na_lat # convert deg => rad
|
308
|
+
### make NArray of data
|
309
|
+
# make axis term
|
310
|
+
to_3D = NArray.sfloat(nlon, nlat, nz).fill!(1.0)
|
311
|
+
|
312
|
+
sin_lambda = sin(na_lambda).reshape(nlon, 1, 1)
|
313
|
+
cos_phi = cos(na_phi).reshape(1, nlat, 1)
|
314
|
+
sin_phi = sin(na_phi).reshape(1, nlat, 1)
|
315
|
+
tan_phi = sin_phi/cos_phi
|
316
|
+
z = na_z.reshape(1, 1, nz)
|
317
|
+
p = na_p.reshape(1, 1, nz)
|
318
|
+
eddy = ( sin_lambda * cos_phi * to_3D) # common eddy term
|
319
|
+
|
320
|
+
# make each data na in z
|
321
|
+
na_u = 1.0 * eddy + 10 + z
|
322
|
+
na_v = 2.0 * eddy + 20
|
323
|
+
na_w = 3.0 * eddy + 30
|
324
|
+
na_t = 4.0 * eddy + 40
|
325
|
+
na_omega = ( 3.0 * eddy + 30 ) * -p00/h * exp(-z/h)
|
326
|
+
na_theta = ( 4.0 * eddy + 40 ) * exp(kappa*z/h)
|
327
|
+
|
328
|
+
# make each data na in p
|
329
|
+
na_u_p = 1.0 * eddy + 10 + p
|
330
|
+
na_v_p = na_v
|
331
|
+
na_w_p = na_w
|
332
|
+
na_t_p = na_t
|
333
|
+
|
334
|
+
|
335
|
+
p "--------------------------------------------------------------"
|
336
|
+
p "==== pattern 1: W, T in z-coordinate ===="
|
337
|
+
p "--------------------------------------------------------------"
|
338
|
+
|
339
|
+
# generate test GPhys objects.
|
340
|
+
gp_u, gp_v, gp_w, gp_t = \
|
341
|
+
gen_gphys__W_and_Temp_in_z_coordinate(na_u, na_v, na_w, na_t,
|
342
|
+
na_lon, na_lat, na_z)
|
343
|
+
|
344
|
+
# calculate EP Flux, etc.
|
345
|
+
( epflx_y, epflx_z, v_rmean, w_rmean, gp_lat, gp_z,
|
346
|
+
u_mean, theta_mean,
|
347
|
+
uv_dash, vt_dash, uw_dash, dtheta_dz) = \
|
348
|
+
GPhys::EP_Flux::ep_full_sphere(gp_u,gp_v,gp_w,gp_t,true)
|
349
|
+
|
350
|
+
# calculate EP Flux divergence
|
351
|
+
epflx_div = GPhys::EP_Flux::div_sphere(epflx_y, epflx_z)
|
352
|
+
|
353
|
+
# calculate Residual merdional mean circulation
|
354
|
+
strm_rmean = GPhys::EP_Flux::strm_rmean(v_rmean)
|
355
|
+
|
356
|
+
# analytical functions. (these are not smart code.)
|
357
|
+
f = 2*2*PI/rot*sin_phi
|
358
|
+
sig_cos3 = exp( -z/h )*cos_phi**3
|
359
|
+
avort = ( f + (10 + z)/radius*tan_phi )
|
360
|
+
epflx_y_ana = (sig_cos3 * ( h/(10.0*kappa) - 1 )).reshape(nlat,nz)
|
361
|
+
epflx_z_ana = (sig_cos3 * ( avort* h/(10.0*kappa) - 1.5 )).reshape(nlat,nz)
|
362
|
+
u_mean_ana = 10 + na_z.reshape(1,nz)
|
363
|
+
theta_mean_ana = 40 * exp(kappa*na_z.reshape(1,nz)/h)
|
364
|
+
uv_dash_ana = cos(na_phi.reshape(nlat, 1))**2
|
365
|
+
vt_dash_ana = 4* cos(na_phi.reshape(nlat, 1))**2 * exp(kappa*na_z.reshape(1,nz)/h)
|
366
|
+
uw_dash_ana = 1.5 * cos(na_phi.reshape(nlat, 1))**2
|
367
|
+
dtheta_dz_ana = 40 * kappa/h * exp(kappa*na_z.reshape(1,nz)/h)
|
368
|
+
epflx_div_ana = ( exp( -z/h )*(-4)*(cos_phi**2)*sin_phi/radius * ( h/(10.0*kappa) - 1 )).reshape(nlat,nz) \
|
369
|
+
- epflx_z_ana/h + (( exp( -z/h )*( cos_phi**2 *sin_phi) ) / radius * h/(10.0*kappa)).reshape(nlat,nz)
|
370
|
+
v_rmean_ana = 20 + cos(na_phi.reshape(nlat, 1))**2/10/kappa
|
371
|
+
w_rmean_ana = 30 + 3*h*cos(na_phi.reshape(nlat, 1))*sin(na_phi.reshape(nlat, 1))/10/radius/kappa
|
372
|
+
na_zp = p00_Pa*exp(-z/h).reshape(1, nz)
|
373
|
+
strm_rmean_ana = v_rmean_ana * 2 * PI * radius * cos(na_phi.reshape(nlat, 1)) * (na_zp - na_zp[-1])/g.val + v_rmean_ana[-1] * PI * radius * cos(na_phi.reshape(nlat, 1)) * na_zp[-1]/g.val
|
374
|
+
|
375
|
+
|
376
|
+
### check_precision_and_attribute
|
377
|
+
["epflx_y", "epflx_z", "v_rmean", "w_rmean", "u_mean", "theta_mean",
|
378
|
+
"uv_dash", "vt_dash", "uw_dash", "dtheta_dz", "epflx_div", "strm_rmean"].each { |gp_nm|
|
379
|
+
gp = eval(gp_nm) # ex. "epflx_y" => epflx_y
|
380
|
+
gp_ana = eval(gp_nm+"_ana") # ex. "epflx_y" => epflx_y_na
|
381
|
+
title = gp.data.get_att("long_name").to_s
|
382
|
+
p "***************** #{title} *****************"
|
383
|
+
show_attr(gp)
|
384
|
+
print_error_ratio_max_and_mean(gp.data.val, gp_ana)
|
385
|
+
}
|
386
|
+
|
387
|
+
p "--------------------------------------------------------------"
|
388
|
+
p "==== pattern 2: Omega, Theta in z-coordinate ===="
|
389
|
+
p "--------------------------------------------------------------"
|
390
|
+
|
391
|
+
gp_u, gp_v, gp_omega, gp_theta = \
|
392
|
+
gen_gphys__Omega_and_Theta_in_z_coordinate(na_u, na_v, na_omega, na_theta,
|
393
|
+
na_lon, na_lat, na_z)
|
394
|
+
( epflx_y, epflx_z, v_rmean, w_rmean, gp_lat, gp_z,
|
395
|
+
u_mean, theta_mean,
|
396
|
+
uv_dash, vt_dash, uw_dash, dtheta_dz) = \
|
397
|
+
GPhys::EP_Flux::ep_full_sphere(gp_u,gp_v,gp_omega,gp_theta,false)
|
398
|
+
|
399
|
+
epflx_div = GPhys::EP_Flux::div_sphere(epflx_y, epflx_z)
|
400
|
+
|
401
|
+
# calculate Residual merdional mean circulation
|
402
|
+
strm_rmean = GPhys::EP_Flux::strm_rmean(v_rmean)
|
403
|
+
|
404
|
+
## analytical functions
|
405
|
+
f = 2*2*PI/rot*sin_phi
|
406
|
+
sig_cos3 = exp( -z/h )*cos_phi**3
|
407
|
+
avort = ( f + (10 + z)/radius*tan_phi )
|
408
|
+
epflx_y_ana = (sig_cos3 * ( h/(10.0*kappa) - 1 )).reshape(nlat,nz)
|
409
|
+
epflx_z_ana = (sig_cos3 * ( avort* h/(10.0*kappa) - 1.5 )).reshape(nlat,nz)
|
410
|
+
u_mean_ana = 10 + na_z.reshape(1,nz)
|
411
|
+
theta_mean_ana = 40 * exp(kappa*na_z.reshape(1,nz)/h)
|
412
|
+
uv_dash_ana = cos(na_phi.reshape(nlat, 1))**2
|
413
|
+
vt_dash_ana = 4* cos(na_phi.reshape(nlat, 1))**2 * exp(kappa*na_z.reshape(1,nz)/h)
|
414
|
+
uw_dash_ana = 1.5 * cos(na_phi.reshape(nlat, 1))**2
|
415
|
+
dtheta_dz_ana = 40 * kappa/h * exp(kappa*na_z.reshape(1,nz)/h)
|
416
|
+
epflx_div_ana = ( exp( -z/h )*-4*cos_phi**2*sin_phi/radius * ( h/(10.0*kappa) - 1 )).reshape(nlat,nz) \
|
417
|
+
- epflx_z_ana/h + \
|
418
|
+
(( exp( -z/h )*(cos_phi**2 * sin_phi) ) /radius * h/(10.0*kappa)).reshape(nlat,nz)
|
419
|
+
v_rmean_ana = 20 + cos(na_phi.reshape(nlat, 1))**2/10/kappa
|
420
|
+
w_rmean_ana = 30 + 3*h*cos(na_phi.reshape(nlat, 1))*sin(na_phi.reshape(nlat, 1))/10/radius/kappa
|
421
|
+
na_zp = p00_Pa*exp(-z/h).reshape(1, nz)
|
422
|
+
#strm_rmean_ana = v_rmean_ana * 2 * PI * radius * cos(na_phi.reshape(nlat, 1)) * na_zp/g.val
|
423
|
+
strm_rmean_ana = v_rmean_ana * 2 * PI * radius * cos(na_phi.reshape(nlat, 1)) * (na_zp - na_zp[-1])/g.val + v_rmean_ana[-1] * PI * radius * cos(na_phi.reshape(nlat, 1)) * na_zp[-1]/g.val
|
424
|
+
|
425
|
+
### check_precision_and_attribute
|
426
|
+
["epflx_y", "epflx_z", "v_rmean", "w_rmean", "u_mean", "theta_mean",
|
427
|
+
"uv_dash", "vt_dash", "uw_dash", "dtheta_dz", "epflx_div", "strm_rmean"].each { |gp_nm|
|
428
|
+
gp = eval(gp_nm) # ex. "epflx_y" => epflx_y
|
429
|
+
gp_ana = eval(gp_nm+"_ana") # ex. "epflx_y" => epflx_y_na
|
430
|
+
title = gp.data.get_att("long_name").to_s
|
431
|
+
p "***************** #{title} *****************"
|
432
|
+
show_attr(gp)
|
433
|
+
print_error_ratio_max_and_mean(gp.data.val, gp_ana)
|
434
|
+
}
|
435
|
+
|
436
|
+
p "--------------------------------------------------------------"
|
437
|
+
p "==== pattern 3: W, T in p-coordinate ===="
|
438
|
+
p "--------------------------------------------------------------"
|
439
|
+
|
440
|
+
gp_u, gp_v, gp_w, gp_t = \
|
441
|
+
gen_gphys__W_and_Temp_in_p_coordinate(na_u_p, na_v_p, na_w_p, na_t_p,
|
442
|
+
na_lon, na_lat, na_p)
|
443
|
+
( epflx_y, epflx_z, v_rmean, w_rmean, gp_lat, gp_z,
|
444
|
+
u_mean, theta_mean,
|
445
|
+
uv_dash, vt_dash, uw_dash, dtheta_dz) = \
|
446
|
+
GPhys::EP_Flux::ep_full_sphere(gp_u,gp_v,gp_w,gp_t,true)
|
447
|
+
|
448
|
+
epflx_div = GPhys::EP_Flux::div_sphere(epflx_y, epflx_z)
|
449
|
+
# calculate Residual merdional mean circulation
|
450
|
+
strm_rmean = GPhys::EP_Flux::strm_rmean(v_rmean)
|
451
|
+
|
452
|
+
## analytical functions
|
453
|
+
f = 2*2*PI/rot*sin_phi
|
454
|
+
avort = ( f + (10 + p)/radius*tan_phi )
|
455
|
+
epflx_y_ana = (( p/p00 * cos_phi**3 ) * ( -p/(10.0*kappa) - 1 )).reshape(nlat,nz)
|
456
|
+
epflx_z_ana = (( p/p00 * cos_phi**3 ) * ( avort * h/(10.0*kappa) - 1.5 )).reshape(nlat,nz)
|
457
|
+
u_mean_ana = 10 + na_p.reshape(1,nz)
|
458
|
+
theta_mean_ana = ( 40 * (p00/na_p.reshape(1,nz))**kappa )
|
459
|
+
uv_dash_ana = cos(na_phi.reshape(nlat, 1))**2
|
460
|
+
vt_dash_ana = ( 4* cos(na_phi.reshape(nlat, 1))**2 * (p00/na_p.reshape(1,nz))**kappa ).reshape(nlat,nz)
|
461
|
+
uw_dash_ana = 1.5 * cos(na_phi.reshape(nlat, 1))**2
|
462
|
+
dtheta_dz_ana = theta_mean_ana / h * kappa
|
463
|
+
epflx_div_ana = ( p/p00*-4*cos_phi**2*sin_phi/radius * ( -p/(10.0*kappa) - 1 )).reshape(nlat,nz) - epflx_z_ana/h + \
|
464
|
+
((-p**2/p00/h*cos_phi**2 ) * ( sin_phi/radius ) * h/(10.0*kappa)).reshape(nlat,nz)
|
465
|
+
v_rmean_ana = 20 + cos(na_phi.reshape(nlat, 1))**2/10/kappa
|
466
|
+
w_rmean_ana = 30 + 3*h*cos(na_phi.reshape(nlat, 1))*sin(na_phi.reshape(nlat, 1))/10/radius/kappa
|
467
|
+
strm_rmean_ana = v_rmean_ana * 2 * PI * radius * cos(na_phi.reshape(nlat, 1)) * (na_p.reshape(1, nz) - na_p[-1])*100/g.val + v_rmean_ana[-1] * PI * radius * cos(na_phi.reshape(nlat, 1)) * na_p[-1]*100/g.val
|
468
|
+
|
469
|
+
### check_precision_and_attribute
|
470
|
+
["epflx_y", "epflx_z", "v_rmean", "w_rmean", "u_mean", "theta_mean",
|
471
|
+
"uv_dash", "vt_dash", "uw_dash", "dtheta_dz", "epflx_div", "strm_rmean"].each { |gp_nm|
|
472
|
+
gp = eval(gp_nm) # ex. "epflx_y" => epflx_y
|
473
|
+
gp_ana = eval(gp_nm+"_ana") # ex. "epflx_y" => epflx_y_na
|
474
|
+
title = gp.data.get_att("long_name").to_s
|
475
|
+
p "***************** #{title} *****************"
|
476
|
+
show_attr(gp)
|
477
|
+
print_error_ratio_max_and_mean(gp.data.val, gp_ana)
|
478
|
+
}
|
479
|
+
|
480
|
+
|
481
|
+
p "--------------------------------------------------------------"
|
482
|
+
p "==== pattern 4: check div_sphere with easy data ===="
|
483
|
+
p "--------------------------------------------------------------"
|
484
|
+
|
485
|
+
## make axis
|
486
|
+
nlat = 50; nz = 10
|
487
|
+
na_lat = NArray.float(nlat).indgen! / (nlat - 1) * 180.0 - 90.0 # [-90, .., 90]
|
488
|
+
p ( na_z = 1000 * (NArray.float(nz).indgen!/(nz-1)) ) # [1000, .., 100]
|
489
|
+
va_lat = VArray.new( na_lat,
|
490
|
+
{"long_name"=>"latitude","units"=>"degrees"},
|
491
|
+
"lat" )
|
492
|
+
va_z = VArray.new( na_z,
|
493
|
+
{"long_name"=>"alt","units"=>"m"},
|
494
|
+
"z" )
|
495
|
+
lat = Axis.new.set_pos(va_lat)
|
496
|
+
z = Axis.new.set_pos(va_z)
|
497
|
+
grid = Grid.new(lat, z)
|
498
|
+
|
499
|
+
## make data
|
500
|
+
na_phi = PI/180.0*na_lat
|
501
|
+
na_z1 = na_z.dup.fill(1.0)
|
502
|
+
na_f_phi = 1.0 * cos(na_phi.reshape(nlat, 1)) * (na_z1).reshape(1, nz)
|
503
|
+
na_f_z = 3.0 * na_z.newdim(0) * cos(na_phi).reshape(nlat, 1)
|
504
|
+
|
505
|
+
va_f_phi = VArray.new( na_f_phi,
|
506
|
+
{"long_name"=>"epflx_y","units"=>"m2.s-2"},
|
507
|
+
"epy" )
|
508
|
+
va_f_z = VArray.new( na_f_z,
|
509
|
+
{"long_name"=>"epflx_z","units"=>"m2.s-2"},
|
510
|
+
"epz" )
|
511
|
+
|
512
|
+
gp_f_phi = GPhys.new(grid, va_f_phi)
|
513
|
+
gp_f_z = GPhys.new(grid, va_f_z)
|
514
|
+
|
515
|
+
kappa = (GPhys::EP_Flux::gas_const / GPhys::EP_Flux::cp).val
|
516
|
+
p00 = GPhys::EP_Flux::p00
|
517
|
+
scale_height = GPhys::EP_Flux::scale_height
|
518
|
+
rot_period = GPhys::EP_Flux::rot_period
|
519
|
+
radius = GPhys::EP_Flux::radius
|
520
|
+
|
521
|
+
|
522
|
+
na_z = na_z.reshape(1, nz)
|
523
|
+
na_phi = na_phi.reshape(nlat, 1)
|
524
|
+
p "*** epflx_div ***"
|
525
|
+
epflx_div = GPhys::EP_Flux::div_sphere(gp_f_phi, gp_f_z)
|
526
|
+
epflx_div_ana = -2*sin(na_phi) + 3 * cos(na_phi)
|
527
|
+
|
528
|
+
### check divergence
|
529
|
+
title = epflx_div.data.get_att("long_name").to_s
|
530
|
+
p "***************** #{title} *****************"
|
531
|
+
show_attr(epflx_div)
|
532
|
+
print_error_ratio_max_and_mean(epflx_div.data.val, epflx_div_ana)
|
533
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "numru/gphys"
|
2
|
+
include NumRu
|
3
|
+
path = "../mltbit.dat"
|
4
|
+
mbio = MultibitIO.new("mltbit.dat")
|
5
|
+
|
6
|
+
10000.times{|i|
|
7
|
+
na = mbio.read2D(12, 15, 100,100, 1,9,2, 1,7,3, nil, nil,
|
8
|
+
nil, nil)
|
9
|
+
p(na) if i==0
|
10
|
+
na = mbio.read2D(12, 15, 100,100,
|
11
|
+
nil,nil,nil, 1,5,2, [0,5,3],nil, 0.1, 1000.0)
|
12
|
+
p(na) if i==0
|
13
|
+
|
14
|
+
na = mbio.read2D(12, 15, 100,100,
|
15
|
+
nil,nil,nil, nil,nil,nil, [0,5,3],[90,80,5], nil, nil)
|
16
|
+
p(na) if i==0
|
17
|
+
}
|
18
|
+
|
19
|
+
|
data/testdata/T.jan.ctl
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
DSET ^T.jan.dat
|
2
|
+
TITLE monthly longterm mean air temperature from the NCEP Reanalysis
|
3
|
+
OPTIONS BIG_ENDIAN YREV
|
4
|
+
UNDEF -9.96921E36
|
5
|
+
XDEF 36 LINEAR 0.0 10.0
|
6
|
+
YDEF 19 LINEAR -90.0 10.0
|
7
|
+
ZDEF 9 LEVELS
|
8
|
+
1000.0 850.0 600.0 400.0 250.0 150.0 70.0 30.0 10.0
|
9
|
+
TDEF 1 LINEAR 1JAN1999 1MO
|
10
|
+
VARS 1
|
11
|
+
T 9 99 Temperature degC
|
12
|
+
ENDVARS
|
data/testdata/T.jan.dat
ADDED
Binary file
|
data/testdata/T.jan.grib
ADDED
Binary file
|
data/testdata/T.jan.nc
ADDED
Binary file
|
Binary file
|
data/testdata/UV.jan.nc
ADDED
Binary file
|
Binary file
|