-
Notifications
You must be signed in to change notification settings - Fork 235
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
Add functions that can extract and update phenological status based on MODIS data and enable monthly SDA #3249
Conversation
Merge Dongchen's branch
…velop Merge from the upstream.
##read data | ||
leafphdata <- utils::read.csv(leaf_pheno_data) | ||
leafOnDay <- leafphdata$leafonday[leafphdata$year == obs_year & leafphdata$site_id==settings$run$site$id] | ||
leafOffDay<- leafphdata$leafoffday[leafphdata$year== obs_year & leafphdata$site_id==settings$run$site$id] |
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.
not required for this PR, but for future reference (1) I suspect dplyr::filter would have been more clear here and (2) it would be good to return a warning to the user if the start.date and end.date are not in the same year, since the current approach doesn't implement any way to update the phenology dates in multi-year runs. Indeed, even in a short term run you could get unexpected results if, for example, you start.date is Dec 31 2023 and your leaf out is in Jan 2024 -- the code as implemented would use the 2023 leaf out date, not the 2024 one.
if (!(lubridate::month(settings$run$start.date) %in% seq(5,9))){ #Growing seasons are coarsely defined as months from May to September for non-conifers in the US | ||
site_pft <- utils::read.csv(settings$run$inputs$pft.site$path) | ||
site.pft.name <- site_pft$pft[site_pft$site == settings$run$site$id] | ||
if (site.pft.name!="boreal.coniferous") { #Currently only excluding boreal conifers. Other evergreen PFTs could be added here 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.
Not going to hold up this PR, but this chunk of code here needs updating before it's used more broadly. Even for North American runs, there's has to be a better way of knowing the phenology of a PFT than hard coding it (e.g. adding to the <model>
or <pft>
configs. Similarly, why hard code the LAI initialization uniformly based on months if we've got a model file that prescribes the leaf-on and leaf-off dates?
@@ -240,7 +241,8 @@ template <- PEcAn.settings::Settings(list( | |||
revision = "ssr", | |||
delete.raw = FALSE, | |||
binary = model_binary, | |||
jobtemplate = "~/sipnet_geo.job" | |||
jobtemplate = "~/sipnet_geo.job", | |||
leaf_phenology= TRUE |
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.
revert
…sda_monthly_local Merge from the upstream.
fb52beb
to
ac67c02
Compare
Co-authored-by: Chris Black <[email protected]>
Description
Motivation and Context
Review Time Estimate
Types of changes
Checklist: