{"id":22297305,"url":"https://github.com/matthalex/fortran-project-template","last_synced_at":"2025-07-29T01:33:00.440Z","repository":{"id":244770313,"uuid":"814220250","full_name":"MatthAlex/fortran-project-template","owner":"MatthAlex","description":"An opinionated one-stop shop for new and old Fortran projects, offering seamless compiling, building, packaging, linting, formatting, and more, with modern tools like FPM, pre-commit, fprettify, and ford.","archived":false,"fork":false,"pushed_at":"2025-02-18T14:42:50.000Z","size":37,"stargazers_count":9,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T05:51:13.425Z","etag":null,"topics":["fortran","fortran-package-manager","python","template"],"latest_commit_sha":null,"homepage":"https://github.com/MatthAlex/fortran-project-template","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatthAlex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-12T15:10:35.000Z","updated_at":"2025-04-04T18:58:50.000Z","dependencies_parsed_at":"2024-06-17T10:46:11.763Z","dependency_job_id":"2669cf1d-2acd-45a1-907c-66e671cef5be","html_url":"https://github.com/MatthAlex/fortran-project-template","commit_stats":null,"previous_names":["matthalex/fortran-project-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/MatthAlex/fortran-project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthAlex%2Ffortran-project-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthAlex%2Ffortran-project-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthAlex%2Ffortran-project-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthAlex%2Ffortran-project-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatthAlex","download_url":"https://codeload.github.com/MatthAlex/fortran-project-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthAlex%2Ffortran-project-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267616582,"owners_count":24116155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran","fortran-package-manager","python","template"],"created_at":"2024-12-03T17:49:17.710Z","updated_at":"2025-07-29T01:33:00.434Z","avatar_url":"https://github.com/MatthAlex.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fortran Project Template\n\nModern Fortran development made simple - an opinionated, batteries-included project template that brings contemporary development practices to Fortran projects.\n\n- [Why This Template?](#why-this-template)\n- [Getting Started](#getting-started)\n- [Style Guide and Best Practices](#style-guide-and-best-practices)\n- [Development Tools](#development-tools)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [License](#license)\n- [Appendix](#appendix)\n\n## Why This Template?\n\nFortran remains a crucial language in scientific computing, engineering, and high-performance computing. However, while the language has modernized significantly, the development workflow often lags behind contemporary software engineering practices. This template bridges that gap by providing:\n\n- modern development features like code completion, automated testing, and documentation generation out of the box.\n- seamless integration of Fortran codebases with modern DevOps practices, including continuous integration, code quality checks, and automated documentation.\n- IDE-like tooling integration with VS Code and extensions.\n\n### Key Benefits\n\n- 🚀 **Instant Modern Setup**: Get a fully configured development environment in minutes, not days\n- 🔍 **Code Intelligence**: Real-time error detection, code completion, and refactoring support via VS Code integration\n- 📊 **Quality Assurance**: Automated testing, formatting, and linting integrated with git workflow\n- 📚 **Automated Documentation**: Generate professional documentation from your code comments\n- 🛠️ **Best Practices Built-in**: Pre-configured tools enforce consistent code style and quality\n- 🔄 **Modern Workflow**: Brings git-based workflow, dependency management, and automated builds to Fortran\n\n### Traditional vs Modern Fortran Development\n\n| Aspect | Traditional Approach | With This Template |\n|--------|---------------------|-------------------|\n| Setup Time | Hours/days configuring tools | Minutes with pre-configured environment |\n| Error Detection | At compile time | Real-time as you type |\n| Code Style | Manual enforcement | Automated formatting and checks |\n| Documentation | Manual maintenance | Generated from code comments |\n| Testing | Often manual or ad-hoc | Automated with each commit |\n| Dependencies | Manual management | Handled by package manager |\n\n## Getting Started\n\n### Prerequisites\n\n- Linux OS or WSL2 via Windows\n- GFortran or oneAPI Fortran compiler\n\n#### Optional\n\n- VS Code installation\n- Modern Fortran extension installation\n\n### Step-by-step instructions\n\n0. Load compiler modules (if on a compute cluster):\n\n    ```sh\n    module load gcc\n    # or\n    module load intel\n    ```\n\n1. Create and activate a Python environment:\n\n    ```sh\n    python3 -m venv .venv\n    source .venv/bin/activate\n    ```\n\n    Remember to activate your enviroment before runtime or development tasks.\n\n2. Install the runtime and development packages:\n\n    ```sh\n    pip3 install .  # Install runtime dependencies from pyproject.toml\n    pip3 install .[dev]  # Install development dependencies\n    ```\n\n3. Run the tests and main program:\n\n    ```sh\n    fpm test  # by default it uses gcc/gfortran to compile and run\n    fpm run\n    ```\n\n4. Migrate your project:\n\n    See a step-by-step guide on how to [migrate your project](./docs/MIGRATION.md).\n\n## Style Guide and Best Practices\n\nThe integrated tooling has been configured to automatically conform the code to a set of prescribed rules.\n\nThese rules are roughly outlined in the [STYLE_GUIDE.md](./docs/STYLE_GUIDE.md).\n\n## Development Tools\n\nThe template includes preconfigured development tools and settings for Modern Fortran development, with configurations for:\n\n- VS Code integration with Modern Fortran extension\n- Language server features with `fortls`\n- Code formatting with `fprettify`\n- Automated testing with `fpm test`\n- Package management with `fpm`\n\nFor detailed setup instructions and tool configurations, see [TOOLING.md](./docs/TOOLING.md).\n\n### Profiling\n\nFor information on profiling, see [PROFILING.md](./docs/PROFILING.md).\n\n## Documentation\n\nAutomated documentation is generated by using the [ford](https://github.com/Fortran-FOSS-Programmers/ford) package. For example config files and usage, see [here](https://forddocs.readthedocs.io/en/latest/index.html).\n\nTo generate dcoumentation for this sample project, and then view it on the browser, run:\n\n```sh\nford ford.md\nfirefox docs/ford/index.html  # Alternatively, use your preferred browser\n```\n\n## Contributing\n\nContributions from the community are welcome. To contribute, consider opening an issue or pull request with changes and suggestions.\n\n## License\n\nThe project is operating under an [MIT](./LICENSE) license. You are free to use, modify, and distribute the code as needed for your project. Feel free to adapt and customize it to suit your requirements.\n\n## Appendix\n\n### Project Directory Structure\n\n```sh\n$ tree -Ia '__pycache__|.git|.pytest_cache|.venv|build|.gen*|ford'\n.\n├── app  # The main program driver(s) resides here\n│   └── main.f90\n├── docs\n│   ├── MIGRATION.md\n│   ├── PROFILING.md\n│   ├── STYLE_GUIDE.md\n│   └── TOOLING.md\n├── .editorconfig\n├── ford.md  # FORD config file\n├── .fortls  # VSCode Modern Fortran config file\n├── fpm.rsp\n├── fpm.toml  # Fortran Package Manager config file\n├── .fprettify.rc  # fprettify config file\n├── .gitignore  # Git ignore list of files and directories\n├── LICENSE\n├── .pre-commit-config.yaml  # pre-commit config file\n├── profiling\n│   └── template_mpi.json\n├── pyproject.toml  # config file\n├── README.md  # you are here!\n├── src  # All source code files are placed in here, except main driver\n│   └── first_steps.f90\n├── test  # All tests are placed in here\n│   └── check.f90\n└── .vscode  # Holds VSCode configs and runtime/debugging tasks\n    ├── extensions.json  # simply populates the \"Recommended\" Extensions tab\n    └── settings.json  # also referred to as \"Workspace Settings (JSON)\"\n```\n\n### References and Links\n\nThis repository takes a lot of inspiration (and actual code) from [easy](https://github.com/urbanjost/easy).\n\n- [`fpm`](https://github.com/fortran-lang/fpm)\n- [Modern Fortran extension](https://github.com/fortran-lang/vscode-fortran-support)\n- [`fortls`](https://github.com/fortran-lang/fortls)\n- [`fprettify`](https://github.com/pseewald/fprettify)\n- [`pre-commit`](https://pre-commit.com/)\n- [`ford`](https://github.com/Fortran-FOSS-Programmers/ford)\n- [`uv`](https://github.com/astral-sh/uv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthalex%2Ffortran-project-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthalex%2Ffortran-project-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthalex%2Ffortran-project-template/lists"}