-
Notifications
You must be signed in to change notification settings - Fork 61
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
Frequency-dependent internal wave drag #722
Conversation
Utilizing streaming bandpass filters, the linear wave drag can now be applied to the M2 and K1 velocities independently, without affecting the broadband barotropic velocity fields.
Simplified the implementation by allowing both linear wave drag and frequency-dependent drag to be turned on at the same time.
4442466
to
2dbc361
Compare
8fbeaf3
to
398b79c
Compare
Minor update for performance optimization.
398b79c
to
c867191
Compare
I tested the new implementation and after a small bug fix, the results are identical as before. |
It looks to me the newly-added Following the same logic, I kind of wanted to open an discussion on whether BT solver would be the best place to house the calculation of
|
Thanks for the comments, but I think ideally, for better accuracy, the tidal velocities For my own configuration (one-layer, tide only model), the current implementation seems to work fine. But we should definitely keep this conversation open, as we might want to modify the implementation depending on the application. For example, in 3D models, we might want to apply the drag to certain layers instead of the barotropic velocity. And in simulations where the baroclinic time step is large, then the drag should be time-varying for each BT step. |
Bug fix for memory allocation of uninitialized tidal velocities.
src/core/MOM_barotropic.F90
Outdated
if (len_trim(m2_drag_u) > 0 .and. len_trim(m2_drag_v) > 0) then | ||
call MOM_read_data(wave_drag_file, m2_drag_u, CS%lin_drag_um2, G%Domain, & | ||
position=EAST_FACE, scale=m2_drag_scale*GV%m_to_H*US%T_to_s) | ||
call pass_var(CS%lin_drag_um2, G%Domain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing a separate pass_var for lin_drag_um2
and lin_drag_vm2
will result in fields that do not rotate properly and will be incorrect at a norther tripolar fold. Moreover, as these variables are at the u- and v-points, it is incorrect to use pass_var calls without a flag to indicate this, as that routine assumes by default that these variables are at the h-points. The correct thing to do here would be to replace the two pass_var()
calls at lines 5171 and 5175 with a single call to pass_vector(m2_drag_u, m2_drag_v, G%domain, direction=To_All+SCALAR_PAIR)
. The scalar pair here is because these are non-negative magnitudes and not components of a vector.
Similar changes should also be made to the pass_var()
calls on lines 5197 and 5201 in this PR, and also to the calls on lines 5131 and 5135 that were introduced with PR #703. There is no reason to add a flag to recover the previous answers, because they could not pass the rotational symmetry testing and hence are demonstrably wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. This has been corrected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the issues with the previous version of this PR have been addressed, but in re-examining the code, I believe that there is a problem with the separate pass_var()
calls for the u- and v- components of a staggered scalar field that appear in 3 places that should be corrected by replacing them with a call to pass_vector()
before this can be merged into the dev/gfdl branch of MOM6.
Bug fix related to pass_vector()
The streaming filter time advances a set of coupled ODEs, so its prognostic variables need to be in the restart file. This would likely be a separate pull request against MOM_streaming_filter.F90, but the restart capability needs to be in place before this request is merged. Look for register_restart_field to see what is needed, It would be useful to have diagnostic output of um2, vm2, uk1 and vk1. So far as I can tell, these would be like the existing id_ubt_st diagnostic. Similarly Drag_u and Drag_v diagnostics would be like id_ubtforce. |
I have created this PR (#772) that added the restart capability to the filter algorithm, as well as some other major changes. I'm going to close this PR and rewrite the code based on the latest version of |
Utilizing streaming bandpass filters, the linear wave drag can now be applied to the M2 and K1 velocities independently, without affecting the broadband barotropic velocity fields. This implementation would be particularly useful (and perhaps necessary) for correctly representing tides in climate simulations, because if the linear drag is applied to the broadband barotropic velocity, the low-frequency, non-tidal motions would also be damped.