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
heat_capacity array does not match dimensions of 2D state variable #106
Comments
Actually on deeper reflection, the heat capacity is per unit surface area so would always be the same at every point along the latitude axis. So it's not clear whether the array should be broadcast at all. |
Hi Brian, thanks for this wonderful tool and resource! I've been trying to setup a 1d model with latitudinally varying heat capacity and meridional moist diffusion but can't make it work. I think it's because the advection diffusion is expecting a constant |
Hmm, that's a use case that I don't remember ever seeing before. Can you post a code snippet that you represents what you're trying to do, and I can take a look at where it fails. |
Sure:
This throws the following error:
As I say, this might not be the best way to do this. I tried specifying |
Ok, I see. I don't think you're missing anything obvious. Seems like the problem arises in the Fixing this may require some interpolation mechanisms. Or some other deeper dive into the numerics of the diffusion solver. |
OK, I'll take a look - thanks! Presumably the diffusivity should be zero at the outermost boundaries (at the poles) so that interpolation on the internal bounds should work? |
There's no requirement that diffusivity be zero at boundaries. The boundary condition is set by the input argument |
As of climlab 0.7.3, when you initialize a 2D domain like this:
the result is
i.e. the
heat_capacity
array is not broadcast over the latitude dimension. This is causing some broadcasting problems, and may be connected to the 2D diffusive model issue in brian-rose/ClimateModeling_courseware#5The text was updated successfully, but these errors were encountered: