Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 281205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:11:01+00:00 2026-05-12T05:11:01+00:00

What does READ() do in Fortran? For example: READ(1,82)

  • 0

What does READ() do in Fortran?

For example:

READ(1,82)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:11:01+00:00Added an answer on May 12, 2026 at 5:11 am

    1 is the file handle, which you have to open with the proper open call.
    82 is a label that references a format, meaning how you will report the data in terms of visual formatting.

            program foo
            implicit none
            integer :: i
            double precision :: a
    
            write (*,*) 'give me an integer and a float'
            read (*,82) i,a
            write (*,82) i,a
    82      format (I4, F8.3)
            end program
    

    In this example, the program accepts from the standard input (whose unit number is not specified, and so I put a *) an integer and a floating point value. the format says that the integer occupies the first four columns, then I have a float which stays in 8 columns, with 3 digits after the decimal point

    If I run the program now, and I don’t follow exactly this format, the program will complain and crash, because the first 4 columns are expected to represent an integer (due to the I4 format), and “5 3.” is not a valid integer

    $ ./a.out 
     give me an integer and a float
    5 3.5
    At line 7 of file test.f (Unit 5)
    Traceback: not available, compile with -ftrace=frame or -ftrace=full
    Fortran runtime error: Bad value during integer read
    

    However, a correct specification (please note the three spaces before the number 5) will perform the correct operation (with a little tolerance, it’s not that strict)

    $ ./a.out 
     give me an integer and a float
       5 3.5
       5   3.500
    $ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does one read a data file in an iPhone project? For example, lets
I am using WMI to query some properties disk drive. Does WMI read this
Does anyone know a good C++ class to read (and possibly also write) INI
Does anyone have any ideas on how to read the MSDTC configuration on the
Why does the following code print ‘read(): Resource temporarily unavailable’ 80% of the time?
Does anyone know of an existing ruby implementation of a read/write lock - http://en.wikipedia.org/wiki/Readers-writer_lock
I have read in some of the ClickOnce posts that ClickOnce does not allow
How does one choose the size of a buffer (bytes I read from or
What does it take for online documentation to be helpful and interesting to read?
I would like to read/write encrypted XML files using LINQ to XML. Does anyone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.