Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with wrf.interplevel desiredlev input #219

Open
yk519 opened this issue Nov 24, 2023 · 0 comments
Open

Problem with wrf.interplevel desiredlev input #219

yk519 opened this issue Nov 24, 2023 · 0 comments

Comments

@yk519
Copy link

yk519 commented Nov 24, 2023

Hello, I encountered a problem when trying to use a "for loop" to get a sequence of different interpolation planes.

So I have tried this line, which works fine:
p_certain_level = wrf.interplevel(p,z,2893.9905)

I can plot this to get:
image

I also have other different height values that I want to plot. So I write a list:
height = [588.0741, 1751.7858, 2893.9905, 4019.048, 5129.8022, 6228.1494, ... ]

Then I write the for loop:
for a in range(0,3): ## here i'm just trying the first three heights, not the whole list
ss = wrf.interplevel(p, z, float(height[a]))
print(ss)

This returns something like:
image

As you can see, there are a lot of nan in the printed array. I also tried to plot the result:
image

As you can see, the middle values are kept unchanged. However, the other values are all missing. I'm not sure what's happening that leads to interplevel method not working. I've tried a few times and believe this is related to list and numpy.array (both list and np.array are producing the same problem).

I've tried wrf.getvar, in which I use a "timeidx = blabla_list [3]", which turns out to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant