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
24 use global_oct_m
25 use mesh_oct_m
27
28 implicit none
29
30 private
31 public :: &
32 output_t, &
36
38 type output_me_t
39 logical, public :: what(MAX_OUTPUT_TYPES)
44 integer :: ks_multipoles
45
46 integer :: st_start
47 integer :: st_end
48 integer :: nst
49 end type output_me_t
50
52 type output_bgw_t
53 !private
54 integer :: nbands
55 integer :: vxc_diag_nmin
56 integer :: vxc_diag_nmax
57 integer :: vxc_offdiag_nmin
58 integer :: vxc_offdiag_nmax
59 logical :: complex
60 character(len=80) :: wfn_filename
61 logical :: calc_exchange
62 logical :: calc_vmtxel
63 integer :: vmtxel_ncband
64 integer :: vmtxel_nvband
65 real(real64) :: vmtxel_polarization(3)
66 end type output_bgw_t
67
68
71 type output_t
72 !private
74 logical, public :: what(MAX_OUTPUT_TYPES)
75 integer(int64), public :: how(0:MAX_OUTPUT_TYPES)
76
77 type(output_me_t) :: me
78
79 ! These variables fine-tune the output for some of the possible output options:
80 integer, public :: output_interval(0:MAX_OUTPUT_TYPES)
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
135
137 function get_filename_with_spin(output, nspin, spin_index) result(filename)
138 character(len=*), intent(in) :: output
139 integer, intent(in) :: nspin
140 integer, intent(in) :: spin_index
141 character(len=MAX_PATH_LEN) :: filename
143 if (nspin == 1) then
144 write(filename, fmt='(a)') trim(output)
145 else
146 write(filename, fmt='(a,a,i1)') trim(output), '-sp', spin_index
147 end if
148 end function get_filename_with_spin
152!! Local Variables:
153!! mode: f90
154!! coding: utf-8
155!! End:
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
this module contains the low-level part of the output system
Definition: output_low.F90:117
character(len=max_path_len) function, public get_filename_with_spin(output, nspin, spin_index)
Returns the filame as output, or output-spX is spin polarized.
Definition: output_low.F90:233
logical function output_what_now(this, what_id, iter)
Definition: output_low.F90:195
logical function output_anything_now(this, iter)
return true if any output is to be written now
Definition: output_low.F90:213
Output information for BerkeleyGW.
Definition: output_low.F90:147
Output information for matrix elements.
Definition: output_low.F90:133
output handler class
Definition: output_low.F90:166
int true(void)