NCL Home > Documentation > Tools

ncl_filedump

ncl_filedump generates an ASCII representation of a specified file on the standard output.

Synopsis

   ncl_filedump [-c] [-v var1[,...]] [-itime] [-ftime] [-h] input-file

Description

ncl_filedump generates an ASCII representation of a specified file on the standard output. The input file may be any file type supported by NCL via the addfile() function. The default output is to the standard output but it may be redirected to a file. The form of the output is similar to that produced by ncdump -h.

Support was added for GRIB2 files in version 4.3.0.

Support for "-itime" and "-ftime" will be added in version 4.3.1.

Options

ncl_filedump accepts the following options:

-c
Output coordinate variable (variables that are also dimensions) as well as the declarations of all dimensions, variables, and attribute values. Data values of non-coordinate variables are not output.

-v var1[,...]
Output data values for the specified variable(s), in addition to the declarations of all dimensions, variables, and attributes. One or more variables must be specified by name, in a comma-delimited list (without blanks or other whitespace characters). Named variables must be valid within the input file.

-itime
Set time record dimension to initial_time. This allows a variable with only a single initial time to be treated as a single element dimension.

-ftime
Set time record dimension to initial_time. This allows a variable with only a single forecast time to be treated as a single element dimension.

-h
Display a short message explaining the command usage, and exit.

Examples

Example 1

The following prints the coordinate variable information, as well as declarations of all dimensions, variables and attributes, of the input data file:

          % ncl_filedump ced1.lf00.t00z.ega.grb
          [...]
          filename:       ced1.lf00.t00z.eta
          path:   ced1.lf00.t00z.eta.grb
             file global attributes:
             dimensions:
                gridx_6 = 45
                gridy_6 = 53
                gridx_101 = 91
                gridy_101 = 113
                [...]
             variables:
                float PRES_6_SFC ( gridx_6, gridy_6 )
                [...]
Example 2

The following prints coordinate variable information, as well as declarations of all dimensions, variables and attributes, and the data values for the specified variable. It also creates the variable "forecast_time0" as a single element dimension variable.

          % ncl_filedump -v PRES_6_SFC -ftime ced1.lf00.t00z.ega.grb
          [...]
          filename:       ced1.lf00.t00z.eta
          path:   ced1.lf00.t00z.eta.grb
             file global attributes:
             dimensions:
                forecast_time0 = 1
                gridx_6 = 45
                gridy_6 = 53
                gridx_101 = 91
                gridy_101 = 113
                [...]
             variables:
                float PRES_6_SFC ( forecast_time0, gridx_6, gridy_6 )

                integer forecast_time0 ( forecast_time0 )
                   long_name :    Forecast offset from initial time
                   units :        hours

                [...]

          Variables:
 
               PRES_6_SFC:
  
           0.1009E+06  0.1009E+06  0.1009E+06  0.1009E+06  0.1009E+06  0.1008E+06
           0.1008E+06  0.1008E+06  0.1009E+06  0.1010E+06  0.1010E+06  0.1010E+06
           [...]
Example 3

The following prints the usage message:

           % ncl_filedump -h
           ncl_filedump [-c] [-v var1[,...]] [-h] file
           [-c]                coordinate variable and header information
           [-v var1[,...]]     data for variable(s) ,...
           [-itime]            set single element time record dimension to initial time
           [-ftime]            set single element time record dimension to forecast time
           [-h]                this usage message

See also

ncl_convert2nc (version 4.2.0.a034 or later)

Caveats

Input files that do not end with an extension recognized as a supported file format are ignored. If the input file is of a supported type, but is not tagged with a recognized extension, simply adding the recognized extention on the command line will result in the file being recognized as valid input.