-
Notifications
You must be signed in to change notification settings - Fork 65
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 #815
base: dev/gfdl
Are you sure you want to change the base?
Conversation
Utilizing streaming band-pass filters, the frequency-dependent wave drag can be applied to the narrowband tidal velocities, instead of the broadband barotropic velocity. This allows internal wave drag to be optimized for different frequency bands independently, without affecting the low-frequency, non-tidal motions. Also fixed the bug that Filt_accum() does not return a valid output if it is called at the corrector step.
src/core/MOM_barotropic.F90
Outdated
enddo ; enddo | ||
else | ||
!$OMP do schedule(static) | ||
do J=jsv-1,jev ; do i=isv-1,iev+1 | ||
v_accel_bt(i,J) = v_accel_bt(i,J) + wt_accel(n) * (Cor_v(i,J) + PFv(i,J)) | ||
v_accel_bt(i,J) = v_accel_bt(i,J) + wt_accel(n) * (Cor_v(i,J) + PFv(i,J) - Drag_v(i,J)) |
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.
Please add parentheses to specify the order of arithmetic when 3 real variables are added. I would suggest revising the previous line to read v_accel_bt(i,J) = v_accel_bt(i,J) + wt_accel(n) * ((Cor_v(i,J) + PFv(i,J)) - Drag_v(i,J))
, with similar changes on lines 2177, 2253 and 2343.
else | ||
Drag_u(:,:) = 0.0 ; Drag_v(:,:) = 0.0 | ||
endif | ||
|
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.
Drag_u
and Drag_v
do not vary within the barotropic time stepping loops, so it would be mathematically equivalent and more efficient if these were incorporated into u_accel_bt
and v_accel_bt
outside of the barotropic time stepping loops. This revision should be done now because they will change answers at roundoff if it is done later.
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.
I'm not sure how to do this, because Drag_u
and Drag_v
need to be multiplied by wt_accel(n)
just like other forgings. Could you be more specific?
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.
So I removed Drag_u(:,:) = 0.0 ; Drag_v(:,:) = 0.0
here and inside the barotropic time stepping loops, Drag_u
and Drag_v
are added only if the frequency-dependent drag is used.
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.
In addition to the specific comments that I have attached to the relevant lines, we also need to figure out what is causing the doxygen testing to fail before we can accept this PR.
Unfortunately, the doxygen is failing with a segmentation fault and hence is not giving a good error message (see https://github.com/NOAA-GFDL/MOM6/actions/runs/12990322755/job/36293848717?pr=815) . Just based on when doxygen is failing, it appears to be something unusual in a comment in MOM_wave_drag.F90 or MOM_streaming_filter.F90, but I don't have better guidance than this.
Minor performance optimization. Also, this commit allows the filters to be activated without the frequency-dependent drag being activated.
888e16e
to
d9ee30c
Compare
Utilizing streaming band-pass filters, the frequency-dependent wave drag can be applied to the narrowband tidal velocities, instead of the broadband barotropic velocity. This allows internal wave drag to be optimized for different frequency bands independently, without affecting the low-frequency, non-tidal motions.
Also fixed the bug that Filt_accum() does not return a valid output if it is called at the corrector step.
This is the updated version of PR #722 and is implemented based on the latest code of dev/gfdl.