42#include "./base/base_uses.f90"
48 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_binary_restarts'
71 subsys_section, binary_file_read)
77 LOGICAL,
INTENT(OUT) :: binary_file_read
79 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_binary_coordinates'
81 CHARACTER(LEN=default_path_length) :: binary_restart_file_name
82 CHARACTER(LEN=default_string_length) :: string
83 INTEGER :: handle, iatom, ikind, input_unit, istat, &
84 iw, natom, natomkind, ncore, &
85 nmolecule, nmoleculekind, nshell
86 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: ibuf, id_name
90 CALL timeset(routinen, handle)
93 cpassert(
ASSOCIATED(root_section))
94 cpassert(
ASSOCIATED(para_env))
95 cpassert(
ASSOCIATED(subsys_section))
98 binary_file_read = .false.
101 c_val=binary_restart_file_name)
103 IF (trim(adjustl(binary_restart_file_name)) ==
"")
THEN
104 CALL timestop(handle)
109 extension=
".subsysLog")
119 IF (para_env%is_source())
THEN
120 CALL open_file(file_name=binary_restart_file_name, &
122 file_form=
"UNFORMATTED", &
123 file_action=
"READWRITE", &
124 file_position=
"REWIND", &
125 unit_number=input_unit, &
127 READ (unit=input_unit, iostat=istat) &
128 natomkind, natom, ncore, nshell, nmoleculekind, nmolecule
130 CALL stop_read(
"natomkind,natom,ncore,nshell,nmoleculekind,nmolecule "// &
131 "(IOSTAT = "//trim(adjustl(
cp_to_string(istat)))//
")", &
135 WRITE (unit=iw, fmt=
"(T2,A,T71,I10)") &
136 "Number of atomic kinds:", natomkind, &
137 "Number of atoms:", natom, &
138 "Number of cores (only core-shell model):", ncore, &
139 "Number of shells (only core-shell model):", nshell, &
140 "Number of molecule kinds:", nmoleculekind, &
141 "Number of molecules", nmolecule
145 CALL para_env%bcast(natomkind)
146 CALL para_env%bcast(natom)
147 CALL para_env%bcast(ncore)
148 CALL para_env%bcast(nshell)
149 CALL para_env%bcast(nmoleculekind)
150 CALL para_env%bcast(nmolecule)
152 ALLOCATE (id_name(natomkind))
154 DO ikind = 1, natomkind
155 IF (para_env%is_source())
THEN
156 READ (unit=input_unit, iostat=istat) string
157 IF (istat /= 0)
CALL stop_read(
"string (IOSTAT = "// &
161 CALL para_env%bcast(string)
162 id_name(ikind) =
str2id(string)
167 ALLOCATE (atom_info%id_molname(natom))
168 atom_info%id_molname(:) = 0
169 ALLOCATE (atom_info%id_resname(natom))
170 atom_info%id_resname(:) = 0
171 ALLOCATE (atom_info%resid(natom))
173 ALLOCATE (atom_info%id_atmname(natom))
174 atom_info%id_atmname = 0
175 ALLOCATE (atom_info%r(3, natom))
176 atom_info%r(:, :) = 0.0_dp
177 ALLOCATE (atom_info%atm_mass(natom))
178 atom_info%atm_mass(:) = huge(0.0_dp)
179 ALLOCATE (atom_info%atm_charge(natom))
180 atom_info%atm_charge(:) = -huge(0.0_dp)
181 ALLOCATE (atom_info%occup(natom))
182 atom_info%occup(:) = 0.0_dp
183 ALLOCATE (atom_info%beta(natom))
184 atom_info%beta(:) = 0.0_dp
185 ALLOCATE (atom_info%id_element(natom))
186 atom_info%id_element(:) = 0
187 ALLOCATE (ibuf(natom))
190 IF (para_env%is_source())
THEN
191 READ (unit=input_unit, iostat=istat) ibuf(1:natom)
192 IF (istat /= 0)
CALL stop_read(
"ibuf (IOSTAT = "// &
196 CALL para_env%bcast(ibuf)
199 atom_info%id_atmname(iatom) = id_name(ikind)
200 atom_info%id_element(iatom) = id_name(ikind)
205 IF (para_env%is_source())
THEN
206 READ (unit=input_unit, iostat=istat) atom_info%r(1:3, 1:natom)
207 IF (istat /= 0)
CALL stop_read(
"atom_info%r(1:3,1:natom) (IOSTAT = "// &
211 CALL para_env%bcast(atom_info%r)
212 IF (
ASSOCIATED(
topology%cell_muc))
THEN
219 IF (nmolecule > 0)
THEN
220 ALLOCATE (id_name(nmoleculekind))
222 DO ikind = 1, nmoleculekind
223 IF (para_env%is_source())
THEN
224 READ (unit=input_unit, iostat=istat) string
225 IF (istat /= 0)
CALL stop_read(
"string (IOSTAT = "// &
229 CALL para_env%bcast(string)
230 id_name(ikind) =
str2id(string)
233 IF (para_env%is_source())
THEN
234 READ (unit=input_unit, iostat=istat) ibuf(1:natom)
235 IF (istat /= 0)
CALL stop_read(
"ibuf(1:natom) (IOSTAT = "// &
239 CALL para_env%bcast(ibuf)
242 atom_info%id_molname(iatom) = id_name(ikind)
246 IF (para_env%is_source())
THEN
247 READ (unit=input_unit, iostat=istat) atom_info%resid(1:natom)
248 IF (istat /= 0)
CALL stop_read(
"atom_info%resid(1:natom) (IOSTAT = "// &
252 CALL para_env%bcast(atom_info%resid)
261 topology%molname_generated = .false.
265 WRITE (unit=iw, fmt=
"(T2,A)") &
266 "BEGIN of COORD section data [Angstrom] read in binary format from file "// &
267 trim(binary_restart_file_name)
269 WRITE (unit=iw, fmt=
"(T2,A2,3(1X,ES25.16),2(1X,A))") &
270 trim(adjustl(
id2str(atom_info%id_atmname(iatom)))), &
272 trim(adjustl(
id2str(atom_info%id_molname(iatom)))), &
273 trim(adjustl(
id2str(atom_info%id_resname(iatom))))
275 WRITE (unit=iw, fmt=
"(T2,A)") &
276 "END of COORD section data [Angstrom] read from binary restart file "// &
277 trim(binary_restart_file_name)
280 IF (para_env%is_source())
CALL close_file(unit_number=input_unit, &
281 keep_preconnection=.true.)
283 binary_file_read = .true.
285 CALL timestop(handle)
304 subsys_section, binary_file_read, cell)
306 CHARACTER(LEN=*),
INTENT(IN) :: prefix
309 LOGICAL,
INTENT(OUT) :: binary_file_read
310 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
312 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_binary_cs_coordinates'
314 CHARACTER(LEN=default_path_length) :: binary_restart_file_name, message
315 CHARACTER(LEN=default_string_length) :: section_label, section_name
316 INTEGER :: handle, input_unit, iparticle, istat, &
318 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: ibuf
319 LOGICAL :: exit_routine
320 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rbuf
324 CALL timeset(routinen, handle)
327 cpassert(
ASSOCIATED(root_section))
328 cpassert(
ASSOCIATED(subsys_section))
330 para_env => logger%para_env
332 binary_file_read = .false.
334 IF (
ASSOCIATED(particle_set))
THEN
335 exit_routine = .false.
336 nparticle =
SIZE(particle_set)
338 exit_routine = .true.
343 c_val=binary_restart_file_name)
345 IF (trim(adjustl(binary_restart_file_name)) ==
"")
THEN
346 CALL timestop(handle)
351 extension=
".subsysLog")
353 section_name = prefix//
" COORDINATES"
356 IF (para_env%is_source())
THEN
357 CALL open_file(file_name=trim(binary_restart_file_name), &
359 file_form=
"UNFORMATTED", &
360 file_action=
"READWRITE", &
361 file_position=
"ASIS", &
362 unit_number=input_unit, &
364 READ (unit=input_unit, iostat=istat) section_label, nbuf
365 IF (istat /= 0)
CALL stop_read(
"section_label, nbuf -> "//trim(section_label)//
", "// &
367 " (IOSTAT = "//trim(adjustl(
cp_to_string(istat)))//
"). "// &
368 "Section "//trim(adjustl(section_name))//
" was expected.", &
370 IF (trim(section_label) == trim(section_name))
THEN
371 IF (nbuf /= nparticle)
THEN
373 message =
"INFO: The requested number of "//trim(section_name)//
" ("// &
374 trim(adjustl(
cp_to_string(nparticle)))//
") does not match the "// &
375 "number ("//trim(adjustl(
cp_to_string(nbuf)))//
") available from the "// &
376 "binary restart file <"//trim(binary_restart_file_name)// &
377 ">. The restart file information is ignored."
383 ALLOCATE (rbuf(3, nbuf))
384 READ (unit=input_unit, iostat=istat) rbuf(1:3, 1:nbuf)
385 IF (istat /= 0)
CALL stop_read(
"rbuf(1:3,1:nbuf) -> "//prefix// &
386 " coordinates (IOSTAT = "// &
390 ALLOCATE (ibuf(nbuf))
391 READ (unit=input_unit, iostat=istat) ibuf(1:nbuf)
392 IF (istat /= 0)
CALL stop_read(
"ibuf(1:nparticle) -> atomic indices of the "// &
393 trim(section_name)//
" (IOSTAT = "// &
398 exit_routine = .true.
401 WRITE (unit=iw, fmt=
"(T2,A,T71,I10)") &
402 "Number of "//prefix//
" particles:", nparticle
404 IF (nparticle == 0) exit_routine = .true.
407 CALL cp_abort(__location__, &
408 "Section label <"//trim(section_label)//
"> read from the "// &
409 "binary restart file <"//trim(binary_restart_file_name)// &
410 "> does not match the requested section name <"// &
411 trim(section_name)//
">.")
415 CALL para_env%bcast(exit_routine)
416 IF (exit_routine)
THEN
417 IF (para_env%is_source())
CALL close_file(unit_number=input_unit, &
418 keep_preconnection=.true.)
419 CALL timestop(handle)
423 cpassert(nparticle > 0)
425 ALLOCATE (rbuf(3, nparticle))
427 IF (para_env%is_source())
THEN
428 READ (unit=input_unit, iostat=istat) rbuf(1:3, 1:nparticle)
429 IF (istat /= 0)
CALL stop_read(
"rbuf(1:3,1:nparticle) -> "//prefix// &
430 " coordinates (IOSTAT = "// &
434 CALL para_env%bcast(rbuf)
436 DO iparticle = 1, nparticle
437 particle_set(iparticle)%r(1:3) = rbuf(1:3, iparticle)
438 IF (
PRESENT(cell))
THEN
445 ALLOCATE (ibuf(nparticle))
447 IF (para_env%is_source())
THEN
448 READ (unit=input_unit, iostat=istat) ibuf(1:nparticle)
449 IF (istat /= 0)
CALL stop_read(
"ibuf(1:nparticle) -> atomic indices of the "// &
450 trim(section_name)//
" (IOSTAT = "// &
455 CALL para_env%bcast(ibuf)
457 DO iparticle = 1, nparticle
458 particle_set(iparticle)%atom_index = ibuf(iparticle)
464 WRITE (unit=iw, fmt=
"(T2,A)") &
465 "BEGIN of "//trim(adjustl(section_name))// &
466 " section data [Angstrom] read in binary format from file "// &
467 trim(binary_restart_file_name)
468 DO iparticle = 1, nparticle
469 WRITE (unit=iw, fmt=
"(T2,A2,3(1X,ES25.16),1X,I0)") &
470 trim(adjustl(particle_set(iparticle)%atomic_kind%name)), &
471 particle_set(iparticle)%r(1:3)*
angstrom, &
472 particle_set(iparticle)%atom_index
474 WRITE (unit=iw, fmt=
"(T2,A)") &
475 "END of "//trim(adjustl(section_name))// &
476 " section data [Angstrom] read from binary restart file "// &
477 trim(binary_restart_file_name)
480 IF (para_env%is_source())
CALL close_file(unit_number=input_unit, &
481 keep_preconnection=.true.)
483 binary_file_read = .true.
485 CALL timestop(handle)
505 subsys_section, binary_file_read, cell)
507 CHARACTER(LEN=*),
INTENT(IN) :: prefix
512 LOGICAL,
INTENT(OUT) :: binary_file_read
513 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
515 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_binary_velocities'
517 CHARACTER(LEN=default_path_length) :: binary_restart_file_name, message
518 CHARACTER(LEN=default_string_length) :: section_label, section_name
519 INTEGER :: handle, i, input_unit, iparticle, istat, &
521 LOGICAL :: have_velocities
522 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rbuf
525 CALL timeset(routinen, handle)
528 cpassert(
ASSOCIATED(root_section))
529 cpassert(
ASSOCIATED(para_env))
530 cpassert(
ASSOCIATED(subsys_section))
533 binary_file_read = .false.
536 c_val=binary_restart_file_name)
538 IF (trim(adjustl(binary_restart_file_name)) ==
"")
THEN
539 CALL timestop(handle)
544 extension=
".subsysLog")
546 IF (len_trim(prefix) == 0)
THEN
547 section_name =
"VELOCITIES"
549 section_name = prefix//
" VELOCITIES"
552 have_velocities = .false.
554 IF (
ASSOCIATED(particle_set))
THEN
555 nparticle =
SIZE(particle_set)
562 IF (para_env%is_source())
THEN
563 CALL open_file(file_name=binary_restart_file_name, &
565 file_form=
"UNFORMATTED", &
566 file_action=
"READWRITE", &
567 file_position=
"ASIS", &
568 unit_number=input_unit, &
571 READ (unit=input_unit, iostat=istat) section_label, nbuf
572 IF (istat /= 0)
CALL stop_read(
"section_label, nbuf -> "//trim(section_label)//
", "// &
574 " (IOSTAT = "//trim(adjustl(
cp_to_string(istat)))//
"). "// &
575 "Section "//trim(adjustl(section_name))//
" was expected.", &
577 IF (index(section_label,
"THERMOSTAT") > 0)
THEN
580 ALLOCATE (rbuf(nbuf, 1))
583 READ (unit=input_unit, iostat=istat) rbuf(1:nbuf, 1)
584 IF (istat /= 0)
CALL stop_read(
"rbuf(1:nbuf,1) -> "// &
585 trim(adjustl(section_label))// &
586 " (IOSTAT = "//trim(adjustl(
cp_to_string(istat)))//
")", &
591 message =
"INFO: Ignoring section <"//trim(adjustl(section_label))// &
592 "> from binary restart file <"//trim(binary_restart_file_name)//
">."
597 ELSE IF (index(section_label,
"VELOCIT") == 0)
THEN
598 CALL cp_abort(__location__, &
599 "Section label <"//trim(section_label)//
"> read from the "// &
600 "binary restart file <"//trim(binary_restart_file_name)// &
601 "> does not match the requested section name <"// &
602 trim(section_name)//
">.")
604 IF (nbuf > 0) have_velocities = .true.
610 CALL para_env%bcast(nbuf)
611 CALL para_env%bcast(have_velocities)
613 IF (have_velocities)
THEN
615 ALLOCATE (rbuf(3, nbuf))
617 IF (para_env%is_source())
THEN
618 READ (unit=input_unit, iostat=istat) rbuf(1:3, 1:nbuf)
619 IF (istat /= 0)
CALL stop_read(
"rbuf(1:3,1:nbuf) -> "// &
620 trim(adjustl(section_name))// &
621 " (IOSTAT = "//trim(adjustl(
cp_to_string(istat)))//
")", &
625 IF (nbuf == nparticle)
THEN
626 CALL para_env%bcast(rbuf)
627 DO iparticle = 1, nparticle
628 particle_set(iparticle)%v(1:3) = rbuf(1:3, iparticle)
629 IF (
PRESENT(cell))
THEN
635 message =
"INFO: The requested number of "//trim(adjustl(section_name))// &
636 " ("//trim(adjustl(
cp_to_string(nparticle)))//
") does not match the "// &
637 "number ("//trim(adjustl(
cp_to_string(nbuf)))//
") available from the "// &
638 "binary restart file <"//trim(binary_restart_file_name)// &
639 ">. The restart file information is ignored."
648 IF (nbuf == nparticle)
THEN
650 WRITE (unit=iw, fmt=
"(T2,A)") &
651 "BEGIN of "//trim(adjustl(section_name))// &
652 " section data [a.u.] read in binary format from file "// &
653 trim(binary_restart_file_name)
654 IF (have_velocities)
THEN
655 DO iparticle = 1, nparticle
656 WRITE (unit=iw, fmt=
"(T2,A2,3(1X,ES25.16))") &
657 trim(adjustl(particle_set(iparticle)%atomic_kind%name)), &
658 particle_set(iparticle)%v(1:3)
661 WRITE (unit=iw, fmt=
"(A)") &
662 "# No "//trim(adjustl(section_name))//
" available"
664 WRITE (unit=iw, fmt=
"(T2,A)") &
665 "END of "//trim(adjustl(section_name))// &
666 " section data [a.u.] read from binary restart file "// &
667 trim(binary_restart_file_name)
669 binary_file_read = .true.
672 IF (para_env%is_source())
CALL close_file(unit_number=input_unit, &
673 keep_preconnection=.true.)
675 CALL timestop(handle)
695 CHARACTER(LEN=*),
INTENT(IN) :: prefix
697 CHARACTER(LEN=*),
INTENT(IN) :: binary_restart_file_name
698 LOGICAL,
INTENT(OUT) :: restart
701 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_binary_thermostats_nose'
703 CHARACTER(LEN=default_string_length) :: section_label, section_name
704 INTEGER :: handle, i,
idx, input_unit, istat, j, &
705 nhc_size, output_unit
707 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: rbuf
710 CALL timeset(routinen, handle)
712 cpassert(
ASSOCIATED(nhc))
713 cpassert(
ASSOCIATED(para_env))
728 section_name = prefix//
" THERMOSTATS"
731 IF (para_env%is_source())
THEN
732 CALL open_file(file_name=binary_restart_file_name, &
734 file_form=
"UNFORMATTED", &
735 file_action=
"READWRITE", &
736 file_position=
"ASIS", &
737 unit_number=input_unit)
738 READ (unit=input_unit, iostat=istat) section_label, nhc_size
739 IF (istat /= 0)
CALL stop_read(
"nhc_size (IOSTAT = "// &
742 IF (index(section_label,
"THERMOSTAT") == 0)
THEN
743 CALL cp_abort(__location__, &
744 "Section label <"//trim(section_label)//
"> read from the "// &
745 "binary restart file <"//trim(binary_restart_file_name)// &
746 "> does not match the requested section name <"// &
747 trim(section_name)//
">.")
749 IF (debug .AND. output_unit > 0)
THEN
750 WRITE (unit=output_unit, fmt=
"(T2,A,/,T2,A,I0)") &
751 "BEGIN of "//trim(adjustl(section_label))// &
752 " section data read in binary format from file "// &
753 trim(binary_restart_file_name), &
754 "# nhc_size = ", nhc_size
758 CALL para_env%bcast(nhc_size)
760 IF (nhc_size > 0)
THEN
762 ALLOCATE (rbuf(nhc_size))
766 IF (para_env%is_source())
THEN
767 READ (unit=input_unit, iostat=istat) rbuf(1:nhc_size)
768 IF (istat /= 0)
CALL stop_read(
"eta -> rbuf (IOSTAT = "// &
771 IF (debug .AND. output_unit > 0)
THEN
772 WRITE (unit=output_unit, fmt=
"(T2,A,/,(4(1X,ES25.16)))") &
773 "&COORD", rbuf(1:nhc_size)
776 CALL para_env%bcast(rbuf)
777 DO i = 1,
SIZE(nhc%nvt, 2)
778 idx = (nhc%map_info%index(i) - 1)*nhc%nhc_len
779 DO j = 1,
SIZE(nhc%nvt, 1)
781 nhc%nvt(j, i)%eta = rbuf(
idx)
786 IF (para_env%is_source())
THEN
787 READ (unit=input_unit, iostat=istat) rbuf(1:nhc_size)
788 IF (istat /= 0)
CALL stop_read(
"veta -> rbuf (IOSTAT = "// &
791 IF (debug .AND. output_unit > 0)
THEN
792 WRITE (unit=output_unit, fmt=
"(T2,A,/,(4(1X,ES25.16)))") &
793 "&VELOCITY", rbuf(1:nhc_size)
796 CALL para_env%bcast(rbuf)
797 DO i = 1,
SIZE(nhc%nvt, 2)
798 idx = (nhc%map_info%index(i) - 1)*nhc%nhc_len
799 DO j = 1,
SIZE(nhc%nvt, 1)
801 nhc%nvt(j, i)%v = rbuf(
idx)
806 IF (para_env%is_source())
THEN
807 READ (unit=input_unit, iostat=istat) rbuf(1:nhc_size)
808 IF (istat /= 0)
CALL stop_read(
"mnhc -> rbuf (IOSTAT = "// &
811 IF (debug .AND. output_unit > 0)
THEN
812 WRITE (unit=output_unit, fmt=
"(T2,A,/,(4(1X,ES25.16)))") &
813 "&MASS:", rbuf(1:nhc_size)
816 CALL para_env%bcast(rbuf)
817 DO i = 1,
SIZE(nhc%nvt, 2)
818 idx = (nhc%map_info%index(i) - 1)*nhc%nhc_len
819 DO j = 1,
SIZE(nhc%nvt, 1)
821 nhc%nvt(j, i)%mass = rbuf(
idx)
826 IF (para_env%is_source())
THEN
827 READ (unit=input_unit, iostat=istat) rbuf(1:nhc_size)
828 IF (istat /= 0)
CALL stop_read(
"fnhc -> rbuf (IOSTAT = "// &
831 IF (debug .AND. output_unit > 0)
THEN
832 WRITE (unit=output_unit, fmt=
"(T2,A,/,(4(1X,ES25.16)))") &
833 "&FORCE", rbuf(1:nhc_size)
836 CALL para_env%bcast(rbuf)
837 DO i = 1,
SIZE(nhc%nvt, 2)
838 idx = (nhc%map_info%index(i) - 1)*nhc%nhc_len
839 DO j = 1,
SIZE(nhc%nvt, 1)
841 nhc%nvt(j, i)%f = rbuf(
idx)
851 IF (para_env%is_source())
THEN
852 IF (debug .AND. output_unit > 0)
THEN
853 WRITE (unit=output_unit, fmt=
"(T2,A)") &
854 "END of"//trim(adjustl(section_label))// &
855 " section data read in binary format from file "// &
856 trim(binary_restart_file_name)
859 keep_preconnection=.true.)
862 CALL timestop(handle)
878 SUBROUTINE stop_read(object, unit_number)
879 CHARACTER(LEN=*),
INTENT(IN) :: object
880 INTEGER,
INTENT(IN) :: unit_number
882 CHARACTER(LEN=2*default_path_length) :: message
883 CHARACTER(LEN=default_path_length) :: file_name
886 IF (unit_number >= 0)
THEN
892 INQUIRE (unit=unit_number, name=file_name)
893 WRITE (unit=message, fmt=
"(A)") &
894 "An error occurred reading data object <"//trim(adjustl(object))// &
895 "> from file <"//trim(adjustl(file_name))//
">"
897 WRITE (unit=message, fmt=
"(A,I0,A)") &
898 "Could not read data object <"//trim(adjustl(object))// &
899 "> from logical unit ", unit_number,
". The I/O unit does not exist."
904 END SUBROUTINE stop_read
static GRID_HOST_DEVICE int idx(const orbital a)
Return coset index of given orbital angular momentum.
Handles all functions related to the CELL.
subroutine, public cell_transform_input_cartesian(cell, vector)
Transform a Cartesian real-space vector from the user input cell frame into CP2K's canonical internal...
Utility routines to open and close files. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
logical function, public file_exists(file_name)
Checks if file exists, considering also the file discovery mechanism.
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
Lumps all possible extended system variables into one type for easy access and passing.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Interface to the message passing library MPI.
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public angstrom
Perform an abnormal program termination.
subroutine, public print_message(message, output_unit, declev, before, after)
Perform a basic blocking of the text in message and print it optionally decorated with a frame of sta...
generates a unique id number for a string (str2id) that can be used two compare two strings....
character(len=default_string_length) function, public s2s(str)
converts a string in a string of default_string_length
integer function, public str2id(str)
returns a unique id for a given string, and stores the string for later retrieval using the id.
character(len=default_string_length) function, public id2str(id)
returns the string associated with a given id
Control for reading in different topologies and coordinates.
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment