C
Charles Banas
I'm not sure if this is the right place to ask about this, but I've
seen several posts in the past regarding Akima's Bivariate
Interpolations routines, and i'm wondering if someone can give me some
ideas or PD code I can put to use right away.
At the moment, I'm maintaining a contour calculation and plotting
program for radio wave propagation studies. This program uses a
number of routines written by and for the FCC in Fortran in 1976 for
their Univac machine. It was more recently used on VAX machines, and
is now used on Sun Sparc stations. The code I'm using is directly
from FCC/OCE report RS76-01, January 1976. It has numerical tables
calculated from an unspecified bivariate polynomial, which are
interpolated using Akima's Bivariate Interpolation for Smooth Surface
Fitting algorithm.
Unfortunately, due to the nature of the code, I've been forced to
rewrite the code form its original Fortran V to much cleaner C.
(Actually, I've been using ISO C++, but that's beside the point.) My
problem is this: Akima's routine is extremely cryptic and
uncommented, impossible to compile with the tools I have available
(mostly stemming from the complexity of the EQUIVALENCE statements he
used), and so, is very hard to rewrite into C.
I tried just diving into a rewrite, but the biggest issue I ran across
was the way the DIMENSIONed arrays are accessed:
The routine has numerous 2-dimensional arrays that are being accessed
as one-dimensional arrays and then aliased with simple variables.
Since I'm very unfamiliar with Fortran's underpinnings and quirks, I'm
having a hard time with the code. And, unfortunately, because of the
turn this project took, I need it rewritten in C.
I have tried using f2c to translate the routine directly into C, but
I'm quite uncomfortable with how messy the code is, and I honestly
don't trust f2c all that much. (Especially since f2c returned with
well over 40 warnings.)
The name of the routine is ITPLBV, and this version has only 10
parameters. I'm wondering if anyone here knows of an existing
(non-f2c) C version of the routine - possibly one written by Akima
himself? Or maybe someone here is familiar enough with Fortran to
give me some insight on how to treat these 2-dimensional arrays in C?
I'd appreciate anything anyone has to say.
-- Charles Banas
seen several posts in the past regarding Akima's Bivariate
Interpolations routines, and i'm wondering if someone can give me some
ideas or PD code I can put to use right away.
At the moment, I'm maintaining a contour calculation and plotting
program for radio wave propagation studies. This program uses a
number of routines written by and for the FCC in Fortran in 1976 for
their Univac machine. It was more recently used on VAX machines, and
is now used on Sun Sparc stations. The code I'm using is directly
from FCC/OCE report RS76-01, January 1976. It has numerical tables
calculated from an unspecified bivariate polynomial, which are
interpolated using Akima's Bivariate Interpolation for Smooth Surface
Fitting algorithm.
Unfortunately, due to the nature of the code, I've been forced to
rewrite the code form its original Fortran V to much cleaner C.
(Actually, I've been using ISO C++, but that's beside the point.) My
problem is this: Akima's routine is extremely cryptic and
uncommented, impossible to compile with the tools I have available
(mostly stemming from the complexity of the EQUIVALENCE statements he
used), and so, is very hard to rewrite into C.
I tried just diving into a rewrite, but the biggest issue I ran across
was the way the DIMENSIONed arrays are accessed:
The routine has numerous 2-dimensional arrays that are being accessed
as one-dimensional arrays and then aliased with simple variables.
Since I'm very unfamiliar with Fortran's underpinnings and quirks, I'm
having a hard time with the code. And, unfortunately, because of the
turn this project took, I need it rewritten in C.
I have tried using f2c to translate the routine directly into C, but
I'm quite uncomfortable with how messy the code is, and I honestly
don't trust f2c all that much. (Especially since f2c returned with
well over 40 warnings.)
The name of the routine is ITPLBV, and this version has only 10
parameters. I'm wondering if anyone here knows of an existing
(non-f2c) C version of the routine - possibly one written by Akima
himself? Or maybe someone here is familiar enough with Fortran to
give me some insight on how to treat these 2-dimensional arrays in C?
I'd appreciate anything anyone has to say.
-- Charles Banas