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-alpha.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  type, bind(c) :: kim_energy_unit_type
55  integer(c_int) energy_unit_id
56  end type kim_energy_unit_type
57 
58  type(kim_energy_unit_type), protected, &
59  bind(c, name="KIM_ENERGY_UNIT_unsued") &
61  type(kim_energy_unit_type), protected, &
62  bind(c, name="KIM_ENERGY_UNIT_amu_A2_per_ps2") &
64  type(kim_energy_unit_type), protected, &
65  bind(c, name="KIM_ENERGY_UNIT_erg") &
67  type(kim_energy_unit_type), protected, &
68  bind(c, name="KIM_ENERGY_UNIT_eV") &
70  type(kim_energy_unit_type), protected, &
71  bind(c, name="KIM_ENERGY_UNIT_Hartree") &
73  type(kim_energy_unit_type), protected, &
74  bind(c, name="KIM_ENERGY_UNIT_J") &
76  type(kim_energy_unit_type), protected, &
77  bind(c, name="KIM_ENERGY_UNIT_kcal_mol") &
79 
80  interface operator (.eq.)
81  logical function kim_energy_unit_equal(left, right)
82  use, intrinsic :: iso_c_binding
83  import kim_energy_unit_type
84  implicit none
85  type(kim_energy_unit_type), intent(in) :: left
86  type(kim_energy_unit_type), intent(in) :: right
87  end function kim_energy_unit_equal
88  end interface operator (.eq.)
89 
90  interface operator (.ne.)
91  logical function kim_energy_unit_not_equal(left, right)
92  use, intrinsic :: iso_c_binding
93  import kim_energy_unit_type
94  implicit none
95  type(kim_energy_unit_type), intent(in) :: left
96  type(kim_energy_unit_type), intent(in) :: right
97  end function kim_energy_unit_not_equal
98  end interface operator (.ne.)
99 
100  interface
101  subroutine kim_energy_unit_from_string(string, energy_unit)
102  import kim_energy_unit_type
103  implicit none
104  character(len=*), intent(in) :: string
105  type(kim_energy_unit_type), intent(out) :: energy_unit
106  end subroutine kim_energy_unit_from_string
107 
108  subroutine kim_energy_unit_string(energy_unit, string)
109  import kim_energy_unit_type
110  implicit none
111  type(kim_energy_unit_type), intent(in), value :: energy_unit
112  character(len=*), intent(out) :: string
113  end subroutine kim_energy_unit_string
114  end interface
115 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