2

I have a list of netcdf files that I am trying to concatenate along the time dimension.

I am attempting to use the steps outlined here, which seem simple enough. However, I am running into some errors (likely some small/stupid oversight on my part...)

When I try to first make time a record dimension, I am using the following command:

ncks -O --mk_rec_dmn time TiMREX_20080526_000001.nc test_out.nc

This, however, give me the following error:

ncks: invalid option -- '-'

It seems like this is just some simple syntax/typo error on my part, but try as I might I can' find anything wrong.

Just to be sure, when I run a ncdump -h on the file, it confirms that there is indeed a time dimension

ncdump -h TiMREX_20080526_000001.nc
netcdf TiMREX_20080526_000001 {
dimensions:
    time = 1 ;
    bounds = 2 ;
    x0 = 300 ;
    y0 = 300 ;
    z0 = 40 ;

Additionally, if I try to skip this step and just go right to the ncrcat part...

ncrcat -O TiMREX_20080526_000001.nc TiMREX_20080526_000733.nc test_out.nc

I get the following error:

ncopen: filename "TiMREX_20080526_000001.nc": Not a netCDF file

Which is especially odd...I'm pretty confident it is indeed at netCDF file (I just ran ncdump on it after all, and have no problem viewing it with ncview...)

Any thoughts? What simple step am I embarrassingly missing?

4

1 回答 1

3

这是一个奇怪的错误,因为您的命令在语法上看起来是正确的。可以肯定的是,我将它复制到我的机器上,它按预期运行,没有“无效选项”错误。因此我无法重现该问题。根据您报告的错误消息,您似乎可能(以某种方式)使用了系统无法理解为破折号的字符。换句话说,如果 ncks 收到一个看起来像破折号但实际上不是破折号的时髦字符,您报告的错误就是我所期望的。也许当您将其复制到 stackoverflow 时,它会转换为破折号,因此它对我有用(尝试将上面的自己的命令复制回控制台)。确保您键入的破折号与普通键盘上的减号相同,以及其他内容。一些键盘/字符集使字符看起来类似于破折号,但不是 ASCII 破折号。祝你好运。

于 2016-07-25T17:01:51.557 回答