# The NetCDF Classic Format Specification
> https://www.unidata.ucar.edu/software/netcdf/docs/file_format_specifications.html
To present the format more formally, we use a BNF grammar notation. In this notation:
+ Non-terminals (entities defined by grammar rules) are in lower case.
+ Terminals (atomic entities in terms of which the format specification is written) are in upper case, and are specified literally as US-ASCII characters within single-quote characters or are described with text between angle brackets (``<`` and ``>``).
+ Optional entities are enclosed between braces (``[`` and ``]``).
+ A sequence of zero or more occurrences of an entity is denoted by ``[entity ...]``.
+ A vertical line character (``|``) separates alternatives. Alternation has lower precedence than concatenation.
+ Comments follow ``//`` characters.
+ A single byte that is not a printable character is denoted using a hexadecimal number with the notation ``\xDD``, where each D is a hexadecimal digit.
+ A literal single-quote character is denoted by ``\'``, and a literal back-slash character is denoted by ``\``.
Following the grammar, a few additional notes are included to specify format characteristics that are impractical to capture in a BNF grammar, and to note some special cases for implementers. Comments in the grammar point to the notes and special cases, and help to clarify the intent of elements of the format.
## The Format in Detail
```
netcdf_file = header data
header = magic numrecs dim_list gatt_list var_list
magic = 'C' 'D' 'F' VERSION
VERSION = \x01 | // classic format
\x02 // 64-bit offset format
numrecs = NON_NEG | STREAMING // length of record dimension
dim_list = ABSENT | NC_DIMENSION nelems [dim ...]
gatt_list = att_list // global attributes
att_list = ABSENT | NC_ATTRIBUTE nelems [attr ...]
var_list = ABSENT | NC_VARIABLE nelems [var ...]
ABSENT = ZERO ZERO // Means list is not present
ZERO = \x00 \x00 \x00 \x00 // 32-bit zero
NC_DIMENSION = \x00 \x00 \x00 \x0A // tag for list of dimensions
NC_VARIABLE = \x00 \x00 \x00 \x0B // tag for list of variables
NC_ATTRIBUTE = \x00 \x00 \x00 \x0C // tag for list of attributes
nelems = NON_NEG // number of elements in following sequence
dim = name dim_length
name = nelems namestring
// Names a dimension, variable, or attribute.
// Names should match the regular expression
// ([a-zA-Z0-9_]|{MUTF8})([^\x00-\x1F/\x7F-\xFF]|{MUTF8})*
// For other constraints, see "Note on names", below.
namestring = ID1 [IDN ...] padding
ID1 = alphanumeric | '_'
IDN = alphanumeric | special1 | special2
alphanumeric = lowercase | uppercase | numeric | MUTF8
lowercase = 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|
'n'|'o'|'p'|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z'
uppercase = 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'I'|'J'|'K'|'L'|'M'|
'N'|'O'|'P'|'Q'|'R'|'S'|'T'|'U'|'V'|'W'|'X'|'Y'|'Z'
numeric = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
// special1 chars have traditionally been
// permitted in netCDF names.
special1 = '_'|'.'|'@'|'+'|'-'
// special2 chars are recently permitted in
// names (and require escaping in CDL).
// Note: '/' is not permitted.
special2 = ' ' | '!' | '"' | '#' | '$' | '' | '&' | '\'' |
'(' | ')' | '*' | ',' | ':' | ';' | '<' | '=' |
'>' | '?' | '[' | '\' | ']' | '^' | '‘’ | '{' |
'|' | '}' | '~'
MUTF8 = <multibyte UTF-8 encoded, NFC-normalized Unicode character>
dim_length = NON_NEG // If zero, this is the record dimension.
// There can be at most one record dimension.
attr = name nc_type nelems [values ...]
nc_type = NC_BYTE |
NC_CHAR |
NC_SHORT |
NC_INT |
NC_FLOAT |
NC_DOUBLE
var = name nelems [dimid ...] vatt_list nc_type vsize begin
// nelems is the dimensionality (rank) of the
// variable: 0 for scalar, 1 for vector, 2
// for matrix, ...
dimid = NON_NEG // Dimension ID (index into dim_list) for
// variable shape. We say this is a "record
// variable" if and only if the first
// dimension is the record dimension.
vatt_list = att_list // Variable-specific attributes
vsize = NON_NEG // Variable size. If not a record variable,
// the amount of space in bytes allocated to
// the variable's data. If a record variable,
// the amount of space per record. See "Note
// on vsize", below.
begin = OFFSET // Variable start location. The offset in
// bytes (seek index) in the file of the
// beginning of data for this variable.
data = non_recs recs
non_recs = [vardata ...] // The data for all non-record variables,
// stored contiguously for each variable, in
// the same order the variables occur in the
// header.
vardata = [values ...] // All data for a non-record variable, as a
// block of values of the same type as the
// variable, in row-major order (last
// dimension varying fastest).
recs = [record ...] // The data for all record variables are
// stored interleaved at the end of the
// file.
record = [varslab ...] // Each record consists of the n-th slab
// from each record variable, for example
// x[n,...], y[n,...], z[n,...] where the
// first index is the record number, which
// is the unlimited dimension index.
varslab = [values ...] // One record of data for a variable, a
// block of values all of the same type as
// the variable in row-major order (last
// index varying fastest).
values = bytes | chars | shorts | ints | floats | doubles
string = nelems [chars]
bytes = [BYTE ...] padding
chars = [CHAR ...] padding
shorts = [SHORT ...] padding
ints = [INT ...]
floats = [FLOAT ...]
doubles = [DOUBLE ...]
padding = <0, 1, 2, or 3 bytes to next 4-byte boundary>
// Header padding uses null (\x00) bytes. In
// data, padding uses variable's fill value.
// See "Note on padding", below, for a special
// case.
NON_NEG = <non-negative INT>
STREA

Matlab仿真实验室
- 粉丝: 4w+
- 资源: 2478
最新资源
- 毕业设计-Apache+PHP+Mysql(源码+文档指引)
- 基于Maxwell的16极18槽轴向磁通永磁电机模型参数详解:1500W功率,190mm外径,3.7Nm输出转矩及波形图解析,基于Maxwell的16极18槽轴向磁通永磁电机模型参数详解:1500W功
- 基于Matlab的农作物叶子病虫害智能识别与分类系统:计算机视觉下的HSV颜色模型量化与特征匹配技术研究,基于Matlab的农作物叶子病虫害智能识别与分类系统:深度计算机视觉技术在农作物的病虫害快速检
- COMSOL技术:利用汉宁窗正弦激励与黏弹性材料模型计算波速的探究,基于COMSOL的黏弹性材料波速计算模型:汉宁窗调制正弦函数激励下的固体力学位移替代超声激励法,COMSOL-基于黏弹性材料计算波速
- 单级式三相光伏并网逆变器:高效、稳定、清洁能源转换核心装置,单级式三相光伏并网逆变器技术特性与性能优化研究,单级式三相光伏并网逆变器 ,单级式; 三相; 光伏; 并网逆变器,三相并网,单级光伏逆变器:
- 基于等声程与等深度聚焦的超声无损检测:相控阵算法的MATLAB代码实现与COMSOL模型参数化扫描,基于相控阵算法的超声无损检测技术研究:等声程与等深度聚焦方式的MATLAB代码实现与COMSOL模型
- 管家婆辉煌食品版TOP12.81.zip
- MATLAB中的压缩重构感知与L1范数稀疏优化综合方法探究与实践,基于MATLAB的压缩重构感知中稀疏优化问题的研究:L1范数最小化问题求解及多种稀疏重构方法的实现,基于matlab针对压缩重构感知中
- 管家婆辉煌食品版TOP12.91.zip
- 管家婆辉煌食品版TOP12.71.zip
- Python网络爬虫技术实现行业新闻实时监测案例
- STM32F103电机控制方案详解:电路图、霍尔传感器版与非霍尔传感器版最小系统板应用指南,STM32F103电机控制程序详解:电路图、霍尔传感器版与无霍尔传感器版最小系统板应用指南,stm32f10
- COMSOL技术结合红外与热风干燥法:高效加热与切片食品的耦合工艺,利用红外及热风技术高效干燥并保留食品营养:comsol切片与耦合热风干燥加热的探索与实践,comsol红外加热干燥食品,热风干燥加热
- 管家婆辉煌食品版TOP13.1.zip
- 管家婆辉煌食品版TOP13.02.zip
- 管家婆辉煌食品版TOP13.11.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


