Previous: Automatic type conversion, Up: Type Conversion


3.26.2 Manual type conversion

ncap2 provides intrinsic functions for performing manual type conversions. This, for example, converts variable tpt to external type NC_SHORT (a C-type short), and variable prs to external type NC_DOUBLE (a C-type double).

     ncap2 -s 'tpt=short(tpt);prs=double(prs)' in.nc out.nc

See ncap2 netCDF Arithmetic Processor, for more details.