Skip to content

Commit

Permalink
Output routines reorganized and bug for halo radius fixed (now in phy…
Browse files Browse the repository at this point in the history
…sical units rather than comoving)
  • Loading branch information
bmoster committed Apr 8, 2020
1 parent 092fcdc commit 90a4bd2
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 369 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ the redshift for all correlation functions must be the same (given at the start
## 6) Halo merger tree files

In addition to observed galaxy data, Emerge relies on simulated dark matter halo merger trees that will be populated with galaxies. The
files that containt these merger trees and their locations can be specified in the parameter file with the parameter `TreefileName`. The
files that contain these merger trees and their locations can be specified in the parameter file with the parameter `TreefileName`. The
suggested location for the merger tree files is the `trees` folder. If the trees are located in a single file, `TreefileName` corresponds
to the name of this file including folder, e.g. `trees/P100`. If the trees are stored within multiple files, `TreefileName` gives the file
base name, which will be appended with the file index, e.g. `trees/P100` corresponds to the files `P100.0`, `P100.1`, `P100.2`, `...`,
Expand Down
2 changes: 1 addition & 1 deletion src/allvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#define CODE "EMERGE" ///< Code name
#define BRANCH "master" ///< Branch name
#define VERSION "1.0.0" ///< Code version
#define VERSION "1.0.1" ///< Code version
#define SYMBOL '#' ///< Symbol used to start output lines

#define NSTRING 200 ///< Number of elements used for a generic string
Expand Down
2 changes: 1 addition & 1 deletion src/galaxies.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ float get_tdf(int ihalo, int imain)
dx = NEAREST(H[ihalo].pos[0]-H[imain].pos[0]);
dy = NEAREST(H[ihalo].pos[1]-H[imain].pos[1]);
dz = NEAREST(H[ihalo].pos[2]-H[imain].pos[2]);
rsat = sqrt(dx*dx+dy*dy+dz*dz);
rsat = sqrt(dx*dx+dy*dy+dz*dz)*H[imain].a;
clog = log(1.0+(H[imain].mvir+H[imain].mstar)/(H[ihalo].mvir+H[ihalo].mstar));
mu = (H[ihalo].mvir+H[ihalo].mstar)/(H[imain].mvir+H[imain].mstar);
tau = (H[imain].rvir*All.x_unit/vvir) * MPC_IN_KM / YR_IN_SEC / All.t_unit;
Expand Down
750 changes: 387 additions & 363 deletions src/output.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/read_trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ void empty_read_buffer(int offset, int hc)

H[offset + n].a = h[n].a;
H[offset + n].mvir = h[n].mvir/All.h_100/All.m_unit;;
H[offset + n].rvir = h[n].rvir/All.h_100/All.x_unit/1000.0;
H[offset + n].rvir = h[n].rvir/All.h_100/All.x_unit/1000.0*h[n].a;
H[offset + n].c = h[n].c;
H[offset + n].lambda = h[n].lambda;

Expand Down
25 changes: 23 additions & 2 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void read_parameterfile(char *fname)
#define MAXTAGS 300 ///< Maximum number of entries the parameter file can contain

FILE *fd;
char buf[200], buf1[200], buf2[200], buf3[200];
char buf[NSTRING], buf1[NSTRING], buf2[NSTRING], buf3[NSTRING];
int i, j, nt;
int id[MAXTAGS];
void *addr[MAXTAGS];
Expand Down Expand Up @@ -534,7 +534,7 @@ void read_parameterfile(char *fname)
void setup(void){

int i;
char buf[500], tmp1[NSTRING], *tmp2;
char buf[NSTRING], tmp1[NSTRING], *tmp2;

//Print a line
if (ThisTask == 0) printf("%s\n",All.fullline);
Expand Down Expand Up @@ -653,6 +653,27 @@ void setup(void){
{
if (All.verbose >= VERBOSE_MIN) printf("%s Creating output directory '%s'\n",All.startline,All.OutputDir);
}
#ifdef WRITE_GALAXY_CATALOG
sprintf(buf, "%s/galaxies", All.OutputDir);
if (mkdir(buf, 02755) == 0)
{
if (All.verbose >= VERBOSE_MIN) printf("%s Creating galaxy catalogue directory '%s'\n",All.startline,buf);
}
#endif
#ifdef WRITE_HALO_CATALOG
sprintf(buf, "%s/haloes", All.OutputDir);
if (mkdir(buf, 02755) == 0)
{
if (All.verbose >= VERBOSE_MIN) printf("%s Creating halo catalogue directory '%s'\n",All.startline,buf);
}
#endif
#ifdef WRITE_MAINBRANCH
sprintf(buf, "%s/mainbranches", All.OutputDir);
if (mkdir(buf, 02755) == 0)
{
if (All.verbose >= VERBOSE_MIN) printf("%s Creating mainbranch directory '%s'\n",All.startline,buf);
}
#endif
}

//Open all log files
Expand Down
Binary file modified user-guide.pdf
Binary file not shown.

0 comments on commit 90a4bd2

Please sign in to comment.