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
30ba1899
Commit
30ba1899
authored
2 years ago
by
Uwe Schulzweida
Browse files
Options
Downloads
Patches
Plain Diff
Added function grid_is_irregular().
parent
17c8718f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!34
Version 2.2.0
,
!25
M214003/develop
Pipeline
#28688
failed
2 years ago
Stage: external
Changes
4
Pipelines
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/cdi_key.c
+10
-10
10 additions, 10 deletions
src/cdi_key.c
src/grid.c
+93
-94
93 additions, 94 deletions
src/grid.c
src/tsteps.c
+1
-1
1 addition, 1 deletion
src/tsteps.c
src/zaxis.c
+13
-13
13 additions, 13 deletions
src/zaxis.c
with
117 additions
and
118 deletions
src/cdi_key.c
+
10
−
10
View file @
30ba1899
...
...
@@ -133,7 +133,7 @@ cdi_delete_key(cdi_key_t *keyp)
void
cdiDeleteVarKeys
(
cdi_keys_t
*
keysp
)
{
const
int
nelems
=
keysp
?
(
int
)
keysp
->
nelems
:
0
;
int
nelems
=
keysp
?
(
int
)
keysp
->
nelems
:
0
;
for
(
int
keyid
=
0
;
keyid
<
nelems
;
keyid
++
)
{
cdi_delete_key
(
&
(
keysp
->
value
[
keyid
]));
...
...
@@ -154,7 +154,7 @@ cdiDeleteKeys(int cdiID, int varID)
void
cdiPrintVarKeys
(
cdi_keys_t
*
keysp
)
{
const
int
nelems
=
keysp
?
(
int
)
keysp
->
nelems
:
0
;
int
nelems
=
keysp
?
(
int
)
keysp
->
nelems
:
0
;
for
(
int
keyid
=
0
;
keyid
<
nelems
;
keyid
++
)
{
cdi_key_t
*
keyp
=
&
(
keysp
->
value
[
keyid
]);
...
...
@@ -215,7 +215,7 @@ cdi_define_key(const cdi_key_t *keyp, cdi_keys_t *keysp)
int
cdiDeleteKey
(
int
cdiID
,
int
varID
,
int
key
)
{
const
int
status
=
CDI_NOERR
;
int
status
=
CDI_NOERR
;
cdi_keys_t
*
keysp
=
cdi_get_keysp
(
cdiID
,
varID
);
xassert
(
keysp
!=
NULL
);
...
...
@@ -238,7 +238,7 @@ cdiCopyVarKeys(const cdi_keys_t *keysp1, cdi_keys_t *keysp2)
int
cdiCopyKeys
(
int
cdiID1
,
int
varID1
,
int
cdiID2
,
int
varID2
)
{
const
int
status
=
CDI_NOERR
;
int
status
=
CDI_NOERR
;
cdi_keys_t
*
keysp1
=
cdi_get_keysp
(
cdiID1
,
varID1
);
xassert
(
keysp1
!=
NULL
);
...
...
@@ -254,7 +254,7 @@ cdiCopyKeys(int cdiID1, int varID1, int cdiID2, int varID2)
int
cdiCopyVarKey
(
const
cdi_keys_t
*
keysp1
,
int
key
,
cdi_keys_t
*
keysp2
)
{
const
int
status
=
CDI_NOERR
;
int
status
=
CDI_NOERR
;
const
cdi_key_t
*
keyp
=
find_key_const
(
keysp1
,
key
);
if
(
keyp
==
NULL
)
return
-
1
;
...
...
@@ -315,7 +315,7 @@ The function @func{cdiDefKeyInt} defines an integer value from a key.
int
cdiDefKeyInt
(
int
cdiID
,
int
varID
,
int
key
,
int
value
)
{
const
int
status
=
CDI_NOERR
;
int
status
=
CDI_NOERR
;
cdi_keys_t
*
keysp
=
cdi_get_keysp
(
cdiID
,
varID
);
xassert
(
keysp
!=
NULL
);
...
...
@@ -414,7 +414,7 @@ The function @func{cdiDefKeyFloat} defines a CDI floating point value from a key
int
cdiDefKeyFloat
(
int
cdiID
,
int
varID
,
int
key
,
double
value
)
{
const
int
status
=
CDI_NOERR
;
int
status
=
CDI_NOERR
;
cdi_keys_t
*
keysp
=
cdi_get_keysp
(
cdiID
,
varID
);
xassert
(
keysp
!=
NULL
);
...
...
@@ -513,7 +513,7 @@ The function @func{cdiDefKeyBytes} defines a byte array from a key.
int
cdiDefKeyBytes
(
int
cdiID
,
int
varID
,
int
key
,
const
unsigned
char
*
bytes
,
int
length
)
{
const
int
status
=
CDI_NOERR
;
int
status
=
CDI_NOERR
;
cdi_keys_t
*
keysp
=
cdi_get_keysp
(
cdiID
,
varID
);
xassert
(
keysp
!=
NULL
);
...
...
@@ -615,8 +615,8 @@ cdiDefKeyString(int cdiID, int varID, int key, const char *string)
{
xassert
(
string
!=
NULL
);
const
int
length
=
strlen
(
string
)
+
1
;
const
int
status
=
cdiDefKeyBytes
(
cdiID
,
varID
,
key
,
(
const
unsigned
char
*
)
string
,
length
);
int
length
=
strlen
(
string
)
+
1
;
int
status
=
cdiDefKeyBytes
(
cdiID
,
varID
,
key
,
(
const
unsigned
char
*
)
string
,
length
);
return
status
;
}
...
...
This diff is collapsed.
Click to expand it.
src/grid.c
+
93
−
94
View file @
30ba1899
This diff is collapsed.
Click to expand it.
src/tsteps.c
+
1
−
1
View file @
30ba1899
...
...
@@ -54,7 +54,7 @@ cdiCreateTimesteps(stream_t *streamptr)
{
if
(
streamptr
->
ntsteps
<
0
||
streamptr
->
tstepsTableSize
>
0
)
return
;
const
int
ntsteps
=
(
streamptr
->
ntsteps
==
0
)
?
1
:
(
int
)
streamptr
->
ntsteps
;
int
ntsteps
=
(
streamptr
->
ntsteps
==
0
)
?
1
:
(
int
)
streamptr
->
ntsteps
;
streamptr
->
tsteps
=
(
tsteps_t
*
)
Malloc
((
size_t
)
ntsteps
*
sizeof
(
tsteps_t
));
...
...
This diff is collapsed.
Click to expand it.
src/zaxis.c
+
13
−
13
View file @
30ba1899
...
...
@@ -167,7 +167,7 @@ zaxisInit(void)
static
void
zaxis_copy
(
zaxis_t
*
zaxisptr2
,
zaxis_t
*
zaxisptr1
)
{
const
int
zaxisID2
=
zaxisptr2
->
self
;
int
zaxisID2
=
zaxisptr2
->
self
;
memcpy
(
zaxisptr2
,
zaxisptr1
,
sizeof
(
zaxis_t
));
zaxisptr2
->
self
=
zaxisID2
;
cdiInitKeys
(
&
zaxisptr2
->
keys
);
...
...
@@ -192,7 +192,7 @@ zaxisCreate_(int zaxistype, int size, int id)
if
(
zaxistype
>=
CDI_NumZaxistype
||
zaxistype
<
0
)
Error
(
"Internal problem! zaxistype=%d out of range (min=0/max=%d)!"
,
zaxistype
,
CDI_NumZaxistype
-
1
);
const
int
zaxisID
=
zaxisptr
->
self
;
int
zaxisID
=
zaxisptr
->
self
;
cdiDefKeyString
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_NAME
,
ZaxistypeEntry
[
zaxistype
].
name
);
if
(
zaxistype
!=
ZAXIS_GENERIC
)
zaxisDefLongname
(
zaxisID
,
ZaxistypeEntry
[
zaxistype
].
longname
);
cdiDefKeyString
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_UNITS
,
ZaxistypeEntry
[
zaxistype
].
units
);
...
...
@@ -261,7 +261,7 @@ zaxisDestroyKernel(zaxis_t *zaxisptr)
{
xassert
(
zaxisptr
);
const
int
id
=
zaxisptr
->
self
;
int
id
=
zaxisptr
->
self
;
if
(
zaxisptr
->
vals
)
Free
(
zaxisptr
->
vals
);
#ifndef USE_MPI
...
...
@@ -608,7 +608,7 @@ void
zaxisDefLevel
(
int
zaxisID
,
int
levelID
,
double
level
)
{
zaxis_t
*
zaxisptr
=
zaxis_to_pointer
(
zaxisID
);
const
int
size
=
zaxisptr
->
size
;
int
size
=
zaxisptr
->
size
;
xassert
(
size
);
xassert
(
levelID
>=
0
&&
levelID
<
size
);
...
...
@@ -910,7 +910,7 @@ zaxisInqLevelID(int zaxisID, double level)
zaxis_t
*
zaxisptr
=
zaxis_to_pointer
(
zaxisID
);
if
(
zaxisptr
->
vals
)
{
const
int
size
=
zaxisptr
->
size
;
int
size
=
zaxisptr
->
size
;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
if
(
fabs
(
level
-
zaxisptr
->
vals
[
i
])
<
DBL_EPSILON
)
{
...
...
@@ -984,7 +984,7 @@ cdiCheckZaxis(int zaxisID)
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_GENERIC
&&
zaxisptr
->
vals
)
{
const
int
size
=
zaxisptr
->
size
;
int
size
=
zaxisptr
->
size
;
if
(
size
>
1
)
{
/* check direction */
...
...
@@ -1129,10 +1129,10 @@ zaxisDuplicate(int zaxisID)
{
zaxis_t
*
zaxisptr
=
zaxis_to_pointer
(
zaxisID
);
const
int
zaxistype
=
zaxisInqType
(
zaxisID
);
const
int
zaxissize
=
zaxisInqSize
(
zaxisID
);
int
zaxistype
=
zaxisInqType
(
zaxisID
);
int
zaxissize
=
zaxisInqSize
(
zaxisID
);
const
int
zaxisIDnew
=
zaxisCreate
(
zaxistype
,
zaxissize
);
int
zaxisIDnew
=
zaxisCreate
(
zaxistype
,
zaxissize
);
zaxis_t
*
zaxisptrnew
=
zaxis_to_pointer
(
zaxisIDnew
);
zaxis_copy
(
zaxisptrnew
,
zaxisptr
);
...
...
@@ -1188,10 +1188,10 @@ zaxisPrintKernel(zaxis_t *zaxisptr, FILE *fp)
int
datatype
=
CDI_UNDEFID
;
cdiInqKeyInt
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_DATATYPE
,
&
datatype
);
const
int
type
=
zaxisptr
->
type
;
const
int
nlevels
=
zaxisptr
->
size
;
int
type
=
zaxisptr
->
type
;
int
nlevels
=
zaxisptr
->
size
;
const
int
dig
=
(
datatype
==
CDI_DATATYPE_FLT64
)
?
15
:
7
;
int
dig
=
(
datatype
==
CDI_DATATYPE_FLT64
)
?
15
:
7
;
fprintf
(
fp
,
"zaxistype = %s
\n
"
,
zaxisNamePtr
(
type
));
fprintf
(
fp
,
"size = %d
\n
"
,
nlevels
);
...
...
@@ -1258,7 +1258,7 @@ zaxisPrintKernel(zaxis_t *zaxisptr, FILE *fp)
if
(
type
==
ZAXIS_HYBRID
||
type
==
ZAXIS_HYBRID_HALF
)
{
const
int
vctsize
=
zaxisptr
->
vctsize
;
int
vctsize
=
zaxisptr
->
vctsize
;
const
double
*
vct
=
zaxisptr
->
vct
;
fprintf
(
fp
,
"vctsize = %d
\n
"
,
vctsize
);
if
(
vctsize
)
...
...
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