The -not_if option returns true or false. If true, then
the next "output" option is executed otherwise it isn't. In order to write
headers into the output file, "inv_output" options are conditionally executed
depending on the flag.
Note, the effects of nesting of -not_if is not defined
and the flag is reset after processing the record.
The -not_if option was written so that you can process
the file once and create several output files. For example,
old: wgrib2 -match_inv gribfile >inv
grep -v " mb:" inv | wgrib2 -i gribfile -grib flx.grb
grep " mb:" inv | wgrib2 -i gribfile -grib prs.grb
In the above example, the "mb" fields are written to prs.grb
and the rest are written to flx.grb.
wgrib2 gribfile -not_if " mb:" -grib flx.grb -if " mb:" -grib prs.grb
Note that you can use any number of
-if and -not_if
options and they can use the same output file.
wgrib2 gribfile -not_if ":surface:" -grib save.grb
X is a regular expression, returns not X.
The format of the "match inventory" has evolved and will continue to evolve.
The rule for future changes is that new items in the "match inventory" will be added
as the second last item. Consequently the last item in the inventory will always
be ":vt=YYYYMMDDHH:". In order to future proof your
-match, and -not selections, you
must not include any item before the ":vt=YYYYMMDD:" field.
-match ":vt=2011111500:" good
-not ":vt=2011111500:$" good (dollar sign matches the end of the line)
-not ":n=10:vt=2011111500:" bad (item before :vt=)
-match ":RH:975 mb:anl::vt=2010050806:" bad (item before :vt=)
Some recent changes (as of Nov 2011) to the match inventory include:
- adding the "extended name of the variable", ex. TMP.prob_<273
- adding the inventory number, ex. n=10
- adding ensemble/chemical/probability information (-misc)
See also: -not,