问题
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