diff --git a/CHANGELOG.md b/CHANGELOG.md index 8742eb02cc6..9302cb656a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ We are slowly change the license from NCSA opensource to BSD-3 to help with publ - Using R4.0 and R4.1 tags to build PEcAn. Default is now 4.1 - Database connections consistently use `DBI::dbConnect` instead of the deprecated `dplyr::src_postgres` (#2881). This change should be invisible to most users, but it involved converting a lot of internal variables from `bety$con` to `con`. If you see errors involving these symbols it means we missed a place, so please report them as bugs. +- Update URL for MERRA downloads (#2888) - PEcAn.logger is now BSD-3 License - Skipped ICOS and MERRA download tests when running in github actions diff --git a/modules/data.atmosphere/R/download.MERRA.R b/modules/data.atmosphere/R/download.MERRA.R index a21502a38c9..706a3240ea2 100644 --- a/modules/data.atmosphere/R/download.MERRA.R +++ b/modules/data.atmosphere/R/download.MERRA.R @@ -139,6 +139,7 @@ download.MERRA <- function(outfolder, start_date, end_date, ncdf4::ncvar_put(loc, merra_flux_vars[r,][["CF_name"]], x, start = c(1, 1, start), count = c(1, 1, 24)) } + ncdf4::nc_close(nc) lfofile <- file.path(outfolder, sprintf("merra-lfo-%s.nc", as.character(date))) nc <- ncdf4::nc_open(lfofile) for (r in seq_len(nrow(merra_lfo_vars))) { @@ -146,7 +147,6 @@ download.MERRA <- function(outfolder, start_date, end_date, ncdf4::ncvar_put(loc, merra_lfo_vars[r,][["CF_name"]], x, start = c(1, 1, start), count = c(1, 1, 24)) } - ncdf4::nc_close(nc) } @@ -176,7 +176,9 @@ get_merra_date <- function(date, latitude, longitude, outdir, overwrite = FALSE) month <- as.numeric(gsub(dpat, "\\2", date)) day <- as.numeric(gsub(dpat, "\\3", date)) dir.create(outdir, showWarnings = FALSE, recursive = TRUE) - version <- if (year >= 2011) { + version <- if (year == 2020 & month == 9) { + 401 + } else if (year >= 2011) { 400 } else if (year >= 2001) { 300