Octopus
element.F90
Go to the documentation of this file.
1!! Copyright (C) 2015 X. Andrade
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21module element_oct_m
22 use, intrinsic :: iso_fortran_env
23
24 implicit none
25
26 private
27 public :: &
28 element_t, &
35
36 type element_t
37 private
38 integer(int64) :: dummy
39 end type element_t
40
41 interface
42
43 ! -------------------------------------------------
44
45 subroutine element_init(self, symbol)
46 use iso_c_binding
47 import :: element_t
48 implicit none
49
50 type(element_t), intent(out) :: self
51 character(kind=c_char), intent(in) :: symbol(*)
52 end subroutine element_init
53
54 ! -------------------------------------------------
55
56 subroutine element_end(self)
57 import :: element_t
58 implicit none
59
60 type(element_t), intent(inout) :: self
61 end subroutine element_end
62
63 ! ------------------------------------
64
65 real(real64) function element_mass(self)
66 use, intrinsic :: iso_fortran_env
67 import :: element_t
68 implicit none
69
70 type(element_t), intent(in) :: self
71 end function element_mass
72
73 ! ------------------------------------
74
75 real(real64) function element_vdw_radius(self)
76 use, intrinsic :: iso_fortran_env
77 import :: element_t
78 implicit none
79
80 type(element_t), intent(in) :: self
81 end function element_vdw_radius
82
83 ! ------------------------------------
84
85 integer function element_atomic_number(self)
86 import :: element_t
87 implicit none
88
89 type(element_t), intent(in) :: self
90 end function element_atomic_number
91
92 end interface
93
94
95contains
96
97 logical function element_valid(self) result(valid)
98 type(element_t), intent(in) :: self
99
100 interface
101 integer function element_valid_low(self)
102 import :: element_t
103 implicit none
104
105 type(element_t), intent(in) :: self
106 end function element_valid_low
107 end interface
108
109 valid = element_valid_low(self) /= 0
110 end function element_valid
111
112end module element_oct_m
113
114!! Local Variables:
115!! mode: f90
116!! coding: utf-8
117!! End:
logical function, public element_valid(self)
Definition: element.F90:193