NCL Home > Documentation > Functions > File IO

fbinseqSwap1

Byte swaps Fortran sequential files.

Prototype

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

	procedure fbinseqSwap1 (
		in_file  [1] : string,   
		out_file [1] : string,   
		type     [1] : string,   
		dims     [*] : integer   
	)

	return_val  :  file

Arguments

in_file

Name of input file.

out_file

Name of output file.

type

The type of the data on in_file (e.g. "float")

dims

A one-dimensional array or equal to the dimensionality of the input data.

Description

Byte swaps Fortran sequential files. It requires that all records in the file be the same type and dimension. The user must provide the dimensionality of each record, but not necessarily the number of records. If the wrong dimensions are input, the data will be distorted.

See Also

fbinseqSwap2, fbindirSwap

Examples

Example 1

In the following, N is record length [eg N=1000 , (/nlat,mlon/) ]

   load $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl

   fbinseqSwap1("foo.input", "foo.output", "float",  N)