forked from 3rdparty/wrf-python
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
585 B
25 lines
585 B
# Test snippet for f2py |
|
import numpy as np |
|
|
|
import wrf._wrffortran |
|
errlen = int(wrf._wrffortran.constants.errlen) |
|
|
|
a = np.ones((3, 3, 3)) |
|
b = np.zeros((3, 3, 3, 3)) |
|
c = np.zeros(errlen, "c") |
|
errstat = np.array(0) |
|
errmsg = np.zeros(errlen, "c") |
|
|
|
c[:] = "Test String" |
|
|
|
for i in xrange(2): |
|
outview = b[i, :] |
|
outview = outview.T |
|
q = wrf._wrffortran.testfunc(a, outview, c, errstat=errstat, |
|
errmsg=errmsg) |
|
print(errstat) |
|
|
|
|
|
str_bytes = (bytes(char).decode("utf-8") for char in errmsg[:]) |
|
print(repr(errmsg)) |
|
print("".join(str_bytes).strip())
|
|
|