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
b1a32b13
Commit
b1a32b13
authored
9 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Move callees closer to caller.
parent
3a998d59
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/stream_cdf_o.c
+114
-113
114 additions, 113 deletions
src/stream_cdf_o.c
with
114 additions
and
113 deletions
src/stream_cdf_o.c
+
114
−
113
View file @
b1a32b13
...
...
@@ -1105,119 +1105,6 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex)
ncgrid
[
gridindex
].
ncIDs
[
CDF_VARID_A
]
=
ncavarid
;
}
static
void
cdfDefRgrid
(
stream_t
*
streamptr
,
int
gridID
,
int
gridindex
)
{
ncgrid_t
*
ncgrid
=
streamptr
->
ncgrid
;
size_t
dimlen
=
(
size_t
)
gridInqSize
(
gridID
);
int
iz
;
int
dimID
;
{
struct
idSearch
search
=
cdfSearchIDBySize
(
0
,
(
size_t
)
gridindex
,
ncgrid
,
CDF_DIMID_X
,
GRID_GAUSSIAN_REDUCED
,
(
int
)
dimlen
,
gridInqType
,
gridInqSize
);
iz
=
search
.
numNonMatching
;
dimID
=
search
.
foundID
;
}
if
(
dimID
==
CDI_UNDEFID
)
{
int
fileID
=
streamptr
->
fileID
;
static
bool
lwarn
=
true
;
if
(
lwarn
)
{
Warning
(
"Creating a NetCDF file with data on a gaussian reduced grid."
);
Warning
(
"The further processing of the resulting file is unsupported!"
);
lwarn
=
false
;
}
char
axisname
[
7
]
=
"rgridX"
;
if
(
iz
==
0
)
axisname
[
5
]
=
'\0'
;
else
sprintf
(
&
axisname
[
5
],
"%1d"
,
iz
+
1
);
if
(
streamptr
->
ncmode
==
2
)
cdf_redef
(
fileID
);
cdf_def_dim
(
fileID
,
axisname
,
dimlen
,
&
dimID
);
cdf_enddef
(
fileID
);
streamptr
->
ncmode
=
2
;
}
ncgrid
[
gridindex
].
gridID
=
gridID
;
ncgrid
[
gridindex
].
ncIDs
[
CDF_DIMID_X
]
=
dimID
;
}
static
void
cdfDefGdim
(
stream_t
*
streamptr
,
int
gridID
,
int
gridindex
)
{
ncgrid_t
*
ncgrid
=
streamptr
->
ncgrid
;
int
iz
=
0
;
int
dimID
=
CDI_UNDEFID
;
size_t
dimlen
=
(
size_t
)
gridInqSize
(
gridID
);
if
(
gridInqYsize
(
gridID
)
==
0
)
{
struct
idSearch
search
=
cdfSearchIDBySize
(
0
,
(
size_t
)
gridindex
,
ncgrid
,
CDF_DIMID_X
,
GRID_GENERIC
,
(
int
)
dimlen
,
gridInqType
,
gridInqSize
);
iz
=
search
.
numNonMatching
;
dimID
=
search
.
foundID
;
}
if
(
gridInqXsize
(
gridID
)
==
0
)
{
struct
idSearch
search
=
cdfSearchIDBySize
(
0
,
(
size_t
)
gridindex
,
ncgrid
,
CDF_DIMID_Y
,
GRID_GENERIC
,
(
int
)
dimlen
,
gridInqType
,
gridInqSize
);
iz
+=
search
.
numNonMatching
;
dimID
=
search
.
foundID
;
}
if
(
dimID
==
CDI_UNDEFID
)
{
int
fileID
=
streamptr
->
fileID
;
char
dimname
[
CDI_MAX_NAME
];
strcpy
(
dimname
,
"gsize"
);
dimID
=
checkDimName
(
fileID
,
dimlen
,
dimname
);
if
(
streamptr
->
ncmode
==
2
)
cdf_redef
(
fileID
);
if
(
dimID
==
CDI_UNDEFID
)
cdf_def_dim
(
fileID
,
dimname
,
dimlen
,
&
dimID
);
cdf_enddef
(
fileID
);
streamptr
->
ncmode
=
2
;
}
ncgrid
[
gridindex
].
gridID
=
gridID
;
ncgrid
[
gridindex
].
ncIDs
[
CDF_DIMID_X
]
=
dimID
;
}
static
void
cdfDefZaxisUUID
(
stream_t
*
streamptr
,
int
zaxisID
)
{
unsigned
char
uuidOfVGrid
[
CDI_UUID_SIZE
];
zaxisInqUUID
(
zaxisID
,
uuidOfVGrid
);
if
(
uuidOfVGrid
[
0
]
!=
0
)
{
char
uuidOfVGridStr
[
37
];
cdiUUID2Str
(
uuidOfVGrid
,
uuidOfVGridStr
);
if
(
uuidOfVGridStr
[
0
]
!=
0
&&
strlen
(
uuidOfVGridStr
)
==
36
)
{
int
fileID
=
streamptr
->
fileID
;
if
(
streamptr
->
ncmode
==
2
)
cdf_redef
(
fileID
);
cdf_put_att_text
(
fileID
,
NC_GLOBAL
,
"uuidOfVGrid"
,
36
,
uuidOfVGridStr
);
if
(
streamptr
->
ncmode
==
2
)
cdf_enddef
(
fileID
);
}
}
}
static
void
cdfDefUnstructured
(
stream_t
*
streamptr
,
int
gridID
,
int
gridindex
)
...
...
@@ -1738,6 +1625,26 @@ void cdf_def_zaxis_hybrid(stream_t *streamptr, int type, int *ncvarid, int zaxis
def_zaxis_hybrid_delegate
(
streamptr
,
type
,
ncvarid
,
zaxisID
,
zaxisindex
,
xtype
,
dimlen
,
dimID
,
axisname
);
}
static
void
cdfDefZaxisUUID
(
stream_t
*
streamptr
,
int
zaxisID
)
{
unsigned
char
uuidOfVGrid
[
CDI_UUID_SIZE
];
zaxisInqUUID
(
zaxisID
,
uuidOfVGrid
);
if
(
uuidOfVGrid
[
0
]
!=
0
)
{
char
uuidOfVGridStr
[
37
];
cdiUUID2Str
(
uuidOfVGrid
,
uuidOfVGridStr
);
if
(
uuidOfVGridStr
[
0
]
!=
0
&&
strlen
(
uuidOfVGridStr
)
==
36
)
{
int
fileID
=
streamptr
->
fileID
;
if
(
streamptr
->
ncmode
==
2
)
cdf_redef
(
fileID
);
cdf_put_att_text
(
fileID
,
NC_GLOBAL
,
"uuidOfVGrid"
,
36
,
uuidOfVGridStr
);
if
(
streamptr
->
ncmode
==
2
)
cdf_enddef
(
fileID
);
}
}
}
static
void
cdfDefZaxis
(
stream_t
*
streamptr
,
int
zaxisID
)
{
...
...
@@ -1922,6 +1829,100 @@ void cdf_def_mapping(stream_t *streamptr, int gridID)
}
}
static
void
cdfDefRgrid
(
stream_t
*
streamptr
,
int
gridID
,
int
gridindex
)
{
ncgrid_t
*
ncgrid
=
streamptr
->
ncgrid
;
size_t
dimlen
=
(
size_t
)
gridInqSize
(
gridID
);
int
iz
;
int
dimID
;
{
struct
idSearch
search
=
cdfSearchIDBySize
(
0
,
(
size_t
)
gridindex
,
ncgrid
,
CDF_DIMID_X
,
GRID_GAUSSIAN_REDUCED
,
(
int
)
dimlen
,
gridInqType
,
gridInqSize
);
iz
=
search
.
numNonMatching
;
dimID
=
search
.
foundID
;
}
if
(
dimID
==
CDI_UNDEFID
)
{
int
fileID
=
streamptr
->
fileID
;
static
bool
lwarn
=
true
;
if
(
lwarn
)
{
Warning
(
"Creating a NetCDF file with data on a gaussian reduced grid."
);
Warning
(
"The further processing of the resulting file is unsupported!"
);
lwarn
=
false
;
}
char
axisname
[
7
]
=
"rgridX"
;
if
(
iz
==
0
)
axisname
[
5
]
=
'\0'
;
else
sprintf
(
&
axisname
[
5
],
"%1d"
,
iz
+
1
);
if
(
streamptr
->
ncmode
==
2
)
cdf_redef
(
fileID
);
cdf_def_dim
(
fileID
,
axisname
,
dimlen
,
&
dimID
);
cdf_enddef
(
fileID
);
streamptr
->
ncmode
=
2
;
}
ncgrid
[
gridindex
].
gridID
=
gridID
;
ncgrid
[
gridindex
].
ncIDs
[
CDF_DIMID_X
]
=
dimID
;
}
static
void
cdfDefGdim
(
stream_t
*
streamptr
,
int
gridID
,
int
gridindex
)
{
ncgrid_t
*
ncgrid
=
streamptr
->
ncgrid
;
int
iz
=
0
;
int
dimID
=
CDI_UNDEFID
;
size_t
dimlen
=
(
size_t
)
gridInqSize
(
gridID
);
if
(
gridInqYsize
(
gridID
)
==
0
)
{
struct
idSearch
search
=
cdfSearchIDBySize
(
0
,
(
size_t
)
gridindex
,
ncgrid
,
CDF_DIMID_X
,
GRID_GENERIC
,
(
int
)
dimlen
,
gridInqType
,
gridInqSize
);
iz
=
search
.
numNonMatching
;
dimID
=
search
.
foundID
;
}
if
(
gridInqXsize
(
gridID
)
==
0
)
{
struct
idSearch
search
=
cdfSearchIDBySize
(
0
,
(
size_t
)
gridindex
,
ncgrid
,
CDF_DIMID_Y
,
GRID_GENERIC
,
(
int
)
dimlen
,
gridInqType
,
gridInqSize
);
iz
+=
search
.
numNonMatching
;
dimID
=
search
.
foundID
;
}
if
(
dimID
==
CDI_UNDEFID
)
{
int
fileID
=
streamptr
->
fileID
;
char
dimname
[
CDI_MAX_NAME
];
strcpy
(
dimname
,
"gsize"
);
dimID
=
checkDimName
(
fileID
,
dimlen
,
dimname
);
if
(
streamptr
->
ncmode
==
2
)
cdf_redef
(
fileID
);
if
(
dimID
==
CDI_UNDEFID
)
cdf_def_dim
(
fileID
,
dimname
,
dimlen
,
&
dimID
);
cdf_enddef
(
fileID
);
streamptr
->
ncmode
=
2
;
}
ncgrid
[
gridindex
].
gridID
=
gridID
;
ncgrid
[
gridindex
].
ncIDs
[
CDF_DIMID_X
]
=
dimID
;
}
static
void
cdfDefGrid
(
stream_t
*
streamptr
,
int
gridID
,
int
gridindex
)
{
...
...
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