-
Notifications
You must be signed in to change notification settings - Fork 726
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
additional factor when converting surface heat fluxes from dry to moist theta #1259
additional factor when converting surface heat fluxes from dry to moist theta #1259
Conversation
…ry to moist theta
@skamaroc @dudhia @weiwangncar |
@davegill Send him an email, and he can view the PR. |
I checked and it is the same as Bill suggested. |
@MATZE77 @dudhia @weiwangncar |
@davegill |
This looks good to me. Especially appreciate hearing about the conservation aspect of this fix. |
@dudhia @weiwangncar @mgduda Example 2: Example 3: |
Pretty cool! |
@dudhia |
It's only a formality, but since the change affects all the isfflx options
and you
only tested one, we would like to see that the results from the other
options are
also affected in the expected way which I fully expect to be true given the
code.
Then you can add in your description that all isfflx options were tested.
Thanks,
Jimy
…On Mon, Aug 10, 2020 at 3:23 AM Matthias Göbel ***@***.***> wrote:
@dudhia <https://github.com/dudhia>
What do you mean with running a test case to fully check the change? What
exactly do you want to have tested/checked?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77BSEC5V27FJMM52ZB3R764C5ANCNFSM4PEOKCRQ>
.
|
1 similar comment
dyn_em/module_diffusion_em.F
Outdated
@@ -8044,6 +8050,9 @@ SUBROUTINE vertical_diffusion_implicit(ru_tendf, rv_tendf, rw_tendf, rt_tendf,& | |||
DO i = i_start, i_end | |||
nlflux_rho(i,k,j) = nlflux(i,k,j) * & | |||
(fnm(k)*rho (i,k,j)+fnp(k)*rho (i,k-1,j)) | |||
IF(config_flags%use_theta_m == 1)THEN | |||
nlflux_rho(i,k,j) = nlflux_rho(i,k,j)*(1.+rvovrd*moist(i,k,j,P_QV)) | |||
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.
I am not sure about this. Check if this can be done instead with the line that sets sflux(i,j) based on hfx.
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 should be equivalent. When looking at how the non-local flux is computed, you see that all terms that contribute are proportional to sflux (via the variables amf1, amf2, bmf2, hfxpbl):
WRF/dyn_em/module_diffusion_em.F
Lines 5206 to 5226 in 6d0090f
sflux0 = (a11+a12*sfcfracn)*sflux(i,j) | |
snlflux0 = nlfrac*sflux0 | |
amf1 = snlflux0/sfcfracn | |
amf2 = -snlflux0/(mlfrac-sfcfracn) | |
bmf2 = -mlfrac*amf2 | |
amf3 = snlflux0*enlfrac2(i,j)/deltaoh(i,j) | |
bmf3 = -amf3*mlfrac | |
hfxpbl(i,j) = amf3+bmf3 | |
pth1 = pthnl(delxy,hpbl(i,j)) | |
hfxpbl(i,j) = hfxpbl(i,j)*pth1 | |
DO k = kts, ktf | |
zfacmf(i,k,j) = max((zq(i,k+1,j)/hpbl(i,j)),zfmin) | |
IF(pblflg(i,j).and.k.LT.kpbl(i,j)) THEN | |
IF(zfacmf(i,k,j).LE.sfcfracn) THEN | |
nlflux(i,k,j) = amf1*zfacmf(i,k,j) | |
ELSE IF (zfacmf(i,k,j).LE.mlfrac) THEN | |
nlflux(i,k,j) = amf2*zfacmf(i,k,j)+bmf2 | |
ENDIF | |
nlflux(i,k,j) = nlflux(i,k,j) + hfxpbl(i,j)*exp(-entfacmf(i,k,j)) | |
nlflux(i,k,j) = nlflux(i,k,j)*pth1 |
I thought it would be more intuitive to view the non-local flux as being computed for dry theta and then convert it via the same equation derived in the initial PR message:
The water vapor flux term is dropped because there is no non-local water vapor flux in this scheme.
But if you still think it would be better/more readable to convert sflux instead, I can also do that.
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 added a general comment, but I will put one here too.
The nlflux terms are proportional to the surface heat flux, so it should be possible to just modify the surface heat flux the same way you did for other options. The difference from this code is that the correcting q term should be the surface one.
Thanks, very thorough. I left a comment on your code change for km_opt=5.
…On Tue, Aug 11, 2020 at 11:12 AM Matthias Göbel ***@***.***> wrote:
For km_opt=5 and isfflx=2, there is still some inconsistency visible close
to the surface. In my opinion, the non-local flux also needs to be
converted to theta_m. I added the conversion factor in the latest commit.
That fixes the issue as can be seen here:
[image: fixed_hfx_nlflux_5_None_3rd+5th]
<https://user-images.githubusercontent.com/17001470/89927006-f74a2480-dc05-11ea-9b42-51d3f16a28ad.png>
[image: fixed_hfx_nlflux_5_0 15_3rd+5th]
<https://user-images.githubusercontent.com/17001470/89927055-0a5cf480-dc06-11ea-97b4-5a4221f1328a.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77EDQWKR7SS5LY7SCZDSAF3ZHANCNFSM4PEOKCRQ>
.
|
What I noticed is that the nlflux is proportional to hfx so that is the term
to modify. Note that this term goes to zero when hfx is zero. This makes
it more like the other changes you already have made.
…On Wed, Aug 12, 2020 at 1:40 AM Matthias Göbel ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In dyn_em/module_diffusion_em.F
<#1259 (comment)>:
> @@ -8044,6 +8050,9 @@ SUBROUTINE vertical_diffusion_implicit(ru_tendf, rv_tendf, rw_tendf, rt_tendf,&
DO i = i_start, i_end
nlflux_rho(i,k,j) = nlflux(i,k,j) * &
(fnm(k)*rho (i,k,j)+fnp(k)*rho (i,k-1,j))
+ IF(config_flags%use_theta_m == 1)THEN
+ nlflux_rho(i,k,j) = nlflux_rho(i,k,j)*(1.+rvovrd*moist(i,k,j,P_QV))
+ ENDIF
This should be equivalent. When looking at how the non-local flux is
computed, you see that all terms that contribute are proportional to sflux
(via the variables amf1, amf2, bmf2, hfxpbl):
https://github.com/wrf-model/WRF/blob/6d0090fe41bc4fc5a1746a420e825039c1d544b7/dyn_em/module_diffusion_em.F#L5206-L5226
I thought it would be more intuitive to view the non-local flux as being
computed for dry theta and then convert it via the same equation derived in
the initial PR message:
<https://camo.githubusercontent.com/692b004096dfeb7313ab02dd0b94177100df3780/68747470733a2f2f6c617465782e636f6465636f67732e636f6d2f6769662e6c617465783f5c6f7665726c696e657b77275c74686574615f7b6d7d277d5f5c6d617468726d7b4e4c7d5c617070726f7828312b5c616c7068615c6f7665726c696e657b717d295c6f7665726c696e657b77275c7468657461277d5f5c6d617468726d7b4e4c7d2b5c616c7068615c6f7665726c696e657b5c74686574617d5c2c5c6f7665726c696e657b772771277d5f5c6d617468726d7b4e4c7d3d28312b5c616c7068615c6f7665726c696e657b717d295c6f7665726c696e657b77275c7468657461277d5f5c6d617468726d7b4e4c7d>
The water vapor flux term is dropped because there is no non-local water
vapor flux in this scheme.
But if you still think it would be better/more readable to convert sflux
instead, I can also do that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77COSROV5QS6A4J4YATSAJBNLANCNFSM4PEOKCRQ>
.
|
ok, I get your point that the change would then be more similar to my other changes. That would however change the grid variable nlflux (in contrast to my change, which is only local). I think it might be better if that potential output variable would be the same regardless of whether theta_m is used or not. In addition, grid%nlflux is also used in the subroutine tke_bouyancy. I think that in the bouyancy tke production term, the non-local heat flux should not include the moisture factor. If we already multiplied the term before, we would need to divide it here again, which is somehow inelegant. What do you think? |
You have looked at this in more detail than I have. In that case
multiplying by the q term as you had it is OK, but make sure it is the
surface q not the k level value. Since this is nlflux_rho that avoids the
issue with the use of nlflux in the tke buoyancy.
…On Fri, Aug 14, 2020 at 11:42 PM Matthias Göbel ***@***.***> wrote:
ok, I get your point that the change would then be more similar to my
other changes. That would however change the grid variable nlflux (in
contrast to my change, which is only local). I think it might be better if
that potential output variable would be the same regardless of whether
theta_m is used or not. In addition, grid%nlflux is also used in the
subroutine tke_bouyancy. I think that in the bouyancy tke production term,
the non-local heat flux should not include the moisture factor. If we
already multiplied the term before, we would need to divide it here again,
which is somehow inelegant. What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77HLSDEEAERNEO2J763SAYN4DANCNFSM4PEOKCRQ>
.
|
This term is tied to the surface flux. If that is zero this term goes away.
That is why it should
only be modified by the surface q because it represents a surface theta_m
flux. Internally
at other levels theta_m is the variable already, so no modification is
needed.
…On Tue, Aug 25, 2020 at 4:09 AM Matthias Göbel ***@***.***> wrote:
ah, now I understand that there is a difference between the two
approaches. You suggest using the surface q for the correction factor at
all levels, while I implemented the k-level q.
In my opinion, taking the k-level q is correct. This modification is
different from my other modifications because it applies to the non-local
flux at all levels not only at the surface. So we cannot use an analogy
argument.
I took again a look at the Zhang 2018 paper. They write the equations for
the non-local flux of dry potential temperature. To convert this flux to
moist potential temperature we need to multiply by a correction factor
using the k-level q as in the equation that I wrote above:
<https://camo.githubusercontent.com/692b004096dfeb7313ab02dd0b94177100df3780/68747470733a2f2f6c617465782e636f6465636f67732e636f6d2f6769662e6c617465783f5c6f7665726c696e657b77275c74686574615f7b6d7d277d5f5c6d617468726d7b4e4c7d5c617070726f7828312b5c616c7068615c6f7665726c696e657b717d295c6f7665726c696e657b77275c7468657461277d5f5c6d617468726d7b4e4c7d2b5c616c7068615c6f7665726c696e657b5c74686574617d5c2c5c6f7665726c696e657b772771277d5f5c6d617468726d7b4e4c7d3d28312b5c616c7068615c6f7665726c696e657b717d295c6f7665726c696e657b77275c7468657461277d5f5c6d617468726d7b4e4c7d>
How the dry non-local flux is calculated, i.e. that is proportional to the
surface heat flux, should be irrelevant for the conversion.
We could also involve the developers of this package to come to a decision.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77EU67ULAT3KXNZNZDLSCOEXLANCNFSM4PEOKCRQ>
.
|
Why do you say, that internally at other levels theta_m is the variable already? In the non-local flux subroutine, I can't see any connection to theta_m, neither at the surface nor higher up. The routine uses the input variable th_phy, which is dry theta. |
This where the variable being mixed is important to know and it is the
moist theta already
if you trace var_mix back (I mentioned this in my August 26th message).
This make this diffusion
routine similar to the previous one you have dealt with by just modifying
the surface flux.
…On Sun, Sep 13, 2020 at 10:29 PM Matthias Göbel ***@***.***> wrote:
no, no new thoughts, but I can try to restate my argument. I agree that
the non-local flux is proportional to the surface heat flux, but I do not
see why this matters for the conversion.
In my view, the computed non-local flux represents a part of the vertical
*dry* theta flux at every level. For the conversion of this flux to
*moist* theta, the details of the flux computation are irrelevant. The
only thing that matters is that it corresponds to a dry theta flux. At
every vertical level, we need to use the conversion factor that is
appropriate at that level using q at that level.
If we only converted the surface heat flux by using the surface q for the
conversion, the vertical profile of the flux would not be adequate for
neither moist nor dry theta, because the profile calculation assumes a dry
surface heat flux not a heat flux converted to moist theta.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77CABVQQCLH4CZ6OJNLSFWL4HANCNFSM4PEOKCRQ>
.
|
yes, var_mix corresponds to theta_m. But that variable is only used in the local part (Deardorff type) of the scheme and has nothing to do with the non-local part. The non-local flux is computed separately and its divergence is added as a source term to the implicit solution in line 8107: WRF/dyn_em/module_diffusion_em.F Lines 8102 to 8108 in f311cd5
In my opinion, the var_mix in line 8107 belongs to the local part of the scheme. So maybe that's confusing, because it stands in the same line as the non-local source term. The non-local flux in line 8107 nevertheless corresponds to a dry theta flux at all vertical levels. |
I think the question is about line 8054. If that can be kts in the q term
modifying hfx with the kts q term before everything allows removing the
changes in 8054 and 8107.
…On Mon, Sep 14, 2020 at 10:07 AM Matthias Göbel ***@***.***> wrote:
yes, var_mix corresponds to theta_m. But that variable is only used in the
local part (Deardorff type) of the scheme and has nothing to do with the
non-local part. The non-local flux is computed separately and its
divergence is added as a source term to the implicit solution in line 8107:
https://github.com/wrf-model/WRF/blob/f311cd5e136631ebf3ebaa02b4b7be3816ed171f/dyn_em/module_diffusion_em.F#L8102-L8108
In my opinion, the var_mix in line 8107 belongs to the local part of the
scheme. So maybe that's confusing, because it stands in the same line as
the non-local source term. The non-local flux in line 8107 nevertheless
corresponds to a dry theta flux at all vertical levels.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77FR5A2G5ZHQYGS36B3SFY5V5ANCNFSM4PEOKCRQ>
.
|
I don't think so, because the change in my line 8054 only affects the non-local flux which is only taken into account for k > kts, while the change in line 8107 converts the surface heat flux, so for k=kts. These are two separate issues. |
This is where I was suggesting that the nonlocal flux is proportional to
the surface flux as represented by Fig. 2 in the paper
so it should only be a kts term there.
…On Mon, Sep 14, 2020 at 10:44 AM Matthias Göbel ***@***.***> wrote:
I don't think so, because the change in my line 8054 only affects the
non-local flux which is only taken into account for k > kts, while the
change in line 8107 converts the surface heat flux, so for k=kts. These are
two separate issues.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77GWSUC3FUYTAC64J23SFZB65ANCNFSM4PEOKCRQ>
.
|
Dear all, I'm the PI of @matzegoebel's project in Innsbruck and I'm jumping in because we had a few discussions about this issue recently. I don't have the time to dig deep into the WRF code, but I'm hoping to help with some considerations on general principles. So... (1) At any vertical level k, the following flux decomposition holds true (neglecting third-order moments): (2) If now we want the turbulent flux to be parameterized with a local plus a non-local component, we simply add the non-local fluxes where appropriate on the RHS: (3) The above can be restated as: I guess this is what @matzegoebel suggested back on 12 August. I interpret the equation as follows: Regardless of how the non-local contributions to turbulent flux are modelled, consistency with the local tendency of theta_m requires them to be weighted with the local values of theta and q. Does this sound convincing? I do see the uncomfortable aspect of the thing: Even if the non-local term remains proportional to the surface fluxes, now its impact is not constant throughout the BL. This is a side-effect of reconstructing the fluxes of theta_m from those of theta and q. |
Thanks for entering this discussion. The changes by Matthias are important
and we appreciate
his adding them. The other diffusion options are certainly helped by what
he is doing and our
only sticking point is km_opt=5.
I will try to bring the developer into this discussion @zhangxsms
<https://github.com/zhangxsms> . He is at the Shanghai Met Service in China.
As I mentioned my view is that the surface proportionality is intended
because this nonlocal
terms represents a flux that originates at the surface.
Jimy
…On Mon, Sep 21, 2020 at 7:48 AM serafis3 ***@***.***> wrote:
Dear all, I'm the PI of @matzegoebel <https://github.com/matzegoebel>'s
project in Innsbruck and I'm jumping in because we had a few discussions
about this issue recently. I don't have the time to dig deep into the WRF
code, but I'm hoping to help with some considerations on general
principles. So...
(1) At any vertical level k, the following flux decomposition holds true
(neglecting third-order moments):
<https://camo.githubusercontent.com/e0a5c05dd5829795f8a46f07b7febb799a44448d/68747470733a2f2f6c617465782e636f6465636f67732e636f6d2f6769662e6c617465783f5c6f7665726c696e657b77275c7468657461275f6d7d5e6b3d5c6f7665726c696e657b77275c7468657461277d5e6b28312b5c616c7068615c6f7665726c696e657b717d5e6b292b5c616c7068615c6f7665726c696e657b5c74686574617d5e6b5c6f7665726c696e657b772771277d5e6b>
(2) If now we want the turbulent flux to be parameterized with a local
plus a non-local component, we simply add the non-local fluxes where
appropriate on the RHS:
<https://camo.githubusercontent.com/30b523d0091bb59e3300f8752891c612186b303c/68747470733a2f2f6c617465782e636f6465636f67732e636f6d2f6769662e6c617465783f285c6f7665726c696e657b77275c7468657461277d5e6b2b5c6f7665726c696e657b77275c7468657461277d5f7b4e4c7d2928312b5c616c7068615c6f7665726c696e657b717d5e6b292b5c616c7068615c6f7665726c696e657b5c74686574617d5e6b285c6f7665726c696e657b772771277d5e6b2b5c6f7665726c696e657b772771277d5f7b4e4c7d29>
(3) The above can be restated as:
<https://camo.githubusercontent.com/20f94f6bae728e8696ce22579b2fb2bed5a9ea32/68747470733a2f2f6c617465782e636f6465636f67732e636f6d2f6769662e6c617465783f5c6f7665726c696e657b77275c7468657461275f6d7d5e6b2b5c6f7665726c696e657b77275c7468657461277d5f7b4e4c7d28312b5c616c7068615c6f7665726c696e657b717d5e6b292b5c616c7068615c6f7665726c696e657b5c74686574617d5e6b285c6f7665726c696e657b772771277d5f7b4e4c7d29>
I guess this is what @matzegoebel <https://github.com/matzegoebel>
suggested back on 12 August. I interpret the equation as follows:
Regardless of how the non-local contributions to turbulent flux are
modelled, consistency with the local tendency of theta_m requires them to
be weighted with the local values of theta and q. Does this sound
convincing?
I do see the uncomfortable aspect of the thing: Even if the non-local term
remains proportional to the surface fluxes, now its impact is not constant
throughout the BL. This is a side-effect of reconstructing the fluxes of
theta_m from those of theta and q.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77BIKIYNR7T25TGN7UDSG5KRDANCNFSM4PEOKCRQ>
.
|
Thanks for getting back! Sure, there is no doubt about the purpose and origin of the nonlocal terms. To clarify my thought: In Eq (3) above, the nonlocal fluxes of (dry) theta and q (if existing) remain just as they are in the Shanghai Met Service scheme (kmopt=5). But there is an open issue with theta_m conservation. A closure such as: is fine with theta in a dry atmosphere. But if one wishes to conserve theta_m in a moist atmosphere, it seems the closure should become: which expands to: This doesn't change the parameterization of the nonlocal fluxes at all, it only adds two terms to account for the influence of moisture on theta_m. If there is no need to conserve theta_m, those two terms can be left out... it can be a legitimate modelling choice, if the consequences are clear. I'm not sure if the authors of the SMS scheme considered the case of moist air. It doesn't seem so. Yes, getting their feedback would be precious! Stefano |
@serafis3, thanks for your support. I totally agree. |
Can we take this conversation off github? I am cc'ing my email address.
Future messages can exclude the github accounts. Please respond only
to my email address, so that I can have yours.
Thanks,
Jimy
…On Tue, Sep 22, 2020 at 4:53 AM Matthias Göbel ***@***.***> wrote:
@serafis3 <https://github.com/serafis3>, thanks for your support. I
totally agree.
In order to make equations be displayed, the URL has to be embedded in an
image command like this:
<img src="https://latex.codecogs.com/gif.latex?\overline{w'\theta_{m}'}"
/>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77BBEJQMONSZ6Y4PYT3SHB64BANCNFSM4PEOKCRQ>
.
|
… to improve dry theta conservation
6049322
to
654069f
Compare
I just pushed commit 654069f which leads to an even better conservation of dry theta. Instead of multiplying the non-local flux in km_opt=5 directly with q(k), the vertical derivative of nlflux is first calculated and then multiplied with q(k). This is more consistent, because nlflux is on w-levels, while q is on mass levels, as is the vertical derivative of nlflux. I did a few simple CBL simulations to show the difference between not modifying the non-local flux at all, using q(k) in the conversion factor, and using q(kts) in the conversion factor, as Jimy suggests. The following figure shows the RMSE of comparing the sum of all forcings with the actual dry theta tendency. Each lines represents an average over 10 minutes, x, y and over 4 ensemble simulations with perturbed initial conditions. Using q(k) in the conversion, seems to lead to a slightly lower error at most levels, especially at the beginning of the simulation, |
OK, I think mine only differs from yours in using q(kts) in that line, just
to summarize the difference
for Xu,
Jimy
…On Mon, Oct 12, 2020 at 8:44 AM Matthias Göbel ***@***.***> wrote:
I just pushed commit 654069f
<654069f>
which leads to an even better conservation of dry theta. Instead of
multiplying the non-local flux in km_opt=5 directly with q(k), the vertical
derivative of nlflux is first calculated and then multiplied with q(k).
This is more consistent, because nlflux is on w-levels, while q is on mass
levels, as is the vertical derivative of nlflux. I did a few simple CBL
simulations to show the difference between not modifying the non-local flux
at all, using q(k) in the conversion factor, and using q(kts) in the
conversion factor, as Jimy suggests. The following figure shows the RMSE of
comparing the sum of all forcings with the actual dry theta tendency. Each
lines represents an average over 10 minutes, x, y and over 4 ensemble
simulations with perturbed initial conditions.
[image: rmse_nlflux_conversion_tmean]
<https://user-images.githubusercontent.com/17001470/95758626-005c7e00-0ca9-11eb-86ae-fa8b7b26a983.png>
Using q(k) in the conversion, seems to lead to a slightly lower error at
most levels, especially at the beginning of the simulation,
The results at later times need be taken with care, since the different
simulations are not exactly equivalent due to the different conversion
factors. Therefore, I argue that the q(k) version should be the correct one
(in addition to the theoretical arguments that we presented earlier).
In any way, both versions are much better than not modifying the non-local
flux (the green line in the left plot actually extends to 5e-5, thus an
order of magnitude worse).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77FPMAJGEYDZ5HOFVBDSKMI47ANCNFSM4PEOKCRQ>
.
|
yes that's right, in line 8110 |
@dudhia @weiwangncar |
I am still trying to make my case.
At least Xu Zhang is now involved in the discussion.
Jimy
…On Fri, Oct 23, 2020 at 12:47 PM Dave Gill ***@***.***> wrote:
@dudhia <https://github.com/dudhia> @weiwangncar
<https://github.com/weiwangncar>
What is the status of this PR? Are we waiting for external comments from
anyone?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77G6G6PSQSMPC4ANMVDSMHFTJANCNFSM4PEOKCRQ>
.
|
@matzegoebel I want to finalize for 4.2.2 bug-fix which is about ready. |
In fact, it seems like it is already this way, so I will go ahead and approve soon after you confirm it is ready now. |
ok |
It is now approved and can be merged and committed. When doing
it make sure the commit message is not overwritten by something
automatically changed.
Or we can do the merge if you prefer.
…On Wed, Dec 16, 2020 at 10:05 AM Matthias Göbel ***@***.***> wrote:
ok
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77GC2IBQ5N6KSLFAFEDSVDSGRANCNFSM4PEOKCRQ>
.
|
@matzegoebel @dudhia |
I just see that I have a bunch of equations and plots in the commit message. Should remove those? |
@matzegoebel |
It worked, but now I realize the change I wanted, k-> kts, is not in there
yet.
We also had Xu Zhang suggest he preferred it to be in.
I will set up a separate PR,
Jimy
…On Tue, Dec 29, 2020 at 1:45 PM weiwangncar ***@***.***> wrote:
Merged #1259 <#1259> into
release-v4.2.2.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77COBALWDQV7EK2D32TSXI5WJANCNFSM4PEOKCRQ>
.
|
Oh yes you're right. Sorry, I overlooked this.
He changed his mind several times during the email discussion, but in his latest mail on October 26th he wrote "Hi Matthias, I totally agree with your opinion in the view of theory." This refers to the discussion we had about whether to use q(k) or q(kts). So I guess he actually supports my view. But we can also ask him again for a final statement, if you're not convinced. |
I am still convinced that this change being to the surface flux has to
apply to kts.
Since this added fix is under my name, I can be blamed if it is wrong.
…On Wed, Dec 30, 2020 at 1:36 AM Matthias Göbel ***@***.***> wrote:
It worked, but now I realize the change I wanted, k-> kts, is not in there
yet.
Oh yes you're right. Sorry, I overlooked this.
We also had Xu Zhang suggest he preferred it to be in.
He changed his mind several times during the email discussion, but in his
latest mail on October 26th he wrote "Hi Matthias, I totally agree with
your opinion in the view of theory." This refers to the discussion we had
about whether to use q(k) or q(kts). So I guess he actually supports my
view. But we can also ask him again for a final statement, if you're not
convinced.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77E47UEWZISBBRCHOIDSXLRB3ANCNFSM4PEOKCRQ>
.
|
wrf-model#1259) TYPE: bug fix KEYWORDS: surface heat flux, use_theta_m, moist theta, non-local flux, 3D TKE SOURCE: Matthias Göbel (University of Innsbruck) DESCRIPTION OF CHANGES: The conversion of surface heat fluxes from dry to moist theta in WRF is inconsistent. This leads to an unclosed dry theta budget at the lowest grid point. The surface sensible heat flux in the routines `vertical_diffusion_2` and `vertical_diffusion_implicit` should be multiplied with <img src="https://latex.codecogs.com/svg.latex?1+\frac{R_{v}}{R_{d}}q" /> as is derived below. Using Reynold's decomposition and averaging we can show for the perturbation moist theta: <img src="https://latex.codecogs.com/svg.latex?\theta_{m}'=(\theta(1+q\alpha))'=\theta(1+q\alpha)-\overline{\theta(1+q\alpha)}=\theta-\overline{\theta}+\alpha(q\theta-\overline{q\theta})=\\=\theta'+\alpha\left[(\overline{\theta}+\theta')(\overline{q}+q')-\overline{\theta}\overline{q}-\overline{\theta'q'}\right]=\theta'(1+\alpha\overline{q})+\alpha\left[\overline{\theta}q'+\theta'q'-\overline{\theta'q'}\right]" /> with water vapor mixing ratio q and <img src="https://latex.codecogs.com/svg.latex?\alpha=\frac{R_{v}}{R_{d}}\approx1.61" /> This yields for the converted surface heat flux: <img src="https://latex.codecogs.com/svg.latex?\overline{w'\theta_{m}'}_0=(1+\alpha\overline{q}_0)\overline{w'\theta'}_0+\alpha\overline{\theta}_0\,\overline{w'q'}_0+\alpha\overline{w'\theta'q'}_0\approx(1+\alpha\overline{q}_0)\overline{w'\theta'}_0+\alpha\overline{\theta}_0\,\overline{w'q'}_0" /> The triple correlation in the equation above cannot be easily estimated in WRF, but judging from my tests it probably has a negligible impact. Instead of the given equation, WRF uses: <img src="https://latex.codecogs.com/svg.latex?\overline{w'\theta_{m}'}_0=\overline{w'\theta'}_0+\alpha\overline{\theta}_0\overline{w'q'}_0 " /> We therefore multiplied the surface heat flux with <img src="https://latex.codecogs.com/svg.latex?1+\alpha\overline{q}_0" />, when `use_theta_m=1`. For `km_opt=5`, also the contribution from the non-local heat flux is multiplied with a correction factor. LIST OF MODIFIED FILES: dyn_em/module_diffusion_em.F TESTS CONDUCTED: checked the dry theta budget of a simulation with use_theta_m=1: simple idealized LES once with model-computed surface heat flux and once with prescribed heat fluxes, RRTMG radiation, no microphysics, zero eddy diffusivities. Changed the code to output advection, SGS diffusion and radiation tendencies for dry theta (regardless of use_theta_m and without changing the tendencies used by the model). These forcing tendencies are averaged online over 30 minutes. The sum of the forcing terms is plotted against the actual tendency of dry theta (change of instantaneous dry theta between the half-hourly time stamps divided by 30 minutes) for all gridpoints and time stamps. All tendency terms are divided by the dry air mass to obtain more familiar units. The modified code fixes the issue of an unclosed dry theta budget at the lowest gridpoint (see attached figures). The simulations were repeated for km_opt=5. RELEASE NOTE: To close the dry theta budget at the lowest grid point when use_theta_m is enabled, the surface heat fluxes, and in the case of km_opt=5 also the non-local heat flux, are multiplied with 1+Rv/Rd*qv.   
To close the dry theta budget at the lowest grid point when use_theta_m is enabled, the surface heat fluxes, and in the case of km_opt=5 also the non-local heat flux, are multiplied with 1+Rv/Rd*qv.
TYPE: bug fix
KEYWORDS: surface heat flux, use_theta_m, moist theta, non-local flux, 3D TKE
SOURCE: Matthias Göbel (University of Innsbruck)
DESCRIPTION OF CHANGES: The conversion of surface heat fluxes from dry to moist theta in WRF is inconsistent. This leads to an unclosed dry theta budget at the lowest grid point. The surface sensible heat flux in the routines
as is derived below.


vertical_diffusion_2
andvertical_diffusion_implicit
should be multiplied withUsing Reynold's decomposition and averaging we can show for the perturbation moist theta:
with water vapor mixing ratio q and
This yields for the converted surface heat flux:


, when
The triple correlation in the equation above cannot be easily estimated in WRF, but judging from my tests it probably has a negligible impact.
Instead of the given equation, WRF uses:
We therefore multiplied the surface heat flux with
use_theta_m=1
.For
km_opt=5
, also the contribution from the non-local heat flux is multiplied with a correction factor.LIST OF MODIFIED FILES: dyn_em/module_diffusion_em.F
TESTS CONDUCTED: checked the dry theta budget of a simulation with use_theta_m=1: simple idealized LES once with model-computed surface heat flux and once with prescribed heat fluxes, RRTMG radiation, no microphysics, zero eddy diffusivities. Changed the code to output advection, SGS diffusion and radiation tendencies for dry theta (regardless of use_theta_m and without changing the tendencies used by the model). These forcing tendencies are averaged online over 30 minutes. The sum of the forcing terms is plotted against the actual tendency of dry theta (change of instantaneous dry theta between the half-hourly time stamps divided by 30 minutes) for all gridpoints and time stamps. All tendency terms are divided by the dry air mass to obtain more familiar units. The modified code fixes the issue of an unclosed dry theta budget at the lowest gridpoint (see attached figures). The simulations were repeated for km_opt=5.
RELEASE NOTE: To close the dry theta budget at the lowest grid point when use_theta_m is enabled, the surface heat fluxes, and in the case of km_opt=5 also the non-local heat flux, are multiplied with 1+Rv/Rd*qv.