GeezerVison is showing github.com — Added tests for wspd_wdir · Prajputphfi/wrf-python@b26cb37
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/ncl_get_var.ncl +16-14Lines changed: 16 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 32 | 32 | "geopt", "helicity", "lat", "lon", "omg", "p", "pressure", \ | 33 | 33 | "pvo", "pw", "rh2", "rh", "slp", "ter", "td2", "td", "tc", \ | 34 | 34 | "theta", "tk", "tv", "twb", "updraft_helicity", "ua", "va", \ | 35 | | - "wa", "uvmet10", "uvmet", "z", "cfrac", "height_agl" /] | | 35 | + "wa", "uvmet10", "uvmet", "z", "cfrac", "height_agl", \ | | 36 | + "wspd_wdir", "wspd_wdir10", "uvmet_wspd_wdir", \ | | 37 | + "uvmet10_wspd_wdir" /] | 36 | 38 |
| 37 | 39 | unique_dimname_list = NewList("fifo") | 38 | 40 | unique_dimsize_list = NewList("fifo") | | 87 | 89 | xopt@timeidx = time | 88 | 90 | xopt@linecoords = True | 89 | 91 |
| 90 | | - ht_vertcross1 = wrf_user_vertcross(z, p, pivot, xopt) | | 92 | + ht_vertcross1 = wrf_user_vert_cross(z, p, pivot, xopt) | 91 | 93 |
| 92 | 94 | fout->ht_vertcross1 = ht_vertcross1 | 93 | 95 |
| | 100 | 102 | xopt@timeidx = time | 101 | 103 | xopt@linecoords = True | 102 | 104 |
| 103 | | - ht_vertcross2 = wrf_user_vertcross(z, p, pivot, xopt) | | 105 | + ht_vertcross2 = wrf_user_vert_cross(z, p, pivot, xopt) | 104 | 106 | ht_vertcross2!1 = "vertical2" | 105 | 107 | ht_vertcross2!2 = "cross_line_idx2" | 106 | 108 |
| | 131 | 133 | xopt@linecoords = True | 132 | 134 | xopt@autolevels = 1000 | 133 | 135 |
| 134 | | - ht_vertcross3 = wrf_user_vertcross(z, p, start_end, xopt) | | 136 | + ht_vertcross3 = wrf_user_vert_cross(z, p, start_end, xopt) | 135 | 137 |
| 136 | 138 | ht_vertcross3!0 = "Time" | 137 | 139 | ht_vertcross3!1 = "vertical3" | | 150 | 152 | p_var := p(i,:,:,:) | 151 | 153 | z_var := z(i,:,:,:) | 152 | 154 |
| 153 | | - ht_vertcross := wrf_user_vertcross(z_var, p_var, start_end, xopt) | | 155 | + ht_vertcross := wrf_user_vert_cross(z_var, p_var, start_end, xopt) | 154 | 156 |
| 155 | 157 | dim0name = sprinti("vertical_t%i",i) | 156 | 158 | dim1name = sprinti("cross_line_idx_t%i",i) | | 190 | 192 | plev := 500. ; 500 MB | 191 | 193 | hlev := 5000 ; 5000 m | 192 | 194 |
| 193 | | - z2_500 = wrf_user_interplevel(z,p,plev,False) | 194 | | - p2_5000 = wrf_user_interplevel(p,z,hlev,False) | | 195 | + z2_500 = wrf_user_interp_level(z,p,plev,False) | | 196 | + p2_5000 = wrf_user_interp_level(p,z,hlev,False) | 195 | 197 |
| 196 | 198 | fout->z2_500 = z2_500 | 197 | 199 | fout->p2_5000 = p2_5000 | 198 | 200 |
| 199 | 201 |
| 200 | 202 | plev := (/1000., 850., 500., 250./) | 201 | 203 | hlev := (/500., 2500., 5000., 10000. /) | 202 | | - z2_multi = wrf_user_interplevel(z,p,plev,False) | 203 | | - p2_multi = wrf_user_interplevel(p,z,hlev,False) | | 204 | + z2_multi = wrf_user_interp_level(z,p,plev,False) | | 205 | + p2_multi = wrf_user_interp_level(p,z,hlev,False) | 204 | 206 |
| 205 | 207 | fout->z2_multi = z2_multi | 206 | 208 | fout->p2_multi = p2_multi | 207 | 209 |
| 208 | 210 | pblh = wrf_user_getvar(input_file, "PBLH", time) | 209 | 211 | opts := False | 210 | 212 | opts@inc2dlevs = True | 211 | | - p_lev2d = wrf_user_interplevel(p, z, pblh, opts) | | 213 | + p_lev2d = wrf_user_interp_level(p, z, pblh, opts) | 212 | 214 |
| 213 | 215 | fout->p_lev2d = p_lev2d | 214 | 216 |
| | 234 | 236 | xopt@timeidx = 0 | 235 | 237 | xopt@linecoords = True | 236 | 238 |
| 237 | | - t2_line2 = wrf_user_interpline(t2, pivot, xopt) | | 239 | + t2_line2 = wrf_user_interp_line(t2, pivot, xopt) | 238 | 240 |
| 239 | 241 | fout->t2_line2 = t2_line2 | 240 | 242 |
| | 257 | 259 | xopt@timeidx = 0 | 258 | 260 | xopt@linecoords = True | 259 | 261 |
| 260 | | - t2_line3 = wrf_user_interpline(t2, start_end, xopt) | | 262 | + t2_line3 = wrf_user_interp_line(t2, start_end, xopt) | 261 | 263 | t2_line3!1 = "line_idx_t2_line3" | 262 | 264 |
| 263 | 265 | fout->t2_line3 = t2_line3 | | 270 | 272 | name = sprinti("t2_line_t%i", i) | 271 | 273 | dim0name = sprinti("lineidx_t%i",i) | 272 | 274 | var := t2(i,:,:) | 273 | | - t2_line := wrf_user_interpline(var, start_end, xopt) | | 275 | + t2_line := wrf_user_interp_line(var, start_end, xopt) | 274 | 276 | t2_line!0 = dim0name | 275 | 277 | fout->$name$ = t2_line | 276 | 278 | end do | | 286 | 288 | xopt@timeidx = 0 | 287 | 289 | xopt@linecoords = True | 288 | 290 |
| 289 | | - t2_line4 = wrf_user_interpline(t2, start_end, xopt) | | 291 | + t2_line4 = wrf_user_interp_line(t2, start_end, xopt) | 290 | 292 | t2_line4!0 = "t2_line4_idx" | 291 | 293 |
| 292 | 294 | fout->t2_line4 = t2_line4 | |
Collapse file Copy file name to clipboardExpand all lines: test/utests.py +12-7Lines changed: 12 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -98,10 +98,13 @@ def test(self): | 98 | 98 | pass | 99 | 99 |
| 100 | 100 | # These have a left index that defines the product type | 101 | | - multiproduct = varname in ("uvmet", "uvmet10", "cape_2d", "cape_3d", | 102 | | - "cfrac") | 103 | | - multi2d = ("uvmet10", "cape_2d", "cfrac") | 104 | | - multi3d = ("uvmet", "cape_3d") | | 101 | + multiproduct = varname in ("uvmet", "uvmet10", "wspd_wdir", | | 102 | + "wspd_wdir10", "uvmet_wspd_wdir", | | 103 | + "uvmet10_wspd_wdir", | | 104 | + "cape_2d", "cape_3d", "cfrac") | | 105 | + multi2d = ("uvmet10", "wspd_wdir10", "uvmet10_wspd_wdir", | | 106 | + "cape_2d", "cfrac") | | 107 | + multi3d = ("uvmet", "wspd_wdir", "uvmet_wspd_wdir", "cape_3d") | 105 | 108 |
| 106 | 109 | # These varnames don't have NCL functions to test against | 107 | 110 | ignore_referent = ("zstag", "geopt_stag") | @@ -200,8 +203,9 @@ def _get_refvals(referent, varname, multi): | 200 | 203 | except: | 201 | 204 | pass | 202 | 205 |
| 203 | | - multi2d = ("uvmet10", "cape_2d", "cfrac") | 204 | | - multi3d = ("uvmet", "cape_3d") | | 206 | + multi2d = ("uvmet10", "wspd_wdir10", "uvmet10_wspd_wdir", | | 207 | + "cape_2d", "cfrac") | | 208 | + multi3d = ("uvmet", "wspd_wdir", "uvmet_wspd_wdir", "cape_3d") | 205 | 209 | interpline = ("t2_line","t2_line2", "t2_line3") | 206 | 210 |
| 207 | 211 | if not multi: | @@ -958,7 +962,8 @@ class WRFLatLonTest(ut.TestCase): | 958 | 962 | "pvo", "pw", "rh2", "rh", "slp", "ter", "td2", "td", "tc", | 959 | 963 | "theta", "tk", "tv", "twb", "updraft_helicity", "ua", "va", | 960 | 964 | "wa", "uvmet10", "uvmet", "z", "cfrac", "zstag", "geopt_stag", | 961 | | - "height_agl"] | | 965 | + "height_agl", "wspd_wdir", "wspd_wdir10", "uvmet_wspd_wdir", | | 966 | + "uvmet10_wspd_wdir"] | 962 | 967 | interp_methods = ["interplevel", "vertcross", "interpline", "vinterp"] | 963 | 968 | latlon_tests = ["xy", "ll"] | 964 | 969 |
| |
|