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
a1106bb2
Commit
a1106bb2
authored
Aug 14, 2015
by
Uwe Schulzweida
Browse files
added function zaxisDefPsName()/zaxisInqPsName()
parent
32bd4ec9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
a1106bb2
...
...
@@ -971,6 +971,12 @@ void zaxisInqUnits(int zaxisID, char *units);
/* zaxisInqStdname: Get the standard name of a Z-axis */
void
zaxisInqStdname
(
int
zaxisID
,
char
*
stdname
);
/* zaxisDefPsName: Define the name of the surface pressure variable of a hybrid sigma pressure Z-axis */
void
zaxisDefPsName
(
int
zaxisID
,
const
char
*
psname_optional
);
/* zaxisInqPsName: Get the name of the surface pressure variable of a hybrid sigma pressure Z-axis */
void
zaxisInqPsName
(
int
zaxisID
,
char
*
psname
);
void
zaxisDefPrec
(
int
zaxisID
,
int
prec
);
int
zaxisInqPrec
(
int
zaxisID
);
...
...
src/stream_cdf.c
View file @
a1106bb2
...
...
@@ -7021,9 +7021,9 @@ void define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
int
zdimid
=
UNDEFID
;
int
zvarid
=
UNDEFID
;
int
zsize
=
1
;
int
zaxisType
;
double
*
lbounds
=
NULL
;
double
*
ubounds
=
NULL
;
int
zaxisType
;
positive
=
0
;
...
...
@@ -7137,7 +7137,7 @@ void define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
zaxisDefUUID
(
ncvars
[
ncvarid
].
zaxisID
,
uuidOfVGrid
);
}
//
if ( zaxisType == ZAXIS_HYBRID && psvar
ID
!= -1 ) zaxisDefPs
n
ame(ncvars[ncvarid].zaxisID, ncvars[psvarid].name);
if
(
zaxisType
==
ZAXIS_HYBRID
&&
psvar
id
!=
-
1
)
zaxisDefPs
N
ame
(
ncvars
[
ncvarid
].
zaxisID
,
ncvars
[
psvarid
].
name
);
if
(
positive
>
0
)
zaxisDefPositive
(
ncvars
[
ncvarid
].
zaxisID
,
positive
);
...
...
src/zaxis.c
View file @
a1106bb2
...
...
@@ -68,6 +68,7 @@ typedef struct {
char
longname
[
CDI_MAX_NAME
];
char
stdname
[
CDI_MAX_NAME
];
char
units
[
CDI_MAX_NAME
];
char
psname
[
CDI_MAX_NAME
];
double
*
vals
;
double
*
lbounds
;
double
*
ubounds
;
...
...
@@ -87,7 +88,7 @@ typedef struct {
}
zaxis_t
;
static
int
zaxisCompareP
(
zaxis_t
*
z1
,
zaxis_t
*
z2
);
static
int
zaxisCompareP
(
zaxis_t
*
z1
,
zaxis_t
*
z2
);
static
void
zaxisDestroyP
(
void
*
zaxisptr
);
static
void
zaxisPrintP
(
void
*
zaxisptr
,
FILE
*
fp
);
static
int
zaxisGetPackSize
(
void
*
zaxisptr
,
void
*
context
);
...
...
@@ -138,6 +139,7 @@ void zaxisDefaultValue(zaxis_t *zaxisptr)
zaxisptr
->
longname
[
0
]
=
0
;
zaxisptr
->
stdname
[
0
]
=
0
;
zaxisptr
->
units
[
0
]
=
0
;
zaxisptr
->
psname
[
0
]
=
0
;
zaxisptr
->
vals
=
NULL
;
zaxisptr
->
ubounds
=
NULL
;
zaxisptr
->
lbounds
=
NULL
;
...
...
@@ -428,6 +430,19 @@ void zaxisDefUnits(int zaxisID, const char *units)
}
}
void
zaxisDefPsName
(
int
zaxisID
,
const
char
*
psname
)
{
zaxis_t
*
zaxisptr
=
zaxisID2Ptr
(
zaxisID
);
if
(
psname
)
{
strncpy
(
zaxisptr
->
psname
,
psname
,
CDI_MAX_NAME
-
1
);
zaxisptr
->
name
[
CDI_MAX_NAME
-
1
]
=
'\0'
;
reshSetStatus
(
zaxisID
,
&
zaxisOps
,
RESH_DESYNC_IN_USE
);
}
}
/*
@Function zaxisInqName
@Title Get the name of a Z-axis
...
...
@@ -511,6 +526,13 @@ void zaxisInqStdname(int zaxisID, char *stdname)
}
void
zaxisInqPsName
(
int
zaxisID
,
char
*
psname
)
{
zaxis_t
*
zaxisptr
=
zaxisID2Ptr
(
zaxisID
);
strcpy
(
psname
,
zaxisptr
->
psname
);
}
void
zaxisDefPrec
(
int
zaxisID
,
int
prec
)
{
zaxis_t
*
zaxisptr
=
zaxisID2Ptr
(
zaxisID
);
...
...
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