Commit 1c6a5655 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Merge declarations and initialization in cdfDef{Complex|Timestep}.

parent 4228a779
...@@ -1054,9 +1054,7 @@ void cdfDefTime(stream_t* streamptr) ...@@ -1054,9 +1054,7 @@ void cdfDefTime(stream_t* streamptr)
void cdfDefTimestep(stream_t *streamptr, int tsID) void cdfDefTimestep(stream_t *streamptr, int tsID)
{ {
int vlistID; int vlistID = streamptr->vlistID;
vlistID = streamptr->vlistID;
if ( vlistHasTime(vlistID) ) cdfDefTime(streamptr); if ( vlistHasTime(vlistID) ) cdfDefTime(streamptr);
...@@ -1067,19 +1065,14 @@ static ...@@ -1067,19 +1065,14 @@ static
void cdfDefComplex(stream_t *streamptr, int gridID) void cdfDefComplex(stream_t *streamptr, int gridID)
{ {
char axisname[] = "nc2"; char axisname[] = "nc2";
int index;
int dimID = UNDEFID; int dimID = UNDEFID;
int gridID0, gridtype0, gridindex; int gridID0, gridtype0;
int ngrids; int vlistID = streamptr->vlistID;
int fileID; int fileID = streamptr->fileID;
int vlistID;
vlistID = streamptr->vlistID; int ngrids = vlistNgrids(vlistID);
fileID = streamptr->fileID;
ngrids = vlistNgrids(vlistID); for ( int index = 0; index < ngrids; index++ )
for ( index = 0; index < ngrids; index++ )
{ {
if ( streamptr->xdimID[index] != UNDEFID ) if ( streamptr->xdimID[index] != UNDEFID )
{ {
...@@ -1105,7 +1098,7 @@ void cdfDefComplex(stream_t *streamptr, int gridID) ...@@ -1105,7 +1098,7 @@ void cdfDefComplex(stream_t *streamptr, int gridID)
streamptr->ncmode = 2; streamptr->ncmode = 2;
} }
gridindex = vlistGridIndex(vlistID, gridID); int gridindex = vlistGridIndex(vlistID, gridID);
streamptr->xdimID[gridindex] = dimID; streamptr->xdimID[gridindex] = dimID;
} }
......
Supports Markdown
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