Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cable pop trendy blaze #435

Draft
wants to merge 6 commits into
base: CABLE-POP_TRENDY
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions core/biogeochem/POP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ MODULE POP_Types
REAL(dp), DIMENSION(NYEAR_HISTORY) :: cat_mortality_history
REAL(dp), DIMENSION(AGEMAX) :: freq_age ! age weighting (by age in y: 0:AGE_MAX-1)
REAL(dp), DIMENSION(AGEMAX) :: biomass_age
REAL(dp) :: rkill
END TYPE Landscape

TYPE POP_TYPE
Expand Down Expand Up @@ -2844,27 +2845,32 @@ SUBROUTINE INTERPOLATE_FIREMORTALITY(pop, disturbance_interval,it,g)
pop%pop_grid(g)%patch(:)%age(1).LT.age_max)
endif


tmp5_min = 0.0_dp
if (i_min.ne.0.and.age_min.ne.0) then
MASK = pop%pop_grid(g)%patch(:)%age(1).eq.age_min
where (MASK)
tmp_array = 1.0_dp
elsewhere
tmp_array = 0.0_dp
endwhere
tmp5_min = SUM(pop%pop_grid(g)%patch(:)%fire_mortality,MASK)/SUM(tmp_array)
if ( any(MASK) ) then
tmp5_min = SUM(pop%pop_grid(g)%patch(:)%fire_mortality,MASK)/SUM(tmp_array)
endif
else
tmp5_min = 0.0_dp
endif

tmp5_max = 0.0_dp
MASK = pop%pop_grid(g)%patch(:)%age(1).eq.age_max
where (MASK)
tmp_array = 1.0_dp
elsewhere
tmp_array = 0.0_dp
endwhere
tmp5_max = SUM(pop%pop_grid(g)%patch(:)%fire_mortality,MASK)/SUM(tmp_array)

if ( any(MASK) ) then
tmp5_max = sum(pop%pop_grid(g)%patch(:)%fire_mortality,MASK)/sum(tmp_array)
endif

fire_mort_age(iage) = tmp5_min + (tmp5_max-tmp5_min)/real(age_max-age_min,dp)* &
real(age(iage)-age_min,dp)

Expand Down Expand Up @@ -2955,6 +2961,17 @@ SUBROUTINE ADJUST_POP_FOR_FIRE(pop,disturbance_interval, burned_area, FLI)
! creates new value for POP%pop_grid(g)%fire_mortality
CALL INTERPOLATE_FIREMORTALITY(pop, disturbance_interval,it,g)

!CLN Kill ratio to be used within BLAZE to compute fluxes
POP%pop_grid(g)%rkill = 0.
if ( POP%pop_grid(g)%cmass_sum .gt. 0.) then
POP%pop_grid(g)%rkill = POP%pop_grid(g)%fire_mortality / POP%pop_grid(g)%cmass_sum
else
POP%pop_grid(g)%rkill = 0.
endif
if (POP%pop_grid(g)%rkill .GT. 0.) then
WRITE(*,*) "driver rkill",g,POP%pop_grid(g)%rkill
endif

POP%pop_grid(g)%cmass_sum = POP%pop_grid(g)%cmass_sum - POP%pop_grid(g)%fire_mortality


Expand Down
Loading