NCAR / musica

Multi-Scale Infrastructure for Chemistry Modeling
https://ncar.github.io/musica/
Apache License 2.0
6 stars 3 forks source link

Create Fortran wrapper library for MUSICA #28

Closed mattldawson closed 1 year ago

mattldawson commented 1 year ago
  1. Remove the ccpp directory from CMakeLists.txt
  2. Create src/fortran_interface and add it to the cmake build
    • make sure to include the directory in src/CMakeLists.txt
    • create src/fortran_interface/CMakeLists.txt
  3. Define a new cmake target similar to what is done here
    • call it fortran_interface, aliased with musica::fortran_interface
  4. For the new target, you'll need to setup several properties like here.
    • crucially, this sets up the Fortran_MODULE_DIRECTORY so that the .mod files get copied to a place where other targets can find it
    • make a new cmake variable to allow someone to chose the module directory
  5. Copy the fortran interface to the C functions to micm from here and put them in src/fortran_interface/some file

Acceptance criteria

a project can include musica::musica-fortran and use the c interface

Write a dockerfile that builds and install musica. Then, create a new cmake project that sets up a tiny fortran example that expects to use the musica::musica_fortran target. We should see the example files and the musica::musica_fortran target be compiled and a link against -lmusica in the compile output.

boulderdaze commented 1 year ago

Merged into main