HDTenEightyP/NetNews huggingface dataset:
From: silvert@biome.bio.ns.ca (Bill Silvert)
Subject: Re: Multiple includes
Reply-To: silvert@biome.bio.dfo.ca (Bill Silvert)
Organization: Habitat Ecology Div., Bedford Inst. Oceanography
Distribution: na
Date: Tue, 10 Nov 1992 21:39:09 GMT

In <1dotfaINN4a1@alnitak.usc.edu> olaf@alnitak.usc.edu (Olaf Meeuwissen) writes:

>The reason  for this is  that I want to put all  the maximum dimensions for the
>arrays used in the program in one single file,  so the user knows where to find
>them if they have to be changed. Let's call this file `dim.h'. Now I have other
>header files, say `lib.h' and `sys.h', that both contain some arrays, so I want
>to include `dim.h'.  Then, if I have to include both `lib.h' and `sys.h' in one
>subroutine, yes, the compiler starts complaining!  Of course, I get similar re-
>sults if I want to include `dim.h' and any of the other header files.

Not knowing what compiler you are using, an authoritative answer is not
possible (include is non-standard).  However, you might be able to use
the trick that C includes do, namely:

#ifndef DIM_H
#define DIM_H
....
#endif

and run it through cpp or other preprocessor.
-- 
------------------------------------------------------------------------
William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
InterNet Address: silvert@biome.bio.dfo.ca
Newsgroups: comp.lang.fortran
From: davidm@voltaire.Rational.COM (David Moore)
Subject: Re: Whats the difference between STATIC variables and SAVE variables?
Organization: Rational
Date: Mon, 9 Nov 1992 20:36:44 GMT

jchauvin@netcom.com (John H. Chauvin) writes:

>Is there a difference between variables defined as STATIC and those defined
>with the save statement? How can I tell if a program requires the compiler
>option STATIC? How does the STATIC option effect program execution speed?
>Should I try and avoid using it?

I assume that by STATIC you are referring to a compile time flag. This flag
is provided by many implementors because old Fortran programs assume that
local variables retain their values from one call of a subroutine to another.


Such programs are non-conforming. Using the save statement makes the 
programs conforming - using the flag does not. 

On most machines on which this is an issue, using the STATIC flag will 
often cause programs to run slower. Most implementors, knowing that there
are a lot of non-conforming programs in existence, will not implement locals
as dynamic variables unless there is a performance reason to do so. Typically,
they run faster because:

1) Scalars can be allocated into registers.
2) Address offsets are short (stack relative) rather than full
   machine-length addresses.

So, this is another eason for using SAVE rather than the compilation flag.

REMARKS:

I have seen programs which assume that parameters passed once will remain
bound on subsequent calls to entry statements which lack those parameters.
For example, this is sometimes used to allocate memory dynamically. When you
find such a program, locate the original card deck, drop from the top of a tall
building, and see if you can erase all the disk copies before the deck hits
the ground (hint; remove the rubber bands)

I once saw a compiler which dynamically allocated common blocks. It ran like
a dog since the common block allocator was hopelessly slow.

I believe the constructors of this piece of nonsense have since produced a much
better compiler. Still, technically, dynamic common blocks are standard conforming
(I could have lived with them too, except for the performance hit).
Make sure you SAVE your common blocks if they should be persistent.




Newsgroups: comp.lang.fortran
From: jchauvin@netcom.com (John H. Chauvin)
Subject: Dimensioning arrays passed in a parameter list.
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Sat, 7 Nov 1992 16:00:34 GMT


I am currently porting a FORTRAN 66 program from an IBM 3090 to a Silicon 
Graphics workstation. Can someone tell me the correct FORTRAN 77 procedure 
for dimensioning arrays passed in a call parameter list: For example:

.                DIMENSION A(50),B(50)
                                     .
                                     .
                                     .
                                     .
                CALL XYZ(A,B)
                                     .
                                     .

                 SUBROUTINE XYZ(A,B)
                 DIMENSION A(1),B(1)            <====== Is this correct?
                 DIMENSION A(*),B(*)             <====== Or Is this right?
                                     .
                                     .


How do I handle passing two or three dimensional arrays? (A(1,1,1)  or A(*,*,*)?)

Thanks,

jchauvin@netcom.com
-- 
John H. Chauvin jchauvin@netcom.COM
Netcom - Online Communication Services San Jose, CA
Newsgroups: comp.lang.fortran
From: reykowsk@ee.tamu.edu (Arne Reykowski)
Subject: Running VAX-Fortran Code on IBM compatible PC
Organization: Texas A&M University
Date: Sun, 8 Nov 1992 04:52:46 GMT


Hi, 
I have a question:
I wrote this realy nice piece of code using VAX Fortran.
Now I realized that it would be very appropriate to have it 
available on an IBM compatible PC. We do have a Microsoft Fortran
compiler, but I used STRUCTURE/MAP/UNION commands in my source code
which came very handy for my problems. These are not Fortran 77 comands,
so the PC compiler chokes on them. 

I find myself with two options:
a) Rewriting the code 
b) Finding a compiler that eats VAX Fortran source code without major
   complaints

Since I am more on the lazy side of the human spectrum I would
appreciate any suggestion that would solve my problem without major
effort.

Thanks in advance,
Arne


Newsgroups: comp.lang.fortran,comp.sys.hp
From: mroussel@alchemy.chem.utoronto.ca (Marc Roussel)
Subject: Re: Weird HP compiler warning
Followup-To: comp.sys.hp
Organization: Department of Chemistry, University of Toronto
Date: Wed, 11 Nov 1992 18:35:34 GMT

In article <1992Nov11.133205.4641@jyu.fi> sakkinen@jyu.fi (Markku Sakkinen)
writes:
>In article <1992Nov10.193635.2736@alchemy.chem.utoronto.ca>
>mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes:
>> ...
>>	  double precision h,nexth,err,d2fex
>>	  h = 1.d0
>>	  err = 10.d0
>>	  d2fex = 123.d0
>>          nexth = min(h,sqrt(12.d0*err/d2fex))
>>	  write(*,*)nexth
>>	  END
>>
>>For this piece of code, the compiler produces the warning
>>
>>Warning on line 5 of weird.f: Argument has same name as INTRINSIC function
>>
>>Of course the argument has the same name as an intrinsic!  The argument
>>IS an intrinsic!  [...]
>
>No, the argument is NOT an intrinsic, but the result returned
>from the call of an intrinsic function.
>Thus the compiler is really badly off the track.

     I agree with this comment; I was being careless with my wording.  I
have since discovered one additional and extremely puzzling clue:  This
warning is only generated with the -C compiler flag.  (This flag
generates code for subscript checking.)  Why subscript checking should
have anything to do with calling the sqrt() function and passing its
result to min(), I have no idea.

				Marc R. Roussel
                                mroussel@alchemy.chem.utoronto.ca

P.S.:  I have redirected all followups to comp.sys.hp.  In retrospect,
       I'm not sure why I ever posted to comp.lang.fortran since it has
       been clear from the outset that this is an HP-specific problem.
From: jerry@hnrc.tufts.edu (Jerry Dallal)
Newsgroups: comp.lang.fortran
Subject: Re: Fortran Forever?
Date: 12 Nov 92 19:46:13 GMT
Organization: USDA HNRC at Tufts University

In article <5698@sumax.seattleu.edu>, davej@sumax.seattleu.edu (Dave Jenner) writes:
> I remember a saying something like: "Fortran will be around forever, we
> just don't know what the language will look like in the future" or something
> like that.  Can someone remember what the saying is, who said it, and
> even give a reference to it?

I had heard that it was from Seymour Cray in response to the question, "What
language will your machines be running in the year 2000?"  His supposed
response, "I don't know what language it will be, but I know what it will be
called . . . FORTRAN."  I wrote to him a few years ago to ask if the attribution
was accurate, but I never received a response.  Can anyone from Cray Research
comment?  (On the quotation, not on why he didn't respond. :-))
Newsgroups: comp.lang.fortran
From: zkdc05@trc.amoco.com (Kelly D. Crawford)
Subject: Correction! Re: Fortran Forever?
Originator: zkdc05@church
Organization: Amoco Production Company, Tulsa Research
Date: Wed, 11 Nov 1992 18:56:50 GMT


Oops.  I misquoted the author of those sayings.  The correct quote by Rex Page
should be:

"Fortran was a mistake of innocence and naivete.  C was created by people who
should have known better."

My original post used the word "ignorance", which doesn't make sense given
the context of the quote.

Apologies.

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: davidm@voltaire.Rational.COM (David Moore)
Subject: Re: Whats the difference between STATIC variables and SAVE variables?
Organization: Rational
Date: Tue, 10 Nov 1992 18:41:29 GMT

ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi) writes:

>In article <davidm.721341404@voltaire>, davidm@voltaire.Rational.COM (David Moore) writes:
>|>I have seen programs which assume that parameters passed once will remain
>|>bound on subsequent calls to entry statements which lack those parameters.
>|>For example, this is sometimes used to allocate memory dynamically. When you
>|>find such a program, locate the original card deck, drop from the top of a tall

>if you use SAVE, what's wrong with this technique ?
>you can do poor man's "packages".  i find them very useful when you
>have data that you do not want to expose to the whole world, and you want
>to act on them in many ways.  example:

>	call histogram_initialize(n,xmin,xmax)
>	...
>	do i=...
>	    ...
>	    call histogram_accumulate(x(i))
>	    ...
>	enddo
>	call histogram_output
>		
>and the histogram array (SAVEd, of course) is local to the 'histogram' package, 
>which is a single routine with three entry points.
>I have this in a lot of programs and find it useful.

The point is that the actual-formal binding goes away; you can make copies of
the values in SAVE variables; this is fine, but if you tried to use "n",
"xmin" and "xmax" in histogram_accumulate or _output, on most compilers, they
will no longer be bound. Any program that does assume they remain bound is
not only non-conforming, but it relies on parameters being passed in a 
particular (and rather inefficient) way; namely that an array of parameter
pointers is statically allocated and written into whenever the routine is
called. 

Risc compilers will typically pass parameters in registers.
Newsgroups: comp.lang.fortran
From: jsvrc@rc.rit.edu (J A Stephen Viggiano)
Subject: Re: Obscure Fortran
Organization: RIT Research Corp
Distribution: usa
Date: Wed, 11 Nov 1992 21:27:05 GMT

In article <40824@sdcc12.ucsd.edu> ee161wcc@sdcc15.ucsd.edu (Biju Zachariah) writes:
>Hello,
>	Does anyone know the phone # for Language Systems Fortran?
>This version of Fortran runs on the Macintosh computers.

I don't know what "obscure" FORTRAN is, but Language Systems' FORTRAN offers
great VAX compatibility. You'll need MPW, which you can also get from them.

They're at:

	Language Systems Corporation
	441 Carlisle Drive
	Herndon, VA 22070

	(703) 478 - 0181 (Voice)
	(703) 689 - 9595 (Fax)
	D1810 (Applelink)

If it's FORTRAN you want to do, and it's the Macintosh on which you want to do
it, Language Systems has the compiler you want.

Newsgroups: comp.lang.fortran
From: bai@msiadmin.cit.cornell.edu (Dov Bai-MSI Visitor)
Subject: Re: Running VAX-Fortran Code on IBM compatible PC
Organization: /usr/local/lib/news/organization
Date: Sun, 8 Nov 1992 13:35:03 GMT

In article <1992Nov8.045246.5765@tamsun.tamu.edu> reykowsk@ee.tamu.edu (Arne Reykowski) writes:
>
>Hi, 
>I have a question:
>I wrote this realy nice piece of code using VAX Fortran.
>Now I realized that it would be very appropriate to have it 
>available on an IBM compatible PC. We do have a Microsoft Fortran
>compiler, but I used STRUCTURE/MAP/UNION commands in my source code
>which came very handy for my problems. These are not Fortran 77 comands,

>so the PC compiler chokes on them. 
>
>I find myself with two options:
>a) Rewriting the code 
>b) Finding a compiler that eats VAX Fortran source code without major
>   complaints
>
>Since I am more on the lazy side of the human spectrum I would
>appreciate any suggestion that would solve my problem without major
>effort.

What version of MS-Fortran are you using ? Mine is ver. 5.0 and it has
STRUCTURE/MAP/UNION commands.
 
>
>Thanks in advance,
>Arne
>
>

Dov
Xref: sparky comp.lang.fortran:4295 comp.os.vms:17842
From: carlson@cwis.unomaha.edu (Brian D. Carlson)
Newsgroups: comp.lang.fortran
Subject: Environment Variables, and argv, argc
Summary: ? How to get Environment Variables in F77L
Keywords: environment variables
Date: 12 Nov 92 21:19:07 GMT
Organization: University of Nebraska at Omaha


	I am using fortran 77 (Lahey), however, I'm more used to C. 

	Can anybody give me a quick clue about how to get DOS environment
variables in a Fortran program. Also, you does one go about grabbing the 
command line arguments.

	Something brief would be very helpful to me.

	Thanks,
	Brian D. Carlson
	carlson@unomaha.edu
Newsgroups: comp.lang.fortran
From: metcalf@apofort.cern.ch (Michael Metcalf )
Subject: "Fortran 90 Explained"
Summary: Errata and example program
Keywords: Fortran
Organization: CERN European Lab for Particle Physics
Date: Fri, 13 Nov 1992 07:52:26 GMT


"Fortran 90 Explained"
----------------------
 
   Since "Fortran 90 Explained" was first published at the end of 1990,
a number of readers have been kind enough to point out some errors to us.
We correct all known errors at each new printing as part of our endeavour
to maintain the accuracy of the book with respect both to the standard
and to the interpretations that X3J3 and WG5 are now beginning to issue.
 
   In order that those with early printings (prior to 1993) can correct
errors in their copies, we have prepared an errata list. It is available
by anonymous ftp from numerical.cc.rl.ac.uk (130.246.8.23). When prompted for
a userid, reply with
     anonymous
and give your name as a password. The directory is /pub/open and the file is
MandR.errata. We hope you find it useful.

In addition, at the time of the first printing, we were unable
to add an extended example as there was, at that time, no compiler available
for testing. In the next printing we shall be adding a 300-line example of
the use of new features, in particular of recursion and pointers, and
this module and test program too is available as MandR.appxg.f90 in the same 
directory.

         Michael Metcalf and John Reid
Newsgroups: comp.lang.fortran
From: bga@bgalli.mug.org (Billy G. Allie)
Subject: Re: "Too many files open" error in DOS
Organization: Bill's Home Machine
Date: Sun, 8 Nov 1992 16:38:23 GMT

sharp@mizar.usc.edu (Malcolm Sharp) writes:

>
>We've developed an MS-DOS-based FORTRAN program that has given the
>error message "Too many files open."  This occurs when we the program
>is attempting to open the 16th file.  We have editted the 'CONFIG.SYS'
>file "FILES= " statement to be 30, 40, ... 60 files to no avail (and of
>course rebooted after making the change).
>
>Any ideas suggestions will be appreciated.
>

Changing the "FILES=" parameter in CONFIG.SYS changes the number of system
wide file handles that are available.  But, the problem is that MS-DOS
limits the number of open files per process to twenty (20), five (5) of
which are pre-opened by COMMAND.COM for the process before it starts.
Given this fact, you will be able to open fifteen (15) additional files
before running out of 'per process' file descriptors.  There are ways
around this limit that involves running a program that increases the per
process limit and then executes the program that needs the increased
limits.  If you are interested in the details, send me E-mail, and I will
dig up the detailed information to send to you.  Be sure to include the
version of MS-DOS you are using.

BTW: The five (5) pre-opened files are 'stdin', 'stdout', 'stderr',
     'stdaux', and 'stdprn'
-- 
____	   | Billy G. Allie	| Domain....: bga@bgalli.eds.com
|  /|	   | 7436 Hartwell	| UUCP......: uunet!edsews!bgalli!bga
|-/-|----- | Dearborn, MI 48126	| Compuserve: 76337,2061
|/  |LLIE  | (313) 582-1540	| Genie.....: BGALLIE
From: ruckman@oasys.dt.navy.mil (Christopher Ruckman)
Newsgroups: comp.lang.fortran
Subject: Re: Fortran Forever?
Date: 10 Nov 92 11:50:22 GMT
Reply-To: ruckman@oasys.dt.navy.mil (Christopher Ruckman)
Organization: Carderock Division, NSWC, Bethesda, MD

In comp.lang.fortran, davej@sumax.seattleu.edu (Dave Jenner) writes:
>I remember a saying something like: "Fortran will be around forever, we
>just don't know what the language will look like in the future" or something
>like that.  Can someone remember what the saying is, who said it, and
>even give a reference to it?
>
>Thanks.
>Dave

In Scientific American, July 1991, p. 112, Paul Wallich's article entitled
"FORTRAN Forever:  Is it still the language of choice for science?"
contains the quote but not its origin.  According to the article, Guy
L. Steele of Thinking Machines quotes an unknown scientist as saying
"I don't know what the computer language of the year 2000 will look
like, but I know that it will be called FORTRAN."
Newsgroups: comp.lang.fortran
From: silvert@biome.bio.ns.ca (Bill Silvert)
Subject: Re: Unformatted Format on PCs
Reply-To: silvert@biome.bio.dfo.ca (Bill Silvert)
Organization: Habitat Ecology Div., Bedford Inst. Oceanography
Distribution: na
Date: Wed, 11 Nov 1992 18:46:40 GMT

In <1025@engcon.marshall.ltv.com> rodgers@engcon.marshall.ltv.com (KMRODGERS) writes:

>So, . . . does anyone know how most PC
>Fortran compilers write unformatted files?  Note that I do not need to
>transport binary files between different platforms, I just need gnuplot on
>a PC to read a Fortran unformatted file produced on a PC.  Since our newsfeed
>typically runs several days behind, please email and I will summarize to
>the net.  Thanks in advance . . .

I tried Email, but the address is unreachable.

There is no standard PC format, the default for Lahey and Microsoft is
incompatible.  However, Lahey has a compiler flag that supports the
Microsoft format.  Check the Lahey manual for details.
-- 
------------------------------------------------------------------------
William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
InterNet Address: silvert@biome.bio.dfo.ca
From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgoup)
Newsgroups: comp.lang.fortran
Subject: Re: Fortran 90 Standard document
Date: 5 Nov 92 19:12:19
Organization: Sun MegaSystems
Distribution: world
NNTP-Posting-Host: chiba
In-reply-to: dbs900@anusf.anu.edu.au's message of 5 Nov 1992 22:06:38 GMT


From the comp.lang.fortran.faq

Q1) Where can I get a copy of the Fortran 90 Standard?

Q1)  Where can I get a copy of the Fortran 90 Standard?

From: julian@cernvax.cern.ch (julian bunn)

         The new Fortran 90 standard has now been formally published
	 and is available from the ISO central secretariat or from the
	 national member bodies. The price is about $120. Some
	 ordering detail follow.  I can supply addresses in other
	 countries not mentioned on request (to METCALF@CERNVM).
 
    The document reference is ISO/IEC 1539 : 1991. There is no ISBN.
 
    ISO
    1, rue de Varembe
    Case postale 56
    1211 Geneva 20
    Switzerland
    Fax: +41 22 734 10 79
 
    ANSI
    1430 Broadway
    New York, NY 10018
 
    BSI
    2 Park Street
    London W1A 2BS
 
    DIN
    Burggrafenstrasse 6
    Postfach 1107
    D-1000 Berlin 30
 
    AFNOR
    Tour Europe
    Cedex 7
    92049 Paris La Defence
 
SCC
1200-45 O'Connor
Ottawa
Ontario  K1P 6N7
 
                            Mike Metcalf
                            (metcalf@cernvm)

and from walt@netcom.com

For those of you who don't read comp.lang.fortran, you might be
interested to know that I (walt brainard) just called Global
Engineering to see if the sell ISO 1539:1991.  They do; the price is
$225.

And 

You can obtain copies through:
	Global Engineering Documents
	2805 McGaw Ave.
	Irvine, CA. 92714
	(714) 261-1455
	(800) 854-7179


New ANSI number 
			ANSI X3.198-1992

--
----------------------------------------------------------------
Keith H. Bierman    keith.bierman@Sun.COM| khb@chiba.Eng.Sun.COM
SunPro 2550 Garcia MTV 12-40             | (415 336 2648) fax 964 0946
Mountain View, CA 94043  <speaking for myself, not Sun*> Copyright 1992

Newsgroups: comp.lang.fortran
From: rvenable@helix.nih.gov (Richard M. Venable)
Subject: Re: function for generating the random numbers
Organization: National Institutes of Health, Bethesda
Distribution: usa
Date: Thu, 5 Nov 1992 06:29:04 GMT

In article <1992Nov3.215800.11143@leland.Stanford.EDU> sangwook@leland.Stanford.EDU (Sang Wook Sihn) writes:
>Hi,
>Does anyone know how to generate the random numbers with fortran?
>Thanx.

First, I'd recommend consulting the book "Numerical Recipes" and read the
sections (and code) on random number generation.  It should be found in any
good technical library.

Random numbers are selected from some underlying distribution, such as a
uniform (all equally probable) or Gaussian (the 'normal' distribution).  Most
systems, including those with Unix, provide some type of call to provide
a 'random' integer or real number from a uniform distribution.  The Unix 'rand'
function can be called from Fortran, as well as C, for example.

If you intend to use the random numbers for any serious scientific work, you
should test the random number generator very carefully before using it.  Not
all vendor-supplied random number routines are scientifically rigorous.
From: av@kielo.uta.fi (Arto V. Viitanen)
Newsgroups: comp.lang.c
Subject: Re: gcc and cc!
Date: 6 Nov 92 08:12:40 GMT
Reply-To: av@uta.fi (Arto V. Viitanen)
Distribution: world
Organization: University of Tampere, Finland
In-reply-to: ren@function.mps.ohio-state.edu's message of 6 Nov 92 04:56:02 GMT

>>>>> On 6 Nov 92 04:56:02 GMT, ren@function.mps.ohio-state.edu (Liming Ren) said:
Ren> NNTP-Posting-Host: function.mps.ohio-state.edu

Ren> It seems to me that if we have two object file , say foo.o and bar.o,
Ren> one is compiled with gcc and the other with cc, then we can't link them
Ren> together such as

Ren> cc foo.o bar.o -o name

Ren> or

Ren> gcc foo.o bar.o -o name

On what machine, with what operating system, with what cc-compiler, with what
gcc ???

I tried on SUN Sparc, with SUNoS 4.1.2, using os's compiler and gcc 2.3.1.
Gcc is configured using default linker, code generation and so on.

I used following programs:

----------------------------------------------------------------------
 /* koe1.c */
#include "koe2.h"
main() {
    koe2();
}

----------------------------------------------------------------------
/* koe2.h */

koe2.h
extern koe2();

----------------------------------------------------------------------
/* koe2.c */
#include <stdio.h>
#include "koe2.h"
koe2() {
   printf("hello world\n");
}

('Koe' stands for 'test' in finnish)

I compiled:

$ cc -c koe1.c
$ gcc -c koe2.c
$ cc -o koe koe1.o koe2.o
$ ./koe
hello world
$ gcc -o koe koe1.o koe2.o
$ ./koe
hello world
--
Arto V. Viitanen				               email: av@uta.fi
University Of Tampere,				   	           av@cs.uta.fi
Finland
Newsgroups: comp.lang.c