Skip to content

Commit

Permalink
Merge pull request #428 from NCAR/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
arbennett committed Sep 17, 2020
2 parents 1c3b230 + d9d5dd8 commit f36864c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions build/source/engine/mDecisions.f90
Expand Up @@ -299,6 +299,11 @@ subroutine mDecisions(err,message)
OPT_RAD=3 ! option for canopy radiation
OPT_ALB=2 ! option for snow albedo

! set zero option for thee category tables
! NOTE: we want to keep track of these decisions, but not used in the physics routines
model_decisions(iLookDECISIONS%soilCatTbl)%iDecision = 0
model_decisions(iLookDECISIONS%vegeParTbl)%iDecision = 0

! identify the choice of function for the soil moisture control on stomatal resistance
select case(trim(model_decisions(iLookDECISIONS%soilStress)%cDecision))
case('NoahType'); model_decisions(iLookDECISIONS%soilStress)%iDecision = NoahType ! thresholded linear function of volumetric liquid water content
Expand Down
4 changes: 4 additions & 0 deletions build/source/engine/read_force.f90
Expand Up @@ -486,6 +486,10 @@ subroutine readForcingData(currentJulday,ncId,iFile,iRead,nHRUlocal,time_data,fo
! get index in forcing structure
iVar = forcFileInfo(iFile)%var_ix(iNC)
checkForce(iVar) = .true.

! get variable name for error reporting
err=nf90_inquire_variable(ncid,iNC,name=varName)
if(err/=nf90_noerr)then; message=trim(message)//'problem reading forcing variable name from netCDF: '//trim(nf90_strerror(err)); return; endif

! read forcing data for all HRUs
if(simultaneousRead)then
Expand Down
5 changes: 3 additions & 2 deletions build/source/engine/vegNrgFlux.f90
Expand Up @@ -3140,6 +3140,7 @@ subroutine aStability(&
integer(i4b),intent(out) :: err ! error code
character(*),intent(out) :: message ! error message
! local
real(dp), parameter :: verySmall=1.e-10_dp ! a very small number (avoid stability of zero)
real(dp) :: dRiBulk_dAirTemp ! derivative in the bulk Richardson number w.r.t. air temperature (K-1)
real(dp) :: dRiBulk_dSfcTemp ! derivative in the bulk Richardson number w.r.t. surface temperature (K-1)
real(dp) :: bPrime ! scaled "b" parameter for stability calculations in Louis (1979)
Expand Down Expand Up @@ -3188,11 +3189,11 @@ subroutine aStability(&
case(standard)
! compute surface-atmosphere exchange coefficient (-)
if(RiBulk < critRichNumber) stabilityCorrection = (1._dp - 5._dp*RiBulk)**2._dp
if(RiBulk >= critRichNumber) stabilityCorrection = epsilon(stabilityCorrection)
if(RiBulk >= critRichNumber) stabilityCorrection = verySmall
! compute derivative in surface-atmosphere exchange coefficient w.r.t. temperature (K-1)
if(computeDerivative)then
if(RiBulk < critRichNumber) dStabilityCorrection_dRich = (-5._dp) * 2._dp*(1._dp - 5._dp*RiBulk)
if(RiBulk >= critRichNumber) dStabilityCorrection_dRich = 0._dp
if(RiBulk >= critRichNumber) dStabilityCorrection_dRich = verySmall
end if

! (Louis 1979)
Expand Down

0 comments on commit f36864c

Please sign in to comment.