{"id":22820842,"url":"https://github.com/gha3mi/fordebug","last_synced_at":"2026-02-03T03:31:07.812Z","repository":{"id":212246708,"uuid":"730852186","full_name":"gha3mi/fordebug","owner":"gha3mi","description":"ForDebug: A Fortran library designed for debugging Fortran code, especially within pure procedures.","archived":false,"fork":false,"pushed_at":"2024-05-04T20:11:00.000Z","size":675,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T23:25:38.188Z","etag":null,"topics":["elapsed-time","elemental","fortran-package-manager","pure"],"latest_commit_sha":null,"homepage":"https://gha3mi.github.io/fordebug/","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gha3mi.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":"2023-12-12T20:17:27.000Z","updated_at":"2024-05-04T20:09:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ed745c0-5f53-4d27-b1ea-2000d9594d79","html_url":"https://github.com/gha3mi/fordebug","commit_stats":null,"previous_names":["gha3mi/fordebug"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gha3mi/fordebug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Ffordebug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Ffordebug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Ffordebug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Ffordebug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gha3mi","download_url":"https://codeload.github.com/gha3mi/fordebug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Ffordebug/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262959560,"owners_count":23391057,"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","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":["elapsed-time","elemental","fortran-package-manager","pure"],"created_at":"2024-12-12T15:42:38.133Z","updated_at":"2026-02-03T03:31:07.802Z","avatar_url":"https://github.com/gha3mi.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub](https://img.shields.io/badge/GitHub-ForDebug-blue.svg?style=social\u0026logo=github)](https://github.com/gha3mi/fordebug)\n[![Version](https://img.shields.io/github/release/gha3mi/fordebug.svg)](https://github.com/gha3mi/fordebug/releases/latest)\n[![Documentation](https://img.shields.io/badge/ford-Documentation%20-blueviolet.svg)](https://gha3mi.github.io/fordebug/)\n[![CI-CD](https://github.com/gha3mi/fordebug/actions/workflows/CI-CD.yml/badge.svg)](https://github.com/gha3mi/fordebug/actions/workflows/CI-CD.yml) \n[![License](https://img.shields.io/github/license/gha3mi/fordebug?color=green)](https://github.com/gha3mi/fordebug/blob/main/LICENSE)\n\n**ForDebug**: A Fortran library designed for debugging Fortran code, especially within pure procedures.\n\n## fpm dependency\n\nIf you want to use `ForDebug` as a dependency in your own fpm project,\nyou can easily include it by adding the following line to your `fpm.toml` file:\n\n```toml\n[dependencies]\nfordebug = {git=\"https://github.com/gha3mi/fordebug.git\"}\n```\n\n## Usage\n\n### Error / Warning / Info Control\n\n```Fortran\nuse fordebug, only: debug\n\ntype(debug) :: err\n\ncall err%set(\u0026\n  severity   = 1, \u0026\n  code       = 100, \u0026\n  category   = \"math\", \u0026\n  message    = \"division by zero\", \u0026\n  location   = my_module.f90:11, \u0026\n  suggestion = \"Check denominator for zero.\" )\n\ncall err%print()\n\ncall err%reset()\n```\n\n#### Notes\n\n- Define `FOR_DEBUG` preprocessor directive to enable error/warning/info control.\n\n### Printing or Writing within Pure Procedures\n\nTo enable printing or writing within a pure procedure in Fortran, use the fordebug module.\n\n```Fortran\nuse fordebug, only: pwrite\n\n! within pure procedures\ncall pwrite(message='hello!')\ncall pwrite(R0i32=n)\ncall pwrite(message='x = ', R0r32=10.0, format='(a,f7.3)', file='example/demo.txt', access='append')\n```\n\n#### Notes\n\n- All arguments of `pwrite` are optional.\n- Data types are represented using the following conventions:\n  - `R0i32`, `R0i64`, `R0r32`, `R0r64`, `R0c32`, `R0c64` for Rank 0 integer, real, and complex types.\n  - `R1i32`, `R1i64`, `R1r32`, `R1r64`, `R1c32`, `R1c64` for Rank 1 integer, real, and complex types.\n  - `R2i32`, `R2i64`, `R2r32`, `R2r64`, `R2c32`, `R2c64` for Rank 2 integer, real, and complex types.\n  - `R0ch` for Rank 0 character.\n\n### Measuring Elapsed Time within Pure Procedures\n\nForDebug uses [ForTmie](https://github.com/gha3mi/fortime) as dependency. For measuring elapsed time within a pure procedure, utilize the fordebug module with time derived type.\n\n```Fortran\nuse fordebug, only: timer, ptimer_start, ptimer_stop\n\ntype(timer) :: t\n\ncall ptimer_start(t)\n! Perform your operations here\ncall ptimer_stop(t) ! Output: Elapsed time:  0.000 [s]\n```\n\n## How to run examples\n\n**Clone the repository:**\n\nClone the `ForDebug` repository from GitHub using the following command:\n\n```shell\ngit clone https://github.com/gha3mi/fordebug.git\n```\n\nNavigate to the cloned directory:\n\n```shell\ncd fordebug\n```\n\n### Running examples\n\nTo run all examples, execute the following command:\n\n```shell\nfpm run --example --all --flag \"-DFOR_DEBUG\"\n```\n\n## Status\n\n\u003c!-- STATUS:setup-fortran-conda:START --\u003e\n| Compiler   | macos | ubuntu | windows |\n|------------|----------------------|----------------------|----------------------|\n| `flang-new` | - | fpm ❌  cmake ✅ | fpm ❌  cmake ❌ |\n| `gfortran` | fpm ✅  cmake ✅ | fpm ✅  cmake ✅ | fpm ✅  cmake ✅ |\n| `ifx` | - | fpm ✅  cmake ✅ | fpm ✅  cmake ❌ |\n| `lfortran` | fpm ❌  cmake ❌ | fpm ❌  cmake ❌ | fpm ❌  cmake ❌ |\n| `nvfortran` | - | fpm ✅  cmake ✅ | - |\n\u003c!-- STATUS:setup-fortran-conda:END --\u003e\n\n## API documentation\n\nThe most up-to-date API documentation for the master branch is available\n[here](https://gha3mi.github.io/fordebug/).\nTo generate the API documentation for `ForDebug` using\n[ford](https://github.com/Fortran-FOSS-Programmers/ford) run the following\ncommand:\n\n```shell\nford README.yml\n```\n\n## Contributing\n\nContributions to `ForDebug` are welcome!\nIf you find any issues or would like to suggest improvements, please open an issue.\n\n## See also\n\n- https://github.com/plevold/fortran-debug-utils.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgha3mi%2Ffordebug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgha3mi%2Ffordebug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgha3mi%2Ffordebug/lists"}