Skip to content

Balance check doesn't check for possible errors in all points #55

@billsacks

Description

@billsacks

Bill Sacks < sacks@ucar.edu > - 2017-01-26 09:44:05 -0700
Bugzilla Id: 2415
Bugzilla CC: dlawren@ucar.edu, l.vankampenhout@uu.nl, oleson@ucar.edu, rfisher@ucar.edu,

Leo pointed this out, and I agree with his assessment:

I noticed that the following code from BalanceCheckMod does not check on the maximum error over all columns, merely checks the last column found.
So there is a possibility that the abort is not triggered when it should have been.

   ! Soil energy balance check

   found = .false.
   do c = bounds%begc,bounds%endc
      if (col%active(c)) then
         if (abs(errsoi_col(c)) > 1.0e-6_r8 ) then
            found = .true.
            indexc = c
         end if
      end if
   end do
   if ( found ) then
      write(iulog,*)'WARNING: BalanceCheck: soil balance error (W/m2)'
      write(iulog,*)'nstep         = ',nstep
      write(iulog,*)'errsoi_col    = ',errsoi_col(indexc)
      if (abs(errsoi_col(indexc)) > 1.e-4_r8 .and. (nstep > 2) ) then
         write(iulog,*)'clm model is stopping'
         call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__))
      end if
   end if

We should change this code (and other code in BalanceCheck mod if there is other code that follows this pattern) to check for the maximum error across all points.

Metadata

Metadata

Assignees

Labels

bfbbit-for-bitenhancementnew capability or improved behavior of existing capabilitypriority: highHigh priority to fix/merge soon, e.g., because it is a problem in important configurations

Type

No type

Projects

Status

Done (non release/external)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions