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?

2
  • Always uae 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? Commented Jul 19, 2017 at 7:40
  • Thanks for the links I found the answer Commented Jul 20, 2017 at 3:44

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.