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
cdo
Commits
4be72e83
Commit
4be72e83
authored
Apr 08, 2020
by
Uwe Schulzweida
Browse files
Replaced zaxisInqStdname() by cdiInqKeyString().
parent
b3fc0639
Pipeline
#2525
passed with stages
in 15 minutes and 22 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Filedes.cc
View file @
4be72e83
...
...
@@ -78,7 +78,7 @@ cdoPrintAttributes(FILE *fp, int cdiID, int varID, int nblanks)
}
else
if
(
atttype
==
CDI_DATATYPE_TXT
)
{
std
::
vector
<
char
>
atttxt
(
attlen
);
std
::
vector
<
char
>
atttxt
(
attlen
+
1
);
cdiInqAttTxt
(
cdiID
,
varID
,
attname
,
attlen
,
atttxt
.
data
());
atttxt
[
attlen
]
=
0
;
fprintf
(
fp
,
"%*s"
,
nblanks
,
""
);
...
...
@@ -92,11 +92,11 @@ printSource(FILE *fp, int vlistID, int varID)
{
// institute info
const
auto
instptr
=
institutInqLongnamePtr
(
vlistInqVarInstitut
(
vlistID
,
varID
));
if
(
instptr
)
fprintf
(
fp
,
" institution =
%s
\n
"
,
instptr
);
if
(
instptr
)
fprintf
(
fp
,
" institution =
\"
%s
\"
\n
"
,
instptr
);
// source info
const
auto
modelptr
=
modelInqNamePtr
(
vlistInqVarModel
(
vlistID
,
varID
));
if
(
modelptr
)
fprintf
(
fp
,
" source =
%s
\n
"
,
modelptr
);
if
(
modelptr
)
fprintf
(
fp
,
" source =
\"
%s
\"
\n
"
,
modelptr
);
}
static
void
...
...
@@ -187,7 +187,7 @@ partab(FILE *fp, CdoStreamID streamID, const int option)
if
(
natts
>
0
)
{
fprintf
(
fp
,
"¶meter
\n
"
);
fprintf
(
fp
,
" name
=
_GLOBAL_
\n
"
);
fprintf
(
fp
,
" name
=
_GLOBAL_
\n
"
);
printSource
(
fp
,
vlistID
,
0
);
cdoPrintAttributes
(
fp
,
vlistID
,
CDI_GLOBAL
,
2
);
fprintf
(
fp
,
"/
\n
"
);
...
...
@@ -210,12 +210,12 @@ partab(FILE *fp, CdoStreamID streamID, const int option)
{
fprintf
(
fp
,
"¶meter"
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
" name
=
_default_"
);
fprintf
(
fp
,
" name
=
_default_"
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
auto
datatypestr
=
cdi_datatype2str
(
datatype
);
if
(
*
datatypestr
)
{
fprintf
(
fp
,
" datatype
=
%s"
,
datatypestr
);
fprintf
(
fp
,
" datatype
=
%s"
,
datatypestr
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
fprintf
(
fp
,
" /
\n
"
);
...
...
@@ -244,22 +244,22 @@ partab(FILE *fp, CdoStreamID streamID, const int option)
if
(
param
>=
0
)
{
cdiParamToString
(
param
,
paramstr
,
sizeof
(
paramstr
));
fprintf
(
fp
,
" param
=
%s"
,
paramstr
);
fprintf
(
fp
,
" param
=
%s"
,
paramstr
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
if
(
strlen
(
varstdname
))
{
fprintf
(
fp
,
" standard_name
=
%s"
,
varstdname
);
fprintf
(
fp
,
" standard_name
=
%s"
,
varstdname
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
if
(
strlen
(
varlongname
))
{
fprintf
(
fp
,
" long_name
=
\"
%s
\"
"
,
varlongname
);
fprintf
(
fp
,
" long_name
=
\"
%s
\"
"
,
varlongname
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
if
(
strlen
(
varunits
))
{
fprintf
(
fp
,
" units
=
\"
%s
\"
"
,
varunits
);
fprintf
(
fp
,
" units
=
\"
%s
\"
"
,
varunits
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
...
...
@@ -268,7 +268,7 @@ partab(FILE *fp, CdoStreamID streamID, const int option)
auto
datatypestr
=
cdi_datatype2str
(
vlistInqVarDatatype
(
vlistID
,
varID
));
if
(
*
datatypestr
)
{
fprintf
(
fp
,
" datatype
=
%s"
,
datatypestr
);
fprintf
(
fp
,
" datatype
=
%s"
,
datatypestr
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
}
...
...
@@ -276,7 +276,7 @@ partab(FILE *fp, CdoStreamID streamID, const int option)
int
uvRelativeToGrid
=
0
;
if
(
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_UVRELATIVETOGRID
,
&
uvRelativeToGrid
)
==
CDI_NOERR
)
{
fprintf
(
fp
,
" uvRelativeToGrid
=
%d"
,
uvRelativeToGrid
);
fprintf
(
fp
,
" uvRelativeToGrid
=
%d"
,
uvRelativeToGrid
);
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
...
...
@@ -291,8 +291,11 @@ partab(FILE *fp, CdoStreamID streamID, const int option)
if
(
linebreak
)
fprintf
(
fp
,
"
\n
"
);
}
if
(
option
==
2
)
fprintf
(
fp
,
" missing_value=%g
\n
"
,
missval
);
if
(
option
==
2
)
cdoPrintAttributes
(
fp
,
vlistID
,
varID
,
2
);
if
(
option
==
2
)
{
fprintf
(
fp
,
" missing_value=%g
\n
"
,
missval
);
cdoPrintAttributes
(
fp
,
vlistID
,
varID
,
2
);
}
if
(
!
linebreak
)
fprintf
(
fp
,
" "
);
fprintf
(
fp
,
"/
\n
"
);
...
...
src/Vertintap.cc
View file @
4be72e83
...
...
@@ -43,8 +43,10 @@ is_height_axis(int zaxisID, int nlevel)
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_REFERENCE
)
{
char
units
[
CDI_MAX_NAME
],
stdname
[
CDI_MAX_NAME
];
zaxisInqUnits
(
zaxisID
,
units
);
zaxisInqStdname
(
zaxisID
,
stdname
);
int
length
=
CDI_MAX_NAME
;
cdiInqKeyString
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_UNITS
,
units
,
&
length
);
length
=
CDI_MAX_NAME
;
cdiInqKeyString
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_STDNAME
,
stdname
,
&
length
);
if
(
cstrIsEqual
(
stdname
,
"height"
)
&&
*
units
==
0
)
isheight
=
true
;
}
}
...
...
src/pipe.cc
View file @
4be72e83
...
...
@@ -134,7 +134,7 @@ constexpr std::chrono::milliseconds TIMEOUT = std::chrono::milliseconds(1000);
int
processNumsActive
(
void
);
int
pipe_t
::
pipeInqVlist
(
int
p_vlistID
)
pipe_t
::
pipeInqVlist
(
int
&
p_vlistID
)
{
Debug
(
PIPE
,
"Inquiring vlist for vlistID: %d"
,
p_vlistID
);
std
::
chrono
::
milliseconds
time_to_wait
(
0
);
...
...
src/pipe.h
View file @
4be72e83
...
...
@@ -39,7 +39,7 @@ struct pipe_t
{
public:
pipe_t
();
int
pipeInqVlist
(
int
vlistID
);
int
pipeInqVlist
(
int
&
vlistID
);
void
pipe_init
();
void
pipeDefRecord
(
int
p_varId
,
int
p_levelID
);
void
pipeDefTimestep
(
int
p_vlistID
,
int
tsID
);
...
...
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