Fortran 77 code using Fortran 90 compiler 
Author Message
 Fortran 77 code using Fortran 90 compiler

Hello,
I am new to fortran and new to this group. I want to write a few
Fortran 77 routines for a commercial product. I am thinking of buying
Intel's or Compaq's(hp's) compiler for this purpose. Is there any
compiler switch available in these products or any other product which
prevents user from accidentally using F90/95 syntax? i.e. I want my
code to be in pure Fortran 77.

Any help appreciated.

Thanks
Sunil



Mon, 05 Dec 2005 12:55:41 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:

> I am new to Fortran and new to this group. I want to write a few
> Fortran 77 routines for a commercial product. I am thinking of buying
> Intel's or Compaq's(hp's) compiler for this purpose. Is there any
> compiler switch available in these products or any other product which
> prevents user from accidentally using F90/95 syntax? i.e. I want my
> code to be in pure Fortran 77.

First, there's a question of which "pure" Fortran 77 syntax you want to
limit things to.  There's the ANSI standard Fortran 77, but there are
also a set of extensions to it (MIL-STD 1753) that virtually all Fortran
77 compilers allow.  You will need to decide whether you want to allow
those or not....

To answer your question, though: If you're just writing code, rather
than trying to produce compiled executable or dll files, I would suggest
using the GNU Fortran 77 compiler unless you have a good reason to spend
the money not to.  This is likely already installed (as g77) if you're
using a linux machine; on Windows, I recommend downloading "Force
Fortran", which contains all the relevant install files along with a
nice GUI interface.  The web site is:
http://www.forceproject.hpg.com.br/.

Anyhow, since this is purely a Fortran 77 compiler, it will rather
automatically prevent you from using most F90/95 syntax -- although it
does support a fair number of extensions, most of which can be turned
off with compiler options.  The description of the compiler options is
in section 7.4 of the "Using and Porting Gnu Fortran" manual (which
Force includes as a help file).  For instance, things like

  -ff90-intrinsics-delete

will mean that it doesn't pay attention to any Fortran 90 intrinsics.
There are various other ones for the other extensions it supports.  In
addition, there's an option

  -pedantic

which issues warnings for some (but unfortunately not all) uses of
non-ANSI syntax.

Combining all of those won't guarantee strict ANSI Fortran-77
compliance, but it should do at least reasonably close.  (Incidentally,
to set the compiler command-line options in Force, you select
"Environment options" from the "Options" menu, select the "Run" tab, and
there's a box to enter them.)

Meanwhile, for a completely separate answer, you might want to look into
a Forcheck (www.forcheck.nl); it's a Fortran syntax checker that seems
to have lots of options for checking conformance with various standards
and compilers, and is likely to do a better verification job (or at
least be more flexible about doing it) than almost any compiler would.
It looks like the licenses cost about the same as a commercial compiler
license, but they do offer one-month trials, and you can download the
documentation and read over it for free before you buy it.

In addition, there's what appears to be a similar program called
FortranLint, from
http://www.cleanscape.net/products/fortranlint/index.html -- again,
trial downloads available.

I haven't used either of those, though, so I have no idea how good they
are.

- Brooks



Mon, 05 Dec 2005 15:14:38 GMT  
 Fortran 77 code using Fortran 90 compiler


Quote:
> I want my code to be in pure Fortran 77.

If you are going to buy a standard compiler then why do you want to
limit  use of your purchased compiler?
You do know that Fortran 77 is not a recognized standard anymore?


Mon, 05 Dec 2005 16:38:43 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:

>> I am new to Fortran and new to this group. I want to write a few
>> Fortran 77 routines for a commercial product. I am thinking of buying
>> Intel's or Compaq's(hp's) compiler for this purpose. Is there any


Quote:
>To answer your question, though: If you're just writing code, rather
>than trying to produce compiled executable or dll files, I would suggest
>using the GNU Fortran 77 compiler unless you have a good reason to spend
>the money not to.  

I would also suggest that g77 would be fine for what you want to do.  As
for checking Standards compliance, you should use FTNCHEK which is
excellent and free and runs on many platforms.  Download from
http://dsm.dsm.fordham.edu/~ftnchek/

You need to read the manual to determine which command-line switches to use
to get maximum warnings of non-standard features.  It also does a very good
job of finding bugs (but of course like all of us, you never write those,
I'm sure :-)
--
Clive Page   cgp <at sign> le.ac.uk



Mon, 05 Dec 2005 16:41:07 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:
>I am new to Fortran and new to this group. I want to write a few
>Fortran 77 routines for a commercial product. I am thinking of buying
>Intel's or Compaq's(hp's) compiler for this purpose. Is there any
>compiler switch available in these products or any other product which
>prevents user from accidentally using F90/95 syntax? i.e. I want my
>code to be in pure Fortran 77.

Neither the Intel nor Compaq compilers have options to restrict language
features to F77.  Both can warn you if you have used features not in F90 or
F95. As others have commented, I wonder why you want to restrict yourself to a
no-longer-standard version of the language.

Steve Lionel
Software Products Division
Intel Corporation
Nashua, NH

User communities for Intel Fortran and Compaq Visual Fortran:
  http://intel.com/IDS/forums/fortran



Mon, 05 Dec 2005 19:54:47 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:

> I am new to Fortran and new to this group. I want to write a few
> Fortran 77 routines for a commercial product. I am thinking of buying
> Intel's or Compaq's(hp's) compiler for this purpose. Is there any
> compiler switch available in these products or any other product which
> prevents user from accidentally using F90/95 syntax? i.e. I want my
> code to be in pure Fortran 77.

As far as I can see, there is no flag in Intel's compiler that
gives this behavior (at least in the linux version). I can't comment
on Compaq but the NAG compiler doesn't seem to have it either.

Why don't you just use g77?

You don't even have to buy it, although if you find it useful I
suggest you consider making a donation. Remember that even though
the compiler is GPLed, the GPL doesn't have to apply to code
you _compile_ with it (assuming that by "commercial" you mean
"closed source").

Will



Mon, 05 Dec 2005 22:06:55 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:

> i.e. I want my code to be in pure Fortran 77.

Others have gven answers as good or better than I could for most of
your question.  I'm curious whether you mean the above literally,
though.  Do you really mean pure Fortran 77, or do you just mean code
that will be accepted by Fortran 77 compilers still in widespread use?
If you want your code to be accepted by most current compilers, then I
can at least understand basis of the requirement (not sure I'd
necessarily agree with it, but I don't have enough data to know the
specific case). In that case, I'd second the g77 recommendation
made by several others because

1. It is one of the pretty widely used f77 compilers that you might
   specifically be concerned about.

2. It has, on the whole, fewer extensions than many other current f77
   compilers.  Well, I'm not sure that "fewer" is accurate.  In any
   case it lacks some that can be a big bother to port if you
   mistakenly used them and then have to port to a compiler
   without them (notably so-called Vax records and Cray pointers).

And forchek can also be a help there, as others also mentioned.

If you really meant pure Fortran 77 literally, are you aware what
that means?  Its been a long time since I've seen code like that.
No mixed case.  No variable names longer than 7 characters.  I can
see no justification that I'd understand for writing new code
like that.  There was a time when you needed to stick to those
rules for portability, but today, even among compilers that only
claim f77 conformance, you don't have to be quite that "pure".
Of course, it can be a bit of bother to determine exactly what is
"safe" - standards are nice about that.

--
Richard Maine                |  Good judgment comes from experience;

                             |        -- Mark Twain



Mon, 05 Dec 2005 22:56:17 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:
> I am new to Fortran and new to this group. I want to write a few
> Fortran 77 routines for a commercial product. I am thinking of buying
> Intel's or Compaq's(hp's) compiler for this purpose. Is there any
> compiler switch available in these products or any other product which
> prevents user from accidentally using F90/95 syntax? i.e. I want my
> code to be in pure Fortran 77.

Don't forget about the free Watcom F77 compiler at
www.openwatcom.org .  It has a free C/C++ compiler
with it also.

Sincerely,
Lynn



Tue, 06 Dec 2005 05:35:42 GMT  
 Fortran 77 code using Fortran 90 compiler
Thank you all for your replies. My understanding was that I can't use
a GPL compiler for a commercial project. I've to read it again. I'll
definitely try these options before purchacing one.

I am supposed to provide source code to my client. I dont want him to
report any compilation issues. He wasn't specific abt any compiler. He
said any Fortran 77 will do.

Once again thanks
Sunil

Quote:

> > I am new to Fortran and new to this group. I want to write a few
> > Fortran 77 routines for a commercial product. I am thinking of buying
> > Intel's or Compaq's(hp's) compiler for this purpose. Is there any
> > compiler switch available in these products or any other product which
> > prevents user from accidentally using F90/95 syntax? i.e. I want my
> > code to be in pure Fortran 77.

> Don't forget about the free Watcom F77 compiler at
> www.openwatcom.org .  It has a free C/C++ compiler
> with it also.

> Sincerely,
> Lynn



Tue, 06 Dec 2005 14:27:57 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:

> Thank you all for your replies. My understanding was that I can't use
> a GPL compiler for a commercial project. I've to read it again.

This is (approximately) a FAQ issue; see:
  http://www.gnu.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF

To quote the from answer: "[T]he copyright on the editors and tools does
not cover the code you write.  Using [GNU-licensed editors and
compilers] does not place any restrictions, legally, on the license you
use for your code ... [T]he part of the output which is derived from the
program's input inherits the copyright status of the input."

It further states, a couple of questions later, that it is legally
impossible for a license such as the GNU license to create a restriction
such that the output of a compiler would be bound by the copyright
restrictions on the compiler.

There's rather a bit more about related issues in the following
questions.  In addition, since it's not covered there, note that a lot
of the core GNU libraries -- glibc, for instance -- are covered by the
LGPL ("Lesser GPL") instead, which means you can use them in commercial
projects.

Beyond this, you're not distributing the compiled code, anyhow -- you're
distributing the source, which hasn't even been touched by the compiler.

(The GNU organization is very happy for their tools -- and tools
distributed under the GPL -- to be used in commercial projects; for
instance, the Apache web server is used in a lot of commercial web
servers, which is why companies pay people to work on developing it,
which is why it's a very good product.  The GNU compilers are similar
examples, I would imagine.  And, in general, probably a very large
percentage of GPL software development is funded by companies that
intend to use the end results for their commercial projects....)

Quote:
> I'll
> definitely try these options before purchacing one.

> I am supposed to provide source code to my client. I dont want him to
> report any compilation issues. He wasn't specific abt any compiler. He
> said any Fortran 77 will do.

It occurs to me, also, to mention that there's a copy of the Fortran 77
standards available online at
http://www.fortran.com/fortran/F77_std/rjcnf.html.

- Brooks



Tue, 06 Dec 2005 15:10:39 GMT  
 Fortran 77 code using Fortran 90 compiler


Quote:
>And forchek can also be a help there, as others also mentioned.

or FTNCHEK (which is free, others are commercial products)

Quote:
>No mixed case.  No variable names longer than 7 characters.  I can

6 actually.

I'd add: no END DO statement, which forces you to sprinkle the code with
unwanted statement labels.

--
Clive Page   cgp <at sign> le.ac.uk



Tue, 06 Dec 2005 17:01:15 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:

> Thank you all for your replies. My understanding was that I can't use
> a GPL compiler for a commercial project. I've to read it again. I'll
> definitely try these options before purchacing one.

Your understanding is wrong IMO - see my previous post and
http://www.fsf.org/licenses/gpl-faq.html#CanIUseGPLToolsForNF


Tue, 06 Dec 2005 23:07:39 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:



> >No mixed case.  No variable names longer than 7 characters.  I can

> 6 actually.

Oops.  Its been long enough since I stuck by that limit that the number
sliped by senile mind.  That was about the first extension of f77 that
I decided to consistently allow myself.

Quote:
> I'd add: no END DO statement, which forces you to sprinkle the code with
> unwanted statement labels.

That one I personally stuck with until f90 came out because even
fairly late in f77 days I occasionally ran into a compiler that didn't
support enddo.  Not sure whether there are any current compilers with
that problem (I currently prefer to work with f90, and in the occasional
case where a project is required to work with some f77 compilers, I
tend to allow myself as many of f90 features as are shared by the
particular compilers required; that has included do/enddo in all
recent cases of my experience.)

--
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain



Tue, 06 Dec 2005 23:06:59 GMT  
 Fortran 77 code using Fortran 90 compiler

Quote:
> Thank you all for your replies. My understanding was that I can't use
> a GPL compiler for a commercial project. I've to read it again. I'll
> definitely try these options before purchacing one.

> I am supposed to provide source code to my client. I dont want him to
> report any compilation issues. He wasn't specific abt any compiler. He
> said any Fortran 77 will do.

Read  http://www.openwatcom.org/license_info/open_watcom_lic.html .
As long as you do not change any of the compiler source code, you are
clear to ship proprietary products.

Lynn



Tue, 06 Dec 2005 23:37:59 GMT  
 Fortran 77 code using Fortran 90 compiler


Quote:


>>And forchek can also be a help there, as others also mentioned.

>or FTNCHEK (which is free, others are commercial products)

>>No mixed case.  No variable names longer than 7 characters.  I can

>6 actually.

>I'd add: no END DO statement, which forces you to sprinkle the code with
>unwanted statement labels.

and a real killer if you need to use common blocks: no INCLUDE.

You could look at Salford FTN77 which is a truly excellent Fortran 77
compiler. It's relatively conservative in the extensions to F77 it
allows, but things like long variable names, ENDDO, mixed case and
INCLUDE are there - in my experience, F77 code with extensions written
for FTN77 would work with other F77 compilers, but often not the other
way round.

Catherine.
--
Catherine Rees Lay



Tue, 06 Dec 2005 18:44:51 GMT  
 
 [ 25 post ]  Go to page: [1] [2]

 Relevant Pages 

1. problems converting Fortran 77 code to Fortran 90

2. Fortran 77 vs Fortran 90/95

3. Fortran 90 -> Fortran 77 translator

4. HELP: How to translate Fortran 77 to Fortran 90

5. HELP: How to translate Fortran 77 to Fortran 90

6. Watcom Fortran 77 and Fortran 90

7. conversion fortran 77 to fortran 90

8. COnvert Fortran 77 to Fortran 90 programs ?

9. fortran 77/fortran 90 differences

10. Comparing Efficiency of Fortran-90 v/s Fortran-77

11. Converting from Fortran 77 to Fortran 90

12. Fortran 77 -> Fortran 90 (or C++)

 

 
Powered by phpBB® Forum Software