@@ -326,7 +326,7 @@ subroutine CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, &
326326 cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst)
327327
328328 call CNOffsetLitterfall(num_soilp, filter_soilp, &
329- crop_inst,cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst)
329+ crop_inst,cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst,soilbiogeochem_state_inst,num_soilc, filter_soilc )
330330
331331 call CNBackgroundLitterfall(num_soilp, filter_soilp, &
332332 cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst)
@@ -339,9 +339,9 @@ subroutine CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, &
339339
340340 ! gather all patch-level litterfall fluxes to the column for litter C and N inputs
341341
342- call CNLitterToColumn(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, &
343- cnveg_state_inst,soilbiogeochem_state_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, &
344- cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, leaf_prof_patch(bounds% begp:bounds% endp,1 :nlevdecomp_full), &
342+ call CNLitterToColumn(bounds, num_soilc, filter_soilc, &
343+ cnveg_state_inst,cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, &
344+ leaf_prof_patch(bounds% begp:bounds% endp,1 :nlevdecomp_full), &
345345 froot_prof_patch(bounds% begp:bounds% endp,1 :nlevdecomp_full), stem_prof_patch(bounds% begp:bounds% endp,1 :nlevdecomp_full))
346346 else
347347 call endrun( ' bad phase' )
@@ -2015,7 +2015,6 @@ subroutine FruitTreePhenology(num_pcropp, filter_pcropp , &
20152015 if (tlai(p) <= 0._r8 .and. harvest_flag(p) == 0._r8 ) then ! plant never emerged or died
20162016 croplive(p) = .false.
20172017 if (harvdate(p) >= NOT_Harvested) harvdate(p) = jday
2018- write (iulog,* ) ' WARNING: croplive is set to false and harvdate to jday:' ,harvdate(p)
20192018 crop_seedc_to_leaf(c) = crop_seedc_to_leaf(c) - leafc_xfer(p)/ dt
20202019 crop_seedc_to_froot(c) = crop_seedc_to_froot(c) - frootc_xfer(p)/ dt
20212020 crop_seedn_to_leaf(c) = crop_seedn_to_leaf(c) - leafn_xfer(p)/ dt
@@ -3068,7 +3067,7 @@ end subroutine CNOnsetGrowth
30683067
30693068 !- ----------------------------------------------------------------------
30703069 subroutine CNOffsetLitterfall (num_soilp , filter_soilp , &
3071- crop_inst ,cnveg_state_inst , cnveg_carbonstate_inst , cnveg_nitrogenstate_inst , cnveg_carbonflux_inst , cnveg_nitrogenflux_inst )
3070+ crop_inst ,cnveg_state_inst , cnveg_carbonstate_inst , cnveg_nitrogenstate_inst , cnveg_carbonflux_inst , cnveg_nitrogenflux_inst , soilbiogeochem_state_inst , num_soilc , filter_soilc )
30723071 !
30733072 ! !DESCRIPTION:
30743073 ! Determines the flux of C and N from displayed pools to litter
@@ -3079,6 +3078,7 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &
30793078 use CNSharedParamsMod, only : use_fun
30803079 use clm_varctl , only : CNratio_floating
30813080 use clm_time_manager , only : get_curr_date, get_curr_calday, get_days_per_year, is_beg_curr_year
3081+ use dynHarvestMod , only : CNHarvestPftToColumn
30823082 !
30833083 ! !ARGUMENTS:
30843084 integer , intent (in ) :: num_soilp ! number of soil patches in filter
@@ -3089,6 +3089,9 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &
30893089 type (cnveg_nitrogenstate_type), intent (in ) :: cnveg_nitrogenstate_inst
30903090 type (cnveg_carbonflux_type) , intent (inout ) :: cnveg_carbonflux_inst
30913091 type (cnveg_nitrogenflux_type) , intent (inout ) :: cnveg_nitrogenflux_inst
3092+ type (soilbiogeochem_state_type) , intent (in ) :: soilbiogeochem_state_inst
3093+ integer , intent (in ) :: num_soilc ! number of soil columns in filter
3094+ integer , intent (in ) :: filter_soilc(:) ! filter for soil columns
30923095 !
30933096 ! !LOCAL VARIABLES:
30943097 integer :: p, c ! indices
@@ -3272,12 +3275,12 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &
32723275 if (perennial(ivt(p)) == 1._r8 ) then
32733276 if (grainc(p) > 0._r8 ) then
32743277 t1 = 1.0_r8 / dt
3275- ! replenish seed deficit (needed to balance seedc used for orchard establishment
3278+ ! replenish seed deficit (needed to balance seedc used for orchard establishment)
32763279 grainc_to_seed(p) = t1 * min (- cropseedc_deficit(p), grainc(p))
32773280 grainn_to_seed(p) = t1 * min (- cropseedn_deficit(p), grainn(p))
32783281 ! send remaining grainc to food product pool
3279- grainc_to_food(p) = t1 * grainc(p) + cpool_to_grainc(p)
3280- grainn_to_food(p) = t1 * grainn(p) + npool_to_grainn(p)
3282+ grainc_to_food(p) = t1 * grainc(p) + cpool_to_grainc(p) - grainc_to_seed(p)
3283+ grainn_to_food(p) = t1 * grainn(p) + npool_to_grainn(p) - grainn_to_seed(p)
32813284
32823285 end if
32833286 end if
@@ -3425,15 +3428,14 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &
34253428 ! lifespan is reached
34263429 ! (introduced in CLM-Palm (Fan et al. 2015), and adopted here by O.Dombrowski)
34273430 if (offset2_flag(p) == 1._r8 .and. perennial(ivt(p)) == 1._r8 ) then
3428-
34293431 ! Apply all harvest at the start of the year, otherwise will get
34303432 ! error because of non zero delta mid-year for dribbler
34313433 ! hrv_xsmrpool_to_atm_c
34323434 if (is_beg_curr_year()) then
3433- croplive = .false.
3435+ croplive(p) = .false.
34343436 t1 = 1.0_r8 / dt
34353437 else
3436- croplive = .true.
3438+ croplive(p) = .true.
34373439 t1 = 0._r8
34383440 end if
34393441 ! clear-cut carbon fluxes, remove all displayed/storage/transfer pools
@@ -3487,6 +3489,13 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, &
34873489 ! retransn pools
34883490 hrv_retransn_to_litter(p) = retransn(p) * t1
34893491
3492+ ! summarize all fuxes at orchard rotation to column level (added by O. Dombrowski adapted based on CLM-Palm (Fan et al.(2015))
3493+ if (.not. croplive(p)) then
3494+ call CNHarvestPftToColumn (num_soilc, filter_soilc, &
3495+ soilbiogeochem_state_inst, CNVeg_carbonflux_inst, cnveg_nitrogenflux_inst)
3496+ end if
3497+
3498+
34903499 end if ! end orchard rotation
34913500 end do ! end patch loop
34923501
@@ -3788,9 +3797,9 @@ subroutine CNGrainToProductPools(bounds, num_soilp, filter_soilp, num_soilc, fil
37883797 end subroutine CNGrainToProductPools
37893798
37903799 !- ----------------------------------------------------------------------
3791- subroutine CNLitterToColumn (bounds , num_soilc , filter_soilc , num_soilp , filter_soilp , &
3792- cnveg_state_inst ,soilbiogeochem_state_inst , cnveg_carbonflux_inst , cnveg_nitrogenflux_inst , &
3793- cnveg_carbonstate_inst , cnveg_nitrogenstate_inst , leaf_prof_patch , froot_prof_patch , stem_prof_patch )
3800+ subroutine CNLitterToColumn (bounds , num_soilc , filter_soilc , &
3801+ cnveg_state_inst , cnveg_carbonflux_inst , cnveg_nitrogenflux_inst , &
3802+ leaf_prof_patch , froot_prof_patch , stem_prof_patch )
37943803 !
37953804 ! !DESCRIPTION:
37963805 ! called at the end of cn_phenology to gather all patch-level litterfall fluxes
@@ -3800,20 +3809,14 @@ subroutine CNLitterToColumn (bounds, num_soilc, filter_soilc, num_soilp, filter_
38003809 use clm_varpar , only : max_patch_per_col,maxpatch_pft, nlevdecomp
38013810 use pftconMod , only : npcropmin
38023811 use clm_varctl , only : use_grainproduct
3803- use dynHarvestMod , only: CNHarvestPftToColumn
38043812 !
38053813 ! !ARGUMENTS:
38063814 type (bounds_type) , intent (in ) :: bounds
38073815 integer , intent (in ) :: num_soilc ! number of soil columns in filter
38083816 integer , intent (in ) :: filter_soilc(:) ! filter for soil columns
3809- integer , intent (in ) :: num_soilp ! number of soil patches in filter
3810- integer , intent (in ) :: filter_soilp(:) ! patch filter for soil points
38113817 type (cnveg_state_type) , intent (in ) :: cnveg_state_inst
38123818 type (cnveg_carbonflux_type) , intent (inout ) :: cnveg_carbonflux_inst
38133819 type (cnveg_nitrogenflux_type) , intent (inout ) :: cnveg_nitrogenflux_inst
3814- type (cnveg_carbonstate_type) , intent (in ) :: cnveg_carbonstate_inst
3815- type (cnveg_nitrogenstate_type) , intent (in ) :: cnveg_nitrogenstate_inst
3816- type (soilbiogeochem_state_type) , intent (in ) :: soilbiogeochem_state_inst
38173820 real (r8 ) , intent (in ) :: leaf_prof_patch(bounds% begp:,1 :)
38183821 real (r8 ) , intent (in ) :: froot_prof_patch(bounds% begp:,1 :)
38193822 real (r8 ) , intent (in ) :: stem_prof_patch(bounds% begp:,1 :)
@@ -4052,12 +4055,6 @@ subroutine CNLitterToColumn (bounds, num_soilc, filter_soilc, num_soilp, filter_
40524055
40534056 end do
40544057
4055- ! summarize all fuxes at orchard rotation to column level (added by O. Dombrowski adapted based on CLM-Palm (Fan et al.(2015))
4056- if ( perennial(ivt(p)) == 1._r8 .and. offset2_flag(p) == 1._r8 ) then
4057- call CNHarvestPftToColumn (num_soilc, filter_soilc, &
4058- soilbiogeochem_state_inst, CNVeg_carbonflux_inst, cnveg_nitrogenflux_inst)
4059- end if
4060-
40614058 end associate
40624059
40634060 end subroutine CNLitterToColumn
0 commit comments