Project

General

Profile

Extracting surface level data from multiple files

Added by Alex Archibald over 11 years ago

Hi!
I am quite new to cdo but I think it will ultimately solve all my problems!
The one that I am working on at the moment is how to quickly go through a series of files and extract just a single level of output.
I have tried the following but the results is that the output file contains one time record and many vertical levels:

cdo -merge -selcode,-1 -sellevel,19.9983 xgywsa.pm*.nc xgys_methane_surf.nc

(NB I got the info for the level and the code from doing a cdo info on one of the netCDF files.)

Is there something that I am doing which is wrong? I am using CDO version 1.4.7

Thanks!

Alex


Replies (3)

RE: Extracting surface level data from multiple files - Added by Jaison-Thomas Ambadan over 11 years ago

Hi,

I'm not sure if this works in one step. Try "mergetime" first and then select the required variable.

Cheers,
J

PS: cdo-1.4.7 is VERY ANCIENT!! I highly recommend using the latest version.

RE: Extracting surface level data from multiple files - Added by Uwe Schulzweida over 11 years ago

You have to do this task in 2 steps. First create one file with all timesteps and then you can select what you need:

cdo mergetime xgywsa.pm*.nc xgys_methane_surf.nc
cdo -selcode,-1 -sellevel,19.9983 xgys_methane_surf.nc result
mergetime can be replaced by merge if the name of the input files are sorted alphanumerically in time.
Alternative you can use the new undocumented operator select to do this task in one step:
cdo select,code=-1,level=19.9983 xgywsa.pm*.nc xgys_methane_surf.nc
In this case the name of the input files have to be sorted alphanumerically! And the latest CDO version is required.

RE: Extracting surface level data from multiple files - Added by Alex Archibald over 11 years ago

Thanks for the replies! I will see if we can get the latest version of CDO installed on our system as it sounds like there will be many benefits!
Thanks again,
Alex

    (1-3/3)