Fix units flashes per 5 min#182
Conversation
…eta: change units 'flashes 5 min-1' to 'flashes min-1' and update long name to make clear this is per 5 minutes
|
No. We definitely should not have incorrect information in the units field. The ideal solution was discussed in a CCPP meeting, but it seems none of us copied that information to github. Sorry about that. We would rather have flash rate relative to a configurable base rate. Changes would be these:
This should result in multiplying the value by 1 inside the lightning diagnostic code, which should not change the results. It has the advantages of being consistent, intuitive, non-answer-changing, and invisible to the post-processing. |
I'll leave that up to y'all, as long as it doesn't delay these PRs that need to go in as soon as the commit queue allows (and rt.sh finishes). |
We discussed this in a CCPP meeting, but I though we ultimately decided to do what Dom did here. I don't love this solution as we are introducing another variable just because of a wonky unit. I think a more robust solution would be for the scheme to output fields in standard units (flashes min-1) and to introduce a new variable attribute in the framework, say scale_factor_out=0.2, that is applied in the cap. Let me see if I can make this happen today |
That isn't my recollection. We've clearly shown the need to discuss solutions on github. I'll try to be better about that in the future. |
I like this. A scale factor is the ideal solution. |
|
Doesn't the UFS at least allow you to scale output in the diagnostics code? If so, then you could also switch to flashes min-1 in ccpp, and have the GFS_diagnostics code scale this to 5 minutes (and set the units/attributes there)? |
|
From |
|
Does the GFS_diagnostics scaling affect data sent to the inline post? |
|
O yeah. I like the idea scaling the diagnostics outside of the physics. |
That I don't know - but we can find out. |
|
If you know off the top of your head with regression test exercises inline post for the data in question, please let me know. I can make the change and test it real quick. |
|
It looks like some or all of the |
|
I don't know if there is any lightning threat data in those files though. With a low resolution or no storms, you could get 0 lightning threat across the entire domain. No matter how you scale 0, you send up with 0. |
|
Those tests are useless to us. The entire lightning threat field is undefined: EDIT: This line tells us they are undefined. The number of undefined points (undef=61440) equals the number of points (ndata=61440) |
|
Maeh. Well, then I will need to ask you to test the diffs between two commits on my branch for a useful case, sorry ... I should have the code ready later today (but no need to rush, this can wait until next week). |
|
I asked @junwang-noaa about the inline post and she confirmed my expectations (thanks very much for that!)
|
|
The correct solution then is to:
|
|
I'm constructing a test case we can use for this. It'll be a real-time RRFS run which I'll copy to Hera. |
…90, scale lightning threat from flashes per 5 minutes to flashes per minute to match units in metadata
|
@SamuelTrahanNOAA The code is ready. The ufs-weather-model commit before the rescaling change is d8d13e21f564001df59db9e5c87e14289aa3737b and all the submodule pointers are set correctly. The ufs-weather-model commit after the rescaling change is 49e4625fd9b1786790e1bd15cde775ca0bbbd77f and likewise all the submodule pointers are set correctly. I ran the |
|
I have a test case here which works with the top of develop:
Now that I have Dom's hashes, I'll test those. |
|
The lightning output is completely different. It isn't off by a factor of five, as one may expect. Instead, it's like I'm looking at a different product. |
|
The lightning variables are accumulated quantities. I expect that's the reason for the discrepancy. I'll try a tweak and let you know if it works. |
|
Thanks for your efforts @SamuelTrahanNOAA. Please let me know if I can help. |
|
I have a new set of changes that work. The scaling has to happen deeper in the code for the units to be consistent. I'll do a PR to this branch soon.
EDIT: I just noticed your PR is entirely for these changes. |
|
It turns out the conus13km tests have non-zero lightning threat data in them, at least on Hera. I'll run the regression tests to confirm they're the only ones with changed results. |
|
My corrections are here: |
|
Please update the PR description after merging my PR. The units coming out of the algorithm are now genuinely flashes per minute. This sentence:
Should be something like:
And you can remove the quotes around "Fix" in the title now that we're properly fixing the problem. |
|
I'm running regression tests on the combination of this branch and my PR to this branch. |
|
With the combination of this branch and my PR to this branch:
Please merge my PR climbfuji#16 to this branch so we can move forward with the commit process. |
correctly convert from flashes per five minutes to flashes per minute
dustinswales
left a comment
There was a problem hiding this comment.
@SamuelTrahanNOAA Thanks for making these changes.
|
Hello, @grantfirl @dustinswales , testing is complete on UFS-WM PR#2181. Can you please merge this sub-PR ? |
Description
In
physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.{F90,meta}: change calculation and metadata unitsflashes 5 min-1toflashes min-1- credits to @SamuelTrahanNOAA for contributing the code changes.See NCAR#1047 for more information.
Associated PRs:
NCAR/ccpp-framework#546
NOAA-EMC/ufsatm#796
ufs-community/ufs-weather-model#2181
Testing
See ufs-community/ufs-weather-model#2181