JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for COMP-FORTRAN-90 Archives


COMP-FORTRAN-90 Archives

COMP-FORTRAN-90 Archives


COMP-FORTRAN-90@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

COMP-FORTRAN-90 Home

COMP-FORTRAN-90 Home

COMP-FORTRAN-90  2006

COMP-FORTRAN-90 2006

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: End of file errors using intrinsic function INDEX (3)

From:

"Rowles, Steve CIV G25" <[log in to unmask]>

Reply-To:

Fortran 90 List <[log in to unmask]>

Date:

Wed, 29 Mar 2006 10:19:12 -0500

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (243 lines)

Lewis,

The operation,

DO WHILE (INDEX(STRING,'Connectivity').EQ.3
     & 		  .OR.INDEX(STRING,'domain').EQ.6
     &            .OR.INDEX(STRING,'domain').EQ.7)

causes the program to fail because of logic contained in the do-while
loop that is not able to specify the correct columns of data for those
lines that have a four-digit line number (1000 or greater).  If the
"INDEX(STRING,'domain').EQ.7" test is not included, then those lines are
simply not processed by the loop and the error is avoided.  For example,
it appears that the line,
	    READ(STRING(13:NLEN-1),*) BLKSRC

expects the period after "domain" to be in column 12, but with a
four-digit line number, that period will be in column 13 (according to
your input file sample), causing an error in the read, assuming that
BLKSRC is an integer.

In this situation, I tend to use unformatted reads as much as possible
and without trying to specify the individual column location of each
value.  For example, you could isolate the part of STRING that contains
the values that you want to read in and then read that portion of STRING
with an unformatted read.  Something like:

position = index(STRING," f ",back=.true.)
if(position.ne.0)then
  read(STRING(position+3:),*) BEG(1),BEG(2),BEG(3),END(1),END(2),END(3)
endif

Steve Rowles
Naval Surface Warfare Center
Dahlgren VA


-----Original Message-----
From: Fortran 90 List [mailto:[log in to unmask]] On Behalf
Of Lewis Balfour
Sent: Wednesday, March 29, 2006 5:27 AM
To: [log in to unmask]
Subject: Re: End of file errors using intrinsic function INDEX (3)


Hi

Ok, a little more information about my problem.  I am converting a
multiblock structred mesh from an ICEMCFD format (MULTIBLOCK-INFO) to a
format used for an in-house code DELTA.  The original conversion routine
was not written by me, but works perfectly in most circumstances, and
converts the grid topology from the ICEM format to that required by
DELTA.

The mesh I wish to use is a stuctured grid with 50 blocks and
approximately 1.5 million cells.  The topology file outputted by ICEM is
approximately 7000 lines long.  The problem with my conversion routine
is that it assumes that there will be less than 1000 connectivities
between the blocks i.e. the mesh has less then approximately 25 blocks.
The lines in the code as follows

DO WHILE (INDEX(STRING,'Connectivity').EQ.3
      & .OR.INDEX(STRING,'domain').EQ.6)

decide the types of operation that are performed on the file.  If this
is not the case the operations on the block dimensions or boundary
conditions are performed.  If there are more than 999 connectivties then
the Fortran routine does not 'see' the extra connectivites and moves
onto the next part of the routine.

# Connectivity for domain.16
967  domain.16  -j k-i  	f      33      1      1      1    122
1
967  domain.18  -j k i  	f      33      1     25      1    122
25
968  domain.16   k i-j  	f       1      1      1    122     17
1
968  domain.17   k i j  	f       1     13     12    122     29
12
969  domain.16   k i j  	f       1      1     33    122     17
33
969  domain.15   k i-j  	f       1     13      1    122     29
1
970  domain.16   i-j-k  	f       1     33      1     17      1
1
970  domain.9  	 i-j k  	f       1     33     15     17      1
15
<snip>
991  domain.16   i j k  	e       1     33    122     17     33
122
991  domain.22   i-j-k  	e      13      1      1     29      1
1
992  domain.16   i j k  	e       1     33    122     17     33
122
992  domain.23   i j-k  	e       1     33      1     17     33
1
993  domain.16   i j k  	e       1     33    122     17     33
122
993  domain.15   i-j k  	e      13      1    122     29      1
122
994  domain.16  -j i-k  	e      33     17      1     24     17
1
994  domain.9  	-j i k  	e      33     17     15     24     17
15
995  domain.16  -j i-k  	e      24     17      1     10     17
1
995  domain.47  -j-i k  	e      15      1     15      1      1
15
996  domain.16  -j i-k  	e      24     17      1     10     17
1
996  domain.9  	-j i k  	e      24     17     15     10     17
15
997  domain.16  -j i-k  	e      10     17      1      1     17
1
997  domain.9  	-j i k  	e      10     17     15      1     17
15
998  domain.16   k-j i  	e       1      1     17     52      1
17
998  domain.17   k j i  	e       1     12     29     52     12
29
999  domain.16   k-j i  	e      52      1     17     94      1
17
999  domain.17   k j i  	e      52     12     29     94     12
29
1000  domain.16   k-j i  	e      94      1     17    122      1
17
1000  domain.17   k j i  	e      94     12     29    122     12
29
1001  domain.16   i-j k  	e       1      1    122     17      1
122
1001  domain.24   i j-k  	e      13     12      1     29     12
1
1002  domain.16   i-j k  	e       1      1    122     17      1
122
1002  domain.23   i-j-k  	e       1      1      1     17      1
1
1003  domain.16   i-j k  	e       1      1    122     17      1
122
1003  domain.17   i j k  	e      13     12    122     29     12
122
1004  domain.16  -j i k  	e      33     17    122     24     17
122
1004  domain.23  -j i-k  	e      33     17      1     24     17
1
1005  domain.16  -j i k  	e      24     17    122     10     17
122
1005  domain.23  -j i-k  	e      24     17      1     10     17
1
1006  domain.16  -j i k  	e      10     17    122      1     17
122
1006  domain.23  -j i-k  	e      10     17      1      1     17
1
1007  domain.16   i j k  	v       1     33      1      1     33
1
1007  domain.8  	 i j k  	v      13      1     15     13
1     15
1008  domain.16   i j k  	v       1     33      1      1     33
1
1008  domain.9  	 i j k  	v       1     33     15      1
33     15
1009  domain.16   i j k  	v       1     33      1      1     33
1
1009  domain.11   i j k  	v      25     33     15     25     33
15
1010  domain.16   i j k  	v       1     33      1      1     33
1
<snip>
1041  domain.16   i j k  	v      17      1    122     17      1
122
1041  domain.24   i j k  	v      29     12      1     29     12
1
1042  domain.16   i j k  	v      17     24    122     17     24
122
1042  domain.23   i j k  	v      17     24      1     17     24
1

# Connectivity for domain.17
1043  domain.17   j k-i  	f       1      1      1     12    122
1

etc.

Here is the Majority of the routine

<snipped>

The EXTERNALS are routines that return values such as 0 or 1 depending
on the existance or otherwise of files.

In Summary. The file is opened as unit u1

u1=fortOpen(infofile, format, status )

Then a line is read in

READ (u1,'(A88)') STRING

Then operations are performed on it.


I'd like to re-emphasise that the routine works perfectly where the
number of connectivities are less than 1000.  Other parts of the routine
need re-writing eg the line

READ (STRING(29:34),*) BEG(1)

Will probably need to be adjusted to be

READ (STRING(30:35),*) BEG(1)

But the original question stands: why does the operation

DO WHILE (INDEX(STRING,'Connectivity').EQ.3
     & 		  .OR.INDEX(STRING,'domain').EQ.6
     &            .OR.INDEX(STRING,'domain').EQ.7)

fail?  The error given

Input/Output Error 153: Input file ended

   In Procedure: topobcwrite
        At Line: 249

      Statement: List-Directed READ
           Unit: Internal File
  Record Number: Floating point exception

Suggests that the file has ended, but there are approximately 4000 lines
remaining.  And line 249 in the code is the DO WHILE statement, not a
read. The string read in has 88 spaces, wheras the longest line is 84
characters long.

Many thanks

Lewis

*****************************************
l.j.balfour at lboro.ac.uk
Research Student
Rolls-Royce UTC in Combustor Aerodynamics
Loughborough University
*****************************************

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

December 2023
February 2023
November 2022
September 2022
February 2022
January 2022
June 2021
November 2020
September 2020
June 2020
May 2020
April 2020
December 2019
October 2019
September 2019
March 2019
February 2019
January 2019
November 2018
October 2018
September 2018
August 2018
July 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
December 2015
November 2015
October 2015
September 2015
August 2015
June 2015
April 2015
March 2015
January 2015
December 2014
November 2014
October 2014
August 2014
July 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
July 2013
June 2013
May 2013
April 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
August 2010
July 2010
June 2010
March 2010
February 2010
January 2010
December 2009
October 2009
August 2009
July 2009
June 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager