Skip to content

codee-com/fortran-modernization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Top 10 Recommendations for Fortran Modernization

Modernizing Fortran codebases is a crucial step toward improving code quality and ensuring maintainability. It helps developers uncover hidden bugs and reduces the risk of introducing new errors during development. Additionally, these efforts support modern compilers and tools in generating optimized code and identifying potential issues early. Ultimately, modernization boosts developer productivity and enhances code robustness.

Context and motivation

This project is inspired by the OWASP community-led initiative, which regularly publishes the most relevant Top 10 Secure Coding Recommendations. These are widely adopted by the industry to help developers avoid common security vulnerabilities. The OWASP initiative thrives on collaboration and knowledge sharing through platforms like their GitHub repository.

Beyond OWASP, various open catalogs provide comprehensive collections of checks (rules) to help ensure secure coding practices. Each check describes specific scenarios and necessary actions, offering extensive documentation, example codes, automated code analysis tools, and references to other resources. Notable examples include SEI CERT C and CWE.

Building on these foundations, this project aims to start a similar community-driven initiative focused on modern Fortran software development. Leveraging the existing Open Catalog on Best Practices for Modernization and Performance, we seek to establish a dedicated set of Top 10 Recommendations and related checks to address the specific challenges of Fortran Modernization.

Modernizing Fortran code encompasses updating and maintaining legacy Fortran codes (e.g., F77, F90) with extensive development histories. It also involves refactoring existing Fortran codes to leverage the features of the latest Fortran standards (e.g., transitioning from F90 to F23).

Methodology

To develop the Top 10 Recommendations for Fortran Modernization, we adopted a comprehensive and community-focused approach. First, we conducted an extensive review of existing resources on the topic to identify an initial draft of the most recurrent recommendations. These were later discussed with the Fortran development community to collect insights and feedback (e.g., in Fortran Discourse [12]), which were crucial for shaping the final proposal.

The presented Top 10 Recommendations are prioritized to guide developers through a progression of modernization efforts. Each recommendation is detailed with specific checks that describe actionable steps, including examples of before and after code snippets, the rationale behind the changes, and links to further reading.

To ensure the recommendations remain relevant and comprehensive, we plan to continuously review community input and update the guidelines as the Fortran standards evolve and new best practices emerge.

Top 10 Recommendations

  1. Strict compliance with modern Fortran standards.

  2. Declare procedures in modules.

  3. Restrict data visibility with modules.

  4. Improve dummy arguments semantics.

  5. Improve data type consistency and management.

  6. Avoid legacy control-flow constructs.

  7. Enhance source code semantics.

  8. Adhere to code conventions.

  9. Adopt modern development practices.

  10. Proper C/C++ interoperability.

Contributing

We welcome and encourage contributions to the Top 10 Recommendations! Here's how you can get involved:

  1. Join the discussion:

    Got ideas, questions, or suggestions? Head over to our GitHub Discussions. It's the perfect place for open-ended conversations and brainstorming!

  2. Report issues:

    Found inacuracies, unclear explanations, or other problems? Please open an Issue. Detailed reports help us quickly improve the quality of the project!

  3. Submit pull requests:

    Interested in solving any issues? Feel free to fork the repository, make your changes, and submit a Pull Request. We'd love to see your contributions!

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published