MazamaScience / AirFireWRF

Utilities for working with WRF atmospheric model data
https://mazamascience.github.io/AirFireWRF/
0 stars 1 forks source link

error message generated during wrf_load() #33

Open jonathancallahan opened 3 years ago

jonathancallahan commented 3 years ago

Calling wrf_load() seems to properly download and load the data but stops the following error message:

trying URL 'http://m2.airfire.org/PNW/4km/WRF/2021031200/wrfout_d3.2021031200.f24.0000'
Content type 'text/html; charset=iso-8859-1' length 367002144 bytes (350.0 MB)
============================
downloaded 198.9 MB

Error in value[[3L]](cond) : Error downloading: PNW-4km
In addition: Warning messages:
1: In utils::download.file(url = fileUrl, destfile = filePath, quiet = !verbose) :
  downloaded length 208584704 != reported length 367002144
2: In utils::download.file(url = fileUrl, destfile = filePath, quiet = !verbose) :

 Error in value[[3L]](cond) : Error downloading: PNW-4km 
tabrasel commented 3 years ago

Judging from the download URL, I'm assuming you requested something like:

raster <- wrf_load(
  modelName = "PNW-4km",
  modelRun = "2021031200",
  modelRunHour = 24,
  ...
)

Unfortunately, I can't make that particular request anymore since AirFire gets rid of model runs more than a week old. It's strange that it stopped downloading about halfway through the file though. The source file clearly existed and it's likely that at least some grid data had been downloaded successfully, so I don't think the problem lies in the param values for modelName, modelRun, modelRunHour, or baseUrl. The problem also couldn't lie in bad param values for varNames, res, xlim, or ylim since those are only used once the file has completely finished downloading.

I'm tempted to say the problem lay in the source file itself since wrf_download() (called by wrf_load()) simply builds a file URL like http://m2.airfire.org/PNW/4km/WRF/2021031200/wrfout_d3.2021031200.f24.0000 and downloads the matching remote file. The fact that only half of the file downloaded when the entire file was requested (variable and boundary cropping are done after downloading) leads me to believe that something was wrong with the remote file itself. I haven't encountered the issue yet myself when I try downloading any of the currently available the model runs.