1 |
|
|
2 |
/******************************************************* |
/***************************************************************************** |
3 |
* |
* |
4 |
* Copyright (c) 2003-2010 by University of Queensland |
* Copyright (c) 2003-2014 by University of Queensland |
5 |
* Earth Systems Science Computational Center (ESSCC) |
* http://www.uq.edu.au |
|
* http://www.uq.edu.au/esscc |
|
6 |
* |
* |
7 |
* Primary Business: Queensland, Australia |
* Primary Business: Queensland, Australia |
8 |
* Licensed under the Open Software License version 3.0 |
* Licensed under the Open Software License version 3.0 |
9 |
* http://www.opensource.org/licenses/osl-3.0.php |
* http://www.opensource.org/licenses/osl-3.0.php |
10 |
* |
* |
11 |
*******************************************************/ |
* Development until 2012 by Earth Systems Science Computational Center (ESSCC) |
12 |
|
* Development 2012-2013 by School of Earth Sciences |
13 |
|
* Development from 2014 by Centre for Geoscience Computing (GeoComp) |
14 |
|
* |
15 |
|
*****************************************************************************/ |
16 |
|
|
17 |
#include <weipa/DataVar.h> |
#include <weipa/DataVar.h> |
18 |
#include <weipa/DomainChunk.h> |
#include <weipa/DomainChunk.h> |
142 |
initialized = false; |
initialized = false; |
143 |
} |
} |
144 |
|
|
145 |
|
// special case: shape=(1,) or shape=(1,1) -> convert to scalar |
146 |
|
if (dimSize==1 && rank>0) { |
147 |
|
rank=0; |
148 |
|
shape.clear(); |
149 |
|
} |
150 |
|
|
151 |
if (initialized) { |
if (initialized) { |
152 |
size_t dataSize = dimSize * ptsPerSample; |
size_t dataSize = dimSize * ptsPerSample; |
153 |
float* tempData = new float[dataSize*numSamples]; |
float* tempData = new float[dataSize*numSamples]; |