我试图使用netcdf-c (4.8.1版)定义和编写一个具有两个无限维度的变量,如下所示。
...
...
...
if ((rval = nc_create(out_file_nm, NC_CLOBBER, &out_ncid))) err(rval);
//// create netcdf dimensions
if ((rval = nc_def_dim(out_ncid, t_nm, NC_UNLIMITED, &out_t_dimid))) err(rval);
if ((rval = nc_def_dim(out_ncid, y_nm, nres_y , &out_y_dimid))) err(rval);
if ((rval = nc_def_dim(out_ncid, x_nm, nres_x , &out_x_dimid))) err(rval);
if ((rval = nc_def_dim(out_ncid, b_nm, NC_UNLIMITED, &out_b_dimid))) err(rval);
...
...
...我得到了下面的错误信息。
Error: NetCDF: NC_UNLIMITED size already in use据我所知,从netcdf-4开始,我认为我们可以使用多个无限维(link:https://www.unidata.ucar.edu/software/netcdf/workshops/2010/netcdf4/UnlimDims.html)。
该怎么办呢。我试图写的值的大小是未定的,它随着时间维度的变化而变化。所以,我真的很想用两个无限维。
有没有人有使用多个无限维度的经验?
发布于 2021-12-31 19:43:39
我会尝试在您的nc_create调用中添加一个模式选项。NetCDF默认为一维无限维的经典数据模型。请参阅:https://www.unidata.ucar.edu/software/netcdf/docs/faq.html#formatsdatamodelssoftwarereleases
https://stackoverflow.com/questions/70526348
复制相似问题