2 ! PR48298, this tests function of size= specifier with DTIO.
6 CHARACTER (LEN
=20) :: name
11 GENERIC
:: WRITE(FORMATTED
) => pwf
12 GENERIC
:: READ(FORMATTED
) => prf
15 SUBROUTINE pwf (dtv
,unit
,iotype
,vlist
,iostat
,iomsg
)
16 CLASS(person
), INTENT(IN
) :: dtv
17 INTEGER, INTENT(IN
) :: unit
18 CHARACTER (LEN
=*), INTENT(IN
) :: iotype
19 INTEGER, INTENT(IN
) :: vlist(:)
20 INTEGER, INTENT(OUT
) :: iostat
21 CHARACTER (LEN
=*), INTENT(INOUT
) :: iomsg
22 CHARACTER (LEN
=30) :: udfmt
27 if (iotype
.eq
."DT") then
28 WRITE(unit
, FMT
= '(a20,i2)', IOSTAT
=iostat
, advance
='no') dtv
%name
, dtv
%age
29 if (iostat
.ne
.0) iomsg
= "Fail PWF DT"
31 if (iotype
.eq
."LISTDIRECTED") then
32 WRITE(unit
, '(*(g0))', IOSTAT
=iostat
) dtv
%name
, dtv
%age
33 if (iostat
.ne
.0) iomsg
= "Fail PWF DT"
37 SUBROUTINE prf (dtv
,unit
,iotype
,vlist
,iostat
,iomsg
)
38 CLASS(person
), INTENT(INOUT
) :: dtv
39 INTEGER, INTENT(IN
) :: unit
40 CHARACTER (LEN
=*), INTENT(IN
) :: iotype
41 INTEGER, INTENT(IN
) :: vlist(:)
42 INTEGER, INTENT(OUT
) :: iostat
43 CHARACTER (LEN
=*), INTENT(INOUT
) :: iomsg
44 CHARACTER (LEN
=30) :: udfmt
50 if (iotype
.eq
."DT") then
51 READ(unit
, FMT
= '(a20,i2)', IOSTAT
=iostat
) dtv
%name
, dtv
%age
52 if (iostat
.ne
.0) iomsg
= "Fail PWF DT"
61 TYPE (person
) :: chairman
62 integer(4) :: rl
, tl
, kl
, thesize
68 chairman
%name
="Charlie"
71 open(28, status
='scratch')
72 write(28, '(i10,i10,DT,i15,DT,i12)') rl
, kl
, chairman
, rl
, chairman
, tl
77 read(28, '(i10,i10,DT,i15,DT,i12)', advance
='no', size
=thesize
) rl
, &
78 & kl
, chairman
, rl
, chairman
, tl
79 if (thesize
.ne
.91) call abort