Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Some simple questions?

JohnNichols
Valued Contributor III
403 Views

 

 

    print *,"Forward-Backward double-precision real-to-complex",               &
        &      " out-of-place 1D transform"

 

 

 

I would have expected this line from the real FFT Intel Sample to throw an error, but it compiles fine. Why does the second & not cause a problem? 

 

print '(" DFTI_LENGTHS                = /"I0"/" )', NB

 

I thought one had to always put , between elements of a format statement? 

 

---------------------------------------------------------------------------------------------

I just had to take an Intel Survey on the responses on the overall forum. 

Interesting, has anyone else had one of these, it was new to me. 

 

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
377 Views
Continuation Indicator (Free Source Form)

 

In free source form, the ampersand character (&) indicates a continuation line (unless it appears in a Hollerith or character constant, or within a comment). The continuation line is the first noncomment line following the ampersand. Although Standard Fortran permits up to 256 continuation lines in free-form programs,
Intel® Fortran allows up to 511 continuation lines.
The following shows a continued statement:
  TCOSH(Y) = EXP(Y) + &    ! The initial statement line
    EXP(-Y)                ! A continuation line
If the first nonblank character on the next noncomment line is an ampersand, the statement continues at the character following the ampersand. For example, the preceding example can be written as follows:
  TCOSH(Y) = EXP(Y) + &
   & EXP(-Y)
If a lexical token must be continued, the first nonblank character on the next noncomment line must be an ampersand followed immediately by the rest of the token. For example:
    TCOSH(Y) = EXP(Y) + EX&
 &P(-Y)
If you continue a character constant, an ampersand must be the first non-blank character of the continued line; the statement continues with the next character following the ampersand. For example:
  ADVERTISER = "Davis, O'Brien, Chalmers & Peter&
          &son"
  ARCHITECT  = "O'Connor, Emerson, and Dickinson&
        &  Associates"
If the ampersand is omitted on the continued line, the statement continues with the first non-blank character in the continued line. So, in the preceding example, the whitespace before "Associates" would be ignored.
The ampersand cannot be the only nonblank character in a line, or the only nonblank character before a comment; an ampersand in a comment is ignored.
 
 
Jim Dempsey

View solution in original post

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
378 Views
Continuation Indicator (Free Source Form)

 

In free source form, the ampersand character (&) indicates a continuation line (unless it appears in a Hollerith or character constant, or within a comment). The continuation line is the first noncomment line following the ampersand. Although Standard Fortran permits up to 256 continuation lines in free-form programs,
Intel® Fortran allows up to 511 continuation lines.
The following shows a continued statement:
  TCOSH(Y) = EXP(Y) + &    ! The initial statement line
    EXP(-Y)                ! A continuation line
If the first nonblank character on the next noncomment line is an ampersand, the statement continues at the character following the ampersand. For example, the preceding example can be written as follows:
  TCOSH(Y) = EXP(Y) + &
   & EXP(-Y)
If a lexical token must be continued, the first nonblank character on the next noncomment line must be an ampersand followed immediately by the rest of the token. For example:
    TCOSH(Y) = EXP(Y) + EX&
 &P(-Y)
If you continue a character constant, an ampersand must be the first non-blank character of the continued line; the statement continues with the next character following the ampersand. For example:
  ADVERTISER = "Davis, O'Brien, Chalmers & Peter&
          &son"
  ARCHITECT  = "O'Connor, Emerson, and Dickinson&
        &  Associates"
If the ampersand is omitted on the continued line, the statement continues with the first non-blank character in the continued line. So, in the preceding example, the whitespace before "Associates" would be ignored.
The ampersand cannot be the only nonblank character in a line, or the only nonblank character before a comment; an ampersand in a comment is ignored.
 
 
Jim Dempsey
0 Kudos
JohnNichols
Valued Contributor III
364 Views

you learn something every day, I did not know that.  

0 Kudos
JohnNichols
Valued Contributor III
361 Views
0 Kudos
Reply