Index: Index
Previous: Transformation/Interpolation interface
Next: Appendix 2. Example Convsh scripts
Appendix 1. Convsh commands
Below is a list of convsh extensions to the tcl scripting language. Some
commands have the argument fieldlist, this is a list of numbers which
represents a subset of the fields which convsh has stored in memory. These
fields will be stored in the same order as they are in xconv,
therefore the easiest way to
work out the field numbers is to run xconv on one file, before applying a
convsh script to a large number of files. Remember field numbering starts at 0.
- clearall
- Clears away all internal information about previous input files. This
command must be used if a separate output file is needed for every
input file.
- copyfields fieldlist
- Make a copy of all the fields in fieldlist. Note the field numbers
will be changed by this command. For example if the original fields are
(a,b,c,d,e) mapped on to field numbers (0,1,2,3,4), after the command
copyfields "1 3", the new fields will be (a,b,b,c,d,d,e)
mapped on to field numbers (0,1,2,3,4,5,6).
- delfields fieldlist
- Delete all the fields in fieldlist. Note the field numbers
will be changed by this command. For example if the original fields are
(a,b,c,d,e) mapped on to field numbers (0,1,2,3,4), after the command
delfields "1 3", the new fields will be (a,c,e) mapped on
to field numbers (0,1,2).
- interp_grid fieldlist
- Interpolate data, for fields in fieldlist, from one grid to
another. The initial grid will either
be the grid the data was read in on, or the grid from a previous
interp_grid or spec_trans command. If a new grid is not
defined using setgrid or settrunc, the new grid will be the
same as the initial grid.
- list_fields [fieldtitle]
- List all of the fields currently active in convsh. The output format is
the same as in the main xconv window. The fieldtitle argument is
optional, it can have three values short, long and
both. short uses the
short form of the field title, long uses the long form and
both uses both.
If fieldtitle is not given the long form of the field title is
used.
- readfile filetype filename
- Read into convsh the file given by filename, the file type is
given by the filetype argument. If filetype has the value
0 convsh will try to automatically determine the file type, this
will usually work but if it fails the actual file type can be given.
The various values of filetype for different input file types
are given below:
0 : Automatic
1 : UM format (32 bit IEEE)
2 : PP format (32 bit IEEE)
3 : GRIB format (Unblocked)
4 : GRIB format (Cray blocked)
5 : Drs format
7 : Netcdf format
65 : UM format (64 bit IEEE)
66 : PP format (64 bit IEEE)
165 : UM format (64 bit Cray)
166 : PP format (Cray blocked 64 bit Cray)
167 : PP format (Cray blocked 64 bit IEEE)
201 : UM format (32 bit IEEE byte swapped)
265 : UM format (64 bit IEEE byte swapped)
- reset_trans
- Reset transformation/interpolation variables to their default values.
See the individual commands for the default values.
- setdim dim fieldlist dimlist
- Choose the values given by dimlist for the dimension given by
dim, for the fields in fieldlist. The value of dim
should be one of 1,2,3 or 4 corresponding to
the x,y,z and time dimensions.
Currently convsh only allows dimension sub-sampling for the z and time
dimensions, therefore dim should be either 3 or 4.
As an example
suppose field number 2 has the following levels (1000,900,800,500,200,100)
defined and only levels (1000,500,100) were needed, then the following
should be used: setdim 3 2 "0 3 5".
- setgrid dim n v0 dv
- Defines the new grid for the interp_grid or spec_trans
commands. The argument dim should have the value 1 if a
new x grid is being defined and the value 2 if a new y grid is
being defined. The
argument n gives the number of points on the new grid. The argument
v0 gives the first value of the new grid. The argument
dv gives the grid length of the new grid, dv should be
negative if the grid values are decreasing.
- setgridtype gridtype
- Sets the new grid type for the interp_grid or spec_trans
commands, gridtype has the value regular for
a regular grid and the value gaussian for a Gaussian grid. If
setgridtype is not used interp_grid will interpolate to a
regular grid and spec_trans will transform to a Gaussian grid.
- setinterp interp
- Defines the interpolation method for interp_grid, interp
is either bilinear for bilinear interpolation or
area_weighted for area weighted interpolation.
The default type of interpolation is bilinear.
- setlsm lsm
- Defines whether the input data to interp_grid is a land/sea mask,
lsm is true if the data is a land/sea mask,
false otherwise. The
default value of lsm is false.
- setmiss miss
- Defines whether the input data to interp_grid contains missing
data values, miss is true if the data contains missing
data values, false otherwise.
The default value of miss is false.
- setpole pole
- Defines whether interp_grid will average polar data values,
if pole is true then polar data will be averaged,
otherwise it will not.
The default value of pole is false.
- setprecip precip1 precip2
- Defines whether interp_grid will use a precipitation cutoff,
if precip1 is true then a precipitation cutoff value of
precip2 will be used, otherwise no precipitation cutoff is used.
The precipitation cutoff is implemented in two steps, firstly any output
field value less than precip2 will be set to zero. Secondly, for
each output gridpoint, the nearest input field gridpoint is determined,
if the value of precipitation at this latter point in the input data
field is less than precip2, then the precipitation at the output
gridpoint is set to zero.
The default value of precip1 is false.
- setrotpole xpole ypole
- If interp_grid is interpolating to a grid with a rotated pole,
setrotpole should be used to set the new north pole longitude to
xpole and the new north pole latitude to ypole. By default
xpole has the value 0.0 and ypole has the value
90.0 i.e. an unrotated grid.
- settrunc nspec
- Defines the output truncation for spec_trunc. The command will
also set up the equivalent Gaussian grid for Tnspec truncation,
which can be used by interp_grid and spec_trans.
- spec_trans fieldlist
- Transform spectral data onto a grid, for fields in fieldlist.
The initial spectral coefficients will either come from the input data
or from a previous spec_trunc command. If a grid is not
defined using setgrid or settrunc, then the
equivalent Gaussian grid for the input spectral truncation will
be used.
- spec_trunc fieldlist
- Truncate spectral data, for fields in fieldlist,
by chopping off the small wavelength coefficients.
The initial spectral coefficients will either come from the input data
or from a previous spec_trunc command. The output truncation is
defined using settrunc.
- writefile filetype filename fieldlist
- Write out the fields in fieldlist to file filename of type
filetype. The argument filetype can be one of
drs, netcdf or utf.
Index: Index
Previous: Transformation/Interpolation interface
Next: Appendix 2. Example Convsh scripts