Octopus
io_function.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 atom_oct_m
24 use box_oct_m
26 use comm_oct_m
28 use cube_oct_m
29 use debug_oct_m
31 use fft_oct_m
32 use global_oct_m
33 use index_oct_m
34 use io_oct_m
36 use io_csv_oct_m
37 use iso_c_binding
40 use mesh_oct_m
43 use mpi_oct_m
46#if defined(HAVE_NETCDF)
47 use netcdf
48#endif
50 use parser_oct_m
53 use space_oct_m
55 use unit_oct_m
57 use utils_oct_m
59 use vtk_oct_m
60
61 implicit none
62
63 private
64 public :: &
81
82#if defined(HAVE_NETCDF)
83 public :: &
84 dout_cf_netcdf, &
85 zout_cf_netcdf
86#endif
87
89 integer, parameter, private :: &
90 DOUTPUT_KIND = 1, &
91 zoutput_kind = -1
92
94 character(len=3), parameter :: &
95 index2label(3) = (/ 're ', 'im ', 'abs' /)
96
97
100 end interface io_function_output_vector
101
104 end interface io_function_output_vector_bz
105
108 end interface io_function_output_global_bz
109
112 end interface io_function_output_supercell
113
114
115contains
117 ! ---------------------------------------------------------
118 subroutine io_function_read_what_how_when(namespace, space, what, how, output_interval, &
119 what_tag_in, how_tag_in, output_interval_tag_in, ignore_error)
120 type(namespace_t), intent(in) :: namespace
121 class(space_t), intent(in) :: space
122 logical, intent(inout) :: what(MAX_OUTPUT_TYPES)
123 integer(int64), intent(out) :: how(0:MAX_OUTPUT_TYPES)
124 integer, intent(out) :: output_interval(0:MAX_OUTPUT_TYPES)
125 character(len=*), optional, intent(in) :: what_tag_in
126 character(len=*), optional, intent(in) :: how_tag_in
127 character(len=*), optional, intent(in) :: output_interval_tag_in
128 logical, optional, intent(in) :: ignore_error
129
130 type(block_t) :: blk
131 integer :: ncols, nrows, iout, column_index, what_i
132 integer(int64) :: what_no_how(13)
133 character(len=80) :: what_tag
134 character(len=80) :: how_tag
135 character(len=80) :: output_interval_tag
136 character(len=80) :: output_column_marker
138
139 how = 0_8
140 output_interval = 0_8
141 ncols = 0
142 what_tag = optional_default(what_tag_in, 'Output')
143 how_tag = optional_default(how_tag_in, 'OutputFormat')
144 output_interval_tag = optional_default(output_interval_tag_in, 'OutputInterval')
145
146 call messages_obsolete_variable(namespace, 'OutputHow', 'OutputFormat')
147 call messages_obsolete_variable(namespace, 'Output_KPT', 'Output')
148 call messages_obsolete_variable(namespace, 'OutputLDA_U' , 'Output')
149 call messages_obsolete_variable(namespace, 'OutputEvery', 'OutputInterval')
150
151 !%Variable Output
152 !%Type block
153 !%Default none
154 !%Section Output
155 !%Description
156 !% Specifies what to print.
157 !% Each output must be in a separate row. Optionally individual output formats and output intervals can be defined
158 !% for each row or they can be read separately from <tt>OutputFormat</tt> and <tt>OutputInterval</tt> variables
159 !% in the input file.
160 !% The output files are written at the end of the run into the output directory for the
161 !% relevant kind of run (<i>e.g.</i> <tt>static</tt> for <tt>CalculationMode = gs</tt>).
162 !% Time-dependent simulations print only per iteration, including always the last. The frequency of output per iteration
163 !% (available for <tt>CalculationMode</tt> = <tt>gs</tt>, <tt>unocc</tt>, <tt>td</tt>, and <tt>opt_control</tt>)
164 !% is set by <tt>OutputInterval</tt> and the directory is set by <tt>OutputIterDir</tt>.
165 !% For linear-response run modes, the derivatives of many quantities can be printed, as listed in
166 !% the options below. Indices in the filename are labelled as follows:
167 !% <tt>sp</tt> = spin (or spinor component), <tt>k</tt> = <i>k</i>-point, <tt>st</tt> = state/band.
168 !% There is no tag for directions, given as a letter. The perturbation direction is always
169 !% the last direction for linear-response quantities, and a following +/- indicates the sign of the frequency.
170 !%
171 !% Example (minimal):
172 !% <br><br><tt>%Output
173 !% <br>&nbsp;&nbsp;density
174 !% <br>&nbsp;&nbsp;potential
175 !% <br>%<br></tt>
176 !%
177 !% Example (with OutputFormat):
178 !% <br><br><tt>%Output
179 !% <br>&nbsp;&nbsp;density | cube + axis_z
180 !% <br>&nbsp;&nbsp;potential | cube
181 !% <br>%<br></tt>
182 !%
183 !% Example (with OutputFormat, incomplete):
184 !% <br><br><tt>%Output
185 !% <br>&nbsp;&nbsp;density | cube + axis_z
186 !% <br>&nbsp;&nbsp;potential
187 !% <br>%<br></tt>
188 !%
189 !% Example (tagged):
190 !% <br><br><tt>%Output
191 !% <br>&nbsp;&nbsp;density | "output_format" | cube + axis_z | "output_interval" | 50
192 !% <br>&nbsp;&nbsp;potential | "output_format" | cube | "output_interval" | 20
193 !% <br>%<br></tt>
194 !%
195 !% Example (tagged, incomplete):
196 !% <br><br><tt>%Output
197 !% <br>&nbsp;&nbsp;density | "output_format" | cube + axis_z
198 !% <br>&nbsp;&nbsp;potential | "output_interval" | 20
199 !% <br>%<br></tt>
200 !% Missing information for the incomplete blocks will be parsed form the out-of-block
201 !% definitions. It is also possible to mix the order of columns in the tagged format.
202 !% See <tt>OutputFormat</tt>, and <tt>OutputInterval</tt>.
203 !%Option potential 1
204 !% Outputs Kohn-Sham potential, separated by parts. File names are <tt>v0</tt> for
205 !% the local part of the ionic potential, <tt>vc</tt> for the classical potential (if it exists),
206 !% <tt>vh</tt> for the Hartree potential, <tt>vks</tt> for the local part of the Kohn-Sham potential, and
207 !% <tt>vxc-</tt> for the exchange-correlation potentials. For <tt>vks</tt> and <tt>vxc</tt>,
208 !% a suffix for spin is added in the spin-polarized case.
209 !%Option density 2
210 !% Outputs density. The output file is called <tt>density-</tt>, or <tt>lr_density-</tt> in linear response.
211 !%Option wfs 3
212 !% Outputs wavefunctions. Which wavefunctions are to be printed is specified
213 !% by the variable <tt>OutputWfsNumber</tt> -- see below. The output file is called
214 !% <tt>wf-</tt>, or <tt>lr_wf-</tt> in linear response.
215 !%Option wfs_sqmod 4
216 !% Outputs modulus squared of the wavefunctions.
217 !% The output file is called <tt>sqm-wf-</tt>. For linear response, the filename is <tt>sqm_lr_wf-</tt>.
218 !%Option geometry 5
219 !% Outputs file containing the coordinates of the atoms treated within quantum mechanics.
220 !% If <tt>OutputFormat = xyz</tt>, the file is called <tt>geometry.xyz</tt>; a
221 !% file <tt>crystal.xyz</tt> is written with a supercell geometry if the system is periodic;
222 !% if point charges were defined in the PDB file (see <tt>PDBCoordinates</tt>), they will be output
223 !% in the file <tt>geometry_classical.xyz</tt>.
224 !% If <tt>OutputFormat = xcrysden</tt>, a file called <tt>geometry.xsf</tt> is written.
225 !%Option current 6
226 !% Outputs the total current density. The output file is called <tt>current-</tt>.
227 !% For linear response, the filename is <tt>lr_current-</tt>.
228 !%Option ELF 7
229 !% Outputs electron localization function (ELF). The output file is called <tt>elf-</tt>.
230 !% Only in 2D and 3D.
231 !%Option ELF_basins 8
232 !% Outputs basins of attraction of the ELF. The output file is called
233 !% <tt>elf_rs_basins.info</tt>. Only in 2D and 3D.
234 !%Option Bader 9
235 !% Outputs Laplacian of the density which shows lone pairs, bonded charge concentrations
236 !% and regions subject to electrophilic or nucleophilic attack.
237 !% See RF Bader, <i>Atoms in Molecules: A Quantum Theory</i> (Oxford Univ. Press, Oxford, 1990).
238 !%Option el_pressure 10
239 !% Outputs electronic pressure. See Tao, Vignale, and Tokatly, <i>Phys Rev Lett</i> <b>100</b>, 206405 (2008).
240 !%Option matrix_elements 11
241 !% Outputs a series of matrix elements of the Kohn-Sham states. What is output can
242 !% be controlled by the <tt>OutputMatrixElements</tt> variable.
243 !%Option pol_density 12
244 !% Outputs dipole-moment density <tt>dipole_density-</tt>, or polarizability density <tt>alpha_density-</tt>
245 !% in linear response. If <tt>ResponseMethod = finite_differences</tt>, the hyperpolarizability density
246 !% <tt>beta_density-</tt> is also printed.
247 !%Option mesh_r 13
248 !% Outputs values of the coordinates over the grid. Files
249 !% will be called <tt>mesh_r-</tt> followed by the direction.
250 !%Option kinetic_energy_density 14
251 !% Outputs kinetic-energy density, defined as:
252 !%
253 !% <math>\tau_\sigma(\vec{r}) = \sum_{i=1}^{N_\sigma}
254 !% \left| \vec{\nabla} \phi_{i\sigma}(\vec{r}) \right|^2\,. </math>
255 !%
256 !% The index <math>\sigma</math> is the spin index for the spin-polarized case,
257 !% or if you are using spinors. For spin-unpolarized calculations, you
258 !% get the total kinetic-energy density. The previous expression assumes full
259 !% or null occupations. If fractional occupation numbers, each term in the sum
260 !% is weighted by the occupation. Also, if we are working with an infinite
261 !% system, all <i>k</i>-points are summed up, with their corresponding weights. The
262 !% files will be called <tt>tau-sp1</tt> and <tt>tau-sp2</tt>, if the spin-resolved kinetic
263 !% energy density is produced (runs in spin-polarized and spinors mode), or
264 !% only <tt>tau</tt> if the run is in spin-unpolarized mode.
265 !%
266 !% Note that the code does not the U(1)gauge-invariant kinetic energy density, but simply the kinetic energy density.
267 !%Option dos 15
268 !% Outputs density of states. See <tt>DOSEnergyMax</tt>, <tt>DOSEnergyMin</tt>, <tt>DOSEnergyPoints</tt>,
269 !% and <tt>DOSGamma</tt>.
270 !%Option tpa 16
271 !% Outputs transition-potential approximation (TPA) matrix elements, using <math>\vec{q}</math>-vector specified
272 !% by <tt>MomentumTransfer</tt>.
273 !%Option forces 17
274 !% Outputs file <tt>forces.xsf</tt> containing structure and forces on the atoms as
275 !% a vector associated with each atom, which can be visualized with XCrySDen.
276 !%Option wfs_fourier 18
277 !% (Experimental) Outputs wavefunctions in Fourier space. This is
278 !% only implemented for the ETSF file format output. The file will
279 !% be called <tt>wfs-pw-etsf.nc</tt>.
280 !%Option xc_density 19
281 !% Outputs the XC density, which is the charge density that
282 !% generates the XC potential. (This is <math>-1/4\pi</math> times
283 !% the Laplacian of the XC potential). The files are called <tt>nxc</tt>.
284 !%Option PES_wfs 20
285 !% Outputs the photoelectron wavefunctions. The file name is <tt>pes_wfs-</tt>
286 !% plus the orbital number.
287 !%Option PES_density 21
288 !% Outputs the photolectron density. Output file is <tt>pes_dens-</tt> plus spin species if
289 !% spin-polarized calculation is performed.
290 !%Option PES 22
291 !% Outputs the time-dependent photoelectron spectrum.
292 !%Option BerkeleyGW 23
293 !% Output for a run with <a href=http://www.berkeleygw.org>BerkeleyGW</a>.
294 !% See <tt>Output::BerkeleyGW</tt> for further specification.
295 !%Option delta_perturbation 24
296 !% Outputs the "kick", or time-delta perturbation applied to compute optical response in real time.
297 !%Option external_td_potential 25
298 !% Outputs the (scalar) time-dependent potential.
299 !%Option mmb_wfs 26
300 !% Triggers the ModelMB wavefunctions to be output for each state.
301 !%Option mmb_den 27
302 !% Triggers the ModelMB density matrix to be output for each state, and the particles
303 !% specified by the <tt>DensitytoCalc</tt> block. Calculates, and outputs, the reduced density
304 !% matrix. For the moment the trace is made over the second dimension, and
305 !% the code is limited to 2D. The idea is to model <i>N</i> particles in 1D as an
306 !% <i>N</i>-dimensional non-interacting problem, then to trace out <i>N</i>-1 coordinates.
307 !%Option potential_gradient 28
308 !% Prints the gradient of the potential.
309 !%Option energy_density 29
310 !% Outputs the total energy density to a file called
311 !% <tt>energy_density</tt>.
312 !%Option heat_current 30
313 !% Outputs the total heat current density. The output file is
314 !% called <tt>heat_current-</tt>.
315 !%Option photon_correlator 31
316 !% Outputs the electron-photon correlation function. The output file is
317 !% called <tt>photon_correlator</tt>.
318 !%Option J_flow 32
319 !% todo: document J_flow option!
320 !%Option current_kpt 33
321 !% Outputs the current density resolved in momentum space. The output file is called <tt>current_kpt-</tt>.
322 !%Option density_kpt 34
323 !% Outputs the electronic density resolved in momentum space.
324 !%Option occ_matrices 35
325 !% Only for DFT+U calculations.
326 !% Outputs the occupation matrices of DFT+U
327 !%Option effectiveU 36
328 !% Only for DFT+U calculations.
329 !% Outputs the value of the effectiveU for each atoms
330 !%Option magnetization 37
331 !% Only for DFT+U calculations.
332 !% Outputs file containing structure and magnetization of the localized subspace
333 !% on the atoms as a vector associated with each atom, which can be visualized.
334 !% For the moment, it only works if a +U is added on one type of orbital per atom.
335 !%Option local_orbitals 38
336 !% Only for DFT+U calculations.
337 !% Outputs the localized orbitals that form the correlated subspace
338 !%Option kanamoriU 39
339 !% Only for DFT+U calculations.
340 !% Outputs the Kanamori interaction parameters U, U`, and J.
341 !% These parameters are not determined self-consistently, but are taken from the
342 !% occupation matrices and Coulomb integrals comming from a standard +U calculation.
343 !%Option xc_torque 40
344 !% Outputs the exchange-correlation torque. Only for the spinor case and in the 3D case.
345 !%Option eigenval_kpt 41
346 !% Outputs the eigenvalues resolved in momentum space, with one file for each band.
347 !%Option stress 42
348 !% Outputs the stress tensor and each of its contributing terms
349 !%Option current_dia 43
350 !% Outputs the diamagnetic current density from a non-uniform vector potential.
351 !% The output file is called <tt>current_dia-</tt>.
352 !%Option jdos 44
353 !% Outputs the joint density of states.
354 !% The same variables as for the regular DOS are used to control the energies and broadening.
355 !%Option ldos 45
356 !% Outputs the local density of states
357 !% The broadening uses the same value as the regular DOS. The energies at which the LDOS is computed are
358 !% specified by the <tt>LDOSEnergies</tt> block.
359 !%Option pdos 46
360 !% Outputs the projected density of states.
361 !% At the moment, the PDOS is computed from the bare pseudo-atomic orbitals, directly taken from
362 !% the pseudopotentials. The orbitals are not orthonormalized, in order to preserve their
363 !% atomic orbitals character. As a consequence, the sum of the different PDOS does not integrate
364 !% to the total DOS.
365 !%
366 !% The radii of the orbitals are controled by the threshold defined by <tt>AOThreshold</tt>,
367 !% and the fact that they are normalized or not by <tt>AONormalize</tt>.
368 !%End
369
370 !%Variable OutputFormat
371 !%Type flag
372 !%Default 0
373 !%Section Output
374 !%Description
375 !% Describes the format of the output files.
376 !% This variable can also be defined inside the <tt>Output</tt> block.
377 !% See <tt>Output</tt>.
378 !% Example: <tt>axis_x + plane_x + dx</tt>
379 !%Option axis_x bit(0)
380 !% The values of the function on the <i>x</i> axis are printed. The string <tt>.y=0,z=0</tt> is appended
381 !% to previous file names.
382 !% For non-orthogonal cells, this correspond to the first lattice vector instead the x axis.
383 !%Option axis_y bit(1)
384 !% The values of the function on the <i>y</i> axis are printed. The string <tt>.x=0,z=0</tt> is appended
385 !% to previous file names.
386 !% For non-orthogonal cells, this correspond to the second lattice vector instead the y axis.
387 !%Option axis_z bit(2)
388 !% The values of the function on the <i>z</i> axis are printed. The string <tt>.x=0,y=0</tt> is appended
389 !% to previous file names.
390 !% For non-orthogonal cells, this correspond to the third lattice vector instead the z axis.
391 !%Option plane_x bit(3)
392 !% A plane slice at <i>x</i> = 0 is printed. The string <tt>.x=0</tt> is appended
393 !% to previous file names.
394 !%Option plane_y bit(4)
395 !% A plane slice at <i>y</i> = 0 is printed. The string <tt>.y=0</tt> is appended
396 !% to previous file names.
397 !%Option plane_z bit(5)
398 !% A plane slice at <i>z</i> = 0 is printed. The string <tt>.z=0</tt> is appended to
399 !% previous file names.
400 !%Option dx bit(6)
401 !% For printing three-dimensional information, the open-source program
402 !% visualization tool <a href=http://www.opendx.org>OpenDX</a> can be used. The string
403 !% <tt>.dx</tt> is appended to previous file names. Available only in 3D.
404 !%Option netcdf bit(7)
405 !% Outputs in <a href=http://www.unidata.ucar.edu/packages/netcdf>NetCDF</a> format. This file
406 !% can then be read, for example, by OpenDX. The string <tt>.ncdf</tt> is appended to previous file names.
407 !% Requires the NetCDF library. Only writes the real part of complex functions.
408 !%Option mesh_index bit(8)
409 !% Generates output files of a given quantity (density, wavefunctions, ...) which include
410 !% the internal numbering of mesh points. Since this mode produces large datafiles this is only
411 !% useful for small meshes and debugging purposes.
412 !% The output can also be used to display the mesh directly. A Gnuplot script for mesh visualization
413 !% can be found under <tt>PREFIX/share/octopus/util/display_mesh_index.gp</tt>.
414 !%Option xcrysden bit(9)
415 !% A format for printing structures and three-dimensional information, which can be visualized by
416 !% the free open-source program <a href=http://www.xcrysden.org>XCrySDen</a> and others. The string
417 !% <tt>.xsf</tt> is appended to previous file names. Note that lattice vectors and coordinates are as
418 !% specified by <tt>UnitsOutput</tt>. Available in 2D and 3D.
419 !%Option matlab bit(10)
420 !% In combination with <tt>plane_x</tt>, <tt>plane_y</tt> and
421 !% <tt>plane_z</tt>, this option produces output files which are
422 !% suitable for 2D Matlab functions like <tt>mesh()</tt>,
423 !% <tt>surf()</tt>, or <tt>waterfall()</tt>. To load these files
424 !% into Matlab you can use, <i>e.g.</i>
425 !%<tt>
426 !% >> density = load('static/density-1.x=0.matlab.abs');
427 !% >> mesh(density);
428 !%</tt>
429 !%Option meshgrid bit(11)
430 !% Outputs in Matlab mode the internal mesh in a format similar to
431 !%<tt>
432 !% >> [x,y] = meshgrid(-2:.2:2,-1:.15:1)
433 !%</tt>
434 !% The <i>x</i> meshgrid is contained in a file <tt>*.meshgrid.x</tt> and the <i>y</i>-grid can be found in
435 !% <tt>*.meshgrid.y</tt>.
436 !%Option boundary_points bit(12)
437 !% This option includes the output of the mesh enlargement. Default is without.
438 !% Supported only by <tt>binary</tt>, <tt>axis</tt>, <tt>plane</tt>, <tt>mesh_index</tt>,
439 !% and <tt>matlab</tt> formats.
440 !% Not all types of <tt>Output</tt> will have this information available. Not supported when parallel in domains.
441 !%Option binary bit(13)
442 !% Plain binary, new format.
443 !%Option xyz bit(15)
444 !% Geometry will be output in XYZ format. Does not affect other outputs.
445 !%Option cube bit(16)
446 !% Generates output in the <a href=http://paulbourke.net/dataformats/cube>cube file format</a>.
447 !% Available only in 3D. Only writes the real part of complex functions.
448 !% This output format always uses atomic units.
449 !%Option bild bit(19)
450 !% Generates output in <a href=http://plato.cgl.ucsf.edu/chimera/docs/UsersGuide/bild.html>BILD format</a>.
451 !%Option vtk bit(20)
452 !% Generates output in <a href=http://www.vtk.org/VTK/img/file-formats.pdf>VTK legacy format</a>.
453 !%Option integrate_xy bit(21)
454 !% Integrates the function in the x-y plane and the result on the <i>z</i> axis is printed.
455 !%Option integrate_xz bit(22)
456 !% Integrates the function in the x-z plane and the result on the <i>y</i> axis is printed
457 !%Option integrate_yz bit(23)
458 !% Integrates the function in the y-z plane and the result on the <i>x</i> axis is printed
459 !%Option ascii bit(24)
460 !% Plain text format regardless of dimensionality. For the moment only employed by the oct-phototoelectron_spectrum
461 !% post-processing utility.
462 !%Option poscar bit(25)
463 !% Write geometry in POSCAR format.
464 !% Note that atoms are not ordered by labels and that species names are taken from the Octopus input,
465 !% and are not truncated to two letters.
466 !%End
467
468 !%Variable OutputInterval
469 !%Type integer
470 !%Default 50
471 !%Section Output
472 !%Description
473 !% The output requested by variable <tt>Output</tt> is written
474 !% to the directory <tt>OutputIterDir</tt>
475 !% when the iteration number is a multiple of the <tt>OutputInterval</tt> variable.
476 !% Subdirectories are named Y.X, where Y is <tt>td</tt>, <tt>scf</tt>, or <tt>unocc</tt>, and
477 !% X is the iteration number. To use the working directory, specify <tt>"."</tt>
478 !% Must be >= 0. If it is 0, then no output is written. For <tt>gs</tt> and <tt>unocc</tt>
479 !% calculations, <tt>OutputDuringSCF</tt> must be set too for this output to be produced.
480 !% This variable can also be defined inside the <tt>Output</tt> block.
481 !% See <tt>Output</tt>.
482 !%End
483
484
485 what_no_how = (/ &
486 option__output__matrix_elements, &
487 option__output__berkeleygw, &
488 option__output__dos, &
489 option__output__tpa, &
490 option__output__mmb_den, &
491 option__output__j_flow, &
492 option__output__occ_matrices, &
493 option__output__effectiveu, &
494 option__output__magnetization, &
495 option__output__kanamoriu, &
496 option__output__stress, &
497 option__output__jdos, &
498 option__output__pdos &
499 /)
500
501 if (parse_block(namespace, what_tag, blk) == 0) then
502 nrows = parse_block_n(blk)
503 do iout = 0, nrows - 1
504 ncols = max(ncols , parse_block_cols(blk, iout))
505 end do
506
507 if (ncols == 1) then
508 !new format, Type 0
509 !%Output
510 ! density
511 ! wfs
512 !%
513 do iout = 1, nrows
514 call parse_block_integer(blk, iout - 1, 0, what_i)
515 if (.not. varinfo_valid_option(what_tag, what_i)) then
516 call messages_input_error(namespace, what_tag)
517 end if
518 if (what_i > 0) then
519 what(what_i) = .true.
520 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
521 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
522 .or. (what_tag /= 'Output')) then
523 call parse_variable(namespace, how_tag, 0, how(what_i))
524 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
525 call messages_input_error(namespace, how_tag)
526 end if
527 end if
528 end if
529 end do
530 else if (ncols == 2) then
531 !new format, Type 1
532 !%Output
533 ! density | cube + axis_z
534 ! wfs | cube
535 !%
536
537 do iout = 1, nrows
538 call parse_block_integer(blk, iout - 1, 0, what_i)
539 if (.not. varinfo_valid_option(what_tag, what_i)) then
540 call messages_input_error(namespace, what_tag)
541 end if
542 if (what_i > 0) then
543 what(what_i) = .true.
544 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
545 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
546 .or. (what_tag /= 'Output')) then
547 call parse_block_integer(blk, iout - 1, 1, how(what_i))
548 if (how(what_i) == 0) call parse_variable(namespace, how_tag, 0, how(what_i))
549 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
550 call messages_input_error(namespace, how_tag)
551 end if
552 end if
553 end if
554 end do
555
556 else
557 !new format, Type 2 (tagged)
558 !%Output
559 ! density | "output_interval" | 10 | "output_format" | cube + axis_z
560 ! wfs | "output_format" | cube | "output_interval" | 50
561 !%
562 !
563 ! OR
564 !
565 !%Output
566 ! density | "output_interval" | 10 | "output_format" | cube + axis_z
567 ! wfs | "output_format" | cube
568 !%
569 do iout = 1, nrows
570 call parse_block_integer(blk, iout - 1, 0, what_i)
571 if (.not. varinfo_valid_option(what_tag, what_i)) then
572 call messages_input_error(namespace, what_tag)
573 end if
574 if (what_i > 0) then
575 what(what_i) = .true.
576 do column_index = 0, 1
577 call parse_block_string(blk, iout - 1, 1 + column_index * 2, output_column_marker)
578 if (output_column_marker == 'output_interval') then
579 call parse_block_integer(blk, iout - 1, 2 + column_index * 2, output_interval(what_i))
580 else if (output_column_marker == 'output_format') then
581 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
582 .or. (what_tag /= 'Output')) then
583 call parse_block_integer(blk, iout - 1, 2 + column_index * 2, how(what_i))
584 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
585 call messages_input_error(namespace, how_tag)
586 end if
587 end if
588 else if (len_trim(output_column_marker) /= 0) then
589 ! Unknown output_column_marker
590 call messages_input_error(namespace, what_tag)
591 else
592 ! no output_column_marker -> full output info is not in this block
593 if (output_interval(what_i) == 0) then
594 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
595 end if
596 if (how(what_i) == 0) then
597 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
598 .or. (what_tag /= 'Output')) then
599 call parse_variable(namespace, how_tag, 0, how(what_i))
600 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
601 call messages_input_error(namespace, how_tag)
602 end if
603 end if
604 end if
605 end if
606 end do
607 end if
608 end do
609 end if
610 call parse_block_end(blk)
611 else
612
613 call messages_variable_is_block(namespace, what_tag)
614
615 ! Output block does not exist but we may have OutputHow/OutputInterval
616 call parse_variable(namespace, how_tag, 0, how(0))
617 call parse_variable(namespace, output_interval_tag, 50, output_interval(0))
618 end if
619
620
621 do what_i = lbound(what, 1), ubound(what, 1)
622 if (what_tag == 'Output') then
623 if (what(what_i) .and. (.not. any(what_no_how == what_i))) then
624 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
625 call messages_input_error(namespace, how_tag)
626 end if
627
628 if (how(what_i) == 0 .and. .not. optional_default(ignore_error, .false.)) then
629 write(message(1), '(a)') 'Must specify output method with variable OutputFormat.'
630 call messages_fatal(1, only_root_writes = .true., namespace=namespace)
631 end if
632
633 ! some modes are not available in some circumstances
634 if (space%dim == 1) then
635 if (bitand(how(what_i), option__outputformat__axis_y) /= 0) then
636 message(1) = "OutputFormat = axis_y not available with Dimensions = 1."
637 call messages_fatal(1, namespace=namespace)
638 end if
639 if (bitand(how(what_i), option__outputformat__plane_z) /= 0) then
640 message(1) = "OutputFormat = plane_z not available with Dimensions = 1."
641 call messages_fatal(1, namespace=namespace)
642 end if
643 if (bitand(how(what_i), option__outputformat__xcrysden) /= 0) then
644 message(1) = "OutputFormat = xcrysden not available with Dimensions = 1."
645 call messages_fatal(1, namespace=namespace)
646 end if
647 end if
648
649 if (space%dim <= 2) then
650 if (bitand(how(what_i), option__outputformat__axis_z) /= 0) then
651 message(1) = "OutputFormat = axis_z not available with Dimensions <= 2."
652 call messages_fatal(1, namespace=namespace)
653 end if
654 if (bitand(how(what_i), option__outputformat__plane_x) /= 0) then
655 message(1) = "OutputFormat = plane_x not available with Dimensions <= 2."
656 call messages_fatal(1, namespace=namespace)
657 end if
658 if (bitand(how(what_i), option__outputformat__plane_y) /= 0) then
659 message(1) = "OutputFormat = plane_y not available with Dimensions <= 2."
660 call messages_fatal(1, namespace=namespace)
661 end if
662 if (bitand(how(what_i), option__outputformat__integrate_xy) /= 0) then
663 message(1) = "OutputFormat = integrate_xy not available with Dimensions <= 2."
664 call messages_fatal(1, namespace=namespace)
665 end if
666 if (bitand(how(what_i), option__outputformat__integrate_xz) /= 0) then
667 message(1) = "OutputFormat = integrate_xz not available with Dimensions <= 2."
668 call messages_fatal(1, namespace=namespace)
669 end if
670 if (bitand(how(what_i), option__outputformat__integrate_yz) /= 0) then
671 message(1) = "OutputFormat = integrate_yz not available with Dimensions <= 2."
672 call messages_fatal(1, namespace=namespace)
673 end if
674 if (bitand(how(what_i), option__outputformat__dx) /= 0) then
675 message(1) = "OutputFormat = dx not available with Dimensions <= 2."
676 call messages_fatal(1, namespace=namespace)
677 end if
678 if (bitand(how(what_i), option__outputformat__cube) /= 0) then
679 message(1) = "OutputFormat = cube not available with Dimensions <= 2."
680 call messages_fatal(1, namespace=namespace)
681 end if
682 if (bitand(how(what_i), option__outputformat__poscar) /= 0) then
683 message(1) = "OutputFormat = POSCAR not available with Dimensions <= 2."
684 call messages_fatal(1, namespace=namespace)
685 end if
686 end if
687
688 if (space%periodic_dim<=2) then
689 if (bitand(how(what_i), option__outputformat__poscar) /= 0) then
690 message(1) = "OutputFormat = POSCAR not available with periodic_dim <= 2."
691 call messages_fatal(1, namespace=namespace)
692 end if
693 end if
694
695#if !defined(HAVE_NETCDF)
696 if (bitand(how(what_i), option__outputformat__netcdf) /= 0) then
697 message(1) = 'Octopus was compiled without NetCDF support.'
698 message(2) = 'It is not possible to write output in NetCDF format.'
699 call messages_fatal(2, namespace=namespace)
700 end if
701#endif
702
703
704 end if
705 end if
706
707 if (output_interval(what_i) < 0) then
708 message(1) = "OutputInterval must be >= 0."
709 call messages_fatal(1, namespace=namespace)
710 end if
711 end do
712
714 end subroutine io_function_read_what_how_when
715
716 ! -------------------------------------------------------------------
719 ! ".", "func", mesh, sb, func, M_ONE, ierr)
720 ! -------------------------------------------------------------------
721 integer(int64) function io_function_fill_how(where) result(how)
722 character(len=*), intent(in) :: where
723
724 push_sub(io_function_fill_how)
725
726 how = 0
727 if (index(where, "AxisX") /= 0) how = ior(how, option__outputformat__axis_x)
728 if (index(where, "AxisY") /= 0) how = ior(how, option__outputformat__axis_y)
729 if (index(where, "AxisZ") /= 0) how = ior(how, option__outputformat__axis_z)
730 if (index(where, "PlaneX") /= 0) how = ior(how, option__outputformat__plane_x)
731 if (index(where, "PlaneY") /= 0) how = ior(how, option__outputformat__plane_y)
732 if (index(where, "PlaneZ") /= 0) how = ior(how, option__outputformat__plane_z)
733 if (index(where, "IntegrateXY") /= 0) how = ior(how, option__outputformat__integrate_xy)
734 if (index(where, "IntegrateXZ") /= 0) how = ior(how, option__outputformat__integrate_xz)
735 if (index(where, "IntegrateYZ") /= 0) how = ior(how, option__outputformat__integrate_yz)
736 if (index(where, "DX") /= 0) how = ior(how, option__outputformat__dx)
737 if (index(where, "XCrySDen") /= 0) how = ior(how, option__outputformat__xcrysden)
738 if (index(where, "Binary") /= 0) how = ior(how, option__outputformat__binary)
739 if (index(where, "MeshIndex") /= 0) how = ior(how, option__outputformat__mesh_index)
740 if (index(where, "XYZ") /= 0) how = ior(how, option__outputformat__xyz)
741#if defined(HAVE_NETCDF)
742 if (index(where, "NETCDF") /= 0) how = ior(how, option__outputformat__netcdf)
743#endif
744 if (index(where, "Cube") /= 0) how = ior(how, option__outputformat__cube)
745 if (index(where, "VTK") /= 0) how = ior(how, option__outputformat__vtk)
746 if (index(where, "ASCII") /= 0) how = ior(how, option__outputformat__ascii)
747 if (index(where, "Bild") /= 0) how = ior(how, option__outputformat__bild)
748
749 pop_sub(io_function_fill_how)
750 end function io_function_fill_how
751
756 subroutine write_standard_xyz_file(namespace, fname, pos, species, header)
757 type(namespace_t), intent(in) :: namespace
758 character(len=*), intent(in) :: fname
759 real(real64), intent(in) :: pos(:,:)
760 character(len=*), intent(in) :: species(:)
761 character(len=*), optional, intent(in) :: header
762
763 integer :: iunit, n_atoms, iatom, min_dim
764 real(real64) :: position(3)
765
767
768 n_atoms = size(pos, 2)
769 assert(size(species) == n_atoms)
770
771 iunit = io_open(trim(fname)//'.xyz', namespace, action='write', position='asis')
772
773 write(iunit, '(i6)') n_atoms
774 if (present(header)) then
775 write(iunit, '(a)') trim(adjustl(header))
776 else
777 write(iunit, '(a)')
778 endif
779
780 ! Ensure a set of three coordinate components is written for 1D, 2D and ND systems
781 min_dim = min(size(pos, 1), 3)
782 position(1:3) = 0.0_real64
783
784 ! xyz-style labels and positions:
785 do iatom = 1, n_atoms
786 position(1:min_dim) = pos(1:min_dim, iatom)
787 write(iunit, '(a10, 3(1x, f15.10))') trim(adjustl(species(iatom))), &
789 end do
790
791 call io_close(iunit)
792
794
795 end subroutine write_standard_xyz_file
796
802 subroutine write_canonicalized_xyz_file(dir, fname, space, latt, pos, atoms, box, namespace)
803 character(len=*), intent(in) :: dir
804 character(len=*), intent(in) :: fname
805 class(space_t), intent(in) :: space
806 type(lattice_vectors_t), intent(in) :: latt
807 real(real64), intent(in) :: pos(:,:)
808 type(atom_t), intent(in) :: atoms(:)
809 class(box_t), intent(in) :: box
810 type(namespace_t), intent(in) :: namespace
811
812 integer :: ia
813 character(len=:), allocatable :: info_str, dir_fname
814 character(len=LABEL_LEN), allocatable :: species(:)
815
817
818 call io_mkdir(dir, namespace)
819
820 info_str = trim(space%short_info()) // '; ' // trim(box%short_info(unit_angstrom))
821 if (space%is_periodic()) then
822 info_str = info_str // '; ' // trim(latt%short_info(unit_angstrom))
823 end if
824
825 safe_allocate(species(1:size(atoms)))
826 do ia = 1, size(atoms)
827 species(ia) = atoms(ia)%get_label()
828 enddo
829
830 dir_fname = trim(dir) // '/' // trim(fname)
831 call write_standard_xyz_file(namespace, dir_fname, pos, species, info_str)
832
833 safe_deallocate_a(species)
834
836
837 end subroutine write_canonicalized_xyz_file
838
839 subroutine write_xsf_geometry_file(dir, fname, space, latt, pos, atoms, mesh, namespace, total_forces)
840 character(len=*), intent(in) :: dir, fname
841 class(space_t), intent(in) :: space
842 type(lattice_vectors_t), intent(in) :: latt
843 real(real64), intent(in) :: pos(:,:)
844 type(atom_t), intent(in) :: atoms(:)
845 class(mesh_t), intent(in) :: mesh
846 type(namespace_t), intent(in) :: namespace
847 real(real64), optional, intent(in) :: total_forces(:,:)
848
849 integer :: iunit
850 real(real64), allocatable :: forces(:,:)
852 if (.not. mpi_world%is_root()) return
853
855
856 call io_mkdir(dir, namespace)
857 iunit = io_open(trim(dir)//'/'//trim(fname)//'.xsf', namespace, action='write', position='asis')
858
859 if (present(total_forces)) then
860 safe_allocate(forces(1:space%dim, 1:size(atoms)))
861 forces = units_from_atomic(units_out%force, total_forces)
862 call write_xsf_geometry(iunit, space, latt, pos, atoms, mesh, forces = forces)
863 safe_deallocate_a(forces)
864 else
865 call write_xsf_geometry(iunit, space, latt, pos, atoms, mesh)
866 end if
867
868 call io_close(iunit)
869
871 end subroutine write_xsf_geometry_file
872
873 ! ---------------------------------------------------------
876 subroutine write_xsf_geometry(iunit, space, latt, pos, atoms, mesh, forces, index)
877 integer, intent(in) :: iunit
878 class(space_t), intent(in) :: space
879 type(lattice_vectors_t), intent(in) :: latt
880 real(real64), intent(in) :: pos(:,:)
881 type(atom_t), intent(in) :: atoms(:)
882 class(mesh_t), intent(in) :: mesh
883 real(real64), optional, intent(in) :: forces(:, :)
884 integer, optional, intent(in) :: index
885
886 integer :: idir, idir2, iatom, index_, natoms
887 character(len=7) :: index_str
888 real(real64) :: offset(space%dim)
889 real(real64) :: rlattice(space%dim, space%dim)
890
891 push_sub(write_xsf_geometry)
892
893 if (present(index)) then
894 write(index_str, '(a,i6)') ' ', index
895 index_ = index
896 else
897 write(index_str, '(a)') ''
898 index_ = 1
899 end if
900 natoms = size(pos, dim=2)
901
902 ! The corner of the cell is always (0,0,0) to XCrySDen
903 ! so the offset is applied to the atomic coordinates.
904 ! Along periodic dimensions the offset is -1/2 in reduced coordinates, as
905 ! our origin is at the center of the cell instead of being at the edge.
906 offset(1:space%dim) = latt%red_to_cart(spread(-m_half, 1, space%dim))
907 ! Offset in aperiodic directions:
908 do idir = space%periodic_dim + 1, space%dim
909 offset(idir) = -(mesh%idx%ll(idir) - 1)/2 * mesh%spacing(idir)
910 end do
911
912 if (space%is_periodic()) then
913 if (index_ == 1) then
914 select case (space%periodic_dim)
915 case (3)
916 write(iunit, '(a)') 'CRYSTAL'
917 case (2)
918 write(iunit, '(a)') 'SLAB'
919 case (1)
920 write(iunit, '(a)') 'POLYMER'
921 end select
922 end if
923
924 write(iunit, '(a)') 'PRIMVEC'//trim(index_str)
925
926 !Computes the rlattice corresponding to the 3D periodic version of the simulation box
927 rlattice = latt%rlattice
928 do idir = space%periodic_dim+1, space%dim
929 rlattice(:,idir) = rlattice(:,idir)*m_two*mesh%box%bounding_box_l(idir)
930 end do
931
932 do idir = 1, space%dim
933 write(iunit, '(3f12.6)') (units_from_atomic(units_out%length, rlattice(idir2, idir)), idir2 = 1, space%dim)
934 end do
935
936 write(iunit, '(a)') 'PRIMCOORD'//trim(index_str)
937 write(iunit, '(i10, a)') natoms, ' 1'
938 else
939 write(iunit, '(a)') 'ATOMS'//trim(index_str)
940 end if
941
942 ! BoxOffset should be considered here
943 do iatom = 1, natoms
944 write(iunit, '(a10, 3f12.6)', advance='no') trim(atoms(iatom)%label), &
945 (units_from_atomic(units_out%length, pos(idir, iatom) - offset(idir)), idir = 1, space%dim)
946 if (present(forces)) then
947 write(iunit, '(5x, 3f12.6)', advance='no') forces(:, iatom)
948 end if
949 write(iunit, '()')
950 end do
951
952 pop_sub(write_xsf_geometry)
953 end subroutine write_xsf_geometry
954
955! ---------------------------------------------------------
958 subroutine write_xsf_geometry_supercell(iunit, space, latt, pos, atoms, mesh, centers, supercell, extra_atom)
959 integer, intent(in) :: iunit
960 class(space_t), intent(in) :: space
961 type(lattice_vectors_t), intent(in) :: latt
962 real(real64), intent(in) :: pos(:,:)
963 type(atom_t), intent(in) :: atoms(:)
964 class(mesh_t), intent(in) :: mesh
965 real(real64), intent(in) :: centers(:, :)
966 integer, intent(in) :: supercell(:)
967 real(real64), optional, intent(in) :: extra_atom(:)
968
969 integer :: idir, idir2, iatom, index_
970 character(len=7) :: index_str
971 real(real64) :: offset(3)
972 integer :: irep, nreplica
973
975
976 write(index_str, '(a)') ''
977 index_ = 1
978
979 nreplica = product(supercell(1:space%dim))
980
981 ! The corner of the cell is always (0,0,0) to XCrySDen
982 ! so the offset is applied to the atomic coordinates.
983 ! Offset in periodic directions:
984 offset(1:space%dim) = latt%red_to_cart(spread(-m_half, 1, space%dim))
985 offset(1:3) = offset(1:3) + centers(1:3,1)
986 ! Offset in aperiodic directions:
987 do idir = space%periodic_dim + 1, 3
988 offset(idir) = -(mesh%idx%ll(idir) - 1)/2 * mesh%spacing(idir)
989 end do
990
991 if(space%is_periodic()) then
992 if(index_ == 1) then
993 select case(space%periodic_dim)
994 case(3)
995 write(iunit, '(a)') 'CRYSTAL'
996 case(2)
997 write(iunit, '(a)') 'SLAB'
998 case(1)
999 write(iunit, '(a)') 'POLYMER'
1000 end select
1001 end if
1002
1003 write(iunit, '(a)') 'PRIMVEC'//trim(index_str)
1004
1005 do idir = 1, space%dim
1006 write(iunit, '(3f12.6)') (units_from_atomic(units_out%length, &
1007 latt%rlattice(idir2, idir)*supercell(idir)), idir2 = 1, space%dim)
1008 end do
1009
1010 write(iunit, '(a)') 'PRIMCOORD'//trim(index_str)
1011 if(.not.present(extra_atom)) then
1012 write(iunit, '(i10, a)') size(atoms)*nreplica, ' 1'
1013 else
1014 write(iunit, '(i10, a)') size(atoms)*nreplica+1, ' 1'
1015 end if
1016 else
1017 write(iunit, '(a)') 'ATOMS'//trim(index_str)
1018 end if
1019
1020
1021 do irep = 1, nreplica
1022 ! BoxOffset should be considered here
1023 do iatom = 1, size(atoms)
1024 write(iunit, '(a10, 3f12.6)', advance='no') trim(atoms(iatom)%label), &
1025 (units_from_atomic(units_out%length, pos(idir, iatom) + centers(idir, irep) &
1026 - offset(idir)), idir = 1, space%dim)
1027 write(iunit, '()')
1028 end do
1029 end do
1030 if(present(extra_atom)) then
1031 write(iunit, '(a10, 3f12.6)', advance='no') 'X', &
1032 (units_from_atomic(units_out%length, extra_atom(idir) - offset(idir)), idir = 1, space%dim)
1033 write(iunit, '()')
1034 end if
1035
1037 end subroutine write_xsf_geometry_supercell
1038
1039
1040#if defined(HAVE_NETCDF)
1041 ! ---------------------------------------------------------
1042 subroutine ncdf_error(func, status, filename, namespace, ierr)
1043 character(len=*), intent(in) :: func
1044 integer, intent(in) :: status
1045 character(len=*), intent(in) :: filename
1046 type(namespace_t), intent(in) :: namespace
1047 integer, intent(inout) :: ierr
1048
1049 push_sub(ncdf_error)
1050
1051 if (status == nf90_noerr) then
1052 pop_sub(ncdf_error)
1053 return
1054 end if
1055
1056 write(message(1),'(3a)') "NETCDF error in function '" , trim(func) , "'"
1057 write(message(2),'(3a)') "(reading/writing ", trim(filename) , ")"
1058 write(message(3), '(6x,a,a)')'Error code = ', trim(nf90_strerror(status))
1059 call messages_warning(3, namespace=namespace)
1060 ierr = 5
1061
1062 pop_sub(ncdf_error)
1063 end subroutine ncdf_error
1064#endif
1065
1066 ! ---------------------------------------------------------
1067 subroutine transpose3(in, out)
1068 real(real64), intent(in) :: in(:, :, :)
1069 real(real64), intent(out) :: out(:, :, :)
1070 integer :: ix, iy, iz
1071
1072 push_sub(transpose3)
1073
1074 do ix = lbound(in, 1), ubound(in, 1)
1075 do iy = lbound(in, 2), ubound(in, 2)
1076 do iz = lbound(in, 3), ubound(in, 3)
1077 out(iz, iy, ix) = in(ix, iy, iz)
1078 end do
1079 end do
1080 end do
1081
1082 pop_sub(transpose3)
1083 end subroutine transpose3
1084
1085#include "undef.F90"
1086#include "real.F90"
1087#include "io_function_inc.F90"
1088
1089#include "undef.F90"
1090#include "complex.F90"
1091#include "io_function_inc.F90"
1092#include "undef.F90"
1093
1094end module io_function_oct_m
1095
1096!! Local Variables:
1097!! mode: f90
1098!! coding: utf-8
1099!! End:
real(real64) function func(r1, rn, n, a)
Definition: logrid.F90:330
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
Definition: fft.F90:120
real(real64), parameter, public m_two
Definition: global.F90:202
real(real64), parameter, public m_half
Definition: global.F90:206
This module implements the index, used for the mesh points.
Definition: index.F90:124
subroutine zio_function_output_vector_bz(how, dir, fname, namespace, space, kpt, kpoints, ff, unit, ierr, grp, root)
subroutine, public write_canonicalized_xyz_file(dir, fname, space, latt, pos, atoms, box, namespace)
Write canonicalized xyz file with atom labels and positions in Angstroms.
subroutine, public zio_function_output(how, dir, fname, namespace, space, mesh, ff, unit, ierr, pos, atoms, grp, root)
Top-level IO routine for functions defined on the mesh.
subroutine, public dio_function_output_global(how, dir, fname, namespace, space, mesh, ff, unit, ierr)
subroutine, public io_function_read_what_how_when(namespace, space, what, how, output_interval, what_tag_in, how_tag_in, output_interval_tag_in, ignore_error)
subroutine, public zio_function_input(filename, namespace, space, mesh, ff, ierr, map)
Reads a mesh function from file filename, and puts it into ff. If the map argument is passed,...
subroutine, public write_xsf_geometry(iunit, space, latt, pos, atoms, mesh, forces, index)
for format specification see: http:
subroutine zio_function_output_vector(how, dir, fname, namespace, space, mesh, ff, unit, ierr, pos, atoms, grp, root)
subroutine write_xsf_geometry_supercell(iunit, space, latt, pos, atoms, mesh, centers, supercell, extra_atom)
for format specification see: http:
subroutine dio_function_output_supercell(how, dir, fname, mesh, space, latt, ff, centers, supercell, unit, ierr, namespace, pos, atoms, grp, root, is_global, extra_atom)
subroutine, public dio_function_output(how, dir, fname, namespace, space, mesh, ff, unit, ierr, pos, atoms, grp, root)
Top-level IO routine for functions defined on the mesh.
subroutine dio_function_output_vector(how, dir, fname, namespace, space, mesh, ff, unit, ierr, pos, atoms, grp, root)
subroutine transpose3(in, out)
subroutine zio_function_output_supercell(how, dir, fname, mesh, space, latt, ff, centers, supercell, unit, ierr, namespace, pos, atoms, grp, root, is_global, extra_atom)
subroutine, public write_xsf_geometry_file(dir, fname, space, latt, pos, atoms, mesh, namespace, total_forces)
subroutine dio_function_output_global_bz(how, dir, fname, namespace, kpoints, ff, unit, ierr)
integer, parameter, private zoutput_kind
subroutine, public write_standard_xyz_file(namespace, fname, pos, species, header)
Write a standard xyz file with atom labels and positions (in Angstrom).
subroutine, public zio_function_output_global(how, dir, fname, namespace, space, mesh, ff, unit, ierr)
subroutine dio_function_output_vector_bz(how, dir, fname, namespace, space, kpt, kpoints, ff, unit, ierr, grp, root)
integer(int64) function, public io_function_fill_how(where)
Use this function to quickly plot functions for debugging purposes: call dio_function_output(io_funct...
subroutine, public dio_function_input(filename, namespace, space, mesh, ff, ierr, map)
Reads a mesh function from file filename, and puts it into ff. If the map argument is passed,...
subroutine zio_function_output_global_bz(how, dir, fname, namespace, kpoints, ff, unit, ierr)
Definition: io.F90:116
subroutine, public io_close(iunit, grp)
Definition: io.F90:467
subroutine, public io_mkdir(fname, namespace, parents)
Definition: io.F90:361
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
Definition: io.F90:402
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
subroutine, public messages_variable_is_block(namespace, name)
Definition: messages.F90:1024
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:525
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:1000
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:162
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:410
subroutine, public messages_input_error(namespace, var, details, row, column)
Definition: messages.F90:691
type(mpi_grp_t), public mpi_world
Definition: mpi.F90:272
Some general things and nomenclature:
Definition: par_vec.F90:173
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
Definition: parser.F90:818
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:623
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:134
This module defines the unit system, used for input and output.
type(unit_t), public unit_angstrom
For XYZ files.
type(unit_system_t), public units_out
This module is intended to contain simple general-purpose utility functions and procedures.
Definition: utils.F90:120
class to tell whether a point is inside or outside
Definition: box.F90:143
Describes mesh distribution to nodes.
Definition: mesh.F90:187
int true(void)