Commit 1d8b846c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

diff: changed output of code number to parameter idenifier

parent 18d5e9fc
......@@ -5,8 +5,9 @@
2011-03-11 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* info: changed output of table and code number to parameter idenifier
* sinfo: changed output of table and code number to parameter idenifier
* info: changed output of code number to parameter idenifier
* diff: changed output of code number to parameter idenifier
2011-03-09 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
......
......@@ -8,9 +8,10 @@ Version 1.5.0 (?? March 2011):
* Added support for netCDF level bounds
* Added option -O to overwrite existing output file (only for ens<STAT>, merge, mergetime)
Changed operators:
* sinfov: renamed to sinfon
* sinfo: changed output of table and code number to parameter idenifier
* expr: added functions abs(), int(), nint(), sqr()
* sinfo: changed output of table and code number to parameter idenifier
* info: changed output of code number to parameter idenifier
* diff: changed output of code number to parameter idenifier
Fixed bugs:
* sellonlatbox: does not work as expected when selecting all longitutes
* sellonlatbox: initialization missing for unstructured grids
......
......@@ -12,8 +12,8 @@ Operator catalog:
Info map Dataset information and simple map
Sinfo sinfo Short information listed by parameter identifier
Sinfo sinfon Short information listed by parameter name
Diff diff Compare two datasets listed by code number
Diff diffv Compare two datasets listed by variable name
Diff diff Compare two datasets listed by parameter id
Diff diffn Compare two datasets listed by parameter name
Ninfo npar Number of parameters
Ninfo nlevel Number of levels
Ninfo nyear Number of years
......
......@@ -5,7 +5,7 @@
@Section = Information
@Class = Information
@Arguments = ifile1 ifile2
@Operators = diff diffv
@Operators = diff diffn
@BeginDescription
Compares the contents of two datasets field by field. The input
......@@ -16,14 +16,14 @@ the same header information and dimensions.
@BeginOperator_diff
@Title = Compare two datasets listed by code number
@Title = Compare two datasets listed by parameter id
@BeginDescription
Provides statistics on differences between two datasets.
For each pair of fields the operator prints one line with the following information:
@BeginItemize
@Item = Date and Time
@Item = Code number and Level
@Item = Parameter identifier and Level
@Item = Size of the grid and number of Missing values
@Item = Occurrence of coefficient pairs with different signs (S)
@Item = Occurrence of zero values (Z)
......@@ -42,12 +42,12 @@ For each pair of fields the operator prints one line with the following informat
@EndOperator
@BeginOperator_diffv
@Title = Compare two datasets listed by variable name
@BeginOperator_diffn
@Title = Compare two datasets listed by parameter name
@BeginDescription
The same as operator @oper{diff}. Using the name instead of the code number
to identify the variable.
The same as operator @oper{diff}. Using the name instead of the
identifier to label the parameter.
@EndDescription
@EndOperator
......@@ -55,11 +55,11 @@ to identify the variable.
@BeginExample
To print the difference for each field of two datasets use:
@BeginVerbatim
cdo diffv ifile1 ifile2
cdo diffn ifile1 ifile2
@EndVerbatim
This is an example result of two datasets with one 2D variable over 12 time steps:
This is an example result of two datasets with one 2D parameter over 12 time steps:
@BeginListing
Date Time Varname Level Size Miss : S Z Max_Absdiff Max_Reldiff
Date Time Name Level Size Miss : S Z Max_Absdiff Max_Reldiff
1 : 1987-01-31 12:00:00 SST 0 2048 1361 : F F 0.00010681 4.1660e-07
2 : 1987-02-28 12:00:00 SST 0 2048 1361 : F F 6.1035e-05 2.3742e-07
3 : 1987-03-31 12:00:00 SST 0 2048 1361 : F F 7.6294e-05 3.3784e-07
......
......@@ -21,7 +21,8 @@ The information displayed depends on the chosen operator.
@BeginDescription
Prints information and simple statistics for each field of all
input datasets. For each field the operator prints one line with the following elements:
input datasets. For each field the operator prints one line with
the following elements:
@BeginItemize
@Item = Date and Time
@Item = Parameter identifier and Level
......
......@@ -21,7 +21,8 @@ The information displayed depends on the chosen operator.
@BeginDescription
Prints short information of a dataset. The information is divided into
4 sections. Section 1 prints one line per parameter with the following information:
4 sections. Section 1 prints one line per parameter with the following
information:
@BeginItemize
@Item = institute and source
@Item = parameter identifier
......
......@@ -30,7 +30,7 @@
void *Diff(void *argument)
{
int DIFF, DIFFP, DIFFV, SDIFF;
int DIFF, DIFFP, DIFFN, DIFFC, SDIFF;
int operatorID;
int i;
int indg;
......@@ -59,7 +59,8 @@ void *Diff(void *argument)
DIFF = cdoOperatorAdd("diff", 0, 0, NULL);
DIFFP = cdoOperatorAdd("diffp", 0, 0, NULL);
DIFFV = cdoOperatorAdd("diffv", 0, 0, NULL);
DIFFN = cdoOperatorAdd("diffn", 0, 0, NULL);
DIFFC = cdoOperatorAdd("diffc", 0, 0, NULL);
SDIFF = cdoOperatorAdd("sdiff", 0, 0, NULL);
operatorID = cdoOperatorID();
......@@ -81,13 +82,13 @@ void *Diff(void *argument)
if ( ! cdoSilentMode )
{
if ( operatorID == DIFFV )
fprintf(stdout, " Date Time Varname Level Size Miss :"
if ( operatorID == DIFFN )
fprintf(stdout, " Date Time Name Level Size Miss :"
" S Z Max_Absdiff Max_Reldiff\n");
else if ( operatorID == DIFFP )
else if ( operatorID == DIFF || operatorID == DIFFP )
fprintf(stdout, " Date Time Param Level Size Miss :"
" S Z Max_Absdiff Max_Reldiff\n");
else if ( operatorID == DIFF )
else if ( operatorID == DIFFC )
fprintf(stdout, " Date Time Code Level Size Miss :"
" S Z Max_Absdiff Max_Reldiff\n");
}
......@@ -129,15 +130,15 @@ void *Diff(void *argument)
cdiParamToString(param, paramstr, sizeof(paramstr));
if ( ! cdoSilentMode )
if ( operatorID == DIFFP || operatorID == DIFFV || operatorID == DIFF )
if ( operatorID == DIFF || operatorID == DIFFP || operatorID == DIFFN || operatorID == DIFFC )
{
if ( operatorID == DIFFV ) vlistInqVarName(vlistID1, varID1, varname);
if ( operatorID == DIFFN ) vlistInqVarName(vlistID1, varID1, varname);
if ( operatorID == DIFFV )
if ( operatorID == DIFFN )
fprintf(stdout, "%6d :%s %s %-10s ", indg, vdatestr, vtimestr, varname);
else if ( operatorID == DIFFP )
else if ( operatorID == DIFF || operatorID == DIFFP )
fprintf(stdout, "%6d :%s %s %-10s ", indg, vdatestr, vtimestr, paramstr);
else if ( operatorID == DIFF )
else if ( operatorID == DIFFC )
fprintf(stdout, "%6d :%s %s %3d ", indg, vdatestr, vtimestr, code);
fprintf(stdout, "%7g ", zaxisInqLevel(zaxisID, levelID));
......@@ -172,7 +173,7 @@ void *Diff(void *argument)
}
if ( ! cdoSilentMode )
if ( operatorID == DIFFP || operatorID == DIFFV || operatorID == DIFF )
if ( operatorID == DIFF || operatorID == DIFFP || operatorID == DIFFN || operatorID == DIFFC )
{
fprintf(stdout, "%7d %7d :", gridsize, MAX(nmiss1, nmiss2));
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2010 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2011 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -266,7 +266,7 @@ void *Wct(void *argument);
#define CopyOperators {"copy", "selall"}
#define DeltimeOperators {"delday", "del29feb"}
#define DetrendOperators {"detrend"}
#define DiffOperators {"diff", "diffp", "diffv", "sdiff"}
#define DiffOperators {"diff", "diffp", "diffn", "diffc", "sdiff"}
#define DuplicateOperators {"duplicate"}
#define Echam5iniOperators {"import_e5ml", "import_e5res", \
"export_e5ml", "export_e5res"}
......@@ -718,6 +718,7 @@ static int NumModules = sizeof(Modules) / sizeof(Modules[0]);
static char *opalias[][2] =
{
{"anomaly", "ymonsub" },
{"diffv", "diffn" },
{"ggstat", "info" },
{"ggstats", "sinfo" },
{"globavg", "fldavg" },
......
......@@ -16,7 +16,8 @@ static char *InfoHelp[] = {
"OPERATORS",
" info Dataset information listed by parameter identifier",
" Prints information and simple statistics for each field of all",
" input datasets. For each field the operator prints one line with the following elements:",
" input datasets. For each field the operator prints one line with ",
" the following elements:",
" - Date and Time",
" - Parameter identifier and Level",
" - Size of the grid and number of Missing values",
......@@ -47,7 +48,8 @@ static char *SinfoHelp[] = {
"OPERATORS",
" sinfo Short information listed by parameter identifier",
" Prints short information of a dataset. The information is divided into",
" 4 sections. Section 1 prints one line per parameter with the following information:",
" 4 sections. Section 1 prints one line per parameter with the following ",
" information:",
" - institute and source",
" - parameter identifier",
" - horizontal grid size and number",
......@@ -62,7 +64,7 @@ static char *SinfoHelp[] = {
static char *DiffHelp[] = {
"NAME",
" diff, diffv - Compare two datasets field by field",
" diff, diffn - Compare two datasets field by field",
"",
"SYNOPSIS",
" <operator> ifile1 ifile2",
......@@ -73,19 +75,19 @@ static char *DiffHelp[] = {
" the same header information and dimensions.",
"",
"OPERATORS",
" diff Compare two datasets listed by code number",
" diff Compare two datasets listed by parameter id",
" Provides statistics on differences between two datasets.",
" For each pair of fields the operator prints one line with the following information:",
" - Date and Time",
" - Code number and Level",
" - Parameter identifier and Level",
" - Size of the grid and number of Missing values",
" - Occurrence of coefficient pairs with different signs (S)",
" - Occurrence of zero values (Z)",
" - Maxima of absolute difference of coefficient pairs",
" - Maxima of relative difference of non-zero coefficient pairs with equal signs",
" diffv Compare two datasets listed by variable name",
" The same as operator diff. Using the name instead of the code number",
" to identify the variable.",
" diffn Compare two datasets listed by parameter name",
" The same as operator diff. Using the name instead of the",
" identifier to label the parameter.",
NULL
};
......
Supports Markdown
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