Skip to content

Commit 7d0c639

Browse files
authored
Merge pull request #32 from tugraskan/1210_a
1210 a
2 parents d5b086e + b3b930a commit 7d0c639

10 files changed

+295
-174
lines changed

src/mgt_killop.f90

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,20 @@ subroutine mgt_killop (jj, iplant)
2828
!! add above ground biomass to surface residue pools
2929
soil1(j)%rsd(1) = soil1(j)%rsd(1) + pl_mass(j)%ab_gr(ipl)
3030
if (bsn_cc%cswat == 2) then
31-
soil1(j)%meta(1) = soil1(j)%meta(1) + 0.85 * soil(j)%ly(1)%rtfr * pl_mass(j)%ab_gr(ipl)
32-
soil1(j)%str(1) = soil1(j)%str(1) + 0.15 * soil(j)%ly(1)%rtfr * pl_mass(j)%ab_gr(ipl)
33-
soil1(j)%lig(1) = soil1(j)%lig(1) + 0.12 * soil(j)%ly(1)%rtfr * pl_mass(j)%ab_gr(ipl)
31+
soil1(j)%meta(1) = soil1(j)%meta(1) + 0.85 * pl_mass(j)%ab_gr(ipl)
32+
soil1(j)%str(1) = soil1(j)%str(1) + 0.15 * pl_mass(j)%ab_gr(ipl)
33+
soil1(j)%lig(1) = soil1(j)%lig(1) + 0.12 * pl_mass(j)%ab_gr(ipl)
3434
end if
3535

3636
!! add dead roots to soil residue pools
37-
if (bsn_cc%cswat == 2) then
38-
do ly = 1, soil(j)%nly
37+
do ly = 2, soil(j)%nly
3938
soil1(j)%rsd(ly) = soil1(j)%rsd(ly) + soil(j)%ly(ly)%rtfr * pl_mass(j)%root(ipl)
4039
if (bsn_cc%cswat == 2) then
4140
soil1(j)%meta(ly) = soil1(j)%meta(ly) + 0.85 * soil(j)%ly(ly)%rtfr * pl_mass(j)%root(ipl)
4241
soil1(j)%str(ly) = soil1(j)%str(ly) + 0.15 * soil(j)%ly(ly)%rtfr * pl_mass(j)%root(ipl)
4342
soil1(j)%lig(ly) = soil1(j)%lig(ly) + 0.12 * soil(j)%ly(ly)%rtfr * pl_mass(j)%root(ipl) ! 0.12 = 0.8 * 0.15 -> lig = 80%str
4443
end if
4544
end do
46-
end if
4745

4846
!! sum total community masses
4947
pl_mass(j)%tot_com = pl_mass(j)%tot_com - pl_mass(j)%tot(ipl)

src/mgt_newtillmix.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ subroutine mgt_newtillmix (jj, bmix, idtill)
7878
frac_non_mixed = 0.
7979
emix = 0.
8080
dtil = 0.
81+
mix_clay = 0.
82+
mix_silt = 0.
83+
mix_sand = 0.
84+
8185
if (bmix > 1.e-6) then
8286
!! biological mixing
8387
emix = bmix !bmix MJW (rev 412)

src/organic_mineral_mass_module.f90

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ module organic_mineral_mass_module
55
implicit none
66

77
type organic_mass
8-
real :: m = 0. !kg or kg/ha |total object mass
9-
real :: c = 0. !kg or kg/ha |carbon mass
10-
real :: n = 0. !kg or kg/ha |organic nitrogen mass
11-
real :: p = 0. !kg or kg/ha |organic phosphorus mass
8+
real :: m = 0. !kg/ha |total object mass
9+
real :: c = 0. !kg/ha |carbon mass
10+
real :: n = 0. !kg/ha |organic nitrogen mass
11+
real :: p = 0. !kg/ha |organic phosphorus mass
1212
end type organic_mass
1313
type (organic_mass) :: orgz
1414

@@ -127,22 +127,6 @@ module organic_mineral_mass_module
127127
type (organic_mass) :: rsd_meta ! |temporary storage for initial metabolic litter
128128
type (organic_mass) :: rsd_str ! |temporary storage for initial structural litter
129129

130-
type residue_mass1 !surface residue
131-
character (len=16) :: name = ""
132-
type (organic_mass), dimension(:), allocatable :: tot ! |total mass surface residue litter pool-dimensioned by plant
133-
type (organic_mass), dimension(:), allocatable :: meta ! |metabolic litter pool-dimensioned by plant
134-
type (organic_mass), dimension(:), allocatable :: str ! |structural litter pool-dimensioned by plant
135-
type (organic_mass), dimension(:), allocatable :: lignin ! |lignin pool-dimensioned by plant
136-
type (organic_mass) :: tot_com !kg/ha |total
137-
type (organic_mass) :: tot_meta ! |
138-
type (organic_mass) :: tot_str ! |
139-
type (organic_mass) :: tot_lignin ! |
140-
type (organic_mass) :: man ! |
141-
end type residue_mass1
142-
!soil profile object - dimensioned to number of hrus, using the hru pointer
143-
type (residue_mass1), dimension(:), allocatable :: rsd1
144-
type (residue_mass1), dimension(:), allocatable :: rsd1_init
145-
146130
type plant_community_mass
147131
character(len=4) :: name = ""
148132
type (organic_mass), dimension(:), allocatable :: tot !kg/ha |total biomass for individual plant in community
@@ -170,6 +154,8 @@ module organic_mineral_mass_module
170154
type (organic_mass) :: graz_plant, graz_seed, graz_leaf, graz_stem
171155
type (organic_mass) :: leaf_drop !kg/ha |organic mass of falling leaves
172156
type (organic_mass) :: abgr_drop !kg/ha |above ground that dies at dormancy
157+
type (organic_mass) :: stem_drop !kg/ha |stem that dies at dormancy
158+
type (organic_mass) :: seed_drop !kg/ha |seed that dies at dormancy
173159
type (organic_mass) :: plt_mass_z
174160

175161
type mineral_mass

src/output_landscape_init.f90

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ subroutine output_landscape_init
436436
end if
437437
endif
438438

439-
if (bsn_cc%cswat == 2) then
440439
if (pco%nb_hru%a == "y") then
441440
open (4553,file="hru_scf_aa.txt", recl = 1500)
442441
write (4553,*) bsn%name, prog
@@ -451,7 +450,6 @@ subroutine output_landscape_init
451450
write (9000,*) "HRU hru_scf_aa.csv"
452451
end if
453452
endif
454-
end if
455453

456454
!!!NEW SOIL TRANSFORMATIONS CARBON OUTPUT
457455

@@ -479,18 +477,18 @@ subroutine output_landscape_init
479477
end if
480478
endif
481479

482-
open (4561,file = "hru_resc_stat.txt", recl = 1500)
483480
if (pco%nb_hru%a == "y") then
481+
open (4561,file = "hru_rsdc_stat.txt", recl = 1500)
484482
write (4561,*) bsn%name, prog
485-
write (4561,*) resc_hdr
486-
write (4561,*) resc_hdr_units
487-
write (9000,*) "HRU hru_resc_stat.txt"
483+
write (4561,*) rsdc_hdr
484+
write (4561,*) rsdc_hdr_units
485+
write (9000,*) "HRU hru_rsdc_stat.txt"
488486
if (pco%csvout == "y") then
489-
open (4564,file="hru_resc_stat.csv", recl = 1500)
487+
open (4564,file="hru_rsdc_stat.csv", recl = 1500)
490488
write (4564,*) bsn%name, prog
491-
write (4564,'(*(G0.3,:,","))') resc_hdr
492-
write (4564,'(*(G0.3,:,","))') resc_hdr_units
493-
write (9000,*) "HRU hru_resc_stat.csv"
489+
write (4564,'(*(G0.3,:,","))') rsdc_hdr
490+
write (4564,'(*(G0.3,:,","))') rsdc_hdr_units
491+
write (9000,*) "HRU hru_rsdc_stat.csv"
494492
end if
495493
endif
496494

src/output_landscape_module.f90

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -815,23 +815,27 @@ module output_landscape_module
815815

816816
!! NEW RESIDUE CARBON STAT OUTPUT
817817

818-
type output_resc_header
818+
type output_rsdc_header
819819
character (len=11) :: day = " jday"
820820
character (len=11) :: mo = " mon"
821821
character (len=11) :: day_mo = " day"
822822
character (len=11) :: yrc = " yr"
823823
character (len=16) :: isd = " unit"
824824
character (len=21) :: id = " gis_id "
825825
character (len=16) :: name = " name "
826-
character(len=15) :: tot_c = " tot_c"
827-
character(len=15) :: meta_c = " meta_c"
828-
character(len=15) :: str_c = " str_c"
829-
character(len=15) :: lig_c = " lig_c"
826+
character(len=15) :: tot_surf_c = " tot_surf_c"
827+
character(len=15) :: meta_surf_c = " meta_surf_c"
828+
character(len=15) :: str_surf_c = " str_surf_c"
829+
character(len=15) :: lig_surf_c = " lig_surf_c"
830+
character(len=15) :: tot_soil_c = " tot_soil_c"
831+
character(len=15) :: meta_soil_c = " meta_soil_c"
832+
character(len=15) :: str_soil_c = " str_soil_c"
833+
character(len=15) :: lig_soil_c = " lig_soil_c"
830834

831-
end type output_resc_header
832-
type (output_resc_header) :: resc_hdr
835+
end type output_rsdc_header
836+
type (output_rsdc_header) :: rsdc_hdr
833837

834-
type output_resc_header_units
838+
type output_rsdc_header_units
835839
character (len=11) :: day = " "
836840
character (len=11) :: mo = " "
837841
character (len=11) :: day_mo = " "
@@ -843,8 +847,12 @@ module output_landscape_module
843847
character(len=15) :: meta_c = " kg/ha"
844848
character(len=15) :: str_c = " kg/ha"
845849
character(len=15) :: lig_c = " kg/ha"
846-
end type output_resc_header_units
847-
type (output_resc_header_units) :: resc_hdr_units
850+
character(len=15) :: tot_soil_c = " kg/ha"
851+
character(len=15) :: meta_soil_c = " kg/ha"
852+
character(len=15) :: str_soil_c = " kg/ha"
853+
character(len=15) :: lig_soil_c = " kg/ha"
854+
end type output_rsdc_header_units
855+
type (output_rsdc_header_units) :: rsdc_hdr_units
848856

849857
!!! NEW RESIDUE CARBON STAT OUTPUT
850858

src/pl_dormant.f90

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ subroutine pl_dormant
1616
integer :: idp = 0 ! |
1717
integer :: iob = 0 ! |
1818
integer :: iwgn = 0 ! |
19+
integer :: ly = 0 ! |soil layer number
1920
real :: rto = 0. ! |
2021
real :: lai_init = 0. !
2122
real :: lai_drop = 0.
@@ -34,7 +35,7 @@ subroutine pl_dormant
3435
pcom(j)%plcur(ipl)%idorm = "y"
3536
!! add dead stem mass to residue pool
3637
rto = pldb(idp)%bm_dieoff
37-
abgr_drop = rto * pl_mass(j)%stem(ipl)
38+
stem_drop = rto * pl_mass(j)%stem(ipl)
3839
!! drop lai to minimum if not already
3940
lai_init = pcom(j)%plg(ipl)%lai
4041
pcom(j)%plg(ipl)%lai = pldb(idp)%alai_min
@@ -51,18 +52,24 @@ subroutine pl_dormant
5152
leaf_drop%n = max (0., leaf_drop%n)
5253
leaf_drop%p = leaf_drop%m * pcom(j)%plm(ipl)%p_fr
5354
leaf_drop%p = max (0., leaf_drop%p)
55+
!! add all seed/fruit mass to residue pool
56+
seed_drop = pl_mass(j)%seed(ipl)
57+
abgr_drop = stem_drop + leaf_drop + seed_drop
5458

55-
pl_mass(j)%tot(ipl) = pl_mass(j)%tot(ipl) - abgr_drop - leaf_drop
56-
pl_mass(j)%ab_gr(ipl) = pl_mass(j)%ab_gr(ipl) - abgr_drop - leaf_drop
57-
pl_mass(j)%stem(ipl) = pl_mass(j)%stem(ipl) - abgr_drop
58-
pl_mass(j)%leaf(ipl) = pl_mass(j)%leaf(ipl) - leaf_drop
59-
soil1(j)%rsd(1) = soil1(j)%rsd(1) + abgr_drop + leaf_drop
60-
!! add all seed/fruit mass to residue poolpool
61-
abgr_drop = pl_mass(j)%seed(ipl)
59+
!! add all seed/fruit mass to residue pool
6260
pl_mass(j)%tot(ipl) = pl_mass(j)%tot(ipl) - abgr_drop
6361
pl_mass(j)%ab_gr(ipl) = pl_mass(j)%ab_gr(ipl) - abgr_drop
62+
pl_mass(j)%stem(ipl) = pl_mass(j)%stem(ipl) - stem_drop
63+
pl_mass(j)%leaf(ipl) = pl_mass(j)%leaf(ipl) - leaf_drop
6464
pl_mass(j)%seed(ipl) = plt_mass_z
65+
6566
soil1(j)%rsd(1) = soil1(j)%rsd(1) + abgr_drop
67+
if (bsn_cc%cswat == 2) then
68+
soil1(j)%meta(ly) = soil1(j)%meta(ly) + 0.85 * abgr_drop
69+
soil1(j)%str(ly) = soil1(j)%str(ly) + 0.15 * abgr_drop
70+
soil1(j)%lig(ly) = soil1(j)%lig(ly) + 0.12 * abgr_drop ! 0.12 = 0.8 * 0.15 -> lig = 80%str
71+
end if
72+
6673
end if
6774

6875
!! beginning of cool season annual dormant period

0 commit comments

Comments
 (0)