Fix Lightning Potential Index calculation failure #1836
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.