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

decomp_cpools_vr_col is NaN

samrabin

Sam Rabin
Member
Today on the software engineering standup, I mentioned a problem I was having in SoilBiogeochemPrecisionControl() where the run would crash with a floating-point error on the following line:
Code:
if (abs(cs%decomp_cpools_vr_col(c,j,k)) < ccrit) then
It was suggested that I check to see whether the referenced member of that array was NaN or Inf, and indeed it is NaN.

Bill noticed that the decomp_cpools_vr_col array isn't filled with spval, in SoilBiogeochemCarbonStateType → InitHistory(), for c12 as it is for c13 and c14. I tried the following modification:
Code:
diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90
index 7ef4265a4..0e5147a74 100644
--- a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90
+++ b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90
@@ -158,6 +158,7 @@ contains
        end if

        this%decomp_cpools_col(begc:endc,:) = spval
+       this%decomp_cpools_vr_col(begc:endc,:,:) = spval
        do l  = 1, ndecomp_pools
           if ( nlevdecomp_full > 1 ) then
              data2dptr => this%decomp_cpools_vr_col(:,1:nlevsoi,l)
but unfortunately the same crash happens.

My next course of action is going to be combing the code for all places where decomp_cpools_vr_col is modified, adding an isnan() check after each. Unless, that is, anyone has any ideas? Thanks in advance.

(Also: The array initialization idea I mentioned didn't pan out either.)
 

samrabin

Sam Rabin
Member
I'm not sure exactly of the causal chain here, but I solved this by setting a minimum gddmaturity (heat unit index required for crop maturity, growing degree-days) to 1.0. Note that it only occurred in my experimental branch having to do with crop calendars, so this minimum only applies for runs that don't use the default CLM crop calendars/cultivars.
 
Top