File: read_07.f90

package info (click to toggle)
lfortran 0.60.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,412 kB
  • sloc: cpp: 173,406; f90: 80,491; python: 17,586; ansic: 9,610; yacc: 2,356; sh: 1,401; fortran: 895; makefile: 37; javascript: 15
file content (22 lines) | stat: -rw-r--r-- 603 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! MRE: Formatted READ with mixed types (string + logical)
! ICE in visit_FileRead: get_string_type() called on non-character type
! Reduced from LAPACK BLAS/TESTING/dblat2.f
program read_07
    implicit none
    character(6) :: sname
    logical :: ltest
    integer :: u, stat

    open(newunit=u, file="read_07_data.txt", status="old", iostat=stat)
    if (stat /= 0) error stop

    read(u, fmt=100, iostat=stat) sname, ltest
    if (stat /= 0) error stop
100 format(a6, l2)
    close(u)

    if (sname /= "ABCDEF") error stop
    if (.not. ltest) error stop

    print *, "PASS"
end program read_07