Concatenate netcdf files with different variables - using nco

吃可爱长大的小学妹 提交于 2021-02-10 11:48:41

问题


I want to concatenate two sets of netcdf files using nco, where each set has about 30 files.

Set 1 contains: longitude, latitude, time and v.

Set 2 contains: longitude, latitude, time and u.

I have tried:

ncks *.nc out.nc    

but I get:

Error received 97 filenames; need no more than two

then I tried:

ncks -A *.nc out.nc

but the error persists:

Error received 97 filenames; need no more than two

Please can you point me in the right direction, I am quite new to this.

Thanks in advance.


回答1:


Your first try should work if you use ncrcat instead of ncks:

ncrcat *.nc out.nc

And be careful that your wildcard expression evaluates to the files you intend, i.e., that ls *.nc results in all input files and nothing else.




回答2:


As an alternative you can also use CDO:

cdo cat *.nc out.nc

assuming all files are on the same grid and times.



来源:https://stackoverflow.com/questions/58167605/concatenate-netcdf-files-with-different-variables-using-nco

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!