{"id":18847804,"url":"https://github.com/jacobwilliams/finterp","last_synced_at":"2026-02-14T18:02:20.581Z","repository":{"id":5730107,"uuid":"52758030","full_name":"jacobwilliams/finterp","owner":"jacobwilliams","description":"Multidimensional (1D-6D) Linear and Nearest-Neighbor Interpolation with Modern Fortran","archived":false,"fork":false,"pushed_at":"2024-01-07T03:03:41.000Z","size":1316,"stargazers_count":60,"open_issues_count":1,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-15T01:17:46.761Z","etag":null,"topics":["fortran","fortran-package-manager","interpolation","linear-interpolation","nearest-neighbor-interpolation"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobwilliams.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}},"created_at":"2016-02-29T02:29:10.000Z","updated_at":"2025-08-27T11:58:21.000Z","dependencies_parsed_at":"2024-01-07T04:29:54.412Z","dependency_job_id":null,"html_url":"https://github.com/jacobwilliams/finterp","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jacobwilliams/finterp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffinterp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffinterp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffinterp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffinterp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobwilliams","download_url":"https://codeload.github.com/jacobwilliams/finterp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffinterp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29451926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","interpolation","linear-interpolation","nearest-neighbor-interpolation"],"created_at":"2024-11-08T03:09:43.504Z","updated_at":"2026-02-14T18:02:20.557Z","avatar_url":"https://github.com/jacobwilliams.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"![finterp](media/logo.png)\n============\n\nFINTERP: Multidimensional Linear Interpolation with Modern Fortran\n\n## Status\n\n[![Language](https://img.shields.io/badge/-Fortran-734f96?logo=fortran\u0026logoColor=white)](https://github.com/topics/fortran)\n[![GitHub release](https://img.shields.io/github/release/jacobwilliams/finterp.svg?style=plastic)](https://github.com/jacobwilliams/finterp/releases/latest)\n![Build Status](https://github.com/jacobwilliams/finterp/actions/workflows/CI.yml/badge.svg?branch=master)\n[![codecov](https://codecov.io/gh/jacobwilliams/finterp/branch/master/graph/badge.svg?token=BHtd51oUTE)](https://codecov.io/gh/jacobwilliams/finterp)\n\n## Description\n\nCan be used to perform multidimensional (1D-6D) linear interpolation of data on a regular grid. The code is written in modern Fortran (2003/2008) and is object-oriented and thread safe.\n\n## Usage\n\nThere are six classes (`linear_interp_1d`, `linear_interp_2d`, `linear_interp_3d`, `linear_interp_4d`, `linear_interp_5d`, and `linear_interp_6d`). Each has three methods: `initialize`, `evaluate`, and `destroy`.\n\n```fortran\nreal(wp) :: x(nx),y(ny),z(nz),q(nq),r(nr),s(ns)\nreal(wp) :: fcn_1d(nx)\nreal(wp) :: fcn_2d(nx,ny)\nreal(wp) :: fcn_3d(nx,ny,nz)\nreal(wp) :: fcn_4d(nx,ny,nz,nq)\nreal(wp) :: fcn_5d(nx,ny,nz,nq,nr)\nreal(wp) :: fcn_6d(nx,ny,nz,nq,nr,ns)\nreal(wp) :: xval,yval,zval,qval,rval,sval,fval\ninteger :: iflag\n\ntype(linear_interp_1d) :: s1\ntype(linear_interp_2d) :: s2\ntype(linear_interp_3d) :: s3\ntype(linear_interp_4d) :: s4\ntype(linear_interp_5d) :: s5\ntype(linear_interp_6d) :: s6\n\n!populate the arrays\n!...\n\n!initialize the class:\ncall s1%initialize(x,fcn_1d,iflag)\ncall s2%initialize(x,y,fcn_2d,iflag)\ncall s3%initialize(x,y,z,fcn_3d,iflag)\ncall s4%initialize(x,y,z,q,fcn_4d,iflag)\ncall s5%initialize(x,y,z,q,r,fcn_5d,iflag)\ncall s6%initialize(x,y,z,q,r,s,fcn_6d,iflag)\n\n!interpolate:\ncall s1%evaluate(xval,fval)\ncall s2%evaluate(xval,yval,fval)\ncall s3%evaluate(xval,yval,zval,fval)\ncall s4%evaluate(xval,yval,zval,qval,fval)\ncall s5%evaluate(xval,yval,zval,qval,rval,fval)\ncall s6%evaluate(xval,yval,zval,qval,rval,sval,fval)\n\n!free memory:\ncall s1%destroy()\ncall s2%destroy()\ncall s3%destroy()\ncall s4%destroy()\ncall s5%destroy()\ncall s6%destroy()\n```\n\n## Nearest Neighbor Interpolation\n\nThe library also includes classes for nearest neighbor interpolation (`nearest_interp_1d`, `nearest_interp_2d`, ...). The interfaces are the same as for the linear classes.\n\n## Compiling\n\nA `fpm.toml` file is provided for compiling finterp with the [Fortran Package Manager](https://github.com/fortran-lang/fpm). For example, to build:\n\n```\nfpm build --profile release\n```\n\nBy default, the library is built with double precision (`real64`) real values. Explicitly specifying the real kind can be done using the following preprocessor flags:\n\nPreprocessor flag | Kind  | Number of bytes\n----------------- | ----- | ---------------\n`REAL32`  | `real(kind=real32)`  | 4\n`REAL64`  | `real(kind=real64)`  | 8\n`REAL128` | `real(kind=real128)` | 16\n\nFor example, to build a single precision version of the library, use:\n\n```\nfpm build --profile release --flag \"-DREAL32\"\n```\n\nTo run the unit tests:\n\n```\nfpm test\n```\n\nTo use `finterp` within your fpm project, add the following to your `fpm.toml` file:\n```toml\n[dependencies]\nfinterp = { git=\"https://github.com/jacobwilliams/finterp.git\" }\n```\n\nor, to use a specific version:\n```toml\n[dependencies]\nfinterp = { git=\"https://github.com/jacobwilliams/finterp.git\", tag = \"1.3.0\"  }\n```\n\nTo generate the documentation using [ford](https://github.com/Fortran-FOSS-Programmers/ford), run: ```ford ford.md```\n\n## Documentation\n\nThe latest API documentation can be found [here](https://jacobwilliams.github.io/finterp/). This was generated from the source code using [FORD](https://github.com/Fortran-FOSS-Programmers/ford).\n\n## License\n\nThe finterp source code and related files and documentation are distributed under a permissive free software [license](https://github.com/jacobwilliams/finterp/blob/master/LICENSE) (BSD-style).\n\n## See also\n\n * [bspline-fortran](https://github.com/jacobwilliams/bspline-fortran), B-spline interpolation.\n * [PCHIP](https://github.com/jacobwilliams/PCHIP), Piecewise Cubic Hermite Interpolation.\n * [Regridpack](https://github.com/jacobwilliams/regridpack), Linear or cubic interpolation for 1D-4D grids.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Ffinterp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobwilliams%2Ffinterp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Ffinterp/lists"}