Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
2d9cd48a
Commit
2d9cd48a
authored
2 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Use CDI_COMPRESS_FILTER
parent
23771316
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!34
Version 2.2.0
,
!29
M214003/develop
Pipeline
#29624
passed
2 years ago
Stage: external
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/cdi.c
+2
-4
2 additions, 4 deletions
app/cdi.c
app/printinfo.c
+37
-37
37 additions, 37 deletions
app/printinfo.c
with
39 additions
and
41 deletions
app/cdi.c
+
2
−
4
View file @
2d9cd48a
...
...
@@ -447,10 +447,8 @@ printShortinfo(int streamID, int vlistID, int vardis)
fprintf
(
stdout
,
" %-3s"
,
pstr
);
if
(
vlistInqVarCompType
(
vlistID
,
varID
)
==
CDI_COMPRESS_NONE
)
fprintf
(
stdout
,
" "
);
else
fprintf
(
stdout
,
"z "
);
bool
isCompressed
=
(
vlistInqVarCompType
(
vlistID
,
varID
)
!=
CDI_COMPRESS_NONE
);
fprintf
(
stdout
,
"%c "
,
isCompressed
?
'z'
:
' '
);
// parameter info
fprintf
(
stdout
,
": "
);
...
...
This diff is collapsed.
Click to expand it.
app/printinfo.c
+
37
−
37
View file @
2d9cd48a
...
...
@@ -36,7 +36,7 @@ time2str(CdiTime time, char *timestr, int maxlen)
char
*
envString
=
getenv
(
"CDI_MS_DIGITS"
);
if
(
envString
)
{
const
int
ival
=
atol
(
envString
);
int
ival
=
atol
(
envString
);
if
(
ival
>
0
)
msDigitsNum
=
ival
;
if
(
ival
>
3
)
msDigitsNum
=
3
;
}
...
...
@@ -53,16 +53,17 @@ const char *
comp_name
(
int
comptype
)
{
if
(
comptype
==
CDI_COMPRESS_SZIP
)
return
"szip"
;
if
(
comptype
==
CDI_COMPRESS_AEC
)
return
"aec"
;
if
(
comptype
==
CDI_COMPRESS_ZIP
)
return
"zip"
;
if
(
comptype
==
CDI_COMPRESS_JPEG
)
return
"jpeg"
;
if
(
comptype
==
CDI_COMPRESS_
AEC
)
return
"
aec
"
;
if
(
comptype
==
CDI_COMPRESS_
FILTER
)
return
"
filter
"
;
return
" "
;
}
void
printFiletype
(
int
streamID
,
int
vlistID
)
{
const
int
filetype
=
streamInqFiletype
(
streamID
);
int
filetype
=
streamInqFiletype
(
streamID
);
// clang-format off
switch
(
filetype
)
...
...
@@ -92,13 +93,13 @@ printFiletype(int streamID, int vlistID)
}
// clang-format on
const
int
nvars
=
vlistNvars
(
vlistID
);
const
int
comps
[]
=
{
CDI_COMPRESS_ZIP
,
CDI_COMPRESS_
JPEG
,
CDI_COMPRESS_
S
ZIP
,
CDI_COMPRESS_
AEC
};
int
nvars
=
vlistNvars
(
vlistID
);
const
int
comps
[]
=
{
CDI_COMPRESS_
S
ZIP
,
CDI_COMPRESS_
AEC
,
CDI_COMPRESS_ZIP
,
CDI_COMPRESS_
JPEG
,
CDI_COMPRESS_FILTER
};
unsigned
kk
=
0
;
for
(
unsigned
k
=
0
;
k
<
sizeof
(
comps
)
/
sizeof
(
int
);
++
k
)
for
(
int
varID
=
0
;
varID
<
nvars
;
varID
++
)
{
const
int
comptype
=
vlistInqVarCompType
(
vlistID
,
varID
);
int
comptype
=
vlistInqVarCompType
(
vlistID
,
varID
);
if
(
comptype
==
comps
[
k
])
{
printf
(
"%c%s"
,
(
kk
++
==
0
)
?
' '
:
'/'
,
comp_name
(
comptype
));
...
...
@@ -112,7 +113,7 @@ printFiletype(int streamID, int vlistID)
static
void
print_xvals
(
int
gridID
,
int
dig
)
{
const
size_t
xsize
=
gridInqXsize
(
gridID
);
size_t
xsize
=
gridInqXsize
(
gridID
);
if
(
xsize
>
0
&&
gridInqXvals
(
gridID
,
NULL
))
{
char
xname
[
CDI_MAX_NAME
],
xunits
[
CDI_MAX_NAME
];
...
...
@@ -137,7 +138,7 @@ print_xvals(int gridID, int dig)
static
void
print_yvals
(
int
gridID
,
int
dig
)
{
const
size_t
ysize
=
gridInqYsize
(
gridID
);
size_t
ysize
=
gridInqYsize
(
gridID
);
if
(
ysize
>
0
&&
gridInqYvals
(
gridID
,
NULL
))
{
char
yname
[
CDI_MAX_NAME
],
yunits
[
CDI_MAX_NAME
];
...
...
@@ -152,7 +153,7 @@ print_yvals(int gridID, int dig)
fprintf
(
stdout
,
"%33s : %.*g"
,
yname
,
dig
,
yfirst
);
if
(
ysize
>
1
)
{
const
int
gridtype
=
gridInqType
(
gridID
);
int
gridtype
=
gridInqType
(
gridID
);
fprintf
(
stdout
,
" to %.*g"
,
dig
,
ylast
);
if
(
IS_NOT_EQUAL
(
yinc
,
0
)
&&
gridtype
!=
GRID_GAUSSIAN
&&
gridtype
!=
GRID_GAUSSIAN_REDUCED
)
fprintf
(
stdout
,
" by %.*g"
,
dig
,
yinc
);
...
...
@@ -176,7 +177,7 @@ print_xyvals2D(int gridID, int dig)
length
=
CDI_MAX_NAME
;
cdiInqKeyString
(
gridID
,
CDI_YAXIS
,
CDI_KEY_UNITS
,
yunits
,
&
length
);
const
size_t
gridsize
=
gridInqSize
(
gridID
);
size_t
gridsize
=
gridInqSize
(
gridID
);
double
*
xvals2D
=
(
double
*
)
malloc
(
gridsize
*
sizeof
(
double
));
double
*
yvals2D
=
(
double
*
)
malloc
(
gridsize
*
sizeof
(
double
));
...
...
@@ -200,8 +201,8 @@ print_xyvals2D(int gridID, int dig)
int
gridtype
=
gridInqType
(
gridID
);
if
(
gridtype
==
GRID_CURVILINEAR
)
{
const
size_t
xsize
=
gridInqXsize
(
gridID
);
const
size_t
ysize
=
gridInqYsize
(
gridID
);
size_t
xsize
=
gridInqXsize
(
gridID
);
size_t
ysize
=
gridInqYsize
(
gridID
);
if
(
xsize
>
1
)
{
double
*
xvals
=
(
double
*
)
malloc
((
size_t
)
xsize
*
sizeof
(
double
));
...
...
@@ -273,7 +274,7 @@ printGridNp(int gridtype, int gridID, size_t gridsize, size_t xsize, size_t ysiz
else
if
(
xsize
&&
ysize
)
fprintf
(
stdout
,
" (%zux%zu)"
,
xsize
,
ysize
);
const
int
numLPE
=
gridInqNP
(
gridID
);
int
numLPE
=
gridInqNP
(
gridID
);
if
(
numLPE
>
0
)
{
if
(
gridtype
==
GRID_GAUSSIAN
)
fprintf
(
stdout
,
" F%d"
,
numLPE
);
...
...
@@ -291,10 +292,10 @@ printGridInfoKernel(int gridID, int index, bool lproj)
if
(
lproj
&&
gridtype
!=
GRID_PROJECTION
)
fprintf
(
stderr
,
"Internal problem (%s): sub grid not equal GRID_PROJECTION!
\n
"
,
__func__
);
const
int
trunc
=
gridInqTrunc
(
gridID
);
const
size_t
gridsize
=
gridInqSize
(
gridID
);
const
size_t
xsize
=
gridInqXsize
(
gridID
);
const
size_t
ysize
=
gridInqYsize
(
gridID
);
int
trunc
=
gridInqTrunc
(
gridID
);
size_t
gridsize
=
gridInqSize
(
gridID
);
size_t
xsize
=
gridInqXsize
(
gridID
);
size_t
ysize
=
gridInqYsize
(
gridID
);
// int prec = gridInqDatatype(gridID);
// int dig = (prec == CDI_DATATYPE_FLT64) ? 15 : 7;
...
...
@@ -364,8 +365,8 @@ printGridInfoKernel(int gridID, int index, bool lproj)
if
(
gridtype
==
GRID_UNSTRUCTURED
)
{
const
int
number
=
gridInqNumber
(
gridID
);
const
int
position
=
gridInqPosition
(
gridID
);
int
number
=
gridInqNumber
(
gridID
);
int
position
=
gridInqPosition
(
gridID
);
if
(
number
>
0
)
fprintf
(
stdout
,
"%33s : number=%d position=%d
\n
"
,
"grid"
,
number
,
position
);
if
(
gridInqReference
(
gridID
,
NULL
))
...
...
@@ -412,18 +413,18 @@ printGridInfoKernel(int gridID, int index, bool lproj)
void
printGridInfo
(
int
vlistID
)
{
const
int
ngrids
=
vlistNgrids
(
vlistID
);
int
ngrids
=
vlistNgrids
(
vlistID
);
for
(
int
index
=
0
;
index
<
ngrids
;
index
++
)
{
const
int
gridID
=
vlistGrid
(
vlistID
,
index
);
int
gridID
=
vlistGrid
(
vlistID
,
index
);
printGridInfoKernel
(
gridID
,
index
,
false
);
const
int
projID
=
gridInqProj
(
gridID
);
int
projID
=
gridInqProj
(
gridID
);
if
(
projID
!=
CDI_UNDEFID
)
printGridInfoKernel
(
projID
,
index
,
true
);
}
}
static
void
printZaxisBoundsInfo
(
const
int
zaxisID
,
const
int
dig
,
const
int
levelsize
,
const
double
zinc
,
const
char
*
zunits
)
printZaxisBoundsInfo
(
int
zaxisID
,
int
dig
,
int
levelsize
,
const
double
zinc
,
const
char
*
zunits
)
{
double
level1
=
zaxisInqLbound
(
zaxisID
,
0
);
double
level2
=
zaxisInqUbound
(
zaxisID
,
0
);
...
...
@@ -439,8 +440,7 @@ printZaxisBoundsInfo(const int zaxisID, const int dig, const int levelsize, cons
}
static
void
printZaxisLevelInfo
(
const
int
levelsize
,
const
int
zaxisID
,
const
int
zaxistype
,
double
zinc
,
const
int
dig
,
const
char
*
zname
,
const
char
*
zunits
)
printZaxisLevelInfo
(
int
levelsize
,
int
zaxisID
,
int
zaxistype
,
double
zinc
,
int
dig
,
const
char
*
zname
,
const
char
*
zunits
)
{
double
*
levels
=
(
double
*
)
malloc
((
size_t
)
levelsize
*
sizeof
(
double
));
zaxisInqLevels
(
zaxisID
,
levels
);
...
...
@@ -473,12 +473,12 @@ printZaxisLevelInfo(const int levelsize, const int zaxisID, const int zaxistype,
}
static
void
printZaxisHybridInfo
(
const
int
zaxisID
)
printZaxisHybridInfo
(
int
zaxisID
)
{
char
psname
[
CDI_MAX_NAME
];
int
length
=
CDI_MAX_NAME
;
cdiInqKeyString
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_PSNAME
,
psname
,
&
length
);
const
int
vctsize
=
zaxisInqVctSize
(
zaxisID
);
int
vctsize
=
zaxisInqVctSize
(
zaxisID
);
if
(
vctsize
||
psname
[
0
])
{
fprintf
(
stdout
,
"%33s :%s%s%s
\n
"
,
"available"
,
vctsize
?
" vct"
:
""
,
psname
[
0
]
?
" ps: "
:
""
,
psname
);
...
...
@@ -486,7 +486,7 @@ printZaxisHybridInfo(const int zaxisID)
}
static
void
printZaxisGenericInfo
(
const
int
ltype
,
const
int
zaxistype
,
const
char
*
zaxisname
)
printZaxisGenericInfo
(
int
ltype
,
int
zaxistype
,
const
char
*
zaxisname
)
{
if
(
zaxistype
==
ZAXIS_GENERIC
&&
ltype
!=
0
)
fprintf
(
stdout
,
"%-12s (ltype=%3d)"
,
zaxisname
,
ltype
);
...
...
@@ -495,7 +495,7 @@ printZaxisGenericInfo(const int ltype, const int zaxistype, const char *zaxisnam
}
static
void
printZaxisReferenceInfo
(
const
int
zaxisID
)
printZaxisReferenceInfo
(
int
zaxisID
)
{
int
referenceNumber
=
0
;
cdiInqKeyInt
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_NUMBEROFVGRIDUSED
,
&
referenceNumber
);
...
...
@@ -523,17 +523,17 @@ printZaxisInfo(int vlistID)
{
char
zaxisname
[
CDI_MAX_NAME
],
zname
[
CDI_MAX_NAME
],
zunits
[
CDI_MAX_NAME
];
const
int
nzaxis
=
vlistNzaxis
(
vlistID
);
int
nzaxis
=
vlistNzaxis
(
vlistID
);
for
(
int
index
=
0
;
index
<
nzaxis
;
index
++
)
{
int
dig
=
7
;
//______________________________________________________--
double
zinc
=
0
;
const
int
zaxisID
=
vlistZaxis
(
vlistID
,
index
);
const
int
zaxistype
=
zaxisInqType
(
zaxisID
);
int
zaxisID
=
vlistZaxis
(
vlistID
,
index
);
int
zaxistype
=
zaxisInqType
(
zaxisID
);
int
ltype
=
0
;
cdiInqKeyInt
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_TYPEOFFIRSTFIXEDSURFACE
,
&
ltype
);
const
int
levelsize
=
zaxisInqSize
(
zaxisID
);
int
levelsize
=
zaxisInqSize
(
zaxisID
);
// int prec = zaxisInqDatatype(zaxisID);
// int dig = (prec == CDI_DATATYPE_FLT64) ? 15 : 7;
...
...
@@ -572,11 +572,11 @@ printZaxisInfo(int vlistID)
void
printSubtypeInfo
(
int
vlistID
)
{
const
int
nsubtypes
=
vlistNsubtypes
(
vlistID
);
int
nsubtypes
=
vlistNsubtypes
(
vlistID
);
for
(
int
index
=
0
;
index
<
nsubtypes
;
index
++
)
{
const
int
subtypeID
=
vlistSubtype
(
vlistID
,
index
);
const
int
subtypesize
=
subtypeInqSize
(
subtypeID
);
int
subtypeID
=
vlistSubtype
(
vlistID
,
index
);
int
subtypesize
=
subtypeInqSize
(
subtypeID
);
// subtypePrint(subtypeID);
fprintf
(
stdout
,
" %4d : %-24s : ntiles=%d
\n
"
,
vlistSubtypeIndex
(
vlistID
,
subtypeID
)
+
1
,
"tiles"
,
subtypesize
);
}
...
...
@@ -650,7 +650,7 @@ printTimesteps(int streamID, int taxisID, int verbose)
while
(
true
)
{
const
int
nrecs
=
streamInqTimestep
(
streamID
,
tsID
);
int
nrecs
=
streamInqTimestep
(
streamID
,
tsID
);
if
(
nrecs
==
0
)
break
;
const
CdiDateTime
vdatetime
=
taxisInqVdatetime
(
taxisID
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment