39 use,
intrinsic :: iso_c_binding
45 kim_temperature_unit_type, &
63 type, bind(c) :: kim_temperature_unit_type
70 integer(c_int) temperature_unit_id
71 end type kim_temperature_unit_type
78 type(kim_temperature_unit_type),
protected,
save, &
79 bind(c, name=
"KIM_TEMPERATURE_UNIT_unused") &
87 type(kim_temperature_unit_type),
protected,
save, &
88 bind(c, name=
"KIM_TEMPERATURE_UNIT_K") &
97 module procedure kim_temperature_unit_known
98 end interface kim_known
105 interface operator(.eq.)
106 module procedure kim_temperature_unit_equal
107 end interface operator(.eq.)
114 interface operator(.ne.)
115 module procedure kim_temperature_unit_not_equal
116 end interface operator(.ne.)
125 interface kim_from_string
126 module procedure kim_temperature_unit_from_string
127 end interface kim_from_string
134 interface kim_to_string
135 module procedure kim_temperature_unit_to_string
136 end interface kim_to_string
144 logical recursive function kim_temperature_unit_known(temperature_unit)
147 integer(c_int) recursive function known(temperature_unit) &
148 bind(c, name=
"KIM_TemperatureUnit_Known")
149 use,
intrinsic :: iso_c_binding
150 import kim_temperature_unit_type
152 type(kim_temperature_unit_type),
intent(in),
value :: temperature_unit
155 type(kim_temperature_unit_type),
intent(in) :: temperature_unit
157 kim_temperature_unit_known = (known(temperature_unit) /= 0)
158 end function kim_temperature_unit_known
165 logical recursive function kim_temperature_unit_equal(lhs, rhs)
167 type(kim_temperature_unit_type),
intent(in) :: lhs
168 type(kim_temperature_unit_type),
intent(in) :: rhs
170 kim_temperature_unit_equal &
171 = (lhs%temperature_unit_id == rhs%temperature_unit_id)
172 end function kim_temperature_unit_equal
179 logical recursive function kim_temperature_unit_not_equal(lhs, rhs)
181 type(kim_temperature_unit_type),
intent(in) :: lhs
182 type(kim_temperature_unit_type),
intent(in) :: rhs
184 kim_temperature_unit_not_equal = .not. (lhs == rhs)
185 end function kim_temperature_unit_not_equal
194 recursive subroutine kim_temperature_unit_from_string(string, &
198 type(kim_temperature_unit_type)
recursive function from_string(string) &
199 bind(c, name=
"KIM_TemperatureUnit_FromString")
200 use,
intrinsic :: iso_c_binding
201 import kim_temperature_unit_type
203 character(c_char),
intent(in) :: string(*)
204 end function from_string
206 character(len=*, kind=c_char),
intent(in) :: string
207 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
209 temperature_unit = from_string(trim(string)//c_null_char)
210 end subroutine kim_temperature_unit_from_string
217 recursive subroutine kim_temperature_unit_to_string(temperature_unit, string)
218 use kim_convert_string_module
, only: kim_convert_c_char_ptr_to_string
221 type(c_ptr)
recursive function get_string(temperature_unit) &
222 bind(c, name=
"KIM_TemperatureUnit_ToString")
223 use,
intrinsic :: iso_c_binding
224 import kim_temperature_unit_type
226 type(kim_temperature_unit_type),
intent(in),
value :: temperature_unit
227 end function get_string
229 type(kim_temperature_unit_type),
intent(in) :: temperature_unit
230 character(len=*, kind=c_char),
intent(out) :: string
234 p = get_string(temperature_unit)
235 call kim_convert_c_char_ptr_to_string(p, string)
236 end subroutine kim_temperature_unit_to_string
245 number_of_temperature_units)
248 recursive subroutine get_number_of_temperature_units( &
249 number_of_temperature_units) &
250 bind(c, name=
"KIM_TEMPERATURE_UNIT_GetNumberOfTemperatureUnits")
251 use,
intrinsic :: iso_c_binding
253 integer(c_int),
intent(out) :: number_of_temperature_units
254 end subroutine get_number_of_temperature_units
256 integer(c_int),
intent(out) :: number_of_temperature_units
258 call get_number_of_temperature_units(number_of_temperature_units)
268 temperature_unit, ierr)
271 integer(c_int) recursive function get_temperature_unit(index, &
273 bind(c, name=
"KIM_TEMPERATURE_UNIT_GetTemperatureUnit")
274 use,
intrinsic :: iso_c_binding
275 import kim_temperature_unit_type
277 integer(c_int),
intent(in),
value :: index
278 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
279 end function get_temperature_unit
281 integer(c_int),
intent(in) :: index
282 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
283 integer(c_int),
intent(out) :: ierr
285 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.