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
1e3ab1cd
Commit
1e3ab1cd
authored
Aug 31, 2017
by
Uwe Schulzweida
Browse files
preparation for reduce_dim of z axis.
parent
5cbc4e9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cdf_write.c
View file @
1e3ab1cd
...
@@ -986,6 +986,7 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
...
@@ -986,6 +986,7 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
void
cdf_write_var
(
stream_t
*
streamptr
,
int
varID
,
int
memtype
,
const
void
*
data
,
int
nmiss
)
void
cdf_write_var
(
stream_t
*
streamptr
,
int
varID
,
int
memtype
,
const
void
*
data
,
int
nmiss
)
{
{
if
(
streamptr
->
accessmode
==
0
)
cdfEndDef
(
streamptr
);
if
(
streamptr
->
accessmode
==
0
)
cdfEndDef
(
streamptr
);
// if ( streamptr->ncmode == 0 ) { cdfEndDef(streamptr); streamptr->ncmode = 2; }
size_t
xsize
=
0
,
ysize
=
0
;
size_t
xsize
=
0
,
ysize
=
0
;
size_t
size
;
size_t
size
;
...
@@ -1081,6 +1082,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
...
@@ -1081,6 +1082,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
const
int
rect
[][
2
],
const
void
*
data
,
int
nmiss
)
const
int
rect
[][
2
],
const
void
*
data
,
int
nmiss
)
{
{
if
(
streamptr
->
accessmode
==
0
)
cdfEndDef
(
streamptr
);
if
(
streamptr
->
accessmode
==
0
)
cdfEndDef
(
streamptr
);
// if ( streamptr->ncmode == 0 ) { cdfEndDef(streamptr); streamptr->ncmode = 2; }
int
xid
=
CDI_UNDEFID
,
yid
=
CDI_UNDEFID
;
int
xid
=
CDI_UNDEFID
,
yid
=
CDI_UNDEFID
;
size_t
xsize
=
0
,
ysize
=
0
;
size_t
xsize
=
0
,
ysize
=
0
;
...
@@ -1182,6 +1184,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
...
@@ -1182,6 +1184,7 @@ void cdf_write_var_chunk(stream_t *streamptr, int varID, int memtype,
void
cdf_write_var_slice
(
stream_t
*
streamptr
,
int
varID
,
int
levelID
,
int
memtype
,
const
void
*
data
,
int
nmiss
)
void
cdf_write_var_slice
(
stream_t
*
streamptr
,
int
varID
,
int
levelID
,
int
memtype
,
const
void
*
data
,
int
nmiss
)
{
{
if
(
streamptr
->
accessmode
==
0
)
cdfEndDef
(
streamptr
);
if
(
streamptr
->
accessmode
==
0
)
cdfEndDef
(
streamptr
);
// if ( streamptr->ncmode == 0 ) { streamptr->ncmode = 2; cdfEndDef(streamptr); }
size_t
xsize
=
0
,
ysize
=
0
;
size_t
xsize
=
0
,
ysize
=
0
;
size_t
start
[
5
];
size_t
start
[
5
];
...
...
src/stream_cdf_o.c
View file @
1e3ab1cd
...
@@ -1493,39 +1493,40 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID)
...
@@ -1493,39 +1493,40 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID)
int
nzaxis
=
vlistNzaxis
(
vlistID
);
int
nzaxis
=
vlistNzaxis
(
vlistID
);
size_t
dimlen
=
(
size_t
)
zaxisInqSize
(
zaxisID
);
size_t
dimlen
=
(
size_t
)
zaxisInqSize
(
zaxisID
);
int
type
=
zaxisInqType
(
zaxisID
);
int
type
=
zaxisInqType
(
zaxisID
);
int
ndims
=
1
;
bool
is_scalar
=
false
;
if
(
dimlen
==
1
)
if
(
dimlen
==
1
)
{
{
is_scalar
=
zaxisInqScalar
(
zaxisID
)
>
0
;
bool
is_scalar
=
zaxisInqScalar
(
zaxisID
)
>
0
;
if
(
!
is_scalar
&&
CDI_cmor_mode
)
if
(
!
is_scalar
&&
CDI_cmor_mode
)
{
{
is_scalar
=
true
;
is_scalar
=
true
;
zaxisDefScalar
(
zaxisID
);
zaxisDefScalar
(
zaxisID
);
}
}
}
int
ndims
=
is_scalar
?
0
:
1
;
if
(
is_scalar
)
ndims
=
0
;
// if ( CDI_reduce_dim ) return;
if
(
dimlen
==
1
)
switch
(
type
)
switch
(
type
)
{
{
case
ZAXIS_SURFACE
:
case
ZAXIS_
SURFAC
E
:
case
ZAXIS_
CLOUD_BAS
E
:
case
ZAXIS_CLOUD_
BASE
:
case
ZAXIS_CLOUD_
TOP
:
case
ZAXIS_
CLOUD_TOP
:
case
ZAXIS_
ISOTHERM_ZERO
:
case
ZAXIS_
ISOTHERM_ZERO
:
case
ZAXIS_
TOA
:
case
ZAXIS_TO
A
:
case
ZAXIS_
SEA_BOT
TO
M
:
case
ZAXIS_
SEA_BOTTOM
:
case
ZAXIS_
ATMOSPHERE
:
case
ZAXIS_
ATMOSPHERE
:
case
ZAXIS_
MEANSEA
:
case
ZAXIS_
MEANSEA
:
case
ZAXIS_
LAKE_BOTTOM
:
case
ZAXIS_
LAKE
_BOTTOM
:
case
ZAXIS_
SEDIMENT
_BOTTOM
:
case
ZAXIS_SEDIMENT_BOTTOM
:
case
ZAXIS_SEDIMENT_BOTTOM
_TA
:
case
ZAXIS_SEDIMENT_BOTTOM_T
A
:
case
ZAXIS_SEDIMENT_BOTTOM_T
W
:
case
ZAXIS_
SEDIMENT_BOTTOM_TW
:
case
ZAXIS_
MIX_LAYER
:
case
ZAXIS_MIX_LAYER
:
return
;
return
;
}
}
}
zaxisInqName
(
zaxisID
,
axisname
);
zaxisInqName
(
zaxisID
,
axisname
);
...
...
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