Help to get daily precipitation from pentads with CDO
Added by Kendy Silvério over 6 years ago
Hi, dear all!
1. I have pentad (5-day) time steps in my dataset (from Jan 1, 1979 - Dec 27, 2016, so 2774 total time steps) from CPC merged analysis of precipitation pentad data (https://www.esrl.noaa.gov/psd/data/gridded/data.cmap.html). And I would like to get from these pentads daily data, is it possible using cdo? If yes, is there any suggestion?
2. The 2nd question is: how to get season climatology (DJF, MAM, JJA, OND) from the original dataset (pentads).
Any suggestion would be very welcome!
Thanks in advance for your quickly feedback!
Cheers
Silverio
Replies (12)
RE: Help to get daily precipitation from pentads with CDO - Added by Ralf Mueller over 6 years ago
hi Kendy!
1) I dont know, what kind of values you expect to be there for each day out for a 5-day-mean. Constant? linear interpolation?
2) There are all kinds of seasonal operators - check the list with running
cdo -h seas
hth
ralf
RE: Help to get daily precipitation from pentads with CDO - Added by Kendy Silvério over 6 years ago
Hi, Ralf Mueller
Firstly, thanks for your feedback.
Now, responding your question:
1. I would like to get daily values from that 5-day-mean and I guess for that should be used linear interpolation, is not it, Ralf Mueller?
Thanks
Silverio
RE: Help to get daily precipitation from pentads with CDO - Added by Ralf Mueller over 6 years ago
AFAIK there is no such thing as interpolation along the time-axis in CDO.
sry
ralf
RE: Help to get daily precipitation from pentads with CDO - Added by Karin Meier-Fleischer over 6 years ago
Hi Silverio,
may I make a remark here. Time interpolation from 5-daily (pentad) values to 1-daily values can be done using the inttime operator.
cdo inttime,1979-01-01,00:00:00,1day precip.pentad.mean.nc precip.daily.mean.nc
-Karin
RE: Help to get daily precipitation from pentads with CDO - Added by Ralf Mueller over 6 years ago
awesome - didnt know about that operator,yet ;-)
thx @Karin
RE: Help to get daily precipitation from pentads with CDO - Added by Kendy Silvério over 6 years ago
Hi, Karin
It worked perfectly.
Thank you very.
By the way, is there any suggestion for converting netcdf (.nc) data to binary (.ctl)?
Cheers,
Silverio
RE: Help to get daily precipitation from pentads with CDO - Added by Karin Meier-Fleischer over 6 years ago
If you want to use GrADS you don't need to convert netCDF files, GrADS can read them. See http://cola.gmu.edu/grads/gadoc/SDFdescriptorfile.html
But of course CDO can create a .ctl file (which is not a binary file) using the gradsdes operator:
cdo gradsdes your_file.nc
The name of the .ctl file will be your_file.ctl in the same data directory.
-Karin
RE: Help to get daily precipitation from pentads with CDO - Added by Kendy Silvério over 6 years ago
Dear Karin, I am trying to do as the operator suggest (cdo gradsdes precip.daily.mean.nc), but I am getting error (cdo gradsdes (Abort): Unsupported file format!). Any idea?
Tks,
Silverio
RE: Help to get daily precipitation from pentads with CDO - Added by Karin Meier-Fleischer over 6 years ago
Without your data it is not possible to say what is going wrong. Which CDO version (cdo -V) are you using? Can you send us the output of the ncdump call or the file itself?
ncdump -h precip.daily.mean.nc
-Karin
RE: Help to get daily precipitation from pentads with CDO - Added by Kendy Silvério over 6 years ago
The data I am using is from https://www.esrl.noaa.gov/psd/data/gridded/data.cmap.html, which through the command cdo inttime,1979-01-01,00:00:00,1day precip.pentad.mean.nc I got daily data (precip.daily.mean.nc) and then I tried to use cdo gradsdes your_file.nc to get .ctl data, but I am experiencing this issue (cdo gradsdes (Abort): Unsupported file format!) as I have reported you.
From ncdump -h precip.daily.mean.nc I get it:
netcdf precip.daily.mean {
dimensions:
lon = 144 ;
lat = 72 ;
time = UNLIMITED ; // (13876 currently)
variables:
float lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "Longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
float lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "Latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
double time(time) ;
time:standard_name = "time" ;
time:long_name = "Time" ;
time:units = "hours since 1800-1-1 00:00:00" ;
time:calendar = "standard" ;
time:axis = "T" ;
float precip(time, lat, lon) ;
precip:long_name = "Average Pentad Rate of Precipitation" ;
precip:units = "mm/day" ;
precip:_FillValue = -9.96921e+36f ;
precip:missing_value = -9.96921e+36f ;
precip:precision = 2s ;
precip:least_significant_digit = 2s ;
precip:var_desc = "Precipitation" ;
precip:dataset = "CPC Merged Analysis of Precipitation Standard" ;
precip:level_desc = "Surface" ;
precip:statistic = "Pentad Mean" ;
precip:parent_stat = "Mean" ;
precip:actual_range = 0.f, 209.67f ;
// global attributes:
:CDI = "Climate Data Interface version ?? (http://mpimet.mpg.de/cdi)" ;
:history = "Fri Jul 13 13:19:46 2018: cdo inttime,1979-01-01,00:00:00,1day precip.pentad.mean.nc precip.daily.mean.nc\n",
"update 03/2017 V1701" ;
:source = "ftp ftp.cpc.ncep.noaa.gov precip/cmap/pentad" ;
:Conventions = "COARDS" ;
:title = "CPC Merged Analysis of Precipitation Pentad data (excludes NCEP Reanalysis I)" ;
:platform = "Analyses" ;
:hisotry = "Converted to chunked, deflated non-packed NetCDF4 Jul 2014" ;
:dataset_title = "CPC Merged Analysis of Precipitation" ;
:documentation = "https://www.esrl.noaa.gov/psd/data/gridded/data.cmap.html" ;
:References = "https://www.esrl.noaa.gov/psd/data/gridded/data.cmap.html" ;
:version = "V1701" ;
:Version = "V1701" ;
:CDO = "Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)" ;
}
To get the version, version (cdo -V) I have got this info:
Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)
Compiler: gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
version: gcc (Ubuntu 5.3.1-9ubuntu2) 5.3.1 20160220
Features: DATA PTHREADS OpenMP4 HDF5 NC4/HDF5/threadsafe OPeNDAP SZ Z UDUNITS2 PROJ.4 MAGICS CURL FFTW3 SSE2
Libraries: HDF5/1.8.16 proj/4.92 curl/7.47.0
Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
CDI library version : 1.7.0
GRIB_API library version : 1.14.4
netCDF library version : 4.4.0 of Mar 29 2016 11:41:40 $
HDF5 library version : 1.8.16
SERVICE library version : 1.4.0
EXTRA library version : 1.4.0
IEG library version : 1.4.0
FILE library version : 1.8.2
I am trying to convert the data to compute composite analysis, whose initial data should be in .ctl and .bin.
Thank you Mr. Karin in advance for your help.
RE: Help to get daily precipitation from pentads with CDO - Added by Karin Meier-Fleischer over 6 years ago
Ok, you are using an old CDO version which maybe cause the problems. Please, update to the current version.
Here is what I did with the data:
cdo inttime,1979-01-01,00:00:00,1day precip.pentad.mean.nc out_time_interpolate.nc cdo gradsdes out_time_interpolate.nc
cat out_time_interpolate.ctl
* Generated by CDO operator gradsdes * DSET ^out_time_interpolate.nc DTYPE NetCDF XDEF 144 LINEAR 1.250000 2.500000 YDEF 72 LINEAR -88.750000 2.500000 ZDEF 1 LEVELS 0 TDEF 13876 LINEAR 00:00Z01jan1979 1dy TITLE out_time_interpolate.nc 144x72 grid OPTIONS yrev UNDEF -9.96921e+36 VARS 1 precip 0 t,y,x Average Pentad Rate of Precipitation [mm/day] ENDVARS
-Karin
RE: Help to get daily precipitation from pentads with CDO - Added by Kendy Silvério over 6 years ago
Thank you very much dear Karin for your help.
Cheers,
Kenedy