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 !%Option axis_y bit(1)
383 !% The values of the function on the <i>y</i> axis are printed. The string <tt>.x=0,z=0</tt> is appended
384 !% to previous file names.
385 !%Option axis_z bit(2)
386 !% The values of the function on the <i>z</i> axis are printed. The string <tt>.x=0,y=0</tt> is appended
387 !% to previous file names.
388 !%Option plane_x bit(3)
389 !% A plane slice at <i>x</i> = 0 is printed. The string <tt>.x=0</tt> is appended
390 !% to previous file names.
391 !%Option plane_y bit(4)
392 !% A plane slice at <i>y</i> = 0 is printed. The string <tt>.y=0</tt> is appended
393 !% to previous file names.
394 !%Option plane_z bit(5)
395 !% A plane slice at <i>z</i> = 0 is printed. The string <tt>.z=0</tt> is appended to
396 !% previous file names.
397 !%Option dx bit(6)
398 !% For printing three-dimensional information, the open-source program
399 !% visualization tool <a href=http://www.opendx.org>OpenDX</a> can be used. The string
400 !% <tt>.dx</tt> is appended to previous file names. Available only in 3D.
401 !%Option netcdf bit(7)
402 !% Outputs in <a href=http://www.unidata.ucar.edu/packages/netcdf>NetCDF</a> format. This file
403 !% can then be read, for example, by OpenDX. The string <tt>.ncdf</tt> is appended to previous file names.
404 !% Requires the NetCDF library. Only writes the real part of complex functions.
405 !%Option mesh_index bit(8)
406 !% Generates output files of a given quantity (density, wavefunctions, ...) which include
407 !% the internal numbering of mesh points. Since this mode produces large datafiles this is only
408 !% useful for small meshes and debugging purposes.
409 !% The output can also be used to display the mesh directly. A Gnuplot script for mesh visualization
410 !% can be found under <tt>PREFIX/share/octopus/util/display_mesh_index.gp</tt>.
411 !%Option xcrysden bit(9)
412 !% A format for printing structures and three-dimensional information, which can be visualized by
413 !% the free open-source program <a href=http://www.xcrysden.org>XCrySDen</a> and others. The string
414 !% <tt>.xsf</tt> is appended to previous file names. Note that lattice vectors and coordinates are as
415 !% specified by <tt>UnitsOutput</tt>. Available in 2D and 3D.
416 !%Option matlab bit(10)
417 !% In combination with <tt>plane_x</tt>, <tt>plane_y</tt> and
418 !% <tt>plane_z</tt>, this option produces output files which are
419 !% suitable for 2D Matlab functions like <tt>mesh()</tt>,
420 !% <tt>surf()</tt>, or <tt>waterfall()</tt>. To load these files
421 !% into Matlab you can use, <i>e.g.</i>
422 !%<tt>
423 !% >> density = load('static/density-1.x=0.matlab.abs');
424 !% >> mesh(density);
425 !%</tt>
426 !%Option meshgrid bit(11)
427 !% Outputs in Matlab mode the internal mesh in a format similar to
428 !%<tt>
429 !% >> [x,y] = meshgrid(-2:.2:2,-1:.15:1)
430 !%</tt>
431 !% The <i>x</i> meshgrid is contained in a file <tt>*.meshgrid.x</tt> and the <i>y</i>-grid can be found in
432 !% <tt>*.meshgrid.y</tt>.
433 !%Option boundary_points bit(12)
434 !% This option includes the output of the mesh enlargement. Default is without.
435 !% Supported only by <tt>binary</tt>, <tt>axis</tt>, <tt>plane</tt>, <tt>mesh_index</tt>,
436 !% and <tt>matlab</tt> formats.
437 !% Not all types of <tt>Output</tt> will have this information available. Not supported when parallel in domains.
438 !%Option binary bit(13)
439 !% Plain binary, new format.
440 !%Option etsf bit(14)
441 !% <a href=http://www.etsf.eu/resources/software/standardization_project>ETSF file format</a>.
442 !% Requires the ETSF_IO library. Applies only to <tt>Output = density</tt>, <tt>geometry</tt>,
443 !% <tt>wfs</tt>, and/or <tt>wfs_fourier</tt>.
444 !%Option xyz bit(15)
445 !% Geometry will be output in XYZ format. Does not affect other outputs.
446 !%Option cube bit(16)
447 !% Generates output in the <a href=http://paulbourke.net/dataformats/cube>cube file format</a>.
448 !% Available only in 3D. Only writes the real part of complex functions.
449 !% This output format always uses atomic units.
450 !%Option bild bit(19)
451 !% Generates output in <a href=http://plato.cgl.ucsf.edu/chimera/docs/UsersGuide/bild.html>BILD format</a>.
452 !%Option vtk bit(20)
453 !% Generates output in <a href=http://www.vtk.org/VTK/img/file-formats.pdf>VTK legacy format</a>.
454 !%Option integrate_xy bit(21)
455 !% Integrates the function in the x-y plane and the result on the <i>z</i> axis is printed.
456 !%Option integrate_xz bit(22)
457 !% Integrates the function in the x-z plane and the result on the <i>y</i> axis is printed
458 !%Option integrate_yz bit(23)
459 !% Integrates the function in the y-z plane and the result on the <i>x</i> axis is printed
460 !%Option ascii bit(24)
461 !% Plain text format regardless of dimensionality. For the moment only employed by the oct-phototoelectron_spectrum
462 !% post-processing utility.
463 !%Option poscar bit(25)
464 !% Write geometry in POSCAR format.
465 !% Note that atoms are not ordered by labels and that species names are taken from the Octopus input,
466 !% and are not truncated to two letters.
467 !%End
468
469 !%Variable OutputInterval
470 !%Type integer
471 !%Default 50
472 !%Section Output
473 !%Description
474 !% The output requested by variable <tt>Output</tt> is written
475 !% to the directory <tt>OutputIterDir</tt>
476 !% when the iteration number is a multiple of the <tt>OutputInterval</tt> variable.
477 !% Subdirectories are named Y.X, where Y is <tt>td</tt>, <tt>scf</tt>, or <tt>unocc</tt>, and
478 !% X is the iteration number. To use the working directory, specify <tt>"."</tt>
479 !% Must be >= 0. If it is 0, then no output is written. For <tt>gs</tt> and <tt>unocc</tt>
480 !% calculations, <tt>OutputDuringSCF</tt> must be set too for this output to be produced.
481 !% This variable can also be defined inside the <tt>Output</tt> block.
482 !% See <tt>Output</tt>.
483 !%End
484
485
486 what_no_how = (/ &
487 option__output__matrix_elements, &
488 option__output__berkeleygw, &
489 option__output__dos, &
490 option__output__tpa, &
491 option__output__mmb_den, &
492 option__output__j_flow, &
493 option__output__occ_matrices, &
494 option__output__effectiveu, &
495 option__output__magnetization, &
496 option__output__kanamoriu, &
497 option__output__stress, &
498 option__output__jdos, &
499 option__output__pdos &
500 /)
501
502 if (parse_block(namespace, what_tag, blk) == 0) then
503 nrows = parse_block_n(blk)
504 do iout = 0, nrows - 1
505 ncols = max(ncols , parse_block_cols(blk, iout))
506 end do
507
508 if (ncols == 1) then
509 !new format, Type 0
510 !%Output
511 ! density
512 ! wfs
513 !%
514 do iout = 1, nrows
515 call parse_block_integer(blk, iout - 1, 0, what_i)
516 if (.not. varinfo_valid_option(what_tag, what_i)) then
517 call messages_input_error(namespace, what_tag)
518 end if
519 if (what_i > 0) then
520 what(what_i) = .true.
521 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
522 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
523 .or. (what_tag /= 'Output')) then
524 call parse_variable(namespace, how_tag, 0, how(what_i))
525 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
526 call messages_input_error(namespace, how_tag)
527 end if
528 end if
529 end if
530 end do
531 else if (ncols == 2) then
532 !new format, Type 1
533 !%Output
534 ! density | cube + axis_z
535 ! wfs | cube
536 !%
537
538 do iout = 1, nrows
539 call parse_block_integer(blk, iout - 1, 0, what_i)
540 if (.not. varinfo_valid_option(what_tag, what_i)) then
541 call messages_input_error(namespace, what_tag)
542 end if
543 if (what_i > 0) then
544 what(what_i) = .true.
545 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
546 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
547 .or. (what_tag /= 'Output')) then
548 call parse_block_integer(blk, iout - 1, 1, how(what_i))
549 if (how(what_i) == 0) call parse_variable(namespace, how_tag, 0, how(what_i))
550 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
551 call messages_input_error(namespace, how_tag)
552 end if
553 end if
554 end if
555 end do
556
557 else
558 !new format, Type 2 (tagged)
559 !%Output
560 ! density | "output_interval" | 10 | "output_format" | cube + axis_z
561 ! wfs | "output_format" | cube | "output_interval" | 50
562 !%
563 !
564 ! OR
565 !
566 !%Output
567 ! density | "output_interval" | 10 | "output_format" | cube + axis_z
568 ! wfs | "output_format" | cube
569 !%
570 do iout = 1, nrows
571 call parse_block_integer(blk, iout - 1, 0, what_i)
572 if (.not. varinfo_valid_option(what_tag, what_i)) then
573 call messages_input_error(namespace, what_tag)
574 end if
575 if (what_i > 0) then
576 what(what_i) = .true.
577 do column_index = 0, 1
578 call parse_block_string(blk, iout - 1, 1 + column_index * 2, output_column_marker)
579 if (output_column_marker == 'output_interval') then
580 call parse_block_integer(blk, iout - 1, 2 + column_index * 2, output_interval(what_i))
581 else if (output_column_marker == 'output_format') then
582 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
583 .or. (what_tag /= 'Output')) then
584 call parse_block_integer(blk, iout - 1, 2 + column_index * 2, how(what_i))
585 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
586 call messages_input_error(namespace, how_tag)
587 end if
588 end if
589 else if (len_trim(output_column_marker) /= 0) then
590 ! Unknown output_column_marker
591 call messages_input_error(namespace, what_tag)
592 else
593 ! no output_column_marker -> full output info is not in this block
594 if (output_interval(what_i) == 0) then
595 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
596 end if
597 if (how(what_i) == 0) then
598 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
599 .or. (what_tag /= 'Output')) then
600 call parse_variable(namespace, how_tag, 0, how(what_i))
601 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
602 call messages_input_error(namespace, how_tag)
603 end if
604 end if
605 end if
606 end if
607 end do
608 end if
609 end do
610 end if
611 call parse_block_end(blk)
612 else
613
614 call messages_variable_is_block(namespace, what_tag)
615
616 ! Output block does not exist but we may have OutputHow/OutputInterval
617 call parse_variable(namespace, how_tag, 0, how(0))
618 call parse_variable(namespace, output_interval_tag, 50, output_interval(0))
619 end if
620
621
622 do what_i = lbound(what, 1), ubound(what, 1)
623 if (what_tag == 'Output') then
624 if (what(what_i) .and. (.not. any(what_no_how == what_i))) then
625 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
626 call messages_input_error(namespace, how_tag)
627 end if
628
629 if (how(what_i) == 0 .and. .not. optional_default(ignore_error, .false.)) then
630 write(message(1), '(a)') 'Must specify output method with variable OutputFormat.'
631 call messages_fatal(1, only_root_writes = .true., namespace=namespace)
632 end if
633
634 ! some modes are not available in some circumstances
635 if (space%dim == 1) then
636 if (bitand(how(what_i), option__outputformat__axis_y) /= 0) then
637 message(1) = "OutputFormat = axis_y not available with Dimensions = 1."
638 call messages_fatal(1, namespace=namespace)
639 end if
640 if (bitand(how(what_i), option__outputformat__plane_z) /= 0) then
641 message(1) = "OutputFormat = plane_z not available with Dimensions = 1."
642 call messages_fatal(1, namespace=namespace)
643 end if
644 if (bitand(how(what_i), option__outputformat__xcrysden) /= 0) then
645 message(1) = "OutputFormat = xcrysden not available with Dimensions = 1."
646 call messages_fatal(1, namespace=namespace)
647 end if
648 end if
649
650 if (space%dim <= 2) then
651 if (bitand(how(what_i), option__outputformat__axis_z) /= 0) then
652 message(1) = "OutputFormat = axis_z not available with Dimensions <= 2."
653 call messages_fatal(1, namespace=namespace)
654 end if
655 if (bitand(how(what_i), option__outputformat__plane_x) /= 0) then
656 message(1) = "OutputFormat = plane_x not available with Dimensions <= 2."
657 call messages_fatal(1, namespace=namespace)
658 end if
659 if (bitand(how(what_i), option__outputformat__plane_y) /= 0) then
660 message(1) = "OutputFormat = plane_y not available with Dimensions <= 2."
661 call messages_fatal(1, namespace=namespace)
662 end if
663 if (bitand(how(what_i), option__outputformat__integrate_xy) /= 0) then
664 message(1) = "OutputFormat = integrate_xy not available with Dimensions <= 2."
665 call messages_fatal(1, namespace=namespace)
666 end if
667 if (bitand(how(what_i), option__outputformat__integrate_xz) /= 0) then
668 message(1) = "OutputFormat = integrate_xz not available with Dimensions <= 2."
669 call messages_fatal(1, namespace=namespace)
670 end if
671 if (bitand(how(what_i), option__outputformat__integrate_yz) /= 0) then
672 message(1) = "OutputFormat = integrate_yz not available with Dimensions <= 2."
673 call messages_fatal(1, namespace=namespace)
674 end if
675 if (bitand(how(what_i), option__outputformat__dx) /= 0) then
676 message(1) = "OutputFormat = dx not available with Dimensions <= 2."
677 call messages_fatal(1, namespace=namespace)
678 end if
679 if (bitand(how(what_i), option__outputformat__cube) /= 0) then
680 message(1) = "OutputFormat = cube not available with Dimensions <= 2."
681 call messages_fatal(1, namespace=namespace)
682 end if
683 if (bitand(how(what_i), option__outputformat__poscar) /= 0) then
684 message(1) = "OutputFormat = POSCAR not available with Dimensions <= 2."
685 call messages_fatal(1, namespace=namespace)
686 end if
687 end if
688
689 if (space%periodic_dim<=2) then
690 if (bitand(how(what_i), option__outputformat__poscar) /= 0) then
691 message(1) = "OutputFormat = POSCAR not available with periodic_dim <= 2."
692 call messages_fatal(1, namespace=namespace)
693 end if
694 end if
695
696#if !defined(HAVE_NETCDF)
697 if (bitand(how(what_i), option__outputformat__netcdf) /= 0) then
698 message(1) = 'Octopus was compiled without NetCDF support.'
699 message(2) = 'It is not possible to write output in NetCDF format.'
700 call messages_fatal(2, namespace=namespace)
701 end if
702#endif
703#if !defined(HAVE_ETSF_IO)
704 if (bitand(how(what_i), option__outputformat__etsf) /= 0) then
705 message(1) = 'Octopus was compiled without ETSF_IO support.'
706 message(2) = 'It is not possible to write output in ETSF format.'
707 call messages_fatal(2, namespace=namespace)
708 end if
709#endif
710
711
712 end if
713 end if
714
715 if (output_interval(what_i) < 0) then
716 message(1) = "OutputInterval must be >= 0."
717 call messages_fatal(1, namespace=namespace)
718 end if
719 end do
720
722 end subroutine io_function_read_what_how_when
723
724 ! -------------------------------------------------------------------
727 ! ".", "func", mesh, sb, func, M_ONE, ierr)
728 ! -------------------------------------------------------------------
729 integer(int64) function io_function_fill_how(where) result(how)
730 character(len=*), intent(in) :: where
731
732 push_sub(io_function_fill_how)
733
734 how = 0
735 if (index(where, "AxisX") /= 0) how = ior(how, option__outputformat__axis_x)
736 if (index(where, "AxisY") /= 0) how = ior(how, option__outputformat__axis_y)
737 if (index(where, "AxisZ") /= 0) how = ior(how, option__outputformat__axis_z)
738 if (index(where, "PlaneX") /= 0) how = ior(how, option__outputformat__plane_x)
739 if (index(where, "PlaneY") /= 0) how = ior(how, option__outputformat__plane_y)
740 if (index(where, "PlaneZ") /= 0) how = ior(how, option__outputformat__plane_z)
741 if (index(where, "IntegrateXY") /= 0) how = ior(how, option__outputformat__integrate_xy)
742 if (index(where, "IntegrateXZ") /= 0) how = ior(how, option__outputformat__integrate_xz)
743 if (index(where, "IntegrateYZ") /= 0) how = ior(how, option__outputformat__integrate_yz)
744 if (index(where, "DX") /= 0) how = ior(how, option__outputformat__dx)
745 if (index(where, "XCrySDen") /= 0) how = ior(how, option__outputformat__xcrysden)
746 if (index(where, "Binary") /= 0) how = ior(how, option__outputformat__binary)
747 if (index(where, "MeshIndex") /= 0) how = ior(how, option__outputformat__mesh_index)
748 if (index(where, "XYZ") /= 0) how = ior(how, option__outputformat__xyz)
749#if defined(HAVE_NETCDF)
750 if (index(where, "NETCDF") /= 0) how = ior(how, option__outputformat__netcdf)
751#endif
752 if (index(where, "Cube") /= 0) how = ior(how, option__outputformat__cube)
753 if (index(where, "VTK") /= 0) how = ior(how, option__outputformat__vtk)
754 if (index(where, "ASCII") /= 0) how = ior(how, option__outputformat__ascii)
755 if (index(where, "Bild") /= 0) how = ior(how, option__outputformat__bild)
756
757 pop_sub(io_function_fill_how)
758 end function io_function_fill_how
759
764 subroutine write_standard_xyz_file(namespace, fname, pos, species, header)
765 type(namespace_t), intent(in) :: namespace
766 character(len=*), intent(in) :: fname
767 real(real64), intent(in) :: pos(:,:)
768 character(len=*), intent(in) :: species(:)
769 character(len=*), optional, intent(in) :: header
770
771 integer :: iunit, n_atoms, iatom, min_dim
772 real(real64) :: position(3)
773
775
776 n_atoms = size(pos, 2)
777 assert(size(species) == n_atoms)
778
779 iunit = io_open(trim(fname)//'.xyz', namespace, action='write', position='asis')
780
781 write(iunit, '(i6)') n_atoms
782 if (present(header)) then
783 write(iunit, '(a)') trim(adjustl(header))
784 else
785 write(iunit, '(a)')
786 endif
787
788 ! Ensure a set of three coordinate components is written for 1D, 2D and ND systems
789 min_dim = min(size(pos, 1), 3)
790 position(1:3) = 0.0_real64
791
792 ! xyz-style labels and positions:
793 do iatom = 1, n_atoms
794 position(1:min_dim) = pos(1:min_dim, iatom)
795 write(iunit, '(a10, 3(1x, f15.10))') trim(adjustl(species(iatom))), &
797 end do
798
799 call io_close(iunit)
800
802
803 end subroutine write_standard_xyz_file
804
810 subroutine write_canonicalized_xyz_file(dir, fname, space, latt, pos, atoms, box, namespace)
811 character(len=*), intent(in) :: dir
812 character(len=*), intent(in) :: fname
813 class(space_t), intent(in) :: space
814 type(lattice_vectors_t), intent(in) :: latt
815 real(real64), intent(in) :: pos(:,:)
816 type(atom_t), intent(in) :: atoms(:)
817 class(box_t), intent(in) :: box
818 type(namespace_t), intent(in) :: namespace
819
820 integer :: ia
821 character(len=:), allocatable :: info_str, dir_fname
822 character(len=LABEL_LEN), allocatable :: species(:)
823
825
826 call io_mkdir(dir, namespace)
827
828 info_str = trim(space%short_info()) // '; ' // trim(box%short_info(unit_angstrom))
829 if (space%is_periodic()) then
830 info_str = info_str // '; ' // trim(latt%short_info(unit_angstrom))
831 end if
832
833 safe_allocate(species(1:size(atoms)))
834 do ia = 1, size(atoms)
835 species(ia) = atoms(ia)%get_label()
836 enddo
837
838 dir_fname = trim(dir) // '/' // trim(fname)
839 call write_standard_xyz_file(namespace, dir_fname, pos, species, info_str)
840
841 safe_deallocate_a(species)
842
844
845 end subroutine write_canonicalized_xyz_file
846
847 subroutine write_xsf_geometry_file(dir, fname, space, latt, pos, atoms, mesh, namespace, total_forces)
848 character(len=*), intent(in) :: dir, fname
849 class(space_t), intent(in) :: space
850 type(lattice_vectors_t), intent(in) :: latt
851 real(real64), intent(in) :: pos(:,:)
852 type(atom_t), intent(in) :: atoms(:)
853 class(mesh_t), intent(in) :: mesh
854 type(namespace_t), intent(in) :: namespace
855 real(real64), optional, intent(in) :: total_forces(:,:)
856
857 integer :: iunit
858 real(real64), allocatable :: forces(:,:)
860 if (.not. mpi_world%is_root()) return
861
863
864 call io_mkdir(dir, namespace)
865 iunit = io_open(trim(dir)//'/'//trim(fname)//'.xsf', namespace, action='write', position='asis')
866
867 if (present(total_forces)) then
868 safe_allocate(forces(1:space%dim, 1:size(atoms)))
869 forces = units_from_atomic(units_out%force, total_forces)
870 call write_xsf_geometry(iunit, space, latt, pos, atoms, mesh, forces = forces)
871 safe_deallocate_a(forces)
872 else
873 call write_xsf_geometry(iunit, space, latt, pos, atoms, mesh)
874 end if
875
876 call io_close(iunit)
877
879 end subroutine write_xsf_geometry_file
880
881 ! ---------------------------------------------------------
884 subroutine write_xsf_geometry(iunit, space, latt, pos, atoms, mesh, forces, index)
885 integer, intent(in) :: iunit
886 class(space_t), intent(in) :: space
887 type(lattice_vectors_t), intent(in) :: latt
888 real(real64), intent(in) :: pos(:,:)
889 type(atom_t), intent(in) :: atoms(:)
890 class(mesh_t), intent(in) :: mesh
891 real(real64), optional, intent(in) :: forces(:, :)
892 integer, optional, intent(in) :: index
893
894 integer :: idir, idir2, iatom, index_, natoms
895 character(len=7) :: index_str
896 real(real64) :: offset(space%dim)
897 real(real64) :: rlattice(space%dim, space%dim)
898
899 push_sub(write_xsf_geometry)
900
901 if (present(index)) then
902 write(index_str, '(a,i6)') ' ', index
903 index_ = index
904 else
905 write(index_str, '(a)') ''
906 index_ = 1
907 end if
908 natoms = size(pos, dim=2)
909
910 ! The corner of the cell is always (0,0,0) to XCrySDen
911 ! so the offset is applied to the atomic coordinates.
912 ! Along periodic dimensions the offset is -1/2 in reduced coordinates, as
913 ! our origin is at the center of the cell instead of being at the edge.
914 offset(1:space%dim) = latt%red_to_cart(spread(-m_half, 1, space%dim))
915 ! Offset in aperiodic directions:
916 do idir = space%periodic_dim + 1, space%dim
917 offset(idir) = -(mesh%idx%ll(idir) - 1)/2 * mesh%spacing(idir)
918 end do
919
920 if (space%is_periodic()) then
921 if (index_ == 1) then
922 select case (space%periodic_dim)
923 case (3)
924 write(iunit, '(a)') 'CRYSTAL'
925 case (2)
926 write(iunit, '(a)') 'SLAB'
927 case (1)
928 write(iunit, '(a)') 'POLYMER'
929 end select
930 end if
931
932 write(iunit, '(a)') 'PRIMVEC'//trim(index_str)
933
934 !Computes the rlattice corresponding to the 3D periodic version of the simulation box
935 rlattice = latt%rlattice
936 do idir = space%periodic_dim+1, space%dim
937 rlattice(:,idir) = rlattice(:,idir)*m_two*mesh%box%bounding_box_l(idir)
938 end do
939
940 do idir = 1, space%dim
941 write(iunit, '(3f12.6)') (units_from_atomic(units_out%length, rlattice(idir2, idir)), idir2 = 1, space%dim)
942 end do
943
944 write(iunit, '(a)') 'PRIMCOORD'//trim(index_str)
945 write(iunit, '(i10, a)') natoms, ' 1'
946 else
947 write(iunit, '(a)') 'ATOMS'//trim(index_str)
948 end if
949
950 ! BoxOffset should be considered here
951 do iatom = 1, natoms
952 write(iunit, '(a10, 3f12.6)', advance='no') trim(atoms(iatom)%label), &
953 (units_from_atomic(units_out%length, pos(idir, iatom) - offset(idir)), idir = 1, space%dim)
954 if (present(forces)) then
955 write(iunit, '(5x, 3f12.6)', advance='no') forces(:, iatom)
956 end if
957 write(iunit, '()')
958 end do
959
960 pop_sub(write_xsf_geometry)
961 end subroutine write_xsf_geometry
962
963! ---------------------------------------------------------
966 subroutine write_xsf_geometry_supercell(iunit, space, latt, pos, atoms, mesh, centers, supercell, extra_atom)
967 integer, intent(in) :: iunit
968 class(space_t), intent(in) :: space
969 type(lattice_vectors_t), intent(in) :: latt
970 real(real64), intent(in) :: pos(:,:)
971 type(atom_t), intent(in) :: atoms(:)
972 class(mesh_t), intent(in) :: mesh
973 real(real64), intent(in) :: centers(:, :)
974 integer, intent(in) :: supercell(:)
975 real(real64), optional, intent(in) :: extra_atom(:)
976
977 integer :: idir, idir2, iatom, index_
978 character(len=7) :: index_str
979 real(real64) :: offset(3)
980 integer :: irep, nreplica
981
983
984 write(index_str, '(a)') ''
985 index_ = 1
986
987 nreplica = product(supercell(1:space%dim))
988
989 ! The corner of the cell is always (0,0,0) to XCrySDen
990 ! so the offset is applied to the atomic coordinates.
991 ! Offset in periodic directions:
992 offset(1:space%dim) = latt%red_to_cart(spread(-m_half, 1, space%dim))
993 offset(1:3) = offset(1:3) + centers(1:3,1)
994 ! Offset in aperiodic directions:
995 do idir = space%periodic_dim + 1, 3
996 offset(idir) = -(mesh%idx%ll(idir) - 1)/2 * mesh%spacing(idir)
997 end do
998
999 if(space%is_periodic()) then
1000 if(index_ == 1) then
1001 select case(space%periodic_dim)
1002 case(3)
1003 write(iunit, '(a)') 'CRYSTAL'
1004 case(2)
1005 write(iunit, '(a)') 'SLAB'
1006 case(1)
1007 write(iunit, '(a)') 'POLYMER'
1008 end select
1009 end if
1010
1011 write(iunit, '(a)') 'PRIMVEC'//trim(index_str)
1012
1013 do idir = 1, space%dim
1014 write(iunit, '(3f12.6)') (units_from_atomic(units_out%length, &
1015 latt%rlattice(idir2, idir)*supercell(idir)), idir2 = 1, space%dim)
1016 end do
1017
1018 write(iunit, '(a)') 'PRIMCOORD'//trim(index_str)
1019 if(.not.present(extra_atom)) then
1020 write(iunit, '(i10, a)') size(atoms)*nreplica, ' 1'
1021 else
1022 write(iunit, '(i10, a)') size(atoms)*nreplica+1, ' 1'
1023 end if
1024 else
1025 write(iunit, '(a)') 'ATOMS'//trim(index_str)
1026 end if
1027
1028
1029 do irep = 1, nreplica
1030 ! BoxOffset should be considered here
1031 do iatom = 1, size(atoms)
1032 write(iunit, '(a10, 3f12.6)', advance='no') trim(atoms(iatom)%label), &
1033 (units_from_atomic(units_out%length, pos(idir, iatom) + centers(idir, irep) &
1034 - offset(idir)), idir = 1, space%dim)
1035 write(iunit, '()')
1036 end do
1037 end do
1038 if(present(extra_atom)) then
1039 write(iunit, '(a10, 3f12.6)', advance='no') 'X', &
1040 (units_from_atomic(units_out%length, extra_atom(idir) - offset(idir)), idir = 1, space%dim)
1041 write(iunit, '()')
1042 end if
1043
1045 end subroutine write_xsf_geometry_supercell
1046
1047
1048#if defined(HAVE_NETCDF)
1049 ! ---------------------------------------------------------
1050 subroutine ncdf_error(func, status, filename, namespace, ierr)
1051 character(len=*), intent(in) :: func
1052 integer, intent(in) :: status
1053 character(len=*), intent(in) :: filename
1054 type(namespace_t), intent(in) :: namespace
1055 integer, intent(inout) :: ierr
1056
1057 push_sub(ncdf_error)
1058
1059 if (status == nf90_noerr) then
1060 pop_sub(ncdf_error)
1061 return
1062 end if
1063
1064 write(message(1),'(3a)') "NETCDF error in function '" , trim(func) , "'"
1065 write(message(2),'(3a)') "(reading/writing ", trim(filename) , ")"
1066 write(message(3), '(6x,a,a)')'Error code = ', trim(nf90_strerror(status))
1067 call messages_warning(3, namespace=namespace)
1068 ierr = 5
1069
1070 pop_sub(ncdf_error)
1071 end subroutine ncdf_error
1072#endif
1073
1074 ! ---------------------------------------------------------
1075 subroutine transpose3(in, out)
1076 real(real64), intent(in) :: in(:, :, :)
1077 real(real64), intent(out) :: out(:, :, :)
1078 integer :: ix, iy, iz
1079
1080 push_sub(transpose3)
1081
1082 do ix = lbound(in, 1), ubound(in, 1)
1083 do iy = lbound(in, 2), ubound(in, 2)
1084 do iz = lbound(in, 3), ubound(in, 3)
1085 out(iz, iy, ix) = in(ix, iy, iz)
1086 end do
1087 end do
1088 end do
1089
1090 pop_sub(transpose3)
1091 end subroutine transpose3
1092
1093#include "undef.F90"
1094#include "real.F90"
1095#include "io_function_inc.F90"
1096
1097#include "undef.F90"
1098#include "complex.F90"
1099#include "io_function_inc.F90"
1100#include "undef.F90"
1101
1102end module io_function_oct_m
1103
1104!! Local Variables:
1105!! mode: f90
1106!! coding: utf-8
1107!! 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)