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

Wandering error

Mike_Z_
Novice
478 Views

At compilation the following test program compiler shows error:

test.f90(45): error #5082: Syntax error, found ')' when expecting one of: <REAL_KIND_CON> <REAL_CONSTANT> <DBLPRC_CONSTANT> <DBLPRC_KIND_CON> <QUAPRC_CONSTANT> ...

program tst
implicit none
complex(16) zs, mg

zs = (1.0q0, 2.0q0)
mg = zs*( 1.000000000000000000000000000000000e000_kp + zs*( 5.772156649015328606065120900824024e-01_kp + &
     zs*(-6.558780715202538810770195151453905e-01_kp + zs*(-4.200263503409523552900393487542982e-02_kp + &
     zs*( 1.665386113822914895017007951021052e-01_kp + zs*(-4.219773455554433674820830128918739e-02_kp + &
     zs*(-9.621971527876973562114921672348199e-03_kp + zs*( 7.218943246663099542395010340446573e-03_kp + &
     zs*(-1.165167591859065112113971084018389e-03_kp + zs*(-2.152416741149509728157299630536478e-04_kp + &

     zs*( 1.280502823881161861531986263281643e-04_kp + zs*(-2.013485478078823865568939142102182e-05_kp + &
     zs*(-1.250493482142670657345359473833092e-06_kp + zs*( 1.133027231981695882374129620330745e-06_kp + &
     zs*(-2.056338416977607103450154130020573e-07_kp + zs*( 6.116095104481415817862498682855343e-09_kp + &
     zs*( 5.002007644469222930055665048059991e-09_kp + zs*(-1.181274570487020144588126565436506e-09_kp + &
     zs*( 1.043426711691100510491540332312250e-10_kp + zs*( 7.782263439905071254049937311360777e-12_kp + &

     zs*(-3.696805618642205708187815878085766e-12_kp + zs*( 5.100370287454475979015481322863232e-13_kp + &
     zs*(-2.058326053566506783222429544855237e-14_kp + zs*(-5.348122539423017982370017318727940e-15_kp + &
     zs*( 1.226778628238260790158893846622422e-15_kp + zs*(-1.181259301697458769513764586842298e-16_kp + &
     zs*( 1.186692254751600332579777242928674e-18_kp + zs*( 1.412380655318031781555803947566709e-18_kp + &
     zs*(-2.298745684435370206592478580633699e-19_kp + zs*( 1.714406321927337433383963370267257e-20_kp + &

     zs*( 1.337351730493693114864781395122268e-22_kp + zs*(-2.054233551766672789325025351355734e-22_kp + &
     zs*( 2.736030048607999844831509904330982e-23_kp + zs*(-1.732356445910516639057428451564780e-24_kp + &
     zs*(-2.360619024499287287343450735427531e-26_kp + zs*( 1.864982941717294430718413161878667e-26_kp + &
     zs*(-2.218095624207197204399716913626860e-27_kp + zs*( 1.297781974947993668824414486330594e-28_kp + &
     zs*( 1.180697474966528406222745415509972e-30_kp + zs*(-1.124584349277088090293654674261440e-30_kp + &

     zs*( 1.277085175140866203990206677751125e-31_kp + zs*(-7.391451169615140823461289330108553e-33_kp + &
     zs*( 1.134750257554215760954165259469306e-35_kp + zs*( 4.639134641058722029944804907952228e-35_kp + &
     zs*(-5.347336818439198875077418196709893e-36_kp + zs*( 3.207995923613352622861237279082794e-37_kp + &
     zs*(-4.445829736550756882101590352124644e-39_kp + zs*(-1.311174518881988712901058494389922e-39_kp + &
     zs*( 1.647033352543813886818259327906394e-40_kp + zs*(-1.056233178503581218600561071538285e-41_kp + &

     zs*( 2.678442982643049478354963071890852e-43_kp + zs*( 2.424715494851782689673032938370921e-44_kp + &
     zs*(-3.736587834535612554034559121270316e-45_kp + zs*( 2.628332980940195449089037611873639e-46_kp + &
     zs*(-9.298175995376886299601668991518173e-48_kp + zs*(-2.327942418699470598604262055622292e-49_kp + &
     zs*( 6.169620835244387420354431773150548e-50_kp + zs*(-4.928295586770989930504458682212533e-51_kp + &
     zs*( 2.183513183414510697277828498691356e-52_kp + zs*(-1.218722189147516555250452605074758e-54_kp + &

     zs*(-7.117108841662874631945652733848302e-55_kp + zs*( 6.920504054328689253528422229066270e-56_kp + &
     zs*(-3.676438468356676327679748481822479e-57_kp + zs*( 8.563098056275654327981712454743157e-59_kp + &

     ))))) )))))  ))))) )))))  ))))) )))))  ))))) )))))  ))))) ))))) ))))) ))))) ))))
end program tst

 

pointing to 10th bracket in the penultimate line. In my big program it points to another bracket in the same line.

What's wrong?

0 Kudos
5 Replies
andrew_4619
Honored Contributor II
478 Views

Line 44 looks blank when it should be continuation maybe?

0 Kudos
Mike_Z_
Novice
478 Views

I tried put & in blank lines -> error #5153: Illegal continuation. No valid non_commentary source following &

0 Kudos
Steven_L_Intel1
Employee
478 Views

Two problems.

  1. You're missing a declaration of kp as a PARAMETER constant
  2. Line 43 ends with a + but there is no operand following that.
0 Kudos
Mike_Z_
Novice
478 Views

Thank you Steve, and sorry for my stupidity! Second reason. In my main program KP is declared correctly.

0 Kudos
FortranFan
Honored Contributor II
478 Views

Mike Z. wrote:

Thank you Steve, and sorry for my stupidity! Second reason. In my main program KP is declared correctly.

Is this what you're trying to do?  If so, use modern syntax to make it easier to read the code, especially anyone who inherits the code.

program tst

   use, intrinsic :: iso_fortran_env, only : kp => real128

   implicit none

   real(kp), parameter :: Q(*) = [                                                                  &
     1.0_kp,                                      5.772156649015328606065120900824024e-01_kp,       &
     -6.558780715202538810770195151453905e-01_kp, -4.200263503409523552900393487542982e-02_kp,      &
     1.665386113822914895017007951021052e-01_kp,  -4.219773455554433674820830128918739e-02_kp,      &
     -9.621971527876973562114921672348199e-03_kp, 7.218943246663099542395010340446573e-03_kp,       &
     -1.165167591859065112113971084018389e-03_kp, -2.152416741149509728157299630536478e-04_kp,      &
     1.280502823881161861531986263281643e-04_kp,  -2.013485478078823865568939142102182e-05_kp,      &
     -1.250493482142670657345359473833092e-06_kp, 1.133027231981695882374129620330745e-06_kp,       &
     -2.056338416977607103450154130020573e-07_kp, 6.116095104481415817862498682855343e-09_kp,       &
     5.002007644469222930055665048059991e-09_kp,  -1.181274570487020144588126565436506e-09_kp,      &
     1.043426711691100510491540332312250e-10_kp,  7.782263439905071254049937311360777e-12_kp,       &
     -3.696805618642205708187815878085766e-12_kp, 5.100370287454475979015481322863232e-13_kp,       &
     -2.058326053566506783222429544855237e-14_kp, -5.348122539423017982370017318727940e-15_kp,      &
     1.226778628238260790158893846622422e-15_kp,  -1.181259301697458769513764586842298e-16_kp,      &
     1.186692254751600332579777242928674e-18_kp,  1.412380655318031781555803947566709e-18_kp,       &
     -2.298745684435370206592478580633699e-19_kp, 1.714406321927337433383963370267257e-20_kp,       &
     1.337351730493693114864781395122268e-22_kp,  -2.054233551766672789325025351355734e-22_kp,      &
     2.736030048607999844831509904330982e-23_kp,  -1.732356445910516639057428451564780e-24_kp,      &
     -2.360619024499287287343450735427531e-26_kp, 1.864982941717294430718413161878667e-26_kp,       &
     -2.218095624207197204399716913626860e-27_kp, 1.297781974947993668824414486330594e-28_kp,       &
     1.180697474966528406222745415509972e-30_kp,  -1.124584349277088090293654674261440e-30_kp,      &
     1.277085175140866203990206677751125e-31_kp,  -7.391451169615140823461289330108553e-33_kp,      &
     1.134750257554215760954165259469306e-35_kp,  4.639134641058722029944804907952228e-35_kp,       &
     -5.347336818439198875077418196709893e-36_kp, 3.207995923613352622861237279082794e-37_kp,       &
     -4.445829736550756882101590352124644e-39_kp, -1.311174518881988712901058494389922e-39_kp,      &
     1.647033352543813886818259327906394e-40_kp,  -1.056233178503581218600561071538285e-41_kp,      &
     2.678442982643049478354963071890852e-43_kp,  2.424715494851782689673032938370921e-44_kp,       &
     -3.736587834535612554034559121270316e-45_kp, 2.628332980940195449089037611873639e-46_kp,       &
     -9.298175995376886299601668991518173e-48_kp, -2.327942418699470598604262055622292e-49_kp,      &
     6.169620835244387420354431773150548e-50_kp,  -4.928295586770989930504458682212533e-51_kp,      &
     2.183513183414510697277828498691356e-52_kp,  -1.218722189147516555250452605074758e-54_kp,      &
     -7.117108841662874631945652733848302e-55_kp, 6.920504054328689253528422229066270e-56_kp,       &
     -3.676438468356676327679748481822479e-57_kp, 8.563098056275654327981712454743157e-59_kp  ]

   complex(kp), parameter :: zero = ( 0.0_kp, 0.0_kp )
   complex(kp), parameter :: zs = ( 1.0_kp, 2.0_kp )
   complex(kp) :: mg
   integer :: I

   mg = zero
   do I = size(Q), 1, -1
      mg = zs*(Q(I) + mg)
   end do

   print *, "mg   = ", mg

   stop

end program tst

Upon execution,

 mg   =
 (6.47307362601913450156361287401753,-0.843943840773202145488299862783640)
Press any key to continue . . .

 

0 Kudos
Reply