HDTenEightyP/NetNews huggingface dataset:
From: ags@seaman.cc.purdue.edu (Dave Seaman)
Subject: Re: Jumping from nested subroutine to main directly?
Organization: Purdue University
Date: Sat, 21 Nov 1992 18:56:00 GMT

>
>>>>>> "John" == John H. Chauvin <jchauvin@netcom.com> writes:
>
>  John> Is it possible to transfer control from a nested subroutine directly to the 
>  John> main routine without have to execute multiple returns from all the 
>  John> subroutines in between?  I would like a way of exiting directly to the main 
>  John> routine when a error is detected six or seven subroutines down.

Write a subroutine to do whatever final cleanup is needed. Have
the main program end with a call to the cleanup routine. Have the
cleanup routine finish with a STOP statement, so that it never
returns to the main program.

Now, when an error is detected and you want to bail out, you can
just call the cleanup routine, knowing it will never return. You
can even have the routine take an error argument to indicate the
reason for termination, and have the cleanup take appropriate
action.

--
Dave Seaman
ags@seaman.cc.purdue.edu
From: ctaylor@cs.uiuc.edu (Conrad W Taylor)
Subject: Print characters on one line without newline...???
Organization: University of Illinois at Urbana-Champaign
Date: Mon, 16 Nov 1992 18:33:42 GMT

         I'm writting this PrintX routine that is to print
the letter X n times on one line without any spaces and
newline.  My PrintX routine looks like this:

      SUBROUTINE PrintX(XCOUNT)
        INTEGER XCOUNT

        INTEGER i

        DO 10 i, XCOUNT
          PRINT 20
  10    CONTINUE
  20    FORMAT(1X, 'X')

        PRINT *
        
        RETURN
        END

correct: XXXXX...X
incorrect: X
           X
           X
           .
           .
           X

This routine only prints one 'X' on n lines and I want it to print
n X's on one line without any spaces in between and without a new-
line character.  Could someone explain what I might be doing wrong?
Thanks in advance to all that reply to this e-mail.

-Conrad


Newsgroups: comp.lang.fortran
From: michael@chpc.utexas.edu (Michael Lemke)
Subject: Re: really weird compiler hang!
Organization: The University of Texas System - CHPC
Date: Thu, 19 Nov 92 19:47:41 GMT

In article <EJH.92Nov19092632@khonshu.colorado.edu> ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
>
[notes that following routine hangs Sun's compiler:]
>
>      subroutine get_days(LU, h, typenum, filein)
>ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
>c
>      implicit none
>c
>      structure /cond_samp_hdr/
>         integer data_rate, num_chan, num_ind_val
>         integer start_jday, stop_jday
>         real start_time, stop_time
>         character*80 data_type
>         character*80 set_name
>         character*100 comment1, comment2, comment3
>         character*100 reserved
>      end structure
>c
>      record /cond_samp_hdr/ h
>c
>      date = h.set_name(lnblnk(h.set_name)-7:lnblnk(h.set_name))
>      end
>
>
>Here's what make gives me:
>cd /home/khonshu/ejh/cond_samp/atob_src/
>f77 -c -e test.f
>test.f:
>	get_days:
>
>
>Can anyone explain this bizarre behavior? I'm running this on a Sun
>IPC, running 4.1.1, using the Sun fortran compiler.
>--
>Edward Hartnett			ejh@khonshu.colorado.edu
>


This is what I got on our Sparc station after a few seconds:


version-id of "/usr/lang/SC1.0.1/f77pass1":          SC1.0 Fortran V1.4, Patch Release 6, 13Apr1992
/usr/lang/SC1.0.1/f77pass1 "-P -cg87" x.f /tmp/f77pass1.16664.s.0.s /tmp/f77pass1.16664.i.1.s /tmp/f77pass1.16664.d.2.s
x.f:
	get_days:
"x.f", line 18: Error: attempt to use undefined variable "lu"
"x.f", line 18: Error: attempt to use undefined variable "typenum"
"x.f", line 18: Error: attempt to use undefined variable "filein"
"x.f", line 18: Error: attempt to use undefined variable "date"
"x.f", line 18: Error: attempt to use untyped function "lnblnk"
"x.f", line 18: Error: attempt to use untyped function "lnblnk"
"x.f", line 18: Error: attempt to use untyped function "lnblnk"
"x.f", line 18: Error: attempt to use untyped function "lnblnk"
"x.f", line 18: Error: attempt to use untyped function "lnblnk"
rm /tmp/f77pass1.16664.s.0.s
rm /tmp/f77pass1.16664.i.1.s
rm /tmp/f77pass1.16664.d.2.s
Compilation failed


Maybe fixing the declarations helps or setting -O1 to turn off optimization.


-- 
Michael Lemke
Astronomy, UT Austin, Texas
(michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
Newsgroups: comp.lang.fortran
From: dnl@convex.is.macsch.com (David Lombard)
Subject: Re: Fortran to C issues?
Organization: MacNeal-Schwendler Corp.
Date: Thu, 19 Nov 92 16:18:26 GMT

In article <1992Nov18.183132.16770@newshost.lanl.gov> jlg@cochiti.lanl.gov (J. Giles) writes:
>In article <1992Nov17.224350.26781@draco.macsch.com>, dnl@convex.is.macsch.com (David Lombard) writes:
>|> [...]
>|> Finally, and this will change with time, Fortran compiler writers have
>|> more experience in highly optimized code than do C compiler
>|> writers.  That's a temporary advantage at best.
>|> 
>|> On C's side, have you ever seen code which dealt with bitmaps, free
>|> memory chains, complicated structures and the like in Fortran?  Talk
>|> about terminally ugly and begging for coding errors!
>
>Yes, but this is a temporary problem - more temporary than the one you
>excused C for just now.  Fortran 90 has support for all this stuff.
>Most better implementations of Fortran have had *some* support for
>quite a while, but many vendors were waiting for the standard before
>committing themselves (an example of "cart before the horse" since
>the standard should be driven by common practice, not the other way
>around).
>

Fair comment!

Regards,
DNL

                 MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;

David N. Lombard    The first thing we do,         The MacNeal-Schwendler Corp
dnl@macsch.com      Let's kill all the lawyers.    815 Colorado Blvd
(213) 259-4911      II Henry VI, IV.ii             Los Angeles, CA  90041
From: rolfe@dsuvax.dsu.edu (Tim Rolfe)
Subject: Re: ... f77 code to do matrix mult,trans,inv operations
Organization: Dakota State University
Date: Fri, 20 Nov 1992 17:55:11 GMT

In <***> [name suppressed] writes

>multiply a matrix by a vector
>multiply two matrices
>invert a matrix
>transpose a matrix

Except for inverting a matrix, aren't the rest of these exercises typical
of introductory programming languages courses with a numerical bent, or at
very most a second-semester course?  Transpose is one line in a nested
double loop.  Matrix-dot-vector is a triple loop; in Fortran the matrix
multiply can be a single loop calling the matrix-dot-vector.

If anything more complicated is required, it isn't obvious from the post.
-- 
                                              --- Tim Rolfe
                                           rolfe@dsuvax.dsu.edu
                                            ROLFE@SDNET.BITNET
Newsgroups: comp.lang.fortran
From: jtbell@hubcap.clemson.edu (Jon Bell)
Subject: Re: Jumping from nested subroutine to main directly?
Organization: Presbyterian College, Clinton SC
Date: Sun, 22 Nov 1992 03:02:51 GMT

In article <1992Nov21.222705.20726@monu6.cc.monash.edu.au> map@hal.maths.monash.edu.au (Michael Page) writes:
>
>(Which also prompts me to ask why the ENTRY statement is so frowned upon 
>that it is now deprecated?  Is it superceded by something else?)
>
In situations where where several subroutines need to share the same data,
I think it's considered better form to do one of the following:

(a) Pass the data to each subroutine explicitly, as arguments; or, if this is
too clumsy or inefficient,

(b) Let the subroutines share the data via a well-documented COMMON block.

I understand that FORTRAN 90 allows you to group subroutines together into 
"modules" which share the same data.

In situations where two subroutines share much of the same code, it's considered
better form to split off the common code into a separate subroutine, or maybe
put it in an INCLUDE file if your compiler allows it.

Jon Bell / Dept. of Physics & Comp. Sci. / Presbyterian College / Clinton SC USA
From: walt@netcom.com (Walt Brainerd)
Newsgroups: comp.lang.fortran
Subject: Fortran standard in electronic from
Keywords: Fortran standard ISO 1539 ANSI
Date: 23 Nov 92 03:56:21 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest)

In accordance with an official agreement with
the International Standards Organization, Unicomp
is now able to distribute electronic versions of
the Fortran 90 standard: "ISO/IEC 1539 : 1991,
Information technology--Programming languages--Fortran".

The money received from this effort will go partly to
fund ISO activities and partly to recover the costs
incurred by Unicomp in preparing and typesetting the
standard document.  The prices are set by ISO.

The document can be obtained in three versions:

1.  An ascii version suitable for viewing on a
    computer terminal using any kind of editor.
    Cost: USD 125.

2.  A PostScript version with a license allowing
    the purchaser to print n paper copies.
    Cost: USD 125 + 10n.

3.  Complete source in ditroff with macros and
    software to extract and create the annexes.
    The source constitutes a fairly high level
    marked up document; for example, each program
    beginning and ending is marked and there
    are few low-level typographic commands such
    as size and font changes.  Cost USD 1000.

I am quite enthused especially about version (2).
If you want to have 10 copies for your organization,
and it costs $10 to make a printed copy, then the
cost to make the 10 copies would be $125 + $200,
or just $32.50 per copy, which is a substantial
savings over purchasing paper copies.

Versions (1) and (3) will be accompanied by a
license restricting use to one CPU and prohibiting
copying, except for backup purposes, etc.  The
version (2) license will prohibit distributing
any of the printed copies outside of the purchasing
organization.

If you have special requirements, such as wanting
to distribute a copy with each version of your compiler
or using the source as a part of your documentation,
we can make special arrangements, subject to the
approval of the ISO.  Please advise me of your
requirements and we can work up a proposal together.

ISO and Unicomp think this will provide the often
requested access to the standard in electronic form.
This is the first time this is being tried, so we hope
that organizations will be careful to observe the rules
and encourage the continued availability of this
and other standards in electronic form.

Payment can be made by Visa or MasterCard, or with
a check on a US Bank in US funds.  We will accept
a purchase order only if the amount is $500 or more.

[Keith: can you put some of this in the FAQ?]
-- 
Walt Brainerd                walt@netcom.com
Unicomp, Inc.                +1-415-949-4052
235 Mt. Hamilton Ave.        +1-415-949-4058 (fax)
Los Altos, CA 94022 USA      "F90--Fortran for the '90s"
Newsgroups: comp.lang.fortran
From: dschmidt@deci.cs.umn.edu (David Eric Schmidt)
Subject: Windows applications using MS Fortran v 5.10 on a 286 box.
Organization: University of Minnesota
Date: Tue, 17 Nov 1992 17:33:03 GMT


I have been unable to run an application for MS Windows compiled with
MS Fortran on my 286.  The manuals state that a 286 is OK, as is
Windows 3.1, which is what I'm running.  Following the example
in the manual, I compile one of the sample applications.  When
I run the application, I get a "General Protection Fault" error
from Windows.  I've tried calling MS support, but, in typical MS
fashion, they haven't deigned to return my calls. :-(

If anyone knows definitively if an application written for Windows
with MS Fortran will/won't work on a 286 processor with 4 Mb RAM,
please let me know via e-mail (dschmidt@mail.cs.umn.edu)

Thanks in advance,
Dave
Newsgroups: comp.lang.fortran
From: ctaylor@cs.uiuc.edu (Conrad W Taylor)
Subject: How does one return a logical value...???
Organization: University of Illinois at Urbana-Champaign
Date: Wed, 18 Nov 1992 10:52:22 GMT

         I have written a function which returns a logical
value, CheckActivity(previous, ROWS, COLS), previous is an
array.  I'm using it like this:

        IF (CheckActivity(previous, ROWS, COLS) .EQ.  .TRUE.) THEN
          uncontrol = uncontrol + 1
        ENDIF

My compiler says that I have mixed types when I use .TRUE. .  What
should I use I tried T instead of .TRUE. . It doesn't give errors
but it doesn't increment the uncontrol... it never goes into the
IF statement; skips it completely.  I'm new to FORTRAN and please
if anyone knows what I should do, let me know via e-mail.  Thanks
in advance to all that reply to my e-mail.

-Conrad


Newsgroups: comp.lang.fortran
From: kehcheng@netcom.com (Keh-Cheng Chu)
Subject: Re: Bessel Function Functions
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Thu, 19 Nov 1992 22:24:09 GMT

In article <1992Nov19.210449.22219@magnus.acs.ohio-state.edu> bilee@magnus.acs.ohio-state.edu (Billy Lee) writes:
>I'm trying to locate functions for integer order Bessel
>Functions of the first and second kinds and integer order
>Modified Bessel Functions of the first and second kinds for
>non-negative integer order and non-negative real argument.
>
>   J (x), Y (x), I (x), and K (x)
>    n      n      n          n
>
SPECFUN 2.5 has everything you need.  Send email to netlib@ornl.gov
containing the following two lines

	send index
	send index from specfun

to get info on how to retrieve them.
From: v087mxgb@ubvmsb.cc.buffalo.edu (somewhere over Buffalo)
Newsgroups: comp.lang.fortran
Subject: anyone have any f77 code to do matrix mult,trans,inv operations ???
Date: 20 Nov 92 01:27:00 GMT
Organization: University at Buffalo
News-Software: VAX/VMS VNEWS 1.41

Hi all,

I haven't had any luck finding PD stuff this simple, so here goes
a public begging:


does anyone have some *simple* subroutines coded to do the following
simple operations:


multiply a matrix by a vector
multiply two matrices
invert a matrix
transpose a matrix




TIA for any & all help



                             Shawn E. Thompson           
_______________________________________________________________________________
v087mxgb@ubvms.cc.buffalo.edu         |    Senior Engineer & Project Manager
set@autarch.acsu.buffalo.edu          |    Research & Development Department
SUNY @ Buffalo                        |    Optical Products Division       
Grad School of Mechanical Engineering |    Leica, Incorporated
-------------------------------------------------------------------------------
"These days the buck stops nowhere.....no-one takes the blame"    -- Don Henley
Newsgroups: comp.lang.fortran
From: vpillai@vms.ucc.okstate.edu
Subject: +*+*+*SYSTEM COMMANDS --FORTRAN +*+**+
Summary: +_+_+_ SYSTEM COMMANDS FROM FORTRAN+_+_
Reply-To: vpillai@vms.ucc.okstate.edu
Organization: Oklahoma State University Computer Center
Date: Fri, 20 Nov 1992 14:28:19 GMT

Hi
	I am a beginner in FORTRAN
	Can anybody tell me how to call system commands from a 

	FORTRAN program. like CLEAR SCREEN (cls)

	I am using VAX/VMS.

	Please mail to me.
	
	Thanking in advance

	VELU PILLAI. C

Newsgroups: comp.lang.fortran
From: pld@fc.hp.com (Paul_Dineen)
Subject: Re: Print characters on one line without newline...???
Organization: HP CLO/CoLL, Fort Collins, CO
X-Newsreader: TIN [version 1.1.4 PL6]
Date: Mon, 16 Nov 1992 22:35:38 GMT

Conrad W Taylor (ctaylor@cs.uiuc.edu) wrote:
:          I'm writting this PrintX routine that is to print
: the letter X n times on one line without any spaces and
: newline.

  On an HP9000:

        accept *, n
        write(*,'(A,$)') ('X',i=1,n)
        end

pld@hpfcpld:/users/pld/temp/
> a.out
47
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXpld@hpfcpld:/users/pld/temp/

 where the above line has no CR at the end (the pld... is my prompt).
 Reminder:  '$' is not an F77 standard feature.
Newsgroups: comp.lang.fortran
From: klassen@sol.UVic.CA (Melvin Klassen)
Subject: Re: anyone have any f77 code to do matrix mult,trans,inv operations ???
Organization: University of Victoria, Victoria, B.C. CANADA
Date: Sat, 21 Nov 92 01:18:49 GMT

Shawn Thompson (somewhere over Buffalo) <v087mxgb@ubvmsb.cc.buffalo.edu> writes:
> I haven't had any luck finding PD stuff this simple, so ... Does anyone 
> have some *simple* subroutines coded to do the following simple operations:
>    multiply a matrix by a vector
>    multiply two matrices
>    invert a matrix
>    transpose a matrix

Send E-mail to 'netlib@RESEARCH.ATT.COM', 
and put the text 'send index from linpack' into the "Subject:" line.

The 'LINPACK' and the 'LAPACK' directories contain **much** high-quality
linear-algebra software.
Newsgroups: comp.lang.fortran
From: lfm@pgroup.com (Larry Meadows)
Subject: Re: ENTRY in main (was re: Jumping from nested subroutine)
Date: Mon, 23 Nov 1992 14:26:53 GMT
Organization: The Portland Group, Portland, OR

Well, I can't resist...

What the original poster wants is called non-local GOTO in pascal, and
setjmp/longjmp in C.  In either case, the return stack is unwound to
the invocation record of the function to which control is being returned.
In pascal this is the function containing the label to which control
is being transferred; in C, it is the function that called setjmp.

Ordinarily, unwinding the stack consists of restoring the stack pointer,
possibly the frame pointer; then, control transfer is performed by loading
the program counter (i.e., performing an indirect branch).  Machines
with register windows are more complicated; I'm sure someone can tell us
exactly how it is done on the Sparc.

So, anyway, it should be possible to call setjmp and longjmp from fortran,
assuming they exist on the original poster's system.  Problem is, they
would need fortran entry points, since wrapping a C function around
the original setjmp/longjmp won't work (setjmp must be called from the
function to which control is to return, then that function must not return
before longjmp is called).  If fortran entry point's don't exist, I'd
be inclined to hack the object to create them.

Of course, the ability to do all this is entirely system dependent.

Good luck.
-- 
Larry Meadows		The Portland Group
lfm@pgroup.com
Newsgroups: comp.lang.fortran
Subject: Re: passing a string constant to a subroutine
From: dvalent@husc8.harvard.edu (Daniel Valentine)
Date: 20 Nov 92 18:18:36 GMT

ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:

>When I want to pass a string constant to a subroutine, what size do I
>declare the character variable to be in the subprogram. For example
>I have a subroutine:

>      subroutine ask_data_type(prog, typenum)

>This is intended to be called from one of several programs, and the
>program name is to be passed in as the first parameter. Inside the
>subroutine I have:
>      character*20 prog

>And when I called if from program atob.f this is what the call looked
>like:
>	call ask_data_type('atob',typenum)

>I assumed that it would put 'atob' in prog and blank fill the rest.
>What it did instead was fill the rest with grabage, not blanks.

Because you declared the string as character*20 in the subroutine, the
subroutine took the address of the string from the descriptor you passed
and assumed that the 20 bytes starting there were your string. (FORTRAN
tends to pass addresses and descriptors rather than creating new copies
of data on the stack.)

If you want to be able to pass variable length strings to your subroutine,
make a declaration like:
        character*(*) prog,
which will take the length from the descriptor as well.

                               -- Dan Valentine
                                  dvalent@husc.harvard.edu
From: llew@bigwpi.WPI.EDU (Lok C. Lew Yan Voon)
Newsgroups: comp.lang.fortran
Subject: the difference b/w cdexp and zexp?
Date: 22 Nov 92 18:11:32 GMT
Organization: Worcester Polytechnic Institute
NNTP-Posting-Host: bigwpi.wpi.edu



i don't have any fortran manuals.
can someone remind me of the difference b/w the 'z' and 'cd' form
of functions like exp or abs?
can one replace 'c' for 'cd'?

lok
Newsgroups: comp.lang.fortran
From: jlg@cochiti.lanl.gov (J. Giles)
Subject: Re: Logical operators and operands
Organization: Los Alamos National Laboratory
Date: Thu, 19 Nov 1992 20:07:31 GMT

In article <30502@nntp_server.ems.cdc.com>, mstemper@ems.cdc.com (Michael Stemper) writes:
|> [...]
|> This seems dumb! Why shouldn't the operators for equality and
|> inequality be the same, no matter what type of operands are
|> used? It seems to me that this is poor language design. Can
|> somebody come up with a plausible excuse for this? Is it:
|>  a) Tradition
|>  b) History
|>  c) Easier to optimize compilers
|>  d) Grandfathered in

I agree that it's dumb.  I think I can say *why* it was done.  There
are a number of relations defined in the predecate calculus like
equivalence, implication, AND, OR, NOT, etc..  These have inherently 
lower precedence than the relational operations on numeric types so
that such relational expressions can be used as operands to the 
predecate calculus operations.  However, this is a fairly weak
connection since LOGICAL expressions are not predecate calculus:
they don't define relationships between assertions but merely 
values.  For example, if I say that assertion A is equivalent
to assertion B, that means that they *always* have identical 
meaning.  Whereas, the Fortran .EQV. operator can only tell
you whether the expressions corresponding to the two assertions
presently evaluate to the same truth-value.  That's quite a
difference.

In any case, as long as we've got .EQV. and .NEQV. in the
language, why not add .IMPLIES. as well?  I need it rather
more often than the others.

-- 
J. Giles
Newsgroups: comp.lang.fortran
From: mai@neit.cgd.ucar.edu (Andrew Mai)
Subject: Re: Print characters on one line without newline...???
Organization: Climate and Global Dynamics Division/NCAR, Boulder, CO
Date: Mon, 16 Nov 1992 20:31:56 GMT

In article <BxtnK6.23s@cs.uiuc.edu> ctaylor@cs.uiuc.edu
(Conrad W Taylor) writes:
>
>         I'm writting this PrintX routine that is to print
> the letter X n times on one line without any spaces and
> newline.

The following does what you want and is written in ANSI standard FORTRAN 77.

      program test
      call printx(15)
      call printx(80)
      end
      subroutine printx(xcount)
c
c  Print a space, then xcount X's with a newline at the end
c
      integer xcount,nd
      character*16 form1,form2
      write(form1,fmt='(a,i1,a)') '(a,i',nd(xcount),',a)'
      write(form2,fmt=form1) '(1x,',xcount,'(''X''))'
      write(6,form2)
      return
      end
      function nd(k)
c
c  Returns the number of digits in k (plus one for the
c  minus sign if k is negative)
c
      integer nd,k,l
      nd=1
      l=abs(k)
    1 if (l.lt.10) goto 2
      nd=nd+1
      l=l/10
      goto 1
    2 if (k.lt.0) nd=nd+1
      return
      end

OUTPUT:
 XXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


I don't know an easier way to do this in standard FORTRAN, but someone will
probably show you.

Andy Mai
mai@ncar.ucar.edu
Newsgroups: comp.lang.fortran
From: jlg@cochiti.lanl.gov (J. Giles)
Subject: Re: Fortran to C issues?
Organization: Los Alamos National Laboratory
Date: Wed, 18 Nov 1992 18:31:32 GMT

In article <1992Nov17.224350.26781@draco.macsch.com>, dnl@convex.is.macsch.com (David Lombard) writes:
|> [...]
|> Finally, and this will change with time, Fortran compiler writers have
|> more experience in highly optimized code than do C compiler
|> writers.  That's a temporary advantage at best.
|> 
|> On C's side, have you ever seen code which dealt with bitmaps, free
|> memory chains, complicated structures and the like in Fortran?  Talk
|> about terminally ugly and begging for coding errors!

Yes, but this is a temporary problem - more temporary than the one you
excused C for just now.  Fortran 90 has support for all this stuff.
Most better implementations of Fortran have had *some* support for
quite a while, but many vendors were waiting for the standard before
committing themselves (an example of "cart before the horse" since
the standard should be driven by common practice, not the other way
around).

-- 
J. Giles
Newsgroups: comp.lang.fortran