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

Nitpicking on internal tides source test #1149

Closed
raphaeldussin opened this issue Jun 29, 2020 · 3 comments · Fixed by #1448
Closed

Nitpicking on internal tides source test #1149

raphaeldussin opened this issue Jun 29, 2020 · 3 comments · Fixed by #1448
Assignees

Comments

@raphaeldussin
Copy link
Contributor

in https://github.com/NOAA-GFDL/MOM6/blob/d44e79b9b16310d0539352ab48bdd6dd941d8b94/src/parameterizations/vertical/MOM_internal_tide_input.F90#L129

should this be:

     if (time_end <= CS%time_max_source) then
       do j=js,je ; do i=is,ie
         ! Input  an arbitrary energy point source.id_
-        if (((G%geoLonCu(I-1,j)-CS%int_tide_source_x) * (G%geoLonBu(I,j)-CS%int_tide_source_x) <= 0.0) .and. &
-            ((G%geoLatCv(i,J-1)-CS%int_tide_source_y) * (G%geoLatCv(i,j)-CS%int_tide_source_y) <= 0.0)) then
+        if (((G%geoLonCu(I-1,j)-CS%int_tide_source_x) * (G%geoLonCu(I,j)-CS%int_tide_source_x) <= 0.0) .and. &
+            ((G%geoLatCv(i,J-1)-CS%int_tide_source_y) * (G%geoLatCv(i,J)-CS%int_tide_source_y) <= 0.0)) then
           itide%TKE_itidal_input(i,j) = 1.0*US%kg_m3_to_R*US%m_to_Z**3*US%T_to_s**3
         endif
       enddo ; enddo
@Hallberg-NOAA
Copy link
Collaborator

Yes, @raphaeldussin, your suggested changes are correct. There may, however, be a bigger algorithmic issue with the logic here on grids that are twisted from latitude-longitude, in that there might be no cells or two cells that satisfy the logic to contain the source. Such cases would be rare (if they could even occur), and this code is only for testing the internal wave propagation, so I would not expend much effort to fix this problem until it became urgent.

Please put in a pull request with this correction, or if you are planning to make other changes to this code, you might prefer to make a note of this correction and fix it with other changes in a larger pull request.

@raphaeldussin
Copy link
Contributor Author

I'm currently trying to figure out why using the tides source test does not change anything to my solution so there may be a bigger PR coming up

@raphaeldussin
Copy link
Contributor Author

one more potential issue here: https://github.com/NOAA-GFDL/MOM6/blob/d44e79b9b16310d0539352ab48bdd6dd941d8b94/src/parameterizations/vertical/MOM_internal_tide_input.F90#L143

@@ -140,7 +140,7 @@ subroutine set_int_tide_input(u, v, h, tv, fluxes, itide, dt, G, GV, US, CS)
                  scale=US%RZ3_T3_to_W_m2)
   endif

-  if (CS%id_TKE_itidal > 0) call post_data(CS%id_TKE_itidal, itide%TKE_itidal_input, CS%diag)
+  if (CS%id_TKE_itidal_input > 0) call post_data(CS%id_TKE_itidal_input, itide%TKE_itidal_input, CS%diag)
   if (CS%id_Nb > 0) call post_data(CS%id_Nb, itide%Nb, CS%diag)
   if (CS%id_N2_bot > 0 ) call post_data(CS%id_N2_bot, N2_bot, CS%diag)

marshallward added a commit that referenced this issue Aug 11, 2021
add option to prescribe internal wave generation site in grid indices, fixes #1149
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants