Project

General

Profile

suspicious warning concerning time bounds

Added by Benjamin Buldmann about 5 years ago

dear all,

having the annual cycle constructed, I set in a loop a specific year to be able to substract that merged set of annual cycles from a timeseries.
this works fine:

for (( year = 1903; year <= 1905; year+=1 )); do
    cdo -s cat -setyear,$year 'ep_ydaymean.nc' 'ep_ydaymean_3times.nc'
done

but after applying a runnung mean and selecting only 1904:

cdo -s seldate,1904-01-01,1904-12-31 -runmean,$runmean_length 'ep_ydaymean_3times.nc' 'ep_ydaymean_runmean'$runmean_length'.nc'

this following loop put a warning everytime setyear is excecuted:
cdo setyear (Warning): Time bounds unsupported by this operator, removed!

for (( year = $start_year; year <= $end_year; year+=1 )); do

    # making the 
    if [ $(($year % 4)) -eq 0 ]; then
        if [[ $year == 1900 ]]; then  
            # kein Schaltjahr
            cdo -s setyear,$year -delete,month=2,day=29 'ep_ydaymean_runmean'$runmean_length'.nc' 'ep_ydaymean_runmean'$runmean_length'_temp_'$year'.nc'
        else
            cdo -s setyear,$year 'ep_ydaymean_runmean'$runmean_length'.nc' 'ep_ydaymean_runmean'$runmean_length'_temp_'$year'.nc'
        fi
    else # kein Schaltjahr 365 tage
        cdo -s setyear,$year -delete,month=2,day=29 'ep_ydaymean_runmean'$runmean_length'.nc' 'ep_ydaymean_runmean'$runmean_length'_temp_'$year'.nc'
    fi
done

Perhaps any idea how to solve this warning, at least surpress it ;)


Replies (4)

RE: suspicious warning concerning time bounds - Added by Karin Meier-Fleischer about 5 years ago

Hi Benjamin,

first, instead using seldate,1904-01-01,1904-12-31 to get the year 1904 you can simply use selyear,1904.

The warning can be ignored but if you would like to get rid of it you have to delete the time bounds attribute in this case.

-Karin

RE: suspicious warning concerning time bounds - Added by Benjamin Buldmann about 5 years ago

Hi,

thanks for the answer, sure selyear works also, I had some problems I probably falsely related to selyear, so I switch to seldate. I checked, selyear works fine at the moment. But I certainly tried before deleting the time bounds. Lets say by:

ncdump -h ep_ydaymean_runmean45.nc
netcdf ep_ydaymean_runmean45 {
dimensions:
    time = UNLIMITED ; // (366 currently)
    bnds = 2 ;
    lon = 1 ;
    lat = 1 ;
variables:
    double time(time) ;
        time:standard_name = "time" ;
        time:long_name = "Time in days" ;
        time:bounds = "time_bnds" ;
        time:units = "days since 1950-01-01 00:00" ;
        time:calendar = "standard" ;
        time:axis = "T" ;
    double time_bnds(time, bnds) ;
    float lon(lon) ;

so deleting the variable time_bnds should bring the result, but:
cdo delete,name=time_bnds ep_ydaymean_runmean45.nc test.nc

cdo delete (Warning): Variable name >time_bnds< not found!
cdo delete: Processed 366 values from 1 variable over 366 timesteps [0.01s 46MB]


turned out that the variable isn't there?! This is why I tried to find a solution here in the forum ;)
thx

RE: suspicious warning concerning time bounds - Added by Karin Meier-Fleischer about 5 years ago

You have to delete the attribute bounds of the variable time. You can do it using NCO's ncatted program.

ncatted -O -a bounds,time,d,, infile outfile

-Karin

    (1-4/4)