https://github.com/anowacki/fortranreader.jl

https://github.com/anowacki/fortranreader.jl

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: anowacki
  • License: mit
  • Language: Julia
  • Default Branch: master
  • Homepage:
  • Size: 4.88 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 5 years ago · Last pushed over 5 years ago
Metadata Files
Readme License

README.md

FortranReader

Introduction

FortranReader.jl provides basic commands to read the 'unformatted' files written by Fortran programs using Julia.

Although not technically portable, most Fortran programs write these files in a predictable way, in 'records'. Each record contains either one or several variables, marked before and after with the length of the variable(s) in bytes. This marker is written as a 4-byte integer.

This package is a simple module to fulfil a narrow purpose and comes without tests or any guarantee of future updates. See the section on alternatives below for better options for new projects.

Installation

julia julia> import Pkg; Pkg.add(url="https://github.com/anowacki/FortranReader.jl")

Using the package

Three functions are exported: - read_record - skip_record - write_record

Each is passed an IO object and will read, skip or write a single Fortran record. The user must pass the type of the record and the dimensions of the array being read/written if not a scalar.

Example

Read a rank-2 array of reals in the fourth record of a Gfortran unformatted Fortran binary file into data. The first and second records contains the dimensions of the array and are read as a scalars, passing no dimensions. We do not need the third record and so skip over it.

julia data = open("file") do io m = read_record(io, Int) n = read_record(io, Int) skip_record(io) read_record(io, Float32, m, n) end

Alternatives

  • FortranFiles.jl is maintained and tested, comes with documentation, and should be used instead of this package for new projects.

Contributions

Bug reports are welcome via GitHub issues but no guarantee is given that they will be fixed, though if accompanied with a pull request fixing a bug, I will do my best to merge it in.

Feature requests will not be acted upon.

Owner

  • Name: Andy Nowacki
  • Login: anowacki
  • Kind: user

Lecturer at the School of Earth and Environment, University of Leeds, studying the Earth's deep interior.

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels