Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
dd4ec788
Commit
dd4ec788
authored
Nov 11, 2014
by
Uwe Schulzweida
Browse files
histcount: doesn't recognize missing values (bug fix)
parent
6bc97dd1
Changes
6
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
dd4ec788
...
...
@@ -5,6 +5,7 @@
2014-11-11 Uwe Schulzweida
* histcount: doesn't recognize missing values (bug fix)
* filesdes: doesn't work for GRIB2 files [Bug #5307]
2014-10-31 Uwe Schulzweida
...
...
NEWS
View file @
dd4ec788
CDO NEWS
--------
Version 1.7.0 (19 February 2015):
Fixed bugs:
* histcount: doesn't recognize missing values
* filesdes: doesn't work for GRIB2 files [Bug #5307]
Version 1.6.5 (23 October 2014):
New operators:
...
...
cdo.spec
View file @
dd4ec788
...
...
@@ -4,7 +4,7 @@
Name: cdo
#BuildRequires:
Version: 1.
6.5
Version: 1.
7.0
Release: 1
Summary: Climate Data Operators
License: GNU GENERAL PUBLIC LICENSE Version 2, June 1991
...
...
doc/tex/mod/Setpartab
View file @
dd4ec788
...
...
@@ -15,7 +15,7 @@ start with "\¶meter" and to end with "/".
The following parameter table entries are supported:
@BeginTable
@bold{Entry} & @bold{Type} & @bold{Description}
@bold{Entry}
& @bold{Type}
& @bold{Description}
name & WORD & Name of the variable
out_name & WORD & New name of the variable
param & WORD & Parameter identifier (GRIB1: code[.tabnum]; GRIB2: num[.cat[.dis]])
...
...
src/Histogram.c
View file @
dd4ec788
...
...
@@ -58,6 +58,8 @@ void *Histogram(void *argument)
HISTMEAN
=
cdoOperatorAdd
(
"histmean"
,
0
,
0
,
NULL
);
HISTFREQ
=
cdoOperatorAdd
(
"histfreq"
,
0
,
0
,
NULL
);
UNUSED
(
HISTSUM
);
operatorID
=
cdoOperatorID
();
operatorInputArg
(
"bins"
);
...
...
@@ -147,16 +149,16 @@ void *Histogram(void *argument)
{
if
(
!
DBL_IS_EQUAL
(
array
[
i
],
missval
)
)
{
*
(
vartcount
[
varID
]
+
i
)
+=
1
;
vartcount
[
varID
]
[
i
]
+=
1
;
index
=
0
;
while
(
index
<
nbins
)
{
offset
=
gridsize
*
index
;
if
(
!
DBL_IS_EQUAL
(
*
(
vardata
[
varID
]
+
offset
+
i
)
,
missval
)
&&
if
(
!
DBL_IS_EQUAL
(
vardata
[
varID
]
[
offset
+
i
]
,
missval
)
&&
array
[
i
]
>=
fltarr
[
index
]
&&
array
[
i
]
<
fltarr
[
index
+
1
]
)
{
*
(
vardata
[
varID
]
+
offset
+
i
)
+=
array
[
i
];
*
(
varcount
[
varID
]
+
offset
+
i
)
+=
1
;
vardata
[
varID
]
[
offset
+
i
]
+=
array
[
i
];
varcount
[
varID
]
[
offset
+
i
]
+=
1
;
break
;
}
index
++
;
...
...
@@ -177,36 +179,39 @@ void *Histogram(void *argument)
{
missval
=
vlistInqVarMissval
(
vlistID2
,
varID
);
gridsize
=
gridInqSize
(
vlistInqVarGrid
(
vlistID2
,
varID
));
nmiss
=
0
;
/* fix mising values */
for
(
index
=
0
;
index
<
nbins
;
index
++
)
{
streamDefRecord
(
streamID2
,
varID
,
index
)
;
offset
=
gridsize
*
index
;
nmiss
=
0
;
offset
=
gridsize
*
index
;
for
(
i
=
0
;
i
<
gridsize
;
i
++
)
{
if
(
*
(
vartcount
[
varID
]
+
i
)
>
0
)
if
(
vartcount
[
varID
]
[
i
]
>
0
)
{
if
(
operatorID
==
HISTMEAN
||
operatorID
==
HISTFREQ
)
{
if
(
*
(
varcount
[
varID
]
+
offset
+
i
)
>
0
)
if
(
varcount
[
varID
]
[
offset
+
i
]
>
0
)
{
if
(
operatorID
==
HISTMEAN
)
*
(
vardata
[
varID
]
+
offset
+
i
)
/=
*
(
varcount
[
varID
]
+
offset
+
i
)
;
vardata
[
varID
]
[
offset
+
i
]
/=
varcount
[
varID
]
[
offset
+
i
]
;
else
*
(
vardata
[
varID
]
+
offset
+
i
)
=
*
(
varcount
[
varID
]
+
offset
+
i
)
/
*
(
vartcount
[
varID
]
+
i
)
;
vardata
[
varID
]
[
offset
+
i
]
=
varcount
[
varID
]
[
offset
+
i
]
/
vartcount
[
varID
]
[
i
]
;
}
}
}
else
{
nmiss
++
;
*
(
vardata
[
varID
]
+
offset
+
i
)
=
missval
;
varcount
[
varID
][
offset
+
i
]
=
missval
;
vardata
[
varID
][
offset
+
i
]
=
missval
;
}
}
streamDefRecord
(
streamID2
,
varID
,
index
);
if
(
operatorID
==
HISTCOUNT
)
streamWriteRecord
(
streamID2
,
varcount
[
varID
]
+
offset
,
nmiss
);
else
...
...
src/operator_help.h
View file @
dd4ec788
...
...
@@ -805,7 +805,7 @@ static char *SetpartabHelp[] = {
" "
,
" The following parameter table entries are supported:"
,
" "
,
" Entry
& Type
& Description "
,
" Entry
& Type
& Description "
,
" name & WORD & Name of the variable"
,
" out_name & WORD & New name of the variable"
,
" param & WORD & Parameter identifier (GRIB1: code[.tabnum]; GRIB2: num[.cat[.dis]])"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment