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

local angular distributions #36

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6c5351f
add ability to generate histograms
jonahm-LANL Jul 10, 2024
1e4ad19
atomic!
jonahm-LANL Jul 10, 2024
bafaacc
oscillations in situ machinery seems to run
jonahm-LANL Nov 17, 2024
021287c
loop over photons broken with tracers. Now fixed.
jonahm-LANL Nov 18, 2024
14d9b3c
add local angular distributions to torus_cbc
jonahm-LANL Nov 18, 2024
5538e6e
darwin
jonahm-LANL Nov 18, 2024
e951146
fundamental flaw... coords only specified for Minkowski. now fixed.
jonahm-LANL Nov 18, 2024
437fbe3
Merge branch 'jmm/local-angular-distributions' of github.com:lanl/nub…
jonahm-LANL Nov 18, 2024
deaee4c
testing
jonahm-LANL Nov 19, 2024
2902ca7
whee
jonahm-LANL Nov 19, 2024
558dd53
infinity...
jonahm-LANL Nov 19, 2024
7445dfb
why is G = 0
jonahm-LANL Nov 19, 2024
9a8f349
pass in struct pointer???
jonahm-LANL Nov 19, 2024
722b6aa
fabs
jonahm-LANL Nov 19, 2024
8f97909
progress
jonahm-LANL Nov 19, 2024
993a836
try normalizing kspace
jonahm-LANL Nov 19, 2024
2b22cde
cleanup...
jonahm-LANL Nov 19, 2024
426e855
one more try
jonahm-LANL Nov 19, 2024
31d8c80
i > mu
jonahm-LANL Nov 19, 2024
534e4d5
should be gcov not gcon
jonahm-LANL Nov 19, 2024
8269258
cleanup
jonahm-LANL Nov 19, 2024
cdfff36
Support 4 species transport
jonahm-LANL Nov 21, 2024
4ec9374
fornax 1zone test modified for 4 species NuLib table
jonahm-LANL Nov 21, 2024
1bf5e6e
output local angles grid positions and mu
jonahm-LANL Nov 21, 2024
4da3b69
Define Gnu, moment types but don't set them yet. Refactor binning cod…
jonahm-LANL Nov 21, 2024
e9592fd
compute Gnu and moments
jonahm-LANL Nov 22, 2024
52b3dfe
Better include guards
jonahm-LANL Nov 22, 2024
90a3010
Cleanup...
jonahm-LANL Nov 22, 2024
cebaaed
dt and oscillations
jonahm-LANL Nov 23, 2024
ada6bdc
OSCILLATIONS
jonahm-LANL Nov 23, 2024
37c4ae9
oscillations doesn't depend on time. Make sure dt is in code units.
jonahm-LANL Nov 23, 2024
7b6f7e5
thread it through step.c
jonahm-LANL Nov 23, 2024
547ea4b
better formatting
jonahm-LANL Nov 23, 2024
fa23e77
multiscatt getting crazier...
jonahm-LANL Nov 23, 2024
5f824d9
starting oscillations setup. not done yet.
jonahm-LANL Nov 23, 2024
fa0112e
oops didn't mean to commit that
jonahm-LANL Nov 23, 2024
039644e
NuLib opacities
jonahm-LANL Nov 23, 2024
4bcc147
debugging, performance, cleanup
jonahm-LANL Nov 23, 2024
420f5f8
oscillations problem test works
jonahm-LANL Nov 23, 2024
903c927
simplify/cleanup
jonahm-LANL Nov 23, 2024
b55f1f8
automated test
jonahm-LANL Nov 23, 2024
be16433
revert intermediate fornax and multiscatt tests
jonahm-LANL Nov 23, 2024
f4631f1
can do it badly
jonahm-LANL Nov 25, 2024
c09f8a1
fix
jonahm-LANL Nov 25, 2024
cbb3f38
NOW the tests look right
jonahm-LANL Nov 28, 2024
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
5 changes: 5 additions & 0 deletions core/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
#define S4THW (S2THW * S2THW)
#define NUSIGMA0 (1.7611737037e-44) // Fundamental neutrino cross section

// Frequency scale of neutrino oscillations
#define ROOT2 (1.4142135623730951)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Square roots are slow in C

#define NUFERM (ROOT2*HBAR*HBAR*CL*CL*CL*GFERM)
#define PEQ (1./3.) // survival probability for equilibration

// Unit conversions
#define EV (1.60217653e-12) // Electron-volt
#define MEV (1.0e6 * EV) // Mega-Electron-Volt
Expand Down
12 changes: 11 additions & 1 deletion core/coord.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,12 @@ void set_points() {
stopx_rad[1] = startx_rad[1] + N1TOT * dx[1];
stopx_rad[2] = startx_rad[2] + N2TOT * dx[2];
stopx_rad[3] = startx_rad[3] + N3TOT * dx[3];
#endif
#if LOCAL_ANGULAR_DISTRIBUTIONS
local_dx1_rad = (stopx_rad[1] - startx_rad[1]) / (LOCAL_ANGLES_NX1);
local_dx2_rad = (stopx_rad[2] - startx_rad[2]) / (LOCAL_ANGLES_NX2);
local_dx_costh = 2. / (LOCAL_ANGLES_NMU);
#endif // LOCAL_ANGULAR_DISTRIBUTIONS
#endif // RADIATION
#elif METRIC == MKS
// Calculate some radii determined by the geometry
Reh = 1. + sqrt(1. - a * a);
Expand Down Expand Up @@ -435,6 +440,11 @@ void set_points() {
stopx_rad[1] = log(Rout_rad);
stopx_rad[2] = startx[2] + N2TOT * dx[2];
stopx_rad[3] = startx[3] + N3TOT * dx[3];
#if LOCAL_ANGULAR_DISTRIBUTIONS
local_dx1_rad = (stopx_rad[1] - startx_rad[1]) / (LOCAL_ANGLES_NX1);
local_dx2_rad = (stopx_rad[2] - startx_rad[2]) / (LOCAL_ANGLES_NX2);
local_dx_costh = 2. / (LOCAL_ANGLES_NMU);
#endif // LOCAL_ANGULAR_DISTRIBUTIONS
#endif
poly_norm = 0.5 * M_PI * 1. /
(1. + 1. / (poly_alpha + 1.) * 1. / pow(poly_xt, poly_alpha));
Expand Down
46 changes: 43 additions & 3 deletions core/decs.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@
#define RAD_TYPE_START (0)
#define TYPE_TRACER (-1)
#if RADIATION == RADTYPE_NEUTRINOS
#define RAD_NUM_TYPES (3)
#define NU_ELECTRON (0)
#define ANTINU_ELECTRON (1)
#define NU_HEAVY (2)
#define ANTINU_HEAVY (3)
#if MULTISCATT_TEST
#define RAD_SCATT_TYPES (3)
#else
Expand All @@ -183,12 +183,10 @@
#define RADG_YE (4)
#define RADG_YE_EM (5)
#elif RADIATION == RADTYPE_LIGHT
#define RAD_NUM_TYPES (1)
#define RAD_SCATT_TYPES (1)
#define NRADCOMP (0)
#define PHOTON (0)
#else
#define RAD_NUM_TYPES (0)
#define RAD_SCATT_TYPES (0)
#define NRADCOMP (0)
#endif
Expand Down Expand Up @@ -368,6 +366,27 @@ extern grid_radtype_type Nem_phys, Nabs_phys, radtype_buf;
extern grid_int_type Nsuper;
extern grid_double_type Esuper;
extern grid_prim_type psupersave;

#if LOCAL_ANGULAR_DISTRIBUTIONS
#define LOCAL_NUM_BASES (2)
#define MOMENTS_A (0)
#define MOMENTS_B (1)
Comment on lines +371 to +373
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to move these up...

typedef double grid_local_angles_type[LOCAL_NUM_BASES][LOCAL_ANGLES_NX1]
[LOCAL_ANGLES_NX2][RAD_NUM_TYPES]
[LOCAL_ANGLES_NMU];
extern grid_local_angles_type local_angles;
extern double local_dx1_rad, local_dx2_rad, local_dx_costh;

#if RAD_NUM_TYPES >= 4
typedef double grid_Gnu_type[LOCAL_NUM_BASES][LOCAL_ANGLES_NX1]
[LOCAL_ANGLES_NX2][LOCAL_ANGLES_NMU];
typedef double grid_local_moment_type[LOCAL_NUM_BASES][2][LOCAL_ANGLES_NX1]
[LOCAL_ANGLES_NX2];
extern grid_Gnu_type Gnu, local_stddev;
extern grid_local_moment_type local_moments;
#endif // #if RAD_NUM_TYPES >= 4
#endif // LOCAL_ANGULAR_DISTRIBUTIONS

#endif // RADIATION

// Default initialization is 0, which in this case is
Expand Down Expand Up @@ -671,6 +690,12 @@ extern int global_stop[NDIM];
#define JRADLOOP for (int n = 0; n < MAXNSCATT + 2; n++)
#define NULOOP for (int inu = 0; inu < NU_BINS + 1; inu++)

#define LOCALXLOOP \
for (int i = 0; i < LOCAL_ANGLES_NX1; ++i) \
for (int j = 0; j < LOCAL_ANGLES_NX2; ++j)
#define LOCALMULOOP for (int imu = 0; imu < LOCAL_ANGLES_NMU; ++imu)
#define LOCALXMULOOP LOCALXLOOP LOCALMULOOP

#define MY_MIN(fval1, fval2) (((fval1) < (fval2)) ? (fval1) : (fval2))
#define MY_MAX(fval1, fval2) (((fval1) > (fval2)) ? (fval1) : (fval2))
#define MY_SIGN(fval) (((fval) < 0.) ? -1. : 1.)
Expand Down Expand Up @@ -981,6 +1006,20 @@ double Jnu_hdf(double nu, int type, const struct of_microphysics *m);
double int_jnudnudOmega_hdf(const struct of_microphysics *m);
double alpha_nu_hdf(double nu, int type, const struct of_microphysics *m);
#endif // HDF opacities

// oscillations.c
#if RADIATION == RADTYPE_NEUTRINOS && LOCAL_ANGULAR_DISTRIBUTIONS
double get_dt_oscillations();
void get_local_angle_bins(
struct of_photon *ph, int *pi, int *pj, int *pmu1, int *pmu2);
void accumulate_local_angles();
#if RAD_NUM_TYPES >= 4
void compute_local_gnu(grid_local_angles_type local_angles,
grid_Gnu_type local_stddev, grid_Gnu_type gnu);
void compute_local_moments(grid_Gnu_type gnu, grid_local_moment_type moments);
void oscillate(grid_local_moment_type local_moments, grid_Gnu_type gnu);
#endif // RAD_NUM_TYPES >= 4
#endif // LOCAL_ANGULAR_DISTRIBUTIONS
#endif // RADIATION

// passive.c
Expand Down Expand Up @@ -1065,6 +1104,7 @@ void set_cooling_time(
void record_lepton_flux(const struct of_photon *ph);
void check_nu_type(const char *location);
int get_lepton_sign(const struct of_photon *ph);
int nu_is_heavy(const int radtype);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed for generalizing to 4 species transport

#endif // NEUTRINOS
#endif // RADIATION

Expand Down
9 changes: 9 additions & 0 deletions core/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ grid_radtype_type Nem_phys, Nabs_phys, radtype_buf;
grid_int_type Nsuper;
grid_double_type Esuper;
grid_prim_type psupersave;

#if LOCAL_ANGULAR_DISTRIBUTIONS
grid_local_angles_type local_angles;
double local_dx1_rad, local_dx2_rad, local_dx_costh;
#if RAD_NUM_TYPES >= 4
grid_Gnu_type Gnu, local_stddev;
grid_local_moment_type local_moments;
#endif // RAD_NUM_TYPES
#endif // LOCAL_ANGULAR_DISTRIBUTIONS
#endif // RADIATION

#if ELECTRONS
Expand Down
6 changes: 5 additions & 1 deletion core/diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,12 @@ void print_rad_types() {
rad_type_counts[NU_ELECTRON]);
fprintf(stdout, " ANTI %.2f %%\n",
rad_type_counts[ANTINU_ELECTRON]);
fprintf(stdout, " HEAVY %.2f %%\n",
fprintf(stdout, " X %.2f %%\n",
rad_type_counts[NU_HEAVY]);
#if RAD_NUM_TYPES > 3
fprintf(stdout, " ANTIX %.2f %%\n",
rad_type_counts[ANTINU_HEAVY]);
#endif
fprintf(stdout, "*********************************\n\n");
}
timer_stop(TIMER_DIAG);
Expand Down
176 changes: 166 additions & 10 deletions core/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void track_ph() {
hsize_t dims[1] = {num_tracked_buf};
hid_t space = H5Screate_simple(1, dims, NULL);
ph_dsets[n] = H5Dcreate(file_id, dsetnam, trackphfiletype, space,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Sclose(space);
}
if (num_tracked > 0)
Expand Down Expand Up @@ -637,6 +637,92 @@ void dump_grid() {
free(Lambda_h2cart_cov);
}

#if RADIATION
#if RADIATION == RADTYPE_NEUTRINOS && LOCAL_ANGULAR_DISTRIBUTIONS
{
double *local_angles_Xharm = safe_malloc(
(NDIM - 1) * LOCAL_ANGLES_NX1 * LOCAL_ANGLES_NX2 * sizeof(double));
#if METRIC == MKS
double *local_angles_Xbl = safe_malloc(
(NDIM - 1) * LOCAL_ANGLES_NX1 * LOCAL_ANGLES_NX2 * sizeof(double));
#endif // MKS
double *local_angles_Xcart = safe_malloc(
(NDIM - 1) * LOCAL_ANGLES_NX1 * LOCAL_ANGLES_NX2 * sizeof(double));
Comment on lines +643 to +650
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are diagnostics.

int n = 0;
double X[NDIM], Xcart[NDIM], r, th;
for (int i = 0; i < LOCAL_ANGLES_NX1; ++i) {
X[1] = startx_rad[1] + (i + 0.5) * local_dx1_rad; // startx is a face
for (int j = 0; j < LOCAL_ANGLES_NX2; ++j) {
X[2] = startx_rad[2] + (j + 0.5) * local_dx2_rad;
cart_coord(X, Xcart);

local_angles_Xharm[n + 0] = 0;
local_angles_Xharm[n + 1] = X[1];
local_angles_Xharm[n + 2] = X[2];

#if METRIC == MKS
bl_coord(X, &r, &th);
local_angles_Xbl[n + 0] = 0;
local_angles_Xbl[n + 1] = r;
local_angles_Xbl[n + 2] = th;
#endif // MKS

local_angles_Xcart[n + 0] = 0;
local_angles_Xcart[n + 1] = Xcart[1];
local_angles_Xcart[n + 2] = Xcart[2];

n += (NDIM - 1);
}
}
#define RANK (3)
hsize_t fdims[RANK] = {LOCAL_ANGLES_NX1, LOCAL_ANGLES_NX2, NDIM - 1};
hsize_t fstart[RANK] = {0, 0, 0};
hsize_t fcount[RANK] = {LOCAL_ANGLES_NX1, LOCAL_ANGLES_NX2, NDIM - 1};
hsize_t mdims[RANK] = {LOCAL_ANGLES_NX1, LOCAL_ANGLES_NX2, NDIM - 1};
hsize_t mstart[RANK] = {0, 0, 0};
if (!mpi_io_proc()) {
fcount[0] = 0;
fcount[1] = 0;
fcount[2] = 0;
}
WRITE_ARRAY(local_angles_Xharm, RANK, fdims, fstart, fcount, mdims, mstart,
TYPE_DBL);
free(local_angles_Xharm);

WRITE_ARRAY(local_angles_Xcart, RANK, fdims, fstart, fcount, mdims, mstart,
TYPE_DBL);
free(local_angles_Xcart);

#if METRIC == MKS
WRITE_ARRAY(
local_angles_Xbl, RANK, fdims, fstart, fcount, mdims, mstart, TYPE_DBL);
free(local_angles_Xbl);
#endif // MKS
#undef RANK
}

{
double *local_angles_mu = safe_malloc(LOCAL_ANGLES_NMU * sizeof(double));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diagnostics

for (int i = 0; i < LOCAL_ANGLES_NMU; ++i) {
local_angles_mu[i] = -1 + (i + 0.5) * local_dx_costh;
}
#define RANK (1)
hsize_t fdims[RANK] = {LOCAL_ANGLES_NMU};
hsize_t fstart[RANK] = {0};
hsize_t fcount[RANK] = {LOCAL_ANGLES_NMU};
hsize_t mdims[RANK] = {LOCAL_ANGLES_NMU};
hsize_t mstart[RANK] = {0};
if (!mpi_io_proc()) {
fcount[0] = 0;
}
WRITE_ARRAY(
local_angles_mu, RANK, fdims, fstart, fcount, mdims, mstart, TYPE_DBL);
#undef RANK
free(local_angles_mu);
}
#endif // RADIATION
#endif // LOCAL_ANGULAR_DISTRIBUTIONS

H5Fflush(file_id, H5F_SCOPE_GLOBAL);
H5Fclose(file_id);
}
Expand Down Expand Up @@ -816,7 +902,7 @@ void dump() {
hsize_t str_dims[1] = {NVAR};
hid_t prim_space = H5Screate_simple(1, str_dims, NULL);
hid_t str_attr = H5Acreate(
prim_dset, "vnams", strtype, prim_space, H5P_DEFAULT, H5P_DEFAULT);
prim_dset, "vnams", strtype, prim_space, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(str_attr, strtype, vnams);
H5Aclose(str_attr);
H5Sclose(prim_space);
Expand Down Expand Up @@ -975,6 +1061,76 @@ void dump() {
WRITE_ARRAY(nuLnu, RANK, fdims, fstart, fcount, mdims, mstart, TYPE_DBL);
#undef RANK
}

// local angle histograms
#if RADIATION == RADTYPE_NEUTRINOS && LOCAL_ANGULAR_DISTRIBUTIONS
accumulate_local_angles();
{
#define RANK (5)
hsize_t fdims[RANK] = {LOCAL_NUM_BASES, LOCAL_ANGLES_NX1,
LOCAL_ANGLES_NX2, RAD_NUM_TYPES, LOCAL_ANGLES_NMU};
hsize_t fstart[RANK] = {0, 0, 0, 0, 0};
hsize_t fcount[RANK] = {LOCAL_NUM_BASES, LOCAL_ANGLES_NX1,
LOCAL_ANGLES_NX2, RAD_NUM_TYPES, LOCAL_ANGLES_NMU};
hsize_t mdims[RANK] = {LOCAL_NUM_BASES, LOCAL_ANGLES_NX1,
LOCAL_ANGLES_NX2, RAD_NUM_TYPES, LOCAL_ANGLES_NMU};
hsize_t mstart[RANK] = {0, 0, 0, 0, 0};
if (!mpi_io_proc()) {
fcount[0] = 0;
fcount[1] = 0;
fcount[2] = 0;
fcount[3] = 0;
fcount[4] = 0;
}
WRITE_ARRAY(
local_angles, RANK, fdims, fstart, fcount, mdims, mstart, TYPE_DBL);
Comment on lines +1085 to +1086
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diagnostic

#undef RANK
}

{
#define RANK (4)
hsize_t fdims[RANK] = {LOCAL_NUM_BASES, LOCAL_ANGLES_NX1,
LOCAL_ANGLES_NX2, LOCAL_ANGLES_NMU};
hsize_t fstart[RANK] = {0, 0, 0, 0};
hsize_t fcount[RANK] = {LOCAL_NUM_BASES, LOCAL_ANGLES_NX1,
LOCAL_ANGLES_NX2, LOCAL_ANGLES_NMU};
hsize_t mdims[RANK] = {LOCAL_NUM_BASES, LOCAL_ANGLES_NX1,
LOCAL_ANGLES_NX2, LOCAL_ANGLES_NMU};
hsize_t mstart[RANK] = {0, 0, 0, 0};
if (!mpi_io_proc()) {
fcount[0] = 0;
fcount[1] = 0;
fcount[2] = 0;
fcount[3] = 0;
}
WRITE_ARRAY(Gnu,
RANK, fdims, fstart, fcount, mdims, mstart, TYPE_DBL);
WRITE_ARRAY(local_stddev,
RANK, fdims, fstart, fcount, mdims, mstart, TYPE_DBL);
Comment on lines +1106 to +1109
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diagnostics

#undef RANK
}

{
#define RANK (4)
hsize_t fdims[RANK] = {
LOCAL_NUM_BASES, 2, LOCAL_ANGLES_NX1, LOCAL_ANGLES_NX2};
hsize_t fstart[RANK] = {0, 0, 0, 0};
hsize_t fcount[RANK] = {
LOCAL_NUM_BASES, 2, LOCAL_ANGLES_NX1, LOCAL_ANGLES_NX2};
hsize_t mdims[RANK] = {
LOCAL_NUM_BASES, 2, LOCAL_ANGLES_NX1, LOCAL_ANGLES_NX2};
hsize_t mstart[RANK] = {0, 0, 0, 0};
if (!mpi_io_proc()) {
fcount[0] = 0;
fcount[1] = 0;
fcount[2] = 0;
fcount[3] = 0;
}
WRITE_ARRAY(
local_moments, RANK, fdims, fstart, fcount, mdims, mstart, TYPE_DBL);
Comment on lines +1129 to +1130
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A and B from Zaizan and Nakagura

#undef RANK
}
#endif // LOCAL_ANGULAR_DISTRIBUTIONS
#endif // RADIATION
}

Expand Down Expand Up @@ -1271,8 +1427,8 @@ void restart_write(int restart_type) {
hsize_t fcount[RANK] = {1};
hsize_t mdims[RANK] = {1};
hsize_t mstart[RANK] = {0};
int *particle_offsets = safe_malloc(1 * sizeof(int));
int *particle_counts = safe_malloc(1 * sizeof(int));
int * particle_offsets = safe_malloc(1 * sizeof(int));
int * particle_counts = safe_malloc(1 * sizeof(int));
particle_offsets[0] = npart_offset;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto formatting... oops but also 🤷

particle_counts[0] = npart_local;
WRITE_ARRAY(
Expand Down Expand Up @@ -1525,8 +1681,8 @@ void restart_read(char *fname) {
hsize_t fcount[RANK] = {1};
hsize_t mdims[RANK] = {1};
hsize_t mstart[RANK] = {0};
int *particle_offsets = safe_malloc(1 * sizeof(int));
int *particle_counts = safe_malloc(1 * sizeof(int));
int * particle_offsets = safe_malloc(1 * sizeof(int));
int * particle_counts = safe_malloc(1 * sizeof(int));
READ_ARRAY(
particle_offsets, RANK, fdims, fstart, fcount, mdims, mstart, TYPE_INT);
READ_ARRAY(
Expand Down Expand Up @@ -1774,9 +1930,9 @@ void dump_tracers() {
WRITE_HDR(ntracers, TYPE_INT);

// arrays to fil
int *id = safe_malloc(ntracers_local * sizeof(int));
int *it = safe_malloc(ntracers_local * sizeof(int));
int *active = safe_malloc(ntracers_local * sizeof(int));
int * id = safe_malloc(ntracers_local * sizeof(int));
int * it = safe_malloc(ntracers_local * sizeof(int));
int * active = safe_malloc(ntracers_local * sizeof(int));
double *time = safe_malloc(ntracers_local * sizeof(double));
double *mass = safe_malloc(ntracers_local * sizeof(double));
double *Xharm = safe_malloc(3 * ntracers_local * sizeof(double));
Expand Down Expand Up @@ -2072,7 +2228,7 @@ void write_array(void *data, const char *name, hsize_t rank, hsize_t *fdims,
H5Tset_size(string_type, strlen(data));
plist_id = H5Pcreate(H5P_DATASET_CREATE);
dset_id = H5Dcreate(file_id, name, string_type, filespace, H5P_DEFAULT,
plist_id, H5P_DEFAULT);
plist_id, H5P_DEFAULT);
H5Pclose(plist_id);
plist_id = H5Pcreate(H5P_DATASET_XFER);
H5Dwrite(dset_id, string_type, memspace, filespace, plist_id, data);
Expand Down
Loading
Loading