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
cdcf2014
Commit
cdcf2014
authored
Sep 17, 2013
by
Uwe Schulzweida
Browse files
grib2: added read part for ZAXIS_REFERENCE
parent
e124a50f
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/cdi.c
View file @
cdcf2014
...
...
@@ -431,7 +431,7 @@ void printShortinfo(int streamID, int vlistID, int vardis)
if
(
zaxistype
==
ZAXIS_GENERIC
&&
ltype
!=
0
)
nbyte0
=
fprintf
(
stdout
,
" %4d : %-11s (ltype=%3d) : "
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
,
longname
,
ltype
);
else
nbyte0
=
fprintf
(
stdout
,
" %4d : %-1
7s
%5s : "
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
,
longname
,
units
);
nbyte0
=
fprintf
(
stdout
,
" %4d : %-1
8s
%5s : "
,
vlistZaxisIndex
(
vlistID
,
zaxisID
)
+
1
,
longname
,
units
);
nbyte
=
nbyte0
;
for
(
levelID
=
0
;
levelID
<
levelsize
;
levelID
++
)
{
...
...
@@ -449,7 +449,7 @@ void printShortinfo(int streamID, int vlistID, int vardis)
{
double
level1
,
level2
;
nbyte
=
nbyte0
;
nbyte0
=
fprintf
(
stdout
,
"%33s : "
,
"bounds"
);
fprintf
(
stdout
,
"%33s : "
,
"bounds"
);
for
(
levelID
=
0
;
levelID
<
levelsize
;
levelID
++
)
{
if
(
nbyte
>
MAXCHARS
)
...
...
@@ -464,6 +464,30 @@ void printShortinfo(int streamID, int vlistID, int vardis)
}
fprintf
(
stdout
,
"
\n
"
);
}
if
(
zaxistype
==
ZAXIS_REFERENCE
)
{
int
number
=
zaxisInqNumber
(
zaxisID
);
if
(
number
>
0
)
{
fprintf
(
stdout
,
"%33s : "
,
"zaxis"
);
fprintf
(
stdout
,
"number = %d
\n
"
,
number
);
}
char
uuidOfVGrid
[
17
];
zaxisInqUUID
(
zaxisID
,
uuidOfVGrid
);
if
(
uuidOfVGrid
[
0
]
!=
0
)
{
char
uuidOfVGridStr
[
37
];
uuid2str
(
uuidOfVGrid
,
uuidOfVGridStr
);
if
(
uuidOfVGridStr
[
0
]
!=
0
&&
strlen
(
uuidOfVGridStr
)
==
36
)
{
fprintf
(
stdout
,
"%33s : "
,
"uuid"
);
fprintf
(
stdout
,
"%s
\n
"
,
uuidOfVGridStr
);
}
}
}
}
taxisID
=
vlistInqTaxis
(
vlistID
);
...
...
app/printinfo.h
View file @
cdcf2014
...
...
@@ -278,9 +278,6 @@ void printGridInfo(int vlistID)
}
else
if
(
gridtype
==
GRID_CURVILINEAR
||
gridtype
==
GRID_UNSTRUCTURED
)
{
int
number
=
gridInqNumber
(
gridID
);
int
position
=
gridInqPosition
(
gridID
);
if
(
gridtype
==
GRID_CURVILINEAR
)
fprintf
(
stdout
,
"size : dim = %d nx = %d ny = %d"
,
gridsize
,
xsize
,
ysize
);
else
...
...
@@ -293,6 +290,9 @@ void printGridInfo(int vlistID)
if
(
gridtype
==
GRID_UNSTRUCTURED
)
{
int
number
=
gridInqNumber
(
gridID
);
int
position
=
gridInqPosition
(
gridID
);
if
(
number
>
0
)
{
fprintf
(
stdout
,
"%*s"
,
nbyte0
,
""
);
...
...
doc/tex/c_quick_ref.tex
View file @
cdcf2014
...
...
@@ -55,7 +55,7 @@ Define the number of vertex of a Gridbox.
void gridDefPosition (int gridID, int position);
\end{verbatim}
Define the position of grid in reference f
or an unstructured grid
.
Define the position of grid in
the
reference f
ile
.
\section*
{
\tt
\htmlref
{
gridDefPrec
}{
gridDefPrec
}}
...
...
@@ -244,7 +244,7 @@ Get the number of vertex of a Gridbox.
int gridInqPosition (int gridID);
\end{verbatim}
Get the position of grid in reference
to an unstructured grid
.
Get the position of grid in
the
reference
file
.
\section*
{
\tt
\htmlref
{
gridInqPrec
}{
gridInqPrec
}}
...
...
doc/tex/f_quick_ref.tex
View file @
cdcf2014
...
...
@@ -55,7 +55,7 @@ Define the number of vertex of a Gridbox.
SUBROUTINE gridDefPosition (INTEGER gridID, INTEGER position)
\end{verbatim}
Define the position of grid in reference f
or an unstructured grid
.
Define the position of grid in
the
reference f
ile
.
\section*
{
\tt
\htmlref
{
gridDefPrec
}{
gridDefPrec
}}
...
...
@@ -244,7 +244,7 @@ Get the number of vertex of a Gridbox.
INTEGER FUNCTION gridInqPosition (INTEGER gridID)
\end{verbatim}
Get the position of grid in reference
to an unstructured grid
.
Get the position of grid in
the
reference
file
.
\section*
{
\tt
\htmlref
{
gridInqPrec
}{
gridInqPrec
}}
...
...
src/stream_grb.c
View file @
cdcf2014
...
...
@@ -83,6 +83,7 @@ int grib2ltypeToZaxisType(int grib_ltype)
case
GRIB2_LTYPE_SEDIMENT_BOTTOM_TA
:
{
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM_TA
;
break
;
}
case
GRIB2_LTYPE_SEDIMENT_BOTTOM_TW
:
{
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM_TW
;
break
;
}
case
GRIB2_LTYPE_MIX_LAYER
:
{
zaxistype
=
ZAXIS_MIX_LAYER
;
break
;
}
case
GRIB2_LTYPE_REFERENCE
:
{
zaxistype
=
ZAXIS_REFERENCE
;
break
;
}
}
return
(
zaxistype
);
...
...
src/varscan.c
View file @
cdcf2014
...
...
@@ -570,6 +570,12 @@ void cdi_generate_vars(stream_t *streamptr)
zaxisID
=
varDefZaxis
(
vlistID
,
zaxistype
,
nlevels
,
dlevels
,
lbounds
,
dlevels1
,
dlevels2
,
Vctsize
,
Vct
,
NULL
,
NULL
,
unitptr
,
0
,
0
,
ltype
);
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_REFERENCE
)
{
if
(
numberOfVerticalGrid
>
0
)
zaxisDefNumber
(
zaxisID
,
numberOfVerticalGrid
);
if
(
uuidVGrid
[
0
]
!=
0
)
zaxisDefUUID
(
zaxisID
,
uuidVGrid
);
}
if
(
lbounds
)
free
(
dlevels1
);
if
(
lbounds
)
free
(
dlevels2
);
free
(
dlevels
);
...
...
src/zaxis.c
View file @
cdcf2014
...
...
@@ -54,7 +54,7 @@ ZaxistypeEntry[] = {
{
/* 22 */
0
,
"sedimentbottomta"
,
"sediment_bottom_ta"
,
""
,
""
},
{
/* 23 */
0
,
"sedimentbottomtw"
,
"sediment_bottom_tw"
,
""
,
""
},
{
/* 24 */
0
,
"mixlayer"
,
"mix_layer"
,
""
,
""
},
{
/* 25 */
0
,
"height"
,
"generalized height"
,
"height"
,
"
m
"
},
{
/* 25 */
0
,
"height"
,
"generalized height"
,
"height"
,
""
},
};
static
int
CDI_MaxZaxistype
=
sizeof
(
ZaxistypeEntry
)
/
sizeof
(
ZaxistypeEntry
[
0
]);
...
...
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