0

I would like to integrate a three dimensional function in Fortran using Quadpack:

function f(x,y,z)
...

I was thinking of something like this:

result = Integrate(B(x), a_x, b_x)
B(x0) = Integrate(C(x0,y), a_y, b_y)
C(x0, y0) = Integrate(f(x0,y0, z), a_z, b_z)

Quadpack expects a function of only one argument. How can I implement this in Fortran? Modules might do the trick, but is there something easier?

Stein
  • 3,179
  • 5
  • 27
  • 51
  • What did *you* try so far? – Alexander Vogt May 07 '16 at 15:51
  • I googled and realized that Fortran doesn't provide anonymous functions. I don't want a full code. I would like to know "the standard approach" – Stein May 07 '16 at 16:05
  • Also http://stackoverflow.com/questions/24391991/in-fortran-90-how-do-i-program-the-equivalent-of-a-handle-in-matlab and http://stackoverflow.com/questions/26297170/fortran-minimization-of-a-function-with-additional-arguments – Vladimir F Героям слава May 07 '16 at 17:03
  • You could use cubature integration like feynarts.de/cuba/ but you will have to calculate the Jacobian since it does integration over a unit hypercube. – slek120 Feb 23 '17 at 15:52

0 Answers0