Skip to content

Commit

Permalink
Merge pull request #24 from arnoldjjms/main
Browse files Browse the repository at this point in the history
Revised initialization of residue and soil litter.
  • Loading branch information
arnoldjjms authored Nov 14, 2024
2 parents 370c1a4 + 914687a commit 1c25953
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 75 deletions.
1 change: 0 additions & 1 deletion src/actions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,6 @@ subroutine actions (ob_cur, ob_num, idtbl)
ilu = d_tbl%act_typ(iac)
hru(j)%land_use_mgt = ilu
hru(j)%dbs%land_use_mgt = ilu
!hru(j)%dbsc%land_use_mgt
lu_prev = hru(j)%land_use_mgt_c
hru(j)%land_use_mgt_c = d_tbl%act(iac)%file_pointer
isol = hru(j)%dbs%soil
Expand Down
74 changes: 37 additions & 37 deletions src/organic_mineral_mass_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module organic_mineral_mass_module
character (len=16) :: name = ""
real :: tot_mn = 0. ! |total mineral n pool (no3+nh4) in soil profile
real :: tot_mp = 0. ! |mineral p pool (wsol+lab+act+sta) in soil profile
real :: salt = 0. ! |total salt amount (kg/ha) in soil profile
type (organic_mass) :: tot_org ! |total organics in soil profile
real, dimension(:), allocatable :: sw !mm |soil water dimensioned by layer
real, dimension(:), allocatable :: cbn !% |percent carbon
Expand Down Expand Up @@ -92,13 +93,14 @@ module organic_mineral_mass_module
type (organic_mass) :: bsn_org_rsd ! |total residue organics in basin
real :: bsn_mn = 0. ! |total mineral n pool (no3+nh4) in soil profile
real :: bsn_mp = 0. ! |mineral p pool (wsol+lab+act+sta) in soil profile

type (organic_mass) :: decomp ! |temporary storage for residue decomp

type residue_mass1 !surface residue
character (len=16) :: name = ""
type (organic_mass), dimension(:), allocatable :: tot ! |total mass surface residue litter pool-dimensioned by plant
type (organic_mass), dimension(:), allocatable :: meta ! |metabolic litter pool-dimensioned by plant
type (organic_mass), dimension(:), allocatable :: str ! |structural litter pool-dimensioned by plant
type (organic_mass), dimension(:), allocatable :: lignin ! |lignin pool-dimensioned by plant
type (organic_mass), dimension(:), allocatable :: lignin ! |lignin pool-dimensioned by plant
type (organic_mass) :: tot_com !kg/ha |total
type (organic_mass) :: tot_meta ! |
type (organic_mass) :: tot_str ! |
Expand Down Expand Up @@ -366,6 +368,39 @@ function om_add1 (o_m1, o_m2) result (o_m3)
o_m3%p = o_m1%p + o_m2%p
end function om_add1

!! subtract organic mass
function om_subtract (o_m1, o_m2) result (o_m3)
type (organic_mass), intent (in) :: o_m1
type (organic_mass), intent (in) :: o_m2
type (organic_mass) :: o_m3
o_m3%m = o_m1%m - o_m2%m
o_m3%c = o_m1%c - o_m2%c
o_m3%n = o_m1%n - o_m2%n
o_m3%p = o_m1%p - o_m2%p
end function om_subtract

!! multiply organic mass by a constant
function om_mult_const (const, o_m1) result (o_m2)
real, intent (in) :: const
type (organic_mass), intent (in) :: o_m1
type (organic_mass) :: o_m2
o_m2%m = const * o_m1%m
o_m2%c = const * o_m1%c
o_m2%n = const * o_m1%n
o_m2%p = const * o_m1%p
end function om_mult_const

!! divide organic mass by a constant
function om_divide (o_m1, const) result (o_m2)
type (organic_mass), intent (in) :: o_m1
real, intent (in) :: const
type (organic_mass) :: o_m2
o_m2%m = o_m1%m / const
o_m2%c = o_m1%c / const
o_m2%n = o_m1%n / const
o_m2%p = o_m1%p / const
end function om_divide

!! add org_flux
function org_flux_add1 (org_flux1, org_flux2) result (org_flux3)
type (organic_flux), intent (in) :: org_flux1
Expand Down Expand Up @@ -409,40 +444,5 @@ function org_flux_add1 (org_flux1, org_flux2) result (org_flux3)
org_flux3%co2fs2 = org_flux1%co2fs2 + org_flux2%co2fs2
org_flux3%co2fs3 = org_flux1%co2fs3 + org_flux2%co2fs3
end function org_flux_add1

!! subtract organic mass
function om_subtract (o_m1, o_m2) result (o_m3)
type (organic_mass), intent (in) :: o_m1
type (organic_mass), intent (in) :: o_m2
type (organic_mass) :: o_m3
o_m3%m = o_m1%m - o_m2%m
o_m3%c = o_m1%c - o_m2%c
o_m3%n = o_m1%n - o_m2%n
o_m3%p = o_m1%p - o_m2%p
end function om_subtract

!! multiply organic mass by a constant
function om_mult_const (const, o_m1) result (o_m2)
real, intent (in) :: const
type (organic_mass), intent (in) :: o_m1
type (organic_mass) :: o_m2
o_m2%m = const * o_m1%m
o_m2%c = const * o_m1%c
o_m2%n = const * o_m1%n
o_m2%p = const * o_m1%p
end function om_mult_const

!! divide organic mass by a constant
function om_divide (o_m1, const) result (o_m2)
type (organic_mass), intent (in) :: o_m1
real, intent (in) :: const
type (organic_mass) :: o_m2
o_m2%m = o_m1%m / const
o_m2%c = o_m1%c / const
o_m2%n = o_m1%n / const
o_m2%p = o_m1%p / const
end function om_divide



end module organic_mineral_mass_module
25 changes: 21 additions & 4 deletions src/plant_init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,28 @@ subroutine plant_init (init, iihru)
pcom(j)%plcur(ipl)%gro = pcomdb(icom)%pl(ipl)%igro
pcom(j)%plcur(ipl)%idorm = "y"
idp = pcomdb(icom)%pl(ipl)%db_num

!! initialize fresh organic residue pools
rsd1(j)%tot(ipl)%m = pcomdb(icom)%pl(ipl)%rsdin
!set fresh organic pools--assume cn ratio = 57 and cp ratio = 300
rsd1(j)%tot(ipl)%c = 0.43 * rsd1(j)%tot(ipl)%m
rsd1(j)%tot(ipl)%n = 0.43 * rsd1(j)%tot(ipl)%m / 57.
rsd1(j)%tot(ipl)%p = 0.43 * rsd1(j)%tot(ipl)%m / 300.
rsd1(j)%tot(ipl)%c = 0.42 * rsd1(j)%tot(ipl)%m

!! metabolic residue
rsd1(j)%meta(ipl)%m = 0.85 * rsd1(j)%tot(ipl)%m
rsd1(j)%meta(ipl)%c = 0.85 * rsd1(j)%tot(ipl)%c
rsd1(j)%meta(ipl)%n = rsd1(j)%meta(ipl)%c / 10. !assume 10:1 C:N ratio (EPIC)
rsd1(j)%meta(ipl)%p = rsd1(j)%meta(ipl)%c / 100.

!! structural residue
rsd1(j)%str(ipl)%m = 0.15 * rsd1(j)%tot(ipl)%m
rsd1(j)%str(ipl)%c = 0.15 * rsd1(j)%tot(ipl)%c
rsd1(j)%str(ipl)%n = rsd1(j)%str(ipl)%c / 150. !assume 150:1 C:N ratio (EPIC)
rsd1(j)%str(ipl)%p = rsd1(j)%str(ipl)%c / 1500.

!! lignin residue
rsd1(j)%lignin(ipl)%m = 0.8 * rsd1(j)%str(ipl)%m
rsd1(j)%lignin(ipl)%c = 0.8 * rsd1(j)%str(ipl)%c !assume 80% Stuctural C is Lignin
rsd1(j)%lignin(ipl)%n = 0.2 * rsd1(j)%str(ipl)%n
rsd1(j)%lignin(ipl)%p = 0.02 * rsd1(j)%str(ipl)%p

! set heat units to maturity
! first compute base0 units for entire year
Expand Down
12 changes: 9 additions & 3 deletions src/rsd_decomp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,15 @@ subroutine rsd_decomp

!! apply decay to all carbon pools
if (bsn_cc%cswat == 2) then
rsd1(j)%meta(ipl) = (1. - decr) * rsd1(j)%meta(ipl)
rsd1(j)%str(ipl) = (1. - decr) * rsd1(j)%str(ipl)
rsd1(j)%lignin(ipl) = (1. - decr) * rsd1(j)%lignin(ipl)
decomp = decr * rsd1(j)%meta(ipl)
rsd1(j)%meta(ipl) = rsd1(j)%meta(ipl) - decomp
soil1(j)%meta(1) = soil1(j)%meta(1) + decomp
decomp = decr * rsd1(j)%str(ipl)
rsd1(j)%str(ipl) = rsd1(j)%str(ipl) - decomp
soil1(j)%str(1) = soil1(j)%str(1) + decomp
decomp = decr * rsd1(j)%lignin(ipl)
rsd1(j)%lignin(ipl) = rsd1(j)%lignin(ipl) - decomp
soil1(j)%lig(1) = soil1(j)%lig(1) + decomp
end if

!! mineralization of residue n and p
Expand Down
46 changes: 16 additions & 30 deletions src/soil_nutcarb_init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -150,48 +150,34 @@ subroutine soil_nutcarb_init (isol)

!initialize passive humus pool
soil1(ihru)%hp(ly)%m = frac_hum_passive * soil1(ihru)%tot(ly)%m
soil1(ihru)%hp(ly)%c = .42 * frac_hum_passive * soil1(ihru)%tot(ly)%c !assume 42% C
soil1(ihru)%hp(ly)%n = soil1(ihru)%hp(ly)%c / 10. !assume 10:1 C:N ratio
soil1(ihru)%hp(ly)%p = soil1(ihru)%hp(ly)%c / 80. !assume 80:1 C:P ratio
soil1(ihru)%hp(ly)%c = frac_hum_passive * soil1(ihru)%tot(ly)%c
soil1(ihru)%hp(ly)%n = soil1(ihru)%hp(ly)%c / 10. !assume 10:1 C:N ratio
soil1(ihru)%hp(ly)%p = soil1(ihru)%hp(ly)%c / 80. !assume 80:1 C:P ratio

!initialize slow humus pool
soil1(ihru)%hs(ly)%m = frac_hum_slow * soil1(ihru)%tot(ly)%m
soil1(ihru)%hs(ly)%c = .42 * frac_hum_slow * soil1(ihru)%tot(ly)%c !assume 42% C
soil1(ihru)%hs(ly)%n = soil1(ihru)%hs(ly)%c / 10. !assume 10:1 C:N ratio
soil1(ihru)%hs(ly)%p = soil1(ihru)%hs(ly)%c / 80. !assume 80:1 C:P ratio
soil1(ihru)%hs(ly)%c = frac_hum_slow * soil1(ihru)%tot(ly)%c
soil1(ihru)%hs(ly)%n = soil1(ihru)%hs(ly)%c / 10. !assume 10:1 C:N ratio
soil1(ihru)%hs(ly)%p = soil1(ihru)%hs(ly)%c / 80. !assume 80:1 C:P ratio

!initialize microbial pool
soil1(ihru)%microb(ly)%m = frac_hum_microb * soil1(ihru)%tot(ly)%m
soil1(ihru)%microb(ly)%c = .42 * frac_hum_microb * soil1(ihru)%tot(ly)%c !assume 42% C
soil1(ihru)%microb(ly)%c = frac_hum_microb * soil1(ihru)%tot(ly)%c
soil1(ihru)%microb(ly)%n = soil1(ihru)%microb(ly)%c / 8. !assume 8:1 C:N ratio
soil1(ihru)%microb(ly)%p = soil1(ihru)%microb(ly)%c / 80. !assume 80:1 C:P ratio

!initialize metabolic litter pool
soil1(ihru)%meta(ly)%m = soil1(ihru)%tot(ly)%m / 1000. !t/ha - kg/ha
soil1(ihru)%meta(ly)%c = .42 * soil1(ihru)%meta(ly)%c !assume 42% C
soil1(ihru)%meta(ly)%n = soil1(ihru)%meta(ly)%c / 150. !assume 150:1 C:N ratio
soil1(ihru)%meta(ly)%p = soil1(ihru)%meta(ly)%c / 1500. !assume 1500:1 C:P ratio

!initialize structural litter pool
soil1(ihru)%str(ly)%m = soil1(ihru)%meta(ly)%m
soil1(ihru)%str(ly)%c = .42 * soil1(ihru)%str(ly)%c !assume 42% C
soil1(ihru)%str(ly)%n = soil1(ihru)%lig(ly)%c / 150. !assume 150:1 C:N ratio
soil1(ihru)%str(ly)%p = soil1(ihru)%lig(ly)%c / 1500. !assume 1500:1 C:P ratio
!zero metabolic litter pool
soil1(ihru)%meta(ly) = plt_mass_z

!zero structural litter pool
soil1(ihru)%str(ly) = plt_mass_z

!initialize lignon litter pool
soil1(ihru)%lig(ly)%m = .8 * soil1(ihru)%str(ly)%m
soil1(ihru)%lig(ly)%c = .8 * soil1(ihru)%str(ly)%c
soil1(ihru)%lig(ly)%n = .2 * soil1(ihru)%str(ly)%c
soil1(ihru)%lig(ly)%p = .02 * soil1(ihru)%str(ly)%c
!zero lignon litter pool
soil1(ihru)%lig(ly) = plt_mass_z

soil1(ihru)%tot(ly)%c = soil1(ihru)%hs(ly)%c + soil1(ihru)%hp(ly)%c + soil1(ihru)%microb(ly)%c + &
soil1(ihru)%meta(ly)%c + soil1(ihru)%str(ly)%c + soil1(ihru)%lig(ly)%c
!initialize water soluble pool
!soil1(ihru)%water(ly)%m =
!soil1(ihru)%water(ly)%c =
!soil1(ihru)%water(ly)%n =
!soil1(ihru)%water(ly)%p =

soil1(ihru)%meta(ly)%c + soil1(ihru)%str(ly)%c

end do

return
Expand Down

0 comments on commit 1c25953

Please sign in to comment.