-
Notifications
You must be signed in to change notification settings - Fork 64
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
Streaming Filter #772
Streaming Filter #772
Conversation
Also, while working on this PR, I encountered an issue (#773) related to creating restart files, which seems to be a bug to me. |
5428fab
to
70f8687
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #772 +/- ##
============================================
+ Coverage 36.67% 37.19% +0.51%
============================================
Files 278 288 +10
Lines 84300 85269 +969
Branches 15877 16020 +143
============================================
+ Hits 30921 31715 +794
- Misses 47549 47609 +60
- Partials 5830 5945 +115 ☔ View full report in Codecov by Sentry. |
70f8687
to
ec33cf6
Compare
I have examined the code in this PR, and overall it looks sensible. However, I do not see where the filtered velocities are being used, either to change the model state or as output. Is this the first of several steps to implement and use the filters, or is there something that I am missing about this PR? |
Yes, another PR of frequency-dependent internal wave drag will follow once this is approved and merged. However, I think there is a potential problem with defining the additional dimensions in the restarting files (#773). It would be great if you could take a look at it, @Hallberg-NOAA. I also want to add the restarting capability to the harmonic analysis module, but it might be a good idea to do so after this issue is fixed. |
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.
Thank you for the explanation of how this PR fits into the broader development of diagnostics of the tidal and de-tided velocities, for example. Before accepting this, though, I have added a handful of specific suggestions for added comments that I would have found helpful in making sense of the code more quickly and for some minor code changes for efficiency and parsimoniousness. In each case, I leave the decision about whether to accept these suggestions up to you, and I will be happy to accept this PR once you have had a chance to respond to or accept each of the specific suggestions.
For the future changes building on this PR, I think that it would be worthwhile to consider whether it might be more useful to diagnose the tidal velocities at the end of the predictor step call to btstep()
rather than at the start of the corrector step call. This would require some additional refactoring, but I think that it would help to line up the filtered velocities and other fields in time with the unfiltered velocities at the time when we usually diagnose them.
I guess it depends on the application. For de-tiding, placing the |
ec33cf6
to
8761d17
Compare
8761d17
to
2a78ee6
Compare
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.
This is getting closer, but I would still consider the condition for the return
from Filt_accum()
, as I noted in the updated comment. Please either return
if dt <= 0.0
(or the equivalent) or explain why that is not the right thing to do.
The filters and their target frequencies are no longer hard-coded. Instead, multiple filters with tidal or arbitrary frequencies as their target frequencies can be turned on. The filter names are specified in MOM_input and must consist of two letters/numbers. If the name of a filter is the same as the name of a tidal constituent, then the corresponding tidal frequency will be used as its target frequency. Otherwise, the user must specify the target frequency by "FILTER_${FILTER_NAME}_OMEGA" in MOM_input. The restarting capability has also been implemented. Because the filtering is a point-wise operation, all variables are considered as fields, even if they are velocity components.
2a78ee6
to
0c5bd2f
Compare
This has been fixed. |
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.
Thank you very much for this valuable contribution.
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26127 with the expected changes in entries in the MOM_parameter_doc files. There are two parameters ( |
This is a major revision to the original PR (#675) of the streaming band-pass filter.
The filters and their target frequencies are no longer hard-coded. Instead, multiple filters with tidal or arbitrary frequencies as their target frequencies can be turned on. The filter names are specified in MOM_input and must consist of two letters/numbers. If the name of a filter is the same as the name of a tidal constituent, then the corresponding tidal frequency will be used as its target frequency. Otherwise, the user must specify the target frequency. In either case, the target frequency is specified by "FILTER_${FILTER_NAME}_OMEGA".
The restarting capability has also been implemented. Because the filtering is a point-wise operation, all variables are considered as fields, even if they are velocity components.