WRITE(*,*) itest ! 1234567
WRITE(*,'(I6)') itest ! ******
WRITE(*,'(I10)') itest ! 1234567
WRITE(*,'(I10.9)') itest ! 001234567
WRITE(*,'(2I7)') itest, 7654321 ! 12345677654321
WRITE(*,'(2I8)') itest, 7654321 ! 1234567 7654321
WRITE(*,*) itest ! 1.2345670E+02 -not F format
WRITE(*,'(F8.0)') itest ! 123
WRITE(*,'(F10.4)') itest ! 123.4567
WRITE(*,'(F10.5)') itest ! 123.45670
WRITE(*,'(F10.9)') itest ! **********
WRITE(*,'(2F8.4)') itest, 7654321 ! 123.4567765.4321
WRITE(*,'(2F10.4)') itest, 7654321 ! 123.4567 765.4321
WRITE(*,*) itest ! 1.2345670E+02
WRITE(*,'(E10.4)') itest ! 0.1234E+09
WRITE(*,'(E10.5)') itest ! .12345E+09
WRITE(*,'(E10.4E3)') itest ! .1234E+009
WRITE(*,'(E10.9)') itest ! **********
WRITE(*,'(2E12.4)') itest, 7654321 ! 0.12345E+090.76543E+04
WRITE(*,'(2E10.4)') itest, 7654321 ! 0.1234E+090.7654E+04
WRITE(*,*) itest ! 1.2345000E+04
WRITE(*,'(EN13.6)') ! 12.345000E+03
WRITE(*,'(ES13.6)') ! 1.234500E+04 ES - Scientific - the value before the decimal point always lies in the range 1..10
CHARACTER(LEN=8) :: long='Bookshop'
CHARACTER(LEN=1) :: short='B'
WRITE(*,*) long ! Bookshop
WRITE(*,'(A)') long ! Bookshop
WRITE(*,'(A8)') long ! Bookshop
WRITE(*,'(A5)') long ! Books
WRITE(*,'(A10)') long ! Bookshop
WRITE(*,'(A)') short ! B
WRITE(*,'(2A) short, long ! BBookshop
WRITE(*,'(2A3) short, long ! BBoo
LOGICAL :: ltest=.FALSE.
WRITE(*,*) ltest ! F
WRITE(*,'(2L1)') ltest, .NOT.ltest ! FT
WRITE(*,'(L7)') ltest ! F
WRITE(*,'(I4, 2X, I4)') i, i-1 ! 1234 1233 Blank Spaces (Skip Character Positions)
WRITE(*,'(I4, 4X, I4)') i, i-1 ! 1234 1233
Special Characters
' ' to output the character string specified
/ specifies take a new line
( ) to group descriptors, normally for repetition
INTEGER :: value = 100
INTEGER :: a=101, b=201
WRITE(*,'( 'The value is', 2X, I3, ' units.')') value
WRITE(*,'( 'a =', 1X, I3, /, 'b = ', 1X, I3)')
WRITE(*,'( 'a and b =', 2(1X, I3) )') a, b
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment