{"id":13948736,"url":"https://github.com/NCAR/micm","last_synced_at":"2025-07-20T10:32:39.758Z","repository":{"id":45017521,"uuid":"294492778","full_name":"NCAR/micm","owner":"NCAR","description":"A model-independent chemistry module for atmosphere models","archived":false,"fork":false,"pushed_at":"2025-07-18T15:51:33.000Z","size":48439,"stargazers_count":6,"open_issues_count":16,"forks_count":7,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-07-18T16:35:01.517Z","etag":null,"topics":["atmospheric-chemistry","atmospheric-modeling","atmospheric-science","cuda","gpu","gpu-acceleration","hpc","ode-solver"],"latest_commit_sha":null,"homepage":"https://ncar.github.io/micm/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NCAR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-09-10T18:37:15.000Z","updated_at":"2025-07-18T15:49:56.000Z","dependencies_parsed_at":"2023-09-28T16:24:50.035Z","dependency_job_id":"750fe727-26af-48df-bd8a-92ee5a254bb7","html_url":"https://github.com/NCAR/micm","commit_stats":{"total_commits":1259,"total_committers":17,"mean_commits":74.05882352941177,"dds":0.6926131850675139,"last_synced_commit":"51ddf3909a860c64fb14a5da822e1c30b5493c56"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/NCAR/micm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fmicm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fmicm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fmicm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fmicm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NCAR","download_url":"https://codeload.github.com/NCAR/micm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NCAR%2Fmicm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265948552,"owners_count":23853392,"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":["atmospheric-chemistry","atmospheric-modeling","atmospheric-science","cuda","gpu","gpu-acceleration","hpc","ode-solver"],"created_at":"2024-08-08T05:01:29.346Z","updated_at":"2025-07-20T10:32:39.748Z","avatar_url":"https://github.com/NCAR.png","language":"C++","readme":"MICM Chemistry\n==============\n\nModel Independent Chemical Module. MICM can be used to configure and solve atmospheric chemistry systems.\n\n[![GitHub Releases](https://img.shields.io/github/release/NCAR/micm.svg)](https://github.com/NCAR/micm/releases)\n[![License](https://img.shields.io/github/license/NCAR/micm.svg)](https://github.com/NCAR/micm/blob/master/LICENSE)\n[![Docker builds](https://github.com/NCAR/micm/actions/workflows/docker_and_coverage.yml/badge.svg)](https://github.com/NCAR/micm/actions/workflows/docker_and_coverage.yml)\n[![Windows](https://github.com/NCAR/micm/actions/workflows/windows.yml/badge.svg)](https://github.com/NCAR/micm/actions/workflows/windows.yml)\n[![Mac](https://github.com/NCAR/micm/actions/workflows/mac.yml/badge.svg)](https://github.com/NCAR/micm/actions/workflows/mac.yml)\n[![Ubuntu](https://github.com/NCAR/micm/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/NCAR/micm/actions/workflows/ubuntu.yml)\n[![codecov](https://codecov.io/gh/NCAR/micm/branch/main/graph/badge.svg?token=ATGO4DKTMY)](https://codecov.io/gh/NCAR/micm)\n[![DOI](https://zenodo.org/badge/294492778.svg)](https://zenodo.org/badge/latestdoi/294492778)\n[![FAIR checklist badge](https://fairsoftwarechecklist.net/badge.svg)](https://fairsoftwarechecklist.net/v0.2?f=31\u0026a=32113\u0026i=22322\u0026r=123)\n\n\nCopyright (C) 2018-2025 University Corporation for Atmospheric Research\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg style=\"border-radius: 100%\" src=\"docs/source/_static/icons/micm.png\"\u003e\n\u003c/p\u003e\n\n\u003e **Note**\n\u003e MICM 3.x.x is part of a refactor and may include breaking changes across minor revision numbers\nand partially implemented features\n\n\n# Getting Started\n\n## Installing MICM locally\nTo build and install MICM locally, you must have CMake installed on your machine.\n\nOpen a terminal window, navigate to a folder where you would like the MICM files to exist,\nand run the following commands:\n\n```\ngit clone https://github.com/NCAR/micm.git\ncd micm\nmkdir build\ncd build\nccmake ..\nsudo make install -j 8\n```\n\nTo run the tests:\n\n```\nmake test\n```\n\nIf you would later like to uninstall MICM, you can run\n`sudo make uninstall` from the `build/` directory.\n\n## Options\n\nThere are multiple options for running micm. You can use [json](https://github.com/nlohmann/json)\nto configure a solver, [llvm](https://llvm.org/) to JIT-compile\nsolvers on CPUs or [cuda](https://developer.nvidia.com/cuda-zone)-based solvers to solve chemistry on GPUs.\nPlease [read our docs](https://ncar.github.io/micm/getting_started.html) \nto learn how to enable these options.\n\n## Running a MICM Docker container\n\nYou must have [Docker Desktop](https://www.docker.com/get-started) installed and running.\nWith Docker Desktop running, open a terminal window.\nTo build the latest MICM release, run the following command to start the MICM container:\n\n```\ndocker run -it ghcr.io/ncar/micm:release bash\n```\n\nTo build the latest pre-release version of MICM, instead run:\n\n```\ngit clone https://github.com/NCAR/micm.git\ncd micm\ndocker build -t micm -f docker/Dockerfile .\ndocker run -it micm bash\n```\n\nInside the container, you can run the MICM tests from the `/build/` folder:\n\n```\ncd /build/\nmake test\n```\n\n# Using the MICM API\n\nThe following example solves the fictitious chemical system:\n\n```\nfoo       --k1--\u003e 0.8 bar + 0.2 baz\nfoo + bar --k2--\u003e baz\n```\nThe `k1` and `k2` rate constants are for Arrhenius reactions. See the [MICM documentation](https://ncar.github.io/micm/) for details on the types of reactions available in MICM and how to configure them.\n\nTo solve this system save the following code in a file named `foo_chem.cpp`:\n\n```c++\n#include \u003cmicm/process/arrhenius_rate_constant.hpp\u003e\n#include \u003cmicm/solver/rosenbrock.hpp\u003e\n#include \u003cmicm/solver/solver_builder.hpp\u003e\n\n#include \u003ciomanip\u003e\n#include \u003ciostream\u003e\n\nusing namespace micm;\n\nint main(const int argc, const char *argv[])\n{\n  auto foo = Species{ \"Foo\" };\n  auto bar = Species{ \"Bar\" };\n  auto baz = Species{ \"Baz\" };\n\n  Phase gas_phase{ std::vector\u003cSpecies\u003e{ foo, bar, baz } };\n\n  System chemical_system{ SystemParameters{ .gas_phase_ = gas_phase } };\n\n  Process r1 = Process::Create()\n                   .SetReactants({ foo })\n                   .SetProducts({ Yield(bar, 0.8), Yield(baz, 0.2) })\n                   .SetRateConstant(ArrheniusRateConstant({ .A_ = 1.0e-3 }))\n                   .SetPhase(gas_phase);\n\n  Process r2 = Process::Create()\n                   .SetReactants({ foo, bar })\n                   .SetProducts({ Yield(baz, 1) })\n                   .SetRateConstant(ArrheniusRateConstant({ .A_ = 1.0e-5, .C_ = 110.0 }))\n                   .SetPhase(gas_phase);\n\n  std::vector\u003cProcess\u003e reactions{ r1, r2 };\n\n  auto solver = micm::CpuSolverBuilder\u003cmicm::RosenbrockSolverParameters\u003e(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters())\n                    .SetSystem(chemical_system)\n                    .SetReactions(reactions)\n                    .Build();\n\n  State state = solver.GetState();\n\n  state.conditions_[0].temperature_ = 287.45;  // K\n  state.conditions_[0].pressure_ = 101319.9;   // Pa\n  state.conditions_[0].CalculateIdealAirDensity();\n  state.SetConcentration(foo, 20.0);           // mol m-3\n\n  state.PrintHeader();\n  for (int i = 0; i \u003c 10; ++i)\n  {\n    solver.CalculateRateConstants(state);\n    auto result = solver.Solve(500.0, state);\n    state.PrintState(i * 500);\n  }\n\n  return 0;\n}\n```\n\nTo build and run the example using GNU (assuming the default install location):\n```\ng++ -o foo_chem foo_chem.cpp -I/usr/local/micm-3.9.0/include -std=c++20\n./foo_chem\n```\n\nOutput:\n```\n time,        Bar,        Baz,        Foo\n    0,   5.90e+00,   1.91e+00,   1.18e+01\n  500,   9.05e+00,   3.32e+00,   6.79e+00\n 1000,   1.07e+01,   4.21e+00,   3.83e+00\n 1500,   1.17e+01,   4.74e+00,   2.14e+00\n 2000,   1.22e+01,   5.04e+00,   1.19e+00\n 2500,   1.24e+01,   5.21e+00,   6.58e-01\n 3000,   1.26e+01,   5.31e+00,   3.64e-01\n 3500,   1.27e+01,   5.36e+00,   2.01e-01\n 4000,   1.27e+01,   5.39e+00,   1.11e-01\n 4500,   1.28e+01,   5.41e+00,   6.13e-02\n```\n# Citation\n\nMICM is part of the MUSICA project and can be cited by reference to the MUSICA vision paper. The BibTeX entry below can be used to generate a citation for this.\n\n```\n@Article { acom.software.musica-vision,\n    author = \"Gabriele G. Pfister and Sebastian D. Eastham and Avelino F. Arellano and Bernard Aumont and Kelley C. Barsanti and Mary C. Barth and Andrew Conley and Nicholas A. Davis and Louisa K. Emmons and Jerome D. Fast and Arlene M. Fiore and Benjamin Gaubert and Steve Goldhaber and Claire Granier and Georg A. Grell and Marc Guevara and Daven K. Henze and Alma Hodzic and Xiaohong Liu and Daniel R. Marsh and John J. Orlando and John M. C. Plane and Lorenzo M. Polvani and Karen H. Rosenlof and Allison L. Steiner and Daniel J. Jacob and Guy P. Brasseur\",\n    title = \"The Multi-Scale Infrastructure for Chemistry and Aerosols (MUSICA)\",\n    journal = \"Bulletin of the American Meteorological Society\",\n    year = \"2020\",\n    publisher = \"American Meteorological Society\",\n    address = \"Boston MA, USA\",\n    volume = \"101\",\n    number = \"10\",\n    doi = \"10.1175/BAMS-D-19-0331.1\",\n    pages= \"E1743 - E1760\",\n    url = \"https://journals.ametsoc.org/view/journals/bams/101/10/bamsD190331.xml\"\n}\n```\n\n# Community and contributions\nWe welcome contributions and feedback from anyone, everything from updating\nthe content or appearance of the documentation to new and\ncutting edge science.\n\n- [Collaboration](https://github.com/NCAR/musica/blob/main/docs/Software%20Development%20Plan.pdf)\n  - Anyone interested in scientific collaboration\nwhich would add new software functionality should read the [MUSICA software development plan](https://github.com/NCAR/musica/blob/main/docs/Software%20Development%20Plan.pdf).\n\n- [Contributor's guide](https://ncar.github.io/micm/contributing/index.html)\n  - Before submiitting a PR, please thouroughly read this to you understand our expectations. We reserve the right to reject any PR not meeting our guidelines.\n\n\n# Documentation\nPlease see the [MICM documentation](https://ncar.github.io/micm/) for detailed\ninstallation and usage instructions.\n\n# License\n\n- [Apache 2.0](/LICENSE)\n\nCopyright (C) 2018-2025 University Corporation for Atmospheric Research\n","funding_links":[],"categories":["Atmosphere"],"sub_categories":["Atmospheric Chemistry and Aerosol"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNCAR%2Fmicm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNCAR%2Fmicm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNCAR%2Fmicm/lists"}