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
302f55fd
Commit
302f55fd
authored
Jan 03, 2010
by
Uwe Schulzweida
Browse files
check complex numbers
parent
eddddf0f
Changes
4
Show whitespace changes
Inline
Side-by-side
src/stream_cdf.c
View file @
302f55fd
...
...
@@ -361,8 +361,12 @@ int cdfInqDatatype(int xtype)
#if defined (HAVE_LIBNETCDF)
int
cdfDefDatatype
(
int
datatype
)
{
static
char
func
[]
=
"cdfDefDatatype"
;
int
xtype
;
if
(
datatype
==
DATATYPE_CPX32
||
datatype
==
DATATYPE_CPX64
)
Error
(
func
,
"CDI/netCDF library does not support complex numbers!"
);
if
(
datatype
==
DATATYPE_INT8
)
xtype
=
NC_BYTE
;
else
if
(
datatype
==
DATATYPE_UINT8
)
xtype
=
NC_SHORT
;
else
if
(
datatype
==
DATATYPE_INT16
)
xtype
=
NC_SHORT
;
...
...
src/stream_grb.c
View file @
302f55fd
...
...
@@ -16,8 +16,12 @@
int
grbBitsPerValue
(
int
datatype
)
{
static
char
func
[]
=
"grbBitsPerValue"
;
int
bitsPerValue
=
16
;
if
(
datatype
==
DATATYPE_CPX32
||
datatype
==
DATATYPE_CPX64
)
Error
(
func
,
"CDI/GRIB library does not support complex numbers!"
);
if
(
datatype
!=
CDI_UNDEFID
)
{
if
(
datatype
>
0
&&
datatype
<=
32
)
...
...
src/stream_ieg.c
View file @
302f55fd
...
...
@@ -47,8 +47,12 @@ int iegInqDatatype(int prec)
int
iegDefDatatype
(
int
datatype
)
{
static
char
func
[]
=
"iegDefDatatype"
;
int
prec
;
if
(
datatype
==
DATATYPE_CPX32
||
datatype
==
DATATYPE_CPX64
)
Error
(
func
,
"CDI/IEG library does not support complex numbers!"
);
if
(
datatype
!=
DATATYPE_FLT32
&&
datatype
!=
DATATYPE_FLT64
)
datatype
=
DATATYPE_FLT32
;
...
...
src/stream_srv.c
View file @
302f55fd
...
...
@@ -45,8 +45,12 @@ int srvInqDatatype(int prec)
int
srvDefDatatype
(
int
datatype
)
{
static
char
func
[]
=
"srvDefDatatype"
;
int
prec
;
if
(
datatype
==
DATATYPE_CPX32
||
datatype
==
DATATYPE_CPX64
)
Error
(
func
,
"CDI/SERVICE library does not support complex numbers!"
);
if
(
datatype
!=
DATATYPE_FLT32
&&
datatype
!=
DATATYPE_FLT64
)
datatype
=
DATATYPE_FLT32
;
...
...
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