Add Omega horizontal pressure gradient tests#465
Conversation
|
This is build off of #464 so I will hold off a bit on asking for reviews and rebase once that (hopefully) goes in. |
|
This needs to be updated to not use the |
c5259f4 to
5edaee3
Compare
5edaee3 to
a385f6b
Compare
|
Updated
|
|
@xylar Thanks for pointing that out. Sounds good |
|
I'll add the submodule update tomorrow. Sorry I forgot to do that today. |
|
|
||
|
|
||
| class Reference(OceanIOStep): | ||
| r""" |
There was a problem hiding this comment.
| r""" | |
| """ |
There was a problem hiding this comment.
I'll check on this. There may be a math reason this needs to be a literal string rather than decoding the back-slashes.
There was a problem hiding this comment.
Ah, I didn't think of that
| - Omega RMS error versus reference (`omega_vs_reference.png`), including a | ||
| power-law fit and convergence slope, and | ||
| - Omega RMS difference versus Python initialization (`omega_vs_python.png`). |
There was a problem hiding this comment.
Can we provide more detail here to explain exactly what we're evaluating against? It's not immediately apparent to me why, in order to evaluate the pressure gradient tendency at the midpoint of edges given the T,S,layerThickness fields at the midpoint of cells, we choose as "truth" a 4th-order reconstruction given T,S,dTdx,dSdx at the midpoint of edges (not sure that I got all these details right, just trying to be specific about what details would be helpful). I realize that some of this info might be in the design doc but I think it would be good to include here or in the description section.
There was a problem hiding this comment.
Noted. I will try to do a better job of documenting this.
There was a problem hiding this comment.
I made major revisions to the docs. Hopefully, this is clarified. Please have a look if you have time.
a385f6b to
c613e45
Compare
c613e45 to
6681b49
Compare
For now, just creates initial conditions in each column, including specific volume.
The vertical coordinate is z-tilde, but the z-tilde at the sea floor has to be found iteratively such that the geometric water-column thickness is as expected
The analysis fails if errors exceed the thresholds or if the convergence rate is outside the expected range.
Limit the convergence analysis to 6 km and higher. Add absolute error threshold for situations where the HPGA is too small for the normalize error to be useful.
Add 0.5 km resolution and lower convergence fit to <= 4 km. Switch reference solution to higher res (0.25 km). Adjust convergence thresholds.
This makes the problem more numerically challenging.
Drop coarsest resolutions (16, 8, 6 km) and add more fine resolutions (1.5 and 0.75 km).
Flesh out the description of the reference and init implelmentaitons of the HPGF.
6681b49 to
9e83366
Compare
|
I'm rerunning the |
|
@xylar Thanks for expanding the docs. Unless I missed it, can you state that you are evaluating the pressure gradient at the one edge adjoining the two columns and that the x-axis is normal to that edge (or a similar corrected statement if I'm mistaken). |
|
@cbegeman, I'm trying my best to clarify this further:
Although I do keep flat z-tilde layers in 2 of the 3 tests, this is only true until we hit the bathymetry, which is flat in geometric height but not in z-tilde. The 3rd test has tilted layers and the gradient in computed along layer, not normal to the edge. |
|
I tried to create a figure illustrating the configuration but it was not really good enough to be helpful. I think a more cartoonish illustration might show the concepts but wouldn't be particularly true to the test. Happy to keep iterating. |
|
@cbegeman, thank you for pushing things to be better. |
sbrus89
left a comment
There was a problem hiding this comment.
I tested this by doing a local merge into main on pm-cpu. All tests pass with baseline comparisons to the current main except for the salinity_gradient test, which this PR adds to the omega_pr suite:
Polaris omega_pr suite
- Baseline workdir:
/global/homes/s/sbrus/scratch/polaris_constant_eos_omega_pr_baseline/ - Baseline build:
/global/homes/s/sbrus/scratch/polaris_constant_eos_omega_pr_baseline/build - PR build:
/global/homes/s/sbrus/scratch/polaris_add-two-column/build - PR workdir:
/global/homes/s/sbrus/scratch/polaris_add-two-column - Machine:
pm-cpu - Compiler:
gnu - Build type:
Release - Log: not found
- Result:
- Diffs (1 of 10):
ocean/horiz_press_grad/salinity_gradient
- Diffs (1 of 10):
|
Thanks for all your work on this @xylar! |
|
Thanks for reviewing and merging @sbrus89! |
This merge adds three
horiz_press_gradtests for the horizontal pressure-gradient acceleration (HPGA) in Omega:salinity_gradient- salinity varies horizontally; temperature varies only with depth and layer pseudo-thicknesses are uniformtemperature_gradient- temperature varies horizontally; salinity varies only with depth and layer pseudo-thicknesses are uniformztilde_gradient- pseudo-height of layers are sloped; temperature and salinity vary only with depth (thus, HPGA should be close to zero)The tests include :
referencestep that computes a high-fidelity reference solution (numerical quadrature in the vertical; a 4th-order gradient in the horizontal)initsteps at each of a list of horizontal and vertical resolutions that provide initial conditions and a Python implementation of the centered, 2nd-order HPGAforwardsteps at each resolution that just computes the HPGA (inNormalVelocityTend) in Omegaanalysisstep that checks the RMS difference between the Omega and Polaris centered HPGA (verification of the implementation) and plots the convergence of the HPGA with respect to the reference solution. Errors are raised if the Omega solution diverges too much from the Python implementation at any resolution or from the reference solution at the highest resolution. An error is also raised if the convergence rate is too poor.Checklist
api.md) has any new or modified class, method and/or functions listedTestingcomment in the PR documents testing used to verify the changes