Skip to content

Commit

Permalink
Merge pull request ESCOMP#2552 from ekluzek/dust_emiss_OO
Browse files Browse the repository at this point in the history
Dust emissions moved to Object Oriented (OO) design to enable bringing in the new Dust scheme
  • Loading branch information
ekluzek authored Jun 19, 2024
2 parents 872f65a + c47e7a6 commit b6501da
Show file tree
Hide file tree
Showing 23 changed files with 1,680 additions and 460 deletions.
3 changes: 3 additions & 0 deletions src/biogeochem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ list(APPEND clm_sources
CNPhenologyMod.F90
CNSpeciesMod.F90
CNDVType.F90
DustEmisBase.F90
DustEmisZender2003.F90
DustEmisFactory.F90
CropReprPoolsMod.F90
CropType.F90
CNVegStateType.F90
Expand Down
2 changes: 1 addition & 1 deletion src/biogeochem/CNVegStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ subroutine InitCold(this, bounds)

! --------------------------------------------------------------------
! Initialize terms needed for dust model
! TODO - move these terms to DUSTMod module variables
! TODO - move these terms to DustEmisBase object variables
! --------------------------------------------------------------------

do c = bounds%begc, bounds%endc
Expand Down
2 changes: 1 addition & 1 deletion src/biogeochem/CNVegetationFacade.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module CNVegetationFacade
! - ch4_inst
! - probably not: really seems to belong in soilbiogeochem
! - crop_inst
! - dust_inst
! - dust_emis_inst
! - vocemis_inst
! - fireemis_inst
! - drydepvel_inst
Expand Down
719 changes: 281 additions & 438 deletions src/biogeochem/DUSTMod.F90 → src/biogeochem/DustEmisBase.F90

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions src/biogeochem/DustEmisFactory.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
module DustEmisFactory
!---------------------------------------------------------------------------
!
! Factory to figure out whihc dust emission method to instantiate
!
!---------------------------------------------------------------------------
use abortutils , only : endrun
use shr_log_mod , only : errMsg => shr_log_errMsg
use clm_varctl , only : iulog

implicit none
save
private
!
public :: create_dust_emissions ! create an object of class dust_emis_base

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

contains

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

function create_dust_emissions(bounds, NLFilename) result(dust_emis)
!---------------------------------------------------------------------------
! Create a dust_emission base class objecct
! The method implemented depends on namelist input
!---------------------------------------------------------------------------
use DustEmisBase , only : dust_emis_base_type
use DustEmisZender2003, only : dust_emis_zender2003_type
use clm_varctl , only : dust_emis_method
use decompMod , only : bounds_type
use shr_kind_mod , only : CL => shr_kind_cl
implicit none
! Arguments
class(dust_emis_base_type), allocatable :: dust_emis
type(bounds_type), intent(in) :: bounds
character(len=*), intent(in) :: NLFilename
! Local variables

select case ( trim(dust_emis_method) )

case( "Zender_2003" )
allocate(dust_emis, source=dust_emis_zender2003_type() )

! This will be added when the Leung2023 comes in
!case( "Leung_2023" )
! allocate(dust_emis, source=dust_emis_zender2003_type() )
case default
write(iulog,*) 'ERROR: unknown dust_emis_method: ', dust_emis_method, &
errMsg(sourcefile, __LINE__)
call endrun( "Unrecognized dust_emis_method" )

end select

call dust_emis%Init(bounds, NLFilename)

end function create_dust_emissions

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

end module DustEmisFactory
Loading

0 comments on commit b6501da

Please sign in to comment.