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

Fixes CNP Budget #6233

Merged
merged 5 commits into from
Feb 28, 2024
Merged

Fixes CNP Budget #6233

merged 5 commits into from
Feb 28, 2024

Conversation

bishtgautam
Copy link
Contributor

@bishtgautam bishtgautam commented Feb 13, 2024

The following updates are made to fix the CNP budget in ELM.

  • The value for three fluxes used in the monthly CNP budget is now initialized.
  • An MPI_Allreduce (instead of an MPI_Reduce) is used when budgets are computed.
  • An additional field is written out in the ELM restart file.
  • Long names and units of a few variables in the restart files are corrected.

Fixes #6230
[BFB] (except a new field is added in the ELM restart file)

Sets the values for three fluxes that are included in monthly CNP budgets.

Fixes #6230
[BFB]
Copy link

github-actions bot commented Feb 13, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://E3SM-Project.github.io/E3SM/pr-preview/pr-6233/
on branch gh-pages at 2024-02-27 21:26 UTC

@peterdschwartz
Copy link
Contributor

I did a test merge of this to next and received DIFF for fates_cold_allvars test in CMASS_BALANCE_ERROR. Only cause I can think of is that the gridcell balance checking for FATES is not correct and that will be fixed by PR #6235 . So, this PR may need to be merged after PR #6235 to avoid the extra diff. I'll try to test them together.

@rljacob
Copy link
Member

rljacob commented Feb 26, 2024

@peterdschwartz we need this merged because it fixes month-long restart tests with the standard v3 F-case. Can't wait for it to work with FATES.

@rljacob rljacob added this to the v3.0.0-rc milestone Feb 26, 2024
bishtgautam added a commit that referenced this pull request Feb 26, 2024
Sets the values for three fluxes that are included in monthly CNP budgets.

Fixes #6230
[BFB]
@peterdschwartz peterdschwartz removed their request for review February 26, 2024 19:36
@rljacob
Copy link
Member

rljacob commented Feb 27, 2024

This caused ERP_Ld15.ne4pg2_ne4pg2.IELMFATES.chrysalis_intel.elm-fates_cold_allvars to diff. Expected?

@peterdschwartz
Copy link
Contributor

@rljacob Did you miss my comment above?

@rljacob
Copy link
Member

rljacob commented Feb 27, 2024

Ah I missed that. Thanks.

@rljacob
Copy link
Member

rljacob commented Feb 27, 2024

This fix allows SMS_Lm1.ne4pg2_oQU480.F2010 and SMS_Ly1.ne4pg2_oQU480.F2010 to run and pass. ERP_Lm3.ne4pg2_oQU480.F2010 and ERS_Ld31.ne4pg2_oQU480 no longer have runtime fails but do fail the restart test with "2 had differences in fill patterns" (for ERP) and "1 had differences in fill patterns" (for ERS).

@peterdschwartz
Copy link
Contributor

@rljacob Sorry, I'm not sure where to look for those tests on CDash

@rljacob
Copy link
Member

rljacob commented Feb 27, 2024

They're in the gcp-12 report for extra-coverage: https://my.cdash.org/viewTest.php?onlyfailed&buildid=2502048

@rljacob
Copy link
Member

rljacob commented Feb 27, 2024

SMS_Ln9.ne4pg2_oQU480.F2010..eam-outfrq9s has diffs with baselines.
FILLDIF and RMS diff: ER
FILLDIFF only: SOM_C_LEACHED
RMS only: CMASS_BALANCE_ERROR

@rljacob
Copy link
Member

rljacob commented Feb 27, 2024

Further investigation and discussion with @bishtgautam: any test that outputs an elm h0 file will have a diff like the above. So all prod-suite tests need to be blessed as well.

@rljacob
Copy link
Member

rljacob commented Feb 28, 2024

@bishtgautam please update the PR description with your other changes.

@bishtgautam
Copy link
Contributor Author

@rljacob I have updated the PR description.

@bishtgautam bishtgautam merged commit c0a7395 into master Feb 28, 2024
10 checks passed
@bishtgautam bishtgautam deleted the bishtgautam/lnd/fix-cnp-budget branch February 28, 2024 18:28
@rljacob rljacob modified the milestones: v3.0.0-rc1, v3.0.0-rc2 Feb 29, 2024
@kchong75
Copy link

Hello, I was running E3SMv3.0.0 with a non-January starting month (e.g., 10), using the corresponding ELM restart file from a previous run (e.g., CASE.elm.r.0001-10-01.nc) as the initial dataset (finidat) for ELM. However, the CNPBudget fails its annual check for carbon state (net change in state >> time integrated flux) at the end of year, due to all annual beginning values being zeros.
Below is the error message:

-----------------------------------------------------------------------|--------------------
                                                  *SUM*   382.70401574 |      3042037680.28
-----------------------------------------------------------------------|--------------------
 
 CARBON STATES (kgC/m2*1e6): period   annual: date =        20101           0
 
                                        beg              end          |        *NET CHANGE*
                    PFT                 0.00       4515692979.23      |      4515692979.23
                    CWD                 0.00          2368343.95      |         2368343.95
           Total litter                 0.00        413913580.76      |       413913580.76
              Total SOM                 0.00        836694905.52      |       836694905.52
     Total wood product                 0.00                0.00      |               0.00
        Truncation sink                 0.00            32479.12      |           32479.12
      Crop seed deficit                 0.00                0.00      |               0.00
         Grid-level Err                 0.00               -0.00      |              -0.00
----------------------------------------------------------------------|-----------------------
           *SUM*                      5768702288.59                   |      5768702288.59
 time integrated flux =    3042037680.27547     
 net change in state  =    5768702288.59410     
 current state        =    72.4916509223762     
 relative error [%]   =    47.2665163135523     
 ENDRUN:
 ERROR in CNPBudgetMod.F90 at line 929

Is there a way to fix this issue, or is it necessary to run the model starting from January? Thank you in advance for your help.

@rljacob
Copy link
Member

rljacob commented Mar 25, 2024

was the previous run that made the restart file also from v3.0.0?

@kchong75
Copy link

kchong75 commented Mar 25, 2024

was the previous run that made the restart file also from v3.0.0?

Yes. It is a monthly restart file generated from a v3.0.0 run that starts from January.
And I did try a run without specifying the finidat file, it still fails the annual budget check, as long as it has a non-Jan starting month.

@kchong75
Copy link

I am not sure how the time integrated flux is calculated for the annual budget check, but it seems that the annual beg values from finidat (no matter if it is specified by user or not) is not updated to the ELM restart files if the model does not start from month 01, causing the annual beg values being all zeros.

@bishtgautam
Copy link
Contributor Author

@kchong75 Can you please share the commands to reproduce the error? It is quite possible that I had not considered the case when a simulation starts in the middle of the year instead of 1st-Jan.

@bishtgautam
Copy link
Contributor Author

@kchong75 I have created a new issue (#6337) and we can have a followup discussion on that new issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB bug fix PR Land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SMS_Lm1.ne30pg2_ECwISC30to60E2r1.WCYCL1850 broken
4 participants