Project

General

Profile

daily minimum, maximum and average

Added by Ehsan Taghizadeh about 2 years ago

Hi,
I hope you are doing well.
I've downloaded hourly temperature at 2m level from ERA5-Land for all days, all months and some years. I would like to extract daily max, min and average of 2m temperature with NCO/CDO. It would be great if I could have your suggestions for the commands.
Beside that, because of the limitation on size of file to download, I had to download ERA5-Land data on two parts, 1998 to 2008, and 2009 to 2019. It is necessary to merge two downloaded files. I tried the following command:
$ ncrcat in1.nc in2.nc out.nc
The following error is occurred:
"ncrcat error no variables fit criteria for processing"

Attached file is the api file to download ERA5-Land data.
I hope to hear from you.
Sincerely


Replies (7)

RE: daily minimum, maximum and average - Added by Karin Meier-Fleischer about 2 years ago

Hi Ehsan,

have you tried

cdo cat in1.nc in2.nc out.nc

or

cdo mergetime in1.nc in2.nc out.nc

RE: daily minimum, maximum and average - Added by Ehsan Taghizadeh about 2 years ago

Dear Karin,
As you suggested I tried both commands. For both commands, I faced the following error:
Error (cdf_put_vara_double): NetCDF: Numeric conversion not representable

Then I tried the following command:
$ cdo -b F64 mergetime in1.nc in2.nc out.nc
It seems worked, with the following message:
cdo mergetime: Processed 2 variables over 184080 timesteps [95.59s 103MB].
However, the out.nc has size about 52 G, while each input file has size about 6 G.
Each in1.nc and in2.nc has size about 6 G, however, the out.nc has size about 52 G!
May I ask is everything right?

In summary I would like to find daily max, main and average of 2m temperature from the attached files, then merge them in one file? Finally I had to interpolated these max, min and average data over points in the Rain_Synoptic_GorganRudGharesu.txt file. I'll be thankful if there is any command for each of these jobs in cdo.

Sincerely,
Ehsan

RE: daily minimum, maximum and average - Added by Karin Meier-Fleischer about 2 years ago

Your data is of type short and you have to use

cdo -b i16 -mergetime test1.nc test2.nc out.nc

To calculate the average close to the stations from the CSV file you can use Python for example.

RE: daily minimum, maximum and average - Added by Ehsan Taghizadeh about 2 years ago

Dear Karin,
"-b i16 -mergetime" option works well. Thank you so much for your helpful reply.
If I ignore the stations, may I ask how could I find daily max, min and average of 2m temperature in out.nc, including hourly data for some years? I think cdo could find daily max, min and average from a data file.
Pardon me to repeat the question. I think I couldn't ask my question clearly.

RE: daily minimum, maximum and average - Added by Ehsan Taghizadeh about 2 years ago

Dear Karin,
May I ask why did you mention "i16" and not "i8" or "i32", or etc?

RE: daily minimum, maximum and average - Added by Karin Meier-Fleischer about 2 years ago

First, I tried I8 but it said 'Error (cdf_put_vara_double): NetCDF: Numeric conversion not representable' than I tried I16 and it worked fine. I didn't try I32 because it would increase the output file size. It is up to you what kind of data type you want to choose (float = F32, double = F64, ... see documentation).

    (1-7/7)