Skip to content

Commit

Permalink
Merge branch 'ts_zero_harvests' into rx_crop_calendars2
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Jan 3, 2023
2 parents d5bda14 + f78a19c commit 309e0ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions src/biogeochem/CNPhenologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2610,6 +2610,10 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, &
gddmaturity(p) = min(gdd020(p), hybgdd(ivt(p)))
end if

if (generate_crop_gdds) then
gddmaturity(p) = max(gddmaturity(p), gddmin(ivt(p)))
endif

endif

end associate
Expand Down Expand Up @@ -3003,9 +3007,6 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &

! How many harvests have occurred?
h = crop_inst%harvest_count(p)
if (h .le. 0) then
call endrun(msg="CNOffsetLitterfall(): Invalid harvest_count")
end if

! Replenish the seed deficits from grain, if there is enough available
! grain. (If there is not enough available grain, the seed deficits will
Expand Down Expand Up @@ -3033,10 +3034,15 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &
repr_grainc_to_food_thispool = cpool_to_reproductivec(p,k) - repr_grainc_to_seed(p,k)
repr_grainc_to_food(p,k) = t1 * reproductivec(p,k) &
+ repr_grainc_to_food_thispool
repr_grainc_to_food_perharv(p,h,k) = reproductivec(p,k) &
+ repr_grainc_to_food_thispool * dt
repr_grainc_to_food_thisyr(p,k) = repr_grainc_to_food_thisyr(p,k) &
+ repr_grainc_to_food_perharv(p,h,k)
if (reproductivec(p,k) + repr_grainc_to_food_thispool * dt .gt. 0) then
if (h .le. 0) then
call endrun(msg="CNOffsetLitterfall(): Invalid harvest_count")
end if
repr_grainc_to_food_perharv(p,h,k) = reproductivec(p,k) &
+ repr_grainc_to_food_thispool * dt
repr_grainc_to_food_thisyr(p,k) = repr_grainc_to_food_thisyr(p,k) &
+ repr_grainc_to_food_perharv(p,h,k)
end if
repr_grainn_to_food(p,k) = t1 * reproductiven(p,k) &
+ npool_to_reproductiven(p,k) - repr_grainn_to_seed(p,k)
end do
Expand Down
2 changes: 1 addition & 1 deletion src/biogeochem/CNVegCarbonFluxType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ subroutine InitAllocate(this, bounds, carbon_type)
bounds = bounds, &
name = 'hrv_xsmrpool_to_atm_' // carbon_type_suffix, &
units = 'gC/m^2', &
allows_non_annual_delta = .false.)
allows_non_annual_delta = allows_non_annual_delta)

end subroutine InitAllocate

Expand Down

0 comments on commit 309e0ed

Please sign in to comment.