diff --git a/CMakeLists.txt b/CMakeLists.txt index f3ba64d7..f4020cc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,10 @@ option(GDB "Drop into GDB with mpi_debug_here() calls" OFF) option(ENABLE_PROFILING "Enable profiling of executable with gperftools." OFF) option(USE_CUDA "Build with CUDA support for reionization calculations" OFF) +# Some build options clash with each other +if(USE_CUDA AND USE_MINI_HALOS) + message(FATAL_ERROR "The GPU reionization implementation does not currently support minihalos physics") +endif() # Build type set(default_build_type "RelWithDebInfo") diff --git a/src/core/BrightnessTemperature.c b/src/core/BrightnessTemperature.c index 4382bfaf..2453a81a 100644 --- a/src/core/BrightnessTemperature.c +++ b/src/core/BrightnessTemperature.c @@ -21,8 +21,8 @@ * highlight the contribution of Pop III stars). By Manu Ventura. */ -void ComputeBrightnessTemperatureBox(int snapshot) // - // +void ComputeBrightnessTemperatureBox(int snapshot) // + // { int ii, jj, kk, i_real, i_padded, iii; diff --git a/src/core/ComputeTs.c b/src/core/ComputeTs.c index 9d3c67f4..af34ca16 100644 --- a/src/core/ComputeTs.c +++ b/src/core/ComputeTs.c @@ -552,8 +552,8 @@ void _ComputeTs(int snapshot) Luminosity_converstion_factor_GAL *= (SEC_PER_YEAR) / (PLANCK); - // Do the same for Pop III. - + // Do the same for Pop III. + #if USE_MINI_HALOS if (fabs(run_globals.params.physics.SpecIndexXrayIII - 1.0) < 0.000001) { Luminosity_converstion_factor_III = diff --git a/src/core/dracarys.c b/src/core/dracarys.c index 6f1a8123..cdde5fba 100644 --- a/src/core/dracarys.c +++ b/src/core/dracarys.c @@ -15,7 +15,7 @@ #include "metal_evo.h" #include "read_grids.h" #include "stellar_feedback.h" -#include "virial_properties.h" +#include "virial_properties.h" #endif #include "save.h" #include "tree_flags.h" diff --git a/src/core/metal_evo.c b/src/core/metal_evo.c index 49251945..7c984921 100644 --- a/src/core/metal_evo.c +++ b/src/core/metal_evo.c @@ -548,9 +548,7 @@ int map_galaxies_to_slabs_metals(int ngals) return gal_counter; } -void assign_probability_to_galaxies(int ngals_in_metal_slabs, - int snapshot, - int flag_property) +void assign_probability_to_galaxies(int ngals_in_metal_slabs, int snapshot, int flag_property) { // Same way in which we assing Mcrit due to Reio and LW feedback in reionization.c @@ -844,7 +842,7 @@ void assign_probability_to_galaxies(int ngals_in_metal_slabs, if (flag_property == 2) { gal->Gas_IGM = (double)buffer_metals[grid_index(ix, iy, iz, MetalGridDim, INDEX_REAL)]; - gal->Metallicity_IGM = calc_metallicity(gal->Gas_IGM, gal->Metals_IGM); + gal->Metallicity_IGM = calc_metallicity(gal->Gas_IGM, gal->Metals_IGM); } if (flag_property == 3) diff --git a/src/core/read_grids.c b/src/core/read_grids.c index 07dcfcbc..38bebd75 100644 --- a/src/core/read_grids.c +++ b/src/core/read_grids.c @@ -55,8 +55,7 @@ double calc_resample_factor(int n_cell[3]) } #if USE_MINI_HALOS -void smooth_Densitygrid_real( - int snapshot) // Need this to put the overdensity in the metal grid. +void smooth_Densitygrid_real(int snapshot) // Need this to put the overdensity in the metal grid. { mlog("Smoothing the overdensity of the reionization grid into the metal grid...", MLOG_MESG); reion_grids_t* reiogrids = &(run_globals.reion_grids); diff --git a/src/core/read_halos-velociraptor.c b/src/core/read_halos-velociraptor.c index e3bf260d..4789fbc7 100644 --- a/src/core/read_halos-velociraptor.c +++ b/src/core/read_halos-velociraptor.c @@ -319,16 +319,16 @@ void read_trees__velociraptor(int snapshot, // fof_group->Mvir = tree_entry.Mass_FOF; // fof_group->Rvir = -1; } else { - if ((tree_entry.Mass_200crit >= tree_entry.Mass_FOF) || (tree_entry.Mass_200crit < tree_entry.Mass_tot)) { - // Adding this since we found an issue in the N-body - fof_group->Mvir = tree_entry.Mass_FOF; - fof_group->Rvir = -1; - } - - else { - fof_group->Mvir = tree_entry.Mass_200crit; - fof_group->Rvir = tree_entry.R_200crit; - } + if ((tree_entry.Mass_200crit >= tree_entry.Mass_FOF) || (tree_entry.Mass_200crit < tree_entry.Mass_tot)) { + // Adding this since we found an issue in the N-body + fof_group->Mvir = tree_entry.Mass_FOF; + fof_group->Rvir = -1; + } + + else { + fof_group->Mvir = tree_entry.Mass_200crit; + fof_group->Rvir = tree_entry.R_200crit; + } } fof_group->Vvir = -1; fof_group->FOFMvirModifier = 1.0; diff --git a/src/core/reionization.c b/src/core/reionization.c index 0f9fb953..1e2d3a95 100644 --- a/src/core/reionization.c +++ b/src/core/reionization.c @@ -1150,7 +1150,7 @@ int map_galaxies_to_slabs(int ngals) return gal_counter; } -void assign_Mvir_crit_to_galaxies(int ngals_in_slabs, int flag_feed) +void assign_Mvir_crit_to_galaxies(int ngals_in_slabs, int flag_feed) // flag = 1 Reio feedback, flag = 2 LW feedback { // N.B. We are assuming here that the galaxy_to_slab mapping has been sorted diff --git a/src/core/stellar_feedback.c b/src/core/stellar_feedback.c index 5c8e96de..bd30f384 100644 --- a/src/core/stellar_feedback.c +++ b/src/core/stellar_feedback.c @@ -180,11 +180,10 @@ double get_total_SN_energy(void) #if USE_MINI_HALOS // Stuff for Pop. III feedback -double get_SN_energy_PopIII( - int i_burst, - int snapshot, - int SN_type) // SN_type = 0 -> CC, 1 -> PISN - // Pop. III have higher masses so we need to account also for PISN! +double get_SN_energy_PopIII(int i_burst, + int snapshot, + int SN_type) // SN_type = 0 -> CC, 1 -> PISN + // Pop. III have higher masses so we need to account also for PISN! { double NumberPISN = run_globals.NumberPISN; double NumberSNII = run_globals.NumberSNII; @@ -193,9 +192,7 @@ double get_SN_energy_PopIII( if (SN_type == 0) { Enova = ENOVA_CC; double CC_Fraction = CCSN_PopIII_Fraction(i_burst, snapshot, 0); - return Enova * CC_Fraction * NumberSNII * 1e10 / - run_globals.params - .Hubble_h; // result in erg * (1e10 Msol / h) + return Enova * CC_Fraction * NumberSNII * 1e10 / run_globals.params.Hubble_h; // result in erg * (1e10 Msol / h) } // PISN (feedback here is contemporaneous). else if (SN_type == 1) {