1830624 Members
2007 Online
110015 Solutions
New Discussion

Re: F90 compiler bug

 
glockner
New Member

F90 compiler bug

Hello,
I want to allocate and initialise in a subroutine a character??string array
defined as a dynamic array (pointer) in a module.
It works on Windows Digital FORTRAN, TRU64, IRIX64, Linux (IFC) and AIX FORTRAN,
but doesn't work on HP-UX FORTAN90.
If someone has an idea (enclose a short program as example)
I have submitted this program to comp.lang.fortran news and people have the
same conclusion I have

Thanks
Stephane





5 REPLIES 5
Steve Steel
Honored Contributor

Re: F90 compiler bug

Hi

Cannot open your added file

However

1)What OS revision
2)Compiler version
3)Last Fortran Patch loaded


steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
glockner
New Member

Re: F90 compiler bug


Here is the result of command
what /opt:fortran90/bin/f90


/opt/fortran90/bin/f90:
HP-UX f90 19990722 (181103) B3907DB/B3909DB B.10.20.16
HP F90 v2.3
/usr/lib/libc: $Revision: 76.3 $



and the program


!*********************************************
subroutine allocation(tab,kkk)
!*********************************************
implicit none
character(len=*), pointer, dimension(:) :: tab
integer :: kkk,ok
!---------------------------------------------
ok=-1

print*,'allocation ?'
allocate (tab(kkk), stat=ok)
print*,'allocation reussie : ok=',ok

print*,'initialisation ?'
TAB(:) = 'ok'
print*,'initialisation reussie'

!---------------------------------------------
end subroutine allocation
!*********************************************


!*********************************************
module comlec
!*********************************************

integer, parameter :: L80=2
character(len=L80), pointer, dimension(:), save :: bdini

end module comlec
!*********************************************


!=============================================
program essai
!=============================================
use comlec
implicit none
integer, parameter :: n=4
!---------------------------------------------
interface
subroutine allocation(tab,kkk)
implicit none
character(len=*), pointer, dimension(:) :: tab
integer :: kkk
end subroutine allocation
end interface
!---------------------------------------------

call allocation(bdini,n)
print*,bdini

!---------------------------------------------
end program essai
!=============================================

Steve Steel
Honored Contributor

Re: F90 compiler bug

Hi

1)You should get the latest 10.20 patch

PHSS_20205

2)You seem to be on 10.20 which is approaching end of support within a year so there is little chance of major compiler changes now

So if you have a valid problem then you would be best to upgrade the OS and then log a
response centre call against the compiler.

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Olav Baadsvik
Esteemed Contributor

Re: F90 compiler bug



Hi,

The sample code also fails with the latest
f90 compiler on hp-ux 11.00

Regards
Olav
glockner
New Member

Re: F90 compiler bug

Hello,

I have solved the problem writting
NULLIFY(BDINI) before CALL ALLOCATION(BDINI,N).

It is still not clear to me why it doesn't work without because
allocation was done successfully, SHAPE(BDINI) was ok and LEN(BDINI)
also.

Stephane