Project

General

Profile

Segmentation fault (core dumped) whne using cdo detrend

Added by Lina Teck about 5 years ago

Hello,
I've been trying to detrend a global timeseries. This is how I've been trying to use it

cdo detrend precip_CRUNCEP_global_annual.nc precip_CRUNCEP_global_annual_detrend.nc

which yields

Segmentation fault (core dumped)

The header of the file looks like this:

dimensions:
time = UNLIMITED ; // (115 currently)
bnds = 2 ;
lon = 1 ;
lat = 1 ;
variables:
double time(time) ;
time:standard_name = "time" ;
time:bounds = "time_bnds" ;
time:units = "hours since 1901-1-16 00:00:00" ;
time:calendar = "proleptic_gregorian" ;
time:axis = "T" ;
double time_bnds(time, bnds) ;
double lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
double lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
float Total_Precipitation(time, lat, lon) ;
Total_Precipitation:units = "mm d-1" ;
Total_Precipitation:_FillValue = -4.e+34f ;
Total_Precipitation:missing_value = -4.e+34f ;
Total_Precipitation:title = "Total_Precipitation" ;
int mask(lat, lon) ;

The header is almost identical to my other files where cdo detrend works. There seems to be something funny with the bnds, when I tried to set the time axis I got the warning

cdo settaxis (Warning): Time bounds unsupported by this operator, removed!

Anyway, I don't know what's happening and why, can someone help me please? I can also attach the file if that helps.


Replies (5)

RE: Segmentation fault (core dumped) whne using cdo detrend - Added by Karin Meier-Fleischer about 5 years ago

Hi Lina,

please, upload the data file.

-Karin

RE: Segmentation fault (core dumped) whne using cdo detrend - Added by Karin Meier-Fleischer about 5 years ago

Hi Lina,

I guess that the use of detrend is too memory consuming (see also detrend docu 'detrend - Note: This operator has to keep the fields of all timesteps concurrently in the memory. If not enough memory is available use the operators trend and subtrend.').

Do the following steps for the two example files you uploaded instead

cdo trend precip_CRUNCEP_global_annual.nc afile1.nc bfile1.nc
cdo subtrend precip_CRUNCEP_global_annual.nc afile1.nc bfile1.nc out_subtrend_precip.nc

cdo trend tas_CRUNCEP_global_annual.nc afile2.nc bfile2.nc
cdo subtrend tas_CRUNCEP_global_annual.nc afile2.nc bfile2.nc out_subtrend_tas.nc

-Karin

RE: Segmentation fault (core dumped) whne using cdo detrend - Added by Uwe Schulzweida about 5 years ago

Your data contains a time constant field (mask(lat, lon)) and a time varying field (Total_Precipitation(time, lat, lon)).
This is not handled correctly in the CDO operator detrend. This bug will be fixed in the next CDO release. I you don't really need the mask, you can remove it:

cdo detrend -delname,mask  tas_CRUNCEP_global_annual.nc  result.nc

    (1-5/5)