Commit 076a9ef5 authored by Uwe Schulzweida's avatar Uwe Schulzweida

Docu update

parent d388fa53
......@@ -13,7 +13,7 @@
2013-02-22 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* New operator: yearmonmean - yearly mean from monthly data (status: experimental)
* New operator: yearmonmean - yearly mean from monthly data
2013-02-21 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
......
CDO NEWS
--------
Version 1.6.0 (?? March 2013):
Version 1.6.0 (14 March 2013):
Changed operators:
* setcalendar: changed CDO calendar names to CF calendar names (Feature #3123)
(standard, proleptic_gregorian, 360_day, 365_day, 366_day)
* masklonlatbox: added support for curvilinear grids
New operators:
* select: Select fields from an unlimited number of input files
* mergegrid: Merge horizontal grids
* yearmonmean: yearly mean from monthly data
* duplicate: Duplicates a dataset
* adisit: Potential temperature to in-situ temperature
* rhopot: Calculates potential density
Changed operators:
* setcalendar: changed CDO calendar names to CF calendar names (Feature #3123)
(standard, proleptic_gregorian, 360_day, 365_day, 366_day)
* masklonlatbox: added support for curvilinear grids
* diff: print only records that differ
Fixed bugs:
* sellonlatbox: wrong result with overlapped lonlatbox on curvilinear grids
......
......@@ -327,6 +327,7 @@ Operator catalog:
Monstat monvar Monthly variance
Monstat monvar1 Monthly variance
Monpctl monpctl Monthly percentiles
Yearmonstat yearmonmean Yearly mean from monthly data
Yearstat yearmin Yearly minimum
Yearstat yearmax Yearly maximum
Yearstat yearsum Yearly sum
......
No preview for this file type
......@@ -64,6 +64,7 @@ Daystat Statistical values
Daypctl Statistical values
Monstat Statistical values
Monpctl Statistical values
Yearmonstat Statistical values
Yearstat Statistical values
Yearpctl Statistical values
Seasstat Statistical values
......
@BeginModule
@NewPage
@Name = Arithdays
@Title = Arithmetic with days
@Section = Arithmetic
......@@ -59,16 +58,16 @@ o(t,x) = i(t,x) / days\_per\_year
@EndOperator
@BeginExample
Assume an input dataset is a monthly mean time series.
To compute the yearly mean from the correct weighted monthly mean use:
@BeginVerbatim
cdo muldpm ifile tmpfile1
cdo yearsum tmpfile1 tmpfile2
cdo divdpy tmpfile2 ofile
@EndVerbatim
Or all in one command line:
@BeginVerbatim
cdo divdpy -yearsum -muldpm ifile ofile
@EndVerbatim
@EndExample
@C @BeginExample
@C Assume an input dataset is a monthly mean time series.
@C To compute the yearly mean from the correct weighted monthly mean use:
@C @BeginVerbatim
@C cdo muldpm ifile tmpfile1
@C cdo yearsum tmpfile1 tmpfile2
@C cdo divdpy tmpfile2 ofile
@C @EndVerbatim
@C Or all in one command line:
@C @BeginVerbatim
@C cdo divdpy -yearsum -muldpm ifile ofile
@C @EndVerbatim
@C @EndExample
......@@ -184,9 +184,8 @@ INTEGER Number of timesteps
@BeginEnvironment
@Item = RUNSTAT_DATE
Sets the date information in ofile to the "first", "last" or "middle" contributing
timestep in ifile.
@Item = TIMESTAT_DATE
Sets the date information in ofile to the "first", "last" or "middle" contributing timestep in ifile.
@EndEnvironment
......
......@@ -200,6 +200,6 @@ To compute the yearly mean of a time series use:
@EndVerbatim
To compute the yearly mean from the correct weighted monthly mean use:
@BeginVerbatim
cdo divdpy -yearsum -muldpm ifile ofile
cdo yearmonmean ifile ofile
@EndVerbatim
@EndExample
......@@ -36,8 +36,6 @@ void *Yearmonstat(void *argument)
int gridsize;
int vdate = 0, vtime = 0;
int vdate0 = 0, vtime0 = 0;
int vdate_lb = 0, vdate_ub = 0, date_lb = 0, date_ub = 0;
int vtime_lb = 0, vtime_ub = 0, time_lb = 0, time_ub = 0;
int nrecs, nrecords;
int varID, levelID, recID;
int tsID;
......@@ -54,13 +52,16 @@ void *Yearmonstat(void *argument)
int nmiss;
int nvars, nlevel;
int *recVarID, *recLevelID;
int taxis_has_bounds = FALSE;
char vdatestr[32], vtimestr[32];
field_t **vars1 = NULL, **samp1 = NULL;
field_t field;
int timestat_date = DATE_MIDDLE;
dtinfo_t dtinfo[13];
cdoInitialize(argument);
get_timestat_date(&timestat_date);
cdoOperatorAdd("yearmonmean", func_mean, 0, NULL);
cdoOperatorAdd("yearmonavg", func_avg, 0, NULL);
......@@ -73,7 +74,6 @@ void *Yearmonstat(void *argument)
vlistID2 = vlistDuplicate(vlistID1);
taxisID1 = vlistInqTaxis(vlistID1);
taxis_has_bounds = taxisHasBounds(taxisID1);
taxisID2 = taxisDuplicate(taxisID1);
vlistDefTaxis(vlistID2, taxisID2);
......@@ -104,8 +104,9 @@ void *Yearmonstat(void *argument)
dsets = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
{
vdate = taxisInqVdate(taxisID1);
vtime = taxisInqVtime(taxisID1);
taxisInqDTinfo(taxisID1, &dtinfo[nsets]);
vdate = dtinfo[nsets].v.date;
vtime = dtinfo[nsets].v.time;
cdiDecodeDate(vdate, &year, &month, &day);
if ( nsets == 0 ) year0 = year;
......@@ -125,20 +126,6 @@ void *Yearmonstat(void *argument)
dpm = days_per_month(calendar, year, month);
if ( taxis_has_bounds )
{
taxisInqVdateBounds(taxisID1, &date_lb, &date_ub);
taxisInqVtimeBounds(taxisID1, &time_lb, &time_ub);
if ( nsets == 0 )
{
vdate_lb = date_lb;
vtime_lb = time_lb;
}
vdate_ub = date_ub;
vtime_ub = time_ub;
}
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
......@@ -226,13 +213,17 @@ void *Yearmonstat(void *argument)
cdoPrint("%s %s nsets = %d", vdatestr, vtimestr, nsets);
}
taxisDefVdate(taxisID2, vdate0);
taxisDefVtime(taxisID2, vtime0);
if ( taxis_has_bounds )
if ( timestat_date == DATE_MIDDLE ) datetime_avg_dtinfo(calendar, nsets, dtinfo);
else if ( timestat_date == DATE_FIRST ) dtinfo[nsets].v = dtinfo[0].v;
else if ( timestat_date == DATE_LAST ) dtinfo[nsets].v = dtinfo[nsets-1].v;
if ( taxisHasBounds(taxisID2) )
{
taxisDefVdateBounds(taxisID2, vdate_lb, vdate_ub);
taxisDefVtimeBounds(taxisID2, vtime_lb, vtime_ub);
dtinfo[nsets].b[0] = dtinfo[0].b[0];
dtinfo[nsets].b[1] = dtinfo[nsets-1].b[1];
}
taxisDefDTinfo(taxisID2, dtinfo[nsets]);
streamDefTimestep(streamID2, otsID);
for ( recID = 0; recID < nrecords; recID++ )
......
......@@ -716,7 +716,7 @@ static modules_t Modules[] =
{ Writegrid, NULL, WritegridOperators, CDI_REAL, 1, 1 }, /* no cdi output */
{ Writerandom, NULL, WriterandomOperators, CDI_REAL, 1, 1 },
{ YAR, NULL, YAROperators, CDI_REAL, 1, 1 },
{ Yearmonstat, NULL, YearmonstatOperators, CDI_REAL, 1, 1 },
{ Yearmonstat, YearmonmeanHelp, YearmonstatOperators, CDI_REAL, 1, 1 },
{ Ydayarith, YdayarithHelp, YdayarithOperators, CDI_REAL, 2, 1 },
{ Ydaypctl, YdaypctlHelp, YdaypctlOperators, CDI_REAL, 3, 1 },
{ Ydaystat, YdaystatHelp, YdaystatOperators, CDI_REAL, 1, 1 },
......
......@@ -1966,9 +1966,8 @@ static char *RunstatHelp[] = {
" nts INTEGER Number of timesteps",
"",
"ENVIRONMENT",
" RUNSTAT_DATE",
" Sets the date information in ofile to the \"first\", \"last\" or \"middle\" contributing",
" timestep in ifile.",
" TIMESTAT_DATE",
" Sets the date information in ofile to the \"first\", \"last\" or \"middle\" contributing timestep in ifile.",
NULL
};
......@@ -2319,6 +2318,28 @@ static char *MonpctlHelp[] = {
NULL
};
static char *YearmonmeanHelp[] = {
"NAME",
" yearmonmean - Yearly mean from monthly data",
"",
"SYNOPSIS",
" yearmonmean ifile ofile",
"",
"DESCRIPTION",
" This operator computes the yearly mean of a monthly time series.",
" Each month is weighted with the number of days per month. ",
" The date information in ofile is the date of the middle contributing timestep in ifile.",
" ",
" For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
" ",
" o(t,x) = mean{i(t',x), t_1<t'<=t_n}",
"",
"ENVIRONMENT",
" TIMESTAT_DATE",
" Sets the date information in ofile to the \"first\", \"last\" or \"middle\" contributing timestep in ifile.",
NULL
};
static char *YearstatHelp[] = {
"NAME",
" yearmin, yearmax, yearsum, yearmean, yearavg, yearstd, yearstd1, yearvar, ",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment