Project

General

Profile

How to calculate trend from multiple nc files?

Added by Wilma Wang 29 days ago

Hi, I have 100-year monthly SST data, which are stored in 100 nc files for each year, how to calculate trend from these nc files using nco or cdo?
It seems like I should merge these 100 files into one, but each file are at least 1~2 GB, which is too large to be merged.
Does anybody know this? Plese help me, thanks.


Replies (4)

RE: How to calculate trend from multiple nc files? - Added by Uwe Schulzweida 27 days ago

Combine the trend with the mergetime operator:

cdo trend -merge infiles outfile1 outfile2

RE: How to calculate trend from multiple nc files? - Added by Wilma Wang 21 days ago

thank you so much for the prompt reply (and solution)!

When I do:

cdo trend -merge *.nc outfile1.nc outfile2.nc

I got:
cdo trend (Abort): Too many streams! Operator needs 1 input and 2 output streams.

And the cdo version is 1.8.2
How can I fix it? Plese help me, thanks.

RE: How to calculate trend from multiple nc files? - Added by Uwe Schulzweida 20 days ago

In CDO version 1.8.2 single quotation marks are required for the filenames and the correct function is mergetime:

cdo trend -mergetime '*.nc' outfile1.nc outfile2.nc

RE: How to calculate trend from multiple nc files? - Added by Wilma Wang 20 days ago

It works perfectly. I really appreciate your solution.

    (1-4/4)