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

[gromet] Support empty body for if condition #719

Closed
Tracked by #698
vincentraymond-ua opened this issue Dec 7, 2023 · 0 comments · Fixed by #739
Closed
Tracked by #698

[gromet] Support empty body for if condition #719

vincentraymond-ua opened this issue Dec 7, 2023 · 0 comments · Fixed by #739

Comments

@vincentraymond-ua
Copy link
Contributor

vincentraymond-ua commented Dec 7, 2023

There are a few cases in CISM where there are legitimate if conditionals with empty bodies:

   if (model%options%whichdycore /= DYCORE_GLIDE) then   ! glam/glissade dycore
!!       call coordsystem_allocate(model%general%ice_grid, model%basalproc%Hwater)
!!       allocate(model%basalproc%u (ewn-1,nsn-1,model%basalproc%tnodes)); model%basalproc%u=41.0d3
!!       allocate(model%basalproc%etill (ewn-1,nsn-1,model%basalproc%tnodes));model%basalproc%etill=0.5d0
    endif

This case doesn't actually have an effect on the data overall data flow, but if the expression calls a side-effecting function, it could.

github-actions bot added a commit that referenced this issue Jan 9, 2024
## Summary of Changes
## Tree-Sitter Parsers
- Adds a new `--ci` flag to build_parsers.py so that the .so is only
copied to site packages when running on CI. When running locally this
can cause missing import issues.
- Updates Github workflow to add --ci flag to build_parsers call.

## Preprocessor
- Updates arguments to GCC invocation to explicitly specify the source
language. This prevents GCC from mixing up C style comments and Fortran
concatenation (//)

## TS2CAST
- Updates generate_cast_body to add a no_op to output List if it is
empty.
- Updates Loop visitor to use generate_cast_body to prevent Null values
from appearing in CAST.

## CAST->GROMET
- Adds error handling to find_func_in_module function to prevent it from
crashing on Fortran source code.

### Related issues
Resolves #700
Resolves #719 563e3de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant