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

Correct MG2 rain number conservation limiter #1599

Merged
merged 1 commit into from
Jul 17, 2017

Conversation

quantheory
Copy link
Contributor

Fixes an incorrectly positioned parenthesis that caused the rain number
conservation code to reduce process rates by too much.

The rain number conservation code contained the following lines:

ratio = (nr(i,k)/deltat+nprc(i,k)*lcldm(i,k)/precip_frac(i,k))/ &
  (-nsubr(i,k)+npracs(i,k)+nnuccr(i,k)+nnuccri(i,k)-nragg(i,k))*omsm

The values in the denominator (second line) represent concentrations in
the fraction of the grid cell where precipitation is present, while the
values nr(i,k) and nprc(i,k)*lcldm(i,k) in the numerator represent
mean concentrations over the entire grid cell.

In order to compare the two, the entire numerator should be divided by
the precipitation fraction, not just the nprc term. Thus this commit
moves the factor of precip_frac(i,k) outside of that set of
parentheses.

The precise impact of this change is not quite clear yet, but it is
potentially climate-changing, since fixing this bug will most likely
cause average drop size to increase, and therefore increase the rate of
precipitation. This has been demonstrated using an offline driver for
MG2, using a test case for which this bug is known to have a
particularly strong effect.

[CC]

@quantheory
Copy link
Contributor Author

I wanted to make sure that this was out there, because the issue that this PR fixes is definitely a bug, and I think it has slipped between the cracks. However, AFAIK no one has really evaluated the effect on ACME climate yet, so this shouldn't be merged yet.

Fixes an incorrectly positioned parenthesis that caused the rain number
conservation code to reduce process rates by too much.

The rain number conservation code contained the following lines:

    ratio = (nr(i,k)/deltat+nprc(i,k)*lcldm(i,k)/precip_frac(i,k))/ &
      (-nsubr(i,k)+npracs(i,k)+nnuccr(i,k)+nnuccri(i,k)-nragg(i,k))*omsm

The values in the denominator (second line) represent concentrations in
the fraction of the grid cell where precipitation is present, while the
values `nr(i,k)` and `nprc(i,k)*lcldm(i,k)` in the numerator represent
mean concentrations over the entire grid cell.

In order to compare the two, the *entire* numerator should be divided by
the precipitation fraction, not just the `nprc` term. Thus this commit
moves the factor of `precip_frac(i,k)` outside of that set of
parentheses.

The precise impact of this change is not quite clear yet, but it is
potentially climate-changing, since fixing this bug will most likely
cause average drop size to increase, and therefore increase the rate of
precipitation. This has been demonstrated using an offline driver for
MG2, using a test case for which this bug is known to have a
particularly strong effect.

[CC]
@quantheory quantheory force-pushed the quantheory/atm/nr_precip_frac branch from 75e312c to 2a65d9c Compare June 28, 2017 21:14
@PeterCaldwell
Copy link
Contributor

explanation of problematic line (to aid my own recollection if nobody else's): 'ratio' is the scaling factor applied to each of the process rates that reduces nr (rain number concentration) to prevent nr from going negative within a timestep. We want to choose ratio such that nr is exactly zero at the end of the step. We do this by setting ratio*(tendencies which decrease nr) = [nr/deltat + (tendencies which increase nr)*lcldm]/precip_frac. Note that tendencies which increase nr is multiplied by lcldm (cloud fraction) because those tendencies are in-cloud values and nr/deltat is a cell-average value. The whole right-hand side is divided by precip_frac because tendencies which decrease nr should also be in-precip rather than grid average values.

The difference between the buggy and fixed version is that nr/deltat is not divided by precip frac (a number less than 1) in the buggy version, so its ratio will be too small. This will result in overly agressive throttling of processes reducing nr, so the buggy version should have higher nr than the fixed version.

This line of code is only executed when tendencies try to make nr go negative within a timestep (i.e. when numerics is having problems), so hopefully it doesn't have a big impact on the model solution. I'm testing this now.

@PeterCaldwell
Copy link
Contributor

Update: I ran F1850 (prescribed SST, constant 1850 conditions) for 5 yrs with and without this fix. Results are here: http://portal.nersc.gov/project/acme/coupled/beta/nrfix-on.F1850.ne30_ne30-nrfix-off.F1850.ne30_ne30_yrs2-5/ . It looks like this bug causes ~1.3 W/m2 change in TOA radiation balance. Based on the fact that this is definitely a bug and definitely has a climate impact, I think we need to get this on master... but we should do so carefully. In particular, we don't want to surprise people when the model behavior changes and we probably want to retune to compensate for this.

@polunma
Copy link
Contributor

polunma commented Jul 10, 2017

Peter, I think the bug causes 0.88W/m2 difference in RESTOM, instead of 1.3W/m2.

@PeterCaldwell
Copy link
Contributor

@polunma - yup, you're right. I read the table wrong. That mistake doesn't change the fact that this bug causes a substantial change to RESTOM, though.

@polunma
Copy link
Contributor

polunma commented Jul 10, 2017

Agreed.

@PeterCaldwell
Copy link
Contributor

@rljacob, @golaz , etc: @davidcbaderatllnl just told me he wants this bugfix on master ASAP. Because this will be significantly answer-changing, we should probably make a new beta tag for it. I'm not sure whether there are other things (e.g. in the ocean @jonbob ) that we want to incorporate into this tag...

@rljacob rljacob added this to the v1.0beta2 milestone Jul 12, 2017
@rljacob
Copy link
Member

rljacob commented Jul 12, 2017

Sounds good. I've been wanting to make a new tag. Looking at the open PRs, we should probably also add #1630 and #1624 at least.

@jonbob
Copy link
Contributor

jonbob commented Jul 12, 2017

#1630 is good to go -- has passed threading tests on three different platforms. I'm just waiting for a review and can get it in immediately. But it's not critical for a new tag. We do hope to have some science changes very soon that will solve at least some of the mixing/noise issues. But that might not be until early next week. And again, that PR would be non-BFB.

@wlin7
Copy link
Contributor

wlin7 commented Jul 12, 2017

@PeterCaldwell , can you approve the PR? I will start merging shortly.

Copy link
Contributor

@PeterCaldwell PeterCaldwell left a comment

Choose a reason for hiding this comment

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

Sorry, I didn't realize my review was requested. This is definitely correct.

@wlin7
Copy link
Contributor

wlin7 commented Jul 12, 2017

Thanks @PeterCaldwell .

@rljacob , since this is a climate changing PR, when is good time to merge it to next?

@wlin7
Copy link
Contributor

wlin7 commented Jul 13, 2017

Hi @rljacob , can this PR be merged as usual? Or does it need some arrangement given that it is a CC type of PR?

@rljacob
Copy link
Member

rljacob commented Jul 13, 2017

It should go in as the only science-code or non-BFB change that day.
Only some cori/edison machine file changes went in so far so you could merge it to next today.

@rljacob
Copy link
Member

rljacob commented Jul 13, 2017

Wait, the dashboard is a mess with fails from a previous PR. We need that to clear.

@wlin7
Copy link
Contributor

wlin7 commented Jul 13, 2017

Got it. Thanks Rob.

@rljacob
Copy link
Member

rljacob commented Jul 14, 2017

@wlin7 go ahead and merge this to next today.

wlin7 added a commit that referenced this pull request Jul 14, 2017
Merge quantheory/atm/nr_precip_frac into next (PR #1599)

Fixes an incorrectly positioned parenthesis that caused the rain number
conservation code to reduce process rates by too much.

The rain number conservation code contained the following lines:

ratio = (nr(i,k)/deltat+nprc(i,k)*lcldm(i,k)/precip_frac(i,k))/ &
  (-nsubr(i,k)+npracs(i,k)+nnuccr(i,k)+nnuccri(i,k)-nragg(i,k))*omsm
The values in the denominator (second line) represent concentrations in
the fraction of the grid cell where precipitation is present, while the
values nr(i,k) and nprc(i,k)*lcldm(i,k) in the numerator represent
mean concentrations over the entire grid cell.

In order to compare the two, the entire numerator should be divided by
the precipitation fraction, not just the nprc term. Thus this commit
moves the factor of precip_frac(i,k) outside of that set of
parentheses.

The precise impact of this change is not quite clear yet, but it is
potentially climate-changing, since fixing this bug will most likely
cause average drop size to increase, and therefore increase the rate of
precipitation. This has been demonstrated using an offline driver for
MG2, using a test case for which this bug is known to have a
particularly strong effect.

[CC]
@wlin7
Copy link
Contributor

wlin7 commented Jul 14, 2017

merged to next.

jgfouca pushed a commit that referenced this pull request Jul 14, 2017
Update PGI compiler to 17.04 on hobart
Update version of PGI compiler used on hobart

Test suite: verified CECO.hobart_pgi would not build with current master, but does build and run with this branch
Test baseline: N/A
Test namelist changes: N/A
Test status: I don't know if there are any compsets on hobart that build / run with pgi on master, but if so they probably won't have the same answers now

Fixes #1599

User interface changes?: N/A

Code review: one line changes are fun to review
@rljacob
Copy link
Member

rljacob commented Jul 17, 2017

Both machines doing testing on next have reported and results look as expected. @wlin7 please file tickets to bless failed tests and proceed to master.

@wlin7
Copy link
Contributor

wlin7 commented Jul 17, 2017

Tickets filed to bless failed (DIFF) tests for melvin and skybridge.

Melvin reported 4 failed tests, all being DIFF. Request filed to bless all four.

Skybridge reported 15 failed tests, 14 due to DIFF, but one,
"SMS_R_Ld5.T42_T42.FSCM5A97.skybridge_intel" was a plain failed. Though eventually it would still fail with a DIFF after the current issue is resolved, I am not requesting to bless this one. Should I request to bless it even with a separate issue exists?

@wlin7 wlin7 merged commit 2a65d9c into master Jul 17, 2017
wlin7 added a commit that referenced this pull request Jul 17, 2017
Merge quantheory/atm/nr_precip_frac (PR #1599)

Fixes an incorrectly positioned parenthesis that caused the rain number
conservation code to reduce process rates by too much.

The rain number conservation code contained the following lines:

ratio = (nr(i,k)/deltat+nprc(i,k)*lcldm(i,k)/precip_frac(i,k))/ &
  (-nsubr(i,k)+npracs(i,k)+nnuccr(i,k)+nnuccri(i,k)-nragg(i,k))*omsm
The values in the denominator (second line) represent concentrations in
the fraction of the grid cell where precipitation is present, while the
values nr(i,k) and nprc(i,k)*lcldm(i,k) in the numerator represent
mean concentrations over the entire grid cell.

In order to compare the two, the entire numerator should be divided by
the precipitation fraction, not just the nprc term. Thus this commit
moves the factor of precip_frac(i,k) outside of that set of
parentheses.

The precise impact of this change is not quite clear yet, but it is
potentially climate-changing, since fixing this bug will most likely
cause average drop size to increase, and therefore increase the rate of
precipitation. This has been demonstrated using an offline driver for
MG2, using a test case for which this bug is known to have a
particularly strong effect.

[CC]
@singhbalwinder
Copy link
Contributor

"SMS_R_Ld5.T42_T42.FSCM5A97.skybridge_intel" was a plain failed. Though eventually it would still fail with a DIFF after the current issue is resolved, I am not requesting to bless this one. Should I request to bless it even with a separate issue exists?

Thanks @wlin7 . This test can't be blessed as it is failing. SE team is aware of this so there is no need to file a ticket at this time for this test.

@wlin7
Copy link
Contributor

wlin7 commented Jul 17, 2017

Got it. Thanks @singhbalwinder .

@wlin7
Copy link
Contributor

wlin7 commented Jul 18, 2017

@rljacob , @singhbalwinder ,
Now that the PR is in the master, should request also be made to bless the related failed(DIFF) tests? Melvin and Chama are reporting these same failed (DIFF) tests for master as seen for next in melvin and skybridge previously.

@rljacob
Copy link
Member

rljacob commented Jul 18, 2017

Yes please do.

@singhbalwinder
Copy link
Contributor

Yes, a new ticket should be created for blessing the failing tests on Melvin and Chama.

@wlin7
Copy link
Contributor

wlin7 commented Jul 18, 2017

submitted.

@rljacob
Copy link
Member

rljacob commented Sep 1, 2017

@jonbob I believe this is the "one-parenthesis" change that the email from @swrneale mentioned.

@rljacob rljacob deleted the quantheory/atm/nr_precip_frac branch February 15, 2018 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Atmosphere bug fix PR CC PR is climate changing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants