Skip to content

Commit

Permalink
modified shr_fire_emis_mod for fire branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Dec 1, 2022
1 parent 63f3ea8 commit 61b9568
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/drivers/mct/shr/shr_fire_emis_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ module shr_fire_emis_mod
character(len=name_len) :: name ! emissions component name (in fire emissions input table)
integer :: index
real(r8), pointer :: emis_factors(:) ! function of plant-function-type (PFT)
real(r8) :: coeff ! emissions component coeffecient
real(r8) :: molec_weight ! molecular weight of the fire emissions compound (g/mole)
type(shr_fire_emis_comp_t), pointer :: next_emiscomp ! points to next member in the linked list
endtype shr_fire_emis_comp_t
Expand All @@ -50,6 +49,7 @@ module shr_fire_emis_mod
type shr_fire_emis_mechcomp_t
character(len=name_len) :: name ! compound name
type(shr_fire_emis_comp_ptr), pointer :: emis_comps(:) ! an array of pointers to fire emis components
real(r8), pointer :: coeffs(:) ! emissions components coeffecients
integer :: n_emis_comps ! number of fire emis compounds that make up the emissions for this mechanis compound
end type shr_fire_emis_mechcomp_t

Expand Down Expand Up @@ -194,9 +194,12 @@ subroutine shr_fire_emis_init( specifier, emis_fields )
endif
shr_fire_emis_mechcomps(i)%n_emis_comps = item%n_terms
allocate(shr_fire_emis_mechcomps(i)%emis_comps(item%n_terms))
allocate(shr_fire_emis_mechcomps(i)%coeffs(item%n_terms))

shr_fire_emis_mechcomps(i)%coeffs(:) = item%coeffs(:)

do j = 1,item%n_terms
shr_fire_emis_mechcomps(i)%emis_comps(j)%ptr => add_emis_comp( item%vars(j), item%coeffs(j) )
shr_fire_emis_mechcomps(i)%emis_comps(j)%ptr => add_emis_comp( item%vars(j) )
enddo
shr_fire_emis_mechcomps_n = shr_fire_emis_mechcomps_n+1

Expand Down Expand Up @@ -226,10 +229,9 @@ end subroutine shr_fire_emis_init

!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
function add_emis_comp( name, coeff ) result(emis_comp)
function add_emis_comp( name ) result(emis_comp)

character(len=*), intent(in) :: name
real(r8), intent(in) :: coeff
type(shr_fire_emis_comp_t), pointer :: emis_comp

emis_comp => get_emis_comp_by_name(shr_fire_emis_linkedlist, name)
Expand All @@ -247,7 +249,6 @@ function add_emis_comp( name, coeff ) result(emis_comp)
emis_comp%index = shr_fire_emis_comps_n+1

emis_comp%name = trim(name)
emis_comp%coeff = coeff
nullify(emis_comp%next_emiscomp)

call add_emis_comp_to_list(emis_comp)
Expand Down

0 comments on commit 61b9568

Please sign in to comment.