Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran Help

  1. Aug 14, 2011 #1
    Is it possible to increase the size of an already allocated array in FORTRAN, with out reallocation?
    e.g. if in start A(3)=[4, 5, 6] and now I want something like A(4)=[4, 5, 6, 7].
    Currently I am using a temporary array to do this

    allocate(A(3))
    A=(/4, 5, 6/)
    allocate(temp(3))
    temp=A
    deallocate(A)
    allocate(A(4))
    A(1:3)=temp
    A(4)=7


    Or some other suggestion

    Zahur
     
  2. jcsd
  3. Aug 20, 2011 #2
    I'm not a Fortran programmer, but some googling lead me to this. NB: I've not read the code, or tested it.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Similar Discussions: Fortran Help
  1. Fortran help (Replies: 0)

  2. Help in fortran (Replies: 2)

  3. [Fortran] help (Replies: 2)

  4. FORTRAN Help (Replies: 1)

  5. Fortran Help (Replies: 2)

Loading...