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(12)
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 !% or <tt>lr_elf-</tt> in linear response, in which case the associated function D is also written,
231 !% as <tt>lr_elf_D-</tt>. Only in 2D and 3D.
232 !%Option ELF_basins 8
233 !% Outputs basins of attraction of the ELF. The output file is called
234 !% <tt>elf_rs_basins.info</tt>. Only in 2D and 3D.
235 !%Option Bader 9
236 !% Outputs Laplacian of the density which shows lone pairs, bonded charge concentrations
237 !% and regions subject to electrophilic or nucleophilic attack.
238 !% See RF Bader, <i>Atoms in Molecules: A Quantum Theory</i> (Oxford Univ. Press, Oxford, 1990).
239 !%Option el_pressure 10
240 !% Outputs electronic pressure. See Tao, Vignale, and Tokatly, <i>Phys Rev Lett</i> <b>100</b>, 206405 (2008).
241 !%Option matrix_elements 11
242 !% Outputs a series of matrix elements of the Kohn-Sham states. What is output can
243 !% be controlled by the <tt>OutputMatrixElements</tt> variable.
244 !%Option pol_density 12
245 !% Outputs dipole-moment density <tt>dipole_density-</tt>, or polarizability density <tt>alpha_density-</tt>
246 !% in linear response. If <tt>ResponseMethod = finite_differences</tt>, the hyperpolarizability density
247 !% <tt>beta_density-</tt> is also printed.
248 !%Option mesh_r 13
249 !% Outputs values of the coordinates over the grid. Files
250 !% will be called <tt>mesh_r-</tt> followed by the direction.
251 !%Option kinetic_energy_density 14
252 !% Outputs kinetic-energy density, defined as:
253 !%
254 !% <math>\tau_\sigma(\vec{r}) = \sum_{i=1}^{N_\sigma}
255 !% \left| \vec{\nabla} \phi_{i\sigma}(\vec{r}) \right|^2\,. </math>
256 !%
257 !% The index <math>\sigma</math> is the spin index for the spin-polarized case,
258 !% or if you are using spinors. For spin-unpolarized calculations, you
259 !% get the total kinetic-energy density. The previous expression assumes full
260 !% or null occupations. If fractional occupation numbers, each term in the sum
261 !% is weighted by the occupation. Also, if we are working with an infinite
262 !% system, all <i>k</i>-points are summed up, with their corresponding weights. The
263 !% files will be called <tt>tau-sp1</tt> and <tt>tau-sp2</tt>, if the spin-resolved kinetic
264 !% energy density is produced (runs in spin-polarized and spinors mode), or
265 !% only <tt>tau</tt> if the run is in spin-unpolarized mode.
266 !%
267 !% Note that the code does not the U(1)gauge-invariant kinetic energy density, but simply the kinetic energy density.
268 !%Option dos 15
269 !% Outputs density of states. See <tt>DOSEnergyMax</tt>, <tt>DOSEnergyMin</tt>, <tt>DOSEnergyPoints</tt>,
270 !% and <tt>DOSGamma</tt>.
271 !%Option tpa 16
272 !% Outputs transition-potential approximation (TPA) matrix elements, using <math>\vec{q}</math>-vector specified
273 !% by <tt>MomentumTransfer</tt>.
274 !%Option forces 17
275 !% Outputs file <tt>forces.xsf</tt> containing structure and forces on the atoms as
276 !% a vector associated with each atom, which can be visualized with XCrySDen.
277 !%Option wfs_fourier 18
278 !% (Experimental) Outputs wavefunctions in Fourier space. This is
279 !% only implemented for the ETSF file format output. The file will
280 !% be called <tt>wfs-pw-etsf.nc</tt>.
281 !%Option xc_density 19
282 !% Outputs the XC density, which is the charge density that
283 !% generates the XC potential. (This is <math>-1/4\pi</math> times
284 !% the Laplacian of the XC potential). The files are called <tt>nxc</tt>.
285 !%Option PES_wfs 20
286 !% Outputs the photoelectron wavefunctions. The file name is <tt>pes_wfs-</tt>
287 !% plus the orbital number.
288 !%Option PES_density 21
289 !% Outputs the photolectron density. Output file is <tt>pes_dens-</tt> plus spin species if
290 !% spin-polarized calculation is performed.
291 !%Option PES 22
292 !% Outputs the time-dependent photoelectron spectrum.
293 !%Option BerkeleyGW 23
294 !% Output for a run with <a href=http://www.berkeleygw.org>BerkeleyGW</a>.
295 !% See <tt>Output::BerkeleyGW</tt> for further specification.
296 !%Option delta_perturbation 24
297 !% Outputs the "kick", or time-delta perturbation applied to compute optical response in real time.
298 !%Option external_td_potential 25
299 !% Outputs the (scalar) time-dependent potential.
300 !%Option mmb_wfs 26
301 !% Triggers the ModelMB wavefunctions to be output for each state.
302 !%Option mmb_den 27
303 !% Triggers the ModelMB density matrix to be output for each state, and the particles
304 !% specified by the <tt>DensitytoCalc</tt> block. Calculates, and outputs, the reduced density
305 !% matrix. For the moment the trace is made over the second dimension, and
306 !% the code is limited to 2D. The idea is to model <i>N</i> particles in 1D as an
307 !% <i>N</i>-dimensional non-interacting problem, then to trace out <i>N</i>-1 coordinates.
308 !%Option potential_gradient 28
309 !% Prints the gradient of the potential.
310 !%Option energy_density 29
311 !% Outputs the total energy density to a file called
312 !% <tt>energy_density</tt>.
313 !%Option heat_current 30
314 !% Outputs the total heat current density. The output file is
315 !% called <tt>heat_current-</tt>.
316 !%Option photon_correlator 31
317 !% Outputs the electron-photon correlation function. The output file is
318 !% called <tt>photon_correlator</tt>.
319 !%Option J_flow 32
320 !% todo: document J_flow option!
321 !%Option current_kpt 33
322 !% Outputs the current density resolved in momentum space. The output file is called <tt>current_kpt-</tt>.
323 !%Option density_kpt 34
324 !% Outputs the electronic density resolved in momentum space.
325 !%Option occ_matrices 35
326 !% Only for DFT+U calculations.
327 !% Outputs the occupation matrices of DFT+U
328 !%Option effectiveU 36
329 !% Only for DFT+U calculations.
330 !% Outputs the value of the effectiveU for each atoms
331 !%Option magnetization 37
332 !% Only for DFT+U calculations.
333 !% Outputs file containing structure and magnetization of the localized subspace
334 !% on the atoms as a vector associated with each atom, which can be visualized.
335 !% For the moment, it only works if a +U is added on one type of orbital per atom.
336 !%Option local_orbitals 38
337 !% Only for DFT+U calculations.
338 !% Outputs the localized orbitals that form the correlated subspace
339 !%Option kanamoriU 39
340 !% Only for DFT+U calculations.
341 !% Outputs the Kanamori interaction parameters U, U`, and J.
342 !% These parameters are not determined self-consistently, but are taken from the
343 !% occupation matrices and Coulomb integrals comming from a standard +U calculation.
344 !%Option xc_torque 40
345 !% Outputs the exchange-correlation torque. Only for the spinor case and in the 3D case.
346 !%Option eigenval_kpt 41
347 !% Outputs the eigenvalues resolved in momentum space, with one file for each band.
348 !%Option stress 42
349 !% Outputs the stress tensor and each of its contributing terms
350 !%Option current_dia 43
351 !% Outputs the diamagnetic current density from a non-uniform vector potential.
352 !% The output file is called <tt>current_dia-</tt>.
353 !%Option jdos 44
354 !% Outputs the joint density of states.
355 !% The same variables as for the regular DOS are used to control the energies and broadening.
356 !%Option ldos 45
357 !% Outputs the local density of states
358 !% The broadening uses the same value as the regular DOS. The energies at which the LDOS is computed are
359 !% specified by the <tt>LDOSEnergies</tt> block.
360 !%End
361
362 !%Variable OutputFormat
363 !%Type flag
364 !%Default 0
365 !%Section Output
366 !%Description
367 !% Describes the format of the output files.
368 !% This variable can also be defined inside the <tt>Output</tt> block.
369 !% See <tt>Output</tt>.
370 !% Example: <tt>axis_x + plane_x + dx</tt>
371 !%Option axis_x bit(0)
372 !% The values of the function on the <i>x</i> axis are printed. The string <tt>.y=0,z=0</tt> is appended
373 !% to previous file names.
374 !%Option axis_y bit(1)
375 !% The values of the function on the <i>y</i> axis are printed. The string <tt>.x=0,z=0</tt> is appended
376 !% to previous file names.
377 !%Option axis_z bit(2)
378 !% The values of the function on the <i>z</i> axis are printed. The string <tt>.x=0,y=0</tt> is appended
379 !% to previous file names.
380 !%Option plane_x bit(3)
381 !% A plane slice at <i>x</i> = 0 is printed. The string <tt>.x=0</tt> is appended
382 !% to previous file names.
383 !%Option plane_y bit(4)
384 !% A plane slice at <i>y</i> = 0 is printed. The string <tt>.y=0</tt> is appended
385 !% to previous file names.
386 !%Option plane_z bit(5)
387 !% A plane slice at <i>z</i> = 0 is printed. The string <tt>.z=0</tt> is appended to
388 !% previous file names.
389 !%Option dx bit(6)
390 !% For printing three-dimensional information, the open-source program
391 !% visualization tool <a href=http://www.opendx.org>OpenDX</a> can be used. The string
392 !% <tt>.dx</tt> is appended to previous file names. Available only in 3D.
393 !%Option netcdf bit(7)
394 !% Outputs in <a href=http://www.unidata.ucar.edu/packages/netcdf>NetCDF</a> format. This file
395 !% can then be read, for example, by OpenDX. The string <tt>.ncdf</tt> is appended to previous file names.
396 !% Requires the NetCDF library. Only writes the real part of complex functions.
397 !%Option mesh_index bit(8)
398 !% Generates output files of a given quantity (density, wavefunctions, ...) which include
399 !% the internal numbering of mesh points. Since this mode produces large datafiles this is only
400 !% useful for small meshes and debugging purposes.
401 !% The output can also be used to display the mesh directly. A Gnuplot script for mesh visualization
402 !% can be found under <tt>PREFIX/share/octopus/util/display_mesh_index.gp</tt>.
403 !%Option xcrysden bit(9)
404 !% A format for printing structures and three-dimensional information, which can be visualized by
405 !% the free open-source program <a href=http://www.xcrysden.org>XCrySDen</a> and others. The string
406 !% <tt>.xsf</tt> is appended to previous file names. Note that lattice vectors and coordinates are as
407 !% specified by <tt>UnitsOutput</tt>. Available in 2D and 3D.
408 !%Option matlab bit(10)
409 !% In combination with <tt>plane_x</tt>, <tt>plane_y</tt> and
410 !% <tt>plane_z</tt>, this option produces output files which are
411 !% suitable for 2D Matlab functions like <tt>mesh()</tt>,
412 !% <tt>surf()</tt>, or <tt>waterfall()</tt>. To load these files
413 !% into Matlab you can use, <i>e.g.</i>
414 !%<tt>
415 !% >> density = load('static/density-1.x=0.matlab.abs');
416 !% >> mesh(density);
417 !%</tt>
418 !%Option meshgrid bit(11)
419 !% Outputs in Matlab mode the internal mesh in a format similar to
420 !%<tt>
421 !% >> [x,y] = meshgrid(-2:.2:2,-1:.15:1)
422 !%</tt>
423 !% The <i>x</i> meshgrid is contained in a file <tt>*.meshgrid.x</tt> and the <i>y</i>-grid can be found in
424 !% <tt>*.meshgrid.y</tt>.
425 !%Option boundary_points bit(12)
426 !% This option includes the output of the mesh enlargement. Default is without.
427 !% Supported only by <tt>binary</tt>, <tt>axis</tt>, <tt>plane</tt>, <tt>mesh_index</tt>,
428 !% and <tt>matlab</tt> formats.
429 !% Not all types of <tt>Output</tt> will have this information available. Not supported when parallel in domains.
430 !%Option binary bit(13)
431 !% Plain binary, new format.
432 !%Option etsf bit(14)
433 !% <a href=http://www.etsf.eu/resources/software/standardization_project>ETSF file format</a>.
434 !% Requires the ETSF_IO library. Applies only to <tt>Output = density</tt>, <tt>geometry</tt>,
435 !% <tt>wfs</tt>, and/or <tt>wfs_fourier</tt>.
436 !%Option xyz bit(15)
437 !% Geometry will be output in XYZ format. Does not affect other outputs.
438 !%Option cube bit(16)
439 !% Generates output in the <a href=http://paulbourke.net/dataformats/cube>cube file format</a>.
440 !% Available only in 3D. Only writes the real part of complex functions.
441 !% This output format always uses atomic units.
442 !%Option bild bit(19)
443 !% Generates output in <a href=http://plato.cgl.ucsf.edu/chimera/docs/UsersGuide/bild.html>BILD format</a>.
444 !%Option vtk bit(20)
445 !% Generates output in <a href=http://www.vtk.org/VTK/img/file-formats.pdf>VTK legacy format</a>.
446 !%Option integrate_xy bit(21)
447 !% Integrates the function in the x-y plane and the result on the <i>z</i> axis is printed.
448 !%Option integrate_xz bit(22)
449 !% Integrates the function in the x-z plane and the result on the <i>y</i> axis is printed
450 !%Option integrate_yz bit(23)
451 !% Integrates the function in the y-z plane and the result on the <i>x</i> axis is printed
452 !%Option ascii bit(24)
453 !% Plain text format regardless of dimensionality. For the moment only employed by the oct-phototoelectron_spectrum
454 !% post-processing utility.
455 !%Option poscar bit(25)
456 !% Write geometry in POSCAR format.
457 !% Note that atoms are not ordered by labels and that species names are taken from the Octopus input,
458 !% and are not truncated to two letters.
459 !%End
460
461 !%Variable OutputInterval
462 !%Type integer
463 !%Default 50
464 !%Section Output
465 !%Description
466 !% The output requested by variable <tt>Output</tt> is written
467 !% to the directory <tt>OutputIterDir</tt>
468 !% when the iteration number is a multiple of the <tt>OutputInterval</tt> variable.
469 !% Subdirectories are named Y.X, where Y is <tt>td</tt>, <tt>scf</tt>, or <tt>unocc</tt>, and
470 !% X is the iteration number. To use the working directory, specify <tt>"."</tt>
471 !% Must be >= 0. If it is 0, then no output is written. For <tt>gs</tt> and <tt>unocc</tt>
472 !% calculations, <tt>OutputDuringSCF</tt> must be set too for this output to be produced.
473 !% This variable can also be defined inside the <tt>Output</tt> block.
474 !% See <tt>Output</tt>.
475 !%End
476
477
478 what_no_how = (/ &
479 option__output__matrix_elements, &
480 option__output__berkeleygw, &
481 option__output__dos, &
482 option__output__tpa, &
483 option__output__mmb_den, &
484 option__output__j_flow, &
485 option__output__occ_matrices, &
486 option__output__effectiveu, &
487 option__output__magnetization, &
488 option__output__kanamoriu, &
489 option__output__stress, &
490 option__output__jdos &
491 /)
492
493 if (parse_block(namespace, what_tag, blk) == 0) then
494 nrows = parse_block_n(blk)
495 do iout = 0, nrows - 1
496 ncols = max(ncols , parse_block_cols(blk, iout))
497 end do
498
499 if (ncols == 1) then
500 !new format, Type 0
501 !%Output
502 ! density
503 ! wfs
504 !%
505 do iout = 1, nrows
506 call parse_block_integer(blk, iout - 1, 0, what_i)
507 if (.not. varinfo_valid_option(what_tag, what_i)) then
508 call messages_input_error(namespace, what_tag)
509 end if
510 if (what_i > 0) then
511 what(what_i) = .true.
512 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
513 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
514 .or. (what_tag /= 'Output')) then
515 call parse_variable(namespace, how_tag, 0, how(what_i))
516 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
517 call messages_input_error(namespace, how_tag)
518 end if
519 end if
520 end if
521 end do
522 else if (ncols == 2) then
523 !new format, Type 1
524 !%Output
525 ! density | cube + axis_z
526 ! wfs | cube
527 !%
528
529 do iout = 1, nrows
530 call parse_block_integer(blk, iout - 1, 0, what_i)
531 if (.not. varinfo_valid_option(what_tag, what_i)) then
532 call messages_input_error(namespace, what_tag)
533 end if
534 if (what_i > 0) then
535 what(what_i) = .true.
536 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
537 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
538 .or. (what_tag /= 'Output')) then
539 call parse_block_integer(blk, iout - 1, 1, how(what_i))
540 if (how(what_i) == 0) call parse_variable(namespace, how_tag, 0, how(what_i))
541 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
542 call messages_input_error(namespace, how_tag)
543 end if
544 end if
545 end if
546 end do
547
548 else
549 !new format, Type 2 (tagged)
550 !%Output
551 ! density | "output_interval" | 10 | "output_format" | cube + axis_z
552 ! wfs | "output_format" | cube | "output_interval" | 50
553 !%
554 !
555 ! OR
556 !
557 !%Output
558 ! density | "output_interval" | 10 | "output_format" | cube + axis_z
559 ! wfs | "output_format" | cube
560 !%
561 do iout = 1, nrows
562 call parse_block_integer(blk, iout - 1, 0, what_i)
563 if (.not. varinfo_valid_option(what_tag, what_i)) then
564 call messages_input_error(namespace, what_tag)
565 end if
566 if (what_i > 0) then
567 what(what_i) = .true.
568 do column_index = 0, 1
569 call parse_block_string(blk, iout - 1, 1 + column_index * 2, output_column_marker)
570 if (output_column_marker == 'output_interval') then
571 call parse_block_integer(blk, iout - 1, 2 + column_index * 2, output_interval(what_i))
572 else if (output_column_marker == 'output_format') then
573 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
574 .or. (what_tag /= 'Output')) then
575 call parse_block_integer(blk, iout - 1, 2 + column_index * 2, how(what_i))
576 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
577 call messages_input_error(namespace, how_tag)
578 end if
579 end if
580 else if (len_trim(output_column_marker) /= 0) then
581 ! Unknown output_column_marker
582 call messages_input_error(namespace, what_tag)
583 else
584 ! no output_column_marker -> full output info is not in this block
585 if (output_interval(what_i) == 0) then
586 call parse_variable(namespace, output_interval_tag, 50, output_interval(what_i))
587 end if
588 if (how(what_i) == 0) then
589 if (((what_tag == 'Output') .and. (.not. any(what_no_how == what_i)))&
590 .or. (what_tag /= 'Output')) then
591 call parse_variable(namespace, how_tag, 0, how(what_i))
592 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
593 call messages_input_error(namespace, how_tag)
594 end if
595 end if
596 end if
597 end if
598 end do
599 end if
600 end do
601 end if
602 call parse_block_end(blk)
603 else
604
605 call messages_variable_is_block(namespace, what_tag)
606
607 ! Output block does not exist but we may have OutputHow/OutputInterval
608 call parse_variable(namespace, how_tag, 0, how(0))
609 call parse_variable(namespace, output_interval_tag, 50, output_interval(0))
610 end if
611
612
613 do what_i = lbound(what, 1), ubound(what, 1)
614 if (what_tag == 'Output') then
615 if (what(what_i) .and. (.not. any(what_no_how == what_i))) then
616 if (.not. varinfo_valid_option(how_tag, how(what_i), is_flag=.true.)) then
617 call messages_input_error(namespace, how_tag)
618 end if
619
620 if (how(what_i) == 0 .and. .not. optional_default(ignore_error, .false.)) then
621 write(message(1), '(a)') 'Must specify output method with variable OutputFormat.'
622 call messages_fatal(1, only_root_writes = .true., namespace=namespace)
623 end if
624
625 ! some modes are not available in some circumstances
626 if (space%dim == 1) then
627 if (bitand(how(what_i), option__outputformat__axis_y) /= 0) then
628 message(1) = "OutputFormat = axis_y not available with Dimensions = 1."
629 call messages_fatal(1, namespace=namespace)
630 end if
631 if (bitand(how(what_i), option__outputformat__plane_z) /= 0) then
632 message(1) = "OutputFormat = plane_z not available with Dimensions = 1."
633 call messages_fatal(1, namespace=namespace)
634 end if
635 if (bitand(how(what_i), option__outputformat__xcrysden) /= 0) then
636 message(1) = "OutputFormat = xcrysden not available with Dimensions = 1."
637 call messages_fatal(1, namespace=namespace)
638 end if
639 end if
640
641 if (space%dim <= 2) then
642 if (bitand(how(what_i), option__outputformat__axis_z) /= 0) then
643 message(1) = "OutputFormat = axis_z not available with Dimensions <= 2."
644 call messages_fatal(1, namespace=namespace)
645 end if
646 if (bitand(how(what_i), option__outputformat__plane_x) /= 0) then
647 message(1) = "OutputFormat = plane_x not available with Dimensions <= 2."
648 call messages_fatal(1, namespace=namespace)
649 end if
650 if (bitand(how(what_i), option__outputformat__plane_y) /= 0) then
651 message(1) = "OutputFormat = plane_y not available with Dimensions <= 2."
652 call messages_fatal(1, namespace=namespace)
653 end if
654 if (bitand(how(what_i), option__outputformat__integrate_xy) /= 0) then
655 message(1) = "OutputFormat = integrate_xy not available with Dimensions <= 2."
656 call messages_fatal(1, namespace=namespace)
657 end if
658 if (bitand(how(what_i), option__outputformat__integrate_xz) /= 0) then
659 message(1) = "OutputFormat = integrate_xz not available with Dimensions <= 2."
660 call messages_fatal(1, namespace=namespace)
661 end if
662 if (bitand(how(what_i), option__outputformat__integrate_yz) /= 0) then
663 message(1) = "OutputFormat = integrate_yz not available with Dimensions <= 2."
664 call messages_fatal(1, namespace=namespace)
665 end if
666 if (bitand(how(what_i), option__outputformat__dx) /= 0) then
667 message(1) = "OutputFormat = dx not available with Dimensions <= 2."
668 call messages_fatal(1, namespace=namespace)
669 end if
670 if (bitand(how(what_i), option__outputformat__cube) /= 0) then
671 message(1) = "OutputFormat = cube not available with Dimensions <= 2."
672 call messages_fatal(1, namespace=namespace)
673 end if
674 if (bitand(how(what_i), option__outputformat__poscar) /= 0) then
675 message(1) = "OutputFormat = POSCAR not available with Dimensions <= 2."
676 call messages_fatal(1, namespace=namespace)
677 end if
678 end if
679
680 if (space%periodic_dim<=2) then
681 if (bitand(how(what_i), option__outputformat__poscar) /= 0) then
682 message(1) = "OutputFormat = POSCAR not available with periodic_dim <= 2."
683 call messages_fatal(1, namespace=namespace)
684 end if
685 end if
686
687#if !defined(HAVE_NETCDF)
688 if (bitand(how(what_i), option__outputformat__netcdf) /= 0) then
689 message(1) = 'Octopus was compiled without NetCDF support.'
690 message(2) = 'It is not possible to write output in NetCDF format.'
691 call messages_fatal(2, namespace=namespace)
692 end if
693#endif
694#if !defined(HAVE_ETSF_IO)
695 if (bitand(how(what_i), option__outputformat__etsf) /= 0) then
696 message(1) = 'Octopus was compiled without ETSF_IO support.'
697 message(2) = 'It is not possible to write output in ETSF format.'
698 call messages_fatal(2, namespace=namespace)
699 end if
700#endif
701
702
703 end if
704 end if
705
706 if (output_interval(what_i) < 0) then
707 message(1) = "OutputInterval must be >= 0."
708 call messages_fatal(1, namespace=namespace)
709 end if
710 end do
711
713 end subroutine io_function_read_what_how_when
714
715 ! -------------------------------------------------------------------
718 ! ".", "func", mesh, sb, func, M_ONE, ierr)
719 ! -------------------------------------------------------------------
720 integer(int64) function io_function_fill_how(where) result(how)
721 character(len=*), intent(in) :: where
722
723 push_sub(io_function_fill_how)
724
725 how = 0
726 if (index(where, "AxisX") /= 0) how = ior(how, option__outputformat__axis_x)
727 if (index(where, "AxisY") /= 0) how = ior(how, option__outputformat__axis_y)
728 if (index(where, "AxisZ") /= 0) how = ior(how, option__outputformat__axis_z)
729 if (index(where, "PlaneX") /= 0) how = ior(how, option__outputformat__plane_x)
730 if (index(where, "PlaneY") /= 0) how = ior(how, option__outputformat__plane_y)
731 if (index(where, "PlaneZ") /= 0) how = ior(how, option__outputformat__plane_z)
732 if (index(where, "IntegrateXY") /= 0) how = ior(how, option__outputformat__integrate_xy)
733 if (index(where, "IntegrateXZ") /= 0) how = ior(how, option__outputformat__integrate_xz)
734 if (index(where, "IntegrateYZ") /= 0) how = ior(how, option__outputformat__integrate_yz)
735 if (index(where, "DX") /= 0) how = ior(how, option__outputformat__dx)
736 if (index(where, "XCrySDen") /= 0) how = ior(how, option__outputformat__xcrysden)
737 if (index(where, "Binary") /= 0) how = ior(how, option__outputformat__binary)
738 if (index(where, "MeshIndex") /= 0) how = ior(how, option__outputformat__mesh_index)
739 if (index(where, "XYZ") /= 0) how = ior(how, option__outputformat__xyz)
740#if defined(HAVE_NETCDF)
741 if (index(where, "NETCDF") /= 0) how = ior(how, option__outputformat__netcdf)
742#endif
743 if (index(where, "Cube") /= 0) how = ior(how, option__outputformat__cube)
744 if (index(where, "VTK") /= 0) how = ior(how, option__outputformat__vtk)
745 if (index(where, "ASCII") /= 0) how = ior(how, option__outputformat__ascii)
746 if (index(where, "Bild") /= 0) how = ior(how, option__outputformat__bild)
747
748 pop_sub(io_function_fill_how)
749 end function io_function_fill_how
750
755 subroutine write_standard_xyz_file(namespace, fname, pos, species, header)
756 type(namespace_t), intent(in) :: namespace
757 character(len=*), intent(in) :: fname
758 real(real64), intent(in) :: pos(:,:)
759 character(len=*), intent(in) :: species(:)
760 character(len=*), optional, intent(in) :: header
761
762 integer :: iunit, n_atoms, iatom, min_dim
763 real(real64) :: position(3)
764
766
767 n_atoms = size(pos, 2)
768 assert(size(species) == n_atoms)
769
770 iunit = io_open(trim(fname)//'.xyz', namespace, action='write', position='asis')
771
772 write(iunit, '(i6)') n_atoms
773 if (present(header)) then
774 write(iunit, '(a)') trim(adjustl(header))
775 else
776 write(iunit, '(a)')
777 endif
778
779 ! Ensure a set of three coordinate components is written for 1D, 2D and ND systems
780 min_dim = min(size(pos, 1), 3)
781 position(1:3) = 0.0_real64
782
783 ! xyz-style labels and positions:
784 do iatom = 1, n_atoms
785 position(1:min_dim) = pos(1:min_dim, iatom)
786 write(iunit, '(a10, 3(1x, f15.10))') trim(adjustl(species(iatom))), &
788 end do
789
790 call io_close(iunit)
791
793
794 end subroutine write_standard_xyz_file
795
801 subroutine write_canonicalized_xyz_file(dir, fname, space, latt, pos, atoms, box, namespace)
802 character(len=*), intent(in) :: dir
803 character(len=*), intent(in) :: fname
804 class(space_t), intent(in) :: space
805 type(lattice_vectors_t), intent(in) :: latt
806 real(real64), intent(in) :: pos(:,:)
807 type(atom_t), intent(in) :: atoms(:)
808 class(box_t), intent(in) :: box
809 type(namespace_t), intent(in) :: namespace
810
811 integer :: ia
812 character(len=:), allocatable :: info_str, dir_fname
813 character(len=LABEL_LEN), allocatable :: species(:)
814
816
817 call io_mkdir(dir, namespace)
818
819 info_str = trim(space%short_info()) // '; ' // trim(box%short_info(unit_angstrom))
820 if (space%is_periodic()) then
821 info_str = info_str // '; ' // trim(latt%short_info(unit_angstrom))
822 end if
823
824 safe_allocate(species(1:size(atoms)))
825 do ia = 1, size(atoms)
826 species(ia) = atoms(ia)%get_label()
827 enddo
828
829 dir_fname = trim(dir) // '/' // trim(fname)
830 call write_standard_xyz_file(namespace, dir_fname, pos, species, info_str)
831
832 safe_deallocate_a(species)
833
835
836 end subroutine write_canonicalized_xyz_file
837
838 subroutine write_xsf_geometry_file(dir, fname, space, latt, pos, atoms, mesh, namespace, total_forces)
839 character(len=*), intent(in) :: dir, fname
840 class(space_t), intent(in) :: space
841 type(lattice_vectors_t), intent(in) :: latt
842 real(real64), intent(in) :: pos(:,:)
843 type(atom_t), intent(in) :: atoms(:)
844 class(mesh_t), intent(in) :: mesh
845 type(namespace_t), intent(in) :: namespace
846 real(real64), optional, intent(in) :: total_forces(:,:)
847
848 integer :: iunit
849 real(real64), allocatable :: forces(:,:)
851 if (.not. mpi_world%is_root()) return
852
854
855 call io_mkdir(dir, namespace)
856 iunit = io_open(trim(dir)//'/'//trim(fname)//'.xsf', namespace, action='write', position='asis')
857
858 if (present(total_forces)) then
859 safe_allocate(forces(1:space%dim, 1:size(atoms)))
860 forces = units_from_atomic(units_out%force, total_forces)
861 call write_xsf_geometry(iunit, space, latt, pos, atoms, mesh, forces = forces)
862 safe_deallocate_a(forces)
863 else
864 call write_xsf_geometry(iunit, space, latt, pos, atoms, mesh)
865 end if
866
867 call io_close(iunit)
868
870 end subroutine write_xsf_geometry_file
871
872 ! ---------------------------------------------------------
875 subroutine write_xsf_geometry(iunit, space, latt, pos, atoms, mesh, forces, index)
876 integer, intent(in) :: iunit
877 class(space_t), intent(in) :: space
878 type(lattice_vectors_t), intent(in) :: latt
879 real(real64), intent(in) :: pos(:,:)
880 type(atom_t), intent(in) :: atoms(:)
881 class(mesh_t), intent(in) :: mesh
882 real(real64), optional, intent(in) :: forces(:, :)
883 integer, optional, intent(in) :: index
884
885 integer :: idir, idir2, iatom, index_, natoms
886 character(len=7) :: index_str
887 real(real64) :: offset(space%dim)
888 real(real64) :: rlattice(space%dim, space%dim)
889
890 push_sub(write_xsf_geometry)
891
892 if (present(index)) then
893 write(index_str, '(a,i6)') ' ', index
894 index_ = index
895 else
896 write(index_str, '(a)') ''
897 index_ = 1
898 end if
899 natoms = size(pos, dim=2)
900
901 ! The corner of the cell is always (0,0,0) to XCrySDen
902 ! so the offset is applied to the atomic coordinates.
903 ! Along periodic dimensions the offset is -1/2 in reduced coordinates, as
904 ! our origin is at the center of the cell instead of being at the edge.
905 offset(1:space%dim) = latt%red_to_cart(spread(-m_half, 1, space%dim))
906 ! Offset in aperiodic directions:
907 do idir = space%periodic_dim + 1, space%dim
908 offset(idir) = -(mesh%idx%ll(idir) - 1)/2 * mesh%spacing(idir)
909 end do
910
911 if (space%is_periodic()) then
912 if (index_ == 1) then
913 select case (space%periodic_dim)
914 case (3)
915 write(iunit, '(a)') 'CRYSTAL'
916 case (2)
917 write(iunit, '(a)') 'SLAB'
918 case (1)
919 write(iunit, '(a)') 'POLYMER'
920 end select
921 end if
922
923 write(iunit, '(a)') 'PRIMVEC'//trim(index_str)
924
925 !Computes the rlattice corresponding to the 3D periodic version of the simulation box
926 rlattice = latt%rlattice
927 do idir = space%periodic_dim+1, space%dim
928 rlattice(:,idir) = rlattice(:,idir)*m_two*mesh%box%bounding_box_l(idir)
929 end do
930
931 do idir = 1, space%dim
932 write(iunit, '(3f12.6)') (units_from_atomic(units_out%length, rlattice(idir2, idir)), idir2 = 1, space%dim)
933 end do
934
935 write(iunit, '(a)') 'PRIMCOORD'//trim(index_str)
936 write(iunit, '(i10, a)') natoms, ' 1'
937 else
938 write(iunit, '(a)') 'ATOMS'//trim(index_str)
939 end if
940
941 ! BoxOffset should be considered here
942 do iatom = 1, natoms
943 write(iunit, '(a10, 3f12.6)', advance='no') trim(atoms(iatom)%label), &
944 (units_from_atomic(units_out%length, pos(idir, iatom) - offset(idir)), idir = 1, space%dim)
945 if (present(forces)) then
946 write(iunit, '(5x, 3f12.6)', advance='no') forces(:, iatom)
947 end if
948 write(iunit, '()')
949 end do
950
951 pop_sub(write_xsf_geometry)
952 end subroutine write_xsf_geometry
953
954! ---------------------------------------------------------
957 subroutine write_xsf_geometry_supercell(iunit, space, latt, pos, atoms, mesh, centers, supercell, extra_atom)
958 integer, intent(in) :: iunit
959 class(space_t), intent(in) :: space
960 type(lattice_vectors_t), intent(in) :: latt
961 real(real64), intent(in) :: pos(:,:)
962 type(atom_t), intent(in) :: atoms(:)
963 class(mesh_t), intent(in) :: mesh
964 real(real64), intent(in) :: centers(:, :)
965 integer, intent(in) :: supercell(:)
966 real(real64), optional, intent(in) :: extra_atom(:)
967
968 integer :: idir, idir2, iatom, index_
969 character(len=7) :: index_str
970 real(real64) :: offset(3)
971 integer :: irep, nreplica
972
974
975 write(index_str, '(a)') ''
976 index_ = 1
977
978 nreplica = product(supercell(1:space%dim))
979
980 ! The corner of the cell is always (0,0,0) to XCrySDen
981 ! so the offset is applied to the atomic coordinates.
982 ! Offset in periodic directions:
983 offset(1:space%dim) = latt%red_to_cart(spread(-m_half, 1, space%dim))
984 offset(1:3) = offset(1:3) + centers(1:3,1)
985 ! Offset in aperiodic directions:
986 do idir = space%periodic_dim + 1, 3
987 offset(idir) = -(mesh%idx%ll(idir) - 1)/2 * mesh%spacing(idir)
988 end do
989
990 if(space%is_periodic()) then
991 if(index_ == 1) then
992 select case(space%periodic_dim)
993 case(3)
994 write(iunit, '(a)') 'CRYSTAL'
995 case(2)
996 write(iunit, '(a)') 'SLAB'
997 case(1)
998 write(iunit, '(a)') 'POLYMER'
999 end select
1000 end if
1001
1002 write(iunit, '(a)') 'PRIMVEC'//trim(index_str)
1003
1004 do idir = 1, space%dim
1005 write(iunit, '(3f12.6)') (units_from_atomic(units_out%length, &
1006 latt%rlattice(idir2, idir)*supercell(idir)), idir2 = 1, space%dim)
1007 end do
1008
1009 write(iunit, '(a)') 'PRIMCOORD'//trim(index_str)
1010 if(.not.present(extra_atom)) then
1011 write(iunit, '(i10, a)') size(atoms)*nreplica, ' 1'
1012 else
1013 write(iunit, '(i10, a)') size(atoms)*nreplica+1, ' 1'
1014 end if
1015 else
1016 write(iunit, '(a)') 'ATOMS'//trim(index_str)
1017 end if
1018
1019
1020 do irep = 1, nreplica
1021 ! BoxOffset should be considered here
1022 do iatom = 1, size(atoms)
1023 write(iunit, '(a10, 3f12.6)', advance='no') trim(atoms(iatom)%label), &
1024 (units_from_atomic(units_out%length, pos(idir, iatom) + centers(idir, irep) &
1025 - offset(idir)), idir = 1, space%dim)
1026 write(iunit, '()')
1027 end do
1028 end do
1029 if(present(extra_atom)) then
1030 write(iunit, '(a10, 3f12.6)', advance='no') 'X', &
1031 (units_from_atomic(units_out%length, extra_atom(idir) - offset(idir)), idir = 1, space%dim)
1032 write(iunit, '()')
1033 end if
1034
1036 end subroutine write_xsf_geometry_supercell
1037
1038
1039#if defined(HAVE_NETCDF)
1040 ! ---------------------------------------------------------
1041 subroutine ncdf_error(func, status, filename, namespace, ierr)
1042 character(len=*), intent(in) :: func
1043 integer, intent(in) :: status
1044 character(len=*), intent(in) :: filename
1045 type(namespace_t), intent(in) :: namespace
1046 integer, intent(inout) :: ierr
1047
1048 push_sub(ncdf_error)
1049
1050 if (status == nf90_noerr) then
1051 pop_sub(ncdf_error)
1052 return
1053 end if
1054
1055 write(message(1),'(3a)') "NETCDF error in function '" , trim(func) , "'"
1056 write(message(2),'(3a)') "(reading/writing ", trim(filename) , ")"
1057 write(message(3), '(6x,a,a)')'Error code = ', trim(nf90_strerror(status))
1058 call messages_warning(3, namespace=namespace)
1059 ierr = 5
1060
1061 pop_sub(ncdf_error)
1062 end subroutine ncdf_error
1063#endif
1064
1065 ! ---------------------------------------------------------
1066 subroutine transpose3(in, out)
1067 real(real64), intent(in) :: in(:, :, :)
1068 real(real64), intent(out) :: out(:, :, :)
1069 integer :: ix, iy, iz
1070
1071 push_sub(transpose3)
1072
1073 do ix = lbound(in, 1), ubound(in, 1)
1074 do iy = lbound(in, 2), ubound(in, 2)
1075 do iz = lbound(in, 3), ubound(in, 3)
1076 out(iz, iy, ix) = in(ix, iy, iz)
1077 end do
1078 end do
1079 end do
1080
1081 pop_sub(transpose3)
1082 end subroutine transpose3
1083
1084#include "undef.F90"
1085#include "real.F90"
1086#include "io_function_inc.F90"
1087
1088#include "undef.F90"
1089#include "complex.F90"
1090#include "io_function_inc.F90"
1091#include "undef.F90"
1092
1093end module io_function_oct_m
1094
1095!! Local Variables:
1096!! mode: f90
1097!! coding: utf-8
1098!! End:
real(real64) function func(r1, rn, n, a)
Definition: logrid.F90:327
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:810
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:615
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)