Octopus
photons.F90
Go to the documentation of this file.
1!! Copyright (C) 2021 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
21module photons_oct_m
23 use clock_oct_m
24 use debug_oct_m
25 use global_oct_m
26 use iso_c_binding
28 use mpi_oct_m
31 use parser_oct_m
39 use space_oct_m
40 use system_oct_m
41 use unit_oct_m
43
44 implicit none
45
46 private
47 public :: &
49
50 type :: photons_t
51 private
52 type(photon_mode_t), public :: modes
53 type(space_t) :: space
54 type(namespace_t) :: namespace
55
56 contains
57 final :: photons_finalize
58 end type photons_t
59
60 interface photons_t
61 procedure photons_constructor
62 end interface photons_t
63
64contains
65
66 ! ---------------------------------------------------------
71 function photons_constructor(namespace) result(photons)
72 class(photons_t), pointer :: photons
73 type(namespace_t), intent(in) :: namespace
74
75 push_sub(photons_constructor)
76
77 safe_allocate(photons)
78
79 photons%namespace = namespace
80
81 photons%space = space_t(namespace)
82
83 call photon_mode_init(photons%modes, namespace, photons%space%dim)
84
85 pop_sub(photons_constructor)
86 end function photons_constructor
87
88 ! ---------------------------------------------------------
89 subroutine photons_finalize(this)
90 type(photons_t), intent(inout) :: this
91
92 push_sub(photons_finalize)
93
94 call photon_mode_end(this%modes)
95
96 pop_sub(photons_finalize)
97 end subroutine photons_finalize
98
99end module photons_oct_m
100
101!! Local Variables:
102!! mode: f90
103!! coding: utf-8
104!! End:
This module implements the basic elements defining algorithms.
Definition: algorithm.F90:141
This module implements the multisystem debug functionality.
subroutine, public photon_mode_end(this)
subroutine, public photon_mode_init(this, namespace, dim, photon_free)
class(photons_t) function, pointer photons_constructor(namespace)
The factory routine (or constructor) allocates a pointer of the corresponding type and then calls the...
Definition: photons.F90:165
subroutine photons_finalize(this)
Definition: photons.F90:183
This module implements the basic propagator framework.
Definition: propagator.F90:117
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
Definition: quantity.F90:137
This module implements the abstract system type.
Definition: system.F90:118
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:132
This module defines the unit system, used for input and output.