Project

General

Profile

Use wildcards in CDO mergetime

Added by Akhilesh Kumar about 4 years ago

Hello all,

I have a list of CORDEX files (shown below). I want to use wildcards in mergetime so that all hurs-MIROC files are merged together, all hurs-MPI files are merged together, all pr-MIROC files are put together and so on. But I am not able to apply them here (maybe filenames are not suitable). I was wondering if there's a way to do this? (i.e. use wildcards to merge specific files together).

------- The files ----------

hurs_WAS-44_MIROC-MIROC5_rcp26_r1i1p1_SMHI-RCA4_v2_mon_201101-202012.nc
hurs_WAS-44_MIROC-MIROC5_rcp26_r1i1p1_SMHI-RCA4_v2_mon_202101-203012.nc
.... +6 files

hurs_WAS-44_MPI-M-MPI-ESM-LR_rcp26_r1i1p1_SMHI-RCA4_v2_mon_201101-202012.nc
hurs_WAS-44_MPI-M-MPI-ESM-LR_rcp26_r1i1p1_SMHI-RCA4_v2_mon_202101-203012.nc
.... +6 files

pr_WAS-44_MIROC-MIROC5_rcp26_r1i1p1_SMHI-RCA4_v2_mon_201101-202012.nc
pr_WAS-44_MIROC-MIROC5_rcp26_r1i1p1_SMHI-RCA4_v2_mon_202101-203012.nc
.... +6 files

pr_WAS-44_MPI-M-MPI-ESM-LR_rcp26_r1i1p1_SMHI-RCA4_v2_mon_201101-202012.nc
pr_WAS-44_MPI-M-MPI-ESM-LR_rcp26_r1i1p1_SMHI-RCA4_v2_mon_202101-203012.nc
.... +6 files

rsds_WAS-44_MIROC-MIROC5_rcp26_r1i1p1_SMHI-RCA4_v2_mon_201101-202012.nc
rsds_WAS-44_MIROC-MIROC5_rcp26_r1i1p1_SMHI-RCA4_v2_mon_202101-203012.nc
.... +6 files

rsds_WAS-44_MPI-M-MPI-ESM-LR_rcp26_r1i1p1_SMHI-RCA4_v2_mon_201101-202012.nc
rsds_WAS-44_MPI-M-MPI-ESM-LR_rcp26_r1i1p1_SMHI-RCA4_v2_mon_202101-203012.nc
.... +6 files

..and so on.

Thanks,
Akhi.


Replies (2)

RE: Use wildcards in CDO mergetime - Added by Karin Meier-Fleischer about 4 years ago

Hi Akhilesh,

cdo -O -mergetime hurs_WAS-44_MIROC-MIROC5_rcp26_*.nc hurs_WAS-44_MIROC-MIROC5_rcp26_r1i1p1_SMHI-RCA4_v2_mon_2011-2100.nc

cdo -O -mergetime hurs_WAS-44_MPI-M-MPI-ESM-LR_rcp26_*.nc hurs_WAS-44_MPI-M-MPI-ESM-LR_rcp26_r1i1p1_SMHI-RCA4_v2_mon_2011-2100.nc

...

-Karin

RE: Use wildcards in CDO mergetime - Added by Akhilesh Kumar about 4 years ago

Karin Meier-Fleischer wrote:

Hi Akhilesh,

[...]

-Karin

Now that you have answered, that makes sense (and seems so easy). Should have tried that. Thanks, Karin.

    (1-2/2)