-
Notifications
You must be signed in to change notification settings - Fork 45
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
Remove self.gauss_weights and self.area_weights from GFSDynamicalCore? #53
Comments
These were kept for future use. These weights are needed to perform area averaged mean. So, if the user wants to calculate such a quantity, he/she will need these weights. They could also be provided by |
I'm unsure why there are both gauss_weights and area_weights - don't they both reflect the same thing? Instead of doing this, can I include latitude bounds in the grid output so that bounds[1:] - bounds[:-1] gives you the area weighting? It seems having this in the state and not on the GFS object is more appropriate, and that's the most appropriate way to store it in the state. |
yes, just area_weights should suffice. I just exposed both to give the user a choice if necessary. I suspect this quantity would be used fairly regularly, and therefore should be available by itself. I have no issues with it being available in state. With the new API to obtain the grid, it is probably easier to put this into state. There was no obvious way to do it earlier. |
OK, in that case we should use some sort of standard name that implies surface area at that grid coordinate. |
On the other hand, we should only put this in CliMT if you mean it would be "used fairly regularly" by CliMT itself. If the user is going to use area weights regularly, they are free to compute those from the latitude bounds and store them in the state themselves, and then use that as regularly as they like. We probably shouldn't include it because of the programming design principle that you only want to include the features necessary to meet your specs. We don't need to include this extra feature if our code never actually uses it and it's easy for users to do themselves when they need to. Having an extra state variable output by |
Especially because we need to consider the fact that a user might, for example, manually specify an irregular longitude grid. If we put in area_weights to the state, those weights would be incorrect when they modify the longitude grid. |
I'm still a little hazy on how grids are going to be handled in sympl 0.4, so I'm not sure what you mean that the user specifies the grid manually. My understanding was that there was some standard way to allowing the user to add grids and additional information (like area weights) to sympl, and this would get propagated to the model code that follows. If that is not the case, then for the moment, I would suggest leaving the area_weights attribute (maybe use underscores to warn the user not to use it) and add a helper function that returns the area weights given a dynamical core. We could worry about this at a later time. |
If you really think it's necessary, we should include a |
on the contrary, if someone runs the dycore and wants to analyse the output, it does not make sense that this information is not available easily. It has to be available easily, but I'm open about how it is made available. |
It will be available easily, since the latitude and longitude bounds will be present in |
guess I'm confused -- this code https://gist.github.com/ajdawson/b64d24dfac618b91974f seems to suggest calculating weights from latitudes is not as straightforward... |
Actually that code suggests it's quite straightforward. The latitude bounds are the cumulative sum of the weights, which is to say the weights are the distances between consecutive latitude bounds. |
Ah, no, you're right, it's not quite straightforward. Still, we should implement this using a Diagnostic. I'll include it in the set of initialization diagnostics, so that if you get_default_state using a component that needs area weighting it will include surface_area or area_weight or whatever in the state. |
yes, was just writing back saying the same! sounds good. |
The Python attributes
self.gauss_weights
andself.area_weights
on GFSDynamicalCore appear to never be used in CliMT. Can I remove them?The text was updated successfully, but these errors were encountered: