Input via OPEN(5,file='..') 
Author Message
 Input via OPEN(5,file='..')

Dear News Reader,

Can anyone help me with the following source code ported to G77, it works
well with the Lahey
compiler under MS-DOS.

 ?????PROGRAM Len0
?????IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C-----DIMENSIONING OF ARRAYS
?????DIMENSION X(1500),T(1500),TT(1500),G(1)

?????OPEN(5,file='len')
C-----READ IN USER SPECIFIED PARAMATERS

 ?????read(5,1000) a,b,c,d,e,f

1000 ?format(6i4)

etc. etc.

This file Len0.for is compiled with G77 -o Len0 len0.o -lm
and gives the following comment after running it.

Viper:/usr/src/length# len0
invalid number: incomprehensible list input
apparent state: unit 5 named len
last format: list io
lately reading sequential formatted external IO
IOT trap/Abort

Thanks in Advance

--
Rinse Meijer
Children's Endocrinology
Beatrix's Children Hospital
University Hospital Groningen
The Netherlands




Thu, 11 Feb 1999 03:00:00 GMT  
 Input via OPEN(5,file='..')

   Can anyone help me with the following source code ported to G77, it works
   well with the Lahey
   compiler under MS-DOS.

    ?????PROGRAM Len0
   ?????IMPLICIT DOUBLE PRECISION (A-H,O-Z)
   C-----DIMENSIONING OF ARRAYS
   ?????DIMENSION X(1500),T(1500),TT(1500),G(1)

   ?????OPEN(5,file='len')
   C-----READ IN USER SPECIFIED PARAMATERS

    ?????read(5,1000) a,b,c,d,e,f

   1000 ?format(6i4)

   etc. etc.

   This file Len0.for is compiled with G77 -o Len0 len0.o -lm
   and gives the following comment after running it.

   Viper:/usr/src/length# len0
   invalid number: incomprehensible list input
   apparent state: unit 5 named len
   last format: list io
   lately reading sequential formatted external IO
   IOT trap/Abort

I note that your source code didn't well survive the translation
onto USENET -- on my Emacs screen, many of the spaces show up
as "\240" meaning bit 7 (the high bit of an 8-bit character)
is on, but that seems to happen only where the original file
might have had tabs.

It is possible you are running into a problem because of a
difference in the way text files are stored by your MS-DOS
tools and read by the libf2c library shipped with g77.

You might look into various ways of translating these files.

Meanwhile, since you didn't show the contents of the "len"
file, none of us know for sure why libf2c said "incomprehensible
list input".

If you want to learn for this yourself, in the source code for
g77, look for the error message.  It's likely to be in the
directory g77-0.5.18/f/runtime/libI77 somewhere, probably in a
.c file, though the top-level directory should really be named
gcc-2.7.2 or something like that if you're done the build yourself
from scratch.

Once you learn to poke around in the code itself, you take a big
step learning how to cope with the lack of adequate documentation
of diagnostics throughout g77 (and other software in general, but
I can fix only g77 in the near future ;-).
--

"Practice random senselessness and act kind of beautiful."



Fri, 12 Feb 1999 03:00:00 GMT  
 Input via OPEN(5,file='..')

Quote:


>    Can anyone help me with the following source code ported to G77, it > works well with the Lahey compiler under MS-DOS.

>         PROGRAM Len0
>         IMPLICIT DOUBLE PRECISION (A-H,O-Z)
...
>         read(5,1000) a,b,c,d,e,f
>   1000  format(6i4)

---

Quote:
>    Viper:/usr/src/length# len0
>    invalid number: incomprehensible list input
>    apparent state: unit 5 named len
>    last format: list io
>    lately reading sequential formatted external IO
>    IOT trap/Abort

Is this a format/variable mismatch which Lahey handles OK?
Are a,b,c,d,e and f integers ?

BTW are there compilers or static code analyzers that check this ?
(AFAIK, DEC and SUN compilers, FTNCHEK and IPT FLINT all miss this.)

I know checking can not be done in general (e.g. because the format
might be a variable string) but I have often had to wait for a runtime
error - usually in an rarely-executed section of code ;-)  before
detecting an error which is self-evident in the code.



Fri, 12 Feb 1999 03:00:00 GMT  
 Input via OPEN(5,file='..')

|>>         read(5,1000) a,b,c,d,e,f
|>>   1000  format(6i4)
|>
|>BTW are there compilers or static code analyzers that check this ?
|>(AFAIK, DEC and SUN compilers, FTNCHEK and IPT FLINT all miss this.)
|>
|>I know checking can not be done in general (e.g. because the format
|>might be a variable string) but I have often had to wait for a runtime
|>error - usually in an rarely-executed section of code ;-)  before
|>detecting an error which is self-evident in the code.

Interactions between formats and I/O lists is complex, and a static
analyzer would have a hard time doing even a half-way reasonable job of
correlating the items.  My philosophy is that if you can't catch the
majority of the cases, it's not worth the (significant in this case)
effort to catch any of them.

Also, some implementations (such as Digital's) allow you to disable the
run-time error check - sometimes even through a run-time call.

--


fortran Development               http://www.digital.com/info/slionel.html
Digital Equipment Corporation    
110 Spit Brook Road, ZKO2-3/N30    
Nashua, NH 03062-2698             "Free advice is worth every cent"

For information on Digital Fortran, see http://www.digital.com/info/hpc/fortran/



Sat, 13 Feb 1999 03:00:00 GMT  
 Input via OPEN(5,file='..')



Quote:
>Dear News Reader,

>Can anyone help me with the following source code ported to G77, it works
>well with the Lahey compiler under MS-DOS.

>      PROGRAM Len0
>      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
> <snip>
> ?????read(5,1000) a,b,c,d,e,f
>1000 ?format(6i4)
> <snip>
>IOT trap/Abort
> <snip>

Reading real or double precision with an integer format gives error
with most compilers.

Use format(6f4.0) (or read(5,*) if the numbers are blank or comma
separated in the file) and your problem is solved.

Good luck, Kurt


Department of Building Science, LTH, Lund University, Sweden
<Speaking for myself, not the department, nor ...>



Sat, 13 Feb 1999 03:00:00 GMT  
 Input via OPEN(5,file='..')


Quote:
> Can anyone help me with the following source code ported to G77, it works
> well with the Lahey
> compiler under MS-DOS.
>  =A0=A0=A0=A0=A0PROGRAM Len0
> =A0=A0=A0=A0=A0IMPLICIT DOUBLE PRECISION (A-H,O-Z)
> C-----DIMENSIONING OF ARRAYS
> =A0=A0=A0=A0=A0DIMENSION X(1500),T(1500),TT(1500),G(1)
> =A0=A0=A0=A0=A0OPEN(5,file=3D'len')
> C-----READ IN USER SPECIFIED PARAMATERS
>  =A0=A0=A0=A0=A0read(5,1000) a,b,c,d,e,f
> 1000 =A0format(6i4)
>=20
> This file Len0.for is compiled with G77 -o Len0 len0.o -lm
> and gives the following comment after running it.
>=20
> Viper:/usr/src/length# len0
> invalid number: incomprehensible list input
> apparent state: unit 5 named len
> last format: list io
> lately reading sequential formatted external IO
> IOT trap/Abort
>=20

=09Try changing the input format to floating. I think something
like 6F10.4 should work. It doesn't seem too important what the
format is as long as you separate the input by commas. I have found
that G77 error handling leaves much to be desired. It looks like you
are running G77 on unix like I am. I think unix contributes a lot
to the confusion. I hate unix. For example this idiotic news system
that insists that I post more text than what I include from the
original posting. What a waste of time and bandwidth.

=09T.N. Dentel

=09Biology Dept.
=09Bloomsburg University
****************************************************************
=09I believe I've found the missing link between
=09animal and civilized man. It is us.
=09=09=09 =09 Konrad Lorenz
****************************************************************



Mon, 15 Feb 1999 03:00:00 GMT  
 Input via OPEN(5,file='..')

: Dear News Reader,

: Can anyone help me with the following source code ported to G77, it works
: well with the Lahey
: compiler under MS-DOS.

:  ?????PROGRAM Len0
: ?????IMPLICIT DOUBLE PRECISION (A-H,O-Z)
: C-----DIMENSIONING OF ARRAYS
: ?????DIMENSION X(1500),T(1500),TT(1500),G(1)

: ?????OPEN(5,file='len')
: C-----READ IN USER SPECIFIED PARAMATERS

:  ?????read(5,1000) a,b,c,d,e,f

: 1000 ?format(6i4)

: etc. etc.

: This file Len0.for is compiled with G77 -o Len0 len0.o -lm
: and gives the following comment after running it.

: Viper:/usr/src/length# len0
: invalid number: incomprehensible list input
: apparent state: unit 5 named len
: last format: list io
: lately reading sequential formatted external IO
: IOT trap/Abort

I don't like the fact that you are attaching the file to unit 5, this is
traditionally the standard input in Unix and g77 might get confused.
Anyway changing it to 10, say, and recompiling is a quick and simple test.

: Thanks in Advance

: --
: Rinse Meijer
: Children's Endocrinology
: Beatrix's Children Hospital
: University Hospital Groningen
: The Netherlands


Zeb.
--
__________________________________________________________________________
Zebedee Mason          TFMRC, School of Engineering, University of Sussex,
                       Falmer, Brighton, BN1 9QT, United Kingdom.



Fri, 19 Feb 1999 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. opening 'file open' dialog from console

2. 'old' status input file

3. Intellimouse Returns 'File Not Open'

4. cannot open include file 'param.inc'

5. Opening a file with ACTION='READ'

6. file = open(path,'wb')?????

7. Used to 'file = open(...)', now what?

8. Used to 'file = open(...)', now what?

9. open command doesn't work via button

10. stream('file','c','seek ='x) problem

11. upload file via web form (Re: to Trent Mick's posting)

12. Logo and Literacy (via 'Slow Learners')

 

 
Powered by phpBB® Forum Software