Skip to content
Open
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
24 changes: 16 additions & 8 deletions model/kharma/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,6 @@ void output_hdf5()
double game = atof(dict_get(model_params, "game", NULL));
double gamp = atof(dict_get(model_params, "gamp", NULL));
}
double hslope = atof(dict_get(model_params, "hslope", NULL));

const char *coord_system = dict_get(model_params, "coordinate_system", NULL);
if (coord_system) {
Expand All @@ -1987,7 +1986,14 @@ void output_hdf5()
} else {
metric[0] = '\0';
}
double mks_smooth = atof(dict_get(model_params, "mks_smooth", NULL));
if (strcmp(metric, "mks") == 0) {
double hslope = atof(dict_get(model_params, "hslope", NULL));
}
if (strcmp(metric, "fmks") == 0) {
double mks_smooth = atof(dict_get(model_params, "mks_smooth", NULL));
double poly_alpha = atof(dict_get(model_params, "poly_alpha", NULL));
double poly_xt = atof(dict_get(model_params, "poly_xt", NULL));
}
int ncycle = atoi(dict_get(model_params, "ncycle", NULL));
int nghost = atoi(dict_get(model_params, "nghost", NULL));
int nx1 = atoi(dict_get(model_params, "nx1", NULL));
Expand All @@ -1996,8 +2002,6 @@ void output_hdf5()
int nx1_mb = atoi(dict_get(model_params, "nx1_mb", NULL));
int nx2_mb = atoi(dict_get(model_params, "nx2_mb", NULL));
int nx3_mb = atoi(dict_get(model_params, "nx3_mb", NULL));
double poly_alpha = atof(dict_get(model_params, "poly_alpha", NULL));
double poly_xt = atof(dict_get(model_params, "poly_xt", NULL));
const char *problem_id = dict_get(model_params, "problem_id", NULL);
char problem[STRLEN];
if (problem_id) {
Expand Down Expand Up @@ -2043,8 +2047,14 @@ void output_hdf5()
hdf5_write_single_val(&game, "game", H5T_IEEE_F64LE);
hdf5_write_single_val(&gamp, "gamp", H5T_IEEE_F64LE);
hdf5_write_single_val(&gamma, "gamma", H5T_IEEE_F64LE);
hdf5_write_single_val(&hslope, "hslope", H5T_IEEE_F64LE);
hdf5_write_single_val(&mks_smooth, "mks_smooth", H5T_IEEE_F64LE);
if (strcmp(metric, "mks") == 0) {
hdf5_write_single_val(&hslope, "hslope", H5T_IEEE_F64LE);
}
if (strcmp(metric, "fmks") == 0) {
hdf5_write_single_val(&mks_smooth, "mks_smooth", H5T_IEEE_F64LE);
hdf5_write_single_val(&poly_alpha, "poly_alpha", H5T_IEEE_F64LE);
hdf5_write_single_val(&poly_xt, "poly_xt", H5T_IEEE_F64LE);
}
hdf5_write_single_val(&ncycle, "ncycle", H5T_STD_I32LE);
hdf5_write_single_val(&nghost, "nghost", H5T_STD_I32LE);
hdf5_write_single_val(&nx1, "nx1", H5T_STD_I32LE);
Expand All @@ -2053,8 +2063,6 @@ void output_hdf5()
hdf5_write_single_val(&nx1_mb, "nx1_mb", H5T_STD_I32LE);
hdf5_write_single_val(&nx2_mb, "nx2_mb", H5T_STD_I32LE);
hdf5_write_single_val(&nx3_mb, "nx3_mb", H5T_STD_I32LE);
hdf5_write_single_val(&poly_alpha, "poly_alpha", H5T_IEEE_F64LE);
hdf5_write_single_val(&poly_xt, "poly_xt", H5T_IEEE_F64LE);

H5Tset_size(str_type, strlen(problem) + 1);
H5Tset_strpad(str_type, H5T_STR_NULLTERM);
Expand Down