Octopus
output_low.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
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
23 use debug_oct_m
25 use global_oct_m
26 use mesh_oct_m
28
29 implicit none
30
31 private
32 public :: &
33 output_t, &
36
37 type output_me_t
38 logical, public :: what(MAX_OUTPUT_TYPES)
43 integer :: ks_multipoles
44
45 integer :: st_start
46 integer :: st_end
47 integer :: nst
48 type(elec_matrix_elements_t) :: elec_me
49 end type output_me_t
50
51 type output_bgw_t
52 !private
53 integer :: nbands
54 integer :: vxc_diag_nmin
55 integer :: vxc_diag_nmax
56 integer :: vxc_offdiag_nmin
57 integer :: vxc_offdiag_nmax
58 logical :: complex
59 character(len=80) :: wfn_filename
60 logical :: calc_exchange
61 logical :: calc_vmtxel
62 integer :: vmtxel_ncband
63 integer :: vmtxel_nvband
64 real(real64) :: vmtxel_polarization(3)
65 end type output_bgw_t
66
67
70 type output_t
71 !private
73 logical, public :: what(MAX_OUTPUT_TYPES)
74 integer(int64), public :: how(0:MAX_OUTPUT_TYPES)
75
76 type(output_me_t) :: me
77
78 ! These variables fine-tune the output for some of the possible output options:
79 integer, public :: output_interval(0:MAX_OUTPUT_TYPES)
80 integer, public :: restart_write_interval
81 logical, public :: duringscf
82 character(len=80), public :: wfs_list
83 character(len=MAX_PATH_LEN), public :: iter_dir
84
85 type(mesh_plane_t) :: plane
86 type(mesh_line_t) :: line
87
88 type(output_bgw_t) :: bgw
89
90 contains
91 procedure :: what_now => output_what_now
92 procedure :: anything_now => output_anything_now
93 end type output_t
94
95contains
96
97 ! ---------------------------------------------------------
98
99 function output_what_now(this, what_id, iter) result(write_now)
100 class(output_t), intent(in) :: this
101 integer(int64), intent(in) :: what_id
102 integer, intent(in) :: iter
103
104 logical :: write_now
105
106 write_now = .false.
107 if ((what_id > 0) .and. (this%output_interval(what_id) > 0)) then
108 if (this%what(what_id) .and. (iter == -1 .or. mod(iter, this%output_interval(what_id)) == 0)) then
109 write_now = .true.
110 end if
111 end if
112
113 end function output_what_now
114
115 ! ---------------------------------------------------------
117 logical function output_anything_now(this, iter)
118 class(output_t), intent(in) :: this
119 integer, intent(in) :: iter
120
121 integer(int64) :: what_it
122
123 push_sub(output_anything_now)
124
125 output_anything_now = .false.
126 do what_it = lbound(this%output_interval, 1), ubound(this%output_interval, 1)
127 if (this%what_now(what_it, iter)) then
129 exit
130 end if
131 end do
132
133 pop_sub(output_anything_now)
134 end function output_anything_now
135
137
138!! Local Variables:
139!! mode: f90
140!! coding: utf-8
141!! End:
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:118
this module contains the output system
Definition: output_low.F90:115
logical function output_what_now(this, what_id, iter)
Definition: output_low.F90:193
logical function output_anything_now(this, iter)
return true if any output is to be written now
Definition: output_low.F90:211
output handler class
Definition: output_low.F90:163
int true(void)