Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed g_ncid as the ascociated bug was fixed in c library 4.4.1 #131

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cxx4/ncFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ using namespace std;
using namespace netCDF;
using namespace netCDF::exceptions;

int g_ncid = -1;

// destructor
NcFile::~NcFile()
Expand All @@ -31,7 +30,6 @@ void NcFile::close()
{
if (!nullObject) {
ncCheck(nc_close(myId),__FILE__,__LINE__);
g_ncid = -1;
}

nullObject = true;
Expand Down Expand Up @@ -65,7 +63,6 @@ void NcFile::open(const string& filePath, int ncFileFlags) {
close();

ncCheck(nc_open(filePath.c_str(), ncFileFlags, &myId),__FILE__,__LINE__);
g_ncid = myId;

nullObject=false;
}
Expand Down Expand Up @@ -95,7 +92,6 @@ void NcFile::open(const string& filePath, const FileMode fMode)
break;
}

g_ncid = myId;

nullObject=false;
}
Expand All @@ -117,7 +113,6 @@ void NcFile::create(const string& filePath, const int ncFileFlags) {

ncCheck(nc_create(filePath.c_str(),ncFileFlags,&myId),__FILE__,__LINE__);

g_ncid = myId;

nullObject=false;
}
Expand Down Expand Up @@ -159,7 +154,6 @@ void NcFile::open(const string& filePath, const FileMode fMode, const FileFormat
break;
}

g_ncid = myId;
nullObject=false;
}

Expand Down
5 changes: 2 additions & 3 deletions cxx4/ncType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "ncCheck.h"
using namespace std;

extern int g_ncid;

namespace netCDF {
// Global comparator operator ==============
Expand Down Expand Up @@ -99,7 +98,7 @@ string NcType::getName() const{
netcdf file ID (ncid), which is not *groupid*.
Working around this for now. */

ncCheck(nc_inq_type(g_ncid,myId,charName,sizep),__FILE__,__LINE__);
ncCheck(nc_inq_type(groupId,myId,charName,sizep),__FILE__,__LINE__);
return string(charName);

};
Expand All @@ -108,7 +107,7 @@ string NcType::getName() const{
size_t NcType::getSize() const{
char* charName=NULL;
size_t sizep;
ncCheck(nc_inq_type(g_ncid,myId,charName,&sizep),__FILE__,__LINE__);
ncCheck(nc_inq_type(groupId,myId,charName,&sizep),__FILE__,__LINE__);
return sizep;
};

Expand Down
6 changes: 0 additions & 6 deletions cxx4/ncType.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ namespace netCDF
/*! the group Id */
int groupId;

/*! An ncid associated with a particular open file
(returned from nc_open).
This is required by many of the functions ncType uses,
such as nc_inq_type */
int g_fileId;

};

}
Expand Down