gocat −− flatten multi-dimensional fields
goflat |
flat_dim_name dim1 dim2 [dim3 [dim4]] |
Variable fields with the specified dimensions (in the same order as in the input file and at the end of the dimension list) are extracted and flattened, i.e., the specified dimensions are replaced by a single dimension with name "flat_dim_name". The ordering of elements in the flattened field is "last dimension iterated most rapidly". All variables without any of the listed dimensions are passed unchanged. All other variables are dropped. The values assigned to the flat dimension are "0", "1", "2", etc.
The input file is expected on the standard input and the output file appears on the standard output. Only the first variable slice is returned in the output file.
Note that variable fields with the specified dimensions out of the specified order are also dropped. If the dimensions to be flattened in the input file are not at the end of the dimension list or are not in the right order, "cdforder" can be used to fix this problem.
The ordering of elements within variable fields is not changed.
kestrel%goflat index x y z < infile > outfile
Variable fields with dimensions "x", "y", and "z" at the end of the dimension list are retained and the specified dimensions are replaced with a single dimension named "index". All variable fields with none of these dimensions are passed unchanged and all other fields are dropped.