-
Notifications
You must be signed in to change notification settings - Fork 138
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
kinetic energy diagnostic mixes T and U variables for B grid #734
Comments
I see this in ice_diagnostics.F90. I assume what we need to do is compute work1 on either the T or U grid consistently? It seems like it would be better to compute the KE on the U grid, moving the T variables to the U grid? For the C grid, would we compute the "u" part of KE on the E face and the "v" part of KE on the N face then add them? Or is it better to just average the U,V to T and compute KE on T?
|
See also #663. I'm going to close that now as it seems redundant. |
Would this also address tasks in #655? Or are there still more things to do there. And if so, should I include them now? |
MPAS-Ocean also mixes cell-centered and vertex values in its diagnostic KE calculation. See https://github.com/E3SM-Project/E3SM/blob/master/components/mpas-ocean/src/shared/mpas_ocn_diagnostics.F. That code is pretty complicated, but I think the take-home point is that it uses velocities from all of the edges (with appropriate area weighting) around a cell to calculate a cell-centered value. Then it adds additional information from vertices, which are also calculated using the nearest edge velocities. I'm not sure we need the second step, but we could follow the guidance in the first step for getting a cell-centered value, and use that as the primary diagnostic. Would the diagnostic be needed at other cell locations? |
I do not think this fully addresses #655, but it might be close. We need to review the documentation and double-check that the diagnostics are all properly computed (if that's done, please check the box in #655). |
When we average velocity to T gridpoints for diagostics, should it be via an "S" or an "A" average? "S" just averages unmasked values. "A" averages all values including "0s" on land points. A quick test with a B-grid case, averaging velocity to the T grid with "S", leads to differences in KE of up to ~20% and rms ice speed of up to ~10%. Arctic seems to increase and Antarctic decreases which is also odd. That is surprisingly large all things considered. I don't think "A" will change the results all that much, it will just reduce velocity at the land boundary. Is 10-20% changes what we should expect by making this change?? Sample output from a few timesteps (< is original, > is new computation). Otherwise, all diagnostics, results, and restarts are bit-for-bit.
|
Hi Tony, I think we should use A averaging. When you say 'including "0s" on land points' you mean land-ocean boundary points that have have u,v=0 because of the boundary conditions? |
@JFLemieux73, correct. There are 0s on neighbor points because nothing is computed there. The "A" averaging includes those. The "S" averaging just averages points that are "active". I will switch to "A" averaging. This will reduce the averaged velocity near land boundaries, but otherwise will be the same. It will be interesting to see how this changes the values. |
Output with "A" mapping results (< is original same as above, > is with "A" averaging of u/v). This makes a relatively big difference. All values are now reduced, now up to 25% or even a bit more. I still find this surprising.
|
I think the differences come from the fact that you interpolate first and then calculate u2 + v2. I would try to calculate u2 + v2 first and then do the interpolation. |
u2 = u**2... |
How would averaging uu+vv work on the C-grid since u and v are at different locations? I think we want to compute uu and vv separately and map that then combine them? That should work fine for all grids. So the difference would be mapping u/v or mapping u2/v2. A quick test, averaging uu+vv for the B grid produces much closer results. This is not intuitive to me, interesting.
|
There is also a diagnostic for the maximum speed. Should that also be interpolated to the T grid? Currently, we are just evaluating them at the U, N, or E grid points, with the C grid incorrectly combining uvelE^2 + vvelN^2. I guess I'll interpolate the squared velocity to the T point here as well then taking the sqrt. |
For max ice speed, I'm averaging uu and vv to the T grid then adding them and taking the sqrt. For many timesteps, the max speed is reduced by a few percent. For some timesteps, the max speed is reduced by 20%. This is different than the ke or rms ice speed as it represents the value on one grid point, not aggregated over the grid. I think it makes sense that the max speed is reduced when interpolating and that the amount of reduction can vary over time quite a bit. Is this what we want or do we just want to leave it like it was. Some output (< old, > new),
|
I don't see the point of averaging in order to get a maximum ice speed diagnostic. Just use the raw data. |
Well, I guess the point is that u and v are in different locations on the C-grid, and speed needs both of them. What you're doing seems reasonable, and this is just a diagnostic... A true max would probably interpolate u values to v locations, calculate speed and take the max, then interpolate v values to u locations, calculate speed and take the max, then take the maximum of the two maxes. Not sure it's worth the trouble. |
I agree, I think max speed might as well be the raw data. For the C-grid, what you think about using
If you think we shouldn't do that, I'll do the u to v and v to u calculation as you propose. I do think we should either average all (B, C, CD) max speeds to the T grid or none (as much as possible) for some consistency. |
For the KE: |
I'm not going to argue for one implementation over another. Just let me know how you want me to do this and I will. |
I don't really like |
On KE, I guess I do feel interpolating U and V to the T grid then computing KE is more straight-forward to justify. |
Yes. Conceptually, if we wanted to sample KE anywhere in the domain (regardless of whether it's a cell center or a node or somewhere in between, or out in the real world), we would sample the u, v and m values from continuous fields and then calculate the KE. Like you say, interpolating squares or other mid-calculation quantities is harder to justify. |
I agree with this. We should interpolate u and v to the T point and then calculate KE. It is simpler like that. I was just trying to explain the differences between the new approach and the old one. Should we also simply get max speed from u and v interpolated at the T point? |
No description provided.
The text was updated successfully, but these errors were encountered: