Hello Anthony and others
I think that the reason why it croaks on DVF is because loc should be
dimensioned from 0, not from 1. If you change line 9 of input.f90, then it
works fine with both DVF and Intel Fortran. The vector loc is indexed by
item, and item has legitimate values >=0. The alternative is to add code to
report to deal with the case that nitems and item are zero.
INTEGER, SAVE :: item=0, nitems=0, loc(0:80)=0, end(80)=0, &
^^
IMHO, it is a good idea to avoid the use of names which are generally
associated with standard functions (eg char) or near standard function (eg
loc).
Having said all that, I think that Anthony has done a good job here and this
is a good example of both doing character handling in Fortran 90/95, and
packaging functionality into a module, so that it is easy to use.
Alistair
-----Original Message-----
From: Fortran 90 List [mailto:[log in to unmask]] On Behalf Of
Anthony Stone
Sent: 08 March 2003 10:44
To: [log in to unmask]
Subject: Re: F90 parsing routines
Curious what a different compiler will throw up. Everything is as expected
up to and including the "Unexpected end of data file" message, but the
routine is then supposed to show you the input line that provoked the error
(deliberately, in this case):
Input line 20
Concatenation at en ...
*
FORTRAN STOP
This works for me with two different compilers. It looks as if the variable
"level" has been corrupted in your case.
At 06:48 on 8 March, Alistair Mills wrote:
> Hello
>
> I have downloaded and tried the code offered by Anthony.
>
> I found that when I ran the test program, all was well until the end. I
got > the following. Is this what is expected? > > Alistair > > PS
Using DVF 6.6.1 > > --- s n i p ---- > > Rotation through 90 about 1 1 1
> Rotating though 90.00 deg about 1.00 1.00 1.00
> Rotation 90 90 90
> Euler angle rotation 90.00 90.00 90.00 deg.
>
>
> Concatenation at end is an error \
> Apparently concatenating at end-of-file
> Unexpected end of data file
> forrtl: severe (161): Program Exception - array bounds exceeded
> Image PC Routine Line Source
> nml.exe 00404017 INPUT_mp_REPORT 717 input.f90
> nml.exe 00401353 INPUT_mp_READ_LIN 163 input.f90
> nml.exe 00404762 TEST_INPUT 15
test_input.f90
> nml.exe 0044D759 Unknown Unknown Unknown
> nml.exe 00436B29 Unknown Unknown Unknown
> kernel32.dll 77E814C7 Unknown Unknown Unknown
> Press any key to continue
>
> --- e n d s n i p ---
--
Anthony Stone http://www-stone.ch.cam.ac.uk/
University Chemical Laboratory, Email: [log in to unmask]
Lensfield Road, Phone: +44 1223 336375
Cambridge CB2 1EW Fax: +44 1223 336362
|