Hi all,
so I am trying to understand Fortran and translate it into C. I came across this and don't know if there is a difference here that i need to be concerned with:
within a module, there are 2 sub-routines, both have the same arguments (arrays)
subroutine A(Ut, Uold)
real(wp):: Ut(0:x,0:y,0:n)
real(wp):: Uold(0:x,0:y,0:n)
(some condition.... blah-blah-blah)
Uold = Ut
....
subroutine B(Ut, Uold)
real(wp):: Ut(0:x,0:y,0:n)
real(wp):: Uold(0:x,0:y,0:n)
(some condition.... blah-blah-blah)
forall(i=0:x, j=0:y, k=0:n)
Uold(i,j,k) = Ut(i,j,k)
end forall
....
i thought that "forall" in this case does the same thing as the equating these arrays at least in fortran.
WHAT IS THE DIFFERENCE HERE?
Thank you in advance.
so I am trying to understand Fortran and translate it into C. I came across this and don't know if there is a difference here that i need to be concerned with:
within a module, there are 2 sub-routines, both have the same arguments (arrays)
subroutine A(Ut, Uold)
real(wp):: Ut(0:x,0:y,0:n)
real(wp):: Uold(0:x,0:y,0:n)
(some condition.... blah-blah-blah)
Uold = Ut
....
subroutine B(Ut, Uold)
real(wp):: Ut(0:x,0:y,0:n)
real(wp):: Uold(0:x,0:y,0:n)
(some condition.... blah-blah-blah)
forall(i=0:x, j=0:y, k=0:n)
Uold(i,j,k) = Ut(i,j,k)
end forall
....
i thought that "forall" in this case does the same thing as the equating these arrays at least in fortran.
WHAT IS THE DIFFERENCE HERE?
Thank you in advance.