(adsbygoogle = window.adsbygoogle || []).push({}); FORTRAN error "array bound is not scalar integer"

I'd like to know if a loop can be created, inside which I can call a subroutine in which there are arrays to be defined whose size varies as a function of loop variable. I tried as following, but got error "array bound is not scalar integer".

How to solve this issue?

attaching my code snippet here....

Code (Text):

.

.

iloop: do i=5,24,0.5

jloop: do j=5,20

call check(i,j,divlen,Machexit,final)

if (final.eq.1) exit iloop

enddo jloop

enddo iloop

.

.

end program

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Subroutine check(i,j,divlen,Machexit,final)

INTEGER, PARAMETER :: IVLpts=10

real :: i,divlen,Machexit

integer :: final,j

integer :: exppts,intstrtpts,contourstrtpts,totalpts,P1,P2,P3,P4,P5,P6,P7

exppts=((j*IVLpts)+((j-1)*(IVLpts-1)))

P2=(exppts-IVLpts)

P3=(IVLpts-1)

P6=(exppts-P2)

call check2(IVLpts,i,j,divlen,Machexit,final,exppts,P2,P3,P6)

End subroutine check

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Subroutine check2(IVLpts,i,j,divlen,Machexit,final,exppts,P2,P3,P6)

Real, PARAMETER :: gamma=1.4d0,Mini=1.02d0

integer,allocatable :: expcontourpts(:),M(:),x(:),y(:)

real,allocatable :: AoverAstar(:),Mvariance(:)

allocate(expcontourpts(exppts))

allocate(M(exppts))

allocate(x(exppts))

allocate(y(exppts))

allocate(AoverAstar(P6))

allocate(Mvariance(P6))

.

.

.

End subroutine check2

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# FORTRAN error array bound is not scalar integer

Loading...

Similar Threads - FORTRAN error array | Date |
---|---|

Handling underflow errors in fortran 90 | Jul 10, 2017 |

Fortran 90 Error Please help | Apr 6, 2015 |

Array Reference is out of bounds error? Fortran | May 1, 2014 |

Array reading error when opening multiple files in Fortran | Dec 27, 2012 |

Fortran error: Big array size, solution? | May 26, 2012 |

**Physics Forums - The Fusion of Science and Community**