Skip to content

Commit

Permalink
Add a check that figures out the value of fv where the wind threshold…
Browse files Browse the repository at this point in the history
… won't be met and dust will be zero
  • Loading branch information
ekluzek committed May 22, 2024
1 parent f2500c7 commit 1ba3473
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions src/biogeochem/test/DustEmis_test/test_DustEmis.pf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module test_DustEmis
use WaterType, only : water_type
use FrictionVelocityMod, only : frictionvel_type
use unittestWaterTypeFactory, only : unittest_water_type_factory_type
use abortutils, only : endrun

implicit none

Expand Down Expand Up @@ -267,7 +266,6 @@ contains
/ this%frictionvel_inst%fv_patch(p)
call this%dust_emis%WritePatchToLog( p )
end do
call endrun( "exit early")
end subroutine print_values

!-----------------------------------------------------------------------
Expand Down Expand Up @@ -327,16 +325,43 @@ contains

end subroutine check_dust_emis

!-----------------------------------------------------------------------

@Test
subroutine dust_zero_for_fixed_ratio(this)
! Check dust emissions are zero for a no wind
class(TestDustEmis), intent(inout) :: this
integer :: p
real(r8) :: flx_mss_vrt_dst_tot
real(r8) :: fv
real(r8) :: SaltationFactor

call this%create_atm2lnd()
call this%dust_emis%GetConstVars( SaltationFactor )
! Figure out what fv needs to be so that the wind threshold will be u10*(1/(1-eps))
fv = ( SaltationFactor / sqrt( this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc)) ) - 1.d-15
call this%create_fv( fv=fv )
call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, &
this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, &
this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst)
call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst)
call this%print_values()
do p = bounds%begp, bounds%endp
call this%validate_patch(p)
call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot )
@assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 )
end do

end subroutine dust_zero_for_fixed_ratio

!-----------------------------------------------------------------------

@Test
subroutine check_dust_emis_increasing_wind(this)
! Check dust emissions with increasing wind
class(TestDustEmis), intent(inout) :: this
integer :: p, c
real(r8) :: flx_mss_vrt_dst_tot
real(r8) :: vlc_trb_1
real(r8) :: vlc_trb_2
real(r8) :: vlc_trb_3
real(r8) :: vlc_trb_4
real(r8) :: fv = 4.0_r8
real(r8) :: u10 = 10._r8
real(r8) :: total_dust0, total_dust_higher
Expand Down

0 comments on commit 1ba3473

Please sign in to comment.