Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I'm running a subroutine in Fortran and I need to open a data file, i use this statement: OPEN(unit=101,file='sdvh.inp',status='old',iostat= nopath) READ(101,*) ((SDVH(I,J),J=1,NCOL),I=1,NELEMH*NGPH) CLOSE(unit=101,status='keep') And I keep having a iostat=29, ...
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    1

    Unhappy Iostat 29 fortran error

    Hi, I'm running a subroutine in Fortran and I need to open a data file, i use this statement:

    OPEN(unit=101,file='sdvh.inp',status='old',iostat= nopath)
    READ(101,*) ((SDVH(I,J),J=1,NCOL),I=1,NELEMH*NGPH)
    CLOSE(unit=101,status='keep')

    And I keep having a iostat=29, can anybody tell me why? The file is in the same directory as the program and if I run this subroutine in Fortran in Windows I don't have any problem.

    Thanks for your help.

    Soledad

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.

    Welcome to the forums.

    I wrote a complete program incorporating your excerpt, created a small dataset, then compiled and ran it on Debian Sarge with f77/g77 (3.3.5), and also on Debian Lenny with gfortran (4.3.2).

    It failed on Sarge until I changed the unit number from "101" to "9" (with the help of an error message). It worked without changes on Lenny.

    In order to get more responses (say for future questions), I suggest you post the smallest complete example of a program, along with a minimal dataset. Noting your infrastructure would also be useful -- OS and versions of compilers, etc. That will allow responders to concentrate on solving your problem, rather than constructing a framework within which to test your code.

    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...