Skip to content
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

Arctic Carbon Cycle Updates #947

Closed
wants to merge 11 commits into from
Closed

Conversation

lmbirch89
Copy link
Contributor

@lmbirch89 lmbirch89 commented Mar 24, 2020

Description of changes

We have addressed the issues in phenology and photosynthesis in the high latitudes. Development was focused on PFT specific differences and we used observations to inform model development. GPP is improved now such that the tundra is realistically less productive than the boreal forest.

Specific notes

List of Improvements to Arctic-Boreal
Mechanistic Onset/Offset (Phenology)
Onset=soil and air temperatures above freezing
Offset=latitudinal gradient
Maximum Day Length Scaling for Jmax (Luna and photosynthesis)
Leuning Temperature Scaling Parameters, removing the 11 to 35C threshold (Luna and photosynthesis)
Small bug fix where day temperature was used instead of night (Luna)
Dynamic Stem Leaf Allocation (parameter file)
Increased Root Allocation for Grasses/Shrubs (parameter file)
Increased Leaf Allocation for Deciduous Trees (parameter file)

Contributors other than yourself, if any: Brendan Rogers and Danica Lombardozzi have helped with this and work was done as part of NASA's Carbon Cycle Science and ABoVE.

CTSM Issues Fixed (include github issue #): High GPP bias

Are answers expected to change (and if so in what way)?
Yes, the high bias of GPP and LAI has been reduced in the ABZ.

Any User Interface Changes (namelist or namelist defaults changes)?
I have a new parameters file in /glade/work/lbirch/devclm4git/clm5_params_arcticupdate.nc

Testing performed, if any:
A paper is being submitted to GMD of everything we worked through. We used comparisons with Fluxcom, flux towers, and ILAMB. This has also been presented a few times to the NCAR land model working group.
ilamb_scoreall.pdf
griddedclm5_gpp.pdf
clm_gridflux.pdf

A global simulation also ran successfully with changes contained to the high latitudes, except for the Leuning 2003 temperature scaling, which had been used in a previous version of CLM.

(List what testing you did to show your changes worked as expected)
(This can be manual testing or running of the different test suites)
(Documentation on system testing is here: https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide)
(aux_clm on cheyenne for intel/gnu and izumi for intel/gnu/nag/pgi is the standard for tags on master)

NOTE: Be sure to check your Coding style against the standard:
https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines


This change is Reviewable

Copy link
Member

@billsacks billsacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmbirch89 - thank you again for opening this pull request in order to share these improvements with us! I have a number of requests below, some small and some larger. I'm going to discuss some of the larger ones with some other folks to decide how we want to proceed, so keep an eye out for more from us soon.

Two over-arching questions we need to decide on are:

  1. Should these changes be done in a backwards-compatible way, controlled by one or more namelist flags and pulling parameters out to file?

  2. What should be done together, and what should be separated into separate PRs? This question is connected to the first: We generally try to separate answer-changing modifications from those that are introducing a new option but are answer-preserving for existing configurations. So, if we're going to make some of this non-answer-changing (via namelist flags), then that should be kept separate from any answer changes.

src/biogeochem/CNPhenologyMod.F90 Outdated Show resolved Hide resolved
!
! !LOCAL VARIABLES:
integer :: g,c,p !indices
integer :: fp !lake filter patch index
real(r8):: ws_flag !winter-summer solstice flag (0 or 1)
real(r8):: crit_onset_gdd !critical onset growing degree-day sum
real(r8):: crit_daylat !latitudinal light gradient in arctic-boreal
real(r8):: onset_thresh !flag onset threshold
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're using this effectively as a logical value. Please change it to a logical, such as:

logical :: do_onset  ! flag for whether to do onset now

(I realize that some other flags in this routine are real-valued like this... it's possible that's needed for some other reason, or possible that that shouldn't have been done that way in the past. In either case, let's keep new code cleaner in this respect.)

src/biogeochem/CNPhenologyMod.F90 Outdated Show resolved Hide resolved
src/biogeophys/WaterDiagnosticBulkType.F90 Outdated Show resolved Hide resolved
src/biogeochem/CNPhenologyMod.F90 Show resolved Hide resolved
src/biogeophys/TemperatureType.F90 Show resolved Hide resolved
src/biogeophys/WaterDiagnosticBulkType.F90 Outdated Show resolved Hide resolved
src/biogeophys/WaterDiagnosticBulkType.F90 Outdated Show resolved Hide resolved
src/biogeophys/WaterDiagnosticBulkType.F90 Outdated Show resolved Hide resolved
src/biogeophys/WaterDiagnosticBulkType.F90 Outdated Show resolved Hide resolved
@ekluzek ekluzek self-assigned this Mar 26, 2020
@ekluzek ekluzek added PR status: work in progress priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations enhancement new capability or improved behavior of existing capability labels Mar 26, 2020
@billsacks billsacks requested a review from wwieder March 26, 2020 19:55
@billsacks
Copy link
Member

@lmbirch89 - First off, I want to thank you again for taking the time to share these changes with us. I talked about this today with @ekluzek @wwieder and others. Our plans / requests are:

  • Many of my above comments are pretty small and should be easy to address; if you could address the easy ones whenever you get a chance, that would be great

  • @wwieder will do a scientific review of the changes. Among other things, his review will inform what we want to be done in a backwards-compatible way (so that simulations with clm5.0 physics will maintain the same answers as before)

  • In the next week or so, I am going to put in place some infrastructure on master to make it easy to find a soil layer at a specified depth. Then we'll work with you to update this branch to use this infrastructure rather than assuming layer 3.

  • @ekluzek will take the software lead on this, and will reach out to you regarding the bigger changes I asked for - mainly pulling parameters out to file and adding namelist flags so that most of these changes are made in a backwards compatible way.

Again, thank you for this!

@wwieder
Copy link
Contributor

wwieder commented Mar 27, 2020

@lmbirch89 thanks for this contribution. I'll start reviewing this over the weekend and make some notes and ask questions. I'd suspect that having a call some time next week will also be helpful. Could you also pass along your talk from the LMWG, it may remind me of what all the modifications are intended to fix.

@lmbirch89
Copy link
Contributor Author

@billsacks @wwieder I'm happy to chat further. I will email my presentation to you both from the working group meeting and fix some of these small things next couple days.

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 27, 2020

@lmbirch89 can you attach your presentation to this PR, so we can all look at it, and it will remain as documentation?

Thanks

@lmbirch89
Copy link
Contributor Author

@ekluzek It says the file is too large. So any advice on that would be appreciated.

@dlawrenncar
Copy link
Contributor

dlawrenncar commented Mar 27, 2020 via email

Copy link
Contributor

@wwieder wwieder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the modifications requested here generally fall into 3 categories:

  1. Phenology (esp. WRT onset and offset)
  2. LUNA, with several modifications to the application of LUNA for high latitudes
  3. Allocation parameters

The testing in high latitude systems looks very compelling, but it would be helpful to see the effects of these changes both on single point simulations that we tend to look at frequently (e.g. UMBS) and well as global runs (and especially under changing environmental conditions)

onset_thresh=1.0_r8
else if (onset_gddflag(p) == 1.0_r8 .and. t10(p) > SHR_CONST_TKFRZ &
.and. tmin10(p) > SHR_CONST_TKFRZ .and. ws_flag==1.0_r8 &
.and. dayl(g)>(crit_dayl/2.0_r8) .and. snow5d(c)<0.1_r8) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wonder here if it makes sense to have this latitude threshold, or we'll end up with different dynamics in a global-scale simulation on either side 45 degrees? Would it be more clear to just define a new seasonally deciduous subroutine for the PFTs you're trying to target here? This would be for larches, arctic decid. shrubs and grasses, and temperate decid. trees? regardless, changing the parameterization of the later would likely need to be evaluated both at point scales (e.g. UMBS, 45.5 degrees N) and for global runs?

onset_thresh=1.0_r8
else if (onset_gddflag(p) == 1.0_r8 .and. t10(p) > SHR_CONST_TKFRZ &
.and. tmin10(p) > SHR_CONST_TKFRZ .and. ws_flag==1.0_r8 &
.and. dayl(g)>(crit_dayl/2.0_r8) .and. snow5d(c)<0.1_r8) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this snow5d threshold be put on a parameter file? More generally, it means that plants can't leaf out until the snow is completely melted? Is this a good assumption for present day climate for taller vegetation? What are results of this assumption in changing climate scenarios?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should put the 0.1 value on the paramsfile as something like "snow5d_thresh_for_onset". Any other suggestions for a name?

Comment on lines 976 to 979
crit_daylat=54000-360*(65-grc%latdeg(g))
if (crit_daylat < crit_dayl) then
crit_daylat = crit_dayl
end if
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be another good one to have a test to see the implications for temperate systems and in global runs.

@@ -907,13 +914,23 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , &
if (onset_gddflag(p) == 1.0_r8 .and. soilt > SHR_CONST_TKFRZ) then
onset_gdd(p) = onset_gdd(p) + (soilt-SHR_CONST_TKFRZ)*fracday
end if
!separate into Arctic boreal and lower latitudes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekluzek & @billsacks What's the best way to wrap this into a namelist flag to maintain backwards compatibility with CLM5 but also make sure the code is readable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • should we have this hardcoded behavior for latitude or define this by PFT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • the second part of this conditional with onset_gddflag(p) == 1.0_r8 seems to be asking for something different, but as implemented it also seems to be triggered in lower latitudes too, leading to higher than intended LAI and GPP

onset_thresh=1.0_r8
else if (onset_gddflag(p) == 1.0_r8 .and. t10(p) > SHR_CONST_TKFRZ &
.and. tmin10(p) > SHR_CONST_TKFRZ .and. ws_flag==1.0_r8 &
.and. dayl(g)>(crit_dayl/2.0_r8) .and. snow5d(c)<0.1_r8) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this logic for crit_dayl/2.0_r8? The critical day length was previously used for offset, but now is being used for onset and divided by 2? The intent here is murky, but is this so onset doesn't happen too early in the growing season?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's talk about this Wednesday.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to chatting about these, but this is just a day light threshold so phenology doesn't try to start when there is less than 6 hours of daylight.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've actually come back to this and realized that this is do backwards from Leah's intention. So I'll file this as a separate issue.

src/biogeophys/LunaMod.F90 Outdated Show resolved Hide resolved
src/biogeophys/LunaMod.F90 Show resolved Hide resolved
src/biogeophys/LunaMod.F90 Show resolved Hide resolved
src/biogeophys/TemperatureType.F90 Show resolved Hide resolved
src/biogeophys/TemperatureType.F90 Show resolved Hide resolved
@wwieder
Copy link
Contributor

wwieder commented Mar 30, 2020

@lmbirch89 & @ekluzek there's lots to go over here. After you're able to digest a bit, would it be helpful to have a call to make a game plan moving forward?

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 30, 2020

@lmbirch89 here's a document about adding namelist items to CTSM...

https://wiki.ucar.edu/display/ccsm/Adding+New+Namelist+Items+to+CLM

We should also move some of the hardcoded parameters you found to the paramsfile. I think there's enough examples in the code to "follow the recipe". But, let us know if you need more help than that.

I think you should look a lot of this over, but mainly wait for our discussion on Wednesday to make the most progress. We might both change what we think we need to do, as well as be able to clarify any questions you have.

Copy link
Collaborator

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we've talked about there are things that we need to change, mostly adding things to paramsfile as well as namelist triggers.

onset_thresh=1.0_r8
else if (onset_gddflag(p) == 1.0_r8 .and. t10(p) > SHR_CONST_TKFRZ &
.and. tmin10(p) > SHR_CONST_TKFRZ .and. ws_flag==1.0_r8 &
.and. dayl(g)>(crit_dayl/2.0_r8) .and. snow5d(c)<0.1_r8) then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is becoming complex we should probably make this into its own little function. Also the "45.0" degree threshold should be a parameter on the paramsfile.

Comment on lines 976 to 979
crit_daylat=54000-360*(65-grc%latdeg(g))
if (crit_daylat < crit_dayl) then
crit_daylat = crit_dayl
end if
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

54000, 360, and 65 should become parameters on the paramsfile. Do any of these relate to other parameters? And what are some suggestions on names?

src/biogeophys/PhotosynthesisMod.F90 Outdated Show resolved Hide resolved

vcmaxse = 668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)
jmaxse = 659.70_r8 - 0.75_r8 * min(max((t10(p)-tfrz),11._r8),35._r8)
vcmaxse = 486.0_r8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these become hardcoded values, we should put them on the params file. And possibly the old hard coded constants should as well, and then a namelist trigger between the two.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also part of a use_Leuning switch, if it's made

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 30, 2020

Namelist control for Luna can go into the "luna" namelist in LunaMod.F90. Namelist control can go into "cnphenology" namelist in cnphenology. Photosynthesis doens't have a namelist, but we could add one to it. It does have an Init method.

I think the changes in TemperatureMod and WaterDaignosticBulkType are just to add accumulation variables. So these could be done all the time whether they are needed or not (or use the luna or chphenology namelist triggers to determine if they are on or no.

@billsacks
Copy link
Member

I think the changes in TemperatureMod and WaterDaignosticBulkType are just to add accumulation variables. So these could be done all the time whether they are needed or not (or use the luna or chphenology namelist triggers to determine if they are on or no.

In the past we have talked about preferring if accumulation variables are owned by particular parameterizations - so these variables would live in derived types specific to those parameterizations. This keeps logic more localized and makes it more straightforward to exclude them if the given parameterization is inactive. However, I don't feel strongly on this point.

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 30, 2020

In the past we have talked about preferring if accumulation variables are owned by particular parameterizations - so these variables would live in derived types specific to those parameterizations. This keeps logic more localized and makes it more straightforward to exclude them if the given parameterization is inactive. However, I don't feel strongly on this point.

That would be preferred so that it didn't impact parts of the code outside the area that's really being changed. That would also make the accumulation naturally only happen when the new code is invoked. So that it is much cleaner and understandable.

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 30, 2020

@dlawrenncar and @wwieder should the way this be handled is a namelist toggle to choose between Leuning and Kattge? And are there other options that should be added in as well? And perhaps we need to do our own simulations with Leuning to test its global response? @danicalombardozzi on Wednesday tell us more about what Nick Smith is doing and if his work is ready to come in or not.

@wwieder
Copy link
Contributor

wwieder commented Mar 30, 2020

Given @danicalombardozzi 's comments, I think we want to default to Kattge. For simulations done by @lmbirch89, it seems like Leuning was used. Down the road, it would be great to bring in Nick's ideas, but as far as I know these are not ready for game time right now. With the aim of bringing this in for the parameter perturbation experiment, @dlawrenncar it seems like we'd want Kattge for sure. Let's talk Weds.

@billsacks
Copy link
Member

Okay, I have force pushed a few commits that fix the history. Note that the update (from hash 32d0854 to hash dd0cbec) doesn't change the end result at all, but fixes the history.

@lmbirch89 - a full answer to your question is complicated (and dinner is calling, so I've gotta run), but the short version is: while the end result was correct, merging on top of an incorrect state didn't fix the history of the CNPhenologyMod file. For example, changes to that file that I made became attributed to you instead. That's fixed now.

@wwieder
Copy link
Contributor

wwieder commented Apr 16, 2020

Hi @lmbirch89, I wanted to circle back to see where you were with the requests made above and the long conversations about the code and parameter modifications made here? It seems like a bunch of this has been addressed, or is mostly there?

I'm asking because we'd like to do a clean comparison of a series of clean 2 degree simulations with:

  1. CLM5 control, the
  2. LUNA bug fixes you identified and that are corrected with Fixes for the LUNA dayl bugs #961, and
  3. LUNA bugs + the other changes you're suggesting in Arctic Carbon Cycle Updates #947.

I think initially we may stick with the Kattge temperature response functions with acclimation (not Leuning). @olyson is going to spinup 1 & 2 now with the aim of running transient 20th century runs that can be compared to ILAMB. We'd like to do the same with 3, when you feel like the code is close enough for this kind of test. @ekluzek can make a branch that reverts to Kattge for now, for these testing purposes.

@lmbirch89
Copy link
Contributor Author

@wwieder I've cleaned up everything so it runs as I expect at the flux tower sites, and I'm finalizing if the gridded global output in this version of CLM matches my previous regional simulations (when I didn't have a latitudinal threshold for onset, since it didn't matter). Short answer is I think I addressed everything that was asked of me (except the boolean for onset_thresh instead of 0 or 1). I can confirm I'm happy with the global simulation over this weekend though.

@ekluzek
Copy link
Collaborator

ekluzek commented Apr 16, 2020

I can confirm I'm happy with the global simulation over this weekend though.

OK, it sounds like we should wait on this before we make our branch for our testing. If you can run over the weekend, and then let us know whether it looks right or not, that would be helpful. Then I can make a branch that reverts Leuning to Kattge and we can do our testing with that.

@billsacks
Copy link
Member

billsacks commented Apr 17, 2020

I have gone through my own comments and requests to see what has and hasn't been addressed at this point. To help keep track of these requests, I am gathering the remaining outstanding points in a checklist here. Most of these are code cleanup, but a few are more about the science. I'll periodically update this comment as I see that things have been addressed. Note that this just includes comments that I made - not comments made by @wwieder @ekluzek or others.

@wwieder
Copy link
Contributor

wwieder commented Apr 17, 2020 via email

@billsacks
Copy link
Member

Bll I may need a how to you actually keep track of things on github tutorial... not an item for a friday afternoon.

Through lots of sweat, blood and tedium. (Okay, maybe not blood... and often not too much sweat either... but definitely tedium, plenty of tedium.)

@lmbirch89
Copy link
Contributor Author

@billsacks @wwieder I also really wanted to ask and know the answer to that question, haha. Thanks so much Bill!

@billsacks
Copy link
Member

A bit less tongue-in-cheek, the best I've been able to figure out is hitting the "resolve" button on comments that have been fully resolved (note: we prefer that this marking as resolved be done by the original commenter of a given comment / thread), and then, once a PR gets an overwhelming number of comments (like this one has), starting a one-stop-shopping checklist of the outstanding items that I can edit over time.

I periodically feel like there must be a better way, but I haven't found one yet.

@billsacks
Copy link
Member

(It doesn't help that GitHub hides some comments when there get to be too many: I often need to search for "hidden" or "load more" on the page to make sure I have found everything.)

@wwieder
Copy link
Contributor

wwieder commented Apr 20, 2020

OK, I'll start going through and making my own checklist that hopefully doesn't overlap with @billsacks.
Here's a list of the bug fixes that I don't think need to be part of this PR, but I'm not sure how we resolve these conflicts @ekluzek?

Here are some other minor issues to correct

@wwieder
Copy link
Contributor

wwieder commented Apr 22, 2020

@lmbirch89 did you have a chance to look at your global runs to see if they look sensible?

@lmbirch89
Copy link
Contributor Author

@wwieder Yes, sorry they are done running and look at first glance acceptable, but I just needed to check a couple pft specific things. I can do it tonight.

@wwieder
Copy link
Contributor

wwieder commented Apr 22, 2020

Thanks @lmbirch89 if these look OK let us know. Then @ekluzek will create a branch for @olyson to run a clean spinup to compare default CLM5, LunaBug fixes, and the science changes you're suggesting (without Leunning to start with).

@lmbirch89
Copy link
Contributor Author

lmbirch89 commented Apr 23, 2020

@wwieder @ekluzek @olyson With all my changes implemented (not the clean up suggested above yet), the global results are what I expect at high latitudes and seem reasonable everywhere else too. The red line in the seasonal GPP figures is the global model development run with 2 degree resolution. I am still running with Leuning in the figures below. (I can share more figures if necessary, but I thought this was a nice quick summary.)
ilamb_global
ilambgpp

@wwieder
Copy link
Contributor

wwieder commented Apr 23, 2020

Great news, @lmbirch89! We'll get started on running our own tests here. Can you keep updating this PR to address the remaining issues we've highlighted. @ekluzek does @lmbirch89 need to back out all off the LUNAbugs from this PR (this is something both @billsacks and I flagged)?

p.s. that annual cycle is unreal!

@ekluzek ekluzek marked this pull request as draft June 4, 2020 22:42
@ekluzek ekluzek removed the priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations label Jul 2, 2020
@ekluzek
Copy link
Collaborator

ekluzek commented Jul 2, 2020

OK, my understanding is that we are going to drop this one in favor of #990. So I'm going to close this one, after I go through and make sure any notes on needed changes are noted in #990. Someone let me know ASAP if that is NOT the case.

@ekluzek ekluzek added the closed: wontfix We won't fix this issue, because it would be too difficult and/or isn't important enough to fix label Jul 2, 2020
@ekluzek
Copy link
Collaborator

ekluzek commented Jul 18, 2020

This one has been converted into the luna bug fixes that already came in, and #990 that is this one with Kattge rather than Leuning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: wontfix We won't fix this issue, because it would be too difficult and/or isn't important enough to fix enhancement new capability or improved behavior of existing capability science Enhancement to or bug impacting science
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

8 participants