Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[code2FN] Computed GOTO Gromet Generation #773

Closed
4 tasks
titomeister opened this issue Jan 24, 2024 · 0 comments · Fixed by #780
Closed
4 tasks

[code2FN] Computed GOTO Gromet Generation #773

titomeister opened this issue Jan 24, 2024 · 0 comments · Fixed by #780
Assignees
Labels

Comments

@titomeister
Copy link
Contributor

In order to fully support the CISM model ingestion, we need to add generation for computed GOTO statements in the Gromet generation. This involves in making sure that the expr field in the GoTo CAST node is appropriately being generated and then translated to Gromet correctly.

Tasks

@titomeister titomeister self-assigned this Jan 24, 2024
@titomeister titomeister added this to the [DARPA] Milestone 11 milestone Jan 24, 2024
github-actions bot added a commit that referenced this issue Feb 2, 2024
## Summary of Changes
- Adds CAST support for ingesting Computed GO TO
- Adds support for generating GroMEt for CAST files containing Computed
GO TOs.
- Adds a test script `test_goto_computed.py` that contains a unit test
for a small Fortran file that has a Computed GO TO.
- Fixes a small issue in the Annotated CAST generation in
`cast_to_annotated_cast.py`. This fix allows correct support of Computed
GO TOs.
- Updates CAST Visualizer to support visualizing GO TO and Label CAST
nodes.

### CAST Computed GO TO Conversion
Since the expression in Computed GO TOs evaluates to an index rather
than a label, we make a small conversion to the expression in the CAST
to support this. We utilize the _get Gromet function to handle this
indexing.

So:
```fortran
GO TO (100,200,300,400), x+y
```
gets converted to:
```python
_get(["100", "200", "300", "400"], x+y)
```

### Related issues

Resolves #698
Resolves #701
Resolves #773

---------

Co-authored-by: Tito Ferra <[email protected]> f899664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant