Hi to every body,
Sorry if my question is a little strange.
In writing a subroutine or function, I am wondering whether it is important that we specify the input exactly or not?
I mean which one is faster? Does it actually have any difference?
My program do this kind of things a lot and time saving is really important for me, it is in parallel and will take a month to complete the simulation.
e.g:
suppose in main I have:
in part of the program, I just want to use 10 of these starting from 1
So which one would be faster
or
or
.
.
.
or
Please tell me how one should write these, does it actually differ?????????
Thank you very much.
Cheers,
Sorry if my question is a little strange.
In writing a subroutine or function, I am wondering whether it is important that we specify the input exactly or not?
I mean which one is faster? Does it actually have any difference?
My program do this kind of things a lot and time saving is really important for me, it is in parallel and will take a month to complete the simulation.
e.g:
suppose in main I have:
Code:
Integer, Dimension(1:1000000) :: ls
So which one would be faster
Code:
n=10
Call compute(i, j, ls, n)
Code:
n=10
Call compute(i, j, ls(1:n), n)
Code:
n=10
Call compute(i, j, ls(1), n)
.
.
Code:
Subroutine compute(i, j, ls, n)
Implicit None
..
Integer, Dimension(1:*) :: ls
...
End Subroutine compute
Code:
Subroutine compute(i, j, ls, n)
Implicit None
..
Integer, Dimension(1:n) :: ls
...
End Subroutine compute
Please tell me how one should write these, does it actually differ?????????
Thank you very much.
Cheers,