HDTenEightyP/NetNews huggingface dataset:
From: martelli@cadlab.sublink.org (Alex Martelli)
Newsgroups: comp.lang.fortran
Subject: Re: xlf STOP statement output
Keywords: rs6000 xlf stop
Date: 29 Sep 92 09:08:22 GMT
Organization: CAD.LAB S.p.A., Bologna, Italia

ercolessi@uimrl7.mrl.uiuc.edu (furio ercolessi) writes:
	...
:Well, we were talking about a specific platform.

If FORTRAN has a place still, it's because of PORTABILITY.  Platform-dependent
code deserves public pillorying... as do, more strongly!, platform
suppliers that keep pestering us with proprietary extensions & quirks.

:Anyway, I thought that the standard allows absence of STOP (as well of
:RETURN in subroutines and functions) but for this I leave the
:word to the knowledgeable people who hang around in c.l.f...

Yes, STOP and RETURN can be omitted, as "executing" the END statement
does terminate/return.  A surprisingly frequent bug is triggered by
omitting the RETURN in a subprogram with alternate returns - the
just-ENDing subp. appears to "RETURN IRAND(n)" for suitable n... but
it IS a bug, as over the years I have successfully argued with
several compiler vendors (still, my alternate-returning subp.'s now
all have explicit RETURN's for non-error exits, despite the "helpful"
warnings that yet other compilers supply about the END line "never
getting executed" when the penultimate line is a RETURN... anyway,
ignoring warnings is less painful than spending my time and energy
squabbling with compiler vendors).
-- 
Email: martelli@cadlab.sublink.org                   Phone: ++39 (51) 6130360
CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia   Fax: ++39 (51) 6130294
From: patrick@convex.COM (Patrick F. McGehearty)
Newsgroups: comp.lang.fortran
Subject: Re: FORMAT overhead
Date: 2 Oct 92 15:35:22 GMT
Reply-To: patrick@convex.COM (Patrick F. McGehearty)
Organization: Engineering, CONVEX Computer Corp., Richardson, Tx., USA
Originator: patrick@mozart.convex.com
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

In article <1992Oct2.002214.23534@unixg.ubc.ca> morgan@sitka.triumf.ca (Morgan Burke) writes:
>In the process of evaluating the best way to read in a formatted data
>file, I got the following times on an SGI 4D/340:
>
>reading 100000 records;  sample record: "         1234 -0.7654321"
>
>free format (eg. READ(1,*) ...)			 7.14 s
>no field sizes (eg. FORMAT(1X,I,F))		15.28 s
>field sizes (eg. FORMAT(6X,I7,1X,F10.7))		16.47 s
>
>(an unformatted file containing only the REAL data took 0.01 s)
>
The performance will vary with the details of each compiler's particular
implementation.  For example, a format of:
FORMAT(I13,F11.7) 
will run faster on some systems than
FORMAT(6X,I7,1X,F10.7)
due to differences in efficiencies of parsing the format specification
as compared to scanning over blank characters.

Another difference will show up in the loop structure.  Compare
	DO I = 1,100000
	READ(...) A(I),B(I)
	ENDDO
with
	READ(...) (A(I),B(I),I=1,100000)

The implied do structure is recognized by some compilers and handled
more efficiently than the explicit loop structure.  Other compilers
treat both structures the same.

I will admit that I also am surprised that a free format read is that much
faster than a formatted read.  Two speculations: 1) sgi's format parser
is relatively slow, or 2) sgi's free format input parser is real fast.
Anyone know of a fundamental reason why free format might be twice as
fast as a specified format?
Newsgroups: comp.lang.fortran
From: hybl@umbc4.umbc.edu (Dr. Albert Hybl (UMAB-BIOPHYS))
Subject: Re: Is this a Compiler Bug ?
Summary: Unix digraphs
Keywords: '\n' new-line '\t' TAB
Organization: Univ. of MD, Baltimore County
Date: Tue, 6 Oct 1992 13:24:26 GMT

Consider the following program:

*     Program back_slash_antics
      Character*80 string
*
      string = 'abcd\efgh\\ijklm\nopqrs\tuvwxyz'
      Print *,string
      Stop
      End

Results from compilation and execution on an AT&T 3b1:
===============A UNIX Machine=========================
$a.out
 abcd\efgh\\ijklm\nopqrs\tuvwxyz                                        
Programmed STOP 

On an AT&T 3b2 it fails to compile giving the diagnostics:
===============Another UNIX Machine=======================
File j-slash.f:
    MAIN:
        j-slash.f(7):   Syntax error: "character constant" followed by "identifier":
                string = 'abcdefgh\ijklm
opqrs   uvwxyz'print*,  ...
                                                      ^

        j-slash.f(7): warning:  Missing END statement, END supplied

1 error diagnosed in file j-slash.f

========================================
Obviously the UNIX digraphs '\n' and '\t' are interpreted as
new-line and tab by the XLA+ fortran77 compiler.

Waffle, waffle ... waffle
Albert Hybl (hybl@umbc4.umbc.edu)
From: roth@oasys.dt.navy.mil (Pete Roth)
Newsgroups: comp.lang.fortran
Subject: Re: scientific object-oriented programming?
Date: 1 Oct 92 12:34:57 GMT
Reply-To: roth@oasys.dt.navy.mil (Pete Roth)
Organization: The David Taylor Model Basin

In comp.lang.fortran, thacker@enh.nist.gov writes:
>I'm interested in writting fluid-dynamic codes in fortran90 in an
>object-oriented style and would like to see examples of codes that
>might help me in designing data-types and operations for scalar and
>vector fields.

The best I've been able to do with Fortran is Object-Based, rather than
Object Oriented. You might check out my articles in the Fortran
Journal, vol 4, Nos 2 & 4. Although I used the term "Object Oriented"
in the article, I've realized that OB is more correct. Admittedly, this
is f77, but I haven't seen any parts of f90 that *support* OO.

>I would greatly appreciate all suggestions and examples of scientific
>codes written in o-o style and opinions as to whether o-o style is
>appropriate for such computations.  Also, opinions as to fortran90
>(and/or c++) being appropriate.

If you know OO, this question is moot, so I infer that you don't. Since
you'll have to go to another language to learn it (as in, "learn by
doing"), you'll wind up somewhere else anyway. It's an intellectual
investment. Worth it, too, in my view.

My own OO path was through Turbo Pascal, because I knew it already, and
it's fairly readable. It is *not* portable off the PC. So now I'm
starting to learn C++.

A few questions that might influence the course of your project:

    Are you starting from scratch?

    How much time do you expect to devote to the project?

    How much of that time have you devoted to learning OO?

regards, pete
- - - - - - - - - - - - - - - - - - - - - - - - - -
Peter N Roth      roth@oasys.dt.navy.mil
You can take a horse to water, but a pencil must be lead.
Newsgroups: comp.lang.fortran
From: zkdc05@trc.amoco.com (Kelly D. Crawford)
Subject: Re: [HELP] what's wrong with the following simple code?
Originator: zkdc05@church
Organization: Amoco Production Company, Tulsa Research
Date: Tue, 29 Sep 1992 14:14:26 GMT


In article <90835@netnews.upenn.edu>, duong@chestnut.chem.upenn.edu (-3612) writes:
> I'm a fortran novice here. I couldn't figure out what's wrong with the
> following subroutine so could anyone give me a hint? Thank you..
> 
> 							duc
> [code deleted]
>
>                open (21, file='ftnmr.dat', form='unformatted',status='new')
>                read (21) i,(R(j),j=1,abs(2*i))
>
> [code deleted]

If you are reading the file, it must already exist.  Try status='old'.

Kelly
-- 
Kelly D. Crawford             | Amoco Production Research | These are my own
kcrawford@trc.amoco.com       | 4502 East 41st Street     | opinions, not
phone: (918) 660-4043         | Tulsa, OK  74102          | Amoco's...
          >>> *** This line intentionally left blank *** <<<
Newsgroups: comp.lang.fortran
From: bibhas@nano.engr.mun.ca (Bibhas Bhattacharya)
Subject: Re: Calling FORTRAN from C; Losing sleep. Not any more : )
Keywords: FORTRAN C
Organization: Memorial University of Newfoundland
Date: Mon, 5 Oct 1992 01:07:29 GMT

Hi I finally got it to work. I had just the FORTRTAN subroutine in the sum.f
file which was called in fortran.c file.

****C code****

#include<stdio.h>
main(int argc, char *argv[]){
	int sm, a1, a2;
	a1 = atoi(argv[1]);
	a2 = atoi(argv[2]);
	sum_(&a1, &a2, &sm); /*Check out the underscore _ after sum_*/
	printf("%d + %d = %d\n", a1, a2, sm);
}


*****FORTRAN code****

	subroutine sum(A1, A2, S)
	S = A1 + A2
	return
	end

compile command:
cc -o sumit fortran.c sum.f -lF77

Hope this helps to any newcomer. I feel somuch better now, thanks a lot all
of you guys who helped me out.
Bibhas.
From: zkdc05@trc.amoco.com (Kelly D. Crawford)
Newsgroups: comp.lang.fortran
Subject: Re: Quickie
Date: 5 Oct 92 21:25:34 GMT
Distribution: usa
Organization: Amoco Production Company, Tulsa Research
Originator: zkdc05@church


In article <25960@oasys.dt.navy.mil>, mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill) writes:
> Silly fortran question 980678
> 
>       integer n
>       n=1
>       write(*,n)
>     1 format(2x,'my brain hurts')
>     2 format(.....
>     .
>     .
>     .
> 
> 
> Does not work.  How to fix?  Suggest IF statements and I bite you.
> 
> Ciao

Try the following.  Believe it or not, it is standard Fortran!

      program test
      integer n
      assign 1 to n
      write(*,n)
 1    format(2x,'my brain hurts')
 2    format(2x,'mine too (2)')
      end

To use the second format statement, use "assign 2 to n".

Kelly
-- 
Kelly D. Crawford             | Amoco Production Research | These are my own
kcrawford@trc.amoco.com       | 4502 East 41st Street     | opinions, not
phone: (918) 660-4043         | Tulsa, OK  74102          | Amoco's...
          >>> *** This line intentionally left blank *** <<<
Newsgroups: comp.lang.fortran
From: maine@altair.dfrf.nasa.gov (Richard Maine)
Subject: Re: Quickie
Organization: NASA Dryden, Edwards, Cal.
Distribution: usa
Date: Mon, 5 Oct 1992 21:06:30 GMT

On 5 Oct 92 20:26:57 GMT, mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill) said:

Lawrence> Silly fortran question 980678

Lawrence>       integer n
Lawrence>       n=1
Lawrence>       write(*,n)
Lawrence>     1 format(2x,'my brain hurts')
Lawrence>     2 format(.....
Lawrence>     .
Lawrence>     .
Lawrence>     .


Lawrence> Does not work.  How to fix?  Suggest IF statements and I bite you.

Well, there is, of course one possible statement that I won't suggest
lest I get bitten. :-)  Presumably you know how to use that possibility
"IF" you want to.

Another way is to use ASSIGN statements, but they invite such incredibly
bad programming practices that I'm not going to encourage their use by
showing how to use them for this.  They are one of the very few things
explicitly labelled in the f90 standard as obsolescent (which means they
are still supported in f90, but are candidates for deletion in the future).
They make my brain hurt.

The way I prefer to do variable formats like this is to use character
expressions for the format.  Something along the line of

          integer n
          character formats(3)*80
          data formats/'(2x,''my brain hurts'')', ..../
          n = 1
          write (*,formats(n))
          ...

ought to work for instance.  Or there are innumerable variations on
the theme, but the core concept is to use a character expression
instead of a format statement.

--
--
Richard Maine
maine@altair.dfrf.nasa.gov
From: jac@moonshine.llnl.gov (James A. Crotinger)
Newsgroups: comp.lang.fortran
Subject: Phone number for Quibus Software (Forwarn)
Keywords: Forwarn, Quibus
Date: 29 Sep 92 22:22:35 GMT
Organization: Magnetic Fusion Energy - LLNL


  Does anyone out there have the correct phone number for Quibus
software, makers of the Forwarn Fortran lint program?  The number in
the recent FAQ turns out to be the number for "Maggie's Cafe". 8-). 

  Jim

--
-------------------------------------------------/\--------------------------
James A. Crotinger     Lawrence Livermore N'Lab // \ The above views are mine
jac@moonshine.llnl.gov P.O. Box 808;  L-630 \\ //---\  and are not neces-
(510) 422-0259         Livermore CA  94550   \\/Amiga\  sarily those of LLNL.
From: morgan@sitka.triumf.ca (Morgan Burke)
Subject: FORMAT overhead
Organization: TRIUMF, Vancouver BC
Date: Fri, 2 Oct 1992 00:22:14 GMT

In the process of evaluating the best way to read in a formatted data
file, I got the following times on an SGI 4D/340:

reading 100000 records;  sample record: "         1234 -0.7654321"

free format (eg. READ(1,*) ...)			 7.14 s
no field sizes (eg. FORMAT(1X,I,F))		15.28 s
field sizes (eg. FORMAT(6X,I7,1X,F10.7)		16.47 s

(an unformatted file containing only the REAL data took 0.01 s)

This surprised me;  I would have thought that the more well-specified
the file format is, the less overhead there would be in translating the
data.  In fact, the opposite seems to be the case.  Does anyone know
why this is so?  Is this true for all Fortran compilers?

-- Morgan Burke (morgan@reg.triumf.ca)
Newsgroups: comp.lang.fortran,comp.sys.sun.misc,comp.text.tex
From: Tim Larkin <tsl1@cornell.edu>
Subject: Re: Documenting group written fortran code
X-Xxdate: Mon, 28 Sep 92 15: 47:59 GMT
Nntp-Posting-User: tsl1@cornell.edu
Organization: Cornell University
X-Useragent: Nuntius v1.1.1d7
Date: Mon, 28 Sep 1992 14:40:51 GMT

In article <BuoqIu.HK@cs.dal.ca> Steven Matheson, matheson@open.dal.ca
writes:

>routines in the code.  Something that might perhaps produce separate
>program soruce files and printable LaTeX files from a shared source
>would be nice.  I've heard that "fweb" might be able to do this, but I
>don't know much about it.

fweb does this. The programmer writes one file which combines
documentation and source. fweb consists of two programs: Tangle reads
the fweb file and produces a file for the compiler; Weave reads the
same file and produces a LaTeX file.
>
>Does anyone have some words of wisdom in this area?  Does anyone care
>to comment on using fweb or Sun SourceBrowser for this sort of work?

I suggest subscribing to the mailing list, LITPROG@SHSU.BITNET 
(LITPROG@SHSU.edu), which supports an ongoing dissemination of
"words of wisdom".


Tim Larkin
Federal Nutrition Laboratory
Tower Road
Ithaca, New York
tsl1@cornell.edu
607-255-7008
From: ruckman@oasys.dt.navy.mil (Christopher Ruckman)
Newsgroups: comp.lang.fortran
Subject: Re: How do I make MS Fortran 5.1 use lots of memory?
Date: 1 Oct 92 21:05:00 GMT
Reply-To: ruckman@oasys.dt.navy.mil (Christopher Ruckman)
Organization: Carderock Division, NSWC, Bethesda, MD

In comp.lang.fortran, gumley@ltp2.gsfc.nasa.gov (Liam E. Gumley) writes:
> ....
>Note that this only works on programs which use character I/O.  There has been
>talk of a library around which lets you do graphics in Windows 3.1, but I
>have not seen it.  The graphics library that comes with MS Fortran 5.1 does
>not work in Windows.

I believe you refer to the QuickWin Graphics Library.  I got a copy
by calling MicroSoft and asking for one.  I don't recall paying for
it ... I think it came out just after I bought Fortran 5.1, so they
gave it to me for free.
Newsgroups: comp.lang.fortran
From: jlg@cochiti.lanl.gov (Jim Giles)
Subject: Re: FORMAT overhead
Organization: Los Alamos National Laboratory
Date: Fri, 2 Oct 1992 16:49:23 GMT

In article <1992Oct2.002214.23534@unixg.ubc.ca>, morgan@sitka.triumf.ca (Morgan Burke) writes:
|> In the process of evaluating the best way to read in a formatted data
|> file, I got the following times on an SGI 4D/340:
|> 
|> reading 100000 records;  sample record: "         1234 -0.7654321"
|> 
|> free format (eg. READ(1,*) ...)			 7.14 s
|> no field sizes (eg. FORMAT(1X,I,F))			15.28 s
|> field sizes (eg. FORMAT(6X,I7,1X,F10.7)		16.47 s
|> 
|> (an unformatted file containing only the REAL data took 0.01 s)
|> 
|> This surprised me;  I would have thought that the more well-specified
|> the file format is, the less overhead there would be in translating the
|> data.  In fact, the opposite seems to be the case.  Does anyone know
|> why this is so?  Is this true for all Fortran compilers?

Many Fortran support libraries will parse the FORMAT many times, rather
than just once.  This is because they will only parse the FORMAT element
that corresponds to the current list item, then throw out the parsed
version and proceed to the next list item.  So, your 100000 records 
might require that the FORMAT itself be parsed 100000 times.  A more
efficient method of parsing the FORMAT once, and saving the result
as a template for later use is sometimes used (some compilers actually
do the FORMAT statements and string literals within I/O statements
at compile time, but FORMATS passed as string variables but still
be parsed by the library).  I suspect your I/O library probably
does the multiple parsing.  Since parsing FORMATs is actually
*harder* than parsing numeric data, it's no surprise that this
overhead dominates.

-- 
J. Giles
Xref: sparky comp.lang.fortran:3885 comp.lang.c:14605
From: zzang@stat.ufl.edu (zzang)
Newsgroups: comp.lang.fortran,comp.lang.c
Subject: SUMMARY: cc vs. f77, argv argc for f77
Date: 6 Oct 92 19:52:29 GMT
Article-I.D.: eng.1992Oct6.195229.9463
Distribution: usa
Organization: University of Florida
Originator: zzang@manta

Hello,
First, I would like to thank all those netters
who give me helps in my two recently posts.

the posts are about how to call C functions
in Fortran programs and vice versa, and
how to get the cmd line options in Fortran program.

here are the summaries:

we discuss this under the Unix environment.

1. call C functions in Fortran.
   f77 puts a '_' in the end of procedure names
   as the internal procedure names.
   so if you use : 
   CALL FOO(bar)
   f77 sees foo_() when it ld the .o together.

   now if you try to implement foo() in C
   then you need declare foo_() in C.

   compile is rather simple.
   first, use f77 -c and cc -c to get the .o
   then you may use
   f77 -o try try.o ...
   (f77 will ld libc.a libm.a automatically)

   for more info on this, you may get a copy :
   FORT.Z by Glenn Geers
   ftp: suphys.physics.su.oz.au in ~ftp/src

2. get  the argv argc in Fortran program.
   use getarg(3f) and iargc(3f)


-- 
Zhuo Zang[~{j0WA~}]
Department of Statistics
University of Florida            Email: zzang@stat.ufl.edu
From: ruckman@oasys.dt.navy.mil (Christopher Ruckman)
Newsgroups: comp.lang.fortran
Subject: Re: How do I make MS Fortran 5.1 use lots of memory?
Date: 2 Oct 92 10:47:06 GMT
Reply-To: ruckman@oasys.dt.navy.mil (Christopher Ruckman)
Organization: Carderock Division, NSWC, Bethesda, MD

I posted a summary of my replies, along with a description of how I
solved the problem, as "SUMMARY: How do I make MSF5.1 use lots of memory?"

Thanks again for all who responded!
From: sla@umbra.ucsc.edu (Steve Allen)
Newsgroups: comp.lang.fortran
Subject: Preprocessing (was Is this a Compiler Bug ?)
Date: 4 Oct 1992 21:00:47 GMT
Organization: UCO/Lick Observatory
NNTP-Posting-Host: umbra.ucsc.edu
Summary: think about doing it
Keywords: vendors, OSs, standards, flames

In article <1992Oct1.195512.16735@chpc.utexas.edu>, ivab015@hermes.chpc.utexas.edu (Albert Wu) writes:
>                  Apparently, the backslash is treated as a continuation
> symbol.  Is this considered a bug in this program or a bug in the compiler.
>       character*30 string
>       string = '1234567890123456\8901234567890'

And this has started what is turning into a rather heated discussion of
the styles of Fortran preferred by various vendors and OSs, the myriad
different compile time compatibility switches, and of whether the net
can pillory some vendors into submission.
This kind of argument can go on indefinitely, with no quick resolution.

Time for my little soapbox...

Not having the time to wait, I prefer to deal with the world as it
is.  This means that I use a preprocessor on all of my Fortran code.
(I use CPP, and for my own reasons.  You may prefer something else.)
On each OS, cpu, etc., I substitute for the apropriate macros using
suitable Makefiles, DCL scripts, etc.  It means that I get my work
done *now* in the real world of a dozen variants of Fortran on half a
dozen platforms.  It also means that folks using my code need merely
edit 1 config file and type "make" on all these platforms.
Yes, things could be easier, but this works for me.  Your mileage may vary.
_______________________________________________________________________________
Steve Allen          | That was the equation!         |   sla@lick.ucsc.edu
UCO/Lick Observatory | Existence!...Survival must     | If the UC were opining,
Santa Cruz, CA 95064 | cancel out programming! -- Ruk | it wouldn't tell me.
From: jf@threel.co.uk (John Fisher)
Newsgroups: comp.lang.fortran
Subject: Re: [HELP] What's wrong with the following simple code?
Date: 30 Sep 92 10:34:42 GMT


mstemper@ems.cdc.com (Michael Stemper) writes:

> |> I'm a fortran novice here. I couldn't figure out what's wrong with the
> |> following subroutine so could anyone give me a hint? Thank you..
> 
> Well, I can find several things wrong with it:

... followed by a critique of his code.

> If you are going to play tricks with equivalencing and common, you
> should have extensive comments. This module doesn't even have enough
> comments for a straight-forward piece of code, but it is doing some
> very cryptic things.

The task was quite simple, and I don't see that the code
was that hard to understand.  Neat layout always helps; so
do expressive variable names.  And some explanation of the
various fields of the parameter record would have been a
good idea.  But I've seen far worse.

You can have too many comments, you know.  I find comments
of this sort *impede* understanding of the code:

   C     Increment counter
         I = I + 1

or

   C     Open output file as unit 10, unformatted sequential
         Open (Unit=10, File='Output', Status='New',
        &      Form='Unformatted', Access='Sequential')

or

   C     Process all the records
         Do 100 I = 1, TotalRecords
            Call ProcessRecord (I)
   100   Continue

Comments like this are really just noise.

--John
From: Peter.Hammond@brunel.ac.uk (Peter D Hammond)
Newsgroups: comp.lang.fortran
Subject: How to disable scrolling on Sun?
Date: 5 Oct 92 09:15:22 GMT
Organization: Brunel University, Uxbridge, UK
X-Newsreader: Tin 1.1 PL3

Hi.
Does anyone know how to disable the scroll bar on a Sun cmdtool window
using OpenLook? It's only a small problem, so I dont want to have to 
become a C systems programmer to do it. OK, I could just prompt the user
to use the menu, but it doesn't look too slick, does it ;-)

The reason I want to do this, incidentally, is to use ANSI cursor 
control to create a menu driven front end to a simulation program.

Thanks for any help.

-- 
BFN, Pete.

 Dept. Materials Technology | Dont pay any attention. | You sometimes have to  
 Brunel University          | Its only my opinion.    |    listen to
 Uxbridge                   |                         | A lot of useless talk.
 Middx, UB8 3PH, UK.        |                         |         N. Peart. (RUSH)