implements the forcing class (wind only)#426
Conversation
|
There has been a call to rename the momentum-related AuxVars from |
|
waiting for omega_pr job 53810182 (set up using polaris/rename-wind) |
|
Update: Polaris
|
|
After the last commit (renaming), I simply did a build and ctest on pm-cpu (gnu). All pass. |
katsmith133
left a comment
There was a problem hiding this comment.
@alicebarthel I took a quick look at this and just had mostly clarification questions. I guess I am a bit confused that you've pulled the surface stress forcing out of the Aux stuff, but its still kind of an auxiliary variable? Can you explain why the partial move? Perhaps you've hashed this out with others, so sorry for the repetition.
Also, there is almost no commenting. I think it would be helpful to add commenting to the new files you've added and the new testing.
| @@ -1,24 +1,24 @@ | |||
| #ifndef OMEGA_AUX_WIND_H | |||
| #define OMEGA_AUX_WIND_H | |||
| #ifndef OMEGA_AUX_MOM_H | |||
There was a problem hiding this comment.
I thought we wanted to stay away from mom? Maybe this was skipped.
| Err += OmegaConfig->get(SfcStressConfig); | ||
|
|
||
| std::string SfcStressInterpTypeStr; | ||
| Err += SfcStressConfig.get("InterpType", SfcStressInterpTypeStr); |
There was a problem hiding this comment.
I assume the InterpType will stay the same for all forcing? Or rather if it doesn't this will be modified when those things are added?
There was a problem hiding this comment.
yes, at this stage, this interp is only used for the surface stress, not the other fluxes which are digested straight from the cell-centered values.
| @@ -0,0 +1,138 @@ | |||
| #include "Forcing.h" | |||
There was a problem hiding this comment.
A little bit of comments here like in AuxiliaryState.cpp would be good
There was a problem hiding this comment.
done, but let me know if you need more detail.
There was a problem hiding this comment.
I'm assuming that as we add more forcing this will become more generic?
There was a problem hiding this comment.
@katsmith133 What other kinds of stress forcing are you thinking we would add?
| @@ -0,0 +1,277 @@ | |||
| //===-- ocn/ForcingTest.cpp - Forcing Unit Test ---------------*- C++ -*-===// | |||
There was a problem hiding this comment.
Its not entirely clear to me why some of the testing is in AuxVars and some is here?
There was a problem hiding this comment.
Also, there is almost no commenting in this file. I would prefer if there were at least a little bit more. Helps to understand what you are trying to test and what the expected outcome is.
There was a problem hiding this comment.
@katsmith133 this was historical. Since the Stress was still in AuxVars, I had left the testing in AuxVars. I have now moved the SfcStress testing to the ForcingTest. That set-up is much cleaner now, thanks for your feedback!
|
Thanks @katsmith133 for your review. I can definitely add comments for clarification. |
|
@alicebarthel I noticed you have a polaris branch. Feel free to open the Polaris PR with the |
|
@cbegeman, my understanding is that's E3SM-Project/polaris#602. |
Thanks for pointing that out @xylar. Sorry, @alicebarthel, I didn't see the PR linked. |
There was a problem hiding this comment.
@katsmith133 What other kinds of stress forcing are you thinking we would add?
brian-oneill
left a comment
There was a problem hiding this comment.
I ran the ctests and omega_pr suite successfully on Frontier with craygnu and craygnu-mphipcc. Found a few other instances, mostly comments where might want to change "wind" to "surface stress".
My take on some of the other comments above:
- Instead of having the surface stress and other future forcing contributions mixed in with the other aux vars, maybe they should go in their own
forcingVarsdirectory. Or if there are just going to be a small number of them, they could just be defined inForcing.handForcing.cpp - A small header in
Forcing.handForcing.cpp, similar to what's in most other header/source files, along with some comments, go a long way towards making the code look cleaner and more readable.
| | TracerDiffOnCell | horizontal diffusion of thickness-weighted tracers | ||
| | TracerHyperDiffOnCell | biharmonic horizontal mixing of thickness-weighted tracers | ||
| | WindForcingOnEdge | forcing by wind stress, defined on edges | ||
| | SfcStressForcingOnEdge | forcing by wind stress, defined on edges |
There was a problem hiding this comment.
| | SfcStressForcingOnEdge | forcing by wind stress, defined on edges | |
| | SfcStressForcingOnEdge | forcing by surface stress, defined on edges |
There was a problem hiding this comment.
| "zonal surface stress", // long name/describe |
| // Meridional wind stress | ||
| auto MeridStressCellField = | ||
| Field::create(MeridStressCell.label(), // field name | ||
| "meridional wind stress", // long Name or description |
There was a problem hiding this comment.
| "meridional wind stress", // long Name or description | |
| "meridional surface stress", // long Name or description |
| @@ -620,23 +622,25 @@ void Tendencies::computeVelocityTendenciesOnly( | |||
| Pacer::stop("Tend:computeVelocityVAdvTend", 2); | |||
|
|
|||
| // Compute wind forcing | |||
There was a problem hiding this comment.
| // Compute wind forcing | |
| // Compute surface stress forcing |
| @@ -301,12 +301,12 @@ class VelocityHyperDiffOnEdge { | |||
| }; | |||
|
|
|||
| /// Wind forcing | |||
There was a problem hiding this comment.
| /// Wind forcing | |
| /// Surface stress forcing |
| SfcStressForcingOnEdge(const HorzMesh *Mesh, const VertCoord *VCoord); | ||
|
|
||
| /// The functor takes the edge index, vertical chunk index, and arrays for | ||
| /// normal wind stress and edge pseudo-thickness, outputs tendency array |
There was a problem hiding this comment.
| /// normal wind stress and edge pseudo-thickness, outputs tendency array | |
| /// normal surface stress and edge pseudo-thickness, outputs tendency array |
| Array2DReal ExactSfcStressForcing("ExactSfcStressForcing", Mesh->NEdgesOwned, | ||
| NVertLayers); | ||
|
|
||
| // Note: this computes wind forcing at every layer |
There was a problem hiding this comment.
| // Note: this computes wind forcing at every layer | |
| // Note: this computes surface stress forcing at every layer |
There was a problem hiding this comment.
I am less worried about the comments in the test - since in the test, we can just decide that our simple case only has wind forcing. But for clarity/consistency, I can change it here too.
| ExactSfcStressForcing, EdgeComponent::Normal, Geom, Mesh, | ||
| ExchangeHalos::No); | ||
|
|
||
| // Reset wind forcing to zero below the surface |
There was a problem hiding this comment.
| // Reset wind forcing to zero below the surface | |
| // Reset surface stress forcing to zero below the surface |
|
I think I have addressed all comments. |
|
of course I just noticed I forgot a couple of comment changes suggested by brian in the Tests... |
|
@alicebarthel, I'm seeing compile errors in the |
|
@sbrus89 I am sorry! I know I corrected these but somehow must have forgotten to push the changes. |
8049c5b to
94de041
Compare
|
I think this new version addresses all the comments. The design is a cleaner separation of ForcingVars outside of AuxiliaryVars. I mirrored the existence of a PLANE and SPHERE test for the forcing test (based on AuxiliaryVarsTest) to maintain the same test coverage of WindForcingAux-->SfcStressForcing. Currently, ctests:
|
Polaris
|
|
@mwarusz I was able to pass the testWindForcingAuxVars (moved to ForcingTest and renamed testSfcStressForcingVars) by following the structure in AuxiliaryVarsTest.cpp producing a SPHERE and PLANE test. Hopefully that was an ok plan? Could you review the test section to confirm? |
|
omega_pr on pm-gpu Polaris
|
|
@alicebarthel Is this PR expected to be BFB with develop for wind-forced tests? |
Polaris
|
Yes, I would hope so. The functions have been moved but the implementation should be the same. Let me know if it does not come out as BFB. |
|
@alicebarthel I didn't get a chance to check the velocity field of the |
|
@cbegeman can you share the path to the long forward? I can have a look at the outout. |
|
@alicebarthel I didn't have time to look at it before chrys went down so it would be best if you just ran it as setup with your latest suite on perlmutter. |
…fcStress Compute check
523ee23 to
362ae2e
Compare
sbrus89
left a comment
There was a problem hiding this comment.
I tested a local merge of this branch (in conjuction with a local merge of E3SM-Project/polaris#602) on Frontier with craygnu-mphipcc. Both the omega_pr suite and CTests pass.
Polaris omega_pr suite
- Baseline workdir:
/ccs/home/brus/run/polaris_omega_pr_baseline_craygnu-mphipcc_mpich - Baseline build:
/ccs/home/brus/run/polaris_omega_pr_baseline_craygnu-mphipcc_mpich/build - PR build:
/ccs/home/brus/run/polaris_forcing_class_omega_pr_craygnu-mphipcc_mpich/build - PR workdir:
/ccs/home/brus/run/polaris_forcing_class_omega_pr_craygnu-mphipcc_mpich - Machine:
frontier - Partition:
batch - Compiler:
craygnu-mphipcc - Build type:
Release - Log: not found
- Result: All tests passed
|
@alicebarthel, let me know when you're able to verify the state of the long_forward barotropic gyre case and I'll merge. |
|
@alicebarthel Thank you so much for taking the time to confirm the behavior! And for this very important development |

Adds the new Forcing class (with minimal changes).
Wind Forcing has been moved to the Forcing class and renamed a more general "SrfStress" to account for sea ice stress.
The docs have been updated accordingly.
The longer term vision is that Forcing will own 3 classes of AuxVars for momentum forcing, surface restoring, and surface tracer forcing. This PR is 1/3 to make #418 more digestible.
A key design question I'd like review on is the ownership/dependencies across AuxState vs Forcing.
I have moved all Forcing out of the AuxState (in the code and ctest). Instead, Forcing is initialized at the beginning of the timestep and used by tendencies directly.
Ultimately, the forcing compute will be called at the beginning of a coupling timestep.
The new/modified ctests include:
Checklist
has passed on pm-cpu, using the rename-wind Polaris branch