40 use,
intrinsic :: iso_c_binding
46 kim_temperature_unit_type, &
67 type, bind(c) :: kim_temperature_unit_type
74 integer(c_int) temperature_unit_id
75 end type kim_temperature_unit_type
82 type(kim_temperature_unit_type),
protected,
save, &
83 bind(c, name=
"KIM_TEMPERATURE_UNIT_unused") &
91 type(kim_temperature_unit_type),
protected,
save, &
92 bind(c, name=
"KIM_TEMPERATURE_UNIT_K") &
101 module procedure kim_temperature_unit_known
102 end interface kim_known
109 interface operator (.eq.)
110 module procedure kim_temperature_unit_equal
111 end interface operator (.eq.)
118 interface operator (.ne.)
119 module procedure kim_temperature_unit_not_equal
120 end interface operator (.ne.)
129 interface kim_from_string
130 module procedure kim_temperature_unit_from_string
131 end interface kim_from_string
138 interface kim_to_string
139 module procedure kim_temperature_unit_to_string
140 end interface kim_to_string
148 logical recursive function kim_temperature_unit_known(temperature_unit)
151 integer(c_int) recursive function known(temperature_unit) &
152 bind(c, name=
"KIM_TemperatureUnit_Known")
153 use,
intrinsic :: iso_c_binding
154 import kim_temperature_unit_type
156 type(kim_temperature_unit_type),
intent(in),
value :: temperature_unit
159 type(kim_temperature_unit_type),
intent(in) :: temperature_unit
161 kim_temperature_unit_known = (known(temperature_unit) /= 0)
162 end function kim_temperature_unit_known
169 logical recursive function kim_temperature_unit_equal(lhs, rhs)
171 type(kim_temperature_unit_type),
intent(in) :: lhs
172 type(kim_temperature_unit_type),
intent(in) :: rhs
174 kim_temperature_unit_equal &
175 = (lhs%temperature_unit_id .eq. rhs%temperature_unit_id)
176 end function kim_temperature_unit_equal
183 logical recursive function kim_temperature_unit_not_equal(lhs, rhs)
185 type(kim_temperature_unit_type),
intent(in) :: lhs
186 type(kim_temperature_unit_type),
intent(in) :: rhs
188 kim_temperature_unit_not_equal = .not. (lhs .eq. rhs)
189 end function kim_temperature_unit_not_equal
198 recursive subroutine kim_temperature_unit_from_string(string, &
202 type(kim_temperature_unit_type)
recursive function from_string(string) &
203 bind(c, name=
"KIM_TemperatureUnit_FromString")
204 use,
intrinsic :: iso_c_binding
205 import kim_temperature_unit_type
207 character(c_char),
intent(in) :: string(*)
208 end function from_string
210 character(len=*, kind=c_char),
intent(in) :: string
211 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
213 temperature_unit = from_string(trim(string)//c_null_char)
214 end subroutine kim_temperature_unit_from_string
221 recursive subroutine kim_temperature_unit_to_string(temperature_unit, string)
222 use kim_convert_string_module
, only : kim_convert_c_char_ptr_to_string
225 type(c_ptr)
recursive function get_string(temperature_unit) &
226 bind(c, name=
"KIM_TemperatureUnit_ToString")
227 use,
intrinsic :: iso_c_binding
228 import kim_temperature_unit_type
230 type(kim_temperature_unit_type),
intent(in),
value :: temperature_unit
231 end function get_string
233 type(kim_temperature_unit_type),
intent(in) :: temperature_unit
234 character(len=*, kind=c_char),
intent(out) :: string
238 p = get_string(temperature_unit)
239 call kim_convert_c_char_ptr_to_string(p, string)
240 end subroutine kim_temperature_unit_to_string
249 number_of_temperature_units)
252 recursive subroutine get_number_of_temperature_units( &
253 number_of_temperature_units) &
254 bind(c, name=
"KIM_TEMPERATURE_UNIT_GetNumberOfTemperatureUnits")
255 use,
intrinsic :: iso_c_binding
257 integer(c_int),
intent(out) :: number_of_temperature_units
258 end subroutine get_number_of_temperature_units
260 integer(c_int),
intent(out) :: number_of_temperature_units
262 call get_number_of_temperature_units(number_of_temperature_units)
272 temperature_unit, ierr)
275 integer(c_int) recursive function get_temperature_unit(index, &
277 bind(c, name=
"KIM_TEMPERATURE_UNIT_GetTemperatureUnit")
278 use,
intrinsic :: iso_c_binding
279 import kim_temperature_unit_type
281 integer(c_int),
intent(in),
value :: index
282 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
283 end function get_temperature_unit
285 integer(c_int),
intent(in) :: index
286 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
287 integer(c_int),
intent(out) :: ierr
289 ierr = get_temperature_unit(index-1, temperature_unit)
recursive subroutine, public kim_get_temperature_unit(index, temperature_unit, ierr)
Get the identity of each defined standard TemperatureUnit.
type(kim_temperature_unit_type), save, public, protected kim_temperature_unit_k
type(kim_temperature_unit_type), save, public, protected kim_temperature_unit_unused
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.
An Extensible Enumeration for the TemperatureUnit's supported by the KIM API.