Project

General

Profile

replace values

Added by Sagar Parajuli about 10 years ago

Hi, I am trying to replace value 1-12 of a a variable named erod in final_erod10km.nc input file. The command gets executed, but the output is not as I expected. I was expecting the value in erod variable 1 would be replaced by 0, 2 by 0.26 and so on. Do you see any problem here?
cdo setvals,1,0,2,0.26,3,0.22,4,0.33,5,0.36,6,0.51,7,0.42,8,0.23,9,0,10,0.71,11,0,12,0 final_erod10km.nc replaced_ult_myerod.nc

Thank you


Replies (1)

RE: replace values - Added by Uwe Schulzweida about 10 years ago

There could be a problem if the data type in final_erod10km.nc is integer. In this case you have to change the data type to float:

cdo -b F32 setvals,1,0,2,0.26,3,0.22,4,0.33,5,0.36,6,0.51,7,0.42,8,0.23,9,0,10,0.71,11,0,12,0 final_erod10km.nc replaced_ult_myerod.nc
In case the original data type is already float then this is a bug!

    (1-1/1)