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
38a1229c
Commit
38a1229c
authored
Jun 11, 2013
by
Uwe Schulzweida
Browse files
GRIB2: added support for snow level (level type 114)
parent
b486ef4c
Changes
19
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
38a1229c
...
...
@@ -4,6 +4,7 @@
2013-06-11 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* GRIB2: added support for snow level (level type 114)
* GRIB2: added support for layers with zaxis type ZAXIS_PRESSURE
2013-06-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
...
...
NEWS
View file @
38a1229c
...
...
@@ -4,6 +4,7 @@ CDI NEWS
Version 1.6.1 (18 June 2013):
New features:
* GRIB2: added support for snow level (level type 114)
* GRIB2: added support for layers with zaxis type ZAXIS_PRESSURE
New functions:
* cdiHaveFiletype(): Check whether a filetype is available
...
...
doc/tex/c_ref.tex
View file @
38a1229c
...
...
@@ -1183,7 +1183,7 @@ vlistInqAttFlt
\fi
}
\begin{verbatim}
int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen,
int
*dp);
int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen,
double
*dp);
\end{verbatim}
Get the value(s) of a floating point attribute
...
...
@@ -1213,7 +1213,7 @@ vlistInqAttTxt
\fi
}
\begin{verbatim}
int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen,
int
*tp);
int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen,
char
*tp);
\end{verbatim}
Get the value(s) of a text attribute
...
...
doc/tex/c_vlist_att.tex
View file @
38a1229c
...
...
@@ -160,7 +160,7 @@ The function {\tt vlistInqAttFlt} gets the values(s) of a floating point attribu
\subsubsection*
{
Usage
}
\begin{verbatim}
int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen,
int
*dp);
int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen,
double
*dp);
\end{verbatim}
\hspace*
{
4mm
}
\begin{minipage}
[]
{
15cm
}
...
...
@@ -218,7 +218,7 @@ The function {\tt vlistInqAttTxt} gets the values(s) of a text attribute.
\subsubsection*
{
Usage
}
\begin{verbatim}
int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen,
int
*tp);
int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen,
char
*tp);
\end{verbatim}
\hspace*
{
4mm
}
\begin{minipage}
[]
{
15cm
}
...
...
doc/tex/c_vlist_var.tex
View file @
38a1229c
...
...
@@ -381,7 +381,7 @@ Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate
\item
[{\tt varID}]
Variable identifier.
\item
[{\tt units}]
Units of the variable. The caller must allocate space for the
Units of the variable. The caller must allocate space for the
returned string. The maximum possible length, in characters, of
the string is given by the predefined constant
{
\tt
CDI
\_
MAX
\_
NAME
}
.
...
...
doc/tex/c_zaxis.tex
View file @
38a1229c
...
...
@@ -20,7 +20,7 @@ The type of the Z-axis, one of the set of predefined {\CDI} Z-axis types.
{
\tt
ZAXIS
\_
HYBRID
}
,
{
\tt
ZAXIS
\_
SIGMA
}
,
{
\tt
ZAXIS
\_
PRESSURE
}
,
{
\tt
ZAXIS
\_
HEIGHT
}
,
{
\tt
ZAXIS
\_
ISENTROPIC
}
,
{
\tt
ZAXIS
\_
ALTITUDE
}
,
{
\tt
ZAXIS
\_
MEANSEA
}
,
{
\tt
ZAXIS
\_
TOA
}
,
{
\tt
ZAXIS
\_
SEA
\_
BOTTOM
}
,
{
\tt
ZAXIS
\_
ATMOSPHERE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
BASE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
SNOW
}
,
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
SEA
}
and
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
LAND
}
.
\item
[{\tt size}]
Number of levels.
...
...
@@ -98,7 +98,7 @@ The valid {\CDI} Z-axis types are {\tt ZAXIS\_GENERIC}, {\tt ZAXIS\_SURFACE},
{
\tt
ZAXIS
\_
HYBRID
}
,
{
\tt
ZAXIS
\_
SIGMA
}
,
{
\tt
ZAXIS
\_
PRESSURE
}
,
{
\tt
ZAXIS
\_
HEIGHT
}
,
{
\tt
ZAXIS
\_
ISENTROPIC
}
,
{
\tt
ZAXIS
\_
ALTITUDE
}
,
{
\tt
ZAXIS
\_
MEANSEA
}
,
{
\tt
ZAXIS
\_
TOA
}
,
{
\tt
ZAXIS
\_
SEA
\_
BOTTOM
}
,
{
\tt
ZAXIS
\_
ATMOSPHERE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
BASE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
SNOW
}
,
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
SEA
}
and
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
LAND
}
.
...
...
doc/tex/cdi_cman.tex
View file @
38a1229c
...
...
@@ -8,15 +8,15 @@
\gdef\pdfoutput
{
0
}
\fi
\newif\ifpdf
\newif\ifpdf
x
\ifnum\pdfoutput
=0
% latex is called for dvi output
\pdffalse
\pdf
x
false
\usepackage
{
graphics
}
\usepackage
{
hyperref
}
\else
% pdflatex is called for pdf output
\pdftrue
\pdf
x
true
\usepackage
[pdftex]
{
graphicx
}
\usepackage
[pdftex]
{
hyperref
}
\fi
...
...
@@ -236,7 +236,7 @@ CDI library routines:
\clearpage
\ifpdf
\ifpdf
x
\phantomsection
\fi
\addcontentsline
{
toc
}{
chapter
}{
\indexname
}
...
...
doc/tex/cdi_fman.tex
View file @
38a1229c
...
...
@@ -8,15 +8,15 @@
\gdef\pdfoutput
{
0
}
\fi
\newif\ifpdf
\newif\ifpdf
x
\ifnum\pdfoutput
=0
% latex is called for dvi output
\pdffalse
\pdf
x
false
\usepackage
{
graphics
}
\usepackage
{
hyperref
}
\else
% pdflatex is called for pdf output
\pdftrue
\pdf
x
true
\usepackage
[pdftex]
{
graphicx
}
\usepackage
[pdftex]
{
hyperref
}
\fi
...
...
@@ -233,7 +233,7 @@ CDI library routines:
\clearpage
\ifpdf
\ifpdf
x
\phantomsection
\printindex
\fi
...
...
doc/tex/f_ref.tex
View file @
38a1229c
...
...
@@ -1195,7 +1195,7 @@ vlistInqAttFlt
}
\begin{verbatim}
INTEGER FUNCTION vlistInqAttFlt(INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER mlen,
INTEGER
dp)
CHARACTER*(*) name, INTEGER mlen,
REAL*8
dp)
\end{verbatim}
Get the value(s) of a floating point attribute
...
...
@@ -1227,7 +1227,8 @@ vlistInqAttTxt
}
\begin{verbatim}
INTEGER FUNCTION vlistInqAttTxt(INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER mlen, INTEGER tp)
CHARACTER*(*) name, INTEGER mlen,
CHARACTER*(*) tp)
\end{verbatim}
Get the value(s) of a text attribute
...
...
doc/tex/f_vlist_att.tex
View file @
38a1229c
...
...
@@ -165,7 +165,7 @@ The function {\tt vlistInqAttFlt} gets the values(s) of a floating point attribu
\begin{verbatim}
INTEGER FUNCTION vlistInqAttFlt(INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER mlen,
INTEGER
dp)
CHARACTER*(*) name, INTEGER mlen,
REAL*8
dp)
\end{verbatim}
\hspace*
{
4mm
}
\begin{minipage}
[]
{
15cm
}
...
...
@@ -226,7 +226,8 @@ The function {\tt vlistInqAttTxt} gets the values(s) of a text attribute.
\begin{verbatim}
INTEGER FUNCTION vlistInqAttTxt(INTEGER vlistID, INTEGER varID,
CHARACTER*(*) name, INTEGER mlen, INTEGER tp)
CHARACTER*(*) name, INTEGER mlen,
CHARACTER*(*) tp)
\end{verbatim}
\hspace*
{
4mm
}
\begin{minipage}
[]
{
15cm
}
...
...
doc/tex/f_vlist_var.tex
View file @
38a1229c
...
...
@@ -386,7 +386,7 @@ Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate
\item
[{\tt varID}]
Variable identifier.
\item
[{\tt units}]
Units of the variable. The caller must allocate space for the
Units of the variable. The caller must allocate space for the
returned string. The maximum possible length, in characters, of
the string is given by the predefined constant
{
\tt
CDI
\_
MAX
\_
NAME
}
.
...
...
doc/tex/f_zaxis.tex
View file @
38a1229c
...
...
@@ -20,7 +20,7 @@ The type of the Z-axis, one of the set of predefined {\CDI} Z-axis types.
{
\tt
ZAXIS
\_
HYBRID
}
,
{
\tt
ZAXIS
\_
SIGMA
}
,
{
\tt
ZAXIS
\_
PRESSURE
}
,
{
\tt
ZAXIS
\_
HEIGHT
}
,
{
\tt
ZAXIS
\_
ISENTROPIC
}
,
{
\tt
ZAXIS
\_
ALTITUDE
}
,
{
\tt
ZAXIS
\_
MEANSEA
}
,
{
\tt
ZAXIS
\_
TOA
}
,
{
\tt
ZAXIS
\_
SEA
\_
BOTTOM
}
,
{
\tt
ZAXIS
\_
ATMOSPHERE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
BASE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
SNOW
}
,
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
SEA
}
and
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
LAND
}
.
\item
[{\tt size}]
Number of levels.
...
...
@@ -98,7 +98,7 @@ The valid {\CDI} Z-axis types are {\tt ZAXIS\_GENERIC}, {\tt ZAXIS\_SURFACE},
{
\tt
ZAXIS
\_
HYBRID
}
,
{
\tt
ZAXIS
\_
SIGMA
}
,
{
\tt
ZAXIS
\_
PRESSURE
}
,
{
\tt
ZAXIS
\_
HEIGHT
}
,
{
\tt
ZAXIS
\_
ISENTROPIC
}
,
{
\tt
ZAXIS
\_
ALTITUDE
}
,
{
\tt
ZAXIS
\_
MEANSEA
}
,
{
\tt
ZAXIS
\_
TOA
}
,
{
\tt
ZAXIS
\_
SEA
\_
BOTTOM
}
,
{
\tt
ZAXIS
\_
ATMOSPHERE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
BASE
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
CLOUD
\_
TOP
}
,
{
\tt
ZAXIS
\_
ISOTHERM
\_
ZERO
}
,
{
\tt
ZAXIS
\_
SNOW
}
,
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
SEA
}
and
{
\tt
ZAXIS
\_
DEPTH
\_
BELOW
\_
LAND
}
.
...
...
doc/tex/formats.tex
View file @
38a1229c
...
...
@@ -68,6 +68,7 @@ GRIB1 & GRIB2 & & \\
111
&
106
&
depthBelowLand
&
Depth below land surface
\\
112
&
106
&
depthBelowLandLayer
&
Layer between two depths below land surface
\\
113
&
107
&
theta
&
Isentropic (theta) level
\\
--
&
114
&
--
&
Snow level
\\
160
&
160
&
depthBelowSea
&
Depth below sea level
\\
\hline
\end{tabular}
...
...
doc/tex/zaxis.tex
View file @
38a1229c
...
...
@@ -21,6 +21,7 @@ The following different Z-axis types are available:
\item
[{\large\tt ZAXIS\_CLOUD\_BASE }]
Cloud base level
\item
[{\large\tt ZAXIS\_CLOUD\_TOP }]
Level of cloud tops
\item
[{\large\tt ZAXIS\_ISOTHERM\_ZERO }]
Level of 0
$^{
\circ
}$
C isotherm
\item
[{\large\tt ZAXIS\_SNOW }]
Snow level
\item
[{\large\tt ZAXIS\_DEPTH\_BELOW\_SEA }]
Depth below sea level in meters
\item
[{\large\tt ZAXIS\_DEPTH\_BELOW\_LAND}]
Depth below land surface in centimeters
\end{deflist}
...
...
src/cdi.h
View file @
38a1229c
...
...
@@ -158,7 +158,8 @@ extern "C" {
#define ZAXIS_CLOUD_BASE 16
/* Cloud base level */
#define ZAXIS_CLOUD_TOP 17
/* Level of cloud tops */
#define ZAXIS_ISOTHERM_ZERO 18
/* Level of 0o C isotherm */
#define ZAXIS_REFERENCE 19
/* zaxis reference number */
#define ZAXIS_SNOW 19
/* Snow level */
#define ZAXIS_REFERENCE 20
/* zaxis reference number */
/* TIME types */
...
...
src/gribapi.h
View file @
38a1229c
...
...
@@ -19,6 +19,7 @@
#define GRIB2_LTYPE_HYBRID 105
#define GRIB2_LTYPE_LANDDEPTH 106
#define GRIB2_LTYPE_ISENTROPIC 107
#define GRIB2_LTYPE_SNOW 114
#define GRIB2_LTYPE_REFERENCE 150
#define GRIB2_LTYPE_SEADEPTH 160
...
...
src/stream_grb.c
View file @
38a1229c
...
...
@@ -37,14 +37,14 @@ int grib1ltypeToZaxisType(int grib_ltype)
case
GRIB1_LTYPE_99
:
case
GRIB1_LTYPE_ISOBARIC
:
{
zaxistype
=
ZAXIS_PRESSURE
;
break
;
}
case
GRIB1_LTYPE_HEIGHT
:
{
zaxistype
=
ZAXIS_HEIGHT
;
break
;
}
case
GRIB1_LTYPE_ALTITUDE
:
{
zaxistype
=
ZAXIS_ALTITUDE
;
break
;
}
case
GRIB1_LTYPE_ALTITUDE
:
{
zaxistype
=
ZAXIS_ALTITUDE
;
break
;
}
case
GRIB1_LTYPE_SIGMA
:
case
GRIB1_LTYPE_SIGMA_LAYER
:
{
zaxistype
=
ZAXIS_SIGMA
;
break
;
}
case
GRIB1_LTYPE_SIGMA_LAYER
:
{
zaxistype
=
ZAXIS_SIGMA
;
break
;
}
case
GRIB1_LTYPE_HYBRID
:
case
GRIB1_LTYPE_HYBRID_LAYER
:
{
zaxistype
=
ZAXIS_HYBRID
;
break
;
}
case
GRIB1_LTYPE_HYBRID_LAYER
:
{
zaxistype
=
ZAXIS_HYBRID
;
break
;
}
case
GRIB1_LTYPE_LANDDEPTH
:
case
GRIB1_LTYPE_LANDDEPTH_LAYER
:
{
zaxistype
=
ZAXIS_DEPTH_BELOW_LAND
;
break
;
}
case
GRIB1_LTYPE_ISENTROPIC
:
{
zaxistype
=
ZAXIS_ISENTROPIC
;
break
;
}
case
GRIB1_LTYPE_ISENTROPIC
:
{
zaxistype
=
ZAXIS_ISENTROPIC
;
break
;
}
case
GRIB1_LTYPE_SEADEPTH
:
{
zaxistype
=
ZAXIS_DEPTH_BELOW_SEA
;
break
;
}
}
...
...
@@ -75,6 +75,7 @@ int grib2ltypeToZaxisType(int grib_ltype)
case
GRIB2_LTYPE_LANDDEPTH
:
/* case GRIB2_LTYPE_LANDDEPTH_LAYER: */
{
zaxistype
=
ZAXIS_DEPTH_BELOW_LAND
;
break
;
}
case
GRIB2_LTYPE_ISENTROPIC
:
{
zaxistype
=
ZAXIS_ISENTROPIC
;
break
;
}
case
GRIB2_LTYPE_SNOW
:
{
zaxistype
=
ZAXIS_SNOW
;
break
;
}
case
GRIB2_LTYPE_SEADEPTH
:
{
zaxistype
=
ZAXIS_DEPTH_BELOW_SEA
;
break
;
}
}
...
...
src/stream_gribapi.c
View file @
38a1229c
...
...
@@ -2592,6 +2592,29 @@ void gribapiDefLevelType(grib_handle *gh, int gcinit, const char *keyname, long
if
(
!
gcinit
)
GRIB_CHECK
(
grib_set_long
(
gh
,
keyname
,
leveltype
),
0
);
}
static
void
grib2DefLevel
(
grib_handle
*
gh
,
int
gcinit
,
long
leveltype
,
int
lbounds
,
double
level
,
double
dlevel1
,
double
dlevel2
)
{
long
scaled_level
;
long
factor
;
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfFirstFixedSurface"
,
leveltype
);
if
(
lbounds
)
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfSecondFixedSurface"
,
leveltype
);
if
(
!
lbounds
)
dlevel1
=
level
;
getLevelFactor
(
dlevel1
,
&
factor
,
&
scaled_level
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaleFactorOfFirstFixedSurface"
,
factor
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaledValueOfFirstFixedSurface"
,
scaled_level
),
0
);
if
(
lbounds
)
{
getLevelFactor
(
dlevel2
,
&
factor
,
&
scaled_level
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaleFactorOfSecondFixedSurface"
,
factor
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaledValueOfSecondFixedSurface"
,
scaled_level
),
0
);
}
}
static
void
gribapiDefLevel
(
int
editionNumber
,
grib_handle
*
gh
,
int
param
,
int
zaxisID
,
int
levelID
,
int
gcinit
)
{
...
...
@@ -2602,10 +2625,8 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
int
reference
;
char
uuid
[
17
];
size_t
len
;
long
scaled_level
;
long
factor
;
double
scalefactor
;
double
dlevel1
,
dlevel2
;
double
dlevel1
=
0
,
dlevel2
=
0
;
zaxistype
=
zaxisInqType
(
zaxisID
);
...
...
@@ -2715,8 +2736,6 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
{
if
(
lbounds
)
{
long
level1
,
level2
;
if
(
editionNumber
<=
1
)
gribapiDefLevelType
(
gh
,
gcinit
,
"indicatorOfTypeOfLevel"
,
GRIB1_LTYPE_HYBRID_LAYER
);
else
...
...
@@ -2725,11 +2744,8 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfSecondFixedSurface"
,
GRIB2_LTYPE_HYBRID
);
}
level1
=
zaxisInqLbound
(
zaxisID
,
levelID
);
level2
=
zaxisInqUbound
(
zaxisID
,
levelID
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"topLevel"
,
level1
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"bottomLevel"
,
level2
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"topLevel"
,
(
long
)
dlevel1
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"bottomLevel"
,
(
long
)
dlevel2
),
0
);
}
else
{
...
...
@@ -2738,7 +2754,7 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
else
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfFirstFixedSurface"
,
GRIB2_LTYPE_HYBRID
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"level"
,
level
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"level"
,
(
long
)
level
),
0
);
}
if
(
!
gcinit
)
...
...
@@ -2765,7 +2781,12 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
if
(
level
<
0
)
Warning
(
"Pressure level of %f Pa is below zero!"
,
level
);
zaxisInqUnits
(
zaxisID
,
units
);
if
(
memcmp
(
units
,
"Pa"
,
2
)
!=
0
)
level
*=
100
;
if
(
memcmp
(
units
,
"Pa"
,
2
)
!=
0
)
{
level
*=
100
;
dlevel1
*=
100
;
dlevel2
*=
100
;
}
if
(
editionNumber
<=
1
)
{
...
...
@@ -2781,21 +2802,20 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
}
else
{
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfFirstFixedSurface"
,
GRIB2_LTYPE_ISOBARIC
);
if
(
lbounds
)
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfSecondFixedSurface"
,
GRIB2_LTYPE_ISOBARIC
);
getLevelFactor
(
dlevel1
,
&
factor
,
&
scaled_level
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaleFactorOfFirstFixedSurface"
,
factor
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaledValueOfFirstFixedSurface"
,
scaled_level
),
0
);
if
(
lbounds
)
{
getLevelFactor
(
dlevel2
,
&
factor
,
&
scaled_level
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaleFactorOfSecondFixedSurface"
,
factor
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaledValueOfSecondFixedSurface"
,
scaled_level
),
0
);
}
grib2DefLevel
(
gh
,
gcinit
,
GRIB2_LTYPE_ISOBARIC
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
}
break
;
}
case
ZAXIS_SNOW
:
{
if
(
editionNumber
<=
1
)
;
// not available
else
{
grib2DefLevel
(
gh
,
gcinit
,
GRIB2_LTYPE_SNOW
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
}
break
;
}
case
ZAXIS_HEIGHT
:
...
...
@@ -2854,21 +2874,11 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID,
else
if
(
memcmp
(
units
,
"dm"
,
2
)
==
0
)
scalefactor
=
0
.
1
;
else
scalefactor
=
1
;
// meter
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfFirstFixedSurface"
,
GRIB2_LTYPE_LANDDEPTH
);
if
(
lbounds
)
gribapiDefLevelType
(
gh
,
gcinit
,
"typeOfSecondFixedSurface"
,
GRIB2_LTYPE_LANDDEPTH
);
level
*=
scalefactor
;
dlevel1
*=
scalefactor
;
dlevel1
*=
scalefactor
;
getLevelFactor
(
dlevel1
,
&
factor
,
&
scaled_level
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaleFactorOfFirstFixedSurface"
,
factor
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaledValueOfFirstFixedSurface"
,
scaled_level
),
0
);
if
(
lbounds
)
{
dlevel2
*=
scalefactor
;
getLevelFactor
(
dlevel2
,
&
factor
,
&
scaled_level
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaleFactorOfSecondFixedSurface"
,
factor
),
0
);
GRIB_CHECK
(
grib_set_long
(
gh
,
"scaledValueOfSecondFixedSurface"
,
scaled_level
),
0
);
}
grib2DefLevel
(
gh
,
gcinit
,
GRIB2_LTYPE_LANDDEPTH
,
lbounds
,
level
,
dlevel1
,
dlevel2
);
}
break
;
...
...
src/zaxis.c
View file @
38a1229c
...
...
@@ -47,7 +47,8 @@ ZaxistypeEntry[] = {
{
/* 16 */
0
,
"cloudbase"
,
"cloud_base"
,
""
,
""
},
{
/* 17 */
0
,
"cloudtop"
,
"cloud_top"
,
""
,
""
},
{
/* 18 */
0
,
"isotherm0"
,
"isotherm_zero"
,
""
,
""
},
{
/* 19 */
0
,
"height"
,
"generalized height"
,
"height"
,
"m"
},
{
/* 19 */
0
,
"snow"
,
"snow"
,
""
,
""
},
{
/* 20 */
0
,
"height"
,
"generalized height"
,
"height"
,
"m"
},
};
static
int
CDI_MaxZaxistype
=
sizeof
(
ZaxistypeEntry
)
/
sizeof
(
ZaxistypeEntry
[
0
]);
...
...
@@ -183,7 +184,7 @@ int zaxisSize(void)
@func{ZAXIS_HYBRID}, @func{ZAXIS_SIGMA}, @func{ZAXIS_PRESSURE}, @func{ZAXIS_HEIGHT},
@func{ZAXIS_ISENTROPIC}, @func{ZAXIS_ALTITUDE}, @func{ZAXIS_MEANSEA}, @func{ZAXIS_TOA},
@func{ZAXIS_SEA_BOTTOM}, @func{ZAXIS_ATMOSPHERE}, @func{ZAXIS_CLOUD_BASE},
@func{ZAXIS_CLOUD_TOP}, @func{ZAXIS_ISOTHERM_ZERO},
@func{ZAXIS_CLOUD_TOP}, @func{ZAXIS_ISOTHERM_ZERO},
@func{ZAXIS_SNOW},
@func{ZAXIS_DEPTH_BELOW_SEA} and @func{ZAXIS_DEPTH_BELOW_LAND}.
@Item size Number of levels.
...
...
@@ -995,7 +996,7 @@ The valid CDI Z-axis types are @func{ZAXIS_GENERIC}, @func{ZAXIS_SURFACE},
@func{ZAXIS_HYBRID}, @func{ZAXIS_SIGMA}, @func{ZAXIS_PRESSURE}, @func{ZAXIS_HEIGHT},
@func{ZAXIS_ISENTROPIC}, @func{ZAXIS_ALTITUDE}, @func{ZAXIS_MEANSEA}, @func{ZAXIS_TOA},
@func{ZAXIS_SEA_BOTTOM}, @func{ZAXIS_ATMOSPHERE}, @func{ZAXIS_CLOUD_BASE},
@func{ZAXIS_CLOUD_TOP}, @func{ZAXIS_ISOTHERM_ZERO},
@func{ZAXIS_CLOUD_TOP}, @func{ZAXIS_ISOTHERM_ZERO},
@func{ZAXIS_SNOW},
@func{ZAXIS_DEPTH_BELOW_SEA} and @func{ZAXIS_DEPTH_BELOW_LAND}.
@EndFunction
...
...
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