Commit e26b5a43 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

NetCDF: added support for proj coordinate without mapping attribute.

parent c7ec6d72
2016-10-10 Uwe Schulzweida
* NetCDF: added support for proj coordinate without mapping attribute
2016-10-04 Uwe Schulzweida
* Version 1.8.0rc3 released
2016-10-04 Uwe Schulzweida
* Changed default name of pressure levels to plev
......
......@@ -2536,9 +2536,6 @@ void cdf_define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
ncvar_t *ncvar = &ncvars[ncvarid];
if ( ncvar->isvar && ncvar->gridID == UNDEFID )
{
int gmapvarid = ncvar->gmapid;
bool lproj = gmapvarid != UNDEFID;
bool lgrid = !(lproj && ncvar->xvarid == UNDEFID);
int ndims = ncvar->ndims;
int *dimtype = ncvar->dimtype;
int vdimid = UNDEFID;
......@@ -2564,6 +2561,16 @@ void cdf_define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
}
}
int gmapvarid = ncvar->gmapid;
bool lproj = gmapvarid != UNDEFID;
if ( !lproj && xaxisid != UNDEFID && xaxisid != xvarid && yaxisid != UNDEFID && yaxisid != yvarid )
{
lproj = true;
}
bool lgrid = !(lproj && ncvar->xvarid == UNDEFID);
bool lunstructured = xdimid != UNDEFID && xdimid == ydimid && nydims == 0;
if ( (ncvar->gridtype == UNDEFID || ncvar->gridtype == GRID_GENERIC) && lunstructured )
ncvar->gridtype = GRID_UNSTRUCTURED;
......@@ -2631,7 +2638,7 @@ void cdf_define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
int gridID = ncvar->gridID;
if ( lproj )
if ( lproj && gmapvarid != UNDEFID )
{
int projID = lgrid ? grid->proj : gridID;
int ncid = ncvars[gmapvarid].ncid;
......
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