Skip to content

Commit

Permalink
Revert "Implement code to read new defaults parameter file"
Browse files Browse the repository at this point in the history
This reverts commit 907a21b.
  • Loading branch information
smutch authored Feb 1, 2024
1 parent f4c2e03 commit 86e6ef6
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ endif()

if(BUILD_TESTS)
enable_testing()
add_subdirectory(src/tests)
add_subdirectory(tests)
endif()


Expand Down
5 changes: 3 additions & 2 deletions input/params/defaults.par
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ ReionMaxHeatingRedshift : 30.
BirthCloudLifetime : 10e6 # yr
TargetSnaps : -1
RestBands : 1550,1650
BetaBands :
BetaBands :
InstantSfIII : 0 # 0 -> Continuous Pop.III SF, 1 -> Instantaneous Pop.III SF (crucial when computing the luminosity of PopIII galaxies)
DeltaT : 1.0 # Time at which the burst of PopIII SF happens since in the beginning of the snapshot (in Myr). Required only if InstantSfIII = 1
DeltaT : 1.0 # Time at which the burst of PopIII SF happens since in the beginning of the snapshot (in Myr)
# Required only if InstantSfIII = 1
3 changes: 1 addition & 2 deletions input/params/input.par
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FileNameGalaxies : meraxes
DefaultsFile : @INPUT_FILE_DIR@/defaults.par
SimParamsFile : @INPUT_FILE_DIR@/simulations/Genesis_L10_N2048_PopIII.par
DefaultsFile : @INPUT_FILE_DIR@/Tiamat.par
OutputSnapshots : -1
OutputDir : output
PhotometricTablesDir : @INPUT_FILE_DIR@/photometric_tables
Expand Down
194 changes: 194 additions & 0 deletions input/params/velociraptor_test.par
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
#------------------------------------------
#----- SA model output files --------------
#------------------------------------------
FileNameGalaxies : velociraptor_test

#------------------------------------------
#----- Simulation input files ------------
#------------------------------------------
SimName : VELOCIraptor Test
SimulationDir : /fred/oz013/simulations/SURFS_L40_N512
CatalogFilePrefix : VELOCIraptor.tree.t4.unifiedhalotree.withforestid.snap.hdf.data
TreesID : 0 # 0 -> VELOCIraptor; 1 -> gbpTrees
BoxSize : 40.0
VolumeFactor : 1.0

#------------------------------------------
#----- Code options -----------------------
#------------------------------------------
NSteps : 1 # Current version of code requires NSteps=1
FlagInteractive : 0
FlagSubhaloVirialProps : 0 # 0 -> approximate subhalo virial props using particle number; 1 -> use catalogue values
FlagMCMC : 0 # Don't do any writing and activate MCMC related routines
FlagIgnoreProgIndex : 0
RandomSeed : 1809 # seed for random number generator

#------------------------------------------
#----- Parameters of physical model -------
#------------------------------------------

# ----- star formation -----
SfDiskVelOpt : 1 # disk velocity for SF law (1=Vmax, 2=Vvir)
SfPrescription : 1 # C06 SF law

SfEfficiency : 0.08 # star formation efficiency Normalization
SfEfficiencyScaling : 0.0 # star formation efficiency Scaling

# ----------------------------------------------------------------
# ----- Pressure-based SF law from Blitz & Rosolowski 2006 -------
# ----------------------------------------------------------------
# SfPrescription == 2 and
# Different H2 Depletion Timescale:
# 1) SfEfficiencyScaling = 0, SfEfficiency = 0.15
# -> 2Gyr is sort of an average H2 depletion time (Bigiel+08, Leroy+09, Bigiel+11, Bollato+11, Saintonge+11)
# 2) SfEfficiencyScaling = 0, SfEfficiency = 1.0
# -> 300Gyr is sort of an average H2 depletion time (Duffy+17)
# 3) SfEfficiencyScaling = 1.06, SfEfficiency = 0.15
# -> 2Gyr at z=0 with redshift dependence SF timescale (Duffy+17)

SfCriticalSDNorm : 0.2 # critical surface density normalisation factor for star formation (internal units; standard=0.37)

# ----- supernova feedback -----
Flag_IRA : 0 # use the instantaneous recycling approximation
Flag_ReheatToFOFGroupTemp : 0 # try to reheat gas to the FOF group Tvir instead of just the subgroup value
SfRecycleFraction : 0.25 # instantaneous recycle fraction (IMF dependant) (only used when Flag_IRA=1)
Yield : 0.03 # mass of metals injected into ISM per unit star formation (only used when Flag_IRA=1)

# SnModel=1:
# -Use the Vmax scaling of Guo et al. 2011
# -Additional redshift factor of ((1 + z)/4)^SnEjectionRedshiftDep (SnReheatRedshiftDep)
# -SnReheatScaling2 and SnEjectionScaling2 are unused
# SnModel=2:
# -Mass loading factor follows Muratov et al. 2015. Use SnReheatScaling for high Vmax scaling and
# SnReheatScaling2 for low Vmax scaling
# -Energy coupling efficiency follows a similar form. Use SnEjectionScaling for high Vmax scaling
# and SnEjectionScaling2 for low Vmax scaling
# -SnEjectionNorm and SnReheatNorm are forced to be the same, and the input SnEjectionNorm is
# unused
# -Both factors has redshift dependence of ((1 + z)/4)^SnEjectionRedshiftDep (SnReheatRedshiftDep)

SnModel : 1
SnEjectionRedshiftDep : 0.0 # SN feedback gas reheating efficiency redshift scaling
SnEjectionEff : 0.5 # SN feedback gas reheating efficiency
SnEjectionScaling : 2.0 # SN feedback gas reheating efficiency scaling (with high Vmax)
SnEjectionScaling2 : 2.0 # SN feedback gas reheating efficiency scaling (with low Vmax)
SnEjectionNorm : 70.0 # SN feedback gas reheating efficiency norm (with Vmax [internal units])

SnReheatRedshiftDep : 0.0 # mass loading factor redshift scaling
SnReheatEff : 10.0 # mass loading factor for SN feedback
SnReheatLimit : 10.0 # maximum allowed mass loading factor for SN feedback
SnReheatScaling : 0.0 # mass loading factor for SN feedback scaling (with high Vmax)
SnReheatScaling2 : 0.0 # mass loading factor for SN feedback scaling2 (with low Vmax)
SnReheatNorm : 70.0 # mass loading factor for SN feedback scaling (with Vmax [internal units])

# ----- cooling -----
MaxCoolingMassFactor : 1.0 # maximum cooling mass factor (1 -> ff time)

# ----- reincorporation -----
# ReincorporationModel=1:
# -Reincorporation time is proportional to the halo dynamic time
# RecinorporationModel=2:
# -Reincorporation time scales with halo mass (Henriques et al. 2013), and is always larger than the
# halo dynamic time
# -ReincorporationEff adopts the definition in Henriques et al. 2013, which differs from the first case
# and should be in a unit of Myr
ReincorporationModel : 1
ReincorporationEff : 0.0 # gas reincorporation efficiency from ejected component

# ----- mergers -----
Flag_FixVmaxOnInfall : 0 # fix Vmax upon infall
Flag_FixDiskRadiusOnInfall : 0 # fix disk radius upon infall

ThreshMajorMerger : 0.3 # major merger when mass ratio greater than this
MergerTimeFactor : 0.5 # Multiplicitive fator for the merger timescales (2.0->DeLucia+; 1.0->Croton+)

MinMergerStellarMass : 1e-9 # Minimum stellar mass for a merger starburst and dynamical friction calc (internal units)
MinMergerRatioForBurst : 0.1 # Minimum mass ratio for merger driven star burst
MergerBurstFactor : 0.57 # Constant factor in merger burst equation
MergerBurstScaling : 0.7


#----- BlackHole and Quasar -----
Flag_BHFeedback : 1

RadioModeEff : 0.3
QuasarModeEff : 0.0005
BlackHoleGrowthRate : 0.05

EddingtonRatio : 1.0
BlackHoleSeed : 1e-7
BlackHoleMassLimitReion : -1
quasar_mode_scaling : 0.0
quasar_open_angle : 80.0


#----------------------------------------------
#----- Reionization ---------------------------
#----------------------------------------------

Flag_ReionizationModifier : 1 # 0: No modifier, 1: Sobacchi 21cmFAST modifier, 2: use halo mass dependant infall modifier of Gnedin, 3: precomputed (requires input file)

# global prescriptions
ReionSobacchi_Zre : 9.3
ReionSobacchi_DeltaZre : 1.0
ReionSobacchi_DeltaZsc : 2.0
ReionSobacchi_T0 : 5.0e4

ReionGnedin_z0 : 8
ReionGnedin_zr : 7

# patchy (21cmFAST) prescription
FFTW3WisdomDir :
Flag_PatchyReion : 1 # Use 21cmFAST (ensure Flag_ReionizationModifier=1 if wish to couple to galaxy formation).
Flag_OutputGrids : 1
Flag_OutputGridsPostReion : 0

ReionUVBFlag : 1 # Use 21cmFAST (ensure Flag_ReionizationModifier=1 if wish to couple to galaxy formation).
ReionGridDim : 128
ReionDeltaRFactor : 1.1
ReionFilterType : 0
ReionPowerSpecDeltaK : 0.1
ReionRtoMFilterType : 0

Y_He : 0.24
ReionRBubbleMin : 0.4068
ReionRBubbleMax : 20.34
ReionGammaHaloBias : 2.0
ReionAlphaUV : 5.0
ReionAlphaUVBH : 1.57

EscapeFracDependency : 1 # 0->none, 1->redshift, 2->stellar mass, 3->sfr, 4->cold gas surface density, 5->mvir, 6->ssfr
EscapeFracNorm : 0.06
EscapeFracRedshiftScaling : 0.5 # N.B. use EscapeFracDependency>1 and this = 0 to scale only with galaxy property (and not also with redshift)
EscapeFracPropScaling : 0.5
EscapeFracBHNorm : 1
EscapeFracBHScaling : 0

ReionSMParam_m0 : 0.18984 # internal units
ReionSMParam_a : 0.17
ReionSMParam_b : -2.1
ReionSMParam_c : 2.0
ReionSMParam_d : 2.5

ReionTcool : 1.0e4 # Kelvin
ReionNionPhotPerBary : 4000


#------------------------------------------------
#----- Cosmological and nbody sim parameters ----
#------------------------------------------------
OmegaM: 0.3121
OmegaK: 0.000
OmegaLambda: 0.6879
OmegaR: 0.0
BaryonFrac: 0.15714
Hubble_h: 0.6751
SpectralIndex: 0.968
Sigma8: 0.815
PartMass: 0.004130523
wLambda: -1.0
NPart: 134217728

UnitLength_in_cm : 3.08568e+24 # WATCH OUT : Mpc/h
UnitMass_in_g : 1.989e+43 # WATCH OUT : 10^10Msun/h
UnitVelocity_in_cm_per_s : 100000 # WATCH OUT : km/s
15 changes: 1 addition & 14 deletions src/core/read_params.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "meraxes.h"
#include "mlog.h"
#include "parse_paramfile.h"
#include <string.h>

Expand Down Expand Up @@ -149,11 +148,6 @@ void read_parameter_file(char* fname, int mode)
required_tag[n_param] = 1;
params_type[n_param++] = PARAM_TYPE_STRING;

strncpy(params_tag[n_param], "SimParamsFile", tag_length);
params_addr[n_param] = run_params->SimParamsFile;
required_tag[n_param] = 1;
params_type[n_param++] = PARAM_TYPE_STRING;

strncpy(params_tag[n_param], "OutputDir", tag_length);
params_addr[n_param] = run_params->OutputDir;
required_tag[n_param] = 1;
Expand Down Expand Up @@ -310,7 +304,7 @@ void read_parameter_file(char* fname, int mode)

strncpy(params_tag[n_param], "FFTW3WisdomDir", tag_length);
params_addr[n_param] = &(run_params->FFTW3WisdomDir);
required_tag[n_param] = 0;
required_tag[n_param] = 1;
params_type[n_param++] = PARAM_TYPE_STRING;
*(run_params->FFTW3WisdomDir) = '\0';

Expand Down Expand Up @@ -1233,17 +1227,10 @@ void read_parameter_file(char* fname, int mode)
// Parse the user parameter file first
n_entries = parse_paramfile(fname, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read input.par", MLOG_MESG);

// Now parse the default parameter file
n_entries = parse_paramfile(run_params->DefaultsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read defaults.par", MLOG_MESG);

// Finally, parse the simulation parameter file
n_entries = parse_paramfile(run_params->SimParamsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read sims file", MLOG_MESG);

// Check to see if we are missing any required parameters
for (ii = 0; ii < n_param; ii++)
Expand Down
1 change: 0 additions & 1 deletion src/meraxes.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ enum tree_ids
typedef struct run_params_t
{
char DefaultsFile[STRLEN];
char SimParamsFile[STRLEN];
char OutputDir[STRLEN];
char FileNameGalaxies[STRLEN];
char SimName[STRLEN];
Expand Down

0 comments on commit 86e6ef6

Please sign in to comment.