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

Clm45BgcCrop case dies due to negative leafn #66

Closed
billsacks opened this issue Dec 16, 2017 · 10 comments
Closed

Clm45BgcCrop case dies due to negative leafn #66

billsacks opened this issue Dec 16, 2017 · 10 comments
Labels
bug something is working incorrectly
Milestone

Comments

@billsacks
Copy link
Member

Bill Sacks < sacks@ucar.edu > - 2017-07-06 13:21:37 -0600
Bugzilla Id: 2489
Bugzilla CC: andre@ucar.edu, dlawren@ucar.edu, dll@ucar.edu, oleson@ucar.edu, rfisher@ucar.edu,

In the compsetchanges branch (soon to be clm4_5_16_r249), this test is dying:

ERP_D.f10_f10_musgs.IHistClm50Bgc.yellowstone_gnu.clm-decStart

with message:

28: ERROR: Carbon or Nitrogen patch negative = 30.5688132018826
28: -6.01119011968369
28: ERROR: limits = -60.0000000000000 -6.00000000000000
28: ENDRUN:
28: ERROR: carbon or nitrogen state critically negative ERROR in CNPrecisionControl
28: Mod.F90 at line 207

This is from this call:

  ! leaf C and N
  call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_patch(bounds%begp:bounds%endp), &
                            ns%leafn_patch(bounds%begp:bounds%endp), &
                            pc(bounds%begp:), pn(bounds%begp:), __LINE__, &
                            c13=c13cs%leafc_patch, c14=c14cs%leafc_patch, &
                            pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) )

which I'm pretty sure means that the problem is in leafn_patch.

@billsacks billsacks added this to the clm5 milestone Dec 16, 2017
@billsacks
Copy link
Member Author

Bill Sacks < sacks@ucar.edu > - 2017-07-06 13:26:36 -0600

Oops, I copied the wrong test name. The failure is actually in:

ERS_Ly5_P72x1.f10_f10_musgs.IHistClm45BgcCrop.cheyenne_intel.clm-cropMonthOutput

@billsacks
Copy link
Member Author

Bill Sacks < sacks@ucar.edu > - 2017-07-06 13:28:13 -0600

This test was newly added in this branch, in order to maintain a long production test of CLM45 in the test list.

@billsacks
Copy link
Member Author

Erik Kluzek < erik@ucar.edu > - 2017-09-08 15:23:53 -0600

Danica and Keith found they needed to do the following to get simulations to run:

It sets the cnegcrit to -600 and nnegcrit to -60

That's much larger than we are comfortable with. But, this has been how the model has worked for some time, we just didn't notice it as we didn't check for negative values for C and N variables.

@billsacks
Copy link
Member Author

Erik Kluzek < erik@ucar.edu > - 2017-09-19 10:53:26 -0600

Fixed in clm4_5_16_r255

@billsacks
Copy link
Member Author

Bill Sacks < sacks@ucar.edu > - 2017-10-25 07:45:58 -0600

This test is still failing in my branch off of r260, seemingly for the same reason: the death is from this call:

  call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_patch(bounds%begp:bounds%endp), &
                            ns%leafn_patch(bounds%begp:bounds%endp), &
                            pc(bounds%begp:), pn(bounds%begp:), __LINE__, &
                            c13=c13cs%leafc_patch, c14=c14cs%leafc_patch, &
                            pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) )

@billsacks
Copy link
Member Author

Bill Sacks < sacks@ucar.edu > - 2017-10-25 07:46:59 -0600

It looks like the proposed changes didn't make it into the code:

real(r8), public :: ccrit = 1.e-8_r8 ! critical carbon state value for truncation (gC/m2)
real(r8), public :: cnegcrit = -6.e+1_r8 ! critical negative carbon state value for abort (gC/m2)
real(r8), public :: ncrit = 1.e-8_r8 ! critical nitrogen state value for truncation (gN/m2)
real(r8), public :: nnegcrit = -6.e+0_r8 ! critical negative nitrogen state value for abort (gN/m2)

@billsacks billsacks added the bug label Jan 19, 2018
@billsacks billsacks added bug something is working incorrectly and removed type: bug - science labels Feb 8, 2018
@ekluzek
Copy link
Collaborator

ekluzek commented Feb 23, 2018

It's actually set in the namelist defaults.

<ncrit    phys="clm5_0" use_cn=".true.">1.d-9</ncrit>
<cnegcrit phys="clm5_0" use_cn=".true.">-6.d+1</cnegcrit>
<nnegcrit phys="clm5_0" use_cn=".true.">-6.d+0</nnegcrit>
<cnegcrit phys="clm4_5" use_cn=".true.">-6.d+2</cnegcrit>
<nnegcrit phys="clm4_5" use_cn=".true.">-6.d+1</nnegcrit>

But it looks like it doesn't actually make it into the actual namelist for some reason, even though as far as I can tell it should.

@ekluzek
Copy link
Collaborator

ekluzek commented Feb 23, 2018

These are the changes needed to get the namelist working correctly:

diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm
index a831476..626a0bc 100755
--- a/bld/CLMBuildNamelist.pm
+++ b/bld/CLMBuildNamelist.pm
@@ -2105,7 +2105,7 @@ sub setup_logic_cnfire {
 sub setup_logic_cnprec {
   my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
 
-  if ( $physv->as_long() >= $physv->as_long("clm5_0") && &value_is_true($nl->get_value('use_cn')) ) {
+  if ( $physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true($nl_flags->{'use_cn'}) ) {
      add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults,
                  $nl, 'ncrit', 'use_cn'=>$nl_flags->{'use_cn'});
      add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults,
diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml
index f78b54e..325c358 100644
--- a/bld/namelist_files/namelist_defaults_clm4_5.xml
+++ b/bld/namelist_files/namelist_defaults_clm4_5.xml
@@ -434,6 +434,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
 <use_nguardrail phys="clm5_0" use_cn=".true." >.true.</use_nguardrail>
 
 <ncrit    phys="clm5_0" use_cn=".true.">1.d-9</ncrit>
+<ncrit    phys="clm4_5" use_cn=".true.">1.d-8</ncrit>
 <cnegcrit phys="clm5_0" use_cn=".true.">-6.d+1</cnegcrit>
 <nnegcrit phys="clm5_0" use_cn=".true.">-6.d+0</nnegcrit>
 <cnegcrit phys="clm4_5" use_cn=".true.">-6.d+2</cnegcrit>

@billsacks
Copy link
Member Author

@ekluzek this is fixed due to #333 and so should be closed, right?

@ekluzek
Copy link
Collaborator

ekluzek commented Apr 10, 2018

Fixed in clm5.0.dev0004

@ekluzek ekluzek closed this as completed Apr 10, 2018
slevis-lmwg added a commit to slevis-lmwg/ctsm that referenced this issue Feb 18, 2023
Remove mml or MML prefix from SLIM history fields
samsrabin pushed a commit to samsrabin/CTSM that referenced this issue Apr 19, 2024
changes for cmeps threading
### Description of changes
Add the SetVM needed for nuopc threading.  The cdeps routines have no openmp sections so this is only for compatibility with the updated cmeps code. 

### Specific notes

Contributors other than yourself, if any:

CMEPS Issues Fixed (include github issue #):

Are there dependencies on other component PRs
 - [ ] CIME (list)
 - [ ] CMEPS (list) 

Are changes expected to change answers?
 - [X] bit for bit
 - [ ] different at roundoff level
 - [ ] more substantial 

Any User Interface Changes (namelist or namelist defaults changes)?
 - [ ] Yes
 - [X] No

Testing performed:
- [X] (required) aux_cdeps
   - machines and compilers: cheyenne intel, created baseline apr05
   - details (e.g. failed tests):
- [ ] (optional) CESM prealpha test
   - machines and compilers
   - details (e.g. failed tests):

Hashes used for testing:
- [ ] CIME
  - repository to check out: https://github.com/ESCOMP/CESM.git
  - branch: 
  - hash:6eac99c34e69
- [ ] CMEPS
  - repository to check out: https://github.com/ESCOMP/CESM.git
  - branch: nuopc_dev
  - hash:2ece713a1958
- [ ] CESM
  - repository to check out: https://github.com/ESCOMP/CESM.git
  - branch: nuopc_dev
  - hash:
ekluzek added a commit to jedwards4b/ctsm that referenced this issue Nov 21, 2024
50bd54c63 Bump to 0.9.3
1e0c40a46 Merge pull request ESCOMP#66 from ESMCI/poetry_and_test_update
135770709 strip strip
e7f9a261c fix issue 65
b1568e724 update poetry certifi version and update tests failing due to mpi-serial update

git-subtree-dir: .lib/git-fleximod
git-subtree-split: 50bd54c63e38c52e0bfc4a1d6bc6cb0eea6cf645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is working incorrectly
Projects
None yet
Development

No branches or pull requests

2 participants