Skip to content

Commit d2b97b6

Browse files
committed
cleanup: Removed whitespaces and preserved newlines
Removed trivial diffs to reduce review burden.
1 parent f2f7ed2 commit d2b97b6

11 files changed

Lines changed: 26 additions & 22 deletions

src/clm5/biogeochem/CNBalanceCheckMod.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ subroutine BeginCNBalance(this, bounds, num_soilc, filter_soilc, &
105105
c = filter_soilc(fc)
106106
col_begcb(c) = totcolc(c)
107107
col_begnb(c) = totcoln(c)
108-
108+
109109
end do
110110

111111
end associate
@@ -164,7 +164,7 @@ subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, &
164164
col_endcb(c) = totcolc(c)
165165
! calculate total column-level inputs
166166
col_cinputs = gpp(c)
167-
167+
168168
! calculate total column-level outputs
169169
! er = ar + hr, col_fire_closs includes patch-level fire losses
170170
col_coutputs = er(c) + col_fire_closs(c) + col_hrv_xsmrpool_to_atm(c) + &
@@ -181,7 +181,7 @@ subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, &
181181

182182
! subtract leaching flux
183183
col_coutputs = col_coutputs - som_c_leached(c)
184-
184+
185185
! calculate the total column-level carbon balance error for this time step
186186
col_errcb(c) = (col_cinputs - col_coutputs)*dt - &
187187
(col_endcb(c) - col_begcb(c))

src/clm5/biogeochem/CNCIsoFluxMod.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ subroutine CIsoFlux1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
135135
iso_cnveg_cf%frootc_to_litter_patch , cnveg_cf%frootc_to_litter_patch, &
136136
iso_cnveg_cs%frootc_patch , cnveg_cs%frootc_patch, &
137137
num_soilp , filter_soilp, 1._r8, 0, isotope)
138-
138+
139139
call CIsoFluxCalc(&
140140
iso_cnveg_cf%livestemc_to_deadstemc_patch , cnveg_cf%livestemc_to_deadstemc_patch, &
141141
iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, &
@@ -1233,7 +1233,7 @@ subroutine CNCIsoLitterToColumn (num_soilc, filter_soilc, &
12331233
+ frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j)
12341234
phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) &
12351235
+ frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j)
1236-
1236+
12371237
!DML
12381238
if (ivt(p) >= npcropmin) then ! add livestemc to litter
12391239
! stem litter carbon fluxes

src/clm5/biogeochem/CNCStateUpdate1Mod.F90

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, &
397397
cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%cpool_to_deadcrootc_patch(p)*dt
398398
cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt
399399
cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) + cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt
400-
401400
end if
402401
if (ivt(p) >= npcropmin) then ! skip 2 generic crops
403402
if (carbon_resp_opt == 1 .and. perennial(ivt(p)) == 0._r8) then !(perennial flag added by O.Dombrowski)
@@ -548,7 +547,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, &
548547
cs_veg%xsmrpool_patch(p) = 0._r8
549548
cs_veg%cpool_patch(p) = 0._r8
550549
cs_veg%frootc_patch(p) = 0._r8
551-
552550
end if
553551

554552
! Slowly release xsmrpool to atmosphere
@@ -560,7 +558,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, &
560558
cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) - cf_veg%xsmrpool_to_atm_patch(p) * dt
561559

562560
end if
563-
564561
end if
565562

566563

src/clm5/biogeochem/CNCStateUpdate2Mod.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
178178
cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + cf_veg%harvest_c_to_litr_lig_c_col(c,j) * dt
179179
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = &
180180
cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%harvest_c_to_cwdc_col(c,j) * dt
181+
181182
! wood to product pools - states updated in CNProducts
182183
end do
183184
end do
@@ -200,6 +201,7 @@ subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, &
200201
- cf_veg%hrv_livecrootc_to_litter_patch(p) * dt
201202
cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) &
202203
- cf_veg%hrv_deadcrootc_to_litter_patch(p) * dt
204+
203205
! xsmrpool
204206
cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) &
205207
- cf_veg%hrv_xsmrpool_to_atm_patch(p) * dt

src/clm5/biogeochem/CNFUNMod.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,9 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
15231523
npp_Nuptake(p) = soilc_change(p)
15241524
! how much carbon goes to growth of tissues?
15251525
npp_growth(p) = (Nuptake(p)- free_retransn_to_npool(p))*plantCN(p)+(excess_carbon_acc/dt) !does not include gresp, since this is calculated from growth
1526-
1526+
1527+
1528+
15271529
!-----------------------Diagnostic Fluxes------------------------------!
15281530
if(availc(p).gt.0.0_r8)then !what happens in the night?
15291531
nuptake_npp_fraction_patch(p) = npp_Nuptake(p)/availc(p)

src/clm5/biogeochem/CNGRespMod.F90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ subroutine CNGResp(num_soilp, filter_soilp, cnveg_carbonflux_inst, canopystate_i
214214
cpool_deadcroot_storage_gr(p) = cpool_to_deadcrootc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p))
215215

216216
transfer_deadcroot_gr(p) = deadcrootc_xfer_to_deadcrootc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p)))
217-
218217
end if
219218

220219
end do

src/clm5/biogeochem/CNNStateUpdate1Mod.F90

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
164164
ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) - nf_veg%livecrootn_xfer_to_livecrootn_patch(p)*dt
165165
ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) + nf_veg%deadcrootn_xfer_to_deadcrootn_patch(p)*dt
166166
ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) - nf_veg%deadcrootn_xfer_to_deadcrootn_patch(p)*dt
167-
168167
end if
169168

170169
if (ivt(p) >= npcropmin) then ! skip 2 generic crops
@@ -198,7 +197,6 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
198197
ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) + nf_veg%livecrootn_to_deadcrootn_patch(p)*dt
199198
ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) - nf_veg%livecrootn_to_retransn_patch(p)*dt
200199
ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) + nf_veg%livecrootn_to_retransn_patch(p)*dt
201-
202200
end if
203201
if (ivt(p) >= npcropmin) then ! Beth adds retrans from froot
204202
if (perennial(ivt(p)) == 1._r8 .and. woody(ivt(p)) == 1.0_r8) then ! (added by O.Dombrowski)
@@ -270,7 +268,6 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
270268
ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) + nf_veg%npool_to_deadcrootn_storage_patch(p)*dt
271269

272270
end if
273-
274271
if (ivt(p) >= npcropmin) then ! skip 2 generic crops
275272
if (perennial(ivt(p)) == 1._r8 .and. woody(ivt(p)) == 1.0_r8) then ! (added by O.Dombrowski)
276273
ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_grainn_patch(p)*dt
@@ -306,7 +303,6 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
306303
ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) + nf_veg%livecrootn_storage_to_xfer_patch(p)*dt
307304
ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) - nf_veg%deadcrootn_storage_to_xfer_patch(p)*dt
308305
ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) + nf_veg%deadcrootn_storage_to_xfer_patch(p)*dt
309-
310306
end if
311307

312308
if (ivt(p) >= npcropmin) then ! skip 2 generic crops

src/clm5/biogeochem/CNVegCarbonStateType.F90

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2522,6 +2522,7 @@ subroutine Summary_carbonstate(this, bounds, num_allc, filter_allc, &
25222522
this%deadstemc_patch(p) + &
25232523
this%livecrootc_patch(p) + &
25242524
this%deadcrootc_patch(p)
2525+
25252526
! stored vegetation carbon, excluding cpool (STORVEGC)
25262527
this%storvegc_patch(p) = &
25272528
this%cpool_patch(p) + &
@@ -2550,16 +2551,18 @@ subroutine Summary_carbonstate(this, bounds, num_allc, filter_allc, &
25502551
this%dispvegc_patch(p) + &
25512552
this%grainc_patch(p)
25522553
end if
2553-
2554+
25542555
! total vegetation carbon, excluding cpool (TOTVEGC)
25552556
this%totvegc_patch(p) = &
25562557
this%dispvegc_patch(p) + &
25572558
this%storvegc_patch(p)
2559+
25582560
! total patch-level carbon, including xsmrpool, ctrunc
25592561
this%totc_patch(p) = &
25602562
this%totvegc_patch(p) + &
25612563
this%xsmrpool_patch(p) + &
25622564
this%ctrunc_patch(p)
2565+
25632566
if (use_crop) then
25642567
this%totc_patch(p) = this%totc_patch(p) + this%cropseedc_deficit_patch(p) + &
25652568
this%xsmrpool_loss_patch(p)
@@ -2602,6 +2605,7 @@ subroutine Summary_carbonstate(this, bounds, num_allc, filter_allc, &
26022605
soilbiogeochem_totlitc_col(c) + &
26032606
soilbiogeochem_totsomc_col(c) + &
26042607
soilbiogeochem_ctrunc_col(c)
2608+
26052609
end do
26062610

26072611
end subroutine Summary_carbonstate

src/clm5/biogeochem/NutrientCompetitionFlexibleCNMod.F90

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ subroutine InitAllocate(this, bounds)
9797

9898
allocate(this%actual_leafcn(bounds%begp:bounds%endp)) ; this%actual_leafcn(:) = nan
9999
allocate(this%actual_storage_leafcn(bounds%begp:bounds%endp)) ; this%actual_storage_leafcn(:) = nan
100+
100101
end subroutine InitAllocate
101102

102103
!------------------------------------------------------------------------
@@ -403,12 +404,14 @@ subroutine calc_plant_cn_alloc(this, bounds, num_soilp, filter_soilp, &
403404

404405
! set time steps
405406
dt = real( get_step_size(), r8 )
407+
406408
! patch loop to distribute the available N between the competing patches
407409
! on the basis of relative demand, and allocate C and N to new growth and storage
408410

409411
do fp = 1,num_soilp
410412
p = filter_soilp(fp)
411413
c = patch%column(p)
414+
412415
! set some local allocation variables
413416
f1 = froot_leaf(ivt(p))
414417
f2 = croot_stem(ivt(p))
@@ -517,6 +520,7 @@ subroutine calc_plant_cn_alloc(this, bounds, num_soilp, filter_soilp, &
517520
! transfer pools
518521

519522
nlc = plant_calloc(p) / c_allometry(p)
523+
520524
cpool_to_leafc(p) = nlc * fcur
521525
cpool_to_leafc_storage(p) = nlc * (1._r8 - fcur)
522526
cpool_to_frootc(p) = nlc * f1 * fcur
@@ -886,6 +890,8 @@ subroutine calc_plant_cn_alloc(this, bounds, num_soilp, filter_soilp, &
886890
+ cpool_to_grainc_storage(p)
887891
end if
888892
cpool_to_gresp_storage(p) = gresp_storage * g1 * (1._r8 - g2)
893+
894+
889895
! computing 1.) fractional N demand and 2.) N allocation after uptake for different plant parts
890896
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
891897
if (downreg_opt .eqv. .false. .AND. CN_partition_opt == 1) then
@@ -1594,11 +1600,13 @@ subroutine calc_plant_nitrogen_demand(this, bounds, num_soilp, filter_soilp, &
15941600

15951601
! no allocation when available c is negative
15961602
availc(p) = max(availc(p),0.0_r8)
1603+
15971604
! test for an xsmrpool deficit
15981605
if (xsmrpool(p) < 0.0_r8) then
15991606
! Running a deficit in the xsmrpool, so the first priority is to let
16001607
! some availc from this timestep accumulate in xsmrpool.
16011608
! Determine rate of recovery for xsmrpool deficit
1609+
16021610
xsmrpool_recover(p) = -xsmrpool(p)/(dayscrecover*secspday)
16031611
if (xsmrpool_recover(p) < availc(p)) then
16041612
! available carbon reduced by amount for xsmrpool recovery

src/clm5/biogeochem/dynHarvestMod.F90

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,13 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, &
330330
else
331331
m = 0._r8
332332
end if
333-
333+
334334
! patch-level harvest carbon fluxes
335335
! displayed pools
336336
hrv_leafc_to_litter(p) = leafc(p) * m
337337
hrv_frootc_to_litter(p) = frootc(p) * m
338338
hrv_livestemc_to_litter(p) = livestemc(p) * m
339339
wood_harvestc(p) = deadstemc(p) * m
340-
341340
hrv_livecrootc_to_litter(p) = livecrootc(p) * m
342341
hrv_deadcrootc_to_litter(p) = deadcrootc(p) * m
343342
hrv_xsmrpool_to_atm(p) = xsmrpool(p) * m
@@ -499,7 +498,7 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
499498
p = col%patchi(c) + pi - 1
500499

501500
if (patch%active(p)) then
502-
501+
503502
! leaf harvest mortality carbon fluxes
504503
harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + &
505504
hrv_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j)
@@ -630,7 +629,7 @@ subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, &
630629
! wood harvest mortality carbon fluxes to product pools
631630
cwood_harvestc(c) = cwood_harvestc(c) + &
632631
pwood_harvestc(p) * wtcol(p)
633-
632+
634633
! wood harvest mortality nitrogen fluxes to product pools
635634
cwood_harvestn(c) = cwood_harvestn(c) + &
636635
pwood_harvestn(p) * wtcol(p)

0 commit comments

Comments
 (0)