Code Comments
Programming Forum and web based access to our favorite programming groups.The following program yields the value of 1.00000 under debug win32 mode of FTN95 compiler version 5.20.1. The correct value should be 2.00000 I do get the correct value when the 'OPTIONS(CHECK)' is commented out. Can someone check it out? yair PRINT *,F2() END FUNCTION F1(X) F1=X END OPTIONS(CHECK) FUNCTION F2() REAL X(1)/1./ F2=ABS(F1(X(1)))*2. END
Post Follow-up to this messageOn Apr 2, 3:35=A0pm, yair <yair...@gmail.com> wrote: > The following program yields the value of 1.00000 under debug win32 > mode of FTN95 compiler version 5.20.1. > The correct value should be 2.00000 > I do get the correct value when the 'OPTIONS(CHECK)' is commented out. > > Can someone check it out? > > yair > > =A0 =A0 =A0 PRINT *,F2() > =A0 =A0 =A0 END > =A0 =A0 =A0 FUNCTION F1(X) > =A0 =A0 =A0 F1=3DX > =A0 =A0 =A0 END > =A0 =A0 =A0 OPTIONS(CHECK) > =A0 =A0 =A0 FUNCTION F2() > =A0 =A0 =A0 REAL X(1)/1./ > =A0 =A0 =A0 F2=3DABS(F1(X(1)))*2. > =A0 =A0 =A0 END I believe that your program relies on an extension to the standard. With g95 I get: C:\temp>type u.f PRINT *,F2() END FUNCTION F1(X) F1=3DX END ! OPTIONS(CHECK) FUNCTION F2() REAL X(1)/1./ F2=3DABS(F1(X(1)))*2. END C:\temp>g95 u.f In file u.f:8 REAL X(1)/1./ 1 Error: Syntax error in data declaration at (1) C:\temp>type u1.f PRINT *,F2() END FUNCTION F1(X) F1=3DX END ! OPTIONS(CHECK) FUNCTION F2() REAL X(1) DATA X(1)/1./ F2=3DABS(F1(X(1)))*2. END C:\temp>g95 u1.f C:\temp>a 2. C:\temp>
Post Follow-up to this messagee p chandler wrote: (snip) > I believe that your program relies on an extension to the standard. > With g95 I get: (snip) > REAL X(1)/1./ > 1 > Error: Syntax error in data declaration at (1) Yes, I believe the standard form is: REAL X(1) DATA X/1./ but it is hard to see how, assuming the non-standard for exists and works correctly, it could give the wrong answer. -- glen
Post Follow-up to this message"yair" <yair999@gmail.com> wrote in message news:085249e2-4e47-4b6e-aaa7-b7b1d97bba3f@e10g2000prf.googlegroups.com... > The following program yields the value of 1.00000 under debug win32 > mode of FTN95 compiler version 5.20.1. > The correct value should be 2.00000 > I do get the correct value when the 'OPTIONS(CHECK)' is commented out. > > Can someone check it out? > > yair > > PRINT *,F2() > END > FUNCTION F1(X) > F1=X > END > OPTIONS(CHECK) > FUNCTION F2() > REAL X(1)/1./ > F2=ABS(F1(X(1)))*2. > END > [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007] NO ERRORS [<BUG1> FTN95/Win32 v5.10.0] NO ERRORS [<F1> FTN95/Win32 v5.10.0] 0007) OPTIONS(CHECK) *** Switching CHECK mode on with OPTIONS in the middle of a file requires the file to be compiled with /DEBUG 1 ERROR [bug1.F95] - Compilation failed. -- "That this social order with its pauperism, famines, prisons, gallows, armies, and wars is necessary to society; that still greater disaster would ensue if this organization were destroyed; all this is said only by those who profit by this organization, while those who suffer from it - and they are ten times as numerous - think and say quite the contrary." ~~ Leo Tolstoy
Post Follow-up to this message"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message news:JZ-dnavzub9CYG7anZ2dnUVZ_tjinZ2d@comcast.com... >e p chandler wrote: > > (snip) > > > (snip) > > > Yes, I believe the standard form is: > > REAL X(1) > DATA X/1./ > > but it is hard to see how, assuming the non-standard for exists > and works correctly, it could give the wrong answer. Silverfrost made it relatively painless to figure this out in Japanese time. I always say about open source disros that they have to have dos shortcut to whereever you're to write source. It was just waiting for me when I pulled up the start menu. program bug1 PRINT *,F2() END FUNCTION F1(X) F1=X END OPTIONS(CHECK) FUNCTION F2() REAL X(1) data x/1./ F2=ABS(F1(X(1)))*2. END program bug1 ! ftn95 bug2.f95 >text43.txt [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007] NO ERRORS [<BUG1> FTN95/Win32 v5.10.0] NO ERRORS [<F1> FTN95/Win32 v5.10.0] 0007) OPTIONS(CHECK) *** Switching CHECK mode on with OPTIONS in the middle of a file requires the file to be compiled with /DEBUG 1 ERROR [bug2.F95] - Compilation failed. I think that the thing the compiler is shouting with 3 asterisks both times is relevant. -- "That this social order with its pauperism, famines, prisons, gallows, armies, and wars is necessary to society; that still greater disaster would ensue if this organization were destroyed; all this is said only by those who profit by this organization, while those who suffer from it - and they are ten times as numerous - think and say quite the contrary." ~~ Leo Tolstoy
Post Follow-up to this message> I believe that your program relies on an extension to the standard. > With g95 I get: > > C:\temp>type u.f > =A0 =A0 =A0 PRINT *,F2() > =A0 =A0 =A0 END > =A0 =A0 =A0 FUNCTION F1(X) > =A0 =A0 =A0 F1=3DX > =A0 =A0 =A0 END > ! =A0 =A0 OPTIONS(CHECK) > =A0 =A0 =A0 FUNCTION F2() > =A0 =A0 =A0 REAL X(1)/1./ > =A0 =A0 =A0 F2=3DABS(F1(X(1)))*2. > =A0 =A0 =A0 END > > C:\temp>g95 u.f > In file u.f:8 > > =A0 =A0 =A0 REAL X(1)/1./ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01 > Error: Syntax error in data declaration at (1) > > C:\temp>type u1.f > =A0 =A0 =A0 PRINT *,F2() > =A0 =A0 =A0 END > =A0 =A0 =A0 FUNCTION F1(X) > =A0 =A0 =A0 F1=3DX > =A0 =A0 =A0 END > ! =A0 =A0 OPTIONS(CHECK) > =A0 =A0 =A0 FUNCTION F2() > =A0 =A0 =A0 REAL X(1) > =A0 =A0 =A0 DATA X(1)/1./ > =A0 =A0 =A0 F2=3DABS(F1(X(1)))*2. > =A0 =A0 =A0 END > > C:\temp>g95 u1.f > > C:\temp>a > =A02. > > C:\temp>- Hide quoted text - > > - Show quoted text - That change did NOT change the situation. I still get 1.00000.
Post Follow-up to this messageOn Apr 3, 12:48=A0am, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: > e p chandler wrote: > > (snip) > > > (snip) > > > Yes, I believe the standard form is: > > =A0 =A0 =A0 =A0REAL X(1) > =A0 =A0 =A0 =A0DATA X/1./ > > but it is hard to see how, assuming the non-standard for exists > and works correctly, it could give the wrong answer. > > -- glen Indeed, the changed standard form still gives the wrong answer of 1.00000.
Post Follow-up to this messageOn Apr 3, 6:31=A0am, "Gerry Ford" <ge...@nowhere.ford> wrote: > [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007] > =A0 =A0 NO ERRORS =A0[<BUG1> FTN95/Win32 v5.10.0] > =A0 =A0 NO ERRORS =A0[<F1> FTN95/Win32 v5.10.0] > 0007) =A0 =A0 =A0 OPTIONS(CHECK) > *** Switching CHECK mode on with OPTIONS in the middle of a file requires > the > =A0 =A0 file to be compiled with /DEBUG > > =A0 =A0 1 ERROR [bug1.F95] - Compilation failed. I forgot to mention, I DID run it in DEBUG mode under PLATO 4.0.
Post Follow-up to this messageOn Apr 3, 6:47=A0am, "Gerry Ford" <ge...@nowhere.ford> wrote: > "glen herrmannsfeldt" <g...@ugcs.caltech.edu> wrote in message > . > . > . > ! ftn95 bug2.f95 >text43.txt > > [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007] > =A0 =A0 NO ERRORS =A0[<BUG1> FTN95/Win32 v5.10.0] > =A0 =A0 NO ERRORS =A0[<F1> FTN95/Win32 v5.10.0] > 0007) =A0 =A0 =A0 OPTIONS(CHECK) > *** Switching CHECK mode on with OPTIONS in the middle of a file requires > the > =A0 =A0 file to be compiled with /DEBUG > > =A0 =A0 1 ERROR [bug2.F95] - Compilation failed. > > I think that the thing the compiler is shouting with 3 asterisks both time=[/color ] s > is relevant. I DID compile and run it in DEBUG mode under PLATO 4.0.
Post Follow-up to this message"yair" <yair999@gmail.com> wrote in message news:17e3eadd-c021-4003-a11d-5fd55e2c0c19@b1g2000hsg.googlegroups.com... On Apr 3, 6:47 am, "Gerry Ford" <ge...@nowhere.ford> wrote: > "glen herrmannsfeldt" <g...@ugcs.caltech.edu> wrote in message > . > . > . > ! ftn95 bug2.f95 >text43.txt > > [FTN95/Win32 Ver. 5.10.0 Copyright (c) Silverfrost Ltd 1993-2007] > NO ERRORS [<BUG1> FTN95/Win32 v5.10.0] > NO ERRORS [<F1> FTN95/Win32 v5.10.0] > 0007) OPTIONS(CHECK) > *** Switching CHECK mode on with OPTIONS in the middle of a file requires > the > file to be compiled with /DEBUG > > 1 ERROR [bug2.F95] - Compilation failed. > > I think that the thing the compiler is shouting with 3 asterisks both > times > is relevant. I DID compile and run it in DEBUG mode under PLATO 4.0. ---> How do you do that? Check. Debugging on the rio grande. Cockroaches are terrorists. -- "That this social order with its pauperism, famines, prisons, gallows, armies, and wars is necessary to society; that still greater disaster would ensue if this organization were destroyed; all this is said only by those who profit by this organization, while those who suffer from it - and they are ten times as numerous - think and say quite the contrary." ~~ Leo Tolstoy
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.