Commit 711ef55b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

netCDF: added attributes and coordinates for gaussian_reduced grid.

parent cf25c0c9
...@@ -388,6 +388,22 @@ void cdfDefineCoordinates(const stream_t *streamptr, int ncvarID, int nczvarID, ...@@ -388,6 +388,22 @@ void cdfDefineCoordinates(const stream_t *streamptr, int ncvarID, int nczvarID,
cdf_get_gmapvarname(gridID, gmapvarname); cdf_get_gmapvarname(gridID, gmapvarname);
if ( gmapvarname[0] ) cdf_put_att_text(fileID, ncvarID, "grid_mapping", strlen(gmapvarname), 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 ) if ( gridtype == GRID_TRAJECTORY )
{ {
cdf_put_att_text(fileID, ncvarID, "coordinates", 9, "tlon tlat"); cdf_put_att_text(fileID, ncvarID, "coordinates", 9, "tlon tlat");
......
...@@ -1768,13 +1768,6 @@ void cdfDefRgrid(stream_t *streamptr, int gridID, int gridindex) ...@@ -1768,13 +1768,6 @@ void cdfDefRgrid(stream_t *streamptr, int gridID, int gridindex)
if ( dimID == CDI_UNDEFID ) if ( dimID == CDI_UNDEFID )
{ {
const int fileID = streamptr->fileID; 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"; char axisname[16] = "rgridX";
if ( iz == 0 ) axisname[5] = '\0'; if ( iz == 0 ) axisname[5] = '\0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment