0

I am trying to allocate an array and want to resize the array ie., grow the array size as and when required in the program.

My sample code looks like this

program main
implicit none
integer, allocatable, dimension(:)::test1
integer i, c1, c2
c1=10
c2=5
allocate(test1(1:c1))
!  I basically want to do this 
!allocate(test1(c1+1:c2))
end program main

How do I do this?

francescalus
  • 30,576
  • 16
  • 61
  • 96
kaush
  • 23
  • 8
  • Always uae tag [tag:fortran] for all Fortran questions. Add a particular version when necessary to distinguish. Note that Fortran 90 is old, obsolete and allocatable arrays were fixed in Fortran 95 and 2003. I agree it is likely a duplicate, have you searched before asking? – Vladimir F Героям слава Jul 19 '17 at 07:40
  • Thanks for the links I found the answer – kaush Jul 20 '17 at 03:44

0 Answers0