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)') str_center(
"The octopus is swimming in " // trim(sys_name), 70)
262 call messages_info(2)
264 call mpi_world%barrier()
266 call print_date(
"Calculation started on ")
297#ifdef HAVE_BERKELEYGW
306#if (defined(HAVE_CLBLAS)) || (defined(HAVE_CLBLAST))
363 real(real64),
target,
intent(in) :: array(:, :)
365 integer(c_intptr_t) :: addr1, addr2
369 if (ubound(array, dim = 2) > 1)
then
370 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
371 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
372 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
381 complex(real64),
target,
intent(in) :: array(:, :)
383 integer(c_intptr_t) :: addr1, addr2
387 if (ubound(array, dim = 2) > 1)
then
388 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
389 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
390 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
398 integer,
target,
intent(in) :: array(:, :)
400 integer(c_intptr_t) :: addr1, addr2
404 if (ubound(array, dim = 2) > 1)
then
405 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
406 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
408 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
415 integer(int64),
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)
425 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
434 real(real64),
target,
intent(in) :: array(:, :, :)
436 integer(c_intptr_t) :: addr1, addr2
440 if (ubound(array, dim = 2) > 1)
then
441 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
442 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
443 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
452 complex(real64),
target,
intent(in) :: array(:, :, :)
454 integer(c_intptr_t) :: addr1, addr2
458 if (ubound(array, dim = 2) > 1)
then
459 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
460 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
461 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
469 integer,
target,
intent(in) :: array(:, :, :)
471 integer(c_intptr_t) :: addr1, addr2
475 if (ubound(array, dim = 2) > 1)
then
476 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
477 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
478 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
485 integer(int64),
target,
intent(in) :: array(:, :, :)
487 integer(c_intptr_t) :: addr1, addr2
491 if (ubound(array, dim = 2) > 1)
then
492 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
493 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
494 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
501 integer function dlead_dim(array)
result(lead_dim)
502 real(real64),
intent(in) :: array(:, :)
511 integer function zlead_dim(array)
result(lead_dim)
512 complex(real64),
intent(in) :: array(:, :)
521 integer function dlead_dim2(array)
result(lead_dim)
522 real(real64),
intent(in) :: array(:, :, :)
526 lead_dim = ubound(array, dim = 1) * ubound(array, dim = 2)
531 integer function zlead_dim2(array)
result(lead_dim)
532 complex(real64),
intent(in) :: array(:, :, :)
536 lead_dim = ubound(array, dim = 1) * ubound(array, dim = 2)
540 integer(int64),
allocatable,
intent(inout) :: array(:)
541 integer,
intent(in) :: new_size
543 integer(int64),
allocatable :: tmp(:)
549 allocate(tmp(1:new_size))
550 copy_size = min(new_size,
size(array))
551 tmp(1:copy_size) = array(1:copy_size)
552 safe_deallocate_a(array)
553 call move_alloc(tmp, array)
560 character(len=32) :: vec
561 character(kind=c_char) :: c_str(33)
565 call string_c_to_f(c_str, vec)
566 message(1) =
'Vectorization level : ' // trim(vec)
567 call messages_info(1)
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()
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()
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)