HDTenEightyP/NetNews huggingface dataset:
From: pld@fc.hp.com (Paul_Dineen)
Subject: Re: unformatted output: << SUMMARY >>
Organization: HP CLO/CoLL, Fort Collins, CO
X-Newsreader: TIN [version 1.1.4 PL6]
Date: Fri, 6 Nov 1992 18:09:31 GMT

In article 26525@chpc.utexas.edu, michael@chpc.utexas.edu (Michael Lemke) writes:
>Doesn't have the record *number* to be stored at some place as well?  
>Nothing stops you from doing
>
>         open( ,.... access='direct', .... )
>         write( ..., rec=777 ) data
>         write( ..., rec=32 ) mode_data
>         close( ... )
>
>which gives you just two records of data and lots of `holes'.  Or am I
>missing something?

 No.  You get holes.  For example, using HP Fortran on a 9.0 9000/750:

$ cat dw.f
        open(10,file='holes',access='direct',recl=8)
        write(10,rec=1000) 1, 2
        i = 0
        j = 0
        read(10,rec=1000) i, j
        print *, i, j
        end

$ f77 dw.f
dw.f:
   MAIN:

$ a.out
 1 2

$ ll holes
-rw-rw-r--   1 pld      users       8000 Nov  6 11:06 holes

$ od -c holes
0000000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0017460  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0 001  \0  \0  \0 002
0017500
From: morgan@sitka.triumf.ca (Morgan Burke)
Newsgroups: comp.lang.fortran
Subject: Re: Multiple includes
Date: 11 Nov 1992 00:58:35 GMT
Organization: TRIUMF, Vancouver BC
Distribution: world
NNTP-Posting-Host: sitka.triumf.ca

In article <1dotfaINN4a1@alnitak.usc.edu>, olaf@alnitak.usc.edu (Olaf Meeuwissen) writes:
|> Is there a way to include files conditionally?  
|> I mean, only include it if it is not included already.

If your f77 compiler uses cpp, you can use the #include statement
instead of the Fortran INCLUDE.  Then, inside the include file, use
#define and #ifndef, for example:

C  dim.h
#ifndef INCLUDE_DIM
      INTEGER dim
      PARAMETER ( dim = 10 )
#endif
#define INCLUDE_DIM
C  end of dim.h

The file will be included more than once, but the contents will only be 
present the first time it is included.

Of course, if you are going to use cpp anyway, you could always just do:

C  dim.h
#define DIM 10
C  end of dim.h

and then declare all your arrays with dimension DIM.  It won't matter if
this file is included more than once.

-- Morgan Burke (morgan@reg.triumf.ca)
From: ohnielse@oersted.ltf.dth.dk (Ole Holm Nielsen)
Newsgroups: comp.lang.fortran
Subject: Re: unformatted output: << SUMMARY >>
Date: 5 Nov 92 11:13:03 GMT
Reply-To: ohnielse@oersted.ltf.dth.dk
Organization: Lab of Applied Physics, Tech. Univ. of Denmark

In article 26525@chpc.utexas.edu, michael@chpc.utexas.edu (Michael Lemke) writes:
>Doesn't have the record *number* to be stored at some place as well?  
>Nothing stops you from doing
>
>         open( ,.... access='direct', .... )
>         write( ..., rec=777 ) data
>         write( ..., rec=32 ) mode_data
>         close( ... )
>
>which gives you just two records of data and lots of `holes'.  Or am I
>missing something?

I think you are exactly right !

Ole H. Nielsen
Laboratory of Applied Physics, Building 307
Technical University of Denmark, DK-2800 Lyngby, Denmark
E-mail: Ole.Holm.Nielsen@ltf.dth.dk
Telephone: (+45) 42 88 24 88 ext. 3187
Telefax:   (+45) 45 93 23 99
Newsgroups: comp.lang.fortran,comp.os.msdos.programmer
From: kelley@vet.vet.purdue.edu (Stephen Kelley)
Subject: Re: Mixed Language MS C calls MS FORTRAN 5.1 (DOS) (help!)
Organization: Purdue University SVM
Date: Thu, 12 Nov 1992 16:43:14 GMT

In article <BxJIvH.2J9@news.cso.uiuc.edu> btbg1194@uxa.cso.uiuc.edu (Bradley T Banko) writes:
- 
- I am having some problems trying to do some mixed language programming
- using MS C (5.0) to call MS FORTRAN (5.1) functions.  I think that I have

- I wrote a second program to test the Fortran subroutines, and I get a 
- bunch of *link* time errors:
- 
- 	L2025 symbol defined more than once
- 

Try using the /NOD (no default library) linker switch, and explicitly
listing the fortran and C libraries.  This is what I do and it usually
works.  (I don't do it often enough, though, so I end up trying all
the permutations of my own library, and the two language libraries.)

The order of library searching is important.

You'll end up with a link command that looks something like this :

	LINK /NOD /NOE cmain.obj forsubs.obj,,,llibce llibfore;

(This is off the top of my head, you'll need to make sure you use the
correct names for the libraries you want, and try the libraries in 
different orders.)

The main key to your problem, though, is that you are using two default
libraries that redefine system calls.  When you use the /NOD, that problem
goes away.


Steve Kelley            kelley@flowcyt.cyto.purdue.edu

Purdue University Cytometry Laboratories        (317) 494-8638  -- voice
B050 Hansen LSRB, Purdue University             (317) 494-0517  -- fax
West Lafayette, Indiana, 47907
From: silvert@biome.bio.ns.ca (Bill Silvert)
Newsgroups: comp.lang.fortran
Subject: Re: Environment Variables, and argv, argc
Keywords: environment variables
Date: 13 Nov 92 13:37:47 GMT
Reply-To: silvert@biome.bio.dfo.ca (Bill Silvert)
Distribution: na
Organization: Habitat Ecology Div., Bedford Inst. Oceanography

In <carlson.721603147@cwis> carlson@cwis.unomaha.edu (Brian D. Carlson) writes:

>	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.

The Lahey function getcl(buffer) copies the command line into a string buffer.
-- 
------------------------------------------------------------------------
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: wmc@photon.com (Bill Cornette)
Subject: Re: Whats the difference between STATIC variables and SAVE variables?
Organization: Photon Research Associates, Inc.
X-Newsreader: TIN [version 1.1 PL6]
Date: Mon, 9 Nov 1992 19:04:26 GMT

John H. Chauvin (jchauvin@netcom.com) wrote:
: 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?

	The SAVE statement saves (i.e., makes static) either all variables
within a routine, or those variables so specified.  Also, COMMON blocks
are not static unless the COMMON block name is specified in a SAVE statement
or the COMMON block is defined in a higher order (relative to the calling
tree) routine.

	I assume that by STATIC, you are refering to a compiler option.  IF
your compiler supports a STATIC command withing the FORTRAN code, it is
non-ANSI code.  The static compiler command will make ALL variables in the
code static.  In other words, the difference is control over the code.
SAVE works either on a variable by variable or a routine by routine basis,
while the static command works on whatever is being compiled.

	My personal opinion is that SAVE is much more prefereable.  I have
been bitten several times by using imported code that assumes static but
does not use the SAVE command anywhere.  You may remember to compile it
in a static mode when doing the initial installation, but later, when
fixing a bug (or when someone else is playing with the code) it may be
compiled in a dynamic mode (the default on the SGI), with corresponding
disasterous results.

	You cannot tell  a code requires STATIC compilation.  Some
imported codes come with instructions to compile it in the static mode,
but most don't -- IMHO many programmers don't even realize or think about
the problem (flame on -- that is if you can call such people programmers -- 
flame off).  You can always run a test case in both static and dynamic modes
and if the outputs are different, you know that static is required.  If the
outputs are the same you never can really tell if you just got lucky.  My
rule is that ALL imported codes should be compiled static for safety sake.
In other words, I have learned the hard way not to trust other programmers
in this respect.

	As far as your own codes are concerned, you should learn to check
if you are assuming that variables not defined in DATA statements (which
are static unless changed in the code) retain their value from routine call
to routine call.  In that case -- use SAVE.  Also, either SAVE all COMMON
blocks are make sure that they are referenced in a higher routine (e.g.,
the main PROGRAM).

	Obviously (at least to me), STATIC (when not required) takes extra 
execution time.  The code must save all variables in a stack somewhere and
reinitialize all variables whenever entering a routine.  I would avoid
it in all home-grown programs for this reason, but as noted above, you
may want to use it routinely for all imported codes.

Hope this helps.

----  Bill Cornette
Newsgroups: comp.lang.fortran
From: grimmon@bronze.ucs.indiana.edu (christine susan grimmond)
Subject: Job opportunity - FORTRAN programmer
Organization: Indiana University
Distribution: iu
Date: Thu, 5 Nov 1992 21:46:14 GMT

Job opportunity: FORTRAN programmer

I would like to employ someone for the next 6 months for 20 hours a week 
at an initial rate of $10 per hour (rate will increase with demonstrated
productivity). The job is primarily to do computer programming for
physically-based modelling and analysis of climatological data. I am looking
for someone who can program in FORTRAN, who has experience with
graphics, cartridges/tapes etc, and is familiar with IBM PCs and VMS &
UNIX systems. 

I would be grateful if you could draw this to the attention of any
individuals who you feel are qualified.

If you are interested and would like more details please contact 
Sue Grimmond, Climate and Meteorology Program, Student Building 120,
5-7971, GRIMMON@indiana.edu
-- 
Sue Grimmond     (812) 855 7971    fax (812) 855 1661                   
Student Building 120
Indiana University, Bloomington. IN 47405     
Grimmon@indiana.edu
From: michael@chpc.utexas.edu (Michael Lemke)
Newsgroups: comp.lang.fortran
Subject: Re: VAX FORTRAN COMMON block problem
Date: 5 Nov 92 07:34:50 GMT
Article-I.D.: chpc.1992Nov5.073450.1798
Organization: The University of Texas System - CHPC

In article <1992Nov4.231000.16114@doug.cae.wisc.edu> dafnioti@cae.wisc.edu (Petros Dafniotis) writes:
>In article <1992Nov4.215456.9045@Princeton.EDU> mfterman@phoenix.Princeton.EDU (Mutant for Hire) writes:
>>Here's the problem. I have the following set of lines in my code. This
>>is the only common block in the entire program. These lines are repeated
>>verbatim in every subroutine and in the main code.
>>
>>      real t0,ts,c1,c2
>>      real e(-ks:ks,-ks:ks,-ks:ks)
>>      real ei(-ks:ks,-ks:ks,-ks:ks)
>>      real qqi(-ks:ks,-ks:ks,-ks:ks)
>>      complex y(0:iter,-ks:ks,-ks:ks,-ks:ks,1:dimf)
>>      common t0,ts,c1,c2,e,ei,qqi,y
>
>Martin,
>  I cannot find (at first glance) anything wrong with your code; so I only
>have three suggestions:

[1 and 2 deleted]

>3) you might want to use the debugger and set a watch point for your y
>   variable that you know is messed up

I want to strongly recommend the debugger which is my favorite tool
for spotting such problems.  The VAX debugger is not a toy like what
you get in Unix but is an amazingly powerful tool.  Compile you code
with

    $ for/noop/deb ....for
    $ link/deb ....
    $ run the_stuff

After a while noticably longer than usual you get the debugger prompt.
Now press PF2 to get your code on the screen.  With KP0 (keypad 0) you
can step through your code line by line.  PF1 KP0 will step into a
subroutine when you are on a line that calls one; KP0 alone will step
over it.  KP, runs the code without further interruption.  To do what
dafnioti@cae.wisc.edu (Petros Dafniotis) suggests just enter SET WATCH Y
<return> and press KP,.  However, if your code is compute intensive this
will probably slow it down that much that you don't want to trace it
this way.  SET WATCH Y(1,1,1,1,1) might help a little.  Unless it is a
very complex code I usually spot the error just by following the code's
logic with STEPs (KP0) and a couple EXAMINEs.  Also, make frequent use 
of HELP (PF2 as always) to find out more.

-- 
Michael Lemke
Astronomy, UT Austin, Texas
(michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
Newsgroups: comp.lang.fortran
From: kraska@fmsrl7.srl.ford.com (Marvin P. Kraska)
Subject: Pascal to FORTRAN translator needed
Summary: need to integrate Pascal code with huge FORTRAN model
Keywords: pascal, fortran, converter, translator
Organization: Ford Motor Company Research Labs, Dearborn, MI
Date: Wed, 11 Nov 1992 16:41:14 GMT



    This may seem like a strange request, but does anyone know of any
Pascal to FORTRAN(77) translators?  All I see mentioned in the FAQ's are
p2c and f2c, (and I have used both) but no p2f.  I have an upcoming
project that involves integrating a large chunk of Pascal code with a
huge FORTRAN model - and the FORTRAN model _will_ dominate.  The FORTRAN
model currently runs on one of our VAXen. 

    I have _not_ set a Followup-To, since I'm not quite sure where this
really belongs (no flames please).  Please reply directly to me, I will
summarize and post. 

    Thanks in advance for any pointers (oops, that's C :-)...

#include <std/disclaimer.h>-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#  Marvin P. Kraska #
# Ford Motor Research Laboratory                   kraska@fmsrl7.srl.ford.com #
# Powertrain Systems & Controls Engineering                    (313) 337-5348 #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- My SHO Played in Peoria! #
Newsgroups: comp.lang.fortran
From: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
Subject: Re: Whats the difference between STATIC variables and SAVE variables?
Reply-To: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
Organization: MRL - UIUC
Date: Tue, 10 Nov 1992 17:52:50 GMT

In article <1992Nov9.230308.1@slacvx.slac.stanford.edu>, fairfield@slacvx.slac.stanford.edu writes:
|>    Sorry, you've missed the point (reread David M.'s paragraph): 
|>The problem is NOT with having different arguments (and numbers of them)
|>for different entry points, nor with SAVE'ng and sharing _local_ variables
|>between the entry points.  The problem is with SAVE'ng the argument itself.
|>Your example is perfectly fine but does not address the objection...

sure.  the argument must certainly be copied into a SAVEd local variable.
sorry!
--
Furio Ercolessi
Materials Research Laboratory           |   Intl School for Advanced Studies
Univ. of Illinois at Urbana-Champaign   |   Trieste, Italy
furio@uiuc.edu                          |   furio@sissa.it
Xref: sparky comp.lang.fortran:4227 comp.lang.c:16089
From: morgan@sitka.triumf.ca (Morgan Burke)
Newsgroups: comp.lang.fortran,comp.lang.c
Subject: SGI floating point exceptions
Date: 6 Nov 1992 18:40:06 GMT
Organization: TRIUMF, Vancouver BC
Distribution: world
NNTP-Posting-Host: sitka.triumf.ca

I'm having difficulty creating a floating point exception handler
for an application running on SGI's Irix 4.0 (System V-based),
with f77 3.4.

According to the man pages, the routine "handle_sigfpes" is used
to manage floating point exceptions (the normal signal processing
facilities seem to have no effect).  However, I get very strange
results using this routine from both Fortran and C.

First, the Fortran case:

      PROGRAM sig
#include <fsigfpe.h>
      REAL*4 a/1.0/,b/0.0/
      CALL handle_sigfpes(FPE_ON,FPE_EN_DIVZERO,0,FPE_ABORT_ON_ERROR,0)
      WRITE(6,*) a/b
      WRITE(6,*) b**(-2)
      WRITE(6,*) LOG(b)
      END

% f77 sig.f -lfpe
% a.out
   3.4028235E+38
 Infinity
   3.4028235E+38
 Infinity
   3.4028235E+38
 Infinity
   3.4028235E+38
....and so on, in an infinite loop

The normal output (ie. without the call to handle_sigfpes) is:
 Infinity
 Infinity
 Infinity

Now, the C case:

#include <sigfpe.h>
#include <math.h>
main()
{
  float a=1.0,b=0.0;
  handle_sigfpes(_ON, _EN_DIVZERO, 0, _ABORT_ON_ERROR, 0 );
  printf("%e\n",a/b);
  printf("%e\n",pow(b,-2));
  printf("%e\n",log(b));
}

% cc sig.c -lfpe -lm
% a.out
3.402823e+38
1.797693e+308
sigfpe_catch: **ABORT(internal) - failure to analyze exception conditions.
        pc = 0x403a68, fcsr = 0x800420
Floating exception (core dumped)

Removing the call to handle_sigfpes, I get:
Infinity
Infinity
-Infinity

Questions:
==========

1.  Why does the handler trap log(0) in C, but not an explicit
    divide-by-zero, when that is what I have asked for?
2.  Why do results that are normally "Infinity" come back as legal
    floating point values (the maximal values, I assume) when the
    handler is used?
3.  Any idea why the Fortran routine goes berserk?
4.  Why does LOG(0) return +Infinity in f77?
5.  I want the application to core dump (like it did for log(0) in C)
    for all of these examples.  Anybody know a better way to do this?
6.  Who do I hunt down and kill for stupidities (IMHO) like "NaN" and
    "Infinity" in the IEEE floating point standard?

-- Morgan Burke (morgan@reg.triumf.ca)
From: jumper@garfield.catt.ncsu.edu (Michael Lanham)
Newsgroups: comp.lang.fortran
Subject: flow-charting f77 code
Date: 7 Nov 92 21:03:14 GMT
Distribution: comp
Organization: North Carolina State University

I need to find an ftp'able automatic flow charter for code.  Is there such a
creature?  

I have read the FAQ and used archie but without a whole lot of success.
He who will not reason, is a bigot; he who cannot is a fool;
and he who dares not is a slave.      --- Sir William Drummond

Michael Lanham       mjlanham@eos.ncsu.edu   &  jumper@catt.ncsu.edu
Newsgroups: comp.lang.fortran,comp.sys.hp
From: system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson))
Subject: Re: Weird HP compiler warning
Organization: University of Toronto Chemistry Department
Date: Wed, 11 Nov 1992 17:40:48 GMT

In article <1992Nov10.210300.2732@leland.Stanford.EDU> ungar@leland.Stanford.EDU (Jeffrey Ungar) 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
>
>That's because it looks (almost) like you are trying to pass a function,
>namely the intrinsic function SQRT, to the MIN() function. Of course, if
>you *really* wanted to use SQRT as a subprogram argument, you would
>declare it in an INTRINSIC statement, and just write the name "SQRT" in
>the argument list (but not, I would suggest, to the MIN routine!)

If the compiler thinks that an expression in a argument list (even if
it involves a function call) is going to pass anything but the returned
value, then the compiler is truly confused - you can't pass things like
that. The code should be precisely equivalent to
    xjunk = sqrt(12.d0*err/d2fex)
    nexth = min(h,xjunk)
To pass a function name to a called routine, you can't have any
arguments, and you better have declared it EXTERNAL so the compiler
knows you are passing a subprogram name, not a variable.
-- 
What are the chances that any HP computer system will ever "work" properly?
... and Slim just left town. -*- Mike Peterson, SysAdmin, U/Toronto Chemistry
Newsgroups: comp.lang.fortran
From: proth@cs.uiuc.edu (Philip Roth)
Subject: Multiple passes for Absoft linker
Summary: I want to perform more than one pass at a time, can I?
Organization: University of Illinois at Urbana-Champaign
Date: Thu, 12 Nov 1992 09:14:20 GMT

The class I TA for is using the Absoft FORTRAN compiler on 
Macintoshes.  I am trying to link some self-made subroutine libraries 
with a main program, but am having trouble with the linker ( 'link' ).
It performs only one pass over the input at a time,
meaning that there are always loads of unresolved references, which would
be resolved by a multiple pass linker.  I can't find any documentation 
for this linker at the instructional computer labs ( where the software is )
here on campus.

My question: is there a way to force the linker to attempt multiple
passes to resolve references, or am I stuck with just one at a time?

E-mail replies are fine,
Thanks,
Phil Roth


Newsgroups: comp.lang.fortran,comp.sys.hp
From: bauwens@acs.ucalgary.ca (Luc Bauwens)
Subject: Re: Weird HP compiler warning
Date: Wed, 11 Nov 92 00:48:28 GMT
Organization: The University of Calgary, Alberta

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!  Am I going to get this silly warning every time I put
>one intrinsic inside another?  My only comfort is that the program
>executes correctly despite a warning which, to me at least, seems to
>suggest that the compiler didn't get it.

Which HP compiler does this?  I tried with the compiler that 
comes with HP-UX 8.07, with the defaults options, and I didn't
get any warning at all...

Luc B

Newsgroups: comp.lang.fortran
From: davidm@voltaire.Rational.COM (David Moore)
Subject: Re: unformatted output: << SUMMARY >>
Organization: Rational
Date: Wed, 11 Nov 1992 18:54:42 GMT

sakkinen@jyu.fi (Markku Sakkinen) writes:

>In article <1992Nov5.111303.17921@uts.uni-c.dk> ohnielse@oersted.ltf.dth.dk writes:
>>In article 26525@chpc.utexas.edu, michael@chpc.utexas.edu (Michael Lemke) writes:
>>>Doesn't have the record *number* to be stored at some place as well?  
>>>Nothing stops you from doing
>>>
>>>         open( ,.... access='direct', .... )
>>>         write( ..., rec=777 ) data
>>>         write( ..., rec=32 ) mode_data
>>>         close( ... )
>>>
>>>which gives you just two records of data and lots of `holes'.  Or am I
>>>missing something?


This is often true. However, some Fortran systems hook into some
sort of "Record Manager" interface, in which case you may be able to
control the organisation of your file with system directives, or with
extended directives in your "open", or else with calls to
system routines with lots of "$"s in their names. You may be able
to convince the system to give you any of 57 varieties of indexed
file, in which the record number is stored as an index with a pointer
to the data. 

This will avoid allocating space for unused records. It may also allow
variable length records. Need I also remark that its not portable?


Newsgroups: comp.lang.fortran,comp.os.vms