-
Notifications
You must be signed in to change notification settings - Fork 92
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
Updates and fixes to maintenance respiration #138
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
32dd172
Science fixes on sapwood and fine root respiration. First pass, no te…
rgknox 58e27de
fixed typo where MR of bg sapwood was double multiplied by bg root fr…
rgknox 4416814
Added several AR diagnostics. Also changed the units of dark-respira…
rgknox 0ca158e
minor fix to update the pft index during the scpf output for photosyn…
rgknox a3e1966
Merge resolution. EDCLMLinkMod was removed in master. That file had …
rgknox 4ecda62
minor fix, livecrootn was still in a print statement that I overlooke…
rgknox d0150fe
fixed hard-coded pft index in grperc found in photosynthesis
rgknox f34bcb8
Merge branch 'andre-fates-constants' into rgknox-ckoven-froot-mr
rgknox 15824a2
added some more global constants and uses in photosynthesis. Also, fi…
rgknox fe9f7a1
intercellular co2 in photosynthesis was being represented as an array…
rgknox fb3e9ca
renamed some local variables related to nitrogen content.
rgknox 44d762d
Added cohort type variables size_class and size_by_pft_class. These v…
rgknox 8e2b86f
Various syntactical fixes including: making rgas more explicit in its…
rgknox 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 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 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 |
---|---|---|
|
@@ -27,7 +27,7 @@ module EDCohortDynamicsMod | |
public :: sort_cohorts | ||
public :: copy_cohort | ||
public :: count_cohorts | ||
! public :: countCohorts | ||
public :: size_and_type_class_index | ||
public :: allocate_live_biomass | ||
|
||
logical, parameter :: DEBUG = .false. ! local debug flag | ||
|
@@ -92,6 +92,9 @@ subroutine create_cohort(patchptr, pft, nn, hite, dbh, & | |
new_cohort%balive = balive | ||
new_cohort%bstore = bstore | ||
|
||
call size_and_type_class_index(new_cohort%dbh,new_cohort%pft, & | ||
new_cohort%size_class,new_cohort%size_by_pft_class) | ||
|
||
if ( DEBUG ) write(iulog,*) 'EDCohortDyn I ',bstore | ||
|
||
if (new_cohort%dbh <= 0.0_r8 .or. new_cohort%n == 0._r8 .or. new_cohort%pft == 0 & | ||
|
@@ -316,6 +319,8 @@ subroutine nan_cohort(cc_p) | |
currentCohort%canopy_layer = 999 ! canopy status of cohort (1 = canopy, 2 = understorey, etc.) | ||
currentCohort%NV = 999 ! Number of leaf layers: - | ||
currentCohort%status_coh = 999 ! growth status of plant (2 = leaves on , 1 = leaves off) | ||
currentCohort%size_class = 999 ! size class index | ||
currentCohort%size_by_pft_class = 999 ! size by pft classification index | ||
|
||
currentCohort%n = nan ! number of individuals in cohort per 'area' (10000m2 default) | ||
currentCohort%dbh = nan ! 'diameter at breast height' in cm | ||
|
@@ -361,7 +366,7 @@ subroutine nan_cohort(cc_p) | |
|
||
|
||
!RESPIRATION | ||
currentCohort%rd = nan | ||
currentCohort%rdark = nan | ||
currentCohort%resp_m = nan ! Maintenance respiration. kGC/cohort/year | ||
currentCohort%resp_g = nan ! Growth respiration. kGC/cohort/year | ||
currentCohort%livestem_mr = nan ! Live stem maintenance respiration. kgC/indiv/s-1 | ||
|
@@ -381,11 +386,6 @@ subroutine nan_cohort(cc_p) | |
currentCohort%leaf_litter = nan ! leaf litter from phenology: KgC/m2 | ||
currentCohort%woody_turnover = nan ! amount of wood lost each day: kgC/indiv/year. Currently set to zero. | ||
|
||
! NITROGEN POOLS | ||
currentCohort%livestemn = nan ! live stem nitrogen : KgN/invid | ||
currentCohort%livecrootn = nan ! live coarse root nitrogen: KgN/invid | ||
currentCohort%frootn = nan ! fine root nitrogen : KgN/invid | ||
|
||
! VARIABLES NEEDED FOR INTEGRATION | ||
currentCohort%dndt = nan ! time derivative of cohort size | ||
currentCohort%dhdt = nan ! time derivative of height | ||
|
@@ -423,7 +423,7 @@ subroutine zero_cohort(cc_p) | |
|
||
currentCohort%NV = 0 | ||
currentCohort%status_coh = 0 | ||
currentCohort%rd = 0._r8 | ||
currentCohort%rdark = 0._r8 | ||
currentCohort%resp_m = 0._r8 | ||
currentCohort%resp_g = 0._r8 | ||
currentCohort%livestem_mr = 0._r8 | ||
|
@@ -1040,18 +1040,13 @@ subroutine copy_cohort( currentCohort,copyc ) | |
n%npp_store = o%npp_store | ||
|
||
!RESPIRATION | ||
n%rd = o%rd | ||
n%rdark = o%rdark | ||
n%resp_m = o%resp_m | ||
n%resp_g = o%resp_g | ||
n%livestem_mr = o%livestem_mr | ||
n%livecroot_mr = o%livecroot_mr | ||
n%froot_mr = o%froot_mr | ||
|
||
! NITROGEN POOLS | ||
n%livestemn = o%livestemn | ||
n%livecrootn = o%livecrootn | ||
n%frootn = o%frootn | ||
|
||
! ALLOCATION | ||
n%md = o%md | ||
n%leaf_md = o%leaf_md | ||
|
@@ -1137,6 +1132,28 @@ function count_cohorts( currentPatch ) result ( backcount ) | |
|
||
end function count_cohorts | ||
|
||
! ===================================================================================== | ||
|
||
subroutine size_and_type_class_index(dbh,pft,size_class,size_by_pft_class) | ||
|
||
use EDTypesMod, only: sclass_ed, & | ||
nlevsclass_ed | ||
|
||
! Arguments | ||
real(r8),intent(in) :: dbh | ||
integer,intent(in) :: pft | ||
integer,intent(out) :: size_class | ||
integer,intent(out) :: size_by_pft_class | ||
|
||
size_class = count(dbh-sclass_ed.ge.0.0) | ||
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. Need an _r8. |
||
|
||
size_by_pft_class = (pft-1)*nlevsclass_ed+size_class | ||
|
||
return | ||
end subroutine size_and_type_class_index | ||
|
||
|
||
|
||
!-------------------------------------------------------------------------------------! | ||
! function countCohorts( bounds, ed_allsites_inst ) result ( totNumCohorts ) | ||
! | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These magic numbers should be replaced with a parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I grabbed your definition of fates_unset_int from the history PR, I will use that, we should expect a trivial merge conflict with either this or History refactors, which every gets pulled second.
I'm going to leave the nan initialization in that subroutine as is. I will be investigating that part of the code anyway while I'm applying the fix to #133.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not concerned about the conflict, it's easy enough to resolve. There are going to be a few conflicts with the hist mod anyway. At a minimum the set_hist_var calls need to be updated.