You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #932 we consolidated configuration reading down to one path that returns a mechanism. In #990 a mechanism became visible to C and fortran for the first time, because miem needed one. It would be nice if micm could take one of these mechanism fortran objects and configure itself
Micm keeps its config path constructors for backwards compatibility, but also because it's the most common use case
One limit on the fortran side. #990 gives mechanism_t a constructor from a path only. So this issue delivers one parse that feeds both micm and miem. It does not deliver a mechanism that a user builds in memory. That work needs mechanism configuration bindings for fortran, and it is a separate issue.
Acceptance criteria
micm can be configured from a mechanism, not only from a config path
mechanism_t moves out of the musica_emissions module into its own module, for example fortran/configuration/mechanism.F90
Build miem C/Fortran interface #990 defines mechanism_t in fortran/miem/emissions.F90. The build compiles micm/ and miem/ under separate flags, so a build with MICM on and MIEM off has no mechanism_t for micm_t to accept
The new module builds whenever the fortran interface is on, and it does not depend on miem
The C side already does this correctly, read_mechanism_c_interface lives in src/configuration
micm and miem can be configured the same way, from the same mechanism object, and one parse can feed both
a test in fortran and a test in C++ that read a mechanism once and build both, with no second parse
Tests
construct micm from a mechanism in fortran
a build with MICM on and MIEM off still compiles the fortran interface
Tutorials and docs show both, read a config for the simple case, build or parse a mechanism when you want to configure more than one model from it
Ideas
The new micm_t constructor needs no special work. A mechanism_t first argument and a character(len=*) first argument resolve cleanly in one generic interface. Build miem C/Fortran interface #990 hit an overload problem, but that was for two constructors with the same argument types.
After this change, Chemistry can become internal. The public boundary is from a mechanism to a model.
A user can hand a config with a miem emissions section to micm without ever configuring miem, and vice versa. I suppose this could be confusing and maybe we should warn about this
In #932 we consolidated configuration reading down to one path that returns a mechanism. In #990 a mechanism became visible to C and fortran for the first time, because miem needed one. It would be nice if micm could take one of these mechanism fortran objects and configure itself
Micm keeps its config path constructors for backwards compatibility, but also because it's the most common use case
One limit on the fortran side. #990 gives
mechanism_ta constructor from a path only. So this issue delivers one parse that feeds both micm and miem. It does not deliver a mechanism that a user builds in memory. That work needs mechanism configuration bindings for fortran, and it is a separate issue.Acceptance criteria
micm_taccepts amechanism_tmechanism_tmoves out of themusica_emissionsmodule into its own module, for examplefortran/configuration/mechanism.F90mechanism_tinfortran/miem/emissions.F90. The build compilesmicm/andmiem/under separate flags, so a build with MICM on and MIEM off has nomechanism_tformicm_tto acceptread_mechanism_c_interfacelives insrc/configurationIdeas
micm_tconstructor needs no special work. Amechanism_tfirst argument and acharacter(len=*)first argument resolve cleanly in one generic interface. Build miem C/Fortran interface #990 hit an overload problem, but that was for two constructors with the same argument types.Chemistrycan become internal. The public boundary is from a mechanism to a model.emissionssection to micm without ever configuring miem, and vice versa. I suppose this could be confusing and maybe we should warn about this