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

  • SEARCH
  • Home
  • 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 8570751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:37:44+00:00 2026-06-11T18:37:44+00:00

Hi this is code given in Chapman’s book Fortran 95-2003 for scientists and engineers(3ed)

  • 0

Hi this is code given in Chapman’s book Fortran 95-2003 for scientists and engineers(3ed) on page 195

WRITE (*,100) index, time, depth, amplitude, phase

100 FORMAT('1',t20,'results for the test number  ',i3,///,&
      1x,'time      = ',f7.0/, &
      1x,'depth     = ',f7.1,' meters',/, &
      1x,'amplitude = ',f8.2/ &,
      1x,'phase     = ',f7.1)

To run it, I completed rest of the statements

program test
implicit none

INTEGER :: index = 10
real:: time=300.0,depth=330.0,amplitude=850.65,phase=30.0
WRITE (*,100) index, time, depth, amplitude, phase

100 FORMAT('1',t20,'results for the test number  ',i3,///,&
      1x,'time      = ',f7.0/, &
      1x,'depth     = ',f7.1,' meters',/, &
      1x,'amplitude = ',f8.2/ &,
      1x,'phase     = ',f7.1)

end program test 

When i compile it with gfortran, I get following errors..

test.f90:12.31:

      1x,'amplitude = ',f8.2/ &,
                               1
Error: Unexpected element '&' in format string at (1)
test.f90:13.8:

      1x,'phase     = ',f7.1)
        1
Error: Non-numeric character in statement label at (1)
test.f90:13.9:

      1x,'phase     = ',f7.1)
         1
Error: Invalid character in name at (1)
test.f90:7.12:

WRITE (*,100) index, time, depth, amplitude, phase
            1
Error: FORMAT label 100 at (1) not defined

whats happening here ? I have seen another thread here at stackoverflow, where the question was about the control characters in fortran. Chapman discusses it in his book without mentioning that the feature of control characters has been deleted in Fortran 2003. So I am wondering if this is similar old thing not recognized by gfortran ?

  • 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-06-11T18:37:45+00:00Added an answer on June 11, 2026 at 6:37 pm

    There is a comma after the ampersand on the line of the format specification that has the ‘ampersand = ‘ literal. To act as a continuation character in a non-character context the ampersand must be the last non-blank, non-comment character on the line.

    The comma should probably be before the ampersand.

    (Because the ampersand is not treated as a continuation character, the compiler thinks it is part of the format specification – hence the first error. The next line is then taken to start a new statement – hence the subsequent errors.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this code: List<Integer> ints = new ArrayList<Integer>(); // Type mismatch: // cannot convert
Given this code, tableButton = new JButton(new ImageIcon(80F_FG2015.GIF)); how would I get that String
Given this code: var arrayStrings = new string[1000]; Parallel.ForEach<string>(arrayStrings, someString => { DoSomething(someString); });
Given this code: List<string> things = new List<string>(); foreach (string thing in things) {
So I was given this code in a folder of bits and pieces that
Can anyone explain why this code with the given routes returns the first route?
I'm learning about pointers. Given this code: FILE* from = fopen("in.txt", "r"); FILE* to
This code works great for generating thumbnails, but when given a very large (100MB+)
I pasted the code given in this link to a file called md5.js. http://www.webtoolkit.info/javascript-md5.html
I can't get this code to work. Declared playpauseButton just above the given below

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.