76 integer,
intent(in) :: nn
77 integer,
intent(inout) :: n_divisors
78 integer,
intent(out) :: divisors(:)
84 assert(n_divisors > 1)
88 divisors(n_divisors) = 1
90 if (mod(nn, ii) == 0)
then
91 n_divisors = n_divisors + 1
93 if (n_divisors > max_d - 1)
then
94 message(1) =
"Internal error in get_divisors. Please increase n_divisors"
98 divisors(n_divisors) = ii
101 n_divisors = n_divisors + 1
102 divisors(n_divisors) = nn
109 character pure function index2axis(idir) result(ch)
110 integer,
intent(in) :: idir
122 write(ch,
'(i1)') idir
129 integer,
intent(in) :: idir
130 character(len=2) :: ch
142 write(ch,
'(i2)') idir
149 subroutine output_tensor(tensor, ndim, unit, write_average, iunit, namespace)
150 real(real64),
intent(in) :: tensor(:,:)
151 integer,
intent(in) :: ndim
152 type(unit_t),
intent(in) :: unit
153 logical,
optional,
intent(in) :: write_average
154 integer,
optional,
intent(in) :: iunit
155 type(namespace_t),
optional,
intent(in) :: namespace
157 real(real64) :: trace
159 logical :: write_average_
163 write_average_ = optional_default(write_average, .
true.)
169 write(message(1),
'(a,f20.6)') trim(message(1)), units_from_atomic(unit, tensor(jj, kk))
171 trace = trace + tensor(jj, jj)
172 call messages_info(1, iunit=iunit, namespace=namespace)
175 if (write_average_)
then
176 write(message(1),
'(a, f20.6)')
'Isotropic average', units_from_atomic(unit, trace/real(ndim, real64) )
177 call messages_info(1, iunit=iunit, namespace=namespace)
186 real(real64),
intent(in) :: dipole(:)
187 integer,
intent(in) :: ndim
188 integer,
optional,
intent(in) :: iunit
189 type(namespace_t),
optional,
intent(in) :: namespace
195 write(message(1),
'(a,a20,a17)')
'Dipole:',
'[' // trim(units_abbrev(units_out%length)) //
']', &
196 '[' // trim(units_abbrev(unit_debye)) //
']'
198 write(message(1+idir),
'(6x,3a,es14.5,3x,2es14.5)')
'<',
index2axis(idir),
'> = ', &
199 units_from_atomic(units_out%length, dipole(idir)), units_from_atomic(unit_debye, dipole(idir))
201 call messages_info(1+ndim, iunit=iunit, namespace=namespace)
211 character(len=256) :: sys_name
214 call io_dump_file(stdout, trim(trim(conf%share) //
'/logo'))
218 message(2) = str_center(
"Running octopus", 70)
220 call messages_info(3)
223 "Version : " // trim(conf%version)
225 "Commit : "// trim(conf%git_commit)
227 "Configuration time : "// trim(conf%config_time)
228 call messages_info(3)
233 message(3) =
'Architecture : ' + tostring(oct_arch)
234 call messages_info(3)
239 "C compiler : "//trim(conf%cc)
241 "C compiler flags : "//trim(conf%cflags)
243 "C++ compiler : "//trim(conf%cxx)
245 "C++ compiler flags : "//trim(conf%cxxflags)
246#ifdef HAVE_FC_COMPILER_VERSION
247 message(5) =
"Fortran compiler : "//trim(conf%fc) //
" ("//compiler_version()//
")"
249 message(5) =
"Fortran compiler : "//trim(conf%fc)
252 "Fortran compiler flags : "//trim(conf%fcflags)
253 call messages_info(6)
256 call messages_info(1)
259 call loct_sysname(sys_name)
260 write(message(1),
'(a)')
"The octopus is swimming in " // trim(sys_name)
262 call messages_info(2)
264 call mpi_world%barrier()
266 call print_date(
"Calculation started on ")
294#ifdef HAVE_LIBXC_FUNCS
297#ifdef HAVE_LIBXC_DEVICE
303#ifdef HAVE_FFTW3_THREADS
325#ifdef HAVE_BERKELEYGW
346#ifdef HAVE_LIBVDWXC_MPI
397 real(real64),
target,
intent(in) :: array(:, :)
399 integer(c_intptr_t) :: addr1, addr2
403 if (ubound(array, dim = 2) > 1)
then
404 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
405 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
406 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
415 complex(real64),
target,
intent(in) :: array(:, :)
417 integer(c_intptr_t) :: addr1, addr2
421 if (ubound(array, dim = 2) > 1)
then
422 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
423 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
424 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
432 integer,
target,
intent(in) :: array(:, :)
434 integer(c_intptr_t) :: addr1, addr2
438 if (ubound(array, dim = 2) > 1)
then
439 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
440 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
442 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
449 integer(int64),
target,
intent(in) :: array(:, :)
451 integer(c_intptr_t) :: addr1, addr2
455 if (ubound(array, dim = 2) > 1)
then
456 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
457 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
459 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
468 real(real64),
target,
intent(in) :: array(:, :, :)
470 integer(c_intptr_t) :: addr1, addr2
474 if (ubound(array, dim = 2) > 1)
then
475 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
476 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
477 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
486 complex(real64),
target,
intent(in) :: array(:, :, :)
488 integer(c_intptr_t) :: addr1, addr2
492 if (ubound(array, dim = 2) > 1)
then
493 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
494 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
495 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
503 integer,
target,
intent(in) :: array(:, :, :)
505 integer(c_intptr_t) :: addr1, addr2
509 if (ubound(array, dim = 2) > 1)
then
510 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
511 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
512 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
519 integer(int64),
target,
intent(in) :: array(:, :, :)
521 integer(c_intptr_t) :: addr1, addr2
525 if (ubound(array, dim = 2) > 1)
then
526 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
527 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
528 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
536 real(real64),
intent(in) :: array(:, :)
546 complex(real64),
intent(in) :: array(:, :)
556 real(real64),
intent(in) :: array(:, :, :)
560 lead_dim = ubound(array, dim = 1) * ubound(array, dim = 2)
565 integer function zlead_dim2(array)
result(lead_dim)
566 complex(real64),
intent(in) :: array(:, :, :)
570 lead_dim = ubound(array, dim = 1) * ubound(array, dim = 2)
574 integer(int64),
allocatable,
intent(inout) :: array(:)
575 integer,
intent(in) :: new_size
577 integer(int64),
allocatable :: tmp(:)
583 allocate(tmp(1:new_size))
584 copy_size = min(new_size,
size(array))
585 tmp(1:copy_size) = array(1:copy_size)
586 safe_deallocate_a(array)
587 call move_alloc(tmp, array)
594 character(len=32) :: vec
595 character(kind=c_char) :: c_str(33)
599 call string_c_to_f(c_str, vec)
600 message(1) =
'Vectorization level : ' // trim(vec)
601 call messages_info(1)
System information (time, memory, sysname)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
This module contains interfaces for routines in operate.c.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
This module is intended to contain simple general-purpose utility functions and procedures.
subroutine, public output_tensor(tensor, ndim, unit, write_average, iunit, namespace)
character(len=256) function, public get_config_opts()
Character string containing compile-time options.
integer function zlead_dim2(array)
subroutine write_vectorization_level()
Prints the level of vectorization used for the vectorized finite differences.
subroutine, public output_dipole(dipole, ndim, iunit, namespace)
logical function zleading_dimension_is_known2(array)
logical function lleading_dimension_is_known(array)
logical function zleading_dimension_is_known(array)
subroutine, public get_divisors(nn, n_divisors, divisors)
integer function dlead_dim(array)
subroutine, public make_array_larger(array, new_size)
logical function dleading_dimension_is_known2(array)
character(len=256) function, public get_optional_libraries()
Character string containing optional external libraries.
logical function ileading_dimension_is_known(array)
integer function dlead_dim2(array)
character pure function, public index2axis(idir)
logical function lleading_dimension_is_known2(array)
logical function ileading_dimension_is_known2(array)
pure character(len=2) function, public index2axisbz(idir)
subroutine, public print_header()
This subroutine prints the logo followed by information about the compilation and the system....
integer function zlead_dim(array)
logical function dleading_dimension_is_known(array)
void get_vectorization_level(char *level)