-
Notifications
You must be signed in to change notification settings - Fork 691
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
Avoid double staggering of ww in vertical advection of geopotential #1338
Conversation
@dudhia @weiwangncar |
also should bring in Bill Skamarock (github name?).
…On Tue, Dec 29, 2020 at 10:20 AM Dave Gill ***@***.***> wrote:
@dudhia <https://github.com/dudhia> @weiwangncar
<https://github.com/weiwangncar>
Folks,
Would you guys review this please
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77CQKVVTSEA4THQNNYTSXIFUTANCNFSM4U4X5IUQ>
.
|
I will say it looks OK and this discretization is not detailed in the ARW Tech Note, so nothing to modify there. |
@skamaroc Bill, can you take a look at this PR? Thanks! |
@matzegoebel can you indicate how much effect this has on results? Is it random noise or systematic in the diffs? |
Also would be helpful to show the change in discretization as an equation (not sure how but something like) |
@dudhia @matzegoebel |
I know github can do them, just don't know how, but I think Matthias does.
This would also be easier to show Bill who has not given his view yet,
Jimy
…On Tue, Jan 12, 2021 at 2:42 PM Dave Gill ***@***.***> wrote:
@dudhia <https://github.com/dudhia> @matzegoebel
<https://github.com/matzegoebel>
Jimy,
Of all of the WRF contributors, you have asked the right person to show
you the discretized equations!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77HXENH6263WXGGR6KDSZS643ANCNFSM4U4X5IUQ>
.
|
I updated the commit message to include the corresponding equations. |
Thanks for adding the equations. I was just thinking of an ncdiff plot to show a sample effect which would illustrate noise versus systematic change. If there is any evidence that the change does not introduce noise, that would be great too, since it now uses a less vertically averaged w. |
Initial feedback from Bill is that this should not go into a bug fix
release just in principle as it is not a bug, so let's
target this towards the develop branch for V4.3 while Bill thinks about it
further.
…On Wed, Jan 13, 2021 at 11:56 AM Matthias Göbel ***@***.***> wrote:
I'm not quite sure what you mean exactly. Here are instantaneous
time-height difference plots for different xy locations:
[image: pcolor_ph]
<https://user-images.githubusercontent.com/17001470/104490615-5820c300-55d1-11eb-834f-a3b9145fc63c.png>
I cannot really see much in there. Only that there is some feature at
bottom_top_stag=20 which is the boundary layer height.
And here is a kernel density estimation of the perturbation from the
xy-average for all data points:
[image: hist_all]
<https://user-images.githubusercontent.com/17001470/104495796-7a6a0f00-55d8-11eb-8900-4d0ad280eef5.png>
The distributions are almost identical, so I think there should not be
more noise (i.e. broader PDF) with the new version.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77DXXYVJND5NK26NLVLSZXUGXANCNFSM4U4X5IUQ>
.
|
I have moved this to a develop branch PR and removed the bug label |
Oh yes that's right, it's not actually a bug. I also changed the base branch of my PR. |
it's the em_les test case |
I see no problem there. Thanks.
…On Wed, Jan 20, 2021 at 8:02 AM Matthias Göbel ***@***.***> wrote:
it's the em_les test case
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77HT5WL3DZHMVAQLJL3S23WCBANCNFSM4U4X5IUQ>
.
|
@dudhia @weiwangncar @matzegoebel |
Good question. I don't think Bill has seen the noise-level plots yet
and we need to ping him on it.
…On Tue, Feb 9, 2021 at 2:03 PM Dave Gill ***@***.***> wrote:
@dudhia <https://github.com/dudhia> @weiwangncar
<https://github.com/weiwangncar> @matzegoebel
<https://github.com/matzegoebel>
Folks,
Is there a status on this yet? Matthias has provided about a zillion plots
and equations.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77G4SIMITPSHY7AVV7TS6GPLBANCNFSM4U4X5IUQ>
.
|
@matzegoebel I have heard back from Bill Skamarock who wants to be cautious but he is OK with this being added via a switch, so that people can test it more for themselves before we commit to it. I think a sample difference xy plot of fields at some time into the simulation may also be useful to post. Do you expect a random difference pattern in fields? |
ok sounds good. Shall I include the switch and add it to the user guide and tech notes or will someone else do this? What fields are you referring to? I would guess that the differences are random, but I'm not sure. |
Great if you can include the switch and add it to the README.namelist. We
can deal with
the other docs separately. Need to decide on a name and default setting.
A field like w and phi itself would be good to look at just some snapshots.
Maybe both
full fields and the diff posted together.
…On Thu, Feb 11, 2021 at 10:22 AM Matthias Göbel ***@***.***> wrote:
ok sounds good. Shall I include the switch and add it to the user guide
and tech notes or will someone else do this? What fields are you referring
to? I would guess that the differences are random, but I'm not sure.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77DZRVIZHAL2YWIIYULS6QG6VANCNFSM4U4X5IUQ>
.
|
With such random flows it is difficult, and a more steady flow like the 2d
hill case
may be more instructive to display this way if you can. Thanks.
…On Fri, Feb 12, 2021 at 1:44 AM Matthias Göbel ***@***.***> wrote:
I included a switch called phi_adv_z with default value 1 (original
formulation). Do you think that's an appropriate name?
Here are xy plots of phi perturbation and w after 1 hour integration at
k=5 (test case em_les again). Looks pretty random but that's hard to say
without an in-depth statistical analysis. Let me know if I can do anything
else.
[image: ph_xy]
<https://user-images.githubusercontent.com/17001470/107746603-64a25380-6d16-11eb-8663-20ae20cec7f8.png>
[image: w]
<https://user-images.githubusercontent.com/17001470/107746594-63712680-6d16-11eb-8efd-a3270b057462.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77AVB3ZXMLNZCVIHV3LS6TS7XANCNFSM4U4X5IUQ>
.
|
I also pushed the commit now that includes the switch |
Thanks, Matthias, that is interesting. 10% is fairly significant but your
idea seems reasonable.
PH shows fractionally less difference.
I am cc'ing Bill Skamarock.
Jimy
…On Mon, Feb 15, 2021 at 1:24 AM Matthias Göbel ***@***.***> wrote:
With such random flows it is difficult, and a more steady flow like the 2d
hill case may be more instructive to display this way
Yes, good point. Here are xz difference plots for the em_hill2d_x case (xy
plots don't make sense since it's 2D) after 10 hours. The updrafts and
downdrafts are about 10% stronger with the new version. This makes sense
since the new version employs less averaging for omega. So the modification
indeed has some systematic and non-negligible impact.
[image: PH_xz]
<https://user-images.githubusercontent.com/17001470/107921007-22734f00-6f6e-11eb-85c0-2a0bdfcc68a9.png>
[image: W_xz]
<https://user-images.githubusercontent.com/17001470/107921009-243d1280-6f6e-11eb-97d0-a897d2d78701.png>
:
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77EXJGZ2RO4ZVJMMYHLS7DK2JANCNFSM4U4X5IUQ>
.
|
@matzegoebel @dudhia |
Probably was run without damp_opt. Not a problem.
…On Mon, Feb 15, 2021 at 10:03 AM Dave Gill ***@***.***> wrote:
@matzegoebel <https://github.com/matzegoebel> @dudhia
<https://github.com/dudhia>
There is a blocky difference at the top of the atmosphere for both ph and
w, but more pronounced for ph. Since it is a difference, that points to
either the previous or current computation as problematic, correct?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77A2U5KOXB5KL2FVOBTS7FHV7ANCNFSM4U4X5IUQ>
.
|
The damping options for that case are: I also thought this looks suspicious. But I guess the damping is too weak to damp away all the waves leading to some strange behavior at the top? But I'm not so familiar with Rayleigh damping to really understand this. If Jimy says it's ok, then I guess it is. |
I don’t think it is a case of the new one being worse just different.
…On Mon, Feb 15, 2021 at 10:25 AM Matthias Göbel ***@***.***> wrote:
The damping options for that case are:
damp_opt = 3
zdamp = 20000. ( ztop = 30000.)
dampcoef = .1
I also thought this looks suspicious. But I guess the damping is too weak
to damp away all the waves leading to some strange behavior at the top? But
I'm not so familiar with Rayleigh damping to really understand this. If
Jimy says it's ok, then I guess it is.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77EBRPGGBIKG232ZPBLS7FKIHANCNFSM4U4X5IUQ>
.
|
This looks fine. The commit message needs to be updated with the addition of the phi_adv_z switch and extra modified files. The new method is 2 and the old one is 1. 1 remains the default. |
ok I updated the commit message. I also included the last two figures. |
@davegill will you add this option to the User Guide? |
@kkeene44 can this be done? This is new option phi_adv_z that was also in the release notes.
…On Wed, May 5, 2021 at 1:20 AM Matthias Göbel ***@***.***> wrote:
@davegill <https://github.com/davegill> will you add this option to the
User Guide?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77CPRZ6GKEHRL7HVT6LTMDWSFANCNFSM4U4X5IUQ>
.
|
@matzegoebel @dudhia We can add this in UG. |
…rf-model#1338) TYPE: enhancement KEYWORDS: geopotential,vertical advection SOURCE: Matthias Göbel (University of Innsbruck) DESCRIPTION OF CHANGES: The geopotential equation in WRF is formulated in the following (advective) form where staggering/destaggering is marked with overbars: <img src="https://latex.codecogs.com/svg.latex?\partial_{t}\phi^{\prime}+\mu_{d}^{-1}[m_{x}m_{y}\left(\overline{\overline{U}^\eta\:\delta_{x}\phi}^x+\overline{\overline{V}^\eta\:\delta_{y}\phi}^y\right)+m_{y}\overline{\overline{\Omega}^\eta\:\delta_{\eta}\phi}^\eta-m_{y}gW]=0" title="http://latex.codecogs.com/svg.latex?\partial_{t}\phi^{\prime}+\mu_{d}^{-1}[m_{x}m_{y}\left(\overline{\overline{U}^\eta\:\delta_{x}\phi}^x+\overline{\overline{V}^\eta\:\delta_{y}\phi}^y\right)+m_{y}\overline{\overline{\Omega}^\eta\:\delta_{\eta}\phi}^\eta-m_{y}gW]=0" /> The vertical advection term thus employs a double staggering of Omega. First, Omega is destaggered to mass levels and multiplied with the phi gradient. Then the product is staggered back to w-levels. This formulation is analogous to the horizontal terms, but the double averaging of Omega may introduce additional inaccuracies and is not necessary. The phi gradient can be first staggered to w-levels and then multiplied with the unaveraged Omega: <img src="https://latex.codecogs.com/svg.latex?\overline{\overline{\Omega}^\eta\:\delta_{\eta}\phi}^\eta\rightarrow\Omega\:\overline{\delta_{\eta}\phi}^\eta" /> For consistency and to avoid numerical instabilities, the same thing has to be done in the acoustic step. The new namelist option `phi_adv_z` allows switching between the two formulations: `phi_adv_z = 1`: old formulation (default) `phi_adv_z = 2`: new formulation LIST OF MODIFIED FILES: Registry/Registry.EM_COMMON dyn_em/module_big_step_utilities_em.F dyn_em/module_small_step_em.F run/README.namelist TESTS CONDUCTED: Idealized test cases em_les and em_hill2d_x. The vertical velocity is affected by the modification. Updrafts and downdrafts in the em_hill2d_x case become ~10% stronger with the new formulation: ![W_xz](https://user-images.githubusercontent.com/17001470/107921009-243d1280-6f6e-11eb-97d0-a897d2d78701.png) In the LES case stronger updrafts and downdrafts occur more frequently: ![hist_w](https://user-images.githubusercontent.com/17001470/108021629-3c209f00-701f-11eb-80c2-5640201690a0.png) I came across this issue when trying to transform advective components of temperature, humidity, and momentum into Cartesian form in a consistent way, using w for the vertical advection. Without the proposed modifications I could not close the budget, because the vertical advection of phi was not consistent with the vertical advection in the other budget equations. RELEASE NOTE: A new namelist option is included that allows a user to avoiding double stagger averaging of Omega in the vertical advection of geopotential. The new namelist option phi_adv_z allows switching between the two formulations: phi_adv_z = 1 (the old formulation, which remains the default), and phi_adv_z = 2 (the new formulation).
TYPE: enhancement
KEYWORDS: geopotential,vertical advection
SOURCE: Matthias Göbel (University of Innsbruck)
DESCRIPTION OF CHANGES:
The geopotential equation in WRF is formulated in the following (advective) form where staggering/destaggering is
marked with overbars:
The vertical advection term thus employs a double staggering of Omega. First, Omega is destaggered to mass levels
and multiplied with the phi gradient. Then the product is staggered back to w-levels. This formulation is analogous to the horizontal terms, but the double averaging of Omega may introduce additional inaccuracies and is not necessary.
The phi gradient can be first staggered to w-levels and then multiplied with the unaveraged Omega:
For consistency and to avoid numerical instabilities, the same thing has to be done in the acoustic step.
The new namelist option
phi_adv_z
allows switching between the two formulations:phi_adv_z = 1
: old formulation (default)phi_adv_z = 2
: new formulationLIST OF MODIFIED FILES:
Registry/Registry.EM_COMMON
dyn_em/module_big_step_utilities_em.F
dyn_em/module_small_step_em.F
run/README.namelist
TESTS CONDUCTED:
Idealized test cases em_les and em_hill2d_x.
The vertical velocity is affected by the modification. Updrafts and downdrafts in the em_hill2d_x case become ~10%
stronger with the new formulation:
In the LES case stronger updrafts and downdrafts occur more frequently:
I came across this issue when trying to transform advective components of temperature, humidity, and momentum into
Cartesian form in a consistent way, using w for the vertical advection. Without the proposed modifications I could not
close the budget, because the vertical advection of phi was not consistent with the vertical advection in the other budget
equations.
RELEASE NOTE: A new namelist option is included that allows a user to avoiding double stagger averaging of Omega in the vertical advection of geopotential. The new namelist option phi_adv_z allows switching between the two formulations: phi_adv_z = 1 (the old formulation, which remains the default), and phi_adv_z = 2 (the new formulation).