 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon May 27, 2019 8:10 am Post subject: |
|
|
JohnCampbell
/TABS is missing from ftn95.chm and I have corrected this. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Thu Aug 29, 2019 7:10 am Post subject: |
|
|
So where is the good installation files for gfortran?
You get again these
*** Unwritable expresssions in read statement or
*** READ can have a maximum of two non-keyword specifiers
and you are guessing and guessing trying and trying different things to understand what the heck this may mean. Need second opinion from different compiler because that not user-friendly diagnostics got on my nerves. As if it was hard to tell that it is not allowed to over-write the parameter iz or what and where these freaking keywords specifiers are. What, there was competition to write things the shortest and most cryptic way as there are no memory to fit the compiler into 64kB floppy disk?
Code: | parameter (ix=100, iy=100, iz=1000)
Real*8 BEJ (3, ix, iy, iz, 3)
character text32*32
open(unit=118,file='aaa', STATUS='old')
read (118,'(a)') text32
read (text32, '(4x, 3i6)',err=1,end=2) i1, iz, i3
close (118)
!... Errors
goto 1000
1 print*, 'Error reading'
goto 1000
2 print*, 'End reached'
1000 continue
end
|
Last edited by DanRRight on Thu Aug 29, 2019 9:38 am; edited 2 times in total |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Thu Aug 29, 2019 7:49 am Post subject: |
|
|
Dan,
Not sure what your post is asking, but yes, gFortran does have a better error message in this case:
FTN95 gives:
C:\temp\forum\dan\dan2.F90(8) : error 304 - Non-writable expression in READ statement
C:\temp\forum\dan\dan2.F90(8) : error 52 - Compilation abandoned
gFortran gives:
C:\temp\forum\dan\dan2.f90(8) : error - Named constant 'iz' in variable definition context (item in READ) at column 1
Compilation failed.
iz is a parameter so can't appear in a read statement.
I am in the good position of having FTN95 and gFortran installed and can easily switch between them in PLATO Ver 5, switching via
Tools > Settings > Miscellaneous
Regarding installing gFortran, there are a number of options for downloading, and I have an approach via environment variables to make installs of both gFortran and FTN95 easier to manage. I'm sure I have explained this in previous posts.
Last edited by JohnCampbell on Thu Aug 29, 2019 7:53 am; edited 1 time in total |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Thu Aug 29, 2019 7:53 am Post subject: |
|
|
Thanks John. What specifically installation do you have? Please provide the exact link. There are many different options i do not have time to try |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Thu Aug 29, 2019 8:08 am Post subject: |
|
|
Dan,
equation.com > Programming tools > Fortran, C, C++
This provides a self extracting file, eg gcc-8.3.0-64.exe
download and then install into : C:\Program Files (x86)\gcc_eq\gcc_8.3.0
Then create the following environment variables, either via a .bat file or via control panel > system
(these work on Win 7)
set f95.ver=8.40F
set _gcc.ver=8.3.0
set _gcc_dir=C:\Program Files (x86)\gcc_eq\gcc_%_gcc.ver%
set gcc_path=%_gcc_dir%\bin;%_gcc_dir%\libexec\gcc\x86_64-w64-mingw32\%_gcc.ver%
set EQ_LIBRARY_PATH=%_gcc_dir%\x86_64-w64-mingw32\lib
set gcc.ver=%_gcc.ver%
set gcc_dir=%_gcc_dir%
set f95_dir=C:\Program Files (x86)\Silverfrost\ftn95_%f95.ver%
set ftn95_path=%f95_dir%
set f95include=%f95_dir%\include
set mod_path=%f95_dir%\include
set Path=C:\ProgramData\Oracle\Java\javapath;%gcc_path%;%ftn95_path%;%orig_path%;c:\utils
Note:
1) set orig_path= " this is the original path prior to installing gFortran or FTN95, but excluding some unnecessary rubbish. your call !
I create orig_path in Control Panel > System > Advanced system settings > Environment Variables > System Variables > New... by cutting and pasting of Path value.
2) all other variables can be created similarly. I have chosen names as their sorted order is important. MS Win 7 does not do multiple pass definition !!
3) changing installed versions is merely changing the value of f95.ver and _gcc.ver to the appropriate value.
4) c:\utils contains most of my own programs to help with programming.
5) equation.com version of gFortran is different to mingw-w64 version (used for clearwin64 ?) in that it is a static build that does not use .dll's. I find this satisfactory.
If you need to use clearwin64, ie gFortran + clearwin+ graphics, that requires .dll's, you may need to install mingw-w64 version. Downloading is a bit more complex, to choose the options you require. I have both but would need to review my last install ( forgotten the options !! )
6) Typically FTN95 is my preferred software development and when combined with /IMPLICIT_NONE is my most reliable approach.
DanRRight wrote: | There are many different options i do not have time to try | I assume this refers to mingw-w64 version. Let me know if this version is required.
I hope this helps
John |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Thu Aug 29, 2019 12:04 pm Post subject: |
|
|
OMG...i need to chose among something again.
Question to SF: is it true Clearwin+ does not work with Equation dot com version ?
Meantime here is another code demonstrating unclear, cryptic, elitist or wrong diagnostics of FTN95 input/output. User-made error of not setting "filename" as character variable is identified wrong way or hell knows what the message says. FTN95 is very good at fining errors. But what it burbs in its South / Texas accent often simply impossible to decipher
Code: | filename = 'zzzOut.data'
open(unit=19,file=filename, STATUS='unknown', err=950)
close (19)
goto 1000
!......... errors
950 print*,' Error opening file'
1000 continue
end |
The error message says
0002) open(unit=19,file=filename, STATUS='unknown', err=950)
*** Scalar, default-kind, CHARACTER expression expected for the FILE keyword
1 ERROR [<main program> FTN95 v8.51.0]
*** Compilation failed |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Thu Aug 29, 2019 12:43 pm Post subject: |
|
|
In this case, I think that the compiler did a fine job. It gave you the line number, and even the clause of the statement on that line that it found to be incorrect.
We could have expected the compiler to complain about the preceding line first, since that line (Line-1) is also in error, since a character expression is being assigned to a real (by implicit naming rules F... is real) variable. Indeed, you may try commenting out the second line of the source code and running the compiler on it again.
I have a suggestion for you. You can get the FTN95 compiler to give you error numbers by using the option /ERR . You can then prepare a text file, say, errlist.txt, with error messages worded as you please, in a language of your choice (North Texan, South Polar, etc.), indexed by the error number. If you type the Windows command
findstr <nnnn> errlist.txt
where nnnn is the error number given by the compiler, you can see your wording of the corresponding message. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Thu Aug 29, 2019 7:52 pm Post subject: |
|
|
hahaha Really drunk logic from both of you, FTN95 + mecesj4. Even not two bugs are here but three: not only FTN95 missed the bug on first line, or reported crazy message on second, it mixed out the order by reporting second line error which was caused by error in the first line.
I'd change each and every error messages if was not translating every english word. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Aug 30, 2019 5:35 am Post subject: |
|
|
Line 1 is not an errror, but could be compatibility with ftn 4 storing characters in a real variable. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Fri Aug 30, 2019 6:56 am Post subject: |
|
|
John, looks like not super-duper compatibility too . The filename is 4 bytes, 'zzzOut.data' is 3 times more.
Last edited by DanRRight on Fri Aug 30, 2019 7:32 am; edited 1 time in total |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Fri Aug 30, 2019 7:30 am Post subject: Re: |
|
|
JohnCampbell wrote: | Line 1 is not an errror, but could be compatibility with ftn 4 storing characters in a real variable. |
It is an error in Fortran 77 and 95 (and later versions). Quote from 7.5.1.2 of Fortran 95 Standard:
A character intrinsic assignment statement is an intrinsic assignment statement for which variable and expr are of type character and have the same kind type parameter.
See also Table 7.9 of Fortran 95 for type compatibility in <variable> = <expression>
Last edited by mecej4 on Fri Aug 30, 2019 11:28 am; edited 1 time in total |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Fri Aug 30, 2019 7:31 am Post subject: Re: |
|
|
--DUPLICATE POST, Please Delete---
Last edited by mecej4 on Sat Aug 31, 2019 9:34 am; edited 1 time in total |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Aug 30, 2019 8:26 am Post subject: |
|
|
It may be an error in the Standard, but isn't it a common extension supported for backward compatibility ? |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Fri Aug 30, 2019 8:54 am Post subject: |
|
|
If the variable were of type INTEGER, perhaps, but assigning a character constant to a REAL variable would almost guarantee incompatibility, since no mainframes that I know of had IEEE reals, and on PCs we have had IEEE compatibility from the time that the first IBM PC arrived. What the Apple II did, I do not know -- possibly, software emulation on the 6502, which did not have FP instructions. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Aug 30, 2019 10:34 am Post subject: |
|
|
I didn't have to look very far. CDC Fortran certainly allowed it, as did Pr1me.
The following is taken from a Pr1me implementation in 1980's.
FTN77 on Pr1me was my first experience of Salford Fortran.
The following was compiled with Pr1me FTN.
I think FTN77 also supported this.
Lines 2 and 3 were my changes for CDC > Pr1me
Code: | C
IMPLICIT INTEGER*4 (I-N)
IMPLICIT REAL*8 (A-H,O-Z)
C
C DRAIN-2D DYNAMIC RESPONSE ANALYSIS OF INELASTIC STRUCTURES
C
C A.E.KANAAN AND G.H.POWELL UNIV. OF CALIF., BERKELEY, 1972
C
COMMON /CONTR/ NELGR,NEQ,MBAND,NPTH,NPTV,NSTO,JCOL
COMMON /GENINF/KCONT(10),KELEM(10),NELEM(10),NINF(10),NDOF(10)
1 ,FCONT(3)
COMMON /DAMP/ ALPHA,BETA,DT,GAXCTE,CON1,CON2,CON3,CON4,CON5,
1 C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,BETAO,DELTA
COMMON /PASS/ IGR,ISTEP,KVARY,NBLOK,KSTAT,KDDS,KM
COMMON /STOR/ NAVST,NF1,NF2,NF3,NF4,NTST,KODST,KDATA
COMMON /OUTN/ IPJ,IPE,KNTJ,KNTE,NHOUT,NVOUT,NROUT
COMMON /WORK/ HED(18),KFORM(2),TITLE(9),W(1972)
COMMON /INFEL/ IEL,KST,LM(1),DUM(199)
COMMON /THIST/ITHOUT(10),THOUT(20),ITHP,ISAVE,NELTH,NSTH,NF7,ISE
COMMON /THISTJ/ITHPJ,NF5,NSTHJ,ISJ
COMMON /THISTR/ITHPR,NF6,NSTHR,NHR,NVR,LRH1(50),LRH2(50),LRV1(50),
1 LRV2(50)
C
DIMENSION A(1)
DIMENSION CHEK(2),HDAT(3,3),HSTF(2,2),SLOD(2,2)
DATA CHEK/5HSTART,5HSTOP /
DATA HDAT/8HEXECUTE ,8H ,8H ,
1 8HDATA CHE,8HCKING ON,8HLY ,
2 8HEXECUTE ,8HIF SINGL,8HE BLOCK /
DATA HSTF/8HSTORED I,8HN CORE ,
1 8HSTORED O,8HN TAPE /
DATA SLOD/8HLOADS AP,8HPLIED ,
1 8HLOADS IG,8HNORED /
C
C
C START AND TITLE CARD
C |
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|