Professional Documents
Culture Documents
de/boards/1/topics/4014
Forums » Support »
Hi
It would be nice if there were a maxc and minc operator to do it in one command
Adrian
Replies (6)
RE: capping field range - setting a maximum or minimum value - Added by Jaison-Thomas Ambadan over 4 years ago
Hi,
It would be nice if there were a maxc and minc operator to do it in one command
Cheers,
J
RE: capping field range - setting a maximum or minimum value - Added by Ralf Mueller over 4 years ago
you could also use the expr operator an the if-then-else shortcut:
1 of 4 1/26/21, 4:27 PM
capping field range - setting a maximum or minimum value - CDO - Project Ma... https://code.mpimet.mpg.de/boards/1/topics/4014
RE: capping field range - setting a maximum or minimum value - Added by Ralf Mueller over 4 years ago
NAME
expr, exprf, aexpr, aexprf - Evaluate expressions
SYNOPSIS
expr,instr ifile ofile
exprf,filename ifile ofile
aexpr,instr ifile ofile
aexprf,filename ifile ofile
DESCRIPTION
This module arithmetically processes every timestep of the input dataset.
Each individual assignment statement have to end with a semi-colon.
Unlike regular variables, temporary variables are never written to the output stream.
To define a temporary variable simply prefix the variable name with an underscore (e.g. _varname)
when the variable is declared.
Math intrinsics:
2 of 4 1/26/21, 4:27 PM
capping field range - setting a maximum or minimum value - CDO - Project Ma... https://code.mpimet.mpg.de/boards/1/topics/4014
Coordinates:
Constants:
Miscellaneous:
OPERATORS
expr Evaluate expressions
The processing instructions are read from the parameter.
exprf Evaluate expressions script
Contrary to expr the processing instructions are read from a file.
aexpr Evaluate expressions and append results
Same as expr, but keep input variables and append results
aexprf Evaluate expression script and append results
Same as exprf, but keep input variables and append results
PARAMETER
instr STRING Processing instructions (need to be 'quoted' in most cases)
filename STRING File with processing instructions
I showed some of them here but I missed the comparison stuff ;-(
3 of 4 1/26/21, 4:27 PM
capping field range - setting a maximum or minimum value - CDO - Project Ma... https://code.mpimet.mpg.de/boards/1/topics/4014
RE: capping field range - setting a maximum or minimum value - Added by Jaison-Thomas Ambadan over 4 years ago
RE: capping field range - setting a maximum or minimum value - Added by Andrea Gierisch almost 4 years ago
Hi,
I found your thread, thanks for the hints! However, I wanted to apply a similar limitation to all variables in my file. Thus, I finally used:
cdo setrtoc,rmin,rmax,c ifile ofile
with a very small number for rmin, and rmax=c.
This works as well.
Andrea
RE: capping field range - setting a maximum or minimum value - Added by Andrea Gierisch over 2 years ago
I recently learned that cdo also accepts "inf" and "-inf" as arguments for rmin and rmax. Hence, this is a better solution:
(1-6/6)
4 of 4 1/26/21, 4:27 PM