KIM API V2
kim_log_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_log_handle_type, &
42  operator (.eq.), &
43  operator (.ne.), &
44  kim_log_create, &
45  kim_log_destroy, &
46  kim_log_get_id, &
47  kim_log_set_id, &
48  kim_log_push_verbosity, &
50  kim_log_log_entry
51 
52  type, bind(c) :: kim_log_handle_type
53  type(c_ptr) :: p = c_null_ptr
54  end type kim_log_handle_type
55 
56  type(kim_log_handle_type), protected &
58 
59  interface operator (.eq.)
60  logical function kim_log_handle_equal(left, right)
61  use, intrinsic :: iso_c_binding
62  import kim_log_handle_type
63  implicit none
64  type(kim_log_handle_type), intent(in) :: left
65  type(kim_log_handle_type), intent(in) :: right
66  end function kim_log_handle_equal
67  end interface operator (.eq.)
68 
69  interface operator (.ne.)
70  logical function kim_log_handle_not_equal(left, right)
71  use, intrinsic :: iso_c_binding
72  import kim_log_handle_type
73  implicit none
74  type(kim_log_handle_type), intent(in) :: left
75  type(kim_log_handle_type), intent(in) :: right
76  end function kim_log_handle_not_equal
77  end interface operator (.ne.)
78 
79  interface
80  subroutine kim_log_create(log_handle, ierr)
81  use, intrinsic :: iso_c_binding
82  import kim_log_handle_type
83  implicit none
84  type(kim_log_handle_type), intent(out) :: log_handle
85  integer(c_int), intent(out) :: ierr
86  end subroutine kim_log_create
87 
88  subroutine kim_log_destroy(log_handle)
89  use, intrinsic :: iso_c_binding
90  import kim_log_handle_type
91  implicit none
92  type(kim_log_handle_type), intent(inout) :: log_handle
93  end subroutine kim_log_destroy
94 
95  subroutine kim_log_get_id(log_handle, id_string)
96  use, intrinsic :: iso_c_binding
97  import kim_log_handle_type
98  implicit none
99  type(kim_log_handle_type), intent(in) :: log_handle
100  character(len=*, kind=c_char), intent(out) :: id_string
101  end subroutine kim_log_get_id
102 
103  subroutine kim_log_set_id(log_handle, id_string)
104  use, intrinsic :: iso_c_binding
105  import kim_log_handle_type
106  implicit none
107  type(kim_log_handle_type), intent(in) :: log_handle
108  character(len=*, kind=c_char), intent(in) :: id_string
109  end subroutine kim_log_set_id
110 
111  subroutine kim_log_push_verbosity(log_handle, log_verbosity)
112  use, intrinsic :: iso_c_binding
113  use :: kim_log_verbosity_module, only : kim_log_verbosity_type
114  import kim_log_handle_type
115  implicit none
116  type(kim_log_handle_type), intent(in) :: log_handle
117  type(kim_log_verbosity_type), intent(in), value :: log_verbosity
118  end subroutine kim_log_push_verbosity
119 
120  subroutine kim_log_pop_verbosity(log_handle)
121  use, intrinsic :: iso_c_binding
122  import kim_log_handle_type
123  implicit none
124  type(kim_log_handle_type), intent(in) :: log_handle
125  end subroutine kim_log_pop_verbosity
126 
127  subroutine kim_log_log_entry(log_handle, log_verbosity, message, &
128  line_number, file_name)
129  use, intrinsic :: iso_c_binding
130  use kim_log_verbosity_module, only : kim_log_verbosity_type
131  import kim_log_handle_type
132  implicit none
133  type(kim_log_handle_type), intent(in) :: log_handle
134  type(kim_log_verbosity_type), intent(in), value :: log_verbosity
135  character(len=*, kind=c_char), intent(in) :: message
136  integer(c_int), intent(in), value :: line_number
137  character(len=*, kind=c_char), intent(in) :: file_name
138  end subroutine kim_log_log_entry
139  end interface
140 end module kim_log_module
type(kim_log_handle_type), public, protected kim_log_null_handle