2 ! PR78670 Incorrect file position with namelist read under DTIO
8 PROCEDURE :: read_formatted
9 GENERIC :: READ(FORMATTED) => read_formatted
10 PROCEDURE :: write_formatted
11 GENERIC :: WRITE(FORMATTED) => write_formatted
14 SUBROUTINE write_formatted(dtv, unit, iotype, v_list, iostat, iomsg)
15 CLASS(t), INTENT(IN) :: dtv
16 INTEGER, INTENT(IN) :: unit
17 CHARACTER(*), INTENT(IN) :: iotype
18 INTEGER, INTENT(IN) :: v_list(:)
19 INTEGER, INTENT(OUT) :: iostat
20 CHARACTER(*), INTENT(INOUT) :: iomsg
21 write(unit,'(a)', iostat=iostat, iomsg=iomsg) dtv%c
22 END SUBROUTINE write_formatted
24 SUBROUTINE read_formatted(dtv, unit, iotype, v_list, iostat, iomsg)
25 CLASS(t), INTENT(INOUT) :: dtv
26 INTEGER, INTENT(IN) :: unit
27 CHARACTER(*), INTENT(IN) :: iotype
28 INTEGER, INTENT(IN) :: v_list(:)
29 INTEGER, INTENT(OUT) :: iostat
30 CHARACTER(*), INTENT(INOUT) :: iomsg
35 READ (unit, "(A)", IOSTAT=iostat, IOMSG=iomsg) ch
36 IF (iostat /= 0) RETURN
37 ! Store first non-blank
43 END SUBROUTINE read_formatted
53 NAMELIST /nml/ j, x, y, z, k
54 INTEGER :: unit, iostatus
56 OPEN(NEWUNIT=unit, STATUS='SCRATCH', ACTION='READWRITE')
70 READ (unit, nml, iostat=iostatus)
71 if (iostatus.ne.0) STOP 1
72 if (j.ne.1 .or. k.ne.2 .or. x%c.ne.'a' .or. y%c.ne.'b' .or. z%c.ne.'c') STOP 2