Skip to content

Commit d6ba203

Browse files
authored
Merge pull request #5 from rgknox/comment_historycode
shorter lines
2 parents 13bbb78 + 149d6ba commit d6ba203

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

main/FatesHistoryInterfaceMod.F90

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,27 @@ module FatesHistoryInterfaceMod
5353
! as distinct classes such as PFTs or fuel size bins, there are multiple different dimensions in
5454
! which it is possible to output history variables to better understand what's going on.
5555
!
56-
! a key point is that, while the number of patches or cohorts can in principle be large, and the age
57-
! and size indices of a given patch or cohort can be finely resolved, we collapse these continuously-
58-
! varying indices into bins of time-invariant width for the purposes of history outputting. This is
59-
! because a given patch or cohort may not persist across a given interval of history averaging, so
60-
! it is better to output all patches of cohorts whose index is within a given interval along the size
61-
! or age bin.
56+
! a key point is that, while the number of patches or cohorts can in principle be large, and
57+
! the age and size indices of a given patch or cohort can be finely resolved, we collapse these
58+
! continuously varying indices into bins of time-invariant width for the purposes of history
59+
! outputting. This is because a given patch or cohort may not persist across a given interval
60+
! of history averaging, so it is better to output all patches of cohorts whose index is within
61+
! a given interval along the size or age bin.
6262
!
63-
! Another particularity of the issue of FATES shifting its subgrid structure frequently and possibly having
64-
! multiple (or zero) patches or cohorts within a given bin is that, if you want to output an average
65-
! quantities across some dimension, such as a mean carbon flux across patch area of a given age, in general
66-
! it is better to output both the numerator and denominator of the averaging calculation separately,
67-
! rather than the average itself, and then calculate the average in post-processing. So, e.g.
68-
! this means outputting both the patch area and the product of the flux within each patch and the patch area
69-
! as separate variables. Doing this allows conservation even when the weights are changing rapidly and
70-
! simplifies the logic when the number of patches or cohorts may be anywhere from zero to a large number.
63+
! Another particularity of the issue of FATES shifting its subgrid structure frequently
64+
! and possibly having multiple (or zero) patches or cohorts within a given bin is that, if you
65+
! want to output an average quantities across some dimension, such as a mean carbon flux across
66+
! patch area of a given age, in general it is better to output both the numerator and denominator
67+
! of the averaging calculation separately, rather than the average itself, and then calculate
68+
! the average in post-processing. So, e.g. this means outputting both the patch area and the
69+
! product of the flux within each patch and the patch area as separate variables. Doing this
70+
! allows conservation even when the weights are changing rapidly and simplifies the logic when
71+
! the number of patches or cohorts may be anywhere from zero to a large number.
7172
!
72-
! So what this means is that anything that is disaggregated at the patch area requires outputting the patch age
73-
! distribution (in units of patch area / site area) as the denominator of the average and then calculating the numerator of
74-
! the average as XXX times the patch area so (so in units of XXX * patch area / site area). For cohort-level quantities,
73+
! So what this means is that anything that is disaggregated at the patch area requires
74+
! outputting the patch age distribution (in units of patch area / site area) as the denominator
75+
! of the average and then calculating the numerator of the average as XXX times the patch
76+
! area so (so in units of XXX * patch area / site area). For cohort-level quantities,
7577
! this requires outputting the number density (in units of individuals per site area), etc.
7678
!
7779
! For reference, some standardized abbreviations of the FATES dimensions are listed here:
@@ -94,15 +96,18 @@ module FatesHistoryInterfaceMod
9496
! A recipe for adding a new history variable to this module:
9597
! (1) decide what time frequency it makes sense to update the variable at, and what dimension(s)
9698
! you want to output the variable on
97-
! (2) add the ih_ integer variable in the immediately following section of the module. Use the suffix as outlined
98-
! above for the dimension you are using.
99-
! (3) define a corresponding hio_ variable by associating it to the ih_ variable in the associate section
100-
! of the subroutine that corresponds to the time-updating frequency that you've chosen
101-
! (i.e. if half-hourly, then work in subroutine update_history_prod; if daily, then work in subroutine update_history_dyn)
102-
! (4) within that subroutine, add the logic that passes the information from the fates-native variable
103-
! (possibly on a patch or cohort structure) to the history hio_ variable that you've associated to.
104-
! (5) add the variable name, metadata, units, dimension, updating frequency, the ih_ variable index, etc via a call
105-
! to the set_history_var method in the subroutine define_history_vars.
99+
! (2) add the ih_ integer variable in the immediately following section of the module.
100+
! use the suffix as outlined above for the dimension you are using.
101+
! (3) define a corresponding hio_ variable by associating it to the ih_ variable
102+
! in the associate section of the subroutine that corresponds to the time-updating
103+
! frequency that you've chosen
104+
! (i.e. if half-hourly, then work in subroutine update_history_prod; if daily,
105+
! then work in subroutine update_history_dyn)
106+
! (4) within that subroutine, add the logic that passes the information from the
107+
! fates-native variable (possibly on a patch or cohort structure) to the history
108+
! hio_ variable that you've associated to.
109+
! (5) add the variable name, metadata, units, dimension, updating frequency, the ih_ variable
110+
! index, etc via a call to the set_history_var method in the subroutine define_history_vars.
106111
!
107112

108113
! Indices to 1D Patch variables

0 commit comments

Comments
 (0)