KIM API V2
kim_energy_unit_module.f90
Go to the documentation of this file.
1 !
2 ! CDDL HEADER START
3 !
4 ! The contents of this file are subject to the terms of the Common Development
5 ! and Distribution License Version 1.0 (the "License").
6 !
7 ! You can obtain a copy of the license at
8 ! http://www.opensource.org/licenses/CDDL-1.0. See the License for the
9 ! specific language governing permissions and limitations under the License.
10 !
11 ! When distributing Covered Code, include this CDDL HEADER in each file and
12 ! include the License file in a prominent location with the name LICENSE.CDDL.
13 ! If applicable, add the following below this CDDL HEADER, with the fields
14 ! enclosed by brackets "[]" replaced with your own identifying information:
15 !
16 ! Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
17 !
18 ! CDDL HEADER END
19 !
20 
21 !
22 ! Copyright (c) 2016--2018, Regents of the University of Minnesota.
23 ! All rights reserved.
24 !
25 ! Contributors:
26 ! Ryan S. Elliott
27 !
28 
29 !
30 ! Release: This file is part of the kim-api-v2.0.0-beta.0 package.
31 !
32 
33 
35  use, intrinsic :: iso_c_binding
36  implicit none
37  private
38 
39  public &
40  kim_energy_unit_type, &
41  kim_energy_unit_from_string, &
42  operator (.eq.), &
43  operator (.ne.), &
44  kim_energy_unit_string, &
45 
53 
54  kim_energy_unit_get_number_of_energy_units, &
55  kim_energy_unit_get_energy_unit
56 
57 
58  type, bind(c) :: kim_energy_unit_type
59  integer(c_int) energy_unit_id
60  end type kim_energy_unit_type
61 
62  type(kim_energy_unit_type), protected, &
63  bind(c, name="KIM_ENERGY_UNIT_unsued") &
65  type(kim_energy_unit_type), protected, &
66  bind(c, name="KIM_ENERGY_UNIT_amu_A2_per_ps2") &
68  type(kim_energy_unit_type), protected, &
69  bind(c, name="KIM_ENERGY_UNIT_erg") &
71  type(kim_energy_unit_type), protected, &
72  bind(c, name="KIM_ENERGY_UNIT_eV") &
74  type(kim_energy_unit_type), protected, &
75  bind(c, name="KIM_ENERGY_UNIT_Hartree") &
77  type(kim_energy_unit_type), protected, &
78  bind(c, name="KIM_ENERGY_UNIT_J") &
80  type(kim_energy_unit_type), protected, &
81  bind(c, name="KIM_ENERGY_UNIT_kcal_mol") &
83 
84  interface operator (.eq.)
85  logical function kim_energy_unit_equal(left, right)
86  use, intrinsic :: iso_c_binding
87  import kim_energy_unit_type
88  implicit none
89  type(kim_energy_unit_type), intent(in) :: left
90  type(kim_energy_unit_type), intent(in) :: right
91  end function kim_energy_unit_equal
92  end interface operator (.eq.)
93 
94  interface operator (.ne.)
95  logical function kim_energy_unit_not_equal(left, right)
96  use, intrinsic :: iso_c_binding
97  import kim_energy_unit_type
98  implicit none
99  type(kim_energy_unit_type), intent(in) :: left
100  type(kim_energy_unit_type), intent(in) :: right
101  end function kim_energy_unit_not_equal
102  end interface operator (.ne.)
103 
104  interface
105  subroutine kim_energy_unit_from_string(string, energy_unit)
106  use, intrinsic :: iso_c_binding
107  import kim_energy_unit_type
108  implicit none
109  character(len=*, kind=c_char), intent(in) :: string
110  type(kim_energy_unit_type), intent(out) :: energy_unit
111  end subroutine kim_energy_unit_from_string
112 
113  subroutine kim_energy_unit_string(energy_unit, string)
114  use, intrinsic :: iso_c_binding
115  import kim_energy_unit_type
116  implicit none
117  type(kim_energy_unit_type), intent(in), value :: energy_unit
118  character(len=*, kind=c_char), intent(out) :: string
119  end subroutine kim_energy_unit_string
120 
121  subroutine kim_energy_unit_get_number_of_energy_units( &
122  number_of_energy_units)
123  use, intrinsic :: iso_c_binding
124  implicit none
125  integer(c_int), intent(out) :: number_of_energy_units
126  end subroutine kim_energy_unit_get_number_of_energy_units
127 
128  subroutine kim_energy_unit_get_energy_unit(index, energy_unit, ierr)
129  use, intrinsic :: iso_c_binding
130  import kim_energy_unit_type
131  implicit none
132  integer(c_int), intent(in), value :: index
133  type(kim_energy_unit_type), intent(out) :: energy_unit
134  integer(c_int), intent(out) :: ierr
135  end subroutine kim_energy_unit_get_energy_unit
136  end interface
137 end module kim_energy_unit_module
type(kim_energy_unit_type), public, protected kim_energy_unit_ev
type(kim_energy_unit_type), public, protected kim_energy_unit_hartree
type(kim_energy_unit_type), public, protected kim_energy_unit_unused
type(kim_energy_unit_type), public, protected kim_energy_unit_j
type(kim_energy_unit_type), public, protected kim_energy_unit_kcal_mol
type(kim_energy_unit_type), public, protected kim_energy_unit_amu_a2_per_ps2
type(kim_energy_unit_type), public, protected kim_energy_unit_erg