diff --git a/Programs/find_HII_bubbles.c b/Programs/find_HII_bubbles.c index 656b54e..61b2bdc 100644 --- a/Programs/find_HII_bubbles.c +++ b/Programs/find_HII_bubbles.c @@ -150,7 +150,7 @@ int main(int argc, char ** argv){ int x,y,z, N_min_cell, LAST_FILTER_STEP, num_th, arg_offset, i,j,k; unsigned long long ct, ion_ct, sample_ct; float f_coll_crit, pixel_volume, density_over_mean, erfc_num, erfc_denom, erfc_denom_cell, res_xH, Splined_Fcoll; - float *xH=NULL, *xH_m=NULL, TVIR_MIN, MFP, xHI_from_xrays, std_xrays, *z_re=NULL, *Gamma12=NULL, *mfp=NULL; + float *xH=NULL, TVIR_MIN, MFP, xHI_from_xrays, std_xrays, *z_re=NULL, *Gamma12=NULL, *mfp=NULL; fftwf_complex *M_coll_unfiltered=NULL, *M_coll_filtered=NULL, *deltax_unfiltered=NULL, *deltax_filtered=NULL, *xe_unfiltered=NULL, *xe_filtered=NULL; fftwf_complex *N_rec_unfiltered=NULL, *N_rec_filtered=NULL; fftwf_plan plan; @@ -197,7 +197,7 @@ Check that your inclusion (or not) of [] is consistent with t cell_length_factor = 1; } init_ps(); - init_MHR(); + if (INHOMO_RECO) { init_MHR();} init_21cmMC_arrays(); @@ -251,12 +251,12 @@ Check that your inclusion (or not) of [] is consistent with t // allocate memory for the neutral fraction box xH = (float *) fftwf_malloc(sizeof(float)*HII_TOT_NUM_PIXELS); - xH_m = (float *) fftwf_malloc(sizeof(float)*HII_TOT_NUM_PIXELS); - if (!xH || !xH_m){ + // xH_m = (float *) fftwf_malloc(sizeof(float)*HII_TOT_NUM_PIXELS); + if (!xH){ strcpy(error_message, "find_HII_bubbles.c: Error allocating memory for xH box\nAborting...\n"); goto CLEANUP; } - for (ct=0; ct] is consistent with t if (!(F = fopen(filename, "rb"))){ fprintf(stderr, "find_HII_bubbles: Unable to open x_e file at %s\nAborting...\n", filename); fprintf(LOG, "find_HII_bubbles: Unable to open x_e file at %s\nAborting...\n", filename); - fclose(LOG); fftwf_free(xH); fftwf_free(xH_m); fftwf_cleanup_threads(); + fclose(LOG); fftwf_free(xH); fftwf_cleanup_threads(); free_ps(); destroy_21cmMC_arrays(); return -1; } for (ct=0; ct] is consistent with t fprintf(stderr, "find_HII_bubbles.c: Write error occured while writting xH box.\n"); fprintf(LOG, "find_HII_bubbles.c: Write error occured while writting xH box.\n"); } - free_ps(); fclose(F); fclose(LOG); fftwf_free(xH); fftwf_free(xH_m); fftwf_cleanup_threads(); + free_ps(); fclose(F); fclose(LOG); fftwf_free(xH); fftwf_cleanup_threads(); destroy_21cmMC_arrays(); return (int) (global_xH * 100); } @@ -520,7 +520,6 @@ Check that your inclusion (or not) of [] is consistent with t fprintf(stderr, error_message); fprintf(LOG, error_message); fftwf_free(xH); - fftwf_free(xH_m); fftwf_free(z_re); fftwf_free(Gamma12); fclose(LOG); @@ -529,9 +528,8 @@ Check that your inclusion (or not) of [] is consistent with t fftwf_free(M_coll_unfiltered); fftwf_free(M_coll_filtered); fftwf_cleanup_threads(); - if (F){ fclose(F);} free_ps(); - free_MHR(); + if (INHOMO_RECO) { free_MHR();} fftwf_free(xe_filtered); fftwf_free(xe_unfiltered); fftwf_free(N_rec_unfiltered); @@ -936,25 +934,21 @@ Check that your inclusion (or not) of [] is consistent with t } - fprintf(stderr, error_message); - fprintf(LOG, error_message); fftwf_free(xH); - fftwf_free(xH_m); - fftwf_free(z_re); - fftwf_free(Gamma12); fclose(LOG); fftwf_free(deltax_unfiltered); fftwf_free(deltax_filtered); fftwf_free(M_coll_unfiltered); fftwf_free(M_coll_filtered); fftwf_cleanup_threads(); - if (F){ fclose(F);} free_ps(); - free_MHR(); - fftwf_free(xe_filtered); - fftwf_free(xe_unfiltered); + if (INHOMO_RECO) { free_MHR();} fftwf_free(N_rec_unfiltered); fftwf_free(N_rec_filtered); + fftwf_free(z_re); + fftwf_free(Gamma12); + fftwf_free(xe_filtered); + fftwf_free(xe_unfiltered); destroy_21cmMC_arrays(); return 0;