Merge 1.6 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@BeginModule
@NewPage
@Name      = Merge
@Title     = Merge datasets
@Section   = File operations
@Class     = File operation
@Arguments = ifiles ofile
@Operators = merge mergetime

@BeginDescription
This module reads datasets from several input files,
merges them and writes the resulting dataset to @file{ofile}.
@EndDescription
@EndModule


@BeginOperator_merge
@Title     = Merge datasets with different fields

@BeginDescription
Merges time series of different fields from several input datasets.
The number of fields per time step written to @file{ofile}
is the sum of the field numbers per time step in all input datasets.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
24
25
The time series on all input datasets are required to have different
fields and the same number of time steps.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
26
27
28
29
30
31
32
33
34
@EndDescription
@EndOperator


@BeginOperator_mergetime
@Title     = Merge datasets sorted by date and time

@BeginDescription
Merges all time steps of all input files sorted by date and time.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
35
36
All input files need to have the same structure with the same variables 
on different time steps.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
37
After this operation every input time step is in @file{ofile} and
Uwe Schulzweida's avatar
Uwe Schulzweida committed
38
all time steps are sorted by date and time.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
39
40
41
42
43
@EndDescription
@EndOperator


@BeginExample
Uwe Schulzweida's avatar
Uwe Schulzweida committed
44
Assume three datasets with the same number of time steps
Uwe Schulzweida's avatar
Uwe Schulzweida committed
45
and different variables in each dataset.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
46
47
48
49
To merge these datasets to a new dataset use:
@BeginVerbatim
   cdo merge ifile1 ifile2 ifile3 ofile
@EndVerbatim
Uwe Schulzweida's avatar
Uwe Schulzweida committed
50
51
Assume you split a 6 hourly dataset with @oper{splithour}.
This produces four datasets, one for each hour.
Uwe Schulzweida's avatar
Uwe Schulzweida committed
52
53
54
55
56
The following command merges them together:
@BeginVerbatim
   cdo mergetime ifile1 ifile2 ifile3 ifile4 ofile
@EndVerbatim
@EndExample