Physics Forums

Physics Forums (http://www.physicsforums.com/index.php)
-   Programming & Computer Science (http://www.physicsforums.com/forumdisplay.php?f=165)
-   -   Fortran Help (http://www.physicsforums.com/showthread.php?t=521609)

Zahur Aug14-11 05:46 PM

Fortran Help
 
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

Nylex Aug20-11 01:03 PM

Re: Fortran Help
 
I'm not a Fortran programmer, but some googling lead me to this. NB: I've not read the code, or tested it.


All times are GMT -5. The time now is 03:27 AM.

Powered by vBulletin Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2014 Physics Forums