19 #include "pism/earth/greens.hh"
20 #include <gsl/gsl_integration.h>
21 #include <gsl/gsl_math.h>
22 #include <gsl/gsl_sf_bessel.h>
30 double ge_integrand(
unsigned ndim,
const double* args,
void* data) {
42 xi_shift = d->
p * dx - xi,
43 eta_shift = d->
q * dy - eta,
44 r = sqrt(xi_shift * xi_shift + eta_shift * eta_shift);
52 acc = gsl_interp_accel_alloc();
53 spline = gsl_spline_alloc(gsl_interp_linear,
N);
59 gsl_interp_accel_free(
acc);
64 return GE[0] / (
rmkm[1] * 1.0e3 * 1.0e12);
66 if (r >
rmkm[
N - 1] * 1.0e3) {
69 return gsl_spline_eval(
spline, r / 1.0e3,
acc) / (r * 1.0e12);
73 {0.0, 0.011, 0.111, 1.112, 2.224, 3.336, 4.448, 6.672, 8.896, 11.12,
74 17.79, 22.24, 27.80, 33.36, 44.48, 55.60, 66.72, 88.96, 111.2, 133.4,
75 177.9, 222.4, 278.0, 333.6, 444.8, 556.0, 667.2, 778.4, 889.6, 1001.0,
76 1112.0, 1334.0, 1779.0, 2224.0, 2780.0, 3336.0, 4448.0, 5560.0, 6672.0, 7784.0,
80 {-33.6488, -33.64, -33.56, -32.75, -31.86, -30.98, -30.12, -28.44, -26.87, -25.41,
81 -21.80, -20.02, -18.36, -17.18, -15.71, -14.91, -14.41, -13.69, -13.01, -12.31,
82 -10.95, -9.757, -8.519, -7.533, -6.131, -5.237, -4.660, -4.272, -3.999, -3.798,
83 -3.640, -3.392, -2.999, -2.619, -2.103, -1.530, -0.292, 0.848, 1.676, 2.083,
116 beta =
rho *
grav +
D * pow(kappa, 4.0),
117 expdiff = exp(-beta * t / (2.0 * eta * kappa)) - 1.0;
119 return expdiff * gsl_sf_bessel_J1(kappa * R0) * gsl_sf_bessel_J0(kappa * rk) / beta;
139 const double ABSTOL = 1.0e-10;
140 const double RELTOL = 1.0e-14;
141 const int N_gsl_workspace = 1000;
142 const int lengthpts = 142;
144 gsl_integration_workspace* w = gsl_integration_workspace_alloc(N_gsl_workspace);
147 std::vector<double> pts(lengthpts);
148 for (
int j=0; j < lengthpts-1; j++) {
149 pts[j] = pow(10.0, -3.0 - 0.05 * j);
151 pts[lengthpts-1] = 1.0e-14;
156 double result, error;
160 gsl_integration_qag (&
F, pts[1], 100.0*pts[1], ABSTOL, RELTOL, N_gsl_workspace,
161 GSL_INTEG_GAUSS21, w, &result, &error);
167 for (
int j = 0; j < lengthpts - 1; j++) {
168 gsl_integration_qag (&
F, pts[j+1], pts[j], ABSTOL, RELTOL, N_gsl_workspace,
169 GSL_INTEG_GAUSS21, w, &result, &error);
173 gsl_integration_workspace_free(w);
static const double rmkm[N]
double operator()(double r)
static const double GE[N]
double sum(const array::Scalar &input)
Sums up all the values in an array::Scalar object. Ignores ghosts.
double vd_integrand(double kappa, void *parameters)
Integrand defining the response of the viscous half-space model to a disc load.
double ge_integrand(unsigned ndim, const double *args, void *data)
The integrand in defining the elastic Green's function from the [Farrell] earth model.
double viscDisc(double t, double H0, double R0, double r, double rho, double rho_ice, double grav, double D, double eta)
Actually compute the response of the viscous half-space model in LingleClark, to a disc load.
static double F(double SL, double B, double H, double alpha)
Parameters used to access elastic Green's function from the [Farrell] earth model.
Parameters used to describe the response of the viscous half-space model to a disc load.