modflow6 icon indicating copy to clipboard operation
modflow6 copied to clipboard

feat: configure supported models at build time

Open wpbonelli opened this issue 1 year ago • 0 comments

A potential approach for #1491

  • Configure supported models & exchanges at build time via meson options
    • Move model sources to independent folders for easier filtering
    • Move model/exg creation to new modules, generated from templates with fypp
    • rename ConnectionBuilder -> ConnectionFactory, move to top level, generate from template
    • rename SimulationCreate -> Simulation
  • Generate IDM files with meson
    • use configure_file() before compiling
    • definition files still created with dfn2f90.py, moved to src/IDM
    • model input file and consolidated selector file generated with fypp in src/
    • generic framework files still in src/Utilities/IDM
    • dfn2f90.py accepts input DFNs via config file, default utils/idmloader/dfns.txt
    • dfn2f90.py accepts an output directory path
    • rename files, modules and routines for basename templating
      • consistent DFN & IDM file naming
      • remove indices from file names

Considerations

  • Template processing is also possible with pure python if not worth adding fypp
  • To keep support for make/MSVS, configure_file() is used instead of generator() and IDM/templated files are still under version control. Developers not using meson can generate code manually before build time, like is currently done for IDM
  • If support for make/MSVS is ever dropped and meson becomes the standard build tool, could switch to generator(), preprocess at build time and remove generated files from versioning, but debugging may become trickier

wpbonelli avatar Dec 30 '23 06:12 wpbonelli