Convert calculation type integer constant to string
Provides human-readable string representation of calculation type.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | calc_type |
Input integer constant |
Output string representation
pure function calc_type_to_string(calc_type) result(calc_type_str) !! Convert calculation type integer constant to string !! !! Provides human-readable string representation of calculation type. integer(int32), intent(in) :: calc_type !! Input integer constant character(len=:), allocatable :: calc_type_str !! Output string representation select case (calc_type) case (CALC_TYPE_ENERGY) calc_type_str = "energy" case (CALC_TYPE_GRADIENT) calc_type_str = "gradient" case (CALC_TYPE_HESSIAN) calc_type_str = "hessian" case default calc_type_str = "unknown" end select end function calc_type_to_string