@@ -18,8 +18,6 @@ module EDPatchDynamicsMod
1818 use EDTypesMod , only : dtype_ilog
1919 use EDTypesMod , only : dtype_ifire
2020 use FatesInterfaceMod , only : hlm_use_planthydro
21- use FatesInterfaceMod , only : hlm_numlevgrnd
22- use FatesInterfaceMod , only : hlm_numlevsoil
2321 use FatesInterfaceMod , only : hlm_numSWb
2422 use FatesInterfaceMod , only : bc_in_type
2523 use FatesInterfaceMod , only : hlm_days_per_year
@@ -57,7 +55,6 @@ module EDPatchDynamicsMod
5755 public :: disturbance_rates
5856 public :: check_patch_area
5957 public :: set_patchno
60- public :: set_root_fraction
6158 private :: fuse_2_patches
6259
6360 character (len=* ), parameter , private :: sourcefile = &
@@ -346,7 +343,7 @@ subroutine spawn_patches( currentSite, bc_in)
346343 allocate (new_patch)
347344 call create_patch(currentSite, new_patch, age, site_areadis, &
348345 cwd_ag_local, cwd_bg_local, leaf_litter_local, &
349- root_litter_local)
346+ root_litter_local, bc_in % nlevsoil )
350347
351348 new_patch% tallest = > null ()
352349 new_patch% shortest = > null ()
@@ -381,7 +378,7 @@ subroutine spawn_patches( currentSite, bc_in)
381378 do while (associated (currentCohort))
382379
383380 allocate (nc)
384- if (hlm_use_planthydro.eq. itrue) call InitHydrCohort(nc)
381+ if (hlm_use_planthydro.eq. itrue) call InitHydrCohort(CurrentSite, nc)
385382 call zero_cohort(nc)
386383
387384 ! nc is the new cohort that goes in the disturbed patch (new_patch)... currentCohort
@@ -1135,7 +1132,7 @@ end subroutine mortality_litter_fluxes
11351132
11361133 ! ============================================================================
11371134 subroutine create_patch (currentSite , new_patch , age , areap ,cwd_ag_local ,cwd_bg_local , &
1138- leaf_litter_local ,root_litter_local )
1135+ leaf_litter_local ,root_litter_local , nlevsoil )
11391136 !
11401137 ! !DESCRIPTION:
11411138 ! Set default values for creating a new patch
@@ -1145,12 +1142,13 @@ subroutine create_patch(currentSite, new_patch, age, areap,cwd_ag_local,cwd_bg_l
11451142 ! !ARGUMENTS:
11461143 type (ed_site_type) , intent (inout ), target :: currentSite
11471144 type (ed_patch_type), intent (inout ), target :: new_patch
1148- real (r8 ), intent (in ) :: age ! notional age of this patch in years
1149- real (r8 ), intent (in ) :: areap ! initial area of this patch in m2.
1150- real (r8 ), intent (in ) :: cwd_ag_local(:) ! initial value of above ground coarse woody debris. KgC/m2
1151- real (r8 ), intent (in ) :: cwd_bg_local(:) ! initial value of below ground coarse woody debris. KgC/m2
1152- real (r8 ), intent (in ) :: root_litter_local(:)! initial value of root litter. KgC/m2
1153- real (r8 ), intent (in ) :: leaf_litter_local(:)! initial value of leaf litter. KgC/m2
1145+ real (r8 ), intent (in ) :: age ! notional age of this patch in years
1146+ real (r8 ), intent (in ) :: areap ! initial area of this patch in m2.
1147+ real (r8 ), intent (in ) :: cwd_ag_local(:) ! initial value of above ground coarse woody debris. KgC/m2
1148+ real (r8 ), intent (in ) :: cwd_bg_local(:) ! initial value of below ground coarse woody debris. KgC/m2
1149+ real (r8 ), intent (in ) :: root_litter_local(:) ! initial value of root litter. KgC/m2
1150+ real (r8 ), intent (in ) :: leaf_litter_local(:) ! initial value of leaf litter. KgC/m2
1151+ integer , intent (in ) :: nlevsoil ! number of soil layers
11541152 !
11551153 ! !LOCAL VARIABLES:
11561154 !- --------------------------------------------------------------------
@@ -1163,8 +1161,8 @@ subroutine create_patch(currentSite, new_patch, age, areap,cwd_ag_local,cwd_bg_l
11631161 allocate (new_patch% fabi(hlm_numSWb))
11641162 allocate (new_patch% sabs_dir(hlm_numSWb))
11651163 allocate (new_patch% sabs_dif(hlm_numSWb))
1166- allocate (new_patch% rootfr_ft(numpft,hlm_numlevgrnd ))
1167- allocate (new_patch% rootr_ft(numpft,hlm_numlevgrnd))
1164+ allocate (new_patch% rootfr_ft(numpft,nlevsoil ))
1165+ allocate (new_patch% rootr_ft(numpft,nlevsoil))
11681166
11691167 call zero_patch(new_patch) ! The nan value in here is not working??
11701168
@@ -1909,38 +1907,4 @@ function countPatches( nsites, sites ) result ( totNumPatches )
19091907
19101908 end function countPatches
19111909
1912- ! ====================================================================================
1913-
1914- subroutine set_root_fraction ( cpatch , zi )
1915- !
1916- ! !DESCRIPTION:
1917- ! Calculates the fractions of the root biomass in each layer for each pft.
1918- !
1919- ! !USES:
1920-
1921- !
1922- ! !ARGUMENTS
1923- type (ed_patch_type),intent (inout ), target :: cpatch
1924- real (r8 ),intent (in ) :: zi(0 :hlm_numlevsoil)
1925- !
1926- ! !LOCAL VARIABLES:
1927- integer :: lev,p,c,ft
1928- !- ---------------------------------------------------------------------
1929-
1930- do ft = 1 ,numpft
1931- do lev = 1 , hlm_numlevgrnd
1932- cpatch% rootfr_ft(ft,lev) = 0._r8
1933- enddo
1934-
1935- do lev = 1 , hlm_numlevsoil-1
1936- cpatch% rootfr_ft(ft,lev) = .5_r8 * ( &
1937- exp (- EDPftvarcon_inst% roota_par(ft) * zi(lev-1 )) &
1938- + exp (- EDPftvarcon_inst% rootb_par(ft) * zi(lev-1 )) &
1939- - exp (- EDPftvarcon_inst% roota_par(ft) * zi(lev)) &
1940- - exp (- EDPftvarcon_inst% rootb_par(ft) * zi(lev)))
1941- end do
1942- end do
1943-
1944- end subroutine set_root_fraction
1945-
19461910 end module EDPatchDynamicsMod
0 commit comments