Dear all,
I have a question about subroutine arguments:
If I have a subroutine like this one
CALL SUBROUTINE(nElem) SUBROUTINE(nElem) REAL, DIMENSION(nElem) :: VECT1 REAL, DIMENSION(nElem) :: VECT2
....
and another one:
SUBROUTINE(nElem) REAL,ALLOCATABLE,DIMENSION(:) :: VECT1,VECT2 ALLOCATE(VECT1(nElem)) ALLOCATE(VECT2(nElem)) ... ... .... DEALLOCATE(VECT1,VECT2)
Are these two procedures equivalent, also from computational time?
I ask this question because I have a program where I call several time a subroutine. I stategy could be allocate VECT1 and VECT2 outside in a specific module, but this does not seems very elegant and could create confusion in future.
Thanks to everyone
Thread Topic:
Question