-
Notifications
You must be signed in to change notification settings - Fork 109
Interstitial bareground #1577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
glemieux
wants to merge
9
commits into
NGEET:main
Choose a base branch
from
glemieux:interstitial_bareground_option
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+75
−28
Draft
Interstitial bareground #1577
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f736477
remove unused total canopy area variable
glemieux 5c852bb
rename canopy_fraction_pa to patch_fraction
glemieux ac12b45
add logic to receive interstitial bareground flag from HLM
glemieux 9215893
update the boundary condition output for patch fraction
glemieux c20ceb3
add interstitial bareground logic to handle surface roughness and dis…
glemieux 0837748
move weighting check outside of TCA check
glemieux 8c2b11c
remove interstitial check from zero TCA option
glemieux fdbca10
add input bc for bareground roughness from the HLM
glemieux 4045b45
update roughness length calculation to include bareground
glemieux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ module EDCanopyStructureMod | |
| use FatesInterfaceTypesMod , only : hlm_use_planthydro | ||
| use FatesInterfaceTypesMod , only : hlm_use_cohort_age_tracking | ||
| use FatesInterfaceTypesMod , only : hlm_use_sp | ||
| use FatesInterfaceTypesMod , only : hlm_use_interstitial_bareground | ||
| use FatesInterfaceTypesMod , only : numpft | ||
| use FatesInterfaceTypesMod, only : bc_in_type | ||
| use FatesPlantHydraulicsMod, only : UpdateH2OVeg,InitHydrCohort, RecruitWaterStorage | ||
|
|
@@ -1328,7 +1329,7 @@ end subroutine leaf_area_profile | |
|
|
||
| ! ====================================================================================== | ||
|
|
||
| subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) | ||
| subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out,bc_in) | ||
|
|
||
| ! ---------------------------------------------------------------------------------- | ||
| ! The purpose of this routine is to package output boundary conditions related | ||
|
|
@@ -1345,22 +1346,25 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) | |
| type(ed_site_type), intent(inout), target :: sites(nsites) | ||
| integer, intent(in) :: fcolumn(nsites) | ||
| type(bc_out_type), intent(inout) :: bc_out(nsites) | ||
| type(bc_in_type), intent(in) :: bc_in(nsites) | ||
|
|
||
| ! Locals | ||
| type (fates_cohort_type) , pointer :: currentCohort | ||
| integer :: s, ifp, c, p | ||
| type (fates_patch_type) , pointer :: currentPatch | ||
| real(r8) :: bare_frac_area | ||
| real(r8) :: local_patch_fraction | ||
| real(r8) :: total_patch_area | ||
| real(r8) :: total_canopy_area | ||
| real(r8) :: total_patch_leaf_stem_area | ||
| real(r8) :: weight ! Weighting for cohort variables in patch | ||
|
|
||
| real(r8) :: weight ! Weighting for cohort variables in patch | ||
| real(r8) :: weighting_area ! Area to normalize against depending on insterstitial bareground handling | ||
| real(r8) :: bareground_fraction ! fraction of the patch that is bareground | ||
|
|
||
| do s = 1,nsites | ||
|
|
||
| total_patch_area = 0._r8 | ||
| total_canopy_area = 0._r8 | ||
| bc_out(s)%canopy_fraction_pa(:) = 0._r8 | ||
| local_patch_fraction = 0._r8 | ||
| bc_out(s)%patch_fraction(:) = 0._r8 | ||
| bc_out(s)%dleaf_pa(:) = 0._r8 | ||
| bc_out(s)%z0m_pa(:) = 0._r8 | ||
| bc_out(s)%displa_pa(:) = 0._r8 | ||
|
|
@@ -1389,24 +1393,46 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) | |
|
|
||
| bc_out(s)%hbot_pa(ifp) = max(0._r8, min(0.2_r8, bc_out(s)%htop_pa(ifp)- 1.0_r8)) | ||
|
|
||
| ! Use canopy-only crown area weighting for all cohorts in the patch to define the characteristic | ||
| ! Roughness length and displacement height used by the HLM | ||
| ! use total LAI + SAI to weight the leaft characteristic dimension | ||
| ! Define the characteristic roughness length and displacement height used by the HLM | ||
| ! Nominally, FATES uses canopy-only crown area weighting for all cohorts in the patch | ||
| ! when the interstitial bareground is being collapsed into the HLM bareground patch. | ||
| ! When we account for the bareground as part of the patch, the full area is accounted | ||
| ! for in the calculation. | ||
| ! If there is no canopy and we are considering the interstitial bareground we do | ||
| ! something else. | ||
| ! Use total LAI + SAI to weight the leaft characteristic dimension | ||
| ! Avoid this if running in satellite phenology mode | ||
| ! ---------------------------------------------------------------------------- | ||
|
|
||
| ! Set the are to be used for weighting against the cohort area | ||
| ! If we are not using the interstitial bareground paradigm, simply | ||
| ! use the patch area. Otherwise use the total canopy area. | ||
| weighting_area = currentPatch%total_canopy_area | ||
| if (hlm_use_interstitial_bareground .eq. ifalse) then | ||
| weighting_area = currentPatch%area | ||
| end if | ||
|
|
||
| if (currentPatch%total_canopy_area > nearzero) then | ||
| currentCohort => currentPatch%shortest | ||
| do while(associated(currentCohort)) | ||
| if (currentCohort%canopy_layer .eq. 1) then | ||
| weight = min(1.0_r8,currentCohort%c_area/currentPatch%total_canopy_area) | ||
| weight = min(1.0_r8,currentCohort%c_area/weighting_area) | ||
| bc_out(s)%z0m_pa(ifp) = bc_out(s)%z0m_pa(ifp) + & | ||
| EDPftvarcon_inst%z0mr(currentCohort%pft) * currentCohort%height * weight | ||
| bc_out(s)%displa_pa(ifp) = bc_out(s)%displa_pa(ifp) + & | ||
| EDPftvarcon_inst%displar(currentCohort%pft) * currentCohort%height * weight | ||
| endif | ||
| currentCohort => currentCohort%taller | ||
| end do | ||
|
|
||
| ! If we are not using the interstitial bareground, we need to account for the bareground area | ||
| ! fraction in calculating the roughness length. Here we mimic ZengWang 2007. This should | ||
| ! eventually be replaced with a more robust approach that more accurately accounts for the | ||
| ! the bareground fraction of the patch. | ||
| if (hlm_use_interstitial_bareground .eq. ifalse) then | ||
| bareground_fraction = (currentPatch%area - currentPatch%total_canopy_area) / currentPatch%area | ||
| bc_out(s)%z0m_pa(ifp) = exp(log(bc_out(s)%z0m_pa(ifp)) + bareground_fraction * log(bc_in(s)%z0mg)) | ||
| end if | ||
|
|
||
| ! for lai, scale to total LAI + SAI in patch. first add up all the LAI and SAI in the patch | ||
| total_patch_leaf_stem_area = 0._r8 | ||
|
|
@@ -1433,9 +1459,9 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) | |
| endif | ||
| else | ||
| ! if no canopy, then use dummy values (first PFT) of aerodynamic properties | ||
| bc_out(s)%z0m_pa(ifp) = EDPftvarcon_inst%z0mr(1) * bc_out(s)%htop_pa(ifp) | ||
| bc_out(s)%displa_pa(ifp) = EDPftvarcon_inst%displar(1) * bc_out(s)%htop_pa(ifp) | ||
| bc_out(s)%dleaf_pa(ifp) = EDPftvarcon_inst%dleaf(1) | ||
| bc_out(s)%z0m_pa(ifp) = EDPftvarcon_inst%z0mr(1) * bc_out(s)%htop_pa(ifp) | ||
| bc_out(s)%displa_pa(ifp) = EDPftvarcon_inst%displar(1) * bc_out(s)%htop_pa(ifp) | ||
| bc_out(s)%dleaf_pa(ifp) = EDPftvarcon_inst%dleaf(1) | ||
|
glemieux marked this conversation as resolved.
|
||
| endif | ||
| ! ----------------------------------------------------------------------------- | ||
|
|
||
|
|
@@ -1445,19 +1471,25 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) | |
| ! currentPatch%total_canopy_area/currentPatch%area is fraction of this patch cover by plants | ||
| ! currentPatch%area/AREA is the fraction of the soil covered by this patch. | ||
|
|
||
| ! If we are accounting for the interstitial bareground within the HLM bareground patch | ||
| ! we use the projected total canopy area fraction as the output boundary condition. | ||
| ! Otherwise we simply use the fraction of the area that the patch contributes to the given site. | ||
| if (hlm_use_interstitial_bareground == itrue) then | ||
| local_patch_fraction = min(1.0_r8,currentPatch%total_canopy_area/currentPatch%area) | ||
| else | ||
| local_patch_fraction = 1.0_r8 | ||
| end if | ||
|
|
||
| if(currentPatch%area.gt.0.0_r8)then | ||
| bc_out(s)%canopy_fraction_pa(ifp) = & | ||
| min(1.0_r8,currentPatch%total_canopy_area/currentPatch%area)*(currentPatch%area/AREA) | ||
| bc_out(s)%patch_fraction(ifp) = local_patch_fraction*(currentPatch%area/AREA) | ||
| else | ||
| bc_out(s)%canopy_fraction_pa(ifp) = 0.0_r8 | ||
| bc_out(s)%patch_fraction(ifp) = 0.0_r8 | ||
| endif | ||
|
|
||
| bare_frac_area = (1.0_r8 - min(1.0_r8,currentPatch%total_canopy_area/currentPatch%area)) * & | ||
| bare_frac_area = (1.0_r8 - local_patch_fraction) * & | ||
| (currentPatch%area/AREA) | ||
|
|
||
| total_patch_area = total_patch_area + bc_out(s)%canopy_fraction_pa(ifp) + bare_frac_area | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this is dead and duplicate code being removed. |
||
|
|
||
| total_canopy_area = total_canopy_area + bc_out(s)%canopy_fraction_pa(ifp) | ||
| total_patch_area = total_patch_area + bc_out(s)%patch_fraction(ifp) + bare_frac_area | ||
|
|
||
| bc_out(s)%nocomp_pft_label_pa(ifp) = currentPatch%nocomp_pft_label | ||
|
|
||
|
|
@@ -1484,7 +1516,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) | |
| bc_out(s)%frac_veg_nosno_alb_pa(ifp) = 0.0_r8 | ||
| end if | ||
|
|
||
| else ! nocomp or SP, and currentPatch%nocomp_pft_label .eq. 0 | ||
| else ! nocomp or SP, (i.e.currentPatch%nocomp_pft_label .eq. 0 | ||
|
|
||
| total_patch_area = total_patch_area + currentPatch%area/AREA | ||
|
|
||
|
|
@@ -1511,7 +1543,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out) | |
| do while(associated(currentPatch)) | ||
| ifp = currentPatch%patchno | ||
| if(currentPatch%nocomp_pft_label.ne.nocomp_bareground)then ! for vegetated patches only | ||
| bc_out(s)%canopy_fraction_pa(ifp) = bc_out(s)%canopy_fraction_pa(ifp)/total_patch_area | ||
| bc_out(s)%patch_fraction(ifp) = bc_out(s)%patch_fraction(ifp)/total_patch_area | ||
| endif ! veg patch | ||
| currentPatch => currentPatch%younger | ||
| end do | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.