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-alpha.0 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  type, bind(c) :: kim_time_unit_type
53  integer(c_int) time_unit_id
54  end type kim_time_unit_type
55 
56  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_unused") &
58  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_fs") &
60  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_ps") &
62  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_ns") &
64  type(kim_time_unit_type), protected, bind(c, name="KIM_TIME_UNIT_s") &
66 
67  interface operator (.eq.)
68  logical function kim_time_unit_equal(left, right)
69  use, intrinsic :: iso_c_binding
70  import kim_time_unit_type
71  implicit none
72  type(kim_time_unit_type), intent(in) :: left
73  type(kim_time_unit_type), intent(in) :: right
74  end function kim_time_unit_equal
75  end interface operator (.eq.)
76 
77  interface operator (.ne.)
78  logical function kim_time_unit_not_equal(left, right)
79  use, intrinsic :: iso_c_binding
80  import kim_time_unit_type
81  implicit none
82  type(kim_time_unit_type), intent(in) :: left
83  type(kim_time_unit_type), intent(in) :: right
84  end function kim_time_unit_not_equal
85  end interface operator (.ne.)
86 
87  interface
88  subroutine kim_time_unit_from_string(string, time_unit)
89  import kim_time_unit_type
90  implicit none
91  character(len=*), intent(in) :: string
92  type(kim_time_unit_type), intent(out) :: time_unit
93  end subroutine kim_time_unit_from_string
94 
95  subroutine kim_time_unit_string(time_unit, string)
96  import kim_time_unit_type
97  implicit none
98  type(kim_time_unit_type), intent(in), value :: time_unit
99  character(len=*), intent(out) :: string
100  end subroutine kim_time_unit_string
101  end interface
102 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