HDTenEightyP/NetNews huggingface dataset:
From: psun@jhunix.hcf.jhu.edu (Peter Sun)
Subject: Re: Variable repeat count specifier for FORMAT statments
Organization: HAC - Johns Hopkins University, Baltimore
Distribution: na
Date: Fri, 24 Jul 1992 22:02:22 GMT

In article <1992Jul23.215113.16531@jhunix.hcf.jhu.edu> psun@jhunix.hcf.jhu.edu (Peter Sun) writes:
>My apologies if this questions seems trivial, but I've tried to find the
>answer in so many places.  I need to know how to give a variable as the
>number of repeat counts to a format field descriptor statement.  For
>example I know on VAX/VMS this can be done with something like:
>
>                   write (*, '(<n>(I8))')
>
>which will repeat the format descriptor I8 n number of times, but I haven't
>found this portable to other compilers.  Namely, the MIPS Fortran 77
>compiler for the SGI IRIS system.  Is there a standard for this?  Or is it
>just compiler dependent.
>
>Thank you very much!  Any help will be greatly appreciate.  
>
>--Peter Sun
>psun@jhunix.hcf.jhu.edu

===============================================================================

Thanks to everyone who replied to my question.  I got a lot of great
responses. 

The overwhelming solution I got to the problem involves first writing
internally as a character string, and then calling that string as the
format to do the actual output (explained better below).  This solution was
provided to me by Myron Calhoun, Al Stangenberger, Melvin Klassen, John
Aguirre, Kurt Hirchert, Jim Giles, and James Burley.  Thanks very much--you
are all very helpful people.


--Peter Sun
psun@jhunix.hcf.jhu.edu

----------------------------------------------------------------------------
	CHARACTER*80 FMT 	      ! Declare the format as a char string.
	INTEGER      N		      !
				      !
	n = 7			      ! Specify repeat count.
				      !  
	fmt = '(xxx(I8))'	      ! Init. the string w/o specifiy 
				      ! repeat count.
	write(fmt,(2:4),'(I3)') n     ! Write to the format and replace the
				      ! xxx with the repeat count.
	write(*,fmt) what_to_write    ! Write out, calling the string FMT
				      ! as the format statement.
----------------------------------------------------------------------------





Newsgroups: comp.lang.fortran
From: schieb@shark.gsfc.nasa.gov (Brian D. Schieber)
Subject: VAX FORTRAN to UNIX master guide wanted
Reply-To: schieb@shark.gsfc.nasa.gov (Brian D. Schieber)
Organization: Oceans & Ice Branch, NASA/GSFC/GSC
Distribution: na
Date: Thu, 30 Jul 1992 15:27:51 GMT

I'd love to get ahold of a reference that can list and 
describe all the considerations in porting VAX FORTRAN 
code (and datasets maybe too :) ) to the UNIX environment.
I know much of this may be device specific on the UNIX
side but there is a standard of sorts for UNIX FORTRAN 
too. 
 
Are there any such references in existence? I know of 
many considerations that I had to learn the hard way.
I would just like to get access to a 'full list' that
will most likely have items that I have not yet come across
in my 'travels'.

Thanks,
 Brian
Newsgroups: comp.lang.fortran
Subject: Re: Portability of DIRECT UNFORMATTED data files?
From: ercolessi@uimrl7.mrl.uiuc.edu (furio ercolessi)
Date: Wed, 29 Jul 1992 17:51:42 GMT
Reply-To: ercolessi@uimrl7.mrl.uiuc.edu (furio ercolessi)
Organization: MRL - UIUC

In article <1992Jul29.143659.29110@e2big.mko.dec.com>, cowan@impec.zko.dec.com (Ken Cowan) writes:
|>In article <Bs5F3H.AB0@news.udel.edu>, mccalpin@perelandra.cms.udel.edu (John D. McCalpin)
|>writes:
|>|>In article <1992Jul29.111524.1@lure.latrobe.edu.au> matap@lure.latrobe.edu.au (Andrej Panjkov,
|>La Trobe Maths) writes:
|>|>>Will these be portable between systems?  (ie is a D/U file written by
|>|>>a Fortran program on one system readable by a Fortran program on another?)
|>|>
|>|>There is a growing range of machines for which Fortran direct access files
|>|>use the same internal format.  Right now I share Fortran DA files between
|>|>Sun, Silicon Graphics, and IBM RS/6000 machines completely transparently.
|>|>
|>|>(Note: the OPEN statement on the SGI may differ, since the RECL= parameter
|>|>is in 32-bit words, while Sun & IBM use a RECL of bytes.)
|>|>
|>|>These machines also use identical formats for Fortran sequential unformatted
|>|>files.

One may add Hewlett-Packard (700 series) to the list, at least for sequential
unformatted, and Convexes in IEEE mode, as emerged from a discussion
in this newsgroup some time ago.
 
|>|>Many other machines are definitely *not* the same format, such as the
|>|>DECstations, which have their bytes swapped. 
|>   DEC Fortran V3 on the DECstation has an option that lets you read RS/6000
|>direct access unformatted files.  Try "CONVERT=BIG_ENDIAN" as an open statement
|>option.  This is documented in the release notes for V3.1.

Or use option '-assume big_endian' in the f77 command line.
--
Furio Ercolessi
Materials Research Laboratory           |   Intl School for Advanced Studies
Univ. of Illinois at Urbana-Champaign   |   Trieste, Italy
furio@uiuc.edu                          |   furio@sissa.it
Newsgroups: comp.lang.fortran
From: mrl@uai.com (Mark R. Ludwig)
Subject: Re: Why CALL EXIT? (was Re: Question for C ==> Fortran)
Organization: Universal Analytics, Inc., Torrance (LA), CA
	<1992Jul29.134901.1@slacvx.slac.stanford.edu>
	<1992Jul29.204115.3917@walter.cray.com>
Date: 30 Jul 92 19:03:25

In article <1992Jul29.204115.3917@walter.cray.com> wws@craywr.cray.com
(Walter Spector) writes:

|> Why do so many people use the non-standard CALL EXIT instead of the
|> standardized-for-over-25-years STOP statement?

The main reason in production software is to prevent the annoying
"STOP" or "FORTRAN STOP" message which some run-time environments
provide.  Few Un*x Fortran environments have that problem.$$
-- 
INET: mrl@uai.com      BANG: uunet!uaisun4!mrl      ICBM: USA; Lower Left Coast
  "You can get a crowd to clap at a phone number, if the inflection is right."
   -- Dave Ross
From: harrisp@wl.aecl.ca
Newsgroups: comp.lang.fortran
Subject: RE: real to string conversion
Date: 22 Jul 92 16:50:52 GMT
Organization: AECL RESEARCH


	The standard way to do this is through "internal" files (at least
on PC's and on VAX mainframes). You use the name of the character variable
as the file unit, and write to it as though it was a file. I hope the 
following code fragment helps:

	character*10 carray
	real*4 val

	val=3.1416
	write(carray,1000) val
 1000	format(f10.4)
	print*,carray


The results of executing this code would print

    3.1416

Note that this requires that you are going to know the range of the
numbers before hand ie. the previous code would print drivel once
val was greater than 10^6 or less than 10^-4. You could get around this
using exponential formatting, or runtime formats. 

I would imagine there would be something in the index of your fortran
manual under internal files. If not, check out the area on IO statments,
specifically WRITE statements


hope this helps

Phil Harris				|  Imagination is more
Whiteshell Laboratories			|  important than knowledge.
Atomic Energy of Canada			|           Albert Einstein
HARRISP@WL.AECL.CA			| 
Newsgroups: comp.lang.fortran
From: ilh@lcs.mit.edu (Lee Hetherington)
Subject: f77 shell script for f2c (wanted)
Reply-To: ilh@lcs.mit.edu
Organization: MIT/LCS Spoken Language Systems
Distribution: comp
Date: Tue, 21 Jul 1992 19:25:52 GMT

I'm using f2c on a Sun in conjunction with the acc (ANSI C) compiler.
I'm wondering if anyone has a shell script (sh or csh) that `looks'
like f77.  This script would interpert appropriate options, call f2c
where appropriate, call acc where appropriate, and link when
appropriate.  Shouldn't be all that difficult.  Has anybody written
such a script yet?

Please respond by email as I don't read this group very often.

Thanks!
--

--Lee Hetherington
From: chepan@gsusgi1.gsu.edu (Parthasarathy Nambi)
Subject: MS Fortran 5.1 upgrade. Is it worth it?
Summary: Is MS Fortran 5.1 upgrade worth it?
Keywords: fortran, Microsoft
Organization: Georgia State University
Date: Fri, 24 Jul 1992 13:40:12 GMT

 Hi,   

 Has anyone upgraded to MS Fortran 5.1 from 5.0. Is it worth the money?
 I have seen advertisements from Microsoft that using 5.1, it is
 possible to write Windows apps - is this true and has anyone actually
 developed any apps that is properly functional under Windows 3.0 or 3.1?

 The ad also claims that one can write apps upto 16MB!? Any comments
 on this.

 Thanks in advance.

 P.Nambi
From: martelli@cadlab.sublink.org (Alex Martelli)
Newsgroups: comp.lang.fortran
Subject: Re: MS Fortran 5.1 upgrade. Is it worth it?
Keywords: fortran, Microsoft
Date: 29 Jul 92 09:48:40 GMT
Organization: CAD.LAB S.p.A., Bologna, Italia

bauwens@acs.ucalgary.ca (Luc Bauwens) writes:
	...
:I am happy with the Watcom compiler 

So am I!

:At this point, the only reason as to why I keep MS 5.1 on my
:hard disk, is to make DOS plain vanilla stuff that will run without the
:extender.

Get the "F77-386 -> F77 Delta Pack" for some trifling amount and you'll
be able to cleanse your disk of the MStuff...
-- 
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: sandee@Think.COM (Daan Sandee)
Newsgroups: comp.lang.fortran
Subject: Re: Assigning numeric variables to strings
Date: 30 Jul 1992 18:00:50 GMT
Organization: TMC
Distribution: world
NNTP-Posting-Host: telecaster.think.com

In article <Bs7qD3.F70@news.cso.uiuc.edu>, jal41820@uxa.cso.uiuc.edu (Smiley) writes:
|> How can one assign a numeric variable to part of a string (e.g., if 
|> fortran allowed this statement, string(38:39) = int(real) is what I
|> want to do)?

Assuming what you want is to have a substring with a *character
representation* of the variable *converted to an integer* :

      write(string(38:39),'(i2)') int(x)

(Definitely a FAQ, about once a week, luckily not one which creates a
hundred postings with misinformation and miscellaneous complaints.)

Daan Sandee                                           sandee@think.com
Thinking Machines Corporation
Cambridge, Mass 02142                                 (617) 234-5044
Newsgroups: comp.lang.fortran
From: ccw@slee07.srl.ford.com (C. C. Warren)
Subject: How can I count the number fields in a formatted file?
Organization: Ford Motor Company Scientific Research Labs, Dearborn, MI
Date: Fri, 31 Jul 1992 15:11:48 GMT

Is there a way to determine the number of fields in a formatted (ascii) file
record? putting it another way, is there a way to terminate a read if an EOL
is encountered? I've looked thru Sun's fortran manual and I don't see an easy
way to do this. 

Any suggestions would be appreciated.
Thanks
--
*************************************************************************
*My opinions are mine and do not necessarily reflect in any way those *
*of my employer.                                                        *
*Chris Warren:  ccw@slee01.srl.ford.com                                 *
Newsgroups: comp.lang.fortran
From: jes@iscnvx.lmsc.lockheed.com (Jim Schafer)
Subject: Runtime format statements 
Organization: Lockheed Missiles and Space Co.
Date: Wed, 29 Jul 92 22:17:39 GMT


  I have a problem with 'runtime' FORMAT statements on the HP9000. 
  Consider the routine PRNT:

       SUBROUTINE PRNT(ARAY,N,FORM)
       CHARACTER*(*) FORM
       WRITE(6,FORM) (ARAY(I),I=1,N)
       RETURN
       END

  According to the old Fortran 66 standards, the program

       dimension I(3),a(3)
       data i/1,2,3/,A/4.,5.,6./
       call PRNT(i,3,'(3i5)')
       call PRNT(a,3,'(3f10.2)')
       end

  should yield

    1    2    3
      4.00      5.00      6.00

  (In Fortran 66, the type of value is assumed to match the format type,
   no conversion is performed) 

  For many systems, this is the default ( convex, iris, mac(LS/MPW) )

  On other systems I get a 'Variable/Format type mismatch' error at
  runtime (Vax,Cray,IBM-RS6000), indicating that the format type (3i5)
  does not match the array type (ARAY). For these systems, I have been
  able to turn off this type-checking. (The one exception has been the
  latest DEC compiler on the Dec5000)

  On the HP9000, it doesn't complain but it yields:

    0    0    0
      4.00      5.00      6.00

  It believed that the input arguments were floating point and saw that
  I wanted an integer format, so it converted them to integer (yielding 0)
  and then printed them. 

  I would like a way to turn off this type checking and force the HP
  (and Dec5000) to trust the FORMAT and not do any conversion. 

  Any help would be appreciated. Thanks in advance,


              Jim Schafer

-- 
J.E.(Jim) Schafer
jes@lmsc.lockheed.com
From: wood@ra.phy.fit.edu (Matt A. Wood)
Newsgroups: comp.lang.fortran
Subject: Which Fortran Compiler for Suns?
Date: 31 Jul 92 17:03:23 GMT
Organization: Florida Institute of Technology

Hello.  I'll be getting a Sun IPX and an ELC in the near future, and
have little money left over for a Fortran compiler (which I must have).
What suggestions can you offer?  Is it wise to buy a f77 compiler
given that f90 is around the corner (and available from NAG, I 
believe)?  Does anybody know how the GNU-Fortran project is 
coming along?  Anyway, thanks very much for your time.  Please
e-mail if possible -- I'll post a summary in about a week.

Cheers,
Matt A. Wood				Physics and Space Sciences
wood@phy.fit.edu			Florida Institute of Technology
(407) 768-8000 (x8098) 			150 W. University Blvd.
                                        Melbourne, FL  32901-6988
-- 
Matt A. Wood				Physics and Space Sciences
wood@phy.fit.edu			Florida Institute of Technology
(407) 768-8000 (x8098) 			150 W. University Blvd.
                                        Melbourne, FL  32901-6988
From: fortran@giac1.oscs.montana.edu (Lou Glassy)
Newsgroups: comp.lang.fortran
Subject: is 'exp10' a Sun-ism?
Date: 22 Jul 92 00:53:08 GMT
Article-I.D.: coe.1992Jul22.005308.4392
Distribution: usa
Organization: Montana State University, Bozeman Montana USA

while compiling some mixed C and Fortran code (the whole ball of which
i've heard came from a Sun), i got the following link-time
undefined-symbol errors:

ld:
Undefined:
for_open
for_read_seq_lis
for_read_seq_lis_xmit
for_write_seq_fmt
for_read_seq_fmt
for_write_seq_fmt_xmit
for_close
for_write_seq_lis
for_write_seq_lis_xmit
for_read_seq
for_read_seq_xmit
for_read_dir
for_read_dir_xmit
for_pause
for_stop
math_pow_ii
exp10

Stop.

well, by throwing in everything but the kitchen sink (e.g.,
-lfor -li -lutil -lots ), i made all the link errors go away *except*
for 'exp10'.  (because this was mixed C and Fortran code, 'cc' was
used for the link phase in the makefile.)

i'm running on a Decstation-5000, under Ultrix v4.2, and using (i think)
Dec Fortran for RISC v2.0.  i'm not sure what the version of 'cc' is.

i grepped on every library i could find (every *.a file on the whole machine,
from / downwards), and found *no* reference to 'exp10' in any of them.

is 'exp10' a Sun-specific function? 

thanks in advance,

lou.


-- 
Lou Glassy                     <> Watch the field behind the plow
Student in Earth Sciences      <> Turn to straight, dark rows..
Montana State University       <> Put another season's promise in the ground.
fortran@giac1.oscs.montana.edu <>                          --Stan Rogers 
Newsgroups: comp.lang.fortran
From: tholen@galileo.ifa.hawaii.edu (Dave Tholen)
Subject: Re: MS Fortran 5.1 upgrade. Is it worth it?
Organization: University of Hawaii
Date: Sat, 25 Jul 1992 22:06:59 GMT

Luc Bauwens writes:

> The 32 bit apps run about 35% faster than the 16 bits MS apps.

I have found that the speedup depends on the relative amounts of I/O and
number crunching.  WATCOM's I/O performance would appear to be slightly
worse than Microsoft's, but in the number-crunching department, the
32-bit code wins handily, and by more than a factor of two.

I ran a simple benchmark that consisted of the following:  a DO loop that
executes 1,000,000 times; inside the loop is a random number generator
that provides a number between -1.0 and 1.0, and a statement that takes
the arcsine of the random number and adds the result to an accumulator.
Outside the loop, the value of the accumulator is written to standard
output.  I discovered that the accumulation step was necessary to prevent
WATCOM's optimizer from eliminating the arcsine step, which I put in there
to make sure the coprocessor was getting used.  By the way, everything was
in DOUBLE PRECISION.

Here are some timings on a 25 MHz 386/387 combination along with the compiler
options used to generate the executable.  Note that WFL refers to the WATCOM
product, while FL refers to the Microsoft product:

    74.36 sec     WFL386 /3 /OX
    74.48         WFL386
    80.67         WFL386 /OD
   198.20         WFL386 /FPC

   162.67         FL -G2 -FPi87
 1,532.35         FL -G2 -FPa
15,561.15         FL -G2 -FPi     with NO87=Coprocessor disabled

With the WATCOM product, it appears that OS/2 takes over the coprocessor
emulation task, but OS/2 doesn't recognize the NO87 environment variable,
so I never could get it to run the test without the coprocessor.  The
factor of 100 speedup using the coprocessor with the Microsoft product
is ridiculous.  Something must be going on that I don't understand.  I
wish I had a system with 16-bit OS/2 version 1.3 installed to determine
if the 32-bit operating system is somehow handicapping 16-bit programs
that emulate the 80-bit arithmetic of the coprocessor.

Anyway, I am keeping the Microsoft compiler on my hard disk, simply
because WATCOM does not (yet?) support the 16-bit Kbd, Mou, and Vio API
calls.  It does permit full PM development using the 32-bit APIs, but
they are only thinking about providing support for the old 16-bit APIs;
no guarantee that it will happen.
Newsgroups: comp.lang.fortran
From: zinckt@wl.aecl.ca
Subject: WANTED : structure chart generator for VAX/VMS
Organization: AECL RESEARCH
Date: Tue, 28 Jul 1992 15:42:53 GMT

Hell0 - 

I am looking for code which produces a list of variable names from inputed 
F77 code.  I as using F77 on VAX/VMS. I thought I would ask the net before I 
write one myself.

Thanx in advance.

	Tom.

----------------------
T.R.A. Zinck
Atomic Energy of Canada Limited
Whiteshell Labs, Pinawa
Manitoba, Canada
email: zinckt@wl.aecl.ca

Newsgroups: comp.lang.fortran
From: bells@watson.ibm.com (Craig Douglas)
Subject: Re: Help! Partial Differential equation solvers
Date: Wed, 22 Jul 1992 16:38:19 GMT
Reply-To: bells@watson.ibm.com
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM Thomas J. Watson Research Center

In article <21JUL92.11592567@wl.aecl.ca>, harrisp@wl.aecl.ca writes:
|> To:   Greg Lampard
|> 
|> From: HARRISP@WL.AECL.CA   (Phil Harris)
|> Date: 22-JUL-1992
|> RE:   Solving partial differential equations numerically
|> 
|> ... (deleted)
|> Anybody have any suggestions. I've heard rumors of some NETLIB routines,
|> but wouldn't know where to start in terms of which routines and where
|> to get them from.
|> 
|> 
|> Phil Harris                          |  Imagination is more
|> Whiteshell Laboratories                      |  important than knowledge.
|> Atomic Energy of Canada                      |           Albert Einstein
|> HARRISP@WL.AECL.CA                   | 
|> 
|> 

You might want to look in the anonymous ftp area of casper.cs.yale.edu in the
mgnet directory.  This is a repository devoted to multigrid (with some domain
decomposition stuff that has crept in).  There are a number of PDE solvers
there.  A number of them are not on netlib or are more recent versions.

There is also a digest that comes out about once a month.  You can join that
by sending a message to mgnet-requests@cs.yale.edu.

Craig Douglas

*******************************************************************************
Relevant addresses and numbers:

offices: IBM T. J. Watson Research Center  *  Yale University
         Mathematical Sciences Department  *  Computer Science Department
         P. O. Box 218                     *  P. O. Box 2158 Yale Station
         Yorktown Heights, NY 10598-0218   *  New Haven, CT 06520-2158
         (914) 945-1475                    *  (203) 432-1209
         location: 35-214                  *  location: 204 Watson Hall
         bells@watson.ibm.com              *  douglas-craig@cs.yale.edu
*******************************************************************************
Newsgroups: comp.lang.fortran
From: winkeler@natinst.com (Keith Winkeler)
Subject: Fortran to C
Organization: National Instruments, Austin, TX
Date: Thu, 23 Jul 1992 21:56:25 GMT


Is there software package available that converts Fortran code
to C code? Please e-mail responses.

Thanks,
Keith Winkeler
Newsgroups: comp.lang.fortran
From: siili@sumppu.fmi.fi (Tero Siili)
Subject: Re: Why CALL EXIT? (was Re: Question for C ==> Fortran)
Originator: siili@sumppu.fmi.fi
Organization: Finnish Meteorological Institute
Date: Thu, 30 Jul 92 15:35:35 GMT


In article <1992Jul29.204115.3917@walter.cray.com>, wws@craywr.cray.com (Walter Spector) writes:
|> 
|> In article <1992Jul29.134901.1@slacvx.slac.stanford.edu>, fairfield@slacvx.slac.stanford.edu writes:
|> |> [a bunch of stuff, then...]
|> |>         CALL EXIT
|> |>         END
|> |>
|> |> The "CALL EXIT" at the bottom is optional (more-or-less). A "STOP" statement
|> |> would do just as well.
|> 
|> This is something I have never understood in almost 20 years of Fortran
|> programming.  Why do so many people use the non-standard CALL EXIT
|> instead of the standardized-for-over-25-years STOP statement?
|> Is/was there magic associated with it on some arcane systems?
|> 
|> (At least there aren't many codes twiddling 'sense lights' anymore. :-)
|> 
|> Walt
|> -- 
|> Walt Spector
|> (wws@renaissance.cray.com)
|> Sunnyvale, California
|> _._ _._ _.... _. ._.

I use CALL EXIT(rc) on SGi, since rc is a return code to the operating system.  I often write tools in fortran, since I have not bothered to learn C (why change a tool, if the one you use works?) and then use several of those tools from shell scripts.  I have not checked, but does STOP create an anomalous return code for the OS?

On SGi EXIT is, I believe, an INTRINSIC subroutine and one good habit (not invented by me) would be to define EXIT with INTRINSIC statement; then if the code is ported to an environment/compiler, which does not have this (in)famous subroutine, the compiler would give warnings.

Tero Siili
Finnish Meteorological Institute
Tero.Siili@fmi.fi
Newsgroups: comp.lang.fortran
From: linsbin@cc.nctu.edu.tw (Lin shyh bin)
Subject: Question for C ==> Fortran
Organization: National Chiao Tung University
X-Newsreader: Tin 1.1 PL4
Date: Tue, 28 Jul 1992 07:55:14 GMT

    Hi, I am unfamiliar to FORTRAN, but I want to write a FORTRAN program as

like the follow C program. 
  
    Could anyone tell me how to transfer it on VAX FORTRAN ?

    #include <stdio.h>
    #include <math.h>

    #define  MASK 0x1f800000

    union dandi {
          int     i[2];
          double  d;
    } di;

    main()
    {
     float  f;
     double d;
     
     for (f=0 ; f<1 ; f+=0.000001) {
         d = (double) f;
         di.d = sin(d);
         if ((di.i[1] & MASK) == 0) printf("\n Sine in hex : %x", di.i[1]);
     }
    }


    Thanks in advance !!

                                               Sbin  Lin
                                    Usenet : u7822044@cc.nctu.edu.tw
                                    Bitnet : 7822044@TWNCTU02
Newsgroups: comp.lang.fortran