-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Labels
Description
Consider the following code:
module m
type base
integer :: i = 999
end type
type, extends(base) :: child
integer :: i1 = 999
end type
type(child) :: b1(2,2)
type(child) :: b2(3,3)
end module
module m1
use m
interface read(formatted)
subroutine readformatted(dtv, unit, iotype, v_list, iostat, iomsg )
import base
class(base), intent(inout) :: dtv
integer, intent(in) :: unit
character(*), intent(in) :: iotype
integer, intent(in) :: v_list(:)
integer, intent(out) :: iostat
character(*), intent(inout) :: iomsg
end subroutine
end interface
end module
program array101a
use m1
integer :: stat = 0
character(200) :: msg = ''
namelist /nml1/ b1, b2
open (1, file = 'array101a.1', form='formatted', access='stream' )
read (1,NML=nml1, iostat=stat, iomsg=msg)
end program
subroutine readformatted (dtv, unit, iotype, v_list, iostat, iomsg)
use m, only: base, child
class(base), intent(inout) :: dtv
integer, intent(in) :: unit
character(*), intent(in) :: iotype
integer, intent(in) :: v_list(:)
integer, intent(out) :: iostat
character(*), intent(inout) :: iomsg
end subroutine
array101a.1
has
&NML1
B1(1,1)= 101 102 , B1(2,1:2)= 103 104 105 106 , B2(3:1:-1,1)= 205 206 203 204 201 202 ,
B2(1:2,2)= 207 208 209 210,
/
&NML2
B3(2,2)= 999 , B3(1:2,1:2)= 301 302 303 304 ,
/
&NML3
B4= 401 402 403 404 /
/ !<- not enough data supplied
B5(3:1:-2,1)= 501 502 503 504 ,
B5(3:1:-2,2)= 506 507 508 509
/
Flang failed at:
> a.out
fatal Fortran runtime error(t.f:39): DescriptorIO: bad type code (0) in descriptor
IOT/Abort trap(coredump)