Project

General

Profile

Documentation on sub groups should be improved

Added by Guido Cioni over 1 year ago

I cannot find much about sub groups on the cdo documentation, but with 2.2.0 I'm now getting this error for commands that were working before

cdo -f nc4 setgridtype,curvilinear -mergetime -select,name=2t 'moloch_*.grib2' moloch_2D.nc

Could you please clarify what was changed that caused this syntax to now be invalid?
Also from the error message

Using two operators with variable input without using sub groups [] is not allowed

It is not clear how the syntax should be revised.
This entry https://code.mpimet.mpg.de/boards/53/topics/6702 didn't help


Replies (1)

RE: Documentation on sub groups should be improved - Added by Uwe Schulzweida over 1 year ago

Yes, the documentation is a bit behind. CDO 2.2.1 will output the following:

cdo --argument_groups 
========================================================================================================================
        This feature allow to use multiple operators with variable number of inputs
        Notes:
            When a bracket is closed it is no longer possible to add aditional inputs.
            When a bracket is closed another variable input operator can be used without brackets

        Where it is normally not possible to chain multiple operators of that kind, with subgroups a arbitrary number can be chained
            -merge -merge file1 operator file1 > error:
                it cannot be decided which inputs belong to which operator
            -merge [ -merge file1 operator ] file1 > success:

        With the brackets it is possible to have multiple variable inputs as inputs for another variable input
            -merge [ -merge [ *.grb ] -merge [ *.nc ] ] out
        In combination with the apply (see --apply) feature this allows rather complex calls
            -merge [ [ -addc,1 : *1991.grb ] -merge [ -mulc,23 : *1990.grb ] -add file3 file4 ] outfile 
========================================================================================================================
cdo --apply
========================================================================================================================
        This feature allows to prepend simple cdo chains to other chains
        Apply syntax:
            (1) [ chain : file1 file2 file ]             (Recommended Syntax)
            (2) -apply,<chain> [ file1 file2 file_n ]    (Old Syntax) 

        For example the call:
            -merge [ -select,name=topo : *.grb ]
        would merge all grib files in the folder after selecting the variable topo from them

        The example:
            "-merge [ -addc,1 -mulc,2 : -add file1 file2 -subc,1 file3 file4 ] out"        would result in:
            -merge -addc,1 -mulc,2 -add file1 file2 -addc,1 -mulc,2 -subc,3 file3 -addc,2 -mulc,23 file4 out

        In combination with the subgroup (see --argument_groups) feature this allows rather complex calls
            -merge [ [ -addc,1 : *1991.grb ] -merge [ -mulc,23 : *1990.grb ] -add file3 file4 ] outfile 
========================================================================================================================

Does this help?

    (1-1/1)