Fixed. Simplified

This commit is contained in:
Guilhem Lavaux 2008-12-02 11:22:30 -06:00
parent 1fea6371e6
commit 88157e5687
3 changed files with 40 additions and 58 deletions

View file

@ -7,46 +7,6 @@
using namespace CosmoTool;
using namespace std;
OutputNetCDF::OutputNetCDF(NcFile *f, NcVar *v, long *dimList, uint32_t rank)
{
this->outFile = f;
this->curVar = v;
this->dimList = dimList;
this->rank = rank;
this->counts = new long[rank];
this->curPos = new long[rank];
for (long i = 0; i < rank; i++)
this->curPos[i] = 0;
for (long i = 0; i < rank; i++)
this->counts[i] = 1;
}
void OutputNetCDF::addDouble(double a)
{
curVar->set_cur(curPos);
curVar->put(&a, counts);
curPos[rank-1]++;
for (long i = rank-1; i >= 1; i--)
{
if (curPos[i] == dimList[i])
{
curPos[i-1]++;
curPos[i] = 0;
}
}
}
OutputNetCDF::~OutputNetCDF()
{
delete counts;
delete dimList;
delete curPos;
delete outFile;
}
class NetCDF_handle
{
public:

View file

@ -187,24 +187,6 @@ namespace CosmoTool
void loadArray(const char *fname,
T*& array, uint32_t *& dimList, uint32_t& rank);
void saveFloatArray(const char *fname,
float *array, uint32_t *dimList, uint32_t rank);
void loadFloatArray(const char *fname,
float *&array, uint32_t *&dimList, uint32_t& rank)
throw (NoSuchFileException);
void saveDoubleArray(const char *fname,
double *array, uint32_t *dimList, uint32_t rank);
void loadDoubleArray(const char *fname,
double *&array, uint32_t *&dimList, uint32_t& rank)
throw (NoSuchFileException);
void loadIntArray(const char *fname,
int *&array, uint32_t *&dimList, uint32_t& rank)
throw (NoSuchFileException);
void saveIntArray(const char *fname,
int *array, uint32_t *dimList, uint32_t rank);
ProgressiveDoubleOutput saveDoubleArrayProgressive(const char *fname, uint32_t *dimList, uint32_t rank);
};