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
6e650913
Commit
6e650913
authored
Jul 05, 2016
by
Uwe Schulzweida
Browse files
Renamed cdiGridDefStr to cdiGridDefKeyStr
parent
c4a18d2e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cdi.h
View file @
6e650913
...
...
@@ -767,11 +767,11 @@ int gridInqYvals(int gridID, double yvals[]);
#define CDI_GRID_XUNITS 908 // X-axis units
#define CDI_GRID_YUNITS 909 // Y-axis units
// cdiGridDefStr
ing
: Define a CDI grid string value from a key
int
cdiGridDefStr
ing
(
int
gridID
,
int
key
,
int
size
,
const
char
*
mesg
);
// cdiGridDef
Key
Str: Define a CDI grid string value from a key
int
cdiGridDef
Key
Str
(
int
gridID
,
int
key
,
int
size
,
const
char
*
mesg
);
// cdiGridInqStr
ing
: Get a CDI grid string value from a key
int
cdiGridInqStr
ing
(
int
gridID
,
int
key
,
int
size
,
char
*
mesg
);
// cdiGridInq
Key
Str: Get a CDI grid string value from a key
int
cdiGridInq
Key
Str
(
int
gridID
,
int
key
,
int
size
,
char
*
mesg
);
/* gridDefXname: Define the name of a X-axis */
void
gridDefXname
(
int
gridID
,
const
char
*
xname
);
...
...
src/cdiFortran.c
View file @
6e650913
...
...
@@ -327,8 +327,8 @@ FCALLSCFUN2 (INT, gridInqYvals, GRIDINQYVALS, gridinqyvals, INT, DOUBLEV)
/* CDI grid string key values */
FCALLSCFUN4
(
INT
,
cdiGridDefStr
ing
,
CDIGRIDDEFSTRING
,
cdigriddefstring
,
INT
,
INT
,
INT
,
STRING
)
FCALLSCFUN4
(
INT
,
cdiGridInqStr
ing
,
CDIGRIDINQSTRING
,
cdigridinqstring
,
INT
,
INT
,
INT
,
PSTRING
)
FCALLSCFUN4
(
INT
,
cdiGridDef
Key
Str
,
CDIGRIDDEFSTRING
,
cdigriddefstring
,
INT
,
INT
,
INT
,
STRING
)
FCALLSCFUN4
(
INT
,
cdiGridInq
Key
Str
,
CDIGRIDINQSTRING
,
cdigridinqstring
,
INT
,
INT
,
INT
,
PSTRING
)
FCALLSCSUB2
(
gridDefXname
,
GRIDDEFXNAME
,
griddefxname
,
INT
,
STRING
)
FCALLSCSUB2
(
gridInqXname
,
GRIDINQXNAME
,
gridinqxname
,
INT
,
PSTRING
)
FCALLSCSUB2
(
gridDefXlongname
,
GRIDDEFXLONGNAME
,
griddefxlongname
,
INT
,
STRING
)
...
...
src/grid.c
View file @
6e650913
...
...
@@ -616,10 +616,10 @@ char *grid_key_to_string(grid_t *gridptr, int key)
}
/*
@Function cdiGridDefStr
ing
@Function cdiGridDef
Key
Str
@Title Define a CDI grid string value from a key
@Prototype int cdiGridDefStr
ing
(int gridID, int key, int size, const char *mesg)
@Prototype int cdiGridDef
Key
Str(int gridID, int key, int size, const char *mesg)
@Parameter
@Item gridID Grid ID, from a previous call to @fref{gridCreate}.
@Item key The key to be searched
...
...
@@ -627,14 +627,14 @@ char *grid_key_to_string(grid_t *gridptr, int key)
@Item mesg The address of a string where the data will be read
@Description
The function @func{cdiGridDefStr
ing
} defines a CDI grid string value from a key.
The function @func{cdiGridDef
Key
Str} defines a CDI grid string value from a key.
@Result
@func{cdiGridDefStr
ing
} returns 0 if OK and integer value on error.
@func{cdiGridDef
Key
Str} returns 0 if OK and integer value on error.
@EndFunction
*/
int
cdiGridDefStr
ing
(
int
gridID
,
int
key
,
int
size
,
const
char
*
mesg
)
int
cdiGridDef
Key
Str
(
int
gridID
,
int
key
,
int
size
,
const
char
*
mesg
)
{
if
(
size
<
1
||
mesg
==
NULL
||
*
mesg
==
0
)
return
-
1
;
...
...
@@ -654,10 +654,10 @@ int cdiGridDefString(int gridID, int key, int size, const char *mesg)
}
/*
@Function cdiGridInqStr
ing
@Function cdiGridInq
Key
Str
@Title Get a CDI grid string value from a key
@Prototype int cdiGridInqStr
ing
(int gridID, int key, int size, char *mesg)
@Prototype int cdiGridInq
Key
Str(int gridID, int key, int size, char *mesg)
@Parameter
@Item gridID Grid ID, from a previous call to @fref{gridCreate}.
@Item key The key to be searched.
...
...
@@ -668,14 +668,14 @@ int cdiGridDefString(int gridID, int key, int size, const char *mesg)
is given by the predefined constant @func{CDI_MAX_NAME}.
@Description
The function @func{cdiGridInqStr
ing
} return a CDI grid string value from a key.
The function @func{cdiGridInq
Key
Str} return a CDI grid string value from a key.
@Result
@func{cdiGridInqStr
ing
} returns 0 if OK and integer value on error.
@func{cdiGridInq
Key
Str} returns 0 if OK and integer value on error.
@EndFunction
*/
int
cdiGridInqStr
ing
(
int
gridID
,
int
key
,
int
size
,
char
*
mesg
)
int
cdiGridInq
Key
Str
(
int
gridID
,
int
key
,
int
size
,
char
*
mesg
)
{
if
(
size
<
1
||
mesg
==
NULL
)
return
-
1
;
...
...
src/stream_cdf_i.c
View file @
6e650913
...
...
@@ -2858,11 +2858,11 @@ void cdf_define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
gridDefHasDims
(
ncvars
[
ncvarid
].
gridID
,
FALSE
);
if
(
xdimid
!=
-
1
)
cdiGridDefStr
ing
(
ncvars
[
ncvarid
].
gridID
,
CDI_GRID_XDIMNAME
,
(
int
)(
strlen
(
ncdims
[
xdimid
].
name
)
+
1
),
ncdims
[
xdimid
].
name
);
cdiGridDef
Key
Str
(
ncvars
[
ncvarid
].
gridID
,
CDI_GRID_XDIMNAME
,
(
int
)(
strlen
(
ncdims
[
xdimid
].
name
)
+
1
),
ncdims
[
xdimid
].
name
);
if
(
ydimid
!=
-
1
)
cdiGridDefStr
ing
(
ncvars
[
ncvarid
].
gridID
,
CDI_GRID_YDIMNAME
,
(
int
)(
strlen
(
ncdims
[
ydimid
].
name
)
+
1
),
ncdims
[
ydimid
].
name
);
cdiGridDef
Key
Str
(
ncvars
[
ncvarid
].
gridID
,
CDI_GRID_YDIMNAME
,
(
int
)(
strlen
(
ncdims
[
ydimid
].
name
)
+
1
),
ncdims
[
ydimid
].
name
);
if
(
vdimid
!=
-
1
)
cdiGridDefStr
ing
(
ncvars
[
ncvarid
].
gridID
,
CDI_GRID_VDIMNAME
,
(
int
)(
strlen
(
ncdims
[
vdimid
].
name
)
+
1
),
ncdims
[
vdimid
].
name
);
cdiGridDef
Key
Str
(
ncvars
[
ncvarid
].
gridID
,
CDI_GRID_VDIMNAME
,
(
int
)(
strlen
(
ncdims
[
vdimid
].
name
)
+
1
),
ncdims
[
vdimid
].
name
);
if
(
CDI_Debug
)
Message
(
"gridID %d %d %s"
,
ncvars
[
ncvarid
].
gridID
,
ncvarid
,
ncvars
[
ncvarid
].
name
);
...
...
src/stream_cdf_o.c
View file @
6e650913
...
...
@@ -769,7 +769,7 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int ndims,
dimname
[
0
]
=
0
;
if
(
pvals
==
NULL
)
cdiGridInqStr
ing
(
gridID
,
dimKey
,
CDI_MAX_NAME
,
dimname
);
cdiGridInq
Key
Str
(
gridID
,
dimKey
,
CDI_MAX_NAME
,
dimname
);
if
(
dimname
[
0
]
==
0
)
strcpy
(
dimname
,
extendedAxisname
);
dimID
=
checkDimName
(
fileID
,
dimlen
,
dimname
);
...
...
@@ -926,7 +926,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID)
{
char
xdimname
[
CDI_MAX_NAME
+
3
];
xdimname
[
0
]
=
0
;
cdiGridInqStr
ing
(
gridID
,
CDI_GRID_XDIMNAME
,
CDI_MAX_NAME
,
xdimname
);
cdiGridInq
Key
Str
(
gridID
,
CDI_GRID_XDIMNAME
,
CDI_MAX_NAME
,
xdimname
);
if
(
xdimname
[
0
]
==
0
)
{
xdimname
[
0
]
=
'x'
;
xdimname
[
1
]
=
0
;
}
xdimID
=
checkDimName
(
fileID
,
xdimlen
,
xdimname
);
if
(
xdimID
==
UNDEFID
)
cdf_def_dim
(
fileID
,
xdimname
,
xdimlen
,
&
xdimID
);
...
...
@@ -934,7 +934,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID)
{
char
ydimname
[
CDI_MAX_NAME
+
3
];
ydimname
[
0
]
=
0
;
cdiGridInqStr
ing
(
gridID
,
CDI_GRID_YDIMNAME
,
CDI_MAX_NAME
,
ydimname
);
cdiGridInq
Key
Str
(
gridID
,
CDI_GRID_YDIMNAME
,
CDI_MAX_NAME
,
ydimname
);
if
(
ydimname
[
0
]
==
0
)
{
ydimname
[
0
]
=
'y'
;
ydimname
[
1
]
=
0
;
}
ydimID
=
checkDimName
(
fileID
,
ydimlen
,
ydimname
);
if
(
ydimID
==
UNDEFID
)
cdf_def_dim
(
fileID
,
ydimname
,
ydimlen
,
&
ydimID
);
...
...
@@ -946,7 +946,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID)
{
char
vdimname
[
CDI_MAX_NAME
+
3
];
vdimname
[
0
]
=
0
;
cdiGridInqStr
ing
(
gridID
,
CDI_GRID_VDIMNAME
,
CDI_MAX_NAME
,
vdimname
);
cdiGridInq
Key
Str
(
gridID
,
CDI_GRID_VDIMNAME
,
CDI_MAX_NAME
,
vdimname
);
if
(
vdimname
[
0
]
==
0
)
strcpy
(
vdimname
,
"nv4"
);
size_t
nvertex
=
4
;
nvdimID
=
checkDimName
(
fileID
,
nvertex
,
vdimname
);
...
...
@@ -1278,7 +1278,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID)
{
char
xdimname
[
CDI_MAX_NAME
+
3
];
xdimname
[
0
]
=
0
;
cdiGridInqStr
ing
(
gridID
,
CDI_GRID_XDIMNAME
,
CDI_MAX_NAME
,
xdimname
);
cdiGridInq
Key
Str
(
gridID
,
CDI_GRID_XDIMNAME
,
CDI_MAX_NAME
,
xdimname
);
if
(
xdimname
[
0
]
==
0
)
strcpy
(
xdimname
,
"ncells"
);
dimID
=
checkDimName
(
fileID
,
dimlen
,
xdimname
);
if
(
dimID
==
UNDEFID
)
cdf_def_dim
(
fileID
,
xdimname
,
dimlen
,
&
dimID
);
...
...
@@ -1289,7 +1289,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID)
{
char
vdimname
[
CDI_MAX_NAME
+
3
];
vdimname
[
0
]
=
0
;
cdiGridInqStr
ing
(
gridID
,
CDI_GRID_VDIMNAME
,
CDI_MAX_NAME
,
vdimname
);
cdiGridInq
Key
Str
(
gridID
,
CDI_GRID_VDIMNAME
,
CDI_MAX_NAME
,
vdimname
);
if
(
vdimname
[
0
]
==
0
)
strcpy
(
vdimname
,
"vertices"
);
nvdimID
=
checkDimName
(
fileID
,
nvertex
,
vdimname
);
if
(
nvdimID
==
UNDEFID
)
cdf_def_dim
(
fileID
,
vdimname
,
nvertex
,
&
nvdimID
);
...
...
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