Defines integer constants for calculation types to avoid string comparisons throughout the codebase. Provides conversion utilities between string representations and integer constants.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int32), | public, | parameter | :: | CALC_TYPE_ENERGY | = | 1 | |
| integer(kind=int32), | public, | parameter | :: | CALC_TYPE_GRADIENT | = | 2 | |
| integer(kind=int32), | public, | parameter | :: | CALC_TYPE_HESSIAN | = | 3 | |
| integer(kind=int32), | public, | parameter | :: | CALC_TYPE_UNKNOWN | = | 0 |
Convert calculation type string to integer constant
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | calc_type_str |
Input string (e.g., “energy”, “gradient”) |
Output integer constant
Convert calculation type integer constant to string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | calc_type |
Input integer constant |
Output string representation