Recent content by nguyenthanhlam

  1. N

    Fortran Fortran: variables in the list of arguments for Subroutines

    Thanks, If so, I should have explicit lists of arguments then. Actually, I don't have to change anything to my program, it's already been that way :)). Lam
  2. N

    Fortran Fortran: variables in the list of arguments for Subroutines

    Thanks DrClaude, I see your point. In my case I have a program structured like this: =============================== do n=1,100000000 call sub1(list_of_arg_1) call sub2(list_of_arg_2) ... end do ============================ List 1 is used for Sub1, list2 is...
  3. N

    Fortran Fortran: variables in the list of arguments for Subroutines

    Can you elaborate on this? Yes, I have quite a lot of arguments for different subroutines. What I did was, I put all the needed arguments in the brackets. Now I want to test, without putting arguments in the brackets would I have the same results, same performance, etc. Thanks, Lam
  4. N

    Fortran Fortran: variables in the list of arguments for Subroutines

    Here is my test: ======================= program test use examp implicit none y=1. z=2. call calx print*,'x=',x end ====================== module examp implicit none real x,y,z contains subroutine calx x=y+z end subroutine end =======================...
  5. N

    Fortran Fortran: variables in the list of arguments for Subroutines

    Hi all, Suppose I declare X in the main program. Then in the following subroutine: Call example(list of arguments) ------------------------------------ subroutine example(list of arguments) x=y+z end subroutine ------------------------------------- I have two options: (a)...
  6. N

    Fortran Solving Negative Infinity in Fortran Calculation

    Yes FAMAG, FX, FY, FZ are in the same dimensions. And your guessing is right. Maxval(array(1:n)) gives -Infinity if all the elements are NaN. I just did a simple test to confirm this. Thanks a lot. Lam
  7. N

    Fortran Solving Negative Infinity in Fortran Calculation

    FX,FY,FZ, FAMAG are arrays, but FAMAX is dimensionless. I know I should have used clearly different names to avoid confusion. Again, FMAGPBP is an array, FPBPMAX is dimensionless. Lam
  8. N

    Fortran Solving Negative Infinity in Fortran Calculation

    Dear all, I can not figure out why I got negative infinity in my output, so please help. Here is my calculation for FAMAX: FAMAG=SQRT(FX**2+FY**2+FZ**2) FAMAX=MAXVAL(FAMAG(1:NATOM)) and for FPBPMAX...