llnl / llnl/UEDGE

Remove multiple redefinitions of variables when reading equilibrium files?

Open
#45 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Fortran
Stars
56
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Some of the parameters defined in the EFIT a- and g-files are re-defined multiple times when reading the files. This causes confusion in case there are issues with any such parameter.

E.g. simagx, rmagx, and zmagx are defined in multiple places in both the a- and g-file
https://github.com/LLNL/UEDGE/blob/d4926dfbe575b28b0612bc6aa61262a917a89383/flx/flxread.m#L333
https://github.com/LLNL/UEDGE/blob/d4926dfbe575b28b0612bc6aa61262a917a89383/flx/flxread.m#L440
https://github.com/LLNL/UEDGE/blob/d4926dfbe575b28b0612bc6aa61262a917a89383/flx/flxread.m#L441
https://github.com/LLNL/UEDGE/blob/d4926dfbe575b28b0612bc6aa61262a917a89383/flx/flxread.m#L442

Proposed solution:
Define each variable once during reading of the files, store other duplicate definition in dummy variables. Currently, the last instance of each variable in the g-file are used, although the EFIT files sometimes only define the variables in the first row. Thus, I suggest only the first occurrences in the g-file are used, the remainder being read into dummy variables. This way, the dependency on the a-file is minimized.

Alternatively, manual definitions could be used, using simple Python scripts to pick variables (such as magnetic axis and X-point locations) could be utilized.

Currently, only strike-point locations seem to be uniquely defined in the a-file, and are the only required values from the a-file. An internal routine (using e.g. Python) could be implemented to completely remove the need for an a-file.

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 with flx/flxread.m at the linked lines and trace how the EFIT a- and g-files assign simagx, rmagx, and zmagx. Determine which first occurrences are valid and which duplicate values should be read into dummy variables. Done means duplicate definitions no longer override one another and the required strike-point data remains available without unnecessary dependence on the a-file.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab
Domain
data
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.