-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheader.h
153 lines (106 loc) · 3.43 KB
/
header.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//-- Misc. --//
double Interim, dummy;
int Index, local_Index, loopCount, lineNo;
//-- mull run -- //
int i, j, k;
int mull = 0;
//-- Cosmology -- //
double H_0;
double H_0inPerSec;
double HubbleTime;
const double gamma_GR = 0.545;
const double gamma_DGP = 11./16.;
// z - comoving distance data points for interpolation.
double z_eff;
double z_Array[1000];
double ComovingDistance_z[1000];
double z_ComovingDistance_2derivatives[1000]; // z_chi_2d.
double ComovingDistance_z_2derivatives[1000];
// Calculation of the age of the universe, leading to linear growth rate. Change to double precision.
double* AgeOftheUniverse; // Units of H_0
double* HubbleCnstWithTime;
// Calculation of the linear growth rate.
void (*pt2derivs)(float, float[], float[]) = NULL; // FLOAT?!
void (*pt2rkqs)(float [], float [], int, float *, float, float, float [], float *, float *, void (*)(float, float [], float[])) = NULL;
int nVar = 2;
float* yStartArray;
float* yFinalArray;
float* y2derivsStartArray;
int linearGrowth_nPoints;
float eps = 0.00001;
float defaultStepSize = 0.001;
float MinAllowedStepSize = 0.000001;
float InitialStartTime;
float FinalTime;
float Initial_lnScalefactor;
float Final_lnScalefactor;
// Defining declarations for these variables, with memory allocation xp[1..kmax] and yp[1..nvar][1..kmax]
// for the arrays, should be in the calling program.
double* Age2derivatives;
double* Om_mOfa;
double* f_Om_mOfa545;
double* f_Om_mOfa545_2derivs;
double* approx2linear_growthfactor;
double* lnAarray;
double* lnA2derivatives;
double* linear_growthfactor;
double* SplineParams_ofgrowthfactor;
double* SplineParams_ofgdot;
float* xVals;
float* length_scales;
float* gdot;
float* derivs_error;
float* Second_derivs;
float* Second_derivs_error;
float* Second_deriv_lengthscales;
float* SplineParams_ofgdotdot;
int nDerivs;
double growthfactor_today;
double approx_growthfactor_today;
double* HubbleConstant2derivatives;
//-- spline/splint real-space P(k) model --//
int pk_lineNo;
double* sdltk = NULL; // hod p(k).
double* sdltPk = NULL;
double* sdlt2d = NULL;
double* lineark = NULL; // Camb linear p(k)
double* linearPk = NULL;
double* linear2d = NULL;
double pk_hin; // power law index and amplitude for k<<1 and k>>1 extrapolations of real-space p(k).
double pk_lon;
double pk_hiA;
double pk_loA;
//-- VIPERS --//
int fieldFlag;
double TotalW1W4area;
double fracArea; // WX/Total area fraction.
double W1area;
double W4area;
double CentreRA;
double CentreDec;
int CatalogNumber;
// -- Clipping -- //
double u0, variance;
//-- Functions --//
double LegendrePolynomials(double x, int n);
double HubbleCnst(double z);
double (*pt2zChiIntegrand)(double);
double interp_nz(double);
double interp_comovingDistance(double z);
double interp_inverseComovingDistance(double r);
double AcceptedMax(double a[], bool b[], int n);
double AcceptedMin(double a[], bool b[], int n);
// -- Pointers -- //
double (*pt2nz)(double) = NULL;
char root_dir[200];
char filepath[200];
char outputdir[200];
FILE *output;
FILE *inputfile;
gsl_rng *gsl_ran_r; /* global generator */
const gsl_rng_type *gsl_ran_T;
double pi=3.14;
fftw_plan plan;
int max_gals;
fftw_complex *H_k;
time_t start_time;