92 real** offload_array,
char* qid) {
94 #define PLSPATH "/plasma/plasma_1D_XXXXXXXXXX/"
99 f, qid, __FILE__, __LINE__) ) {
return 1;}
101 f, qid, __FILE__, __LINE__) ) {
return 1;}
104 offload_data->
n_rho = n_rho;
114 f, qid, __FILE__, __LINE__) ) {
return 1;}
116 f, qid, __FILE__, __LINE__) ) {
return 1;}
119 f, qid, __FILE__, __LINE__) ) {
return 1;}
120 for(
int i = 0; i < n_ions; i++) {
125 f, qid, __FILE__, __LINE__) ) {
return 1;}
126 for(
int i = 0; i < n_ions; i++) {
134 *offload_array = (
real*) malloc(
sizeof(
real)
139 real* rho = &(*offload_array)[0];
140 real* temp_e = &(*offload_array)[n_rho];
141 real* temp_i = &(*offload_array)[n_rho*2];
142 real* dens_e = &(*offload_array)[n_rho*3];
143 real* dens_i = &(*offload_array)[n_rho*4];
147 f, qid, __FILE__, __LINE__) ) {
return 1;}
149 f, qid, __FILE__, __LINE__) ) {
return 1;}
151 f, qid, __FILE__, __LINE__) ) {
return 1;}
153 f, qid, __FILE__, __LINE__) ) {
return 1;}
155 f, qid, __FILE__, __LINE__) ) {
return 1;}
157 for(
int i = 0; i < n_rho; i++) {
158 temp_e[i] = temp_e[i] *
CONST_E;
159 temp_i[i] = temp_i[i] *
CONST_E;
176 real** offload_array,
char* qid) {
178 #define PLSPATH "/plasma/plasma_1Dt_XXXXXXXXXX/"
181 int n_rho, n_time, n_ions, n_species;
183 f, qid, __FILE__, __LINE__) ) {
return 1;}
185 f, qid, __FILE__, __LINE__) ) {
return 1;}
187 f, qid, __FILE__, __LINE__) ) {
return 1;}
189 n_species = n_ions + 1;
191 offload_data->
n_rho = n_rho;
192 offload_data->
n_time = n_time;
202 f, qid, __FILE__, __LINE__) ) {
return 1;}
204 f, qid, __FILE__, __LINE__) ) {
return 1;}
207 f, qid, __FILE__, __LINE__) ) {
return 1;}
208 for(
int i = 0; i < n_ions; i++) {
213 f, qid, __FILE__, __LINE__) ) {
return 1;}
214 for(
int i = 0; i < n_ions; i++) {
221 n_rho + n_time + 2*n_time*n_rho + n_time*offload_data->
n_species*n_rho;
222 *offload_array = (
real*) malloc(
sizeof(
real)
227 real* rho = &(*offload_array)[0];
228 real* time = &(*offload_array)[n_rho];
229 real* temp = &(*offload_array)[n_rho+n_time];
230 real* dens = &(*offload_array)[n_rho+n_time+n_time*n_rho*2];
234 f, qid, __FILE__, __LINE__) ) {
return 1;}
236 f, qid, __FILE__, __LINE__) ) {
return 1;}
240 real* temp_e_in = (
real*) malloc(n_time*n_rho*
sizeof(
real));
241 real* temp_i_in = (
real*) malloc(n_time*n_rho*
sizeof(
real));
244 f, qid, __FILE__, __LINE__) ) {
return 1;}
246 f, qid, __FILE__, __LINE__) ) {
return 1;}
248 for(
int i_time = 0; i_time < n_time; i_time++) {
249 for(
int i_rho = 0; i_rho < n_rho; i_rho++) {
251 temp[i_time*2*n_rho+i_rho]
252 = temp_e_in[i_time*n_rho + i_rho] *
CONST_E;
255 temp[i_time*2*n_rho+n_rho+i_rho]
256 = temp_i_in[i_time*n_rho + i_rho] *
CONST_E;
265 real* dens_e_in = (
real*) malloc(n_time*n_rho*
sizeof(
real));
266 real* dens_i_in = (
real*) malloc(n_time*n_ions*n_rho*
sizeof(
real));
269 f, qid, __FILE__, __LINE__) ) {
return 1;}
271 f, qid, __FILE__, __LINE__) ) {
return 1;}
273 for(
int i_time = 0; i_time < n_time; i_time++) {
274 for(
int i_species = 0; i_species < (n_ions+1); i_species++) {
275 for(
int i_rho = 0; i_rho < n_rho; i_rho++) {
278 dens[i_time*n_species*n_rho+i_species*n_rho+i_rho]
279 = dens_e_in[i_time*n_rho + i_rho];
283 dens[i_time*n_species*n_rho+i_species*n_rho+i_rho]
284 = dens_i_in[i_time*(n_ions*n_rho)+(i_species-1)*n_rho
310 real** offload_array,
char* qid) {
313 #define PLSPATH "/plasma/plasma_1DS_XXXXXXXXXX/"
318 f, qid, __FILE__, __LINE__) ) {
return 1;}
320 f, qid, __FILE__, __LINE__) ) {
return 1;}
322 f, qid, __FILE__, __LINE__) ) {
return 1;}
324 f, qid, __FILE__, __LINE__) ) {
return 1;}
327 n_rho = offload_data->
n_rho;
338 f, qid, __FILE__, __LINE__) ) {
return 1;}
340 f, qid, __FILE__, __LINE__) ) {
return 1;}
343 f, qid, __FILE__, __LINE__) ) {
return 1;}
344 for(
int i = 0; i < n_ions; i++) {
349 f, qid, __FILE__, __LINE__) ) {
return 1;}
350 for(
int i = 0; i < n_ions; i++) {
358 *offload_array = (
real*) malloc(
sizeof(
real)
363 real* temp_e = &(*offload_array)[0];
364 real* temp_i = &(*offload_array)[n_rho*1];
365 real* dens_e = &(*offload_array)[n_rho*2];
366 real* dens_i = &(*offload_array)[n_rho*3];
370 f, qid, __FILE__, __LINE__) ) {
return 1;}
372 f, qid, __FILE__, __LINE__) ) {
return 1;}
374 f, qid, __FILE__, __LINE__) ) {
return 1;}
376 f, qid, __FILE__, __LINE__) ) {
return 1;}
378 for(
int i = 0; i < n_rho; i++) {
379 temp_e[i] = temp_e[i] *
CONST_E;
380 temp_i[i] = temp_i[i] *
CONST_E;
int hdf5_read_double(const char *var, real *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read double-valued data from ASCOT5 HDF5 file.
int hdf5_read_int(const char *var, int *ptr, hid_t file, char *qid, const char *errfile, int errline)
Read int-valued data from ASCOT5 HDF5 file.