Skip to content

Commit

Permalink
Fix bug resulting in successive additions of vturb_add (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamkerr authored Oct 5, 2021
1 parent 43ccf74 commit 65105a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rh15d/hdf5atmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ void readAtmos_hdf5(int xi, int yi, Atmosphere *atmos, Geometry *geometry,
setTcut(atmos, geometry, input.p15d_tmax);
} else {
mpi.zcut = 0;
/*Free vturb in order to avoid successive addition of vturb_add.
This is done in realloc_ndep (called by setTcut) if 15D_DEFINE_ZCUT = TRUE*/
free(atmos->vturb);
atmos->vturb = (double *) calloc(atmos->Nspace , sizeof(double));
}

/* Memory dataspace, redefine for Nspace */
Expand Down

0 comments on commit 65105a9

Please sign in to comment.