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
288ee20d
Commit
288ee20d
authored
Aug 27, 2020
by
Uwe Schulzweida
Browse files
Renamed set_zaxistype() to cdf_set_zaxistype().
parent
04d62998
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cdf_util.c
View file @
288ee20d
#include
<string.h>
#include
<ctype.h>
#include
"dmemory.h"
#include
"cdi.h"
#include
"cdi_int.h"
#include
"cdf_util.h"
#include
"error.h"
...
...
@@ -307,25 +309,25 @@ void set_gridtype(const char *attstring, int *gridtype)
}
void
set_zaxistype
(
const
char
*
attstring
,
int
*
zaxistype
)
void
cdf_
set_zaxistype
(
const
char
*
attstring
,
int
*
zaxistype
)
{
// clang-format off
if
(
str
cmp
(
attstring
,
"toa"
)
==
0
)
*
zaxistype
=
ZAXIS_TOA
;
else
if
(
str
cmp
(
attstring
,
"tropopause"
)
==
0
)
*
zaxistype
=
ZAXIS_TROPOPAUSE
;
else
if
(
str
cmp
(
attstring
,
"cloudbase"
)
==
0
)
*
zaxistype
=
ZAXIS_CLOUD_BASE
;
else
if
(
str
cmp
(
attstring
,
"cloudtop"
)
==
0
)
*
zaxistype
=
ZAXIS_CLOUD_TOP
;
else
if
(
str
cmp
(
attstring
,
"isotherm0"
)
==
0
)
*
zaxistype
=
ZAXIS_ISOTHERM_ZERO
;
else
if
(
str
cmp
(
attstring
,
"seabottom"
)
==
0
)
*
zaxistype
=
ZAXIS_SEA_BOTTOM
;
else
if
(
str
cmp
(
attstring
,
"lakebottom"
)
==
0
)
*
zaxistype
=
ZAXIS_LAKE_BOTTOM
;
else
if
(
str
cmp
(
attstring
,
"sedimentbottom"
)
==
0
)
*
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM
;
else
if
(
str
cmp
(
attstring
,
"sedimentbottomta"
)
==
0
)
*
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM_TA
;
else
if
(
str
cmp
(
attstring
,
"sedimentbottomtw"
)
==
0
)
*
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM_TW
;
else
if
(
str
cmp
(
attstring
,
"mixlayer"
)
==
0
)
*
zaxistype
=
ZAXIS_MIX_LAYER
;
else
if
(
str
cmp
(
attstring
,
"atmosphere"
)
==
0
)
*
zaxistype
=
ZAXIS_ATMOSPHERE
;
if
(
str
IsEqual
(
attstring
,
"toa"
)
)
*
zaxistype
=
ZAXIS_TOA
;
else
if
(
str
IsEqual
(
attstring
,
"tropopause"
)
)
*
zaxistype
=
ZAXIS_TROPOPAUSE
;
else
if
(
str
IsEqual
(
attstring
,
"cloudbase"
)
)
*
zaxistype
=
ZAXIS_CLOUD_BASE
;
else
if
(
str
IsEqual
(
attstring
,
"cloudtop"
)
)
*
zaxistype
=
ZAXIS_CLOUD_TOP
;
else
if
(
str
IsEqual
(
attstring
,
"isotherm0"
)
)
*
zaxistype
=
ZAXIS_ISOTHERM_ZERO
;
else
if
(
str
IsEqual
(
attstring
,
"seabottom"
)
)
*
zaxistype
=
ZAXIS_SEA_BOTTOM
;
else
if
(
str
IsEqual
(
attstring
,
"lakebottom"
)
)
*
zaxistype
=
ZAXIS_LAKE_BOTTOM
;
else
if
(
str
IsEqual
(
attstring
,
"sedimentbottom"
)
)
*
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM
;
else
if
(
str
IsEqual
(
attstring
,
"sedimentbottomta"
))
*
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM_TA
;
else
if
(
str
IsEqual
(
attstring
,
"sedimentbottomtw"
))
*
zaxistype
=
ZAXIS_SEDIMENT_BOTTOM_TW
;
else
if
(
str
IsEqual
(
attstring
,
"mixlayer"
)
)
*
zaxistype
=
ZAXIS_MIX_LAYER
;
else
if
(
str
IsEqual
(
attstring
,
"atmosphere"
)
)
*
zaxistype
=
ZAXIS_ATMOSPHERE
;
else
{
static
bool
warn
=
true
;
if
(
warn
)
if
(
warn
)
{
warn
=
false
;
Warning
(
"NetCDF attribute level_type='%s' unsupported!"
,
attstring
);
...
...
@@ -338,15 +340,15 @@ void set_zaxistype(const char *attstring, int *zaxistype)
void
set_calendar
(
const
char
*
attstring
,
int
*
calendar
)
{
// clang-format off
if
(
strStartsWith
(
attstring
,
"standard"
)
)
*
calendar
=
CALENDAR_STANDARD
;
else
if
(
strStartsWith
(
attstring
,
"gregorian"
)
)
*
calendar
=
CALENDAR_GREGORIAN
;
else
if
(
strStartsWith
(
attstring
,
"none"
)
)
*
calendar
=
CALENDAR_NONE
;
else
if
(
strStartsWith
(
attstring
,
"proleptic"
)
)
*
calendar
=
CALENDAR_PROLEPTIC
;
else
if
(
strStartsWith
(
attstring
,
"360"
)
)
*
calendar
=
CALENDAR_360DAYS
;
else
if
(
strStartsWith
(
attstring
,
"365"
)
||
strStartsWith
(
attstring
,
"noleap"
)
)
*
calendar
=
CALENDAR_365DAYS
;
else
if
(
strStartsWith
(
attstring
,
"366"
)
||
strStartsWith
(
attstring
,
"all_leap"
)
)
*
calendar
=
CALENDAR_366DAYS
;
if
(
strStartsWith
(
attstring
,
"standard"
))
*
calendar
=
CALENDAR_STANDARD
;
else
if
(
strStartsWith
(
attstring
,
"gregorian"
))
*
calendar
=
CALENDAR_GREGORIAN
;
else
if
(
strStartsWith
(
attstring
,
"none"
))
*
calendar
=
CALENDAR_NONE
;
else
if
(
strStartsWith
(
attstring
,
"proleptic"
))
*
calendar
=
CALENDAR_PROLEPTIC
;
else
if
(
strStartsWith
(
attstring
,
"360"
))
*
calendar
=
CALENDAR_360DAYS
;
else
if
(
strStartsWith
(
attstring
,
"365"
)
||
strStartsWith
(
attstring
,
"noleap"
))
*
calendar
=
CALENDAR_365DAYS
;
else
if
(
strStartsWith
(
attstring
,
"366"
)
||
strStartsWith
(
attstring
,
"all_leap"
))
*
calendar
=
CALENDAR_366DAYS
;
else
Warning
(
"calendar >%s< unsupported!"
,
attstring
);
// clang-format on
}
src/cdf_util.h
View file @
288ee20d
...
...
@@ -22,7 +22,7 @@ bool is_x_axis(const char *units, const char *stdname);
bool
is_y_axis
(
const
char
*
units
,
const
char
*
stdname
);
void
set_gridtype
(
const
char
*
attstring
,
int
*
gridtype
);
void
set_zaxistype
(
const
char
*
attstring
,
int
*
zaxistype
);
void
cdf_
set_zaxistype
(
const
char
*
attstring
,
int
*
zaxistype
);
void
set_calendar
(
const
char
*
attstring
,
int
*
calendar
);
#endif
src/stream_cdf_i.c
View file @
288ee20d
...
...
@@ -1282,7 +1282,7 @@ void cdfScanVarAttr(int nvars, ncvar_t *ncvars, int ndims, ncdim_t *ncdims, int
else
if
(
isText
&&
strIsEqual
(
attname
,
"level_type"
)
)
{
strToLower
(
attstring
);
set_zaxistype
(
attstring
,
&
ncvars
[
ncvarid
].
zaxistype
);
cdf_
set_zaxistype
(
attstring
,
&
ncvars
[
ncvarid
].
zaxistype
);
cdf_set_var
(
ncvars
,
ncvarid
,
TRUE
);
}
else
if
(
isNumber
&&
strIsEqual
(
attname
,
"trunc_count"
)
)
...
...
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