{"id":22371722,"url":"https://github.com/upc-ghs/modpath-rw","last_synced_at":"2026-02-12T17:01:09.737Z","repository":{"id":186792082,"uuid":"579954602","full_name":"upc-ghs/modpath-rw","owner":"upc-ghs","description":"A Random Walk Particle Tracking code for solute transport in heterogeneous aquifers","archived":false,"fork":false,"pushed_at":"2025-12-01T09:27:36.000Z","size":36718,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-12-03T20:55:33.222Z","etag":null,"topics":["fortran","heterogeneous","hydrogeology","particles","random-walk","solute-transport"],"latest_commit_sha":null,"homepage":"","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/upc-ghs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-19T11:05:45.000Z","updated_at":"2025-12-01T09:27:40.000Z","dependencies_parsed_at":"2023-08-07T19:26:29.530Z","dependency_job_id":"909af1b1-a996-4bfd-8237-99922eb257b2","html_url":"https://github.com/upc-ghs/modpath-rw","commit_stats":{"total_commits":520,"total_committers":6,"mean_commits":86.66666666666667,"dds":0.07307692307692304,"last_synced_commit":"bdf419bd2130ab8194f6ca4f13dfd243b501d954"},"previous_names":["upc-ghs/modpath-rw"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/upc-ghs/modpath-rw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fmodpath-rw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fmodpath-rw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fmodpath-rw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fmodpath-rw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upc-ghs","download_url":"https://codeload.github.com/upc-ghs/modpath-rw/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fmodpath-rw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29373837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: 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","heterogeneous","hydrogeology","particles","random-walk","solute-transport"],"created_at":"2024-12-04T20:29:10.398Z","updated_at":"2026-02-12T17:01:09.721Z","avatar_url":"https://github.com/upc-ghs.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# modpath-rw\nA Random Walk Particle Tracking Code for Solute Transport in Heterogeneous Aquifers\n\n![](img/banner.png)\n\n## Overview\nMODPATH-RW is a Random Walk Particle Tracking (RWPT) model, implemented by extension of the particle tracking program [MODPATH-v7](https://github.com/MODFLOW-USGS/modpath-v7). The code employs discrete solute particles to solve the Advection Dispersion Equation (ADE), and inherits the parallel processing of particles from [MODPATH-OMP](https://github.com/upc-ghs/modpath-omp).\n\nThe program is naturally integrated with groundwater flow models obtained with MODFLOW-2005, MODFLOW-USG and [MODFLOW 6](https://github.com/MODFLOW-USGS/modflow6), for structured and rectangular unstructured grids.\n\n## Build\n\n### Get the code\nClone the repository\n\n```\ngit clone https://github.com/upc-ghs/modpath-rw\n```\n\nSome external dependencies are stored in the ``src/lib`` folder. The necessary files are all explicitly included in the repository for convenience. \n\n- [``gpkde``](https://github.com/upc-ghs/gpkde.git): module for smoothed reconstruction of concentrations.\n\n- [``finterp``](https://github.com/jacobwilliams/finterp.git): module for linear interpolation.\n\n- [``rng_par_zig``](https://bitbucket.org/LadaF/elmm/src/master/src/rng_par_zig.f90): module for random number generation in parallel with the Ziggurat method. \n\n\n### Makefile\nMakefiles are available at the folder `make`:\n\n- `makefile-gfortran-pc`: for the `gfortran` compiler.\n- `makefile-ifort-pc`: for the `ifort` compiler, verified for `ifort@2021.9.0`.\n- `makefile-gfortran-mac`: for the `gfortran` compiler in macOS. \n- `makefile-gfortran-wos`: for the `gfortran` compiler in Windows (tested with mingw-w64). \n\nBy default, the compiled program is called ``mpathrw``. Compilation process will create a folder with temporary objects (``make/objtemp``). When integrating program updates and recompiling, it is advised to remove this folder to avoid inconsistencies. \n\n### Meson\nThe program can be built with the [meson](https://mesonbuild.com/) build system:\n\n- Setup the configuration:\n\n```\n    meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin\n``` \n\n- Compile: \n\n```\n    meson install -C builddir\n```\n\n- Test:\n\n```\n    meson test --verbose --no-rebuild -C builddir\n```\n\n### Windows binary\nA Windows executable is available at the folder `wbin/`. The latest version of the [Windows executable](https://github.com/upc-ghs/modpath-rw/blob/develop/wbin/mpathrw.exe) is built with mingw-w64 `gfortran`, with static linking of libraries, meaning that the executable bundles all the necessary Fortran libraries (e.g., OpenMP). \n\n**Note**: This new Windows executable replaces the [former executable](https://github.com/upc-ghs/modpath-rw/blob/develop/wbin/mpathrw_e216a4d.exe) generated with the Intel compiler and Visual Studio, which will remain as legacy updated until commit [e216a4d](https://github.com/upc-ghs/modpath-rw/commit/e216a4d483f13a8dbf5a26c630e613fe0e83c351) (see below).\n\n#### Visual Studio and Intel Compiler\nThe folder `msvs` contains the project and solution files generated with Visual Studio 2022 on a Windows system. An executable file and complementary `dll`'s providing the OpenMP library are available at the folder `wbin/`. Users can make easy use of these files at a system level by extending the `PATH` environment variable, adding their specific address to the `wbin/` folder (as [here](https://www.itprotoday.com/windows-server/how-can-i-add-new-folder-my-system-path) or [here](https://windowsloop.com/how-to-add-to-windows-path/)).\n\nThe necessary `dll`'s can also be installed from the Intel and Visual Studio redistributables (`x64`), respectively:\n\n - [Intel Fortran Compiler Runtime for Windows](https://www.intel.com/content/www/us/en/developer/articles/tool/compilers-redistributable-libraries-by-version.html) \n - [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170)\n\n**Note**: The Windows executable generated with the Intel compiler and Visual Studio will remain as legacy, updated until commit [e216a4d](https://github.com/upc-ghs/modpath-rw/commit/e216a4d483f13a8dbf5a26c630e613fe0e83c351).\n\n## Input files\nDetails about the configuration of input files are provided in the program [Documentation of Input-Output](doc/modpath-rw_IO_v100_.pdf). It is recommended to follow this document closely with the [Description of Model Input and Output of MODPATH-v7](doc/MODPATH_7_io.pdf).\n\nUsers familiarized with the `python` interface [FloPy](https://github.com/modflowpy/flopy) are encouraged to write input files for MODPATH-RW with the extension [flopyrw](https://github.com/upc-ghs/flopyrw). This package provides classes based on the interface for [mp7](https://github.com/modflowpy/flopy/tree/develop/flopy/modpath), which have been adapted to the specific requirements of MODPATH-RW, plus new classes for the new model packages. The extension is consistent with the program documentation and example configuration routines and test cases can be found on the project page.\n\n\n## Command line interface \nA command line interface provides some simple instructions and shortcuts for managing program execution. Asking for help (``mpathrw -h``) displays the following message\n\n```\nMODPATH-RW version *.*.*               \nProgram compiled MMM DD YYYY HH:MM:SS with ******** compiler (ver. *******)       \n\nA Random Walk Particle Tracking code for solute transport in heterogeneous aquifers\n\nusage:\n\n  mpathrw [options] simfile\n\noptions:\n                                                                                 \n  -h         --help                Show this message                             \n  -i         --init                Initialize simulation without running         \n  -l  \u003cstr\u003e  --logname    \u003cstr\u003e    Write program logs to \u003cstr\u003e                   \n  -nl        --nolog               Do not write log file                         \n  -np \u003cint\u003e  --nprocs     \u003cint\u003e    Run with \u003cint\u003e processes                      \n  -p         --parallel            Run in parallel                               \n  -ts \u003cint\u003e  --tsoutput   \u003cint\u003e    Selects timeseries output \u003cint\u003e               \n  -s         --shortlog            Simplified logs                               \n  -v         --version             Show program version                          \n                                                                                 \nFor bug reports and updates, follow:                                             \n  https://github.com/upc-ghs/modpath-rw  \n```\n**Note**: if the OpenMP library is not found by compilers, the program will be generated without parallel compatibility, without the input parameters `nprocs`, `parallel` and `tsoutput`. If these are listed on the program help message (as above), the compilation with parallel compatibility was successful. \n\n#### Some relevant CLI arguments\n\n`--init`: initialize the program packages and stop execution before displacing particles. Useful to monitor the initialization workflow and reports written to the `mplst` file.\n\n`--nprocs`: run in parallel with the given number of processes (`omp_set_num_threads(nprocs)`).\n \n`--parallel`: shorthand for running in parallel with the maximum number of processors (`omp_get_num_procs()`).\n\n**Note**: if neither ``--parallel`` nor ``--nprocs`` are given, the program will by default employ ``omp_get_max_threads()``, whose value can be controlled with the environment variable `OMP_NUM_THREADS`.\n\n\n`--tsoutput`: controls the output protocol for timeseries runs while running in parallel\n\n- 1: is the default format, output is performed into a single output unit with the OpenMP thread exclusive clause (critical). Only difference versus a serial run is that the output file contains non-sorted particle indexes.\n- 2: timeseries records are written into thread specific binary units and then consolidated into a single file after each timeseries output time. Timeseries file generated with this format does not contains a file header.\n- 3: timeseries records are written into thread specific output units. Timeseries file header is written only to the output unit of the first thread ``1_example.timeseries``. Initial particle positions are also written to the file of the first thread.\n\n## Contributing\nFollow the [contribution guidelines](readme/CONTRIBUTING.md) for this project.\n\n## License\nMIT License\n\n## References\n\n#### ***Software citation***\n\n[Pérez-Illanes R., Fernàndez-Garcia, D., 2024, MODPATH-RW: A Random Walk Particle Tracking Code for Solute Transport in Heterogeneous Aquifers, Groundwater 62, no. 4: 617-634, doi:10.1111/gwat.13390](https://doi.org/10.1111/gwat.13390)\n\n#### ***Related publications***\n\n[Pérez-Illanes R., Fernàndez-Garcia, D., 2024, A General Purpose Parallel Fortran Code for Grid Projected Concentration Reconstruction from Multidimensional Particle Distributions, Environmental Modelling \u0026 Software, doi: 10.1016/j.envsoft.2024.106008.](https://doi.org/10.1016/j.envsoft.2024.106008)\n\n[Pérez-Illanes R., Fernàndez-Garcia, D., 2023, Multiprocessing for the Particle Tracking Model MODPATH, Groundwater 61, no. 5: 733–742, doi:10.1111/gwat.13279](https://doi.org/10.1111/gwat.13279)\n\n\n\n## Resources\n* [MODPATH](https://www.usgs.gov/software/modpath-particle-tracking-model-modflow)\n* [MODPATH-v7](https://github.com/MODFLOW-USGS/modpath-v7)\n* [MODPATH-OMP](https://github.com/upc-ghs/modpath-omp)\n* [GPKDE](https://github.com/upc-ghs/gpkde)\n* [flopy](https://github.com/modflowpy/flopy)\n* [flopyrw](https://github.com/upc-ghs/flopyrw)\n* [gfortran](https://gcc.gnu.org/wiki/GFortran)\n* [MinGW](https://www.mingw-w64.org)\n* [Intel oneApi HPC toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html)\n* [OpenMP](https://www.openmp.org/)\n* [MIT License](https://mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupc-ghs%2Fmodpath-rw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupc-ghs%2Fmodpath-rw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupc-ghs%2Fmodpath-rw/lists"}