Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
d7ec10f3
Commit
d7ec10f3
authored
Jul 13, 2012
by
Uwe Schulzweida
Browse files
added call to cdiInitialize() in all streamOpen functions (bug fix)
parent
e0e5be73
Changes
5
Show whitespace changes
Inline
Side-by-side
ChangeLog
View file @
d7ec10f3
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
2012-07-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
2012-07-13 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added call to cdiInitialize() in all streamOpen functions (bug fix)
* added support for environment variable NC_CHUNKSIZEHINT [Feature #2142]
* added support for environment variable NC_CHUNKSIZEHINT [Feature #2142]
2012-07-04 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
2012-07-04 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
src/cdf_int.c
View file @
d7ec10f3
...
@@ -67,13 +67,11 @@ void cdf_create(const char *path, int cmode, int *ncidp)
...
@@ -67,13 +67,11 @@ void cdf_create(const char *path, int cmode, int *ncidp)
if
(
CDF_Debug
||
status
!=
NC_NOERR
)
if
(
CDF_Debug
||
status
!=
NC_NOERR
)
Message
(
"chunksizehint %d"
,
chunksizehint
);
Message
(
"chunksizehint %d"
,
chunksizehint
);
if
(
status
!=
NC_NOERR
)
if
(
status
!=
NC_NOERR
)
Error
(
"%s"
,
nc_strerror
(
status
));
Error
(
"%s"
,
nc_strerror
(
status
));
status
=
nc_set_fill
(
*
ncidp
,
NC_NOFILL
,
&
oldfill
);
status
=
nc_set_fill
(
*
ncidp
,
NC_NOFILL
,
&
oldfill
);
if
(
status
!=
NC_NOERR
)
if
(
status
!=
NC_NOERR
)
Error
(
"%s"
,
nc_strerror
(
status
));
Error
(
"%s"
,
nc_strerror
(
status
));
}
}
...
@@ -102,17 +100,17 @@ int cdf_open(const char *path, int omode, int *ncidp)
...
@@ -102,17 +100,17 @@ int cdf_open(const char *path, int omode, int *ncidp)
/*
/*
if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
*/
*/
if
(
cdiNcChunksizehint
!=
CDI_UNDEFID
)
chunksizehint
=
cdiNcChunksizehint
;
status
=
nc__open
(
path
,
omode
,
&
chunksizehint
,
ncidp
);
status
=
nc__open
(
path
,
omode
,
&
chunksizehint
,
ncidp
);
if
(
CDF_Debug
)
if
(
CDF_Debug
)
Message
(
"chunksizehint %d"
,
chunksizehint
);
Message
(
"chunksizehint %d"
,
chunksizehint
);
}
}
if
(
CDF_Debug
)
if
(
CDF_Debug
)
Message
(
"ncid = %d mode = %d file = %s"
,
*
ncidp
,
omode
,
path
);
Message
(
"ncid = %d mode = %d file = %s"
,
*
ncidp
,
omode
,
path
);
if
(
CDF_Debug
&&
status
!=
NC_NOERR
)
if
(
CDF_Debug
&&
status
!=
NC_NOERR
)
Message
(
"%s"
,
nc_strerror
(
status
));
Message
(
"%s"
,
nc_strerror
(
status
));
return
(
status
);
return
(
status
);
}
}
...
...
src/stream.c
View file @
d7ec10f3
...
@@ -298,8 +298,7 @@ int get_fnames(const char *argument, char *fnames[], int max_fnames)
...
@@ -298,8 +298,7 @@ int get_fnames(const char *argument, char *fnames[], int max_fnames)
strcat
(
command
,
pch
);
strcat
(
command
,
pch
);
pfp
=
popen
(
command
,
"r"
);
pfp
=
popen
(
command
,
"r"
);
if
(
pfp
==
NULL
)
if
(
pfp
==
NULL
)
SysError
(
"popen %s failed"
,
command
);
SysError
(
"popen %s failed"
,
command
);
nfiles
=
0
;
nfiles
=
0
;
while
(
_readline_
(
pfp
,
line
,
MAX_LINE
)
)
while
(
_readline_
(
pfp
,
line
,
MAX_LINE
)
)
...
@@ -973,6 +972,8 @@ int streamOpenRead(const char *filenames)
...
@@ -973,6 +972,8 @@ int streamOpenRead(const char *filenames)
const
char
*
filename
;
const
char
*
filename
;
stream_t
*
streamptr
=
NULL
;
stream_t
*
streamptr
=
NULL
;
cdiInitialize
();
//num_fnames = get_fnames(filenames, fnames, MAX_FNAMES);
//num_fnames = get_fnames(filenames, fnames, MAX_FNAMES);
if
(
num_fnames
==
0
)
if
(
num_fnames
==
0
)
...
@@ -1015,6 +1016,8 @@ int streamOpenAppend(const char *filename)
...
@@ -1015,6 +1016,8 @@ int streamOpenAppend(const char *filename)
int
streamID
;
int
streamID
;
stream_t
*
streamptr
;
stream_t
*
streamptr
;
cdiInitialize
();
filetype
=
getFiletype
(
filename
,
&
byteorder
);
filetype
=
getFiletype
(
filename
,
&
byteorder
);
if
(
filetype
<
0
)
return
(
filetype
);
if
(
filetype
<
0
)
return
(
filetype
);
...
@@ -1073,6 +1076,8 @@ if ( streamID < 0 ) handle_error(streamID);
...
@@ -1073,6 +1076,8 @@ if ( streamID < 0 ) handle_error(streamID);
*/
*/
int
streamOpenWrite
(
const
char
*
filename
,
int
filetype
)
int
streamOpenWrite
(
const
char
*
filename
,
int
filetype
)
{
{
cdiInitialize
();
return
(
streamOpen
(
filename
,
"w"
,
filetype
));
return
(
streamOpen
(
filename
,
"w"
,
filetype
));
}
}
...
...
src/stream_int.c
View file @
d7ec10f3
...
@@ -191,7 +191,9 @@ void cdiInitialize(void)
...
@@ -191,7 +191,9 @@ void cdiInitialize(void)
if
(
CDI_Debug
)
if
(
CDI_Debug
)
Message
(
"Default calendar set to %s!"
,
envString
);
Message
(
"Default calendar set to %s!"
,
envString
);
}
}
#if defined (HAVE_LIBCGRIBEX)
gribSetCalendar
(
cdiDefaultCalendar
);
gribSetCalendar
(
cdiDefaultCalendar
);
#endif
envString
=
getenv
(
"PARTAB_INTERN"
);
envString
=
getenv
(
"PARTAB_INTERN"
);
if
(
envString
)
cdiPartabIntern
=
atoi
(
envString
);
if
(
envString
)
cdiPartabIntern
=
atoi
(
envString
);
...
@@ -581,7 +583,6 @@ void cdiCheckContents(int streamID)
...
@@ -581,7 +583,6 @@ void cdiCheckContents(int streamID)
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_GENERIC
)
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_GENERIC
)
cdiCheckZaxis
(
zaxisID
);
cdiCheckZaxis
(
zaxisID
);
}
}
}
}
...
...
src/stream_int.h
View file @
d7ec10f3
...
@@ -311,6 +311,7 @@ int streamInqDimgroupID(int streamID);
...
@@ -311,6 +311,7 @@ int streamInqDimgroupID(int streamID);
int
getByteswap
(
int
byteorder
);
int
getByteswap
(
int
byteorder
);
void
cdiInitialize
(
void
);
void
stream_write_record
(
int
streamID
,
int
memtype
,
const
void
*
data
,
int
nmiss
);
void
stream_write_record
(
int
streamID
,
int
memtype
,
const
void
*
data
,
int
nmiss
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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