KIM API V2
kim_time_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.1 package.
31 !
32 
33 
35  use, intrinsic :: iso_c_binding
36  implicit none
37  private
38 
39  public &
40  kim_time_unit_type, &
41  kim_time_unit_from_string, &
42  operator (.eq.), &
43  operator (.ne.), &
44  kim_time_unit_string, &
45 
51 
52  kim_time_unit_get_number_of_time_units, &
53  kim_time_unit_get_time_unit
54 
55 
56  type, bind(c) :: kim_time_unit_type
57  integer(c_int) time_unit_id
58  end type kim_time_unit_type
59 
60  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_unused") &
62  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_fs") &
64  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_ps") &
66  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_ns") &
68  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_s") &
70 
71  interface operator (.eq.)
72  logical function kim_time_unit_equal(left, right)
73  use, intrinsic :: iso_c_binding
74  import kim_time_unit_type
75  implicit none
76  type(kim_time_unit_type), intent(in) :: left
77  type(kim_time_unit_type), intent(in) :: right
78  end function kim_time_unit_equal
79  end interface operator (.eq.)
80 
81  interface operator (.ne.)
82  logical function kim_time_unit_not_equal(left, right)
83  use, intrinsic :: iso_c_binding
84  import kim_time_unit_type
85  implicit none
86  type(kim_time_unit_type), intent(in) :: left
87  type(kim_time_unit_type), intent(in) :: right
88  end function kim_time_unit_not_equal
89  end interface operator (.ne.)
90 
91  interface
92  subroutine kim_time_unit_from_string(string, time_unit)
93  use, intrinsic :: iso_c_binding
94  import kim_time_unit_type
95  implicit none
96  character(len=*, kind=c_char), intent(in) :: string
97  type(kim_time_unit_type), intent(out) :: time_unit
98  end subroutine kim_time_unit_from_string
99 
100  subroutine kim_time_unit_string(time_unit, string)
101  use, intrinsic :: iso_c_binding
102  import kim_time_unit_type
103  implicit none
104  type(kim_time_unit_type), intent(in), value :: time_unit
105  character(len=*, kind=c_char), intent(out) :: string
106  end subroutine kim_time_unit_string
107 
108  subroutine kim_time_unit_get_number_of_time_units(number_of_time_units)
109  use, intrinsic :: iso_c_binding
110  implicit none
111  integer(c_int), intent(out) :: number_of_time_units
112  end subroutine kim_time_unit_get_number_of_time_units
113 
114  subroutine kim_time_unit_get_time_unit(index, time_unit, ierr)
115  use, intrinsic :: iso_c_binding
116  import kim_time_unit_type
117  implicit none
118  integer(c_int), intent(in), value :: index
119  type(kim_time_unit_type), intent(out) :: time_unit
120  integer(c_int), intent(out) :: ierr
121  end subroutine kim_time_unit_get_time_unit
122  end interface
123 end module kim_time_unit_module
type(kim_time_unit_type), public, protected kim_time_unit_ps
type(kim_time_unit_type), public, protected kim_time_unit_unused
type(kim_time_unit_type), public, protected kim_time_unit_fs
type(kim_time_unit_type), public, protected kim_time_unit_s
type(kim_time_unit_type), public, protected kim_time_unit_ns