75 integer,
intent(in) :: nn
76 integer,
intent(inout) :: n_divisors
77 integer,
intent(out) :: divisors(:)
83 assert(n_divisors > 1)
87 divisors(n_divisors) = 1
89 if (mod(nn, ii) == 0)
then
90 n_divisors = n_divisors + 1
92 if (n_divisors > max_d - 1)
then
93 message(1) =
"Internal error in get_divisors. Please increase n_divisors"
97 divisors(n_divisors) = ii
100 n_divisors = n_divisors + 1
101 divisors(n_divisors) = nn
108 character pure function index2axis(idir) result(ch)
109 integer,
intent(in) :: idir
121 write(ch,
'(i1)') idir
128 integer,
intent(in) :: idir
129 character(len=2) :: ch
141 write(ch,
'(i2)') idir
148 subroutine output_tensor(tensor, ndim, unit, write_average, iunit, namespace)
149 real(real64),
intent(in) :: tensor(:,:)
150 integer,
intent(in) :: ndim
151 type(unit_t),
intent(in) :: unit
152 logical,
optional,
intent(in) :: write_average
153 integer,
optional,
intent(in) :: iunit
154 type(namespace_t),
optional,
intent(in) :: namespace
156 real(real64) :: trace
158 logical :: write_average_
162 write_average_ = optional_default(write_average, .
true.)
168 write(message(1),
'(a,f20.6)') trim(message(1)), units_from_atomic(unit, tensor(jj, kk))
170 trace = trace + tensor(jj, jj)
171 call messages_info(1, iunit=iunit, namespace=namespace)
174 if (write_average_)
then
175 write(message(1),
'(a, f20.6)')
'Isotropic average', units_from_atomic(unit, trace/real(ndim, real64) )
176 call messages_info(1, iunit=iunit, namespace=namespace)
185 real(real64),
intent(in) :: dipole(:)
186 integer,
intent(in) :: ndim
187 integer,
optional,
intent(in) :: iunit
188 type(namespace_t),
optional,
intent(in) :: namespace
194 write(message(1),
'(a,a20,a17)')
'Dipole:',
'[' // trim(units_abbrev(units_out%length)) //
']', &
195 '[' // trim(units_abbrev(unit_debye)) //
']'
197 write(message(1+idir),
'(6x,3a,es14.5,3x,2es14.5)')
'<',
index2axis(idir),
'> = ', &
198 units_from_atomic(units_out%length, dipole(idir)), units_from_atomic(unit_debye, dipole(idir))
200 call messages_info(1+ndim, iunit=iunit, namespace=namespace)
210 character(len=256) :: sys_name
213 call io_dump_file(stdout, trim(trim(conf%share) //
'/logo'))
217 message(2) = str_center(
"Running octopus", 70)
219 call messages_info(3)
222 "Version : " // trim(conf%version)
224 "Commit : "// trim(conf%git_commit)
226 "Configuration time : "// trim(conf%config_time)
227 call messages_info(3)
232 message(3) =
'Architecture : ' + tostring(oct_arch)
233 call messages_info(3)
236 "C compiler : "//trim(conf%cc)
238 "C compiler flags : "//trim(conf%cflags)
240 "C++ compiler : "//trim(conf%cxx)
242 "C++ compiler flags : "//trim(conf%cxxflags)
243#ifdef HAVE_FC_COMPILER_VERSION
244 message(5) =
"Fortran compiler : "//trim(conf%fc) //
" ("//compiler_version()//
")"
246 message(5) =
"Fortran compiler : "//trim(conf%fc)
249 "Fortran compiler flags : "//trim(conf%fcflags)
250 call messages_info(6)
253 call messages_info(1)
256 call loct_sysname(sys_name)
257 write(message(1),
'(a)') str_center(
"The octopus is swimming in " // trim(sys_name), 70)
259 call messages_info(2)
261 call mpi_world%barrier()
263 call print_date(
"Calculation started on ")
290#ifdef HAVE_BLUE_GENE_Q
306#ifdef HAVE_BERKELEYGW
315#if (defined(HAVE_CLBLAS)) || (defined(HAVE_CLBLAST))
372 real(real64),
target,
intent(in) :: array(:, :)
374 integer(c_intptr_t) :: addr1, addr2
378 if (ubound(array, dim = 2) > 1)
then
379 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
380 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
381 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
390 complex(real64),
target,
intent(in) :: array(:, :)
392 integer(c_intptr_t) :: addr1, addr2
396 if (ubound(array, dim = 2) > 1)
then
397 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
398 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
399 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
407 integer,
target,
intent(in) :: array(:, :)
409 integer(c_intptr_t) :: addr1, addr2
413 if (ubound(array, dim = 2) > 1)
then
414 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
415 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
417 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
424 integer(int64),
target,
intent(in) :: array(:, :)
426 integer(c_intptr_t) :: addr1, addr2
430 if (ubound(array, dim = 2) > 1)
then
431 addr1 = transfer(c_loc(array(1,1)), 0_c_intptr_t)
432 addr2 = transfer(c_loc(array(1,2)), 0_c_intptr_t)
434 known = ubound(array, dim = 1) == (addr2-addr1)/c_sizeof(array(1, 1))
443 real(real64),
target,
intent(in) :: array(:, :, :)
445 integer(c_intptr_t) :: addr1, addr2
449 if (ubound(array, dim = 2) > 1)
then
450 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
451 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
452 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
461 complex(real64),
target,
intent(in) :: array(:, :, :)
463 integer(c_intptr_t) :: addr1, addr2
467 if (ubound(array, dim = 2) > 1)
then
468 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
469 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
470 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
478 integer,
target,
intent(in) :: array(:, :, :)
480 integer(c_intptr_t) :: addr1, addr2
484 if (ubound(array, dim = 2) > 1)
then
485 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
486 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
487 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
494 integer(int64),
target,
intent(in) :: array(:, :, :)
496 integer(c_intptr_t) :: addr1, addr2
500 if (ubound(array, dim = 2) > 1)
then
501 addr1 = transfer(c_loc(array(1,1,1)), 0_c_intptr_t)
502 addr2 = transfer(c_loc(array(1,2,1)), 0_c_intptr_t)
503 known = ubound(array, dim = 1) == (addr2 - addr1)/c_sizeof(array(1, 1, 1))
510 integer function dlead_dim(array)
result(lead_dim)
511 real(real64),
intent(in) :: array(:, :)
520 integer function zlead_dim(array)
result(lead_dim)
521 complex(real64),
intent(in) :: array(:, :)
530 integer function dlead_dim2(array)
result(lead_dim)
531 real(real64),
intent(in) :: array(:, :, :)
535 lead_dim = ubound(array, dim = 1) * ubound(array, dim = 2)
541 complex(real64),
intent(in) :: array(:, :, :)
545 lead_dim = ubound(array, dim = 1) * ubound(array, dim = 2)
549 integer(int64),
allocatable,
intent(inout) :: array(:)
550 integer,
intent(in) :: new_size
552 integer(int64),
allocatable :: tmp(:)
558 allocate(tmp(1:new_size))
559 copy_size = min(new_size,
size(array))
560 tmp(1:copy_size) = array(1:copy_size)
561 safe_deallocate_a(array)
562 call move_alloc(tmp, array)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
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, 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)