Project

General

Profile

modifying only one variable

Added by Sagar Parajuli over 7 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 7 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  ofile
This features was implemented in CDO version 1.7.1.

Cheers,
Uwe

RE: modifying only one variable - Added by Athanasios Tsikerdekis about 5 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

    (1-2/2)