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

met2model.ED2 skips over leap years #1550

Closed
mccabete opened this issue Jul 24, 2017 · 9 comments
Closed

met2model.ED2 skips over leap years #1550

mccabete opened this issue Jul 24, 2017 · 9 comments

Comments

@mccabete
Copy link
Contributor

mccabete commented Jul 24, 2017

Only confirmed this error for GFDL, but might happen for others. met2model.ED2 flags all leap years as incomplete and warns "____ is not a complete year and will not be included" and skips them. This makes ED2 fail for runs that span leap years.

Example error run here.

@mccabete
Copy link
Contributor Author

Workaround
GFDL has no leap-years built into it's met. My personal workaround is to check if the met is GFDL and if it is, treat all leap years like non-leap years. This could use a more general check for met products that don't have leap-years.

@mdietze
Copy link
Member

mdietze commented Jul 31, 2017

@mccabe, that work around won't work -- it will get you through the PEcAn met workflow but models that need leap years will still be one day short, and thus will crash. I think you really do need to copy and add in an extra day

@mccabete
Copy link
Contributor Author

I agree. My solution is completely hackey, and I intend to sequester it in a personal branch for the time being. ED seems fine with it for now, so I think I'll return to this problem after ESA and implement a real solution.

@mccabete mccabete self-assigned this Aug 3, 2017
@tonygardella tonygardella moved this from Suggested, unconfirmed to Confirmed, suggested in PEcAn bugfix sprint: DUE Sep 15th. Aug 14, 2017
@tonygardella tonygardella moved this from Suggested, confirmed to Suggested, unconfirmed in PEcAn bugfix sprint: DUE Sep 15th. Aug 14, 2017
@mccabete mccabete moved this from Suggested, unconfirmed to In progress in PEcAn bugfix sprint: DUE Sep 15th. Aug 29, 2017
@istfer
Copy link
Contributor

istfer commented Aug 30, 2017

I think this is not a met2model.ED2 bug, but it is due to the GFDL not being processed properly (assuming GFDL has leap years), there is no check for leap years in the download.GFDL code, it's always 2920 values per year

Also met2model.ED processes leap years for AmerifluxLBL

@mdietze
Copy link
Member

mdietze commented Aug 30, 2017

I think we agreed previously that the issue was with the GFDL met, the question is whether the solution should come within the GFDL download, within met2model, or be something generic in between. Either way, that extra leap day needs to be added for models that need it.

@istfer
Copy link
Contributor

istfer commented Aug 30, 2017

got it, I wasn't sure whether GFDL has leap years or not (should've read the thread more carefully, not just the title :))

@ankurdesai
Copy link
Contributor

Many modeled met products (and even some obs) skip leap years, some older climate models even used a 360 day year. So we either need to decide that all met products must gap-fill leap days (for example, by replicating Feb 28 twice) if not provided, or all met2model must do that step if the model requires it. Since this seems model specific (some models don't care), seems like met2model.

@infotroph infotroph added this to Needs review in met processing overhaul via automation Nov 8, 2019
@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity.

@ashiklom
Copy link
Member

I think this has been addressed. That function takes a leap_year argument that controls this behavior. I'm not sure how that plays with GFDL met, though.

#' @param leap_year Enforce Leap-years? If set to TRUE, will require leap years to have 366 days. If set to false, will require all years to have 365 days. Default = TRUE.
met2model.ED2 <- function(in.path, in.prefix, outfolder, start_date, end_date, lst = 0, lat = NA,
lon = NA, overwrite = FALSE, verbose = FALSE, leap_year = TRUE, ...) {

met processing overhaul automation moved this from Needs confirmation to Done Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants