36 use,
intrinsic :: iso_c_binding
42 kim_temperature_unit_type, &
60 type, bind(c) :: kim_temperature_unit_type
67 integer(c_int) temperature_unit_id
68 end type kim_temperature_unit_type
75 type(kim_temperature_unit_type),
protected,
save, &
76 bind(c, name=
"KIM_TEMPERATURE_UNIT_unused") &
84 type(kim_temperature_unit_type),
protected,
save, &
85 bind(c, name=
"KIM_TEMPERATURE_UNIT_K") &
94 module procedure kim_temperature_unit_known
95 end interface kim_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.)
122 interface kim_from_string
123 module procedure kim_temperature_unit_from_string
124 end interface kim_from_string
131 interface kim_to_string
132 module procedure kim_temperature_unit_to_string
133 end interface kim_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
147 import kim_temperature_unit_type
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
198 import kim_temperature_unit_type
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
221 import kim_temperature_unit_type
223 type(kim_temperature_unit_type),
intent(in),
value :: temperature_unit
224 end function get_string
226 type(kim_temperature_unit_type),
intent(in) :: temperature_unit
227 character(len=*, kind=c_char),
intent(out) :: string
231 p = get_string(temperature_unit)
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
272 import kim_temperature_unit_type
274 integer(c_int),
intent(in),
value :: index
275 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
276 end function get_temperature_unit
278 integer(c_int),
intent(in) :: index
279 type(kim_temperature_unit_type),
intent(out) :: temperature_unit
280 integer(c_int),
intent(out) :: ierr
282 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.