Recent content by Biederman

  1. B

    Fortran Fortran, passing an array to multiple subroutines

    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
  2. B

    Fortran Fortran, passing an array to multiple subroutines

    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.
  3. B

    Fortran Fortran, passing an array to multiple subroutines

    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...
  4. B

    Momentum conservation law: Head on elastic collision

    Thanks Chet, Those very nice examples. I will think on them a bit more carefully!
  5. B

    Momentum conservation law: Head on elastic collision

    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...
  6. B

    Fortran Fortran, reading a particular column of a matrix, allocatable

    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))...
  7. B

    Momentum conservation law: Head on elastic collision

    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...
  8. B

    Fortran Fortran functions as arguments of functions

    Thank you SteamKing. I've got the program working after checking the EXTERNAL statement, as you had suggested. Thanks again
  9. B

    Fortran Fortran functions as arguments of functions

    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...
Back
Top