Species-name registry helpers shared by chemistry, boundaries, radiation, and diagnostics.
The solver may use a Cantera-discovered species ordering internally. User inputs and radiation model selections should therefore be resolved by name, not by hard-coded numeric indices. This small module keeps that name lookup behavior consistent across subsystems.
Object-oriented species registry container for cleaner access.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=name_len), | public, | allocatable | :: | name(:) | |||
| integer, | public | :: | nspecies | = | 0 |
| procedure, public :: index_of => registry_index_of | |
| procedure, public :: require_index => registry_require_index |
Searches the name array for a target name and returns its 1-based index, or 0 if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | names(:) | |||
| integer, | intent(in) | :: | nspecies |
Size of the names array to search. |
||
| character(len=*), | intent(in) | :: | target |
The target name to search for. |
Returns true if two species names are identical (case-insensitive, whitespace-trimmed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | a |
First name. |
||
| character(len=*), | intent(in) | :: | b |
Second name. |
Searches for a target name and returns its index, or halts simulation with a fatal error if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | names(:) | |||
| integer, | intent(in) | :: | nspecies |
Size of the names array. |
||
| character(len=*), | intent(in) | :: | target |
The target name to require. |
||
| character(len=*), | intent(in) | :: | owner |
The calling subsystem module name for traceback. |
Bound procedure to find the index of a species from the registry instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(species_registry_t), | intent(in) | :: | this |
The species registry instance. |
||
| character(len=*), | intent(in) | :: | target |
The target species name to lookup. |
Bound procedure to find the index of a species, raising a fatal error if it is missing.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(species_registry_t), | intent(in) | :: | this |
The species registry instance. |
||
| character(len=*), | intent(in) | :: | target |
The target species name to require. |
||
| character(len=*), | intent(in) | :: | owner |
The calling subsystem module name. |