Project

General

Profile

Timmean over all nc files in a directory

Added by Frosi Ma over 6 years ago

Hello there,
I've got 36 nc files from 1979 to 2015 and they all contain the same variable (in this case the anomaly of bandpassfiltered Geopotential Height).
I want to run a cdo -timmean over all these files to get the mean from this 36 years.
The files do all have the same name except the 4 last characters which refer to the year, f.e. 1988.

Is there a cdo command to run -timmean over all files in my directory?
According to the refcard I can just pass one infile and not a full directory .

What I would like to do is : cdo -timmean *.nc mean.nc

Thank you very much
Kind regards


Replies (1)

RE: Timmean over all nc files in a directory - Added by Uwe Schulzweida over 6 years ago

You can combine the CDO operator cat with timmean:

cdo  timmean  -cat '*.nc'  mean.nc
The single quotes are required for this kind of combination.

    (1-1/1)