replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - GFortran to FTN95: How does ENUM work?
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GFortran to FTN95: How does ENUM work?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mgup



Joined: 04 Feb 2015
Posts: 3

PostPosted: Wed Feb 04, 2015 5:18 pm    Post subject: GFortran to FTN95: How does ENUM work? Reply with quote

I have a project of roughly 38k lines of Fortran that currently builds as a Win32 dll in GFortran. I am working on getting it to build in FTN95, and I don't really know much about Fortran.

The main problem I'm having right now that I haven't had much luck in finding a solution for is these enums, coded like this:

Code:

   ENUM, BIND(C)
      ENUMERATOR ::    SeaSI      = 1
      ENUMERATOR ::    SeaField   = 2
      ENUMERATOR ::    SeaSeapp   = 3
      ENUMERATOR ::    SeaYaws    = 4
      ENUMERATOR ::    SeaDippr   = 5
      ENUMERATOR ::    SeaBritish = 6
      ENUMERATOR ::    SeaPureSI  = 7
      ENUMERATOR ::    SeaHysys   = 8
   END ENUM


It builds as-is in GFortran, but building in FTN95 gives me an error message on the first line, saying "The '::' separator is missing".

I tried looking up Fortran syntax, and found this, which seems to suggest that the first line should be followed by a :: type_alias_name. I tried changing it to:

Code:

   ENUM, BIND(C) :: SEATYPE


And FTN95 says Syntax Error on that line. I tried a few other variations of the same idea, and keep getting Syntax Errors. I haven't been able to find any documentation on what FTN95 expects Enums to look like, so I'm not really sure what to do now. Can anyone point me in the right direction for getting FTN95 to accept these enums?
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Wed Feb 04, 2015 5:55 pm    Post subject: Reply with quote

Enumerators are not part of Fortran-95, and were introduced in Fortran-2003. Silverfrost FTN95 is a Fortran-95 compiler with some features from Fortran-2003 added. Enumerators are not one of those, so you have to use another compiler or replace enumerators with another constructs.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Wed Feb 04, 2015 6:10 pm    Post subject: Reply with quote

ENUM is available in FTN95 with /f2k on the command line (from v6.2).

I have not tried it with this code.
Back to top
View user's profile Send private message AIM Address
mgup



Joined: 04 Feb 2015
Posts: 3

PostPosted: Wed Feb 04, 2015 7:41 pm    Post subject: Reply with quote

I had been trying to build it in FTN95 Express, which seems to have an older version of FTN95. I downloaded the Personal edition, and tried loading the project in Plato, and it seems to like the Enums properly now. Of course, there's a pile of other errors to figure out...
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Wed Feb 04, 2015 7:57 pm    Post subject: Reply with quote

FTN95 Express does have an older version of FTN95.

However, if you download and install the Personal edition after you have installed FTN95 Express (which you have done), this will update FTN95, and you can use the up-to-date FTN95 either using Plato or the Visual Studio shell.

Well this is my recollection. Its been a while since I used the express version as I prefer Plato and the command line.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Wed Feb 04, 2015 8:14 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
ENUM is available in FTN95 with /f2k on the command line (from v6.2).
That's good to know! I checked only in the FTN95 7.10 help file, and found no mention of enumerators other than in a .NET context. Perhaps the documentation is a tad older than the compiler?
Back to top
View user's profile Send private message
mgup



Joined: 04 Feb 2015
Posts: 3

PostPosted: Thu Feb 05, 2015 12:40 am    Post subject: Re: Reply with quote

davidb wrote:
FTN95 Express does have an older version of FTN95.

However, if you download and install the Personal edition after you have installed FTN95 Express (which you have done), this will update FTN95, and you can use the up-to-date FTN95 either using Plato or the Visual Studio shell.

Well this is my recollection. Its been a while since I used the express version as I prefer Plato and the command line.


I did that, and it didn't update FTN95 Express for me automatically. However, FTN95 Express did use the new version after I copied all of the files from the FTN95 folder into the FTN95 Express folder.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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