Skip to content

Commit

Permalink
Get unit tests to work again
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Jun 4, 2024
1 parent b3b8e08 commit 4a06a23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/biogeochem/test/DustEmis_test/test_DustEmisBase.pf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module test_DustEmisBase
use WaterType, only : water_type
use FrictionVelocityMod, only : frictionvel_type
use unittestWaterTypeFactory, only : unittest_water_type_factory_type
use SoilStateInitTimeConstMod, only : ThresholdSoilMoist, ThresholdSoilMoistKok2014, MassFracClay
use SoilStateInitTimeConstMod, only : ThresholdSoilMoistZender2003, ThresholdSoilMoistKok2014, MassFracClay

implicit none

Expand Down Expand Up @@ -156,7 +156,7 @@ contains
! considered bedrock
col%nbedrock(c) = nlevsoi

this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoist( clay )
this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay )
this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay )
end do

Expand Down
4 changes: 2 additions & 2 deletions src/biogeophys/SoilStateInitTimeConstMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,11 @@ real(r8) function ThresholdSoilMoistZender2003( clay )
real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%)

if ( clay < 0.0_r8 .or. clay > 100.0_r8 )then
ThresholdSoilMoist = nan
ThresholdSoilMoistZender2003 = nan
call endrun( 'Clay fraction is out of bounds (0 to 100)')
return
end if
ThresholdSoilMoist = 0.17_r8 + 0.14_r8 * clay * 0.01_r8
ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * clay * 0.01_r8
end function ThresholdSoilMoistZender2003

!------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ contains
real(r8) :: value
character(len=100) :: expected_msg

value = ThresholdSoilMoist( -1.e-15_r8 )
value = ThresholdSoilMoistZender2003( -1.e-15_r8 )
expected_msg = "ABORTED: Clay fraction is out of bounds (0 to 100)"
@assertExceptionRaised(expected_msg)
value = ThresholdSoilMoist( 1._r8 + 1.-15_r8 )
value = ThresholdSoilMoistZender2003( 1._r8 + 1.-15_r8 )
@assertExceptionRaised(expected_msg)
end subroutine TestClayOutOfRangeThreshold

Expand All @@ -45,9 +45,9 @@ contains
class(TestDustEmisSoilFunctions), intent(inout) :: this
real(r8) :: value

value = ThresholdSoilMoist( 0.0_r8 )
value = ThresholdSoilMoistZender2003( 0.0_r8 )
@assertEqual( value, 0.17_r8, tolerance=tol )
value = ThresholdSoilMoist( 100.0_r8 )
value = ThresholdSoilMoistZender2003( 100.0_r8 )
@assertEqual( value, 0.31_r8, tolerance=tol )
end subroutine TestThresholdValues

Expand Down

0 comments on commit 4a06a23

Please sign in to comment.