Skip to content

Commit f36864c

Browse files
authored
Merge pull request #428 from NCAR/develop
Develop
2 parents 1c3b230 + d9d5dd8 commit f36864c

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

build/source/engine/mDecisions.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ subroutine mDecisions(err,message)
299299
OPT_RAD=3 ! option for canopy radiation
300300
OPT_ALB=2 ! option for snow albedo
301301

302+
! set zero option for thee category tables
303+
! NOTE: we want to keep track of these decisions, but not used in the physics routines
304+
model_decisions(iLookDECISIONS%soilCatTbl)%iDecision = 0
305+
model_decisions(iLookDECISIONS%vegeParTbl)%iDecision = 0
306+
302307
! identify the choice of function for the soil moisture control on stomatal resistance
303308
select case(trim(model_decisions(iLookDECISIONS%soilStress)%cDecision))
304309
case('NoahType'); model_decisions(iLookDECISIONS%soilStress)%iDecision = NoahType ! thresholded linear function of volumetric liquid water content

build/source/engine/read_force.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,10 @@ subroutine readForcingData(currentJulday,ncId,iFile,iRead,nHRUlocal,time_data,fo
486486
! get index in forcing structure
487487
iVar = forcFileInfo(iFile)%var_ix(iNC)
488488
checkForce(iVar) = .true.
489+
490+
! get variable name for error reporting
491+
err=nf90_inquire_variable(ncid,iNC,name=varName)
492+
if(err/=nf90_noerr)then; message=trim(message)//'problem reading forcing variable name from netCDF: '//trim(nf90_strerror(err)); return; endif
489493

490494
! read forcing data for all HRUs
491495
if(simultaneousRead)then

build/source/engine/vegNrgFlux.f90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3140,6 +3140,7 @@ subroutine aStability(&
31403140
integer(i4b),intent(out) :: err ! error code
31413141
character(*),intent(out) :: message ! error message
31423142
! local
3143+
real(dp), parameter :: verySmall=1.e-10_dp ! a very small number (avoid stability of zero)
31433144
real(dp) :: dRiBulk_dAirTemp ! derivative in the bulk Richardson number w.r.t. air temperature (K-1)
31443145
real(dp) :: dRiBulk_dSfcTemp ! derivative in the bulk Richardson number w.r.t. surface temperature (K-1)
31453146
real(dp) :: bPrime ! scaled "b" parameter for stability calculations in Louis (1979)
@@ -3188,11 +3189,11 @@ subroutine aStability(&
31883189
case(standard)
31893190
! compute surface-atmosphere exchange coefficient (-)
31903191
if(RiBulk < critRichNumber) stabilityCorrection = (1._dp - 5._dp*RiBulk)**2._dp
3191-
if(RiBulk >= critRichNumber) stabilityCorrection = epsilon(stabilityCorrection)
3192+
if(RiBulk >= critRichNumber) stabilityCorrection = verySmall
31923193
! compute derivative in surface-atmosphere exchange coefficient w.r.t. temperature (K-1)
31933194
if(computeDerivative)then
31943195
if(RiBulk < critRichNumber) dStabilityCorrection_dRich = (-5._dp) * 2._dp*(1._dp - 5._dp*RiBulk)
3195-
if(RiBulk >= critRichNumber) dStabilityCorrection_dRich = 0._dp
3196+
if(RiBulk >= critRichNumber) dStabilityCorrection_dRich = verySmall
31963197
end if
31973198

31983199
! (Louis 1979)

0 commit comments

Comments
 (0)