{"id":25456804,"url":"https://github.com/szaghi/penf","last_synced_at":"2026-02-27T20:22:02.516Z","repository":{"id":3064080,"uuid":"4086575","full_name":"szaghi/PENF","owner":"szaghi","description":"Portability Environment for Fortran poor people","archived":false,"fork":false,"pushed_at":"2025-05-25T16:31:14.000Z","size":10085,"stargazers_count":40,"open_issues_count":4,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-25T17:31:57.773Z","etag":null,"topics":["codes-portability","fortran","precision"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szaghi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.bsd-2.md","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,"zenodo":null}},"created_at":"2012-04-20T13:05:52.000Z","updated_at":"2025-05-25T16:31:18.000Z","dependencies_parsed_at":"2025-05-25T17:35:35.797Z","dependency_job_id":null,"html_url":"https://github.com/szaghi/PENF","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/szaghi/PENF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FPENF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FPENF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FPENF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FPENF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szaghi","download_url":"https://codeload.github.com/szaghi/PENF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FPENF/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262996403,"owners_count":23396903,"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":["codes-portability","fortran","precision"],"created_at":"2025-02-18T01:51:21.603Z","updated_at":"2026-02-27T20:22:02.502Z","avatar_url":"https://github.com/szaghi.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PENF\n\n\u003e#### Portability Environment for Fortran Poor People\n\u003e A KISS pure Fortran 2003+ library for portable, parametrized numerical types — kind parameters, format strings, number ↔ string conversions, and more.\n\n[![GitHub tag](https://img.shields.io/github/v/tag/szaghi/PENF)](https://github.com/szaghi/PENF/tags)\n[![GitHub issues](https://img.shields.io/github/issues/szaghi/PENF)](https://github.com/szaghi/PENF/issues)\n[![CI](https://github.com/szaghi/PENF/actions/workflows/ci.yml/badge.svg)](https://github.com/szaghi/PENF/actions/workflows/ci.yml)\n[![coverage](https://img.shields.io/endpoint?url=https://szaghi.github.io/PENF/coverage.json)](https://github.com/szaghi/PENF/actions/workflows/ci.yml)\n\n| 🔢 **Kind Parameters**\u003cbr\u003eIntegers `I1P`–`I8P` and reals `R4P`/`R8P`/`R16P`, portable across compilers | 🔄 **Number ↔ String**\u003cbr\u003e`str()`, `strz()`, `cton()`, `bstr()`, `bcton()` — full round-trips | 📐 **Format Strings \u0026 Limits**\u003cbr\u003eReady-made `FI*P` / `FR*P` formats and min/max values for every kind | 📏 **Bit \u0026 Byte Sizes**\u003cbr\u003e`bit_size()` / `byte_size()` extended to reals, integers, and characters |\n|:---:|:---:|:---:|:---:|\n| ⚡ **Pure Fortran 2003+**\u003cbr\u003eNo C, no external deps — tested with gfortran ≥ 4.9.2 and ifort ≥ 12.x | 🔓 **Multi-licensed**\u003cbr\u003eGPL v3 · BSD 2/3-Clause · MIT | 📦 **Multiple build systems**\u003cbr\u003efpm, FoBiS.py, CMake, Makefile | 📖 **Documented \u0026 Tested**\u003cbr\u003eAPI reference + doctests for all type variants |\n\nFor full documentation (guide, API reference, examples, etc.) see the [PENF website](https://szaghi.github.io/PENF/).\n\n---\n\n## Authors\n\n- Stefano Zaghi — [@szaghi](https://github.com/szaghi)\n\nContributions are welcome — see the [Contributing](/guide/contributing) page.\n\n## Copyrights\n\nThis project is distributed under a multi-licensing system:\n\n- **FOSS projects**: [GPL v3](http://www.gnu.org/licenses/gpl-3.0.html)\n- **Closed source / commercial**: [BSD 2-Clause](http://opensource.org/licenses/BSD-2-Clause), [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause), or [MIT](http://opensource.org/licenses/MIT)\n\n\u003e Anyone interested in using, developing, or contributing to this project is welcome — pick the license that best fits your needs.\n\n---\n\n## Quick start\n\n```fortran\nuse penf\ncall penf_init\n\nreal(R8P)    :: x = -1.0_R8P\ninteger(I4P) :: n = 42_I4P\n\nprint FR8P, x !  -0.100000000000000E+001\nprint FI4P, n !          42\n```\n\n### Real kinds\n\n| Parameter | Precision | Range | Size |\n|-----------|-----------|-------|------|\n| `R16P` | 33 digits | $[10^{-4931},\\ 10^{+4931}-1]$ | 128 bit |\n| `R8P` | 15 digits | $[10^{-307},\\ 10^{+307}-1]$ | 64 bit |\n| `R4P` | 6 digits | $[10^{-37},\\ 10^{+37}-1]$ | 32 bit |\n\n### Integer kinds\n\n| Parameter | Range | Size |\n|-----------|-------|------|\n| `I8P` | $[-2^{63},\\ +2^{63}-1]$ | 64 bit |\n| `I4P` | $[-2^{31},\\ +2^{31}-1]$ | 32 bit |\n| `I2P` | $[-2^{15},\\ +2^{15}-1]$ | 16 bit |\n| `I1P` | $[-2^{7},\\ +2^{7}-1]$ | 8 bit |\n\n## Format Strings\n\nEach kind has a matching format string for `print` / `write` statements:\n\n| Kind | Format string | Example output |\n|------|--------------|----------------|\n| `R16P` | `FR16P = '(E42.33E4)'` | `-0.100000000000000000000000000000000E+0001` |\n| `R8P` | `FR8P = '(E23.15E3)'` | `-0.100000000000000E+001` |\n| `R4P` | `FR4P = '(E13.6E2)'` | `-0.100000E+01` |\n| `I8P` | `FI8P = '(I20)'` | `                  -1` |\n| `I4P` | `FI4P = '(I11)'` | `         -1` |\n| `I2P` | `FI2P = '(I6)'` | `    -1` |\n| `I1P` | `FI1P = '(I4)'` | `  -1` |\n\n## Install\n\n### FoBiS.py\n\n**Standalone** — clone, build, and install in one command:\n\n```bash\nFoBiS.py install szaghi/PENF -mode static-gnu\nFoBiS.py install szaghi/PENF -mode static-gnu --prefix /path/to/prefix\n```\n\n**As a project dependency** — declare PENF in your `fobos` and run `fetch`:\n\n```ini\n[dependencies]\ndeps_dir = src/third_party\nPENF     = https://github.com/szaghi/PENF\n```\n\n```bash\nFoBiS.py fetch           # fetch and build\nFoBiS.py fetch --update  # re-fetch and rebuild\n```\n\n### fpm\n\nAdd to your `fpm.toml`:\n\n```toml\n[dependencies]\nPENF = { git = \"https://github.com/szaghi/PENF\" }\n```\n\n### CMake\n\n```bash\ncmake -B build \u0026\u0026 cmake --build build\n```\n\n### Makefile\n\n```bash\nmake              # static library\nmake TESTS=yes    # build and run tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Fpenf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszaghi%2Fpenf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Fpenf/lists"}