diff --git a/src/biogeochem/CNAllocationMod.F90 b/src/biogeochem/CNAllocationMod.F90 index ff8131c9f7..4283a9da31 100644 --- a/src/biogeochem/CNAllocationMod.F90 +++ b/src/biogeochem/CNAllocationMod.F90 @@ -393,18 +393,7 @@ subroutine calc_crop_allocation_fractions(bounds, num_pcropp, filter_pcropp, & end do arepr(p,nrepr) = 1._r8 - aroot(p) - astem(p) - aleaf(p) - else if (crop_phase(p) == cphase_planted) then - ! pre emergence - ! allocation coefficients should be irrelevant because crops have no - ! live carbon pools - aleaf(p) = 1._r8 - astem(p) = 0._r8 - aroot(p) = 0._r8 - do k = 1, nrepr - arepr(p,k) = 0._r8 - end do - - else + else if (crop_phase(p) /= cphase_planted) write(iulog,*) "ERROR in " // subname // ": unexpected crop_phase: ", crop_phase(p) call endrun(msg="ERROR: unexpected crop_phase "//errmsg(sourcefile, __LINE__)) end if diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 3dc4879ff7..7e9ea2a08d 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2555,7 +2555,13 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & gddmin => pftcon%gddmin , & ! Input: gdd020 => temperature_inst%gdd020_patch , & ! Input: [real(r8) (:) ] 20 yr mean of gdd0 gdd820 => temperature_inst%gdd820_patch , & ! Input: [real(r8) (:) ] 20 yr mean of gdd8 - gdd1020 => temperature_inst%gdd1020_patch & ! Input: [real(r8) (:) ] 20 yr mean of gdd10 + gdd1020 => temperature_inst%gdd1020_patch , & ! Input: [real(r8) (:) ] 20 yr mean of gdd10 + aleafi => cnveg_state_inst%aleafi_patch , & ! Output: [real(r8) (:) ] saved allocation coefficient from phase 2 + astemi => cnveg_state_inst%astemi_patch , & ! Output: [real(r8) (:) ] saved allocation coefficient from phase 2 + aleaf => cnveg_state_inst%aleaf_patch , & ! Output: [real(r8) (:) ] leaf allocation coefficient + astem => cnveg_state_inst%astem_patch , & ! Output: [real(r8) (:) ] stem allocation coefficient + aroot => cnveg_state_inst%aroot_patch , & ! Output: [real(r8) (:) ] root allocation coefficient + arepr => cnveg_state_inst%arepr_patch & ! Output: [real(r8) (:,:) ] reproductive allocation coefficient(s) ) ! impose limit on growing season length needed @@ -2646,6 +2652,19 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & gddmaturity(p) = min_gddmaturity endif + ! Initialize allocation coefficients. + ! Because crops have no live carbon pools when planted but not emerged, this shouldn't + ! matter unless they skip the vegetative phase (which only happens in very weird run + ! setups). + aleaf(p) = 1._r8 + aleafi(p) = 1._r8 + astem(p) = 0._r8 + astemi(p) = 0._r8 + aroot(p) = 0._r8 + do k = 1, nrepr + arepr(p,k) = 0._r8 + end do + end associate end subroutine PlantCrop