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
libcdi
Commits
fc334b2d
Commit
fc334b2d
authored
Feb 19, 2010
by
Uwe Schulzweida
Browse files
added switch HAVE_MISSVAL to indicate that the input stream has missing values
parent
8bd3fabd
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/cdi.c
View file @
fc334b2d
...
...
@@ -690,7 +690,7 @@ int main(int argc, char *argv[])
if
(
Progname
==
0
)
Progname
=
argv
[
0
];
else
Progname
++
;
while
(
(
c
=
getopt
(
argc
,
argv
,
"f:t:w:z:cdhlmqRrsvVZ"
))
!=
EOF
)
while
(
(
c
=
getopt
(
argc
,
argv
,
"f:t:w:z:cdhl
M
mqRrsvVZ"
))
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -706,6 +706,9 @@ int main(int argc, char *argv[])
case
'l'
:
Longinfo
=
1
;
break
;
case
'M'
:
cdiDefGlobal
(
"HAVE_MISSVAL"
,
1
);
break
;
case
'm'
:
Move
=
1
;
break
;
...
...
src/stream.c
View file @
fc334b2d
...
...
@@ -2016,6 +2016,8 @@ void streamDefVlist(int streamID, int vlistID)
gridID
=
vlistInqVarGrid
(
vlistID
,
varID
);
zaxisID
=
vlistInqVarZaxis
(
vlistID
,
varID
);
streamNewVar
(
streamID
,
gridID
,
zaxisID
);
if
(
streamptr
->
have_missval
)
vlistDefVarMissval
(
vlistID
,
varID
,
vlistInqVarMissval
(
vlistID
,
varID
));
}
if
(
streamptr
->
filemode
==
'w'
)
...
...
src/stream_int.c
View file @
fc334b2d
...
...
@@ -55,6 +55,7 @@ int CDI_Debug = 0; /* If set to 1, debugging */
int
cdiDefaultLeveltype
=
-
1
;
static
int
cdiDataUnreduced
=
0
;
static
int
cdiSortName
=
0
;
static
int
cdiHaveMissval
=
0
;
long
cdiGetenvInt
(
char
*
envName
)
...
...
@@ -118,6 +119,9 @@ void cdiInitialize(void)
value
=
cdiGetenvInt
(
"CDI_SORTNAME"
);
if
(
value
>=
0
)
cdiSortName
=
(
int
)
value
;
value
=
cdiGetenvInt
(
"CDI_HAVE_MISSVAL"
);
if
(
value
>=
0
)
cdiHaveMissval
=
(
int
)
value
;
value
=
cdiGetenvInt
(
"CD_LEVELTYPE"
);
if
(
value
>=
0
)
cdiDefaultLeveltype
=
(
int
)
value
;
...
...
@@ -363,6 +367,7 @@ static void stream_init_entry(stream_t *streamptr)
streamptr
->
vct
.
mlevID
=
UNDEFID
;
streamptr
->
unreduced
=
cdiDataUnreduced
;
streamptr
->
sortname
=
cdiSortName
;
streamptr
->
have_missval
=
cdiHaveMissval
;
streamptr
->
ztype
=
COMPRESS_NONE
;
streamptr
->
zlevel
=
0
;
...
...
@@ -485,6 +490,10 @@ void cdiDefGlobal(const char *string, int val)
{
cdiSortName
=
val
;
}
else
if
(
strcmp
(
string
,
"HAVE_MISSVAL"
)
==
0
)
{
cdiHaveMissval
=
val
;
}
else
{
Warning
(
func
,
"Unsupported global key: %s"
,
string
);
...
...
@@ -497,7 +506,6 @@ void cdiDefMissval(double missval)
cdiInitialize
();
cdiDefaultMissval
=
missval
;
}
...
...
src/stream_int.h
View file @
fc334b2d
...
...
@@ -235,6 +235,7 @@ typedef struct {
VCT
vct
;
int
unreduced
;
int
sortname
;
int
have_missval
;
int
ztype
;
int
zlevel
;
int
curfile
;
...
...
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