modifying only one variable
Added by Sagar Parajuli over 8 years ago
Hi, I need to multiply a particular variable with a constant. I know I can use mulc for this but this multiplies all the variables in the file, not only the variable of interest. Is there a way to multiply a particular variable by specifying the variable name? Thanks.
Replies (2)
RE: modifying only one variable - Added by Uwe Schulzweida over 8 years ago
Try the expression operator aexpr, here an example to multiply the variable myvar with the constant 3.14.
cdo aexpr="myvar=myvar*3.14" ifile ofileThis features was implemented in CDO version 1.7.1.
Cheers,
Uwe
RE: modifying only one variable - Added by Athanasios Tsikerdekis about 6 years ago
Thank you both for the answer/reply.
A small update. It worked with "," for me and not with "=". For example:
cdo aexpr,"myvar=myvar*3.14" ifile ofile
Cheers,
Thanos