Hi!
I have written a fortran program on a linux machine. I compiled this code with the fortran 6.5 Lahey compiler. It works fine.
Now I m trying to import this code on a sun machine. I don t manage to compile the same code with the fortran workshop for sun.
1- Is there any way to compile this code with a low compatibility option in the sun fortran compiler. I mean, can increase the tolerance of the sun compiler?
2- One of the main issue is the following :
this program aims to load a vector of data with 'num' values as type 'type' ('INTE' for integer or 'DOUB' for real(8))
the file looks like that
1222258 'INTE'
... 1222258 integers follows
#######################
Main MyProgram
implicit none
real(8), dimension),allocatable :: tab_doub
integer,dimension),allocatable :: tab_inte
integer :: num,fileID
character(4) :: type
...
...
call Read_SizeType(fileID,num,type)
...
call Read_Tab(...,fileID,tab_inte,tab_doub,num)
...
! use of tab_real or tab_doub
...
select case(type)
case('INTE')
deallocate(tab_inte)
case('DOUB')
deallocate(tab_doub)
end select
...
...
end MyProgram
!------------------
module MyModule
implicit none
contains
!!!
subroutine Read_SizeType(fileID,num,type)
integer, intent(out) :: num
character(4) :: type
read(fileID,FMT...) num,type
! read the header: the following data are either integer or real(8), there are num elements.
end subroutine Read_SizeType
!!!
subroutine Read_Tab(...,fileID,type,tab_real,tab_int,num)
real(8),dimension),allocatable,intent(out) :: tab_doub
integer,dimension),allocatable,intent(out) :: tab_inte
integer,intent(in) :: num,fileID
character(4),intent(in) :: type
select case(type)
case('INTE')
allocate(tab_inte)
read(fileID,FMT...) tab_inte
case('DOUB')
allocate(tab_doub)
read(fileID,FMT...) tab_doub
end select
end subroutine Read_Tab
end module MyModule
####################################
When I compile this piece of code :
"MyProgram.f90", Line = 72, Column = 40: ERROR: Attributes
INTENT and ALLOCATABLE must not appear in the same attribute list.
Regarding the structure of my code, and what I aim to do, Do you have an idea on how to get rid of this error?
Thanks
Flav256
I have written a fortran program on a linux machine. I compiled this code with the fortran 6.5 Lahey compiler. It works fine.
Now I m trying to import this code on a sun machine. I don t manage to compile the same code with the fortran workshop for sun.
1- Is there any way to compile this code with a low compatibility option in the sun fortran compiler. I mean, can increase the tolerance of the sun compiler?
2- One of the main issue is the following :
this program aims to load a vector of data with 'num' values as type 'type' ('INTE' for integer or 'DOUB' for real(8))
the file looks like that
1222258 'INTE'
... 1222258 integers follows
#######################
Main MyProgram
implicit none
real(8), dimension),allocatable :: tab_doub
integer,dimension),allocatable :: tab_inte
integer :: num,fileID
character(4) :: type
...
...
call Read_SizeType(fileID,num,type)
...
call Read_Tab(...,fileID,tab_inte,tab_doub,num)
...
! use of tab_real or tab_doub
...
select case(type)
case('INTE')
deallocate(tab_inte)
case('DOUB')
deallocate(tab_doub)
end select
...
...
end MyProgram
!------------------
module MyModule
implicit none
contains
!!!
subroutine Read_SizeType(fileID,num,type)
integer, intent(out) :: num
character(4) :: type
read(fileID,FMT...) num,type
! read the header: the following data are either integer or real(8), there are num elements.
end subroutine Read_SizeType
!!!
subroutine Read_Tab(...,fileID,type,tab_real,tab_int,num)
real(8),dimension),allocatable,intent(out) :: tab_doub
integer,dimension),allocatable,intent(out) :: tab_inte
integer,intent(in) :: num,fileID
character(4),intent(in) :: type
select case(type)
case('INTE')
allocate(tab_inte)
read(fileID,FMT...) tab_inte
case('DOUB')
allocate(tab_doub)
read(fileID,FMT...) tab_doub
end select
end subroutine Read_Tab
end module MyModule
####################################
When I compile this piece of code :
"MyProgram.f90", Line = 72, Column = 40: ERROR: Attributes
INTENT and ALLOCATABLE must not appear in the same attribute list.
Regarding the structure of my code, and what I aim to do, Do you have an idea on how to get rid of this error?
Thanks
Flav256