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

Bug fix and rework the scale-aware code #1840

Merged
merged 3 commits into from
Apr 10, 2023

Conversation

weiwangncar
Copy link
Collaborator

@weiwangncar weiwangncar commented Mar 30, 2023

TYPE: bug fix

KEYWORDS: scale-aware ntiedtke

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
The original PR to add scale-awareness to the new Tiedtke scheme had a bug: the introduction of the namelist control didn't work correctly. Also the introduction of the namelist control made the code look ugly. After discussing with the original developer, we agreed if the changes to scale the cloud to rain conversion coefficient (which helps to reduce very light precip), and saturation check as a condition for triggering mid-level convection (which helps to the number of grid points that are classified as mid-level convection) are removed, the rest of the code can be added without a namelist control.

Solution:
Removing the namelist introduced in PR#1806, and the changes related to cloud-to-rain conversion coefficient and saturation check for mid-level convection, and only keeping the scale-awareness only for convective adjustment time scale and shallow mass fluxes.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M dyn_em/module_first_rk_step_part1.F
M phys/module_cu_ntiedtke.F
M phys/module_cumulus_driver.F

TESTS CONDUCTED:

  1. Works as expected in two cases.
  2. The Jenkins tests have passed.

@weiwangncar weiwangncar requested review from a team as code owners March 30, 2023 01:43
@weiwangncar
Copy link
Collaborator Author

The Jenkins test results:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@weiwangncar weiwangncar changed the title Fix sa ntk Bug fix and rework the scale-aware code Mar 30, 2023
dudhia
dudhia previously approved these changes Mar 30, 2023
smileMchen
smileMchen previously approved these changes Mar 30, 2023
@weiwangncar
Copy link
Collaborator Author

The Jenkins test results:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

phys/module_cu_ntiedtke.F Outdated Show resolved Hide resolved
@@ -1039,14 +1035,10 @@ subroutine cumastrn &
if(ldcum(jl).and.ktype(jl).eq.1) then
ikb = kcbot(jl)
ikt = kctop(jl)
ztau = ztauc(jl) * scale_fac(jl)
ztau = ztauc(jl) * scale_tau(jl)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is better to set ztauc (360., 10800.), then ztau=ztauc*scale_fac

Copy link
Contributor

Choose a reason for hiding this comment

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

@weiwangncar please check the code here. My suggestion is to add (360, 10800) to ztauc. There will be no additional time limit for ztau.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hichunxi I thought that is what I did based on your recommendation before. Here is the section in the new code:

       ztauc(jl) = max(ztmst,ztauc(jl))
       ztauc(jl) = max(360.,ztauc(jl))
       ztauc(jl) = min(10800.,ztauc(jl))
       ztau = ztauc(jl) * scale_fac(jl)

Copy link
Contributor

Choose a reason for hiding this comment

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

@weiwangncar Sorry I missed it. It looks good now. I will approve this PR very soon.

@@ -1085,10 +1077,8 @@ subroutine cumastrn &
else
zmfub1(jl) = zmfub(jl)
end if
zmfub1(jl) = zmfub1(jl)/scale_mf(jl)
Copy link
Contributor

Choose a reason for hiding this comment

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

scale-awareness for shallow convection at 15 km grid spacing is questionable.

@weiwangncar
Copy link
Collaborator Author

@hichunxi Thanks for the comments. If I change the constant in the scaling formula a bit to make the value at 15 km to be equal to that in the original formula, I get this plot:

scale

Would this be acceptable. As you can see, the green line in the plot is for scaling shallow convection, and it is a very weak scaling.

@hichunxi
Copy link
Contributor

@hichunxi Thanks for the comments. If I change the constant in the scaling formula a bit to make the value at 15 km to be equal to that in the original formula, I get this plot:

scale

Would this be acceptable. As you can see, the green line in the plot is for scaling shallow convection, and it is a very weak scaling.

For deep convection, it looks ok. But for shallow convection, the scale-factor is around 2 at 8 km grid spacing, which might be a little bit too high.

@weiwangncar
Copy link
Collaborator Author

@hichunxi You might be right. How about we leave it like this now, and make adjustment if we have evidence that it doesn't work well or is not realistic in the future.

@hichunxi
Copy link
Contributor

hichunxi commented Apr 3, 2023

@weiwangncar Ok, leave it as is now and make potential changes in the future.

@weiwangncar weiwangncar dismissed stale reviews from smileMchen and dudhia via b16031a April 6, 2023 17:55
@weiwangncar
Copy link
Collaborator Author

The Jenkins test results:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@weiwangncar
Copy link
Collaborator Author

@hichunxi Can you take a look at this final change? Thanks.

@weiwangncar
Copy link
Collaborator Author

@hichunxi Thanks!
@dudhia @smileMchen Can you review and approve if it is ok? Thanks!

@weiwangncar weiwangncar merged commit cfc2801 into wrf-model:release-v4.5 Apr 10, 2023
@weiwangncar weiwangncar deleted the fix-sa-ntk branch April 10, 2023 20:06
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS: scale-aware ntiedtke

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
The original PR to add scale-awareness to the new Tiedtke scheme had a bug: the introduction of the namelist control didn't work correctly. Also the introduction of the namelist control made the code look ugly. After discussing with the original developer, we agreed if the changes to scale the cloud to rain conversion coefficient (which helps to reduce very light precip), and saturation check as a condition for triggering mid-level convection (which helps to the number of grid points that are classified as mid-level convection) are removed, the rest of the code can be added without a namelist control. 

Solution:
Removing the namelist introduced in PR#1806, and the changes related to cloud-to-rain conversion coefficient and saturation check for mid-level convection, and only keeping the scale-awareness only for convective adjustment time scale and shallow mass fluxes.

LIST OF MODIFIED FILES: 
M       Registry/Registry.EM_COMMON
M       dyn_em/module_first_rk_step_part1.F
M       phys/module_cu_ntiedtke.F
M       phys/module_cumulus_driver.F

TESTS CONDUCTED: 
1. Works as expected in two cases.
2. The Jenkins tests have passed.
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.

None yet

4 participants