Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

ERROR: carbon or nitrogen state critically negative

johanna_teresa

Johanna Malle
New Member
Hi,
I am running CLM5 on a local linux machine, and have done so successfully with SP mode. I am running it on a custom grid, for which I have created my own surface data/domain files and forcing data. However, recently I attempted to set up a BGC case, and keep running into the problem of carbon patch turning negative, beyond the critical cnegcrit value after ~600 timesteps (using 3hr time-steps) - see the attached lnd.log. I have tried switching to the CLM4.5 cnegcrit limits (600 instead of 60), but it only takes a bit longer before it crashes. I have also tried using different forcing datasets (all of which work with SP mode) which does not appear to be the problem. It also looked at the development of leafc over time, which starts out normal and decreases pretty much linearly until it hits the critical value. Do you have any idea what could be the problem/what I am doing wrong? When looking into this I found this issue: Clm45BgcCrop case dies due to negative leafn · Issue #66 · ESCOMP/CTSM, but this was fixed so I don't think it is the problem. Any help with this would be appreciated.
Thanks a lot,
Johanna
 

Attachments

  • config_files.zip
    22.7 KB · Views: 1
  • lnd.log.zip
    52.8 KB · Views: 3
  • version_info.txt
    8.2 KB · Views: 1

oleson

Keith Oleson
CSEG and Liaisons
Staff member
I see this in your lnd log:

dtime = 10800

which I think implies that you are running the model at 3-hourly time steps? I don't have any experience with running the model at time steps longer than 1 hour. There are a number of phenology triggers in the crop model code and probably elsewhere that may not work correctly with longer time steps.
We had a similar error in negative leaf carbon caused by this issue:


In that case a twenty minute time step was used which exposed a bug in the phenology code. I think this bug was fixed in a tag later than the one you are using so you could try implementing the bug fix in your code, but running at a 3-hourly time step in BGC mode may still not work well.
 

johanna_teresa

Johanna Malle
New Member
Thanks for the reply! Yes, I was running the model at 3-hourly time steps, but have now also tried it with 1-hourly time steps. The model runs for longer but I get the same error eventually. Weirdly it happens around the same date/time, which now makes me think it could be a problem with some input data which was somehow no problematic in the SP run. I will try implementing the bug fix in my code, thanks for the suggestion!
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
One other thing you could try is a cold start (finidat = ' '). Maybe there is a problem on initialization.
 

johanna_teresa

Johanna Malle
New Member
I implemented the suggested bug fix which in combination with running at 1hour time steps fixed my problem - the model has now ran for >50 years successfully. Thanks again!
 

AnuNTNU

Anusha Sathyanadh
New Member
Let me first tell you how I started getting error. I am trying to incorporate biocrops miscanthus and switchgrass to CLM5 and running CLM5 with NorESM2. I modified my original CNPhenology file (all 4 of them) with the one from here, CLM5_bioenergy/user_mods at master · IMMM-SFA/CLM5_bioenergy. Then I succesfully run the model for 5 days. But when I try to run it for a month, i get the below error. But it seems from the F90 file that it is realted to grain C and N. I still tried the bug fix, So I made all the 6 additions to my CNPhenology.F90 and now I get error while building the model itself. Any suggestions?
ERROR: Carbon or Nitrogen patch negative = 0.000000000000000E+000
-79.9550895382736
ERROR: limits = -60.0000000000000 -6.00000000000000
ENDRUN:
ERROR:
ERROR: carbon or nitrogen state critically negative ERROR in CNPrecisionControlMod.F90 at line 248
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
As noted in the posts above, the bug fix I mentioned was to fix a specific problem with running at a time step interval different from the interval on the restart file. Is that what you are doing?
Miscanthus and switchgrass have already been incorporated into CLM:


Can you use a more recent version of CLM? Otherwise, I recommend sorting through that pull request to see all of the changes that were made.
 

AnuNTNU

Anusha Sathyanadh
New Member
No, that is not my problem then. I havent used any restart files yet on this particular case. I am using CLM5 inside NorESM2-LM in an SSP534 simulation. If these biocrops are active, why the default parameter file (inputdata/lnd/clm2/paramdata/clm5_params.c171117.nc),has some parameter values NaN. Which version of CLM do you suggest me to update ? And may I know what is the difference between Add two bioenergy crops (switchgrass and Miscanthus) by yanyanchengHydro · Pull Request #884 · ESCOMP/CTSM and CLM5_bioenergy/user_mods at master · IMMM-SFA/CLM5_bioenergy ? I can only see the files are different.
 

oleson

Keith Oleson
CSEG and Liaisons
Staff member
It looks like the bioenergy crops came in with ctsm1.0.dev097, so you'd need to update at least to that.
Along with that there would have been an update to the parameter file.
I don't know what the CLM5_bioenergy repository is, I'd contact the author.
 

AnuNTNU

Anusha Sathyanadh
New Member
Thanks a lot. NorESM2 (the one i am using is 2.0.6) is based on the second version of the Community Earth System Model (CESM2.1).I am able to read the most updated parameter file in my compset.
 
Top