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

Add functions that can extract and update phenological status based on MODIS data and enable monthly SDA #3249

Merged
merged 43 commits into from
Jun 5, 2024

Conversation

Qianyuxuan
Copy link
Collaborator

Description

  1. Add a function to extract MODIS phenological data under "data.remote" package based on user-defined sites' locations and dates.
  2. Add functions that can parameterize leaf-on and leaf-off dates for SIPNET model with MODIS phenological data.
  3. Enable SDA with monthly observations.
  4. Add a pecan.xml template for running single-site SDA.
  5. Fix bugs in Dongchen's new block-based SDA modules "Analysis_sda_block.R".

Motivation and Context

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

modules/assim.sequential/R/Analysis_sda_block.R Outdated Show resolved Hide resolved
modules/assim.sequential/R/sda.enkf_MultiSite.R Outdated Show resolved Hide resolved
##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]
Copy link
Member

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.
Copy link
Member

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?

modules/assim.sequential/R/sda.enkf_MultiSite.R Outdated Show resolved Hide resolved
models/sipnet/R/write.configs.SIPNET.R Outdated Show resolved Hide resolved
book_source/03_topical_pages/04_R_workflow.Rmd Outdated Show resolved Hide resolved
@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

revert

modules/data.remote/R/extract_phenology_MODIS.R Outdated Show resolved Hide resolved
Qianyu Li added 2 commits June 4, 2024 13:50
base/workflow/R/do_conversions.R Outdated Show resolved Hide resolved
models/sipnet/R/write.configs.SIPNET.R Outdated Show resolved Hide resolved
models/sipnet/R/write.configs.SIPNET.R Show resolved Hide resolved
models/sipnet/R/write.configs.SIPNET.R Outdated Show resolved Hide resolved
models/sipnet/R/write.configs.SIPNET.R Outdated Show resolved Hide resolved
@mdietze mdietze enabled auto-merge June 5, 2024 21:47
@mdietze mdietze added this pull request to the merge queue Jun 5, 2024
Merged via the queue into PecanProject:develop with commit 5d28f6d Jun 5, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants