- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I was using the following code in fortran 90 for reading different input files. But when i used intel fortran it gave me this error
Error 1 error #6362: The data types of the argument(s) are invalid. [LEN] D:\3D_U_1 - Prism_int\sub1.f90 6
Error 2 error #6415: This name cannot be assigned this data type because it conflicts with prior uses of the name. [FNAME] D:\3D_U_1 - Prism_int\sub1.f90 6
" fname : is the name of different file that i need to read"
Subroutine InputNum(fname,nv)
character(len=len(fname)), intent(in) :: fname
integer, intent(out) :: nv
Open(10,file = fname, STATUS='old')
Read(10,*) nv
Close (10)
End subroutine InputNum
Subroutine getmatrix_int(fname,v,nv,z)
character(len=len(fname)), intent(in) :: fname
integer, intent(in) :: nv,z
Integer, dimension(nv,z), intent(out) :: v
integer :: i, stat
Open(10,file = fname, STATUS='old')
Read(10,*)
i = 1
Do
Read(10,*,iostat=stat) (v(i,j),j=1,z)
if (stat < 0) exit
i = i + 1
End do
Close (10)
End subroutine Getmatrix_int
Regards
Reda
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The statement:
character(len=len(fname)), intent(in) :: fname
is incorrect because it is trying to use a characteristic of fname to declare itself. I think what you want is:
character(len=*), intent(in) :: fname

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page