I have bitten the bullet and decided to manually convert my Fortran code to pascal (see separate thread).
But there are a few things I am not familiar with concerning pascal array handling, which I would like advice for:
This is the start of an example fortran procedure:
subroutine ChleskySolve(a, n, p, b, x)
use GlobalForw, only : Rkind
(Rkind is located in another file as a constant valued 8, so I assume this means that the reals are double size.)
implicit none <== no fortran assumptions of var type based on name
integer, intent(in) :: n
real(Rkind), intent(in) :: a(1:n, 1:n), p(n), b(n) real(Rkind), intent(out) :: x(n)
real(Rkind) :: sum
integer :: i, k
From this I have deduced that a pascal procedure would be declared
something like this:
procedure ChleskySolve(a: array of double; n: integer; p, b: array of
double; var x: array of double);
The fortran specification indicates this concerning the arrays:
a is really 2-dim: array[1..n][1..n] of double;
p,b,x are 1-dim array[1..n] of double;And x is the array holding the return values.
What is the correct declaration in this case? Open arrays can only be one-dimensional if memory serves me right.
And do I need to declare var for the x array, or are they all supplied by reference?
Bo Berglund
