@garynewport , you can create "minimal working example"s of sections of your legacy code and try them out to understand the behavior per FORTRAN 77
and other dialects/extensions upon which such legacy code may be based. So for example,
! legacy
integer, parameter :: mj = 2
double precision x(mj,4)
double precision, dimension(mj) :: temp, xl, r, pres
equivalence (x(1, 1), pres), (x(1, 4), temp)
equivalence (x(1, 2), r), (x(1, 3), xl)
integer :: i
do i = 1, mj
x(i,1) = 1D5*i
x(i,2) = 1D0*i
x(i,3) = 1D1*i
x(i,4) = 300D0*i
end do
print *, "pres = ", pres
print *, "r = ", r
print *, "x1 = ", xl
print *, "temp = ", temp
end
vis-a-vis
! EQUIVALENCE replaced by TARGET<->POINTER paired semantics starting Fortran 90 standard
integer, parameter :: mj = 2
double precision, target :: x(mj,4)
double precision, pointer, dimension(:) :: temp, xl, r, pres
integer :: i
pres(1:mj) => x(1:mj,1)
r(1:mj) => x(1:mj,2)
xl(1:mj) => x(1:mj,3)
temp(1:mj) => x(1:mj,4)
do i = 1, mj
x(i,1) = 1D5*i
x(i,2) = 1D0*i
x(i,3) = 1D1*i
x(i,4) = 300D0*i
end do
print *, "pres = ", pres
print *, "r = ", r
print *, "x1 = ", xl
print *, "temp = ", temp
end
You can then run both the programs and check whether the output is equivalent - it should be the same.