Daily observations as fractions of the annual mean value (climate change)
Added by Predrag Ignjacevic over 4 years ago
Hi everyone,
I am interested in creating a so-called "temporal pattern scale" of daily temperature and relative humidity data.
What this entails is that I would need to divide daily observations with the annual mean value.
I have tried using the operator ydaydiv to divide the daily time series by the annual mean series but keep getting an error:
"Day of year index 1 already allocated (date=-583704608)!
terminate called without an active exception"
I am assuming this has to do with the fact that my time series are daily and annual respectively and therefore do not match the ydaydiv requirements.
How would I go about creating a daily time series that presents daily observations as fractions of the annual mean values?
Thank you!
Predrag
Replies (13)
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Ralf Mueller over 4 years ago
hi!
I think that what you want is simply not what ydaymean
does:
- you want to divide multiyear daily data by the year-mean field of the corresponding year
ydaymean
does the division of any kind of time-series by the daily mean values of the same day in a year
Can you comment on that? Did I get this right?
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Predrag Ignjacevic over 4 years ago
Yes Ralf, that is correct.
Therefore, ydaymean would also not work for me as I need the year-mean not the daily mean across many years.
Would you have an idea how this can be solved?
Thank you for your help,
Predrag
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Ralf Mueller over 4 years ago
can you upload the input file? if it's to large, maybe a single variable or level is enough for debugging. I think this is solvable in a for loop, but I need the data to avoid getting lost in (possible) details of it
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Predrag Ignjacevic over 4 years ago
Hi,
Here are two upscaled example files from the EU-11 Cordex data I am using.
The first file is the daily timeseries and the second, the annual mean of the data.
How would you go about dividing these two datasets?
Best,
Predrag
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Predrag Ignjacevic over 4 years ago
I have tried simply using the div function and it works with the following warning:
Filling up stream2 >filename< by copying all timesteps.
How can I check whether the annual mean values are being filled in for all days of the same year?
This would be the equivalent of what I need.
Best
Predrag
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Ralf Mueller over 4 years ago
Sorry for the late reply: I talked to Uwe about your yearly-workflow and he implemented a set of operators for this. I will test is with your data and do some more tests.
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Predrag Ignjacevic over 4 years ago
This is great, thank you guys!
I have found where the filling up stream case is coming up in the div function:
https://earth.bsc.es/gitlab/ces/cdo/raw/3f24a95db4d1fcd21a4ac20f42e15d4d3c90784e/src/Arith.c
As mentioned, The issue i that I am not sure what values are being filled in.
Suppose that the daily 5-year data matrix would be of the form (360,720,1800) and the annual 5-year (360,720,5).
The divide function (or daily-to-annual conversion function) would have to be able to convert the (360,720,5) matrix into a (360,720,1800) matrix by filling up the daily matrix values with annual values that correspond to the days of that year.
I believe that you got this already from my previous question but I have tried being as clear as possible
Once again, thank you for the help. Hopefully more people would find this new function useful!
Pedja
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Ralf Mueller over 4 years ago
filling up the stream is normal for arithmetic operators when you have multiple records in the first input but only a single on in the second input. In this case the single record is re-used for further computation.
you can find the new CDO version here:"https://code.mpimet.mpg.de/attachments/21941/cdo-1.9.9rc3.tar.gz". the new operators are
- yeardiv
- yearadd
- yearmul
- yearsub
For your application the CDO call should look like:
cdo yeardiv tas_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_SMHI-RCA4_v1_day_20060101-20101230.nc tas_yearmean_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_SMHI-RCA4_v1_day_20060101-20101230.nc out.nc
hth
ralf
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Predrag Ignjacevic over 4 years ago
Hi Ralf,
I have installed the package using
./config
make
sudo make install
However, when I run any of the function, I am faced with an error:
Unsupported file type (library support not compiled in)
To create a CDO application with NetCDF4 support use: ./configure --with-netcdf=<NetCDF4 root directory> ...
Am I not installing this correctly?
Best
Pedja
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Ralf Mueller over 4 years ago
you need to have an installation of the netcdf library on your system. what kind of system to you use?
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Predrag Ignjacevic over 4 years ago
I am using the Windows 10 WSL Ubuntu app.
I used to install the cdo library previously by simply running:
sudo apt install cdo
I could open netcdf files before as well. However, not after installing the new package.
I have installed the netcdf library and the hdtf as well using:
sudo apt-get install libnetcdf-dev libhdf5-dev
I run the configure command...
sudo ./configure --enable-netcdf4 --enable-zlib --with-netcdf=/usr/ --with-hdf5=/usr/
... and get the last few lines before the error printed:
checking hdf5.h usability... no
checking hdf5.h presence... no
checking for hdf5.h... no
checking for library containing H5Fopen... no
configure: error: Cannot link to hdf5!
The config file I have attached.
Thank you for your help!
Pedja
config.log (60.7 KB) config.log |
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Predrag Ignjacevic over 4 years ago
Hi again,
I simply followed the instructions on the following link and got cdo to work with netcdf properly:
http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
Thank you again for all your help!
Best
Pedja
RE: Daily observations as fractions of the annual mean value (climate change) - Added by Ralf Mueller over 4 years ago
hi!
good to know, that you could solve it. with
dpkg -L libhdf5-devyou can check the list of files provided by this package. There should be something like
hdf5.h
and libhdf5.so
. You can check the features built into the CDO binary withcdo -V
cheers
ralf