Skip to content

Commit

Permalink
Add an empty unit tester for DUSTMod
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed May 17, 2024
1 parent 8964b0b commit 21f38b4
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/biogeochem/test/DustEmis_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set (pfunit_sources
test_DustEmis.pf)

add_pfunit_ctest(DustEmis
TEST_SOURCES "${pfunit_sources}"
LINK_LIBRARIES clm csm_share esmf_wrf_timemgr)
34 changes: 34 additions & 0 deletions src/biogeochem/test/DustEmis_test/test_DustEmis.pf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module test_DustEmis

! Tests of DustEmis

use funit
use DUSTMod
use shr_kind_mod , only : r8 => shr_kind_r8

implicit none

@TestCase
type, extends(TestCase) :: TestDustEmis
contains
procedure :: setUp
procedure :: tearDown
end type TestDustEmis

contains

subroutine setUp(this)
class(TestDustEmis), intent(inout) :: this
end subroutine setUp

subroutine tearDown(this)
class(TestDustEmis), intent(inout) :: this
end subroutine tearDown

@Test
subroutine check_dust_emis(this)
class(TestDustEmis), intent(inout) :: this

end subroutine check_dust_emis

end module test_DustEmis
88 changes: 88 additions & 0 deletions src/unit_test_stubs/share_esmf/ZenderSoilErodStreamType.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module ZenderSoilErodStreamType

!-----------------------------------------------------------------------
! !DESCRIPTION:
! UNIT-TEST STUB for ZenderSoilErodStreamType
!
! !USES
use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl
use shr_log_mod , only : errMsg => shr_log_errMsg
use abortutils , only : endrun
use decompMod , only : bounds_type

! !PUBLIC TYPES:
implicit none
private

type, public :: soil_erod_stream_type
contains

! !PUBLIC MEMBER FUNCTIONS:
procedure, public :: Init ! Initialize and read data in
procedure, public :: CalcDustSource ! Calculate dust source spatial filter (basically truncating stream data value smaller than 0.1 following CAM's practice) based on input streams
procedure, public :: UseStreams ! If streams will be used

end type soil_erod_stream_type

character(len=*), parameter, private :: sourcefile = &
__FILE__

!==============================================================================
contains
!==============================================================================

subroutine Init(this, bounds, NLFilename)
!
! Initialize the Zender soil eroditability stream object
!
! Uses:
!
! arguments
implicit none
class(soil_erod_stream_type) :: this
type(bounds_type), intent(in) :: bounds
character(len=*), intent(in) :: NLFilename ! Namelist filename
!
! local variables
!-----------------------------------------------------------------------

end subroutine Init

!==============================================================================
logical function UseStreams(this)
!
! !DESCRIPTION:
! Return true if the Zender method is being used and the soil erodability
! file is being used with it
!
! !USES:
!
! !ARGUMENTS:
implicit none
class(soil_erod_stream_type) :: this
!
! !LOCAL VARIABLES:
UseStreams = .false.
end function UseStreams

!==============================================================================
subroutine CalcDustSource(this, bounds, soil_erod)
!
! !DESCRIPTION:
! Calculate the soil eroditability for the Zender dust method.
!
! !USES:
!USES
!
! !ARGUMENTS:
implicit none
class(soil_erod_stream_type) :: this
type(bounds_type) , intent(in) :: bounds
real(r8) , intent(inout) :: soil_erod(bounds%begc:) ! [fraction] rock drag partition factor (roughness effect)
!
! !LOCAL VARIABLES:
!---------------------------------------------------------------------

end subroutine CalcDustSource

end module ZenderSoilErodStreamType

0 comments on commit 21f38b4

Please sign in to comment.