Implement P-star Vertical Coordinate#401
Implement P-star Vertical Coordinate#401brian-oneill wants to merge 13 commits intoE3SM-Project:developfrom
Conversation
Testing
Polaris
|
|
@brian-oneill, thanks for making these changes! I'll give this a look. But, in response to your question, yes, we want to read in |
xylar
left a comment
There was a problem hiding this comment.
@brian-oneill, this looks excellent to me. I just have two comments based on reviewing the code itself, both quite minor. I will go on to revising my Polaris branch with your (excellent) variable name change and make sure I see passing tests, the same as you.
| if (FieldName == OmegaStr) { | ||
| OldFieldName = "restingThickness"; | ||
| } |
There was a problem hiding this comment.
restingThickness is a geometric thickness, whereas RefPseudoThickness is obviously a pseudo-thickness. So I don't think we should allow any fallback if RefPseudoThickness is not present.
There was a problem hiding this comment.
In other words, we can just take out this fallback. Since refPseudoThickness will obviously not be found, we should be good.
There was a problem hiding this comment.
The immediate problem with removing the fallback is that the stream read will throw an error if one or the other isn't found. The mesh we use as ocean_test_mesh.ncin our ctests (https://web.lcrc.anl.gov/public/e3sm/inputdata/ocn/mpas-o/oQU240/ocean.QU.240km.151209.nc) doesn't have RefPseudoThickness. I could make the initialization just ignore the error if not found, but perhaps it's a good opportunity to just set up a dedicated Omega input mesh to point to in the quick start, as opposed to continuing reusing an old MPAS one.
There was a problem hiding this comment.
I'm working on making new files with today's date as a date stamp. I think we need these files to be fixed, rather than relying on the fallbacks.
There was a problem hiding this comment.
I just added new CTest meshes:
'ocean.QU.240km.omega_vars.260506.nc',
'PlanarPeriodic48x48.omega_vars.260506.nc',
'cosine_bell_icos480.omega_vars.260506.nc',
But those are only appropriate after the rename.
Let's leave this in for now and I'll take it out in #327
| int TracerTimeLevel, ///< [in] Time level | ||
| TimeInstant Time ///< [in] Time | ||
| TimeInstant Time, ///< [in] Time | ||
| TimeInterval ProjCoeff ///< [in] Time interval |
There was a problem hiding this comment.
The name ProjCoeff isn't particularly clear. Maybe documentation can take care of this but it would be helpful to me if you add a comment here and possibly also elsewhere where ProjCoeff has been added as a method argument indicating that it is a fractional time step dependent on the time stepper and used to compute movement of layer interfaces.
There was a problem hiding this comment.
@sbrus89 and I have found ProjCoeff to be a confusing name. Can we call it something related to time step or Dt?
There was a problem hiding this comment.
Yeah, wasn't quite sure what to name this one. Maybe AleDt, but if the interval ends up being useful for some other projected state calculation, I'd lean against using an ALE-specific name. Is ProjDt clear enough, provided I add a description like this to the argument list?
| TimeInterval ProjCoeff ///< [in] Time interval | |
| TimeInterval ProjDt ///< [in] Time interval for projection over the current time stepper stage |
There was a problem hiding this comment.
Yep, ProjDt together with your comment would do the tick for me.
|
Excellent! I'm also seeing that the Polaris
|
|
Oh, and after the docs get updated. Presumably the changes there won't be large. |
|
@brian-oneill, when you update the docs, could you take out or replace the references to |
|
@hyungyukang, can you check if this works with the overflow test case as part of a review here? |
|
@sbrus89, if it's feasible, we should test this with the baroclinic channel. |
| RKProj[0] = 1. / 2; | ||
| RKProj[1] = 1. / 2; | ||
| RKProj[2] = 1.; | ||
| RKProj[3] = 1.; |
There was a problem hiding this comment.
Could you comment (preferably in the code, but maybe here in the PR) on how these were derived?
There was a problem hiding this comment.
@xylar , I don’t see it in the current develop branch, and RKProj does not appear to be used anywhere in the RK4 time stepper. I’m not sure where it came from either. My guess is that it may have been introduced during a rebase from an older version?
There was a problem hiding this comment.
It is used in computing the vertical motion of the ALE coordinate. It is not in the time stepper, it is in the vertical advection (as Dt there).
There was a problem hiding this comment.
@xylar , Sorry, I confused myself there. I understand now. Thanks!
@brian-oneill , As Xylar requested, adding a comment there would help make the code easier to understand.
There was a problem hiding this comment.
These are the RKA coefficients shifted by 1 RK stage, so essentially the time interval over which the layer evolves from the old thickness to the projected thickness, which contributes to the transport velocity:
(projected thickness - old thickness) / ProjDt
MPAS-O uses the same coefficients in the RK4 time stepper for computing the ALE contribution to the vertical transport velocity.
There was a problem hiding this comment.
Sounds good. Can you add that comment in the code?
| const I4 K = KStart + KVec; | ||
| LocLayerThickTarget(ICell, K) = | ||
| LocRefLayerThick(ICell, K) * | ||
| LocRefPseudoThick(ICell, K) * |
There was a problem hiding this comment.
Does this imply that LocLayerThickTarget is actually in pseudo-thickness, not geometric thickness? If so, should we rename it LocPseudoThickTarget and should AleTerm above be using (LocThickTarget - PseudoThickness) or convert LocLayerThickTarget to geometric thickness?
There was a problem hiding this comment.
This is not the purpose of this PR. I will rename this in #327
There was a problem hiding this comment.
If we rename things other than *RefLayer* to *RefPseudo*, there will be essentially no end in what needs fixing.
There was a problem hiding this comment.
I took the initiative to rename RefLayer to RefPseudo specifically because the reference thickness is added to the initialization stream in this PR and I just felt uneasy keeping the name as is, since refLayerThickness exists as a distinct 1D field in the MPAS meshes we've been using for tests.
As for the ALE term, all these quantities are pseudo-thicknesses, and the vertical velocities we use in Omega are pseudo-velocities
There was a problem hiding this comment.
Thanks for clarifying. Good to know that it's all pseudothickness here.
@xylar (and anyone else): it looks like MPAS reads the movement weights from the mesh, but also the |
|
@mark-petersen, you might be best equipped to answer @brian-oneill's question. My feeling would be that we typically want to change |
|
@brian-oneill For what it's worth, I'm comfortable with you removing this option and only reading it in from the mesh. |
|
@sbrus89 and @hyungyukang, any update on how your testing is going on this? We need to keep this moving. |
@hyungyukang Let me know if you'd like me to test the overflow case. |
|
I'm just finalizing the baroclinic_channel branch in polaris. I'll report back soon. |
@hyungyukang, my understanding is that something should have changed. We are now calling: I don't see anything in your overflow configuration (https://github.com/E3SM-Project/polaris/pull/572/changes#diff-3b61ea3e604ca93614415174a1dc7c8844506c2d3052e119f26a56ac301e37aa) to explain why you wouldn't be seeing any differences. @brian-oneill, any guess why this isn't changing answers? |
|
@hyungyukang, the differences might be small. Have you verified that you're not seeing changes, or just that things look similar by eye? |
@xylar , thanks a lot for the explanations. It was just an eyeball comaprison. I will check the field differences of the overflow test between p* and z* and post here later. |
How are you getting z*? I don't think that's what Omega produces before this change, but I could be mistaken. Or do you mean z* from MPAS-Ocean? |
|
Some meshes like the QU240 mesh (including both the old one being used for ctests and the new ocean.QU.240km.omega_vars.260506.nc mesh with the newer omega variable names) have all movement weights equal 0. This leads to division by 0 in This doesn't seem intentional here, but I'm wondering what the desired behavior should be when this is encountered. Should a mesh with all zero movement weights be treated as a flag for an impermeable interfaces configuration and disable vertical transport? Or should initialization default to p* when invalid weights like this are read? Or just abort with an error? |

Changes include:
NVertLayersfromInitVertCoordstreamRefLayerThicknesstoRefPseudoThicknessto avoid conflation with MPAS fieldrefLayerThicknessRefPseudoThicknesstoInitVertCoordstreamIOStreamclasscomputeTargetThicknessmethod tocomputeMomVertAuxcomputeVerticalVelocityChecklist
Testingwith the following:have been run on and indicate that are all passing.
has passed, using the Polaris
e3sm_submodules/Omegabaseline-pfor both the baseline (Polarise3sm_submodules/Omega) and the PR buildFixes #391