36 use,
intrinsic :: iso_c_binding
60 type,
bind(c) :: kim_temperature_unit_type
67 integer(c_int) temperature_unit_id
76 bind(c, name="KIM_TEMPERATURE_UNIT_unused") &
85 bind(c, name="KIM_TEMPERATURE_UNIT_K") &
94 module procedure kim_temperature_unit_known
102 interface operator(.eq.)
103 module procedure kim_temperature_unit_equal
104 end interface operator(.eq.)
111 interface operator(.ne.)
112 module procedure kim_temperature_unit_not_equal
113 end interface operator(.ne.)
123 module procedure kim_temperature_unit_from_string
132 module procedure kim_temperature_unit_to_string
141 logical recursive function kim_temperature_unit_known(temperature_unit)
144 integer(c_int) recursive function known(temperature_unit) &
145 bind(c, name="KIM_TemperatureUnit_Known")
146 use,
intrinsic :: iso_c_binding
149 type(kim_temperature_unit_type),
intent(in),
value :: temperature_unit
152 type(kim_temperature_unit_type),
intent(in) :: temperature_unit
154 kim_temperature_unit_known = (known(temperature_unit) /= 0)
155 end function kim_temperature_unit_known
162 logical recursive function kim_temperature_unit_equal(lhs, rhs)
164 type(kim_temperature_unit_type),
intent(in) :: lhs
165 type(kim_temperature_unit_type),
intent(in) :: rhs
167 kim_temperature_unit_equal &
168 = (lhs%temperature_unit_id == rhs%temperature_unit_id)
169 end function kim_temperature_unit_equal
176 logical recursive function kim_temperature_unit_not_equal(lhs, rhs)
178 type(kim_temperature_unit_type),
intent(in) :: lhs
179 type(kim_temperature_unit_type),
intent(in) :: rhs
181 kim_temperature_unit_not_equal = .not. (lhs == rhs)
182 end function kim_temperature_unit_not_equal
191 recursive subroutine kim_temperature_unit_from_string(string, &
195 type(kim_temperature_unit_type)
recursive function from_string(string) &
196 bind(c, name="KIM_TemperatureUnit_FromString")
197 use,
intrinsic :: iso_c_binding
200 character(c_char),
intent(in) :: string(*)
201 end function from_string
203 character(len=*, kind=c_char),
intent(in) :: string
204 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
206 temperature_unit = from_string(trim(string)//c_null_char)
207 end subroutine kim_temperature_unit_from_string
214 recursive subroutine kim_temperature_unit_to_string(temperature_unit, string)
215 use kim_convert_string_module,
only: kim_convert_c_char_ptr_to_string
218 type(c_ptr)
recursive function get_string(temperature_unit) &
219 bind(c, name="KIM_TemperatureUnit_ToString")
220 use,
intrinsic :: iso_c_binding
223 type(kim_temperature_unit_type),
intent(in),
value :: temperature_unit
226 type(kim_temperature_unit_type),
intent(in) :: temperature_unit
227 character(len=*, kind=c_char),
intent(out) :: string
232 call kim_convert_c_char_ptr_to_string(p, string)
233 end subroutine kim_temperature_unit_to_string
242 number_of_temperature_units)
245 recursive subroutine get_number_of_temperature_units( &
246 number_of_temperature_units) &
247 bind(c, name="KIM_TEMPERATURE_UNIT_GetNumberOfTemperatureUnits")
248 use,
intrinsic :: iso_c_binding
250 integer(c_int),
intent(out) :: number_of_temperature_units
251 end subroutine get_number_of_temperature_units
253 integer(c_int),
intent(out) :: number_of_temperature_units
255 call get_number_of_temperature_units(number_of_temperature_units)
265 temperature_unit, ierr)
268 integer(c_int) recursive function get_temperature_unit(index, &
270 bind(c, name="KIM_TEMPERATURE_UNIT_GetTemperatureUnit")
271 use,
intrinsic :: iso_c_binding
274 integer(c_int),
intent(in),
value :: index
276 end function get_temperature_unit
278 integer(c_int),
intent(in) :: index
280 integer(c_int),
intent(out) :: ierr
282 ierr = get_temperature_unit(index - 1, temperature_unit)
TemperatureUnit(std::string const &)
Determines if the object is a quantity known to the KIM API.
Converts the object to a string.
An Extensible Enumeration for the TemperatureUnit's supported by the KIM API.
type(kim_temperature_unit_type), save, bind(C, name="KIM_TEMPERATURE_UNIT_K"), public, protected kim_temperature_unit_k
The standard Kelvin unit of temperature.
recursive subroutine, public kim_get_temperature_unit(index, temperature_unit, ierr)
Get the identity of each defined standard TemperatureUnit.
recursive subroutine, public kim_get_number_of_temperature_units(number_of_temperature_units)
Get the number of standard TemperatureUnit's defined by the KIM API.
type(kim_temperature_unit_type), save, bind(C, name="KIM_TEMPERATURE_UNIT_unused"), public, protected kim_temperature_unit_unused
Indicates that a TemperatureUnit is not used.
An Extensible Enumeration for the TemperatureUnit's supported by the KIM API.