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
711ef55b
Commit
711ef55b
authored
Jul 15, 2019
by
Uwe Schulzweida
Browse files
netCDF: added attributes and coordinates for gaussian_reduced grid.
parent
cf25c0c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cdf_write.c
View file @
711ef55b
...
...
@@ -388,6 +388,22 @@ void cdfDefineCoordinates(const stream_t *streamptr, int ncvarID, int nczvarID,
cdf_get_gmapvarname
(
gridID
,
gmapvarname
);
if
(
gmapvarname
[
0
]
)
cdf_put_att_text
(
fileID
,
ncvarID
,
"grid_mapping"
,
strlen
(
gmapvarname
),
gmapvarname
);
if
(
gridtype
==
GRID_GAUSSIAN_REDUCED
)
{
const
int
numLPE
=
gridInqNP
(
gridID
);
if
(
numLPE
>
0
)
cdf_put_att_int
(
fileID
,
ncvarID
,
"CDI_grid_num_LPE"
,
NC_INT
,
1
,
&
numLPE
);
const
int
ncrpvarID
=
streamptr
->
ncgrid
[
gridindex
].
ncIDs
[
CDF_VARID_RP
];
if
(
ncrpvarID
!=
CDI_UNDEFID
)
{
char
name
[
CDI_MAX_NAME
];
name
[
0
]
=
0
;
cdf_inq_varname
(
fileID
,
ncrpvarID
,
name
);
size_t
len
=
strlen
(
name
);
cdf_put_att_text
(
fileID
,
ncvarID
,
"CDI_grid_reduced_points"
,
len
,
name
);
}
}
if
(
gridtype
==
GRID_TRAJECTORY
)
{
cdf_put_att_text
(
fileID
,
ncvarID
,
"coordinates"
,
9
,
"tlon tlat"
);
...
...
src/stream_cdf_o.c
View file @
711ef55b
...
...
@@ -1768,13 +1768,6 @@ void cdfDefRgrid(stream_t *streamptr, int gridID, int gridindex)
if
(
dimID
==
CDI_UNDEFID
)
{
const
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
[
16
]
=
"rgridX"
;
if
(
iz
==
0
)
axisname
[
5
]
=
'\0'
;
...
...
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