@@ -7,16 +7,16 @@ module EDCanopyStructureMod
77
88 use FatesConstantsMod , only : r8 = > fates_r8
99 use FatesGlobals , only : fates_log
10- use EDPftvarcon , only : EDPftvarcon_inst
10+ use EDPftvarcon , only : EDPftvarcon_inst
1111 use EDGrowthFunctionsMod , only : c_area
1212 use EDCohortDynamicsMod , only : copy_cohort, terminate_cohorts, fuse_cohorts
1313 use EDtypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type, ncwd
1414 use EDTypesMod , only : nclmax
1515 use EDTypesMod , only : nlevleaf
16- use EDTypesMod , only : numpft_ed
1716 use EDtypesMod , only : AREA
1817 use FatesGlobals , only : endrun = > fates_endrun
1918 use FatesInterfaceMod , only : hlm_days_per_year
19+ use FatesInterfaceMod , only : numpft
2020
2121 ! CIME Globals
2222 use shr_log_mod , only : errMsg = > shr_log_errMsg
@@ -825,7 +825,6 @@ subroutine canopy_summarization( nsites, sites, bc_in )
825825 use EDPatchDynamicsMod , only : set_root_fraction
826826 use EDTypesMod , only : sizetype_class_index
827827 use EDGrowthFunctionsMod , only : tree_lai, c_area
828- use EDEcophysConType , only : EDecophyscon
829828 use EDtypesMod , only : area
830829 use EDPftvarcon , only : EDPftvarcon_inst
831830
@@ -941,7 +940,6 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
941940
942941 use EDGrowthFunctionsMod , only : tree_lai, tree_sai, c_area
943942 use EDtypesMod , only : area, dinc_ed, hitemax, n_hite_bins
944- use EDEcophysConType , only : EDecophyscon
945943
946944 !
947945 ! !ARGUMENTS
@@ -1051,19 +1049,19 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
10511049 currentCohort = > currentPatch% shortest
10521050 do while (associated (currentCohort))
10531051 ft = currentCohort% pft
1054- min_chite = currentCohort% hite - currentCohort% hite * EDecophyscon % crown(ft)
1052+ min_chite = currentCohort% hite - currentCohort% hite * EDPftvarcon_inst % crown(ft)
10551053 max_chite = currentCohort% hite
10561054 do iv = 1 ,N_HITE_BINS
10571055 frac_canopy(iv) = 0.0_r8
10581056 ! this layer is in the middle of the canopy
10591057 if (max_chite > maxh(iv).and. min_chite < minh(iv))then
1060- frac_canopy(iv)= min (1.0_r8 ,dh / (currentCohort% hite* EDecophyscon % crown(ft)))
1058+ frac_canopy(iv)= min (1.0_r8 ,dh / (currentCohort% hite* EDPftvarcon_inst % crown(ft)))
10611059 ! this is the layer with the bottom of the canopy in it.
10621060 elseif (min_chite < maxh(iv).and. min_chite > minh(iv).and. max_chite > maxh(iv))then
1063- frac_canopy(iv) = (maxh(iv) - min_chite ) / (currentCohort% hite* EDecophyscon % crown(ft))
1061+ frac_canopy(iv) = (maxh(iv) - min_chite ) / (currentCohort% hite* EDPftvarcon_inst % crown(ft))
10641062 ! this is the layer with the top of the canopy in it.
10651063 elseif (max_chite > minh(iv).and. max_chite < maxh(iv).and. min_chite < minh(iv))then
1066- frac_canopy(iv) = (max_chite - minh(iv)) / (currentCohort% hite* EDecophyscon % crown(ft))
1064+ frac_canopy(iv) = (max_chite - minh(iv)) / (currentCohort% hite* EDPftvarcon_inst % crown(ft))
10671065 elseif (max_chite < maxh(iv).and. min_chite > minh(iv))then ! the whole cohort is within this layer.
10681066 frac_canopy(iv) = 1.0_r8
10691067 endif
@@ -1111,7 +1109,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
11111109 currentCohort = > currentCohort% taller
11121110 enddo ! currentCohort
11131111 lai = 0.0_r8
1114- do ft = 1 ,numpft_ed
1112+ do ft = 1 ,numpft
11151113 lai = lai+ sum (currentPatch% tlai_profile(1 ,ft,:))
11161114 enddo
11171115
@@ -1159,9 +1157,9 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
11591157 ! what is the height of this layer? (for snow burial purposes...)
11601158 ! EDPftvarcon_inst%vertical_canopy_frac(ft))! fudge - this should be pft specific but i cant get it to compile.
11611159 layer_top_hite = currentCohort% hite- ((iv/ currentCohort% NV) * currentCohort% hite * &
1162- EDecophyscon % crown(currentCohort% pft) )
1160+ EDPftvarcon_inst % crown(currentCohort% pft) )
11631161 layer_bottom_hite = currentCohort% hite- (((iv+1 )/ currentCohort% NV) * currentCohort% hite * &
1164- EDecophyscon % crown(currentCohort% pft)) ! EDPftvarcon_inst%vertical_canopy_frac(ft))
1162+ EDPftvarcon_inst % crown(currentCohort% pft)) ! EDPftvarcon_inst%vertical_canopy_frac(ft))
11651163
11661164 fraction_exposed = 1.0_r8
11671165
@@ -1192,10 +1190,10 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
11921190 iv = currentCohort% NV
11931191 ! EDPftvarcon_inst%vertical_canopy_frac(ft))! fudge - this should be pft specific but i cant get it to compile.
11941192 layer_top_hite = currentCohort% hite- ((iv/ currentCohort% NV) * currentCohort% hite * &
1195- EDecophyscon % crown(currentCohort% pft) )
1193+ EDPftvarcon_inst % crown(currentCohort% pft) )
11961194 ! EDPftvarcon_inst%vertical_canopy_frac(ft))
11971195 layer_bottom_hite = currentCohort% hite- (((iv+1 )/ currentCohort% NV) * currentCohort% hite * &
1198- EDecophyscon % crown(currentCohort% pft))
1196+ EDPftvarcon_inst % crown(currentCohort% pft))
11991197
12001198 fraction_exposed = 1.0_r8 ! default.
12011199 snow_depth_avg = snow_depth_si * frac_sno_eff_si
@@ -1251,7 +1249,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
12511249 enddo ! cohort
12521250
12531251 do L = 1 ,currentPatch% NCL_p
1254- do ft = 1 ,numpft_ed
1252+ do ft = 1 ,numpft
12551253 do iv = 1 ,currentPatch% nrad(L,ft)
12561254 ! account for total canopy area
12571255 currentPatch% tlai_profile(L,ft,iv) = currentPatch% tlai_profile(L,ft,iv) / &
@@ -1279,7 +1277,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
12791277
12801278 currentPatch% nrad = currentPatch% ncan
12811279 do L = 1 ,currentPatch% NCL_p
1282- do ft = 1 ,numpft_ed
1280+ do ft = 1 ,numpft
12831281 if (currentPatch% nrad(L,ft) > 30 )then
12841282 write (fates_log(), * ) ' ED: issue w/ nrad'
12851283 endif
@@ -1291,24 +1289,24 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
12911289 end do ! iv
12921290 enddo ! ft
12931291
1294- if ( L == 1 .and. abs (sum (currentPatch% canopy_area_profile(1 ,1 :numpft_ed ,1 ))) < 0.99999 &
1292+ if ( L == 1 .and. abs (sum (currentPatch% canopy_area_profile(1 ,1 :numpft ,1 ))) < 0.99999 &
12951293 .and. currentPatch% NCL_p > 1 ) then
1296- write (fates_log(), * ) ' ED: canopy area too small' ,sum (currentPatch% canopy_area_profile(1 ,1 :numpft_ed ,1 ))
1297- write (fates_log(), * ) ' ED: cohort areas' , currentPatch% canopy_area_profile(1 ,1 :numpft_ed ,:)
1294+ write (fates_log(), * ) ' ED: canopy area too small' ,sum (currentPatch% canopy_area_profile(1 ,1 :numpft ,1 ))
1295+ write (fates_log(), * ) ' ED: cohort areas' , currentPatch% canopy_area_profile(1 ,1 :numpft ,:)
12981296 endif
12991297
13001298 if (L == 1 .and. currentPatch% NCL_p > 1 .and. &
1301- abs (sum (currentPatch% canopy_area_profile(1 ,1 :numpft_ed ,1 ))) < 0.99999 ) then
1299+ abs (sum (currentPatch% canopy_area_profile(1 ,1 :numpft ,1 ))) < 0.99999 ) then
13021300 write (fates_log(), * ) ' ED: not enough area in the top canopy' , &
1303- sum (currentPatch% canopy_area_profile(L,1 :numpft_ed ,1 )), &
1304- currentPatch% canopy_area_profile(L,1 :numpft_ed ,1 )
1301+ sum (currentPatch% canopy_area_profile(L,1 :numpft ,1 )), &
1302+ currentPatch% canopy_area_profile(L,1 :numpft ,1 )
13051303 endif
13061304
1307- if (abs (sum (currentPatch% canopy_area_profile(L,1 :numpft_ed ,1 ))) > 1.00001 )then
1305+ if (abs (sum (currentPatch% canopy_area_profile(L,1 :numpft ,1 ))) > 1.00001 )then
13081306 write (fates_log(), * ) ' ED: canopy-area-profile wrong' , &
1309- sum (currentPatch% canopy_area_profile(L,1 :numpft_ed ,1 )), &
1307+ sum (currentPatch% canopy_area_profile(L,1 :numpft ,1 )), &
13101308 currentPatch% patchno, L
1311- write (fates_log(), * ) ' ED: areas' ,currentPatch% canopy_area_profile(L,1 :numpft_ed ,1 ),currentPatch% patchno
1309+ write (fates_log(), * ) ' ED: areas' ,currentPatch% canopy_area_profile(L,1 :numpft ,1 ),currentPatch% patchno
13121310
13131311 currentCohort = > currentPatch% shortest
13141312
@@ -1328,7 +1326,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
13281326 enddo ! loop over L
13291327
13301328 do L = 1 ,currentPatch% NCL_p
1331- do ft = 1 ,numpft_ed
1329+ do ft = 1 ,numpft
13321330 if (currentPatch% present (L,FT) > 1 )then
13331331 write (fates_log(), * ) ' ED: present issue' ,L,ft,currentPatch% present (L,FT)
13341332 currentPatch% present (L,ft) = 1
@@ -1500,28 +1498,28 @@ function calc_areaindex(cpatch,ai_type) result(ai)
15001498 ai = 0._r8
15011499 if (trim (ai_type) == ' elai' ) then
15021500 do cl = 1 ,cpatch% NCL_p
1503- do ft = 1 ,numpft_ed
1501+ do ft = 1 ,numpft
15041502 ai = ai + sum (cpatch% canopy_area_profile(cl,ft,1 :cpatch% nrad(cl,ft)) * &
15051503 cpatch% elai_profile(cl,ft,1 :cpatch% nrad(cl,ft)))
15061504 enddo
15071505 enddo
15081506 elseif (trim (ai_type) == ' tlai' ) then
15091507 do cl = 1 ,cpatch% NCL_p
1510- do ft = 1 ,numpft_ed
1508+ do ft = 1 ,numpft
15111509 ai = ai + sum (cpatch% canopy_area_profile(cl,ft,1 :cpatch% nrad(cl,ft)) * &
15121510 cpatch% tlai_profile(cl,ft,1 :cpatch% nrad(cl,ft)))
15131511 enddo
15141512 enddo
15151513 elseif (trim (ai_type) == ' esai' ) then
15161514 do cl = 1 ,cpatch% NCL_p
1517- do ft = 1 ,numpft_ed
1515+ do ft = 1 ,numpft
15181516 ai = ai + sum (cpatch% canopy_area_profile(cl,ft,1 :cpatch% nrad(cl,ft)) * &
15191517 cpatch% esai_profile(cl,ft,1 :cpatch% nrad(cl,ft)))
15201518 enddo
15211519 enddo
15221520 elseif (trim (ai_type) == ' tsai' ) then
15231521 do cl = 1 ,cpatch% NCL_p
1524- do ft = 1 ,numpft_ed
1522+ do ft = 1 ,numpft
15251523 ai = ai + sum (cpatch% canopy_area_profile(cl,ft,1 :cpatch% nrad(cl,ft)) * &
15261524 cpatch% tsai_profile(cl,ft,1 :cpatch% nrad(cl,ft)))
15271525 enddo
0 commit comments