Octopus
ext_partner_list.F90
Go to the documentation of this file.
1!! Copyright (C) 2022 N. Tancogne-Dejean
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
22 use debug_oct_m
24 use global_oct_m
26 use lasers_oct_m
28
29 implicit none
30
31 private
32 public :: &
37
38contains
39
40 ! ---------------------------------------------------------
41 logical function list_has_lasers(partners)
42 type(partner_list_t), intent(in) :: partners
43
44 type(partner_iterator_t) :: iter
45 class(interaction_partner_t), pointer :: partner
46
47 push_sub(list_has_lasers)
48
49 list_has_lasers = .false.
50 call iter%start(partners)
51 do while (iter%has_next() .and. .not. list_has_lasers)
52 partner => iter%get_next()
53 select type(partner)
54 type is(lasers_t)
56 end select
57 end do
58
59 pop_sub(list_has_lasers)
60 end function list_has_lasers
61
62 ! ---------------------------------------------------------
63 logical function list_has_gauge_field(partners)
64 type(partner_list_t), intent(in) :: partners
65
66 type(partner_iterator_t) :: iter
67 class(interaction_partner_t), pointer :: partner
68
69 push_sub(list_has_gauge_field)
70
71 list_has_gauge_field = .false.
72 call iter%start(partners)
73 do while (iter%has_next() .and. .not. list_has_gauge_field)
74 partner => iter%get_next()
75 select type(partner)
76 type is(gauge_field_t)
78 end select
79 end do
80
82 end function list_has_gauge_field
83
84 ! ---------------------------------------------------------
85 function list_get_gauge_field(partners) result(value)
86 type(partner_list_t), intent(in) :: partners
87 type(gauge_field_t), pointer :: value
88
89 type(partner_iterator_t) :: iter
90 class(interaction_partner_t), pointer :: partner
91
92 push_sub(list_get_gauge_field)
93
94 value => null()
95 call iter%start(partners)
96 do while (iter%has_next() .and. .not. associated(value))
97 partner => iter%get_next()
98 select type(partner)
99 type is(gauge_field_t)
100 value => partner
101 end select
102 end do
103
104 pop_sub(list_get_gauge_field)
105 end function list_get_gauge_field
106
107
108 ! ---------------------------------------------------------
109 function list_get_lasers(partners) result(value)
110 type(partner_list_t), intent(in) :: partners
111 type(lasers_t), pointer :: value
112
113 type(partner_iterator_t) :: iter
114 class(interaction_partner_t), pointer :: partner
115
116 push_sub(list_get_lasers)
117
118 value => null()
119 call iter%start(partners)
120 do while (iter%has_next() .and. .not. associated(value))
121 partner => iter%get_next()
122 select type(partner)
123 type is(lasers_t)
124 value => partner
125 end select
126 end do
127
128 pop_sub(list_get_lasers)
129 end function list_get_lasers
130
131end module ext_partner_list_oct_m
132
133!! Local Variables:
134!! mode: f90
135!! coding: utf-8
136!! End:
logical function, public list_has_gauge_field(partners)
type(gauge_field_t) function, pointer, public list_get_gauge_field(partners)
logical function, public list_has_lasers(partners)
type(lasers_t) function, pointer, public list_get_lasers(partners)
This module defines classes and functions for interaction partners.
int true(void)