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

ndep forcing incorrect when receiving ndep from CAM (starting with ctsm5.1.dev002) #1233

Closed
billsacks opened this issue Dec 18, 2020 · 3 comments
Assignees
Labels
bug something is working incorrectly priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations science Enhancement to or bug impacting science

Comments

@billsacks
Copy link
Member

Brief summary of bug

There is a bug in ndep forcing (forc_ndep_grc) when receiving ndep from CAM (ndep_from_cpl true). This first appears in ctsm5.1.dev002.

General bug information

CTSM version you are using: ctsm5.1.dev002 and later

Does this bug cause significantly incorrect results in the model's science? Yes

Configurations affected: Any configurations that get ndep from coupler. My guess is that we missed this bug because we don't have any such configurations in our test suite, maybe because this isn't possible in I compsets?

Details of bug

This showed up in CESM prealpha testing as a failure in ERP_Ld3.f09_f09_mg17.FCfireHIST.cheyenne_intel.cam-outfrq1d: the base and restart runs differed.

@fischer-ncar tracked this down to ctsm5.1.dev002, and I have tracked it down to a problem when a loop was split: a local index variable was not set in the second loop. We need this diff:

diff --git a/src/cpl/mct/lnd_import_export.F90 b/src/cpl/mct/lnd_import_export.F90
index 459faead..afdf575a 100644
--- a/src/cpl/mct/lnd_import_export.F90
+++ b/src/cpl/mct/lnd_import_export.F90
@@ -169,6 +169,7 @@ contains
     ! Note that forc_pbot is in Pa
 
     do g = begg,endg
+       i = 1 + (g - begg)
 
        forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g)

and maybe similar in the other caps.

@slevisconsulting FYI. I'll fix this.

@billsacks billsacks added tag: bug - critical priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations bug something is working incorrectly labels Dec 18, 2020
@billsacks billsacks self-assigned this Dec 18, 2020
@ekluzek
Copy link
Collaborator

ekluzek commented Dec 18, 2020

@billsacks thanks for catching this and figuring it out. Yes, this is a situation we can't test for with an I compset, we need at least an F compset to do it. If datm sent ndep rather than CTSM reading it in, the two situations would be closer and we would catch such problems.

We do have an issue for this, but no time to do it...

ESMCI/cime#3549

It would also be better in that we would know that ndep sent to both ocn and lnd would be identical.

@billsacks
Copy link
Member Author

Thanks @ekluzek . As you were writing your comment, I was in the process of reading that issue and opening a corresponding issue in CDEPS: ESCOMP/CDEPS#36.

@billsacks
Copy link
Member Author

This is only an issue in the mct cap: the nuopc cap doesn't have a loop like this, and the lilac cap doesn't currently handle ndep from atm.

billsacks added a commit that referenced this issue Dec 19, 2020
Fix ndep from coupler

There was a bug in ndep forcing (forc_ndep_grc) when receiving ndep from
CAM (ndep_from_cpl true). This first appeared in ctsm5.1.dev002. NDEP
forcings have been garbage since then when receiving ndep from CAM.

This tag fixes that issue.

Resolves #1233 (ndep forcing incorrect when receiving ndep
from CAM (starting with ctsm5.1.dev002))
@samsrabin samsrabin added the science Enhancement to or bug impacting science label Aug 8, 2024
@ekluzek ekluzek moved this to Done in CTSM: High priority Aug 15, 2024
@ekluzek ekluzek moved this to Done (non release/external) in CTSM: Upcoming tags Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is working incorrectly priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations science Enhancement to or bug impacting science
Projects
Status: Done (non release/external)
Development

No branches or pull requests

3 participants