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 integer, public :: restart_write_interval
82 logical, public :: duringscf
83 character(len=80), public :: wfs_list
84 character(len=MAX_PATH_LEN), public :: iter_dir
85
86 type(mesh_plane_t) :: plane
87 type(mesh_line_t) :: line
88
89 type(output_bgw_t) :: bgw
90
91 contains
92 procedure :: what_now => output_what_now
93 procedure :: anything_now => output_anything_now
94 end type output_t
95
96contains
97
98 ! ---------------------------------------------------------
99
100 function output_what_now(this, what_id, iter) result(write_now)
101 class(output_t), intent(in) :: this
102 integer(int64), intent(in) :: what_id
103 integer, intent(in) :: iter
104
105 logical :: write_now
106
107 write_now = .false.
108 if ((what_id > 0) .and. (this%output_interval(what_id) > 0)) then
109 if (this%what(what_id) .and. (iter == -1 .or. mod(iter, this%output_interval(what_id)) == 0)) then
110 write_now = .true.
111 end if
112 end if
113
114 end function output_what_now
116 ! ---------------------------------------------------------
118 logical function output_anything_now(this, iter)
119 class(output_t), intent(in) :: this
120 integer, intent(in) :: iter
121
122 integer(int64) :: what_it
123
124 push_sub(output_anything_now)
125
126 output_anything_now = .false.
127 do what_it = lbound(this%output_interval, 1), ubound(this%output_interval, 1)
128 if (this%what_now(what_it, iter)) then
130 exit
131 end if
132 end do
133
134 pop_sub(output_anything_now)
135 end function output_anything_now
136
138 function get_filename_with_spin(output, nspin, spin_index) result(filename)
139 character(len=*), intent(in) :: output
140 integer, intent(in) :: nspin
141 integer, intent(in) :: spin_index
142 character(len=MAX_PATH_LEN) :: filename
143
144 if (nspin == 1) then
145 write(filename, fmt='(a)') trim(output)
146 else
147 write(filename, fmt='(a,a,i1)') trim(output), '-sp', spin_index
148 end if
153!! Local Variables:
154!! mode: f90
155!! coding: utf-8
156!! End:
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:118
this module contains the low-level part of the output system
Definition: output_low.F90:115
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:232
logical function output_what_now(this, what_id, iter)
Definition: output_low.F90:194
logical function output_anything_now(this, iter)
return true if any output is to be written now
Definition: output_low.F90:212
Output information for BerkeleyGW.
Definition: output_low.F90:145
Output information for matrix elements.
Definition: output_low.F90:131
output handler class
Definition: output_low.F90:164
int true(void)