I have hundreds of NETCDF files that I obtained from ERA5(Land) datasets. The temporal resolutions of the data are in hours but I need to compile them into daily mean. Single calculation is straightforward in CDO (see below). But when I tried to loop through the files, I'm getting an error message that suggests that I can only calculate them one at a time, which would be quite laborious. I was wondering if there is a workaround either in R or CDO. Here are my CDO syntaxes:
$ cdo daymean infile1980.nc outfile_day1980.nc ##single operation works fine.
Trying to loop through
for i in C:/path/.*nc
do
cdo daymean "${pattern}"* "${pattern}_day.nc"
done
cdo (Abort): Too many input streams for operator 'daymean'!
The goal is to aggregate each year's hourly data into daily data