我正在使用带有 netcdf 格式输出的大气模型进行理想化实验。但是netcdf文件头并没有清楚地描述变量和维度。例如 :
netcdf qc3d {
dimensions:
Time = UNLIMITED ; // (1453 currently)
bottom_top = 45 ;
south_north = 32 ;
west_east = 12288 ;
variables:
float Time(Time) ;
Time:axis = "Time" ;
Time:long_name = "Time" ;
Time:standard_name = "Time" ;
Time:units = "minutes since 1900-01-01 " ;
double zc(bottom_top) ;
zc:axis = "Z" ;
zc:long_name = "vertical height of model layers, MSL" ;
zc:standard_name = "altitude" ;
zc:units = "m" ;
zc:positive = "up" ;
double yc(south_north) ;
yc:axis = "Y" ;
yc:long_name = "y-coordinate of grid cell centers in Cartesian system" ;
yc:units = "m" ;
double xc(west_east) ;
xc:axis = "X" ;
xc:long_name = "x-coordinate of grid cell centers in Cartesian system" ;
xc:units = "m" ;
float qc(Time, bottom_top, south_north, west_east) ;
qc:long_name = "cloud water mixing ratio" ;
qc:standard_name = "cloud_water_mixing" ;
qc:units = "kg kg-1" ;
qc:_FillValue = 9.96921e+36f ;
qc:missing_value = 9.96921e+36f ;
// global attributes:
:model_tag = "CSU VVM" ;
:references = "http://kiwi.atmos.colostate.edu/pubs/joon-hee-tech_report.pdf" ;
:contact = "jung@atmos.colostate.edu" ;
:institution = "Colorado State University" ;
:VVM_casename = "GATE_PHASE_III " ;
}
有4个维度,Time(Time)、zc(bottom_top)、yc(south_north)、xc(west_east)和5个变量,其中前4个变量应该是第五个变量的维度,即qc。但似乎不是。维度只是从 1 到 45、32 的序列号索引……其他什么。
我想计算一些变量,它是压力的函数。在 CDO 中的脚本是这样的
cdo expr,"pottemp=temp*((100000/clev(temp))^0.287);" ifile pottemp.nc
(此代码来自此处)
但是当我使用这个函数 clev(qv) 时,我只是获得了一系列指数,比如 1 ,2 ,3 ...不是真正的压力水平。那么如何将变量维度(如 qc from
qc(Time, bottom_top, south_north, west_east) ;
to
)重写为qc(Time, zc, yc, xc) ;
我认为我可以在 matlab 中完成此操作,但我只是不想打开这个数据集,因为它的大小太大......所以我试图找到一些工具,如 ncks 或 cdo,但仍然无法做到这一点。
多谢。