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
a6ea577e
Commit
a6ea577e
authored
Feb 08, 2019
by
Uwe Schulzweida
Browse files
Added function cdfDefineAttrEnsemble().
parent
0682c069
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cdf_write.c
View file @
a6ea577e
...
...
@@ -491,6 +491,18 @@ void cdfDefineAttrLeveltype(int fileID, int ncvarid, int zaxisID, int zaxistype,
}
}
static
void
cdfDefineAttrEnsemble
(
int
fileID
,
int
ncvarid
,
int
vlistID
,
int
varID
)
{
int
perturbationNumber
,
numberOfForecastsInEnsemble
,
typeOfEnsembleForecast
;
if
(
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_PERTURBATIONNUMBER
,
&
perturbationNumber
)
==
0
)
cdf_put_att_int
(
fileID
,
ncvarid
,
"realization"
,
NC_INT
,
1
,
&
perturbationNumber
);
if
(
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_NUMBEROFFORECASTSINENSEMBLE
,
&
numberOfForecastsInEnsemble
)
==
0
)
cdf_put_att_int
(
fileID
,
ncvarid
,
"ensemble_members"
,
NC_INT
,
1
,
&
numberOfForecastsInEnsemble
);
if
(
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_TYPEOFENSEMBLEFORECAST
,
&
typeOfEnsembleForecast
)
==
0
)
cdf_put_att_int
(
fileID
,
ncvarid
,
"forecast_init_type"
,
NC_INT
,
1
,
&
typeOfEnsembleForecast
);
}
static
int
cdfDefVar
(
stream_t
*
streamptr
,
int
varID
)
{
...
...
@@ -730,13 +742,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
if
(
zid
==
-
1
)
cdfDefineAttrLeveltype
(
fileID
,
ncvarid
,
zaxisID
,
zaxistype
,
varname
);
int
perturbationNumber
,
numberOfForecastsInEnsemble
,
typeOfEnsembleForecast
;
if
(
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_PERTURBATIONNUMBER
,
&
perturbationNumber
)
==
0
)
cdf_put_att_int
(
fileID
,
ncvarid
,
"realization"
,
NC_INT
,
1
,
&
perturbationNumber
);
if
(
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_NUMBEROFFORECASTSINENSEMBLE
,
&
numberOfForecastsInEnsemble
)
==
0
)
cdf_put_att_int
(
fileID
,
ncvarid
,
"ensemble_members"
,
NC_INT
,
1
,
&
numberOfForecastsInEnsemble
);
if
(
cdiInqKeyInt
(
vlistID
,
varID
,
CDI_KEY_TYPEOFENSEMBLEFORECAST
,
&
typeOfEnsembleForecast
)
==
0
)
cdf_put_att_int
(
fileID
,
ncvarid
,
"forecast_init_type"
,
NC_INT
,
1
,
&
typeOfEnsembleForecast
);
cdfDefineAttrEnsemble
(
fileID
,
ncvarid
,
vlistID
,
varID
);
// Attributes
cdfDefineAttributes
(
vlistID
,
varID
,
fileID
,
ncvarid
);
...
...
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