Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 680969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:25:54+00:00 2026-05-14T01:25:54+00:00

I am trying to read some smps files with python, and found a fortran

  • 0

I am trying to read some smps files with python, and found a fortran implementation, so I thought I would give f2py a shot. The problem is that I have no experience with fortran.

I have successfully installed gfortran and f2py on my Linux box and ran the example on thew f2py page, but I have some trouble compiling and running the large program. There are two files, one with a file reader wrapper and one with all the logic. They seem to call each other, but when I compile and link or try f2py, I get errors that they somehow can’t find each other:

f95 -c FILEWR~1.F
f95 -c SMPSREAD.F90 
f95 -o smpsread SMPSREAD.o FILEWR~1.o 

FILEWR~1.o In function `file_wrapper_'
FILEWR~1.F(.text+0x3d) undefined reference to `chopen_'
usrlibgcci486-linux-gnu4.4.1libgfortranbegin.a(fmain.o) In function `main'
(.text+0x27) undefined reference to `MAIN__'
collect2 ld returned 1 exit status  

I also tried changing the name to FILE_WRAPPER.F but that did not help.

With f2py I found out I had to include a comment to get it to accept free format, and saved this as a new file and tried:

f2py -c -m smpsread smpsread.f90

I get a lot of output and warnings, but the error seems to be this one:

getctype: No C-type found in "{'typespec': 'type', 'attrspec': ['allocatable'],  'typename': 'node', 'dimension': [':']}", assuming void.

The fortran 90 spms reader can be found here.

Any help or suggestions appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:25:54+00:00Added an answer on May 14, 2026 at 1:25 am

    I would suggest skipping the fortran business altogether.

    http://myweb.dal.ca/gassmann/smps2.htm

    The MPS record layout is described here, and looks relatively simple to pick apart in Python.

    http://myweb.dal.ca/gassmann/smps2.htm#CoreMPSline

    You’ll have to define appropriate Python classes (or namedtuples) for all of the data anyway.

    I don’t think the Fortran is helping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting something pretty strange going on when trying to read some data using
I'm currently trying to read in an XML file, make some minor changes (alter
I'm trying to read through the documentation on Berkeley DB XML , and I
I'm trying to read a .doc file into a database so that I can
I am trying to read a single file from a java.util.zip.ZipInputStream , and copy
I am trying to read ASCII text response from a tcp open streaming socket
I am trying to read an Http response stream twice via the following: HttpWebResponse
I'm trying to read a file to produce a DOM Document, but the file
I have been trying to read a picture saved in Access DB as a
I am trying to read an XML-file from another server. However the the company

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.