HDTenEightyP/NetNews huggingface dataset:
From: maine@altair.dfrf.nasa.gov (Richard Maine)
Subject: Re: Adjustable arrays
Organization: NASA Dryden, Edwards, Cal.
	<EJH.92Oct5134025@khonshu.colorado.edu>
Date: Mon, 5 Oct 1992 20:41:19 GMT


On 5 Oct 92 13:40:25, ejh@khonshu.colorado.edu (Edward J. Hartnett) said:

        [on the widely used practice of dimensioning adjustable
         arrays with "1" instead of "*" ]

Edward> Someone here told me that the practice of using v(1) would cause
Edward> compiler errors in Fortran 90, but I don't know if that's true
Edward> (although I think it would be a good thing). Can anyone address that
Edward> question?	 

This can cause compilation errors in f77 as well as f90.  I have used
f77 compilers that give errors for this practice.  The practice is a
holdover from f66 days.  Fortran 90 generally provides more
opportunity for compilers to catch errors at compilation time, so it
is plausible that f90 compilers might give error messages for this
practice more often than f77 compilers.  And it happens that the first
full f90 implementation (NAG's) is quite strict about disallowing
language extensions including this one.  However, in principle, f77
is no different from f90 here - the practice is illegal on both.

--
Richard Maine
maine@altair.dfrf.nasa.gov

--
--
Richard Maine
maine@altair.dfrf.nasa.gov
From: david@donald.concordia.ca (David Gaudine)
Newsgroups: comp.lang.fortran
Subject: Re: [HELP] what's wrong with the following simple code?
Date: 2 Oct 92 16:16:00 GMT
Organization: ORGANIZATION!! HERE? You must be kidding

In article <27755@nntp_server.ems.cdc.com> mstemper@ems.cdc.com writes:
>In article <90835@netnews.upenn.edu>, duong@chestnut.chem.upenn.edu (-3612) writes:

>|>            read (21) i,(R(j),j=1,abs(2*i))

>Expecting someone to put the number of data items as the first element
>in input is bad human factors engineering. The program should read until
>it encounters EOF or a flag. If a data item count is necessary, the
>program should count them. Computers count much better than people do.

You can't read an unknown number of data items from a single record of
an unformatted file.  You have to read the record with a single read
statement, so the above is the only way to do it.

Anyway, since it's an unformatted file, it was obviously written by another
program, which must have done the counting.
-- 
---------------------------------------------------------------------------
David Gaudine, Concordia University, Montreal has a very unimaginative sig.
---------------------------------------------------------------------------
From: pgdga@ibm.rz.tu-clausthal.de (Dirk Gajewski)
Newsgroups: comp.lang.fortran
Subject: Silicon Valley Software F77
Keywords: compiler performance
Date: 30 Sep 92 08:45:58 GMT
Organization: tu-clausthal.de

Has anyone experience with the Silicon Valley Software
F-77 32bit compiler? How is the performance, and how
can it be compared with LAHEY and WATCOM products.
Any hints are appreciated.

INTERNET:pgdga@ibm.rz.tu-clausthal.de
Institute of Geophysics, Clausthal-Zellerfeld, F.R. Germany
phone: +49-5323-723001   fax:+49-5323-722320
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 11:16:58 GMT
Reply-To: ruckman@oasys.dt.navy.mil (Christopher Ruckman)
Organization: Carderock Division, NSWC, Bethesda, MD

In comp.lang.fortran, bai@msiadmin.cit.cornell.edu (Dov Bai-MSI Visitor) writes:
> ........
>If you hit in the future the DOS 640k limit, you can still use
>the compiler under OS/2 and it would let you address 16M. I think
>that Ver. 5.1 works also under MS-WINDOWS which may also let you
>use the extended memory.
     ^^^^^^^^^^^^^^^^^^^

There's what I'd like to figure out how to do!  When I compile this
program on our MicroVAX II, the largest array is actually 2470 by 19.
This gives 2470*19*16=750k, which obviously won't fit in 640k.  When
I compile and link using this array size, I get an executable that takes
up 1447k on the disk!  Any hints on getting *this* beast to run on the
PC using Win3.1, FORTRAN 5.1, and the MS QuickWin library?

Thanks for your help.  8-)
Newsgroups: comp.lang.fortran
From: hutch@edge1.pfc.mit.edu
Subject:  Re: F77 Compilers for MS-DOS PC's
Organization: MIT PLASMA FUSION CENTER
Date: Sun, 27 Sep 1992 21:25:49 GMT

Without much to add to this thread except my interest, can I expand
thoughts to include the speed of the compile/link steps. My own experience
with MS 5.0 (which is way better than 3.3 and 4.0) leaves me relatively
satisfied, except that it takes for ever to compile.
My comparison is primarily with VAX-VMS. At a rough guess, on machines
that give roughly equivalent run-time program performance, the VAX compiler
compiles at least 5 times faster. Why is MS FORTRAN so slow? The environment
advantages of the PC are negated by this factor, making it a close call
whether I prefer PC or VAX development. A compiler that was much faster
than MS on the PC would probably tip the balance.

More generally, I notice that much more attention is paid in these discussions
to run time than compile time. However, from the prgrammer's viewpoint the
latter may be much more important.

IHH
From: chenzn@ucunix.san.uc.edu (Zhanzhan Chen)
Newsgroups: comp.lang.fortran
Subject: Graphics Library for MS Fortran
Date: 1 Oct 92 20:17:00 GMT
Organization: Univ. of Cincinnati


	I never used MS Fortran before. What I am wondering is
that if MicroSoft Fortran has a graphics library. I asked this
because I have an application which was written by fortran 77
and Plot 10 (a graphic library). I want to convert all the
Plot 10 to MicroSoft Fortran Graphics Library. 

	If anyone know this please Email me the infomation.

	Thanks a lot!!


	Zhanzhan Chen
	University of Cincinnati
Newsgroups: comp.lang.fortran
From: bauwens@acs.ucalgary.ca (Luc Bauwens)
Subject: Re: F77 Compilers for MS-DOS PC's
Date: Sat, 26 Sep 92 21:56:55 GMT
Organization: The University of Calgary, Alberta

In article <1992Sep25.231804.29041@tc.cornell.edu> bai@msiadmin.cit.cornell.edu (Dov Bai-MSI Visitor) writes:
>In article <92Sep25.220308.16090@acs.ucalgary.ca> bauwens@acs.ucalgary.ca (Luc Bauwens) writes:
>
>>Not that it matters much, but for the sake of accuracy, 5.1 does.
>>
>>However, I would recommend Watcom Fortran 386 V9.0 over MS Fortran 5.x
>>to any serious user.  (This after having used MS Fortran 5.0 for
>>something like five years.)
>>
>>The speed difference with a 32 bits vs. 16 bits compiler varies
>>from a factor 1.3 to a factor 3 with large arrays.
>
>Could someone who used both MS-FORTRAN 5.x and the WATCOM 9.0
>compare the debugging facilities of WATCOM ver. MS-FORTRAN ?
>MS-FORTRAN has the CodeView debugger as well compiler switches
>which would point to the line in code in which an array is out 
>of bounds or other floating-point exceptions occured. 

I found CodeView to be a pain.  Any half decent compiler is capable of
bounds checking and pointing out the location of an exception.

As for Watcom, I only used it to port a piece of code (about 5000 lines)
that I had originally written and debugged using MS 5.0.  Watcom comes with
a debugger called Wvideo and (and BTW, I find that quite important) a
profiler.

I haven't had a chance of using either of them yet, so I can't tell how
good they are (just that it shouldn't be too difficult to beat the
half-hearted stuff that Microsoft includes in their packages).

And Watcom also includes a set of graphics routines equivalent to the
Microsoft ones (identical for all practical purposes except for
the first letter of each routine; I think MS uses $, while Watcom
uses _. And they include SVGA support, 800x600 and 1024x768 which MS 
does not support).  Those only work in DOS programs, not Windows nor OS/2;
too bad, BTW.  But they work under the DOS extender.

Luc B

From: pld@hpfcso.FC.HP.COM (Paul Dineen)
Date: Thu, 1 Oct 1992 00:08:09 GMT
Subject: Re: How to print a "TAB" in fortran 77?
Organization: Hewlett-Packard, Fort Collins, CO, USA
Newsgroups: comp.lang.fortran

	write(*,'(A1)') char(9)
Newsgroups: comp.lang.fortran
From: mroussel@alchemy.chem.utoronto.ca (Marc Roussel)
Subject: Re: Is this a Compiler Bug ?
Organization: Department of Chemistry, University of Toronto
Date: Mon, 5 Oct 1992 17:37:54 GMT

In article <KHB.92Oct4125133@chiba.Eng.Sun.COM> khb@chiba.Eng.Sun.COM (chiba)
writes:
>The X3.9-1978 made it clear; don't use backslash if you want your code
>to be Standard Compliant. If you code is not Standard Compliant don't
>complain that the compiler is broken, that FORTRAN is non-portable or
>that X3J3 should have the offending compiler writer tossed in Gaol.

     No, but by all means complain to your vendor that the default
behaviour is a pain in the butt.  Weird behaviour should be turned off
by default, not the other way around.

				Marc R. Roussel
                                mroussel@alchemy.chem.utoronto.ca
Newsgroups: comp.lang.fortran
From: hybl@umbc4.umbc.edu (Dr. Albert Hybl (UMAB-BIOPHYS))
Subject: Re: Is this a Compiler Bug ?
Organization: Univ. of MD, Baltimore County
Date: Tue, 6 Oct 1992 04:40:20 GMT

In article <1992Oct5.174943.22483@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
>In article <7442@charon.cwi.nl>, dik@cwi.nl (Dik T. Winter) writes:
>|> About whether to use '\' or '\\'.
>|> 
>|> It depends on what standard you take (like in a previous thread about
>|> the use of LF as New-Line).
>
>The Fortran 77 standard is the one I quoted here. ...
>Since an escape of that kind is unnecessary, and the
>existing standard requires all processor representable characters
>to be allowed in strings, the `\' should be so allowed.

Just out of curiosity, if '\' is used in Fortran to signal an escape,
what actually happens to the digraph sequences '\n' and '\t'?

Albert Hybl (hybl@umbc4.umbc.edu)
Newsgroups: comp.lang.fortran
From: hybl@umbc4.umbc.edu (Dr. Albert Hybl (UMAB-BIOPHYS))
Subject: Re: Is this a Compiler Bug ?
Organization: Univ. of MD, Baltimore County
Date: Fri, 2 Oct 1992 23:12:20 GMT

In article <KHB.92Oct2134224@chiba.Eng.Sun.COM> khb@chiba.Eng.Sun.COM (chiba) writes:
>
>In article <1992Oct2.174512.16640@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
>
>...
>   be solved.  In the above case, there is no reason that `\' should
>   not be simply accepted.
>
>Yes there is. A long standing Unix tradition of usage of \ dating back
>to the first Unix f77 compiler. Changing this behavior by default
>would break some large (but unknown in precise size) set of existing
>codes. 
>-- Keith H. Bierman    keith.bierman@Sun.COM| khb@chiba.Eng.Sun.COM

The XLA+ fortran77 compiler for an AT&T 3b2 computers expectes
two '\\' backslash characters; the first escapes the second that
gets embedded into the data string.  The SVS fortran77 compiler for
an AT&T 3b1 expectes only one '\' backslash.  Both the 3b2 and
the 3b1 are unix machines.  In this case I agree with Jim "[T]here
is no reason that `\' should not be simply accepted;"  Even if
it is a double negative.

Each time you create one of these imbroglios, you create a reason
that works to diminish the meaning of the word "Standard."  It is
important to have a mechanism to nip these situations in the
bud--not a rule that encourages the accumulation of a "some large
(but unknown in precise size) set of existing codes."

Albert Hybl (hybl@umbc4.umbc.edu)
Newsgroups: comp.lang.fortran
From: jlg@cochiti.lanl.gov (Jim Giles)
Subject: Re: Is this a Compiler Bug ?
Organization: Los Alamos National Laboratory
Date: Thu, 1 Oct 1992 23:15:31 GMT

In article <1992Oct1.195512.16735@chpc.utexas.edu>, ivab015@hermes.chpc.utexas.edu (Albert Wu) writes:
|> The following program cannot be compiled by fortran compilers on a Sun as well
|> as on a RS6000.  Apparently, the backslash is treated as a continuation
|> symbol.  Is this considered a bug in this program or a bug in the compiler.
|> 
|>       program test
|> 
|>       character*30 string
|> 
|>       string = '1234567890123456\8901234567890'
|>       ibksl = index ( string, '\' )
|>       print *, 'ibksl=',ibksl
|> 
|>       end


Depends.  The standard says the following about character constants:

   4.8.1. *Character*Constant*. The form of a character constant
   is an apostrophe followed by a  nonempty string of characters
   followed by an apostrophe.  The string may consist of any
   characters capable of representation in the processor.  Note
   that the delimiting apostrophes are not part of the datum
   represented by the constant.  An apostrophe within the datum
   string is represented by two consecutive apostrophes with no
   intervening blanks.  In a character string, blanks embedded
   between the delimiting apostrophes are significant.

Now, according to this, *any* character in the native character
set *should* be acceptable in the string.  Few implementations
allow unescaped control characters in a string though (after all,
the record separator is a character - so how does one distinguish
between a record separator which terminates the present statement
prematurely and one which is intended to be an element of the
character constant?).  This seems to leave the door open for 
the implementor to decide which native characters are to be 
described as "capable of representation in the processor" for 
the purposes of a given implementation.

I would say that not allowing a printable character goes a little
far though.  It seems to me that the above program should work.

J. Giles
From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup)
Newsgroups: comp.lang.fortran
Subject: Re: Is this a Compiler Bug ?
Date: 1 Oct 92 21:04:41
Organization: Sun MegaSystems
NNTP-Posting-Host: chiba
In-reply-to: ivab015@hermes.chpc.utexas.edu's message of 1 Oct 92 19:55:12 GMT


In article <1992Oct1.195512.16735@chpc.utexas.edu> ivab015@hermes.chpc.utexas.edu (Albert Wu) writes:

   as on a RS6000.  Apparently, the backslash is treated as a continuation
   symbol.  Is this considered a bug in this program or a bug in the compiler.
...

Neither. Consider the documentation.

Hint:

f77 -xl net.f && a.out
net.f:
 MAIN test:
ibksl=  17
$ 

causes your code to work fine.
--
----------------------------------------------------------------
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: cflatter@nrao.edu (Chris Flatters)
Subject: Re: Adjustable arrays
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Mon, 5 Oct 1992 19:32:06 GMT

In article 16706@magnus.acs.ohio-state.edu, cpaulse@magnus.acs.ohio-state.edu (Chris D Paulse) writes:
>
>In some code I'm trying to modify, there are declarations within subroutines
>for arrays of size 1, for instance
>
>      dimension v(1)
>
>These arrays seem to be ajustable, as elements with indices greater than 1
>are referenced within the subroutine.

This is an ancient FORTRAN habit.  Conforming FORTRAN 77 and Fortran 90 programs
do not access arrays with indices outside the declared array limits.  Adjustable
arrays of one-dimension should be declared like

      DIMENSION V(*)

Declaring adjustable arrays as arrays of dimension 1 will prevent you from using
bounds-checking features on some compilers.

>Obviously, the declaration facilitates 
>the correct addressing of the beginning of the array.  I can't seem to find
>any reference to this sort of programming in the standard fortran texts.

Any decent Fortran text should deal with adjustable arrays.

>Could someone please explain what is going on here?  For each of the arrays
>declared, I want to add another dimension.  Should I make the adjustable
>dimension the last one?  

In short: yes.  This follows from the fact that Fortran arrays are stored
with the first dimension varying fastest and the last dimension varying slowest.

	Chris Flatters
	cflatter@nrao.edu
From: fretz@virgo.hks.com (Kurt Fretz)
Newsgroups: comp.lang.fortran
Subject: Re: Quickie
Date: 5 Oct 1992 22:24:09 GMT
Organization: HKS, Inc.
Distribution: usa
Reply-To: fretz@virgo.hks.com (Kurt Fretz)
NNTP-Posting-Host: virgo.hks.com


In article <25960@oasys.dt.navy.mil>, mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill) writes:
>Path: argo.hks.com!noc.near.net!hri.com!ukma!darwin.sura.net!dtix!oasys!mulvihil
>From: mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill)
>Newsgroups: comp.lang.fortran
>Subject: Quickie
>Message-ID: <25960@oasys.dt.navy.mil>
>Date: Mon, 5 Oct 92 16:26:57 GMT+5:00
>Reply-To: mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill)
>Distribution: usa
>Organization: Carderock Division, NSWC, Bethesda, MD
>Lines: 15
>
>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
>
In article <25960@oasys.dt.navy.mil>, mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill) writes:
>Path: argo.hks.com!noc.near.net!hri.com!ukma!darwin.sura.net!dtix!oasys!mulvihil
>From: mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill)
>Newsgroups: comp.lang.fortran
>Subject: Quickie
>Message-ID: <25960@oasys.dt.navy.mil>
>Date: Mon, 5 Oct 92 16:26:57 GMT+5:00
>Reply-To: mulvihil@oasys.dt.navy.mil (Lawrence Mulvihill)
>Distribution: usa
>Organization: Carderock Division, NSWC, Bethesda, MD
>Lines: 15
>
>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 using character arrays for formats, e.g.:

       parameter ( maxfmt = 10 )
       character*40 fmts(maxfmt)
       fmts(1) = '(2x,''my brain hurts'')'
       fmts(2) = ...
       .
       .
       n = 1
       write(*,fmts(n))

Hope this helps.

Kurt
fretz@hks.com
From: thacker@enh.nist.gov
Newsgroups: comp.lang.fortran
Subject: scientific object-oriented programming?
Date: 30 Sep 92 20:33:12 GMT
Organization: NIST

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.  In particular, I'm involved with oceanographic 
problems where it is necessary to distinguish computational cells 
associated with water from those associated with land, and there are 
technical problems associated with some fields being defined at cell 
centers, others at cell faces, etc.  In addition, I am trying to 
design for inverse problems and must implement adjoint operators for 
each differential operator that is introduced.

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.

Thanks,

Carlisle Thacker
From: jlg@cochiti.lanl.gov (Jim Giles)
Newsgroups: comp.lang.fortran
Subject: Re: Is this a Compiler Bug ?
Date: 2 Oct 92 17:45:12 GMT
Article-I.D.: newshost.1992Oct2.174512.16640
Organization: Los Alamos National Laboratory

In article <1992Oct1.195512.16735@chpc.utexas.edu>, ivab015@hermes.chpc.utexas.edu (Albert Wu) writes:
|> [...]
|>       program test
|> 
|>       character*30 string
|> 
|>       string = '1234567890123456\8901234567890'
|>       ibksl = index ( string, '\' )
|>       print *, 'ibksl=',ibksl
|> 
|>       end

A lot of responses to this question include statements that certain
compiler directives or command line options cause the above program
to work as expected.  However, if the native character set of the
implementation is ASCII, the above program is standard conforming
*as is*.  Now, as I pointed out before, few implementations are
strictly standard conforming with respect to character literals
because of control characters.  However, it seems extreme to 
require a compiler option to make a standard conforming program
work unless there is this mitigating implementation problem to
be solved.  In the above case, there is no reason that `\' should
not be simply accepted.

If you want to exclude some ASCII characters from the allowable
set of "characters capable of representation in the processor"
that literals may contain, there is a standard conforming way
to place these into character data without an "escape" character
in the string syntax:

      string = '1234567890123456' // char(13) // '8901234567890'

This inserts the "carriage return" control character into the string
(assuming ASCII is the implementation native character set).  Since 
there is no need for an "escape" in the syntax of Fortran strings,
the implementation shouldn't consume a perfectly good character for 
this purpose.

-- 
J. Giles
Newsgroups: comp.lang.fortran
From: morten@oase.kemi.aau.dk (Morten Kjeldgaard)
Subject: Re: sprintf in FORTRAN?
Organization: Aarhus University, Denmark
Date: Thu, 1 Oct 1992 08:56:50 GMT

Speaking of which: I have an old car from 1957. How do I make it go 220mph?

/Morten

--
Morten Kjeldgaard  ~ morten@oase.kemi.aau.dk ~ mok@kemi.aau.dk
Biostructural Chemistry, Department of Chemistry, Aarhus University
Langelandsgade 140, DK-8000 Aarhus C, Denmark
Phone: +45 86 12 46 33 ~ +45 86 20 27 11 x6518 ~ Fax: +45 86 19 61 99
From: chenzn@ucunix.san.uc.edu (Zhanzhan Chen)
Newsgroups: comp.lang.fortran
Subject: Graphics library for MS Fortran ?
Date: 1 Oct 92 20:08:48 GMT
Organization: Univ. of Cincinnati


	I never used MicroSoft Fortran. What I am wondering is 
if MS FORTRAN has a graphics library? I ased that because I have
an application which was witten by FORTRAN77 and PLOT 10. I need
convert PLOT 10 to MS FORTRAN's graphics library.

        If anybody know this could you E-mail me the information.

        Thanks a lot !



Zhanzhan Chen
University of Cincinnati
From: cpg@jet.uk (Dr Chris P Gatcombe)
Newsgroups: comp.lang.fortran
Subject: Re: [HELP] what's wrong with the following simple code?
Date: 30 Sep 92 07:58:37 GMT
Organization: Joint European Torus

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

This is in no way intended to be a flame, but why post an article
to the world asking a relatively simple problem that the university
computer support people should be answering?

Chris.
-- 
Dr. Chris Gatcombe
Tessella Support Services plc,       Room K1/0/31,
3 Vineyard Chambers, Abingdon,       JET Joint European Undertaking,
Oxfordshire OX14 3PX, UK.            Abingdon, Oxfordshire OX14 3EA, UK.
Phone:  (+44) (0235) 555511          Phone:  (+44) (0235) 464490
Fax:    (+44) (0235) 553301          Fax:    (+44) (0235) 464766
E-mail: gatc@tessella.co.uk          E-mail: cpg@jet.uk
- Disclaimer: Please note that the above is a personal view and should not 
  be construed as an official comment from the JET project.