0

I am not well versed in Fortran, but am trying to understand a Fortran function and how it is passing a parameter to a subroutine (so that I can code similar functionality, in C#). It happens to be SMOOTH from Carl de Boor's "A Practical Guide to Splines," but I'm simplifying for the sake of my question.

The function SMOOTH begins with something like this:

real function SMOOTH (x, y, dy, n, s, V, A) 
integer n, i, m
real A(n, 4), dy(n), s, V(n, 7), x(n), y(n)
call SETUPQ(x, dy, y, n, V, A(1, 4))
    ...

My understanding is that A and V are multi-dimensional arrays, with n rows each, and 4 and 7 columns, respectively. It appears that row 1, column 4 of A is being passed as the last parameter (A(1, 4)) in the call SETUPQ line.

The subroutine SETUPQ starts like this:

subroutine SETUPQ (x, dy, y, n, V, QTY)
integer n, i, m
real dy(n), QTY(n), V(n, 7), x(n), y(n)
    ...

Within SETUPQ, assignment is later made to the n elements of the QTY array.

My question is, why is A(1, 4) from SMOOTH being passed into QTY of SETUPQ? Isn't A(1, 4) simply a single value from A? Is QTY going to be assigned to A(1, 4)?

I'd appreciate any help toward understanding what is happening with that call SETUPQ... line.

2
  • 1
    The crucial expression is "sequence association", using which you can find any number of other examples and details. Commented Mar 13, 2024 at 17:14
  • @francescalus, thank you for the comment; I'll give that phrase a try in my search. Commented Mar 13, 2024 at 17:19

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.