Skip to content
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

Add the Stokes Forces Implementation for the Surface Bands wave coupling method #205

Merged
merged 31 commits into from
Feb 3, 2022

Conversation

alperaltuntas
Copy link
Member

This PR adds the Stokes Forces implementation by @breichl and some additional refactoring and bug fixes.

The summary of Stokes Forces changes (@breichl):

  • Introduction of the stokes forces based on the 3d Stokes drift profile. The 3d Stokes drift profile is obtained via the partitioned Stokes drift components exported from WW3. The added forces are the duS/dt term, the updated pressure gradient force, and the the vorticity modifications. For the duS/dt term, the increment tendency is computed whenever the Stokes drift is updated. This term is applied on the dynamics time step. The pressure gradient force is being calculated outside of the model's pressure solver, and the Stokes-shear terms at cell centers and then integrating and taking gradients to estimate a pressure gradient tendency anomaly. This isn't the correct way of incorporating the pressure gradient force, so will be corrected soon.

The summary of refactorings and bugfixes (@alperaltuntas) :

  • Add the ability to import fields with ungridded dimensions in NUOPC cap.
  • Add a more flexible and concise way of exporting partitioned stokes drift components from WW3. This is based on utilizing the NUOPC ungridded dims feature. The new way of exporting these fields is encapsulated with if (cesm_coupled) checks. However, when the anticipated unification of EMC and NCAR WW3 nuopc caps is accomplished, the old way of exporting the partitioned stokes drift components may be removed to get rid of duplicate code.
  • Fixed the exact restart test failures by adding the 3d stokes drift field to the restart file. To do so, minor refactoring is done in wave_interface module and calling driver modules.
  • other bugfixes: remove unnecessary ampersands from variable declarations. enclose stokes vorticity diag computations with Stokes_VF conditional. Do not call get_Langmuir_Number if lamult is already provided via ww3. Fix openmp test by adding Stokes_VT to shr clause.

brandon.reichl and others added 21 commits May 21, 2021 12:29
- Add Craik-Leibovich terms, vorticity and dynamic pressure components.
- Add exploratory Stokes ddt version in MOM_wave_interface and MOM.F90
- Add tendency diagnostics for Stokes terms w/ control and option for diagnostic only Stokes force computation in MOM_CoriolisAdv.
- This only makes sense to add on the dynamics timestep.
With these changes, arbitrary number of of partitioned stokes drift components
may be imported from ww3 when coupled within cesm. After the planned unification
of ww3 nuopc caps of CESM and EMC, the old (fixed) approach may be removed.
profile to restart file when surfbands wave coupling mode is on.
add the optional waves_csp arg to initialize_MOM
calls so as to ensure that the waves_csp is allocated.
This commit also has several misc doxygen fixes.
in MOM_CoriolisAdv. Also remove the Passive_Stokes_VF
block since it's never set to true.
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2021

Codecov Report

Merging #205 (4f592f2) into dev/ncar (3d86e71) will decrease coverage by 0.05%.
The diff coverage is 12.50%.

Impacted file tree graph

@@             Coverage Diff              @@
##           dev/ncar     #205      +/-   ##
============================================
- Coverage     29.06%   29.01%   -0.06%     
============================================
  Files           237      237              
  Lines         71635    71842     +207     
============================================
+ Hits          20822    20845      +23     
- Misses        50813    50997     +184     
Impacted Files Coverage Δ
src/parameterizations/vertical/MOM_CVMix_KPP.F90 1.00% <0.00%> (ø)
src/user/MOM_wave_interface.F90 1.50% <5.19%> (+0.66%) ⬆️
src/core/MOM_dynamics_split_RK2.F90 59.46% <16.66%> (-1.62%) ⬇️
src/core/MOM_forcing_type.F90 47.25% <25.00%> (+0.02%) ⬆️
src/core/MOM.F90 58.88% <27.27%> (-0.13%) ⬇️
src/core/MOM_CoriolisAdv.F90 38.30% <28.26%> (-0.97%) ⬇️
config_src/drivers/solo_driver/MOM_driver.F90 68.20% <50.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d86e71...4f592f2. Read the comment docs.

brandon.reichl and others added 2 commits December 23, 2021 09:22
- Adding logical to prevent using terms if not allocated
- Adding optional diagnostic only output of term
- Moving time increment to within dynamics step instead of in main step MOOM loop.
- Correcting time tendency term to reflect time between Stokes drift updates and extent of dynamics time loop.
alperaltuntas and others added 6 commits December 23, 2021 13:24
- for ustkb and vstkb, call pass_var, instead of pass_vector because
they are on h grd.
-remove unused ustk0 and vstk0 arrays.
- correct the order of wave-related get param & allocate_forcing calls
in nuopc cap.
- add lamult flag to allocate_forcing_by_group because lamult should
only be allocated if wave_method=="EFACTOR".
- Replaces Stokes-induced pressure anomaly gradient routine with more accurate method that explicitly integrates the Stokes-shear force contribution to the pressure.  Includes diagnostics for the pressure anomaly to verify.
- Updates the Stokes time derivative to only be updated on dynamics time-steps.  Adds additional storage of previous step that is also only updated on the dynamics time-steps.
- Update so that the surface Stokes drift output when using the exponential surfbands option is the surface Stokes drift and not averaged over a layer near the surface.
- Minor rename for clarity in Update_Surface_Waves using data_override to clarify the time that wave terms are computed.
- Adds diagnostic tracking Stokes time tendency term for verification.
- Updates Stokes diagnostic names for conformity.
- Fix allocation of CS%STKy0 from u grid to v grid.
- The model's Coriolis/acceleration term was incorrect when the Stokes vortex form correction was in diagnostic mode.  The correct calculations are restored so it can be run in diagnostic mode and reproduce with the model when the setting is turned off entirely.
- The term us_x and us_y needed to be replaced with us_x_prev and us_y_prev to store the previous timestep Stokes drift in order to have reproducing code with restart files.
@alperaltuntas
Copy link
Member Author

@gustavo-marques this is ready to be tested and merged.

@gustavo-marques
Copy link
Collaborator

@alperaltuntas, I have verified that this PR does not change answers for the MOM6-examples test suit w.r.t. the latest main (9cb9304). Were you able to run the CESM tests?

@alperaltuntas
Copy link
Member Author

@gustavo-marques Yes, the aux_mom test suite passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants