diff --git a/wrf_open/var/ncl_reference/WRFUserARW.ncl b/wrf_open/ncl_reference/WRFUserARW.ncl similarity index 100% rename from wrf_open/var/ncl_reference/WRFUserARW.ncl rename to wrf_open/ncl_reference/WRFUserARW.ncl diff --git a/wrf_open/var/ncl_reference/WRF_contributed.ncl b/wrf_open/ncl_reference/WRF_contributed.ncl similarity index 100% rename from wrf_open/var/ncl_reference/WRF_contributed.ncl rename to wrf_open/ncl_reference/WRF_contributed.ncl diff --git a/wrf_open/var/ncl_reference/calc_uh.f90 b/wrf_open/ncl_reference/calc_uh.f90 similarity index 100% rename from wrf_open/var/ncl_reference/calc_uh.f90 rename to wrf_open/ncl_reference/calc_uh.f90 diff --git a/wrf_open/var/ncl_reference/eqthecalc.f b/wrf_open/ncl_reference/eqthecalc.f similarity index 100% rename from wrf_open/var/ncl_reference/eqthecalc.f rename to wrf_open/ncl_reference/eqthecalc.f diff --git a/wrf_open/var/ncl_reference/etaconv.py b/wrf_open/ncl_reference/etaconv.py similarity index 100% rename from wrf_open/var/ncl_reference/etaconv.py rename to wrf_open/ncl_reference/etaconv.py diff --git a/wrf_open/var/ncl_reference/psadilookup.dat b/wrf_open/ncl_reference/psadilookup.dat similarity index 100% rename from wrf_open/var/ncl_reference/psadilookup.dat rename to wrf_open/ncl_reference/psadilookup.dat diff --git a/wrf_open/var/ncl_reference/rcm2points.f b/wrf_open/ncl_reference/rcm2points.f similarity index 100% rename from wrf_open/var/ncl_reference/rcm2points.f rename to wrf_open/ncl_reference/rcm2points.f diff --git a/wrf_open/var/ncl_reference/rcm2rgrid.f b/wrf_open/ncl_reference/rcm2rgrid.f similarity index 100% rename from wrf_open/var/ncl_reference/rcm2rgrid.f rename to wrf_open/ncl_reference/rcm2rgrid.f diff --git a/wrf_open/var/ncl_reference/rcmW.c b/wrf_open/ncl_reference/rcmW.c similarity index 100% rename from wrf_open/var/ncl_reference/rcmW.c rename to wrf_open/ncl_reference/rcmW.c diff --git a/wrf_open/var/ncl_reference/rip_cape.f b/wrf_open/ncl_reference/rip_cape.f similarity index 100% rename from wrf_open/var/ncl_reference/rip_cape.f rename to wrf_open/ncl_reference/rip_cape.f diff --git a/wrf_open/var/ncl_reference/wrfW.c b/wrf_open/ncl_reference/wrfW.c similarity index 100% rename from wrf_open/var/ncl_reference/wrfW.c rename to wrf_open/ncl_reference/wrfW.c diff --git a/wrf_open/var/ncl_reference/wrf_bint3d.f b/wrf_open/ncl_reference/wrf_bint3d.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_bint3d.f rename to wrf_open/ncl_reference/wrf_bint3d.f diff --git a/wrf_open/var/ncl_reference/wrf_cloud_topW.c b/wrf_open/ncl_reference/wrf_cloud_topW.c similarity index 100% rename from wrf_open/var/ncl_reference/wrf_cloud_topW.c rename to wrf_open/ncl_reference/wrf_cloud_topW.c diff --git a/wrf_open/var/ncl_reference/wrf_fctt.f b/wrf_open/ncl_reference/wrf_fctt.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_fctt.f rename to wrf_open/ncl_reference/wrf_fctt.f diff --git a/wrf_open/var/ncl_reference/wrf_fddaobs_in.F b/wrf_open/ncl_reference/wrf_fddaobs_in.F similarity index 100% rename from wrf_open/var/ncl_reference/wrf_fddaobs_in.F rename to wrf_open/ncl_reference/wrf_fddaobs_in.F diff --git a/wrf_open/var/ncl_reference/wrf_pvo.f b/wrf_open/ncl_reference/wrf_pvo.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_pvo.f rename to wrf_open/ncl_reference/wrf_pvo.f diff --git a/wrf_open/var/ncl_reference/wrf_relhl.f b/wrf_open/ncl_reference/wrf_relhl.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_relhl.f rename to wrf_open/ncl_reference/wrf_relhl.f diff --git a/wrf_open/var/ncl_reference/wrf_rip_phys_routines.f b/wrf_open/ncl_reference/wrf_rip_phys_routines.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_rip_phys_routines.f rename to wrf_open/ncl_reference/wrf_rip_phys_routines.f diff --git a/wrf_open/var/ncl_reference/wrf_user.f b/wrf_open/ncl_reference/wrf_user.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_user.f rename to wrf_open/ncl_reference/wrf_user.f diff --git a/wrf_open/var/ncl_reference/wrf_user_dbz.f b/wrf_open/ncl_reference/wrf_user_dbz.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_user_dbz.f rename to wrf_open/ncl_reference/wrf_user_dbz.f diff --git a/wrf_open/var/ncl_reference/wrf_user_latlon_routines.f b/wrf_open/ncl_reference/wrf_user_latlon_routines.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_user_latlon_routines.f rename to wrf_open/ncl_reference/wrf_user_latlon_routines.f diff --git a/wrf_open/var/ncl_reference/wrf_vinterp.f b/wrf_open/ncl_reference/wrf_vinterp.f similarity index 100% rename from wrf_open/var/ncl_reference/wrf_vinterp.f rename to wrf_open/ncl_reference/wrf_vinterp.f diff --git a/wrf_open/var/ncl_reference/wrf_vinterpW.c b/wrf_open/ncl_reference/wrf_vinterpW.c similarity index 100% rename from wrf_open/var/ncl_reference/wrf_vinterpW.c rename to wrf_open/ncl_reference/wrf_vinterpW.c diff --git a/wrf_open/var/script/plot2d b/wrf_open/script/plot2d similarity index 100% rename from wrf_open/var/script/plot2d rename to wrf_open/script/plot2d diff --git a/wrf_open/var/script/somplot b/wrf_open/script/somplot similarity index 100% rename from wrf_open/var/script/somplot rename to wrf_open/script/somplot diff --git a/wrf_open/var/script/td_test.py b/wrf_open/script/td_test.py similarity index 100% rename from wrf_open/var/script/td_test.py rename to wrf_open/script/td_test.py diff --git a/wrf_open/var/script/wrftest.py b/wrf_open/script/wrftest.py similarity index 100% rename from wrf_open/var/script/wrftest.py rename to wrf_open/script/wrftest.py diff --git a/wrf_open/var/setup.py b/wrf_open/setup.py similarity index 52% rename from wrf_open/var/setup.py rename to wrf_open/setup.py index 8619331..ca9a716 100755 --- a/wrf_open/var/setup.py +++ b/wrf_open/setup.py @@ -2,23 +2,23 @@ import setuptools import numpy.distutils.core ext1 = numpy.distutils.core.Extension( - name = "wrf.var._wrfext", - sources = ["src/python/wrf/var/wrfext.f90", - "src/python/wrf/var/wrfext.pyf"] + name = "wrf._wrfext", + sources = ["src/python/wrf/wrfext.f90", + "src/python/wrf/wrfext.pyf"] ) ext2 = numpy.distutils.core.Extension( - name = "wrf.var._wrfcape", - sources = ["src/python/wrf/var/wrfcape.f90", - "src/python/wrf/var/wrfcape.pyf"] + name = "wrf._wrfcape", + sources = ["src/python/wrf/wrfcape.f90", + "src/python/wrf/wrfcape.pyf"] ) numpy.distutils.core.setup( - name = "wrf.var", + name = "wrf", version = "0.0.1", packages = setuptools.find_packages("src/python"), ext_modules = [ext1,ext2], package_dir={"":"src/python"}, - namespace_packages=["wrf"], + #namespace_packages=["wrf"], scripts=[], ) diff --git a/wrf_open/var/src/python/wrf/var/__init__.py b/wrf_open/src/python/wrf/__init__.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/__init__.py rename to wrf_open/src/python/wrf/__init__.py diff --git a/wrf_open/var/src/python/wrf/var/cape.py b/wrf_open/src/python/wrf/cape.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/cape.py rename to wrf_open/src/python/wrf/cape.py diff --git a/wrf_open/var/src/python/wrf/var/config.py b/wrf_open/src/python/wrf/config.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/config.py rename to wrf_open/src/python/wrf/config.py diff --git a/wrf_open/var/src/python/wrf/var/constants.py b/wrf_open/src/python/wrf/constants.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/constants.py rename to wrf_open/src/python/wrf/constants.py diff --git a/wrf_open/var/src/python/wrf/var/ctt.py b/wrf_open/src/python/wrf/ctt.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/ctt.py rename to wrf_open/src/python/wrf/ctt.py diff --git a/wrf_open/var/src/python/wrf/var/dbz.py b/wrf_open/src/python/wrf/dbz.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/dbz.py rename to wrf_open/src/python/wrf/dbz.py diff --git a/wrf_open/var/src/python/wrf/var/decorators.py b/wrf_open/src/python/wrf/decorators.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/decorators.py rename to wrf_open/src/python/wrf/decorators.py diff --git a/wrf_open/var/src/python/wrf/var/destag.py b/wrf_open/src/python/wrf/destag.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/destag.py rename to wrf_open/src/python/wrf/destag.py diff --git a/wrf_open/var/src/python/wrf/var/dewpoint.py b/wrf_open/src/python/wrf/dewpoint.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/dewpoint.py rename to wrf_open/src/python/wrf/dewpoint.py diff --git a/wrf_open/var/src/python/wrf/var/extension.py b/wrf_open/src/python/wrf/extension.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/extension.py rename to wrf_open/src/python/wrf/extension.py diff --git a/wrf_open/var/src/python/wrf/var/geoht.py b/wrf_open/src/python/wrf/geoht.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/geoht.py rename to wrf_open/src/python/wrf/geoht.py diff --git a/wrf_open/var/src/python/wrf/var/helicity.py b/wrf_open/src/python/wrf/helicity.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/helicity.py rename to wrf_open/src/python/wrf/helicity.py diff --git a/wrf_open/var/src/python/wrf/var/interp.py b/wrf_open/src/python/wrf/interp.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/interp.py rename to wrf_open/src/python/wrf/interp.py diff --git a/wrf_open/var/src/python/wrf/var/interputils.py b/wrf_open/src/python/wrf/interputils.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/interputils.py rename to wrf_open/src/python/wrf/interputils.py diff --git a/wrf_open/var/src/python/wrf/var/latlon.py b/wrf_open/src/python/wrf/latlon.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/latlon.py rename to wrf_open/src/python/wrf/latlon.py diff --git a/wrf_open/var/src/python/wrf/var/latlonutils.py b/wrf_open/src/python/wrf/latlonutils.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/latlonutils.py rename to wrf_open/src/python/wrf/latlonutils.py diff --git a/wrf_open/var/src/python/wrf/var/metadecorators.py b/wrf_open/src/python/wrf/metadecorators.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/metadecorators.py rename to wrf_open/src/python/wrf/metadecorators.py diff --git a/wrf_open/var/src/python/wrf/var/omega.py b/wrf_open/src/python/wrf/omega.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/omega.py rename to wrf_open/src/python/wrf/omega.py diff --git a/wrf_open/var/src/python/wrf/var/precip.py b/wrf_open/src/python/wrf/precip.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/precip.py rename to wrf_open/src/python/wrf/precip.py diff --git a/wrf_open/var/src/python/wrf/var/pressure.py b/wrf_open/src/python/wrf/pressure.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/pressure.py rename to wrf_open/src/python/wrf/pressure.py diff --git a/wrf_open/var/src/python/wrf/var/projection.py b/wrf_open/src/python/wrf/projection.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/projection.py rename to wrf_open/src/python/wrf/projection.py diff --git a/wrf_open/var/src/python/wrf/var/psadlookup.py b/wrf_open/src/python/wrf/psadlookup.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/psadlookup.py rename to wrf_open/src/python/wrf/psadlookup.py diff --git a/wrf_open/var/src/python/wrf/var/pw.py b/wrf_open/src/python/wrf/pw.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/pw.py rename to wrf_open/src/python/wrf/pw.py diff --git a/wrf_open/var/src/python/wrf/var/rh.py b/wrf_open/src/python/wrf/rh.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/rh.py rename to wrf_open/src/python/wrf/rh.py diff --git a/wrf_open/var/src/python/wrf/var/routines.py b/wrf_open/src/python/wrf/routines.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/routines.py rename to wrf_open/src/python/wrf/routines.py diff --git a/wrf_open/var/src/python/wrf/var/slp.py b/wrf_open/src/python/wrf/slp.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/slp.py rename to wrf_open/src/python/wrf/slp.py diff --git a/wrf_open/var/src/python/wrf/var/temp.py b/wrf_open/src/python/wrf/temp.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/temp.py rename to wrf_open/src/python/wrf/temp.py diff --git a/wrf_open/var/src/python/wrf/var/terrain.py b/wrf_open/src/python/wrf/terrain.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/terrain.py rename to wrf_open/src/python/wrf/terrain.py diff --git a/wrf_open/var/src/python/wrf/var/times.py b/wrf_open/src/python/wrf/times.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/times.py rename to wrf_open/src/python/wrf/times.py diff --git a/wrf_open/var/src/python/wrf/var/units.py b/wrf_open/src/python/wrf/units.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/units.py rename to wrf_open/src/python/wrf/units.py diff --git a/wrf_open/var/src/python/wrf/var/util.py b/wrf_open/src/python/wrf/util.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/util.py rename to wrf_open/src/python/wrf/util.py diff --git a/wrf_open/var/src/python/wrf/var/uvdecorator.py b/wrf_open/src/python/wrf/uvdecorator.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/uvdecorator.py rename to wrf_open/src/python/wrf/uvdecorator.py diff --git a/wrf_open/var/src/python/wrf/var/uvmet.py b/wrf_open/src/python/wrf/uvmet.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/uvmet.py rename to wrf_open/src/python/wrf/uvmet.py diff --git a/wrf_open/var/src/python/wrf/var/vorticity.py b/wrf_open/src/python/wrf/vorticity.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/vorticity.py rename to wrf_open/src/python/wrf/vorticity.py diff --git a/wrf_open/var/src/python/wrf/var/wind.py b/wrf_open/src/python/wrf/wind.py similarity index 100% rename from wrf_open/var/src/python/wrf/var/wind.py rename to wrf_open/src/python/wrf/wind.py diff --git a/wrf_open/var/src/python/wrf/var/wrfcape.f90 b/wrf_open/src/python/wrf/wrfcape.f90 similarity index 100% rename from wrf_open/var/src/python/wrf/var/wrfcape.f90 rename to wrf_open/src/python/wrf/wrfcape.f90 diff --git a/wrf_open/var/src/python/wrf/var/wrfcape.pyf b/wrf_open/src/python/wrf/wrfcape.pyf similarity index 100% rename from wrf_open/var/src/python/wrf/var/wrfcape.pyf rename to wrf_open/src/python/wrf/wrfcape.pyf diff --git a/wrf_open/var/src/python/wrf/var/wrfext.f90 b/wrf_open/src/python/wrf/wrfext.f90 similarity index 100% rename from wrf_open/var/src/python/wrf/var/wrfext.f90 rename to wrf_open/src/python/wrf/wrfext.f90 diff --git a/wrf_open/var/src/python/wrf/var/wrfext.pyf b/wrf_open/src/python/wrf/wrfext.pyf similarity index 100% rename from wrf_open/var/src/python/wrf/var/wrfext.pyf rename to wrf_open/src/python/wrf/wrfext.pyf diff --git a/wrf_open/var/src/python/wrf/var/wrfext2.f90.BAK b/wrf_open/src/python/wrf/wrfext2.f90.BAK similarity index 100% rename from wrf_open/var/src/python/wrf/var/wrfext2.f90.BAK rename to wrf_open/src/python/wrf/wrfext2.f90.BAK diff --git a/wrf_open/var/test/listBug.ncl b/wrf_open/test/listBug.ncl similarity index 100% rename from wrf_open/var/test/listBug.ncl rename to wrf_open/test/listBug.ncl diff --git a/wrf_open/var/test/ncl_get_var.ncl b/wrf_open/test/ncl_get_var.ncl similarity index 100% rename from wrf_open/var/test/ncl_get_var.ncl rename to wrf_open/test/ncl_get_var.ncl diff --git a/wrf_open/var/test/projtest.py b/wrf_open/test/projtest.py similarity index 100% rename from wrf_open/var/test/projtest.py rename to wrf_open/test/projtest.py diff --git a/wrf_open/var/test/snippet.py b/wrf_open/test/snippet.py similarity index 100% rename from wrf_open/var/test/snippet.py rename to wrf_open/test/snippet.py diff --git a/wrf_open/test/test_vinterp.ncl b/wrf_open/test/test_vinterp.ncl new file mode 100644 index 0000000..abb7fa6 --- /dev/null +++ b/wrf_open/test/test_vinterp.ncl @@ -0,0 +1,87 @@ + load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" + load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" + load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" + + in_files = (/"/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-28_00:00:00", \ + "/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-28_12:00:00", \ + "/Users/ladwig/Documents/wrf_files/wrf_vortex_multi/wrfout_d02_2005-08-29_00:00:00"/) + + input_file = addfiles(in_files, "r") + + timeidx = 6 + + ; 3D interpolation to new vertical coordinates + ; interp t to theta + fld1 = wrf_user_getvar(input_file, "tk", timeidx) + vert_coord = "theta" + ;interp_levels = (/200,300,500,1000/) + interp_levels = ispan(200,1000,50) + opts = True + opts@extrapolate = True + opts@field_type = "T" + opts@logP = True + opts@time = timeidx + + fld1_intrp = wrf_user_vert_interp(input_file,fld1,vert_coord,interp_levels,opts) + + printVarSummary(fld1_intrp) + + ; interp t to theta-e + fld2 = fld1 + vert_coord := "theta-e" + fld2_intrp = wrf_user_vert_interp(input_file,fld2,vert_coord,interp_levels,opts) + + printVarSummary(fld2_intrp) + + ; interp t to pressure + fld3 = fld1 + vert_coord := "pressure" + interp_levels := (/850,500/) + fld3_intrp = wrf_user_vert_interp(input_file,fld3,vert_coord,interp_levels,opts) + + printVarSummary(fld3_intrp) + + ; interp t to ght_msl + fld4 = fld1 + vert_coord := "ght_msl" + interp_levels := (/1,2/) + fld4_intrp = wrf_user_vert_interp(input_file,fld4,vert_coord,interp_levels,opts) + + printVarSummary(fld4_intrp) + + ; interp t to ght_agl + fld5 = fld1 + vert_coord := "ght_agl" + interp_levels := (/1,2/) + fld5_intrp = wrf_user_vert_interp(input_file,fld1,vert_coord,interp_levels,opts) + + printVarSummary(fld5_intrp) + + ; interp ht to pres + fld6 = wrf_user_getvar(input_file, "height", timeidx) + vert_coord := "pressure" + opts@field_type = "ght" + interp_levels := (/500,50/) + fld6_intrp = wrf_user_vert_interp(input_file,fld6,vert_coord,interp_levels,opts) + + printVarSummary(fld6_intrp) + + ; interp pres to theta + fld7 = wrf_user_getvar(input_file, "pressure", timeidx) + vert_coord := "theta" + opts@field_type = "pressure" + interp_levels := (/200,300,500,1000/) + fld7_intrp = wrf_user_vert_interp(input_file,fld7,vert_coord,interp_levels,opts) + + printVarSummary(fld7_intrp) + + ; interp theta-e to pressure + fld8 = wrf_user_getvar(input_file, "eth", timeidx) + vert_coord := "pressure" + opts@field_type = "T" + interp_levels := (/850,500,5/) + fld8_intrp = wrf_user_vert_interp(input_file,fld8,vert_coord,interp_levels,opts) + + printVarSummary(fld8_intrp) + + \ No newline at end of file diff --git a/wrf_open/var/test/utests.py b/wrf_open/test/utests.py similarity index 99% rename from wrf_open/var/test/utests.py rename to wrf_open/test/utests.py index 28a6eac..72b8376 100644 --- a/wrf_open/var/test/utests.py +++ b/wrf_open/test/utests.py @@ -104,7 +104,6 @@ def make_test(varname, wrf_in, referent, multi=False, repeat=3, pynio=False): my_vals = getvar(in_wrfnc, "temp", timeidx=timeidx, units="c") tol = 0 atol = .1 # Note: NCL uses 273.16 as conversion for some reason - print my_vals.shape, ref_vals.shape nt.assert_allclose(npvalues(my_vals), ref_vals, tol, atol) elif (varname == "pw"): my_vals = getvar(in_wrfnc, "pw", timeidx=timeidx) diff --git a/wrf_open/var/src/python/wrf/__init__.py b/wrf_open/var/src/python/wrf/__init__.py deleted file mode 100755 index d0ed2fc..0000000 --- a/wrf_open/var/src/python/wrf/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -try: - import pkg_resources - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - __path__ = pkgutil.extend_path(__path__, __name__) -