dklinges9 / mcera5

mcera5
12 stars 9 forks source link

Error when request_era5 combines nc files #17

Closed trishfishkoh closed 2 years ago

trishfishkoh commented 2 years ago

Hi!

I'm downloading files across multiple years, but there is an error message when request_era function combines the downloaded files. this is after building request runs fine and the downloads are in the folder. Is there something I'm doing incorrectly? Many thanks!

request_era5(request = req, uid = uid, out_path =
               file_path, combine = TRUE)

Results in this:

- staging data transfer at url endpoint or request id:
  89e71965-1111-42ca-82c9-ba15c677d360

- timeout set to 5.0 hours
  |==========================================================================| 100%
- moved temporary file to -> /Users/patriciakoh/Library/CloudStorage/OneDrive-TheUniversityofMelbourne/trout-project/01_watertempModel/environmental_data_code/data/era5_140_151_-39_-34_2020.nc
- request purged from queue!
ERA5 netCDF file 1 successfully downloaded.
Requesting data to the cds service with username 149341
- staging data transfer at url endpoint or request id:
  cd61dc48-456b-465c-9af6-a4fdb91ce4fa

- timeout set to 5.0 hours
  |==============================================================================================================================| 100%
- moved temporary file to -> /Users/patriciakoh/Library/CloudStorage/OneDrive-TheUniversityofMelbourne/trout-project/01_watertempModel/environmental_data_code/data/era5_140_151_-39_-34_2021.nc
- request purged from queue!
ERA5 netCDF file 2 successfully downloaded.
Requesting data to the cds service with username 149341
- staging data transfer at url endpoint or request id:
  81098b38-26c6-44f0-a3be-77ea56e6ba66

- timeout set to 5.0 hours
  |==============================================================================================================================| 100%
- moved temporary file to -> /Users/patriciakoh/Library/CloudStorage/OneDrive-TheUniversityofMelbourne/trout-project/01_watertempModel/environmental_data_code/data/era5_140_151_-39_-34_2022.nc
- request purged from queue!
ERA5 netCDF file 3 successfully downloaded.
Now combining netCDF files...
Error in R_nc4_open: No such file or directory
 Error in ncdf4::nc_open(x) : 
Error in nc_open trying to open file era5_140_151_-39_-34_2020.nc (return_on_error= FALSE )
trishfishkoh commented 2 years ago

I've reduced the number of years and set the downloads to the working directory instead of a sub directory and it now seems to work!

dklinges9 commented 2 years ago

Hi @trishfishkoh , sorry for my late reply as I've been traveling. It's hard for me to reproduce your problem from only the console print-out that you have provided, but looking at the names of the ERA5 files you were trying to download it appears that you had selected 2020, 2021, and 2022? If you had selected the entire year for 2022, then yes that third file will fail as the last few months of 2022 won't be available from ECMWF– because they haven't happened yet ;) ERA5 only provides preliminary forecasts up to 5 days in advance of present.

I'm guessing that was the problem, given that it worked fine when you reduced the number of years– you should be able to select any sub directory you so desire, so long as you have consistent references to the same file paths throughout. I'll close this issue now but please feel free to reach out in case you have other questions!

Best, Dave