Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran 77 command write

  1. Mar 26, 2013 #1
    Hello,

    I'm new using fortran and I don't know what does it mean:

    write (4,*) ' '
    write (4,310)
    write (4,311)

    this lines go consecutive in the programm I have to understand.

    - might say that 4 is not a reference to a line of the code.
    - 310,311 are references about how the format should be

    i.e:
    310 format('Distance C Elec C Sol Surf Liq Pot Solid Pot ',
    &'Liq Cur j main j side 1 j side 2 j side 3')
    311 format('(microns) (mol/m3) x or y (V) (V) ',
    1' (A/m2) (A/m2) (A/m2) (A/m2) (A/m2)')



    I hope someone can help. Thanks
     
  2. jcsd
  3. Mar 26, 2013 #2

    Mark44

    Staff: Mentor

    All of your write statements send output to unit 4, the first number in the parentheses.
    write (4,*) ' ' -- prints a single space (' ') on unit 4, using a default format.
    write (4,310) -- prints the string in the format statement in line 310, on unit 4. This string appears to be a header of some sort.
    write (4,311) -- prints the string in the format statement in line 311, on unit 4. This string also appears to be some sort of header.
     
  4. Mar 26, 2013 #3

    what does unit 4 mean? The values will have a lenght of 4 characters?

    yes, i also understood they're a header the other outputs. The second might be the units of the first
     
  5. Mar 26, 2013 #4

    Mark44

    Staff: Mentor

    The unit number indicates which device you want to write to. In this case it would probably be a disk file that was assigned a unit number with an OPEN statement.
     
  6. Mar 28, 2013 #5
    Thanks for the answer, Mark.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Fortran 77 command write
  1. Fortran 77 (Replies: 1)

Loading...