Skip to content

Commit

Permalink
Merge pull request #18 from junhyukjeon/master
Browse files Browse the repository at this point in the history
Nitrogen Update
  • Loading branch information
junhyukjeon authored Aug 7, 2024
2 parents 7345881 + 3eeb9b5 commit e0512fc
Show file tree
Hide file tree
Showing 10 changed files with 382 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/Manifest.toml
/.DS_Store
/.DS_Store
/test.ipynb
19 changes: 17 additions & 2 deletions src/morphology/foliage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,19 @@ Foliage
10 # for poplar?
end ~ preserve(u"cm", parameter)

"Foliage nitrogen ratio"
N_ratio_foliage => 0.03 ~ preserve(parameter)

#=====
Growth
=====#

growthFoliage(NPP, pF) => NPP * pF ~ track(u"kg/ha/hr") # foliage

#========
Mortality
========#

deathFoliage(WF, mF, mortality, stemNo) => begin
mF * mortality * (WF / stemNo)
end ~ track(u"kg/ha/hr", when=flagMortal)
Expand All @@ -57,8 +68,12 @@ Foliage

litterfall(gammaFhour, WF) => gammaFhour * WF ~ track(u"kg/ha/hr")

dWF(growthFoliage, litterfall, deathFoliage, defoliation, thinning_WF, dSen, dBud) => begin
growthFoliage - litterfall - deathFoliage - defoliation - thinning_WF - dSen + dBud
#=====
Weight
=====#

dWF(growthFoliage, N_stress, litterfall, deathFoliage, defoliation, thinning_WF, dSen, dBud) => begin
growthFoliage * N_stress - litterfall - deathFoliage - defoliation - thinning_WF - dSen + dBud
end ~ track(u"kg/ha/hr")

WF(dWF) ~ accumulate(u"kg/ha", init=iWF, min=0) # foliage drymass
Expand Down
3 changes: 1 addition & 2 deletions src/morphology/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
ellipsoidal = 6
end


# @enum WaveBand begin
# photosynthetically_active_radiation = 1
# near_infrared = 2
Expand All @@ -16,7 +15,7 @@ end

# Radiation calculates sunlit and sunshaded areas of the canopy.
@system Radiation begin
leaf_angle => ellipsoidal ~ preserve::LeafAngle(parameter)
leaf_angle => spherical ~ preserve::LeafAngle(parameter)

"ratio of horizontal to vertical axis of an ellipsoid"
LAF: leaf_angle_factor => begin
Expand Down
13 changes: 12 additions & 1 deletion src/morphology/root.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"Average monthly root turnover rate"
gammaR => 0.005 ~ preserve(parameter) # Amichev

"Root nitrogen ratio"
N_ratio_root => 0.01 ~ preserve(parameter)

#=====
Growth
=====#
Expand Down Expand Up @@ -50,7 +53,15 @@
Weight
=====#

dWR(growthRoot, rootTurnover, deathRoot, thinning_WR, dShoot) => growthRoot - rootTurnover - deathRoot - thinning_WR - dShoot ~ track(u"kg/ha/hr")
dWR(growthRoot, N_stress, rootTurnover, deathRoot, thinning_WR, dShoot) => growthRoot * N_stress - rootTurnover - deathRoot - thinning_WR - dShoot ~ track(u"kg/ha/hr")
WR(dWR) ~ accumulate(u"kg/ha", init=iWR, min=0) # root drymass
WR_ton(nounit(WR)) => WR / 1000 ~ track

#==
==#
"Specific root length"
SRL => 20 ~ preserve(parameter, u"cm/g")

"Root length density"
RLD(WR, soil_depth, SRL) => WR / soil_depth * SRL ~ track(u"cm/cm^3")
end
17 changes: 16 additions & 1 deletion src/morphology/stem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,28 @@
"Initial stem drymass"
iWS => 4000 ~ preserve(parameter, u"kg/ha")

"Stem nitrogen ratio"
N_ratio_stem => 0.01 ~ preserve(parameter)

#=====
Growth
=====#

growthStem(NPP, pS) => NPP * pS ~ track(u"kg/ha/hr")

#========
Mortality
========#

deathStem(WS, mS, mortality, stemNo) => begin
mS * mortality * (WS / stemNo)
end ~ track(u"kg/ha/hr", when=flagMortal, max=WS_lim)

dWS(growthStem, deathStem, thinning_WS, dBud, coppicing, dShoot) => growthStem - deathStem - thinning_WS - dBud - coppicing + dShoot ~ track(u"kg/ha/hr")
#=====
Weight
=====#

dWS(growthStem, N_stress, deathStem, thinning_WS, dBud, coppicing, dShoot) => growthStem * N_stress - deathStem - thinning_WS - dBud - coppicing + dShoot ~ track(u"kg/ha/hr")

"Average stem mass"
avStemMass(WS, stemNo) => WS / stemNo ~ track(u"kg")
Expand Down
Loading

0 comments on commit e0512fc

Please sign in to comment.