Thanks Ackbeet! Defining a new array solved the problem. You're right, in that way I am not overwriting the old array.
I appreciate your help!
Regards,
Abedin
Hi Ackbeet,
Thank you for the link!
If I wanted to pass all the elements by values then I'd use : call sub(n, arr(1:10))
But either way, it prints the logarithms after the "call" statement rather than the original array.
Hi guys,
I am kind of a newbie to fortran and I'd like to ask a simple question.
In the code below, I have a main program with one subroutine. It's a simple one.
In the main code I am filling an array with elements from 1 to 10. Then I am passing this array to a subroutine "sub", where...
Thanks Chestermiller! I appreciate your help!
I solved the problem using your second suggestion, via Moment. Conser. Law and Energy Conserv. Law.
However, the first method is kind of obscured to me. I would imagine as the train is approaching at +50 m/s and the ball is flying at a -30 m/s...
real :: mean
integer i,k
integer,allocatable, dimension(:) :: x_i
character (5):: a,b,c,d,e,f,g,h,j,l,mopen(12,file='histchess.txt',status='old')
open(11,file='crat.txt', status='old')
i=0
do
read(11,*,end = 200)
i=i+1
end do
200 allocate(x_i(i))...
Hi guys,
I've been thinking on a problem for a while which really bothers me. I've been trying to mathematically solve the following problem:
A train approaches the station at a velocity of V=50 m/s. Then a tennis ball is thrown with a velocity U=30 m/s, against the approaching train...
Hi all,
It is my first time to resort to the help of members of this forum :)
My question is related to programming in fortran but I am rather new with it.
So here is the question:Can I use user defined functions as arguments of a user defined functions in Fortran?
I have written a simple...