-- JuanCastillo - 25 Mar 2008

If you come from C++, read the next article: ibiblio c++ vs Fortran


  • You must declare all the variables at the beguinning of the file.
  • File handling. A file is a label (20 in the example below) (Source: here
    • Open for read: OPEN (UNIT=20, FILE='input.dat', STATUS='OLD')
    • Open for write: OPEN (UNIT=20, FILE='output.dat', STATUS='new', ERR=100)
    • Writting (undefined format) write(20,*) i,j,k
    • Writting (defined format) write(20,907) i,j,k
    • Formatting 907 format('eventID: ',i4,'parent: ',i4,'child: ',i4) (for 3 integers)

Format Specifier I5 F6.0 E10.4 F6.3 F8.2 A5 E13.6 E9.2
Value stored 10 0.0052 357.101 -123.456 0.123-01 Juan 123.456E30 -0.0005678
Topic revision: r1 - 2008-03-25, JuanCastillo
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)