Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #491 > unrolled thread

fortran 77 errors

Started by"Bill Cunningham" <nospam@nspam.invalid>
First post2011-06-22 16:43 -0400
Last post2011-06-27 17:13 +1000
Articles 20 on this page of 56 — 16 participants

Back to article view | Back to comp.programming


Contents

  fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-22 16:43 -0400
    Re: fortran 77 errors James Waldby <not@valid.invalid> - 2011-06-22 21:18 +0000
      Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-22 18:31 -0400
        Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-22 17:21 -0700
          Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-22 20:50 -0400
            Re: fortran 77 errors Ian Collins <ian-news@hotmail.com> - 2011-06-23 14:58 +1200
              Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-23 00:27 -0400
                Re: fortran 77 errors blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-23 17:07 +0000
                  Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-23 16:53 -0400
                    Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-23 14:05 -0700
                      Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-24 17:58 -0400
                      Re: fortran 77 errors "robin" <robin51@dodo.mapson.com.au> - 2011-06-27 17:04 +1000
            Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-23 12:34 -0700
          Re: fortran 77 errors blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-23 17:06 +0000
          Re: fortran 77 errors "robin" <robin51@dodo.mapson.com.au> - 2011-06-27 17:01 +1000
            Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-28 06:39 -0700
    Re: fortran 77 errors free@securityaudit.val.newsbank.net (Dick Wesseling) - 2011-06-23 00:43 +0000
      Re: fortran 77 errors "Ant" <not@home.today> - 2011-06-23 02:38 +0100
      Re: fortran 77 errors "robin" <robin51@dodo.mapson.com.au> - 2011-06-27 17:07 +1000
    Re: fortran 77 errors Geoff <geoff@invalid.invalid> - 2011-06-23 00:47 -0700
      Re: fortran 77 errors Geoff <geoff@invalid.invalid> - 2011-06-23 00:55 -0700
        Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-23 04:16 -0400
          Re: fortran 77 errors Ike Naar <ike@sverige.freeshell.org> - 2011-06-23 09:23 +0000
            Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-23 06:55 -0700
              Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-23 07:02 -0700
              Re: fortran 77 errors Rui Maciel <rui.maciel@gmail.com> - 2011-06-23 15:22 +0100
                Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-23 08:19 -0700
                  Re: fortran 77 errors Geoff <geoff@invalid.invalid> - 2011-06-23 08:52 -0700
                    Re: fortran 77 errors blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-23 17:32 +0000
                      Re: fortran 77 errors Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-06-23 22:39 +0100
                        Re: fortran 77 errors blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-24 20:08 +0000
                  Re: fortran 77 errors Rui Maciel <rui.maciel@gmail.com> - 2011-06-23 19:38 +0100
                Re: fortran 77 errors "osmium" <r124c4u102@comcast.net> - 2011-06-23 10:25 -0500
                  Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-23 09:47 -0700
                  Re: fortran 77 errors blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-23 17:30 +0000
                  Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-23 17:30 -0400
                  Re: fortran 77 errors Dan <dantex1@aol.com> - 2011-06-25 10:10 -0700
                  Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-28 11:21 -0400
                    Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-28 09:40 -0700
                      Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-28 17:59 -0400
                        Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-28 15:21 -0700
                Re: fortran 77 errors "robin" <robin51@dodo.mapson.com.au> - 2011-06-28 00:43 +1000
                  Re: fortran 77 errors Rui Maciel <rui.maciel@gmail.com> - 2011-06-28 11:40 +0100
                    Re: fortran 77 errors "robin" <robin51@dodo.com.au> - 2011-07-05 09:06 +1000
            Re: fortran 77 errors "robin" <robin51@dodo.mapson.com.au> - 2011-06-28 00:41 +1000
          Re: fortran 77 errors Rui Maciel <rui.maciel@gmail.com> - 2011-06-23 12:12 +0100
          Re: fortran 77 errors Geoff <geoff@invalid.invalid> - 2011-06-23 06:52 -0700
            Re: fortran 77 errors "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-23 17:45 -0400
              Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-23 15:30 -0700
              Re: fortran 77 errors Geoff <geoff@invalid.invalid> - 2011-06-23 17:25 -0700
                Re: fortran 77 errors Patricia Shanahan <pats@acm.org> - 2011-06-24 10:35 -0700
                Re: fortran 77 errors blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-06-24 20:09 +0000
              Re: fortran 77 errors Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-06-24 01:38 +0100
      Re: fortran 77 errors "robin" <robin51@dodo.mapson.com.au> - 2011-06-27 17:10 +1000
    Re: fortran 77 errors kym@kymhorsell.com - 2011-06-23 21:23 +0000
    Re: fortran 77 errors "robin" <robin51@dodo.mapson.com.au> - 2011-06-27 17:13 +1000

Page 1 of 3  [1] 2 3  Next page →


#491 — fortran 77 errors

From"Bill Cunningham" <nospam@nspam.invalid>
Date2011-06-22 16:43 -0400
Subjectfortran 77 errors
Message-ID<4e025412$0$1945$bbae4d71@news.suddenlink.net>
    This code doesn't seem to work with my g77 compiler.

begin program
print *,'hello world'
stop
end

I've done this in all caps and in lower case. A carat points to the first 
letter in each line and replies with an error. Is there something obviously 
wrong with this code?

Bill

[toc] | [next] | [standalone]


#492

FromJames Waldby <not@valid.invalid>
Date2011-06-22 21:18 +0000
Message-ID<ittm7r$ib8$1@dont-email.me>
In reply to#491
On Wed, 22 Jun 2011 16:43:10 -0400, Bill Cunningham wrote:

> This code doesn't seem to work with my g77 compiler.
> 
> begin program
> print *,'hello world'
> stop
> end
> 
> I've done this in all caps and in lower case. A carat points to the
> first letter in each line and replies with an error. Is there something
> obviously wrong with this code?

<http://gcc.gnu.org/fortran/> says "We highly encourage users to move 
from g77, which is no longer maintained, and start taking advantage 
of GFortran's modern features. Legacy g77 code will compile fine in 
almost all cases."  But instead of messing around wasting our time 
trying to write Fortran, why don't you try Python?

Anyhow, "begin program" looks wrong -- I don't remember 'begin'
as a Fortran keyword -- and I think F77 doesn't support free-form
input, only fixed-form.  <http://gcc.gnu.org/wiki/GFortran#manuals>
has some manuals I plan to not look at, but you could do so.

Note, <http://gcc.gnu.org/wiki/GFortranUsage> says, ""Fortran 95 
allows for [free form and fixed form] ... The rule in place is 
as follows:     1.  Files whose name ends in .f or .for are assumed 
to be fixed form     2.  Files whose name end in .f90 or .f95 are 
assumed to to be free form   3. For other files [use] command line 
options..."  

If you post again about this problem, make sure you cut and paste
the exact code you are compiling; show the command you used for 
the compile; and show the compiler's output instead of the useless
remark "doesn't seem to work".

-- 
jiw

[toc] | [prev] | [next] | [standalone]


#493

From"Bill Cunningham" <nospam@nspam.invalid>
Date2011-06-22 18:31 -0400
Message-ID<4e026d84$0$952$bbae4d71@news.suddenlink.net>
In reply to#492
James Waldby wrote:
> On Wed, 22 Jun 2011 16:43:10 -0400, Bill Cunningham wrote:
>
>> This code doesn't seem to work with my g77 compiler.
>>
>> begin program
>> print *,'hello world'
>> stop
>> end
>>
>> I've done this in all caps and in lower case. A carat points to the
>> first letter in each line and replies with an error. Is there
>> something obviously wrong with this code?
>
> <http://gcc.gnu.org/fortran/> says "We highly encourage users to move
> from g77, which is no longer maintained, and start taking advantage
> of GFortran's modern features.

    I looked at the page at your link and can't find where the most modern 
fortran standard compiler download is. I use a library called libf2c too 
with my fortran. This seems like an argument between c89 and c99. Which is 
best. I guess it would be a question between portability.

 Legacy g77 code will compile fine in
> almost all cases."  But instead of messing around wasting our time
> trying to write Fortran, why don't you try Python?

    I have looked at python. It's hard to understand. fortran in what I've 
seen looks simpler to learn. That or C++. I like C and I'm not going to give 
up on it but it gives me problems quite a bit.

Bill

>
> Anyhow, "begin program" looks wrong -- I don't remember 'begin'
> as a Fortran keyword -- and I think F77 doesn't support free-form
> input, only fixed-form.  <http://gcc.gnu.org/wiki/GFortran#manuals>
> has some manuals I plan to not look at, but you could do so.
>
> Note, <http://gcc.gnu.org/wiki/GFortranUsage> says, ""Fortran 95
> allows for [free form and fixed form] ... The rule in place is
> as follows:     1.  Files whose name ends in .f or .for are assumed
> to be fixed form     2.  Files whose name end in .f90 or .f95 are
> assumed to to be free form   3. For other files [use] command line
> options..."
>
> If you post again about this problem, make sure you cut and paste
> the exact code you are compiling; show the command you used for
> the compile; and show the compiler's output instead of the useless
> remark "doesn't seem to work". 

[toc] | [prev] | [next] | [standalone]


#494

FromPatricia Shanahan <pats@acm.org>
Date2011-06-22 17:21 -0700
Message-ID<OYudnZcPs7qOGp_TnZ2dnUVZ_tGdnZ2d@earthlink.com>
In reply to#493
On 6/22/2011 3:31 PM, Bill Cunningham wrote:
> James Waldby wrote:
>> On Wed, 22 Jun 2011 16:43:10 -0400, Bill Cunningham wrote:
>>
>>> This code doesn't seem to work with my g77 compiler.
>>>
>>> begin program
>>> print *,'hello world'
>>> stop
>>> end
>>>
>>> I've done this in all caps and in lower case. A carat points to the
>>> first letter in each line and replies with an error. Is there
>>> something obviously wrong with this code?
>>
>> <http://gcc.gnu.org/fortran/>  says "We highly encourage users to move
>> from g77, which is no longer maintained, and start taking advantage
>> of GFortran's modern features.
>
>      I looked at the page at your link and can't find where the most modern
> fortran standard compiler download is. I use a library called libf2c too
> with my fortran. This seems like an argument between c89 and c99. Which is
> best. I guess it would be a question between portability.

The page contained a link to the GFortran wiki,
http://gcc.gnu.org/wiki/GFortran#manuals, which has a lot of data about
GFortran including downloading.

If you are going to program in Fortran 77, you need to get hold of a
reference for Fortran 77. I found
http://www.obliquity.com/computer/fortran/.

I have not checked it extensively, but it does contain, near the start,
the information you would need to fix your program. Note that the
statement field starts in column 6, not column 1, and the main program
should start with a program statement: "PROGRAM main-name" where
main-name is a unique identifier.

>     I have looked at python. It's hard to understand. fortran in what I've
> seen looks simpler to learn. That or C++. I like C and I'm not going to give
> up on it but it gives me problems quite a bit.

What type of problems? Depending on the issues you are facing, Fortran
may not be any improvement over C.

Patricia

[toc] | [prev] | [next] | [standalone]


#496

From"Bill Cunningham" <nospam@nspam.invalid>
Date2011-06-22 20:50 -0400
Message-ID<4e028df0$0$19997$bbae4d71@news.suddenlink.net>
In reply to#494
Patricia Shanahan wrote:

> What type of problems? Depending on the issues you are facing, Fortran
> may not be any improvement over C.

    Mostly syntactic and algorithmic problems. I have a copy of kandr2 that 
helps some. But until recently I would have no idea how to program in int 
main() a simple calculation of an arithmetic mean. I know the code now with 
help from others. Maybe this is a lack of experience issue.

Bill

[toc] | [prev] | [next] | [standalone]


#498

FromIan Collins <ian-news@hotmail.com>
Date2011-06-23 14:58 +1200
Message-ID<96foekFmtvU13@mid.individual.net>
In reply to#496
On 06/23/11 12:50 PM, Bill Cunningham wrote:
> Patricia Shanahan wrote:
>
>> What type of problems? Depending on the issues you are facing, Fortran
>> may not be any improvement over C.
>
>      Mostly syntactic and algorithmic problems. I have a copy of kandr2 that
> helps some. But until recently I would have no idea how to program in int
> main() a simple calculation of an arithmetic mean. I know the code now with
> help from others. Maybe this is a lack of experience issue.

Lack of experience?  Come on, you have been asking the same questions 
for a decade now.

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#499

From"Bill Cunningham" <nospam@nspam.invalid>
Date2011-06-23 00:27 -0400
Message-ID<4e02c0fa$0$1945$bbae4d71@news.suddenlink.net>
In reply to#498
Ian Collins wrote:

> Lack of experience?  Come on, you have been asking the same questions
> for a decade now.

    Well it's something. About all I want to do with C is write financial 
and mathematics things. Some things not too complicated. When I first 
started reading C like languages it was C++ and I seemed to have been doing 
fine as far as I went. Then I went to C and somethnig happened.

Bill

[toc] | [prev] | [next] | [standalone]


#514

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-06-23 17:07 +0000
Message-ID<96ha5qFr09U4@mid.individual.net>
In reply to#499
In article <4e02c0fa$0$1945$bbae4d71@news.suddenlink.net>,
Bill Cunningham <nospam@nspam.invalid> wrote:
> Ian Collins wrote:
> 
> > Lack of experience?  Come on, you have been asking the same questions
> > for a decade now.
> 
>     Well it's something. About all I want to do with C is write financial 
> and mathematics things. Some things not too complicated. When I first 
> started reading C like languages it was C++ and I seemed to have been doing 
> fine as far as I went. Then I went to C and somethnig happened.
> 

So why switch to C, if you were doing fine with C++?  

-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

[toc] | [prev] | [next] | [standalone]


#519

From"Bill Cunningham" <nospam@nspam.invalid>
Date2011-06-23 16:53 -0400
Message-ID<4e03a814$0$1938$bbae4d71@news.suddenlink.net>
In reply to#514
blmblm@myrealbox.com wrote:
> In article <4e02c0fa$0$1945$bbae4d71@news.suddenlink.net>,

> So why switch to C, if you were doing fine with C++?

    I was disappointed by the size of the binaries created by my compiler. 
And that's with symbols stripped. I thought I could do the same with C that 
I could with C++. I guess I could but C++ is going to use the same syntax 
atleast to a point as C.

Bill

[toc] | [prev] | [next] | [standalone]


#521

FromPatricia Shanahan <pats@acm.org>
Date2011-06-23 14:05 -0700
Message-ID<s4CdnRYbyu0jN57TnZ2dnUVZ_sidnZ2d@earthlink.com>
In reply to#519
On 6/23/2011 1:53 PM, Bill Cunningham wrote:
> blmblm@myrealbox.com wrote:
>> In article<4e02c0fa$0$1945$bbae4d71@news.suddenlink.net>,
>
>> So why switch to C, if you were doing fine with C++?
>
>      I was disappointed by the size of the binaries created by my compiler.
> And that's with symbols stripped. I thought I could do the same with C that
> I could with C++. I guess I could but C++ is going to use the same syntax
> atleast to a point as C.

Most mathematical and financial software is intended to run on
reasonably capable computers, not on smart phones. Are you sure
executable size is that high a priority issue compared to just getting
your programs working?

If I had a free choice between C or C++ I would pick C++, even if I did
not intend to write primarily OO code. C++ has more powerful libraries
than C. Anything that can be done easily in C can also be done
easily in C++, but the libraries make some things easy in C++ that are
harder in C. The cost of the more powerful libraries is larger binary
size, but that is usually unimportant compared to programming productivity.

Patricia

[toc] | [prev] | [next] | [standalone]


#536

From"Bill Cunningham" <nospam@nspam.invalid>
Date2011-06-24 17:58 -0400
Message-ID<4e05089f$0$1932$bbae4d71@news.suddenlink.net>
In reply to#521
Patricia Shanahan wrote:
> On 6/23/2011 1:53 PM, Bill Cunningham wrote:
>> blmblm@myrealbox.com wrote:
>>> In article<4e02c0fa$0$1945$bbae4d71@news.suddenlink.net>,
>>
>>> So why switch to C, if you were doing fine with C++?
>>
>>      I was disappointed by the size of the binaries created by my
>> compiler. And that's with symbols stripped. I thought I could do the
>> same with C that I could with C++. I guess I could but C++ is going
>> to use the same syntax atleast to a point as C.
>
> Most mathematical and financial software is intended to run on
> reasonably capable computers, not on smart phones. Are you sure
> executable size is that high a priority issue compared to just getting
> your programs working?

    Well I guess on today's computers it really wouldn't matter then.

> If I had a free choice between C or C++ I would pick C++, even if I
> did not intend to write primarily OO code. C++ has more powerful
> libraries than C.

    Like the STLs?

 Anything that can be done easily in C can also be
> done easily in C++, but the libraries make some things easy in C++ that 
> are
> harder in C. The cost of the more powerful libraries is larger binary
> size, but that is usually unimportant compared to programming
> productivity.
> Patricia 

[toc] | [prev] | [next] | [standalone]


#539

From"robin" <robin51@dodo.mapson.com.au>
Date2011-06-27 17:04 +1000
Message-ID<4e082b93$0$79548$c30e37c6@exi-reader.telstra.net>
In reply to#521
"Patricia Shanahan" <pats@acm.org> wrote in message news:s4CdnRYbyu0jN57TnZ2dnUVZ_sidnZ2d@earthlink.com...
|
| Most mathematical and financial software is intended to run on
| reasonably capable computers, not on smart phones. Are you sure
| executable size is that high a priority issue compared to just getting
| your programs working?
|
| If I had a free choice between C or C++ I would pick C++, even if I did
| not intend to write primarily OO code. C++ has more powerful libraries
| than C. Anything that can be done easily in C can also be done
| easily in C++, but the libraries make some things easy in C++ that are
| harder in C. The cost of the more powerful libraries is larger binary
| size, but that is usually unimportant compared to programming productivity.

If you're interested in programming productivity, you'd be using PL/I
instead of either C, C++, and Fortran. 

[toc] | [prev] | [next] | [standalone]


#518

FromPatricia Shanahan <pats@acm.org>
Date2011-06-23 12:34 -0700
Message-ID<YeWdnUfYbpHzCJ7TnZ2dnUVZ_r-dnZ2d@earthlink.com>
In reply to#496
On 6/22/2011 5:50 PM, Bill Cunningham wrote:
> Patricia Shanahan wrote:
>
>> What type of problems? Depending on the issues you are facing, Fortran
>> may not be any improvement over C.
>
>      Mostly syntactic and algorithmic problems. I have a copy of kandr2 that
> helps some. But until recently I would have no idea how to program in int
> main() a simple calculation of an arithmetic mean. I know the code now with
> help from others. Maybe this is a lack of experience issue.

I hate to discourage anyone who wants to learn programming, but this
does not seem promising for writing much financial or mathematical
software. Arithmetic mean is one of the simplest calculations in both
the mathematical and financial families. It is often used as a first
exercise in array access. It should require only hours of programming
experience.

Maybe there is something about how you are thinking about programming?
How well do you do at explaining how to do something to people? Can you
write a clear set of instructions for a calculation, without worrying
about programming languages?

Patricia

[toc] | [prev] | [next] | [standalone]


#513

Fromblmblm@myrealbox.com <blmblm.myrealbox@gmail.com>
Date2011-06-23 17:06 +0000
Message-ID<96ha4hFr09U3@mid.individual.net>
In reply to#494
In article <OYudnZcPs7qOGp_TnZ2dnUVZ_tGdnZ2d@earthlink.com>,
Patricia Shanahan  <pats@acm.org> wrote:
> On 6/22/2011 3:31 PM, Bill Cunningham wrote:
> > James Waldby wrote:

[ snip ]

> >     I have looked at python. It's hard to understand. fortran in what I've
> > seen looks simpler to learn. That or C++. I like C and I'm not going to give
> > up on it but it gives me problems quite a bit.
> 
> What type of problems? Depending on the issues you are facing, Fortran
> may not be any improvement over C.
> 

Indeed.  Bill has been posting questions about C to comp.lang.c for
some years, and -- well, if you're really curious, possibly searching
the newsgroup's archives for posts by him will be instructive.

-- 
B. L. Massingill
ObDisclaimer:  I don't speak for my employers; they return the favor.

[toc] | [prev] | [next] | [standalone]


#538

From"robin" <robin51@dodo.mapson.com.au>
Date2011-06-27 17:01 +1000
Message-ID<4e082acd$0$79548$c30e37c6@exi-reader.telstra.net>
In reply to#494
"Patricia Shanahan" <pats@acm.org> wrote in message news:OYudnZcPs7qOGp_TnZ2dnUVZ_tGdnZ2d@earthlink.com...
| On 6/22/2011 3:31 PM, Bill Cunningham wrote:
| > James Waldby wrote:
| >> On Wed, 22 Jun 2011 16:43:10 -0400, Bill Cunningham wrote:
| If you are going to program in Fortran 77, you need to get hold of a
| reference for Fortran 77. I found
| http://www.obliquity.com/computer/fortran/.
|
| I have not checked it extensively, but it does contain, near the start,
| the information you would need to fix your program. Note that the
| statement field starts in column 6, not column 1, and the main program
| should start with a program statement: "PROGRAM main-name" where
| main-name is a unique identifier.

The statement field starts in column 7, not column 6.
Column 6 is reserved for a continuation character.

| >     I have looked at python. It's hard to understand. fortran in what I've
| > seen looks simpler to learn. That or C++. I like C and I'm not going to give
| > up on it but it gives me problems quite a bit.
|
| What type of problems? Depending on the issues you are facing, Fortran
| may not be any improvement over C.

Fortran (post F77) is an improvement over C.  So is PL/I. 

[toc] | [prev] | [next] | [standalone]


#548

FromPatricia Shanahan <pats@acm.org>
Date2011-06-28 06:39 -0700
Message-ID<rMGdnXm2Rf4LRJTTnZ2dnUVZ_h6dnZ2d@earthlink.com>
In reply to#538
On 6/27/2011 12:01 AM, robin wrote:
> "Patricia Shanahan"<pats@acm.org>  wrote in message news:OYudnZcPs7qOGp_TnZ2dnUVZ_tGdnZ2d@earthlink.com...
> | On 6/22/2011 3:31 PM, Bill Cunningham wrote:
> |>  James Waldby wrote:
> |>>  On Wed, 22 Jun 2011 16:43:10 -0400, Bill Cunningham wrote:
> | If you are going to program in Fortran 77, you need to get hold of a
> | reference for Fortran 77. I found
> | http://www.obliquity.com/computer/fortran/.
> |
> | I have not checked it extensively, but it does contain, near the start,
> | the information you would need to fix your program. Note that the
> | statement field starts in column 6, not column 1, and the main program
> | should start with a program statement: "PROGRAM main-name" where
> | main-name is a unique identifier.
>
> The statement field starts in column 7, not column 6.
> Column 6 is reserved for a continuation character.

Apologies for the typo.

>
> |>      I have looked at python. It's hard to understand. fortran in what I've
> |>  seen looks simpler to learn. That or C++. I like C and I'm not going to give
> |>  up on it but it gives me problems quite a bit.
> |
> | What type of problems? Depending on the issues you are facing, Fortran
> | may not be any improvement over C.
>
> Fortran (post F77) is an improvement over C.  So is PL/I.

I agree that current Fortran versions are better than C for most
programming projects. That does not address the question I was trying to
raise, whether a change of programming language would be a useful or
harmful strategy for the OP, given the difficulties he is experiencing.

Patricia

[toc] | [prev] | [next] | [standalone]


#495

Fromfree@securityaudit.val.newsbank.net (Dick Wesseling)
Date2011-06-23 00:43 +0000
Message-ID<4e028c21$0$14147$c5fe704e@news6.xs4all.nl>
In reply to#491
In article <4e025412$0$1945$bbae4d71@news.suddenlink.net>,
	"Bill Cunningham" <nospam@nspam.invalid> writes:
>     This code doesn't seem to work with my g77 compiler.
> 
> begin program
> print *,'hello world'
> stop
> end
> 
> I've done this in all caps and in lower case. A carat points to the first 
> letter in each line and replies with an error. Is there something obviously 
> wrong with this code?

I haven't programmed in fortran for over 30 years, so my knowledge
of fortran is a bit rusty. However, back in the 1970's the first 8
columns were used for labels and the statements themselves started
in column 8.

[toc] | [prev] | [next] | [standalone]


#497

From"Ant" <not@home.today>
Date2011-06-23 02:38 +0100
Message-ID<pJydnTJ378WjBJ_TnZ2dnUVZ7tudnZ2d@brightview.co.uk>
In reply to#495
"Dick Wesseling" wrote:

> I haven't programmed in fortran for over 30 years, so my knowledge
> of fortran is a bit rusty.

Same here - but...

> However, back in the 1970's the first 8
> columns were used for labels and the statements themselves started
> in column 8.

...according to this punch-card I have with FORTRAN STATEMENT printed
on it, column 1 can contain C to denote a comment or columns 1 through
5 can be a statement number. Column 6 may contain a character to mean
a continuation statement and columns 7 through 72 are the actual
statement. Columns 73 through 80 are marked "identification".

[toc] | [prev] | [next] | [standalone]


#540

From"robin" <robin51@dodo.mapson.com.au>
Date2011-06-27 17:07 +1000
Message-ID<4e082c55$0$79548$c30e37c6@exi-reader.telstra.net>
In reply to#495
"Dick Wesseling" <free@securityaudit.val.newsbank.net> wrote in message 
news:4e028c21$0$14147$c5fe704e@news6.xs4all.nl...
| In article <4e025412$0$1945$bbae4d71@news.suddenlink.net>,
| "Bill Cunningham" <nospam@nspam.invalid> writes:
| >     This code doesn't seem to work with my g77 compiler.
| >
| > begin program
| > print *,'hello world'
| > stop
| > end
| >
| > I've done this in all caps and in lower case. A carat points to the first
| > letter in each line and replies with an error. Is there something obviously
| > wrong with this code?
|
| I haven't programmed in fortran for over 30 years, so my knowledge
| of fortran is a bit rusty. However, back in the 1970's the first 8
| columns were used for labels and the statements themselves started
| in column 8.

No they're not.
The first 5 columns are used for labels; the 6th column is for
a continuation character,
and columns 7 thru 72 are for the statement body.

Modern Fortran doesn't use such column boundaries (free source form). 

[toc] | [prev] | [next] | [standalone]


#500

FromGeoff <geoff@invalid.invalid>
Date2011-06-23 00:47 -0700
Message-ID<rkr5079vv23nm33p3r3b7f4p39dv32hse3@4ax.com>
In reply to#491
On Wed, 22 Jun 2011 16:43:10 -0400, "Bill Cunningham"
<nospam@nspam.invalid> wrote:

>    This code doesn't seem to work with my g77 compiler.
>
>begin program
>print *,'hello world'
>stop
>end
>
>I've done this in all caps and in lower case. A carat points to the first 
>letter in each line and replies with an error. Is there something obviously 
>wrong with this code?
>
>Bill
>

BEGIN is not a keyword in Fortran. I think it comes from Pascal.

Fortran doesn't look like Fortran unless it has line numbers. :)

c a simple hello world program c in Fortran c  10   program helloworld
 20   print *,'hello world'
 30   stop
 40   end


gfortran -o hello hello.f

./hello
 hello world

Now, where did I store that noisy old KSR-33.

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | comp.programming


csiph-web