Skip to content

bug fix for m_opt: fixed units of surface momentum flux#1214

Merged
kkeene44 merged 1 commit intowrf-model:release-v4.2.1from
matzegoebel:release-v4.2.1
Jul 15, 2020
Merged

bug fix for m_opt: fixed units of surface momentum flux#1214
kkeene44 merged 1 commit intowrf-model:release-v4.2.1from
matzegoebel:release-v4.2.1

Conversation

@matzegoebel
Copy link
Contributor

@matzegoebel matzegoebel commented Jun 19, 2020

TYPE: bug fix

KEYWORDS: m_opt, momentum flux

SOURCE: Matthias Göbel (University of Innsbruck)

DESCRIPTION OF CHANGES:
When outputting SGS momentum fluxes using the option m_opt, the units of the fluxes should be m2 s-2 according
to registry.les. The fluxes above the surface are divided by the density and thus have the correct units. The surface
fluxes, however, still contain the density.

This bug fix divides the surface fluxes by the density to obtain the correct units.

This change only affects the output of the SGS fluxes (nba_mij). The tendencies and thus the results are not changed.

LIST OF MODIFIED FILES:
dyn_em/module_diffusion_em.F

TESTS CONDUCTED:

  1. Jenkins OK

RELEASE NOTE: Fixed units of surface momentum flux in dyn_em/module_diffusion_em.F when using m_opt. This bug fix divides the surface fluxes by the density to obtain the correct units. This change only affects the output of the SGS fluxes (nba_mij). The tendencies and thus the results are not changed.

TYPE: bug fix

SOURCE: Matthias Göbel (UIBK)

DESCRIPTION OF CHANGES:
When outputting SGS momentum fluxes using the option m_opt, the units of the fluxes should be m2 s-2 according to the Registry.
The fluxes above the surface are divided by the density and thus have the correct units. The surface fluxes, however, still contain the density.
This bug fix divides the surface fluxes by the density to obtain the correct units.

LIST OF MODIFIED FILES:
dyn_em/module_diffusion_em.F

TESTS CONDUCTED:
1. Jenkins regression test OK
@davegill
Copy link
Contributor

@MATZE77 @weiwangncar @dudhia
When there are the introduction of new horizontal differences in algorithms, we must be concerned about boundary differences that would be caused by parallel communications. However, the d/dx and d/dy of rho already exists in those loops, so this is OK.

Copy link
Collaborator

@dudhia dudhia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we say that this is just an output change, not results?

@davegill
Copy link
Contributor

@dudhia
Jimy,
So these are entirely diagnostic?

@dudhia
Copy link
Collaborator

dudhia commented Jul 10, 2020 via email

@dudhia
Copy link
Collaborator

dudhia commented Jul 10, 2020 via email

@matzegoebel
Copy link
Contributor Author

@dudhia @davegill
yes, this change only affects the output of the SGS fluxes (nba_mij). The tendencies and thus the results are not changed.

@davegill
Copy link
Contributor

@dudhia @MATZE77
Jimy,
Are you OK with this PR now? Is there a test that you are requesting of Matthias?

@dudhia
Copy link
Collaborator

dudhia commented Jul 14, 2020 via email

@matzegoebel
Copy link
Contributor Author

In my opinion, a test is not strictly necessary. I thoroughly checked that nba_mij, which is modified by this PR, is not used later on in any tendency calculations. The tendency calculations are happening right before the location of the changes. Thus, I don't want to invest time in a test run. If you want to have it tested anyway, you would have to do it yourself, I'm afraid. Or you ask the developers of that sfs_opt option. They can probably judge this PR much better than I can.

@dudhia
Copy link
Collaborator

dudhia commented Jul 15, 2020 via email

@weiwangncar
Copy link
Collaborator

Should we contact the original contributor to check on this?

@dudhia
Copy link
Collaborator

dudhia commented Jul 15, 2020 via email

@dudhia
Copy link
Collaborator

dudhia commented Jul 15, 2020 via email

Copy link
Collaborator

@dudhia dudhia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only affects diagnostic output for m_opt=1.

@weiwangncar
Copy link
Collaborator

@dudhia I meant the original developer who contributed this option..

@dudhia
Copy link
Collaborator

dudhia commented Jul 15, 2020 via email

@weiwangncar
Copy link
Collaborator

@dudhia I have sent an email to Jeff, and let's see if we can get any response.

@kkeene44 kkeene44 merged commit 55da5ef into wrf-model:release-v4.2.1 Jul 15, 2020
davegill pushed a commit that referenced this pull request Feb 25, 2021
TYPE: bug fix

KEYWORDS: rho, sfs_opt, m_opt, cal_titau

SOURCE: Robert Arthur and Jeff Mirocha (LLNL)

DESCRIPTION OF CHANGES:
Problem:
In the cal_titau subroutines in module_diffusion_em, rho was not always interpolated to the correct location on the 
staggered grid. This issue affected the subgrid stress terms when sfs_opt .gt. 1. Additionally, when sfs_opt .eq. 0 and 
m_opt .eq. 1, the actual subgrid stresses applied in the code were correct, but the output was wrong. This is a 
follow-on from issue #1214 by @matzegoebel, which addressed the surface stress output from subroutine 
vertical_diffusion_2 when sfs_opt .gt. 0 or m_opt .eq. 1, but did not address the cal_titau subroutines.

Solution:
A rhoavg variable was added to cal_titau_12_21, cal_titau_13_31, and cal_titau_23_32 and used instead of the 
cell-centered rho variable. Additionally, because cal_titau_12_21 now uses "corner" ghost points for rho, a new 
halo/bc communication was added to solve_em.F to ensure that rho is specified correctly at those points. Correct 
specification of the corner points also requires the updates to subroutine set_physical_bc3d in #1314, included in 
the v4.2.2 release. Without the latter two updates for corner points, bit-for-bit errors occurred in regression tests for 
idealized, doubly-periodic domains.

LIST OF MODIFIED FILES: 
dyn_em/module_diffusion_em.F
dyn_em/solve_em.F
Registry/Registry.EM_COMMON

TESTS CONDUCTED:
1. Idealized, doubly-periodic tests with various processor breakdowns show bit-for-bit identical results.
2. Jenkins is all pass.

RELEASE NOTE: Bug fix to use correct rho value in cal_titau subroutines. In the cal_titau subroutines in module_diffusion_em, rho was not always interpolated to the correct location on the staggered grid. This issue affected the subgrid stress terms when sfs_opt .gt. 1. Additionally, when sfs_opt .eq. 0 and m_opt .eq. 1, the actual subgrid stresses applied in the code were correct, but the output was wrong. A rhoavg variable was added to cal_titau_12_21, cal_titau_13_31, and cal_titau_23_32 and used instead of the cell-centered rho variable.
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…1396)

TYPE: bug fix

KEYWORDS: rho, sfs_opt, m_opt, cal_titau

SOURCE: Robert Arthur and Jeff Mirocha (LLNL)

DESCRIPTION OF CHANGES:
Problem:
In the cal_titau subroutines in module_diffusion_em, rho was not always interpolated to the correct location on the 
staggered grid. This issue affected the subgrid stress terms when sfs_opt .gt. 1. Additionally, when sfs_opt .eq. 0 and 
m_opt .eq. 1, the actual subgrid stresses applied in the code were correct, but the output was wrong. This is a 
follow-on from issue wrf-model#1214 by @matzegoebel, which addressed the surface stress output from subroutine 
vertical_diffusion_2 when sfs_opt .gt. 0 or m_opt .eq. 1, but did not address the cal_titau subroutines.

Solution:
A rhoavg variable was added to cal_titau_12_21, cal_titau_13_31, and cal_titau_23_32 and used instead of the 
cell-centered rho variable. Additionally, because cal_titau_12_21 now uses "corner" ghost points for rho, a new 
halo/bc communication was added to solve_em.F to ensure that rho is specified correctly at those points. Correct 
specification of the corner points also requires the updates to subroutine set_physical_bc3d in wrf-model#1314, included in 
the v4.2.2 release. Without the latter two updates for corner points, bit-for-bit errors occurred in regression tests for 
idealized, doubly-periodic domains.

LIST OF MODIFIED FILES: 
dyn_em/module_diffusion_em.F
dyn_em/solve_em.F
Registry/Registry.EM_COMMON

TESTS CONDUCTED:
1. Idealized, doubly-periodic tests with various processor breakdowns show bit-for-bit identical results.
2. Jenkins is all pass.

RELEASE NOTE: Bug fix to use correct rho value in cal_titau subroutines. In the cal_titau subroutines in module_diffusion_em, rho was not always interpolated to the correct location on the staggered grid. This issue affected the subgrid stress terms when sfs_opt .gt. 1. Additionally, when sfs_opt .eq. 0 and m_opt .eq. 1, the actual subgrid stresses applied in the code were correct, but the output was wrong. A rhoavg variable was added to cal_titau_12_21, cal_titau_13_31, and cal_titau_23_32 and used instead of the cell-centered rho variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants