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

Fix Lightning Potential Index calculation failure #1836

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

weiwangncar
Copy link
Collaborator

@weiwangncar weiwangncar commented Mar 24, 2023

TYPE: bug fix

KEYWORDS: LPI, malloc error, NaNs

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
The model stops right away with malloc error (with gfortran) when using lightning_option = 3, the option to compute lightning potential index (the problem occurred only with a 2 domain test). The error is due to variable packaging for this option. Once this error is fixed, the model can run but produces NaNs in the diagnostics. Array for hail mixing ratio is removed from the call as well, as it is not used.

Solution:
Add additional variables for packaging, and limit hydrometeors to a number that is not smaller than 1.e-10, which eliminates the NaNs.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M phys/module_lightning_driver.F
M phys/module_ltng_lpi.F

TESTS CONDUCTED:

  1. The model ran with 2 domain test, and do not produce NaNs.
  2. The Jenkins tests are all passing.

RELEASE NOTE: Fixed a bug for lightning diagnostic option 3, an option for lightning potential index calculation. The bug prevented nested case to run, and may produce NaNs in the diagnostics.

@weiwangncar weiwangncar requested review from a team as code owners March 24, 2023 21:01
@weiwangncar weiwangncar changed the base branch from master to release-v4.5 March 24, 2023 21:01
@dudhia
Copy link
Collaborator

dudhia commented Mar 24, 2023

Makes sense. Thanks for tracking it down.

@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

@dudhia
Copy link
Collaborator

dudhia commented Mar 29, 2023

When you say it produces NaNs in the diagnostics, is that still the case after the fix? It was not clear.

@weiwangncar
Copy link
Collaborator Author

@dudhia Added more in 'Solution'.

@weiwangncar weiwangncar merged commit f511c65 into wrf-model:release-v4.5 Mar 30, 2023
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
TYPE: bug fix

KEYWORDS: LPI, malloc error, NaNs

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
The model stops right away with malloc error (with gfortran) when using lightning_option = 3, the option to compute lightning potential index (the problem occurred only with a 2 domain test). The error is due to variable packaging for this option. Once this error is fixed, the model can run but produces NaNs in the diagnostics. Array for hail mixing ratio is removed from the call as well, as it is not used.

Solution:
Add additional variables for packaging, and limit hydrometeors to a number that is not smaller than 1.e-10, which eliminates the NaNs.

LIST OF MODIFIED FILES: 
M       Registry/Registry.EM_COMMON
M       phys/module_lightning_driver.F
M       phys/module_ltng_lpi.F

TESTS CONDUCTED: 
1. The model ran with 2 domain test, and do not produce NaNs.
2. The Jenkins tests are all passing.

RELEASE NOTE: Fixed a bug for lightning diagnostic option 3, an option for lightning potential index calculation. The bug prevented nested case to run, and may produce NaNs in the diagnostics.
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

3 participants