OpenMDAO / OpenMDAO/Aviary

Fortran-to-Aviary refactor

Open
#1,162 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
287
Forks
140
Avg merge
6d 14h
Merged PRs (30d)
18

Description

Desired capability or behavior.

fortran_to_aviary needs to be refactored for cleaner organization and accuracy.

Suggested implementation.

The utility should have the following distinct steps:

  1. Read in Fortran file into data structure that captures variable path (namelist.name), value, and possibly units. The data structure defaults to values stored in the legacy defaults files - if we want to get fancy, we can check this against the Aviary metadata and only include these values if the metadata default is different than the legacy tool's
  2. Convert Fortran names to Aviary names. Separate out list of "unconverted" variables.
  3. Run rules on variables. Have separate functions for processing FLOPS or GASP options. This step should have extremely detailed comments. Every single rule applied needs to explain what is being done and reference where in the legacy code this is from. For example, in FLOPS each rule can point to the line in the manual where the variable behavior is described. Rules that apply to large numbers of variables should create a list of variables the rule is applicable to and loop through and apply the rule to each one - this makes it easy to extend/modify the behavior in the future. The comments for the "batch" of rules can point to a single instance in the manual where the rule is explained. Ideally each entry in the variable list should point to the line in the manual where the behavior is described.
  4. Write the csv output file - this step will probably be largely unchanged from its current form

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the existing fortran_to_aviary utility and trace how it currently reads variables, converts names, applies rules, and writes CSV output. Refactor it into the four proposed stages, including separate FLOPS and GASP processing with detailed legacy-code references; done means the output remains correct and unconverted variables are reported separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, python
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.