Yes, it worked. Now when I increase the dimensions of the array which I am extracting from .csv file then I am getting fatal error. Details are as follows:
Code:
PROGRAM Area
!---------------------------------------------------------------------
!
! This program gets data from stored .csv file
!
!---------------------------------------------------------------------
IMPLICIT NONE
INTERFACE
FUNCTION xcsv()
integer, parameter :: iu=20, nrows = 81000, ncols = 11
real:: xcsv(nrows,ncols)
END FUNCTION xcsv
END INTERFACE
! Declare local variables
INTEGER :: a,b
INTEGER, parameter :: NROWS=81000, NCOLS=11
REAL :: radius, output(NROWS,NCOLS)
output=xcsv()
write(*, '(A)', ADVANCE = "NO") "The stored data is: "
write(*,*) output(1,10)
write (*,*) 'Enter the values for a & b:'
read (*,*) a,b
END PROGRAM Area
!-----Reads data from csv file----------------------------------------------------
FUNCTION xcsv()
IMPLICIT NONE
! read real numbers from CSV file
integer, parameter :: iu=20, nrows = 81000, ncols = 11
real :: xx(nrows,ncols), xcsv(nrows,ncols)
integer :: i, a, b
open (unit=iu,file="testdata.csv",action="read",status="old")
do i=1,nrows
read (iu,*) xx(i,:)
end do
xcsv=xx
END FUNCTION xcsv
The actual size of the data in excel sheet is 81000X11. It is in .csv format. I am getting following error:
Debug Assertion Failed!
Program:
...Projects\Frotran_Learning_1\Frotran_Learning_1\Debug\xcsv.exe
File: f:\dd\vctools\crt\crtw32\misc\wingsig.c
Line:418
Expression: ("Invalid signal or error",0)
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
In command window, I am getting following message:
forrtl: severe (170): Program Exception-Stack overflow
Any idea, how to debug this problem?
Is there any limitation on the size of the data that can be imported in fortran arrays from excel sheet?