2 ! PR78854 namelist write to internal unit.
9 procedure
:: write_formatted
10 generic
:: write(formatted
) => write_formatted
11 procedure
:: read_formatted
12 generic
:: read(formatted
) => read_formatted
15 subroutine write_formatted(dtv
, unit
, iotype
, v_list
, iostat
, iomsg
)
16 class(t
), intent(in
) :: dtv
17 integer, intent(in
) :: unit
18 character(*), intent(in
) :: iotype
19 integer, intent(in
) :: v_list(:)
20 integer, intent(out
) :: iostat
21 character(*), intent(inout
) :: iomsg
22 if (iotype
.eq
."NAMELIST") then
23 write (unit
, '(a1,a1,i3)') dtv
%c
,',', dtv
%k
25 write (unit
,*) dtv
%c
, dtv
%k
28 subroutine read_formatted(dtv
, unit
, iotype
, v_list
, iostat
, iomsg
)
29 class(t
), intent(inout
) :: dtv
30 integer, intent(in
) :: unit
31 character(*), intent(in
) :: iotype
32 integer, intent(in
) :: v_list(:)
33 integer, intent(out
) :: iostat
34 character(*), intent(inout
) :: iomsg
36 if (iotype
.eq
."NAMELIST") then
37 read (unit
, '(a1,a1,i3)') dtv
%c
, comma
, dtv
%k
39 read (unit
,*) dtv
%c
, comma
, dtv
%k
41 if (comma
/= ',') STOP 1
48 character(len
=50) :: buffer
53 if (buffer
.ne
.'&NML X=a, 5 /') STOP 1
56 if (x
%c
.ne
.'a'.or
. x
%k
.ne
.5) STOP 2