42#include "../base/base_uses.f90"
50 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'md_util'
73 CHARACTER(LEN=default_string_length) :: my_itimes, my_region
75 INTEGER,
POINTER :: itimes
80 NULLIFY (itimes, simpar)
81 CALL get_md_env(md_env, itimes=itimes, simpar=simpar)
84 IF (simpar%do_thermal_region)
THEN
85 NULLIFY (thermal_regions)
86 CALL get_md_env(md_env, thermal_regions=thermal_regions)
87 DO ireg = 1, thermal_regions%nregions
89 t_region => thermal_regions%thermal_region(ireg)
90 IF (len_trim(t_region%temperature_function) > 0)
THEN
92 CALL parsef(1, trim(t_region%temperature_function), t_region%temperature_function_parameters)
93 t_region%temperature_function_values(1) = itimes*1.0_dp
94 t_region%temperature_function_values(2) = t_region%temperature
98 IF (t_region%temp_expected < 0.0_dp)
THEN
101 CALL cp_abort(__location__, &
102 "At step "//trim(my_itimes)//
" , the temperature "// &
103 "evaluated for thermal region "//trim(my_region)//
" is "// &
105 " K, which is negative and unphysical!")
124 SUBROUTINE md_output(md_env, md_section, root_section, forced_io)
127 LOGICAL,
INTENT(IN) :: forced_io
129 CHARACTER(LEN=*),
PARAMETER :: routinen =
'md_output'
135 CALL timeset(routinen, handle)
146 CALL timestop(handle)
174 INTEGER,
INTENT(OUT) :: dof
175 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: eigenvalues
176 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(OUT) :: eigenvectors
178 CHARACTER(LEN=default_path_length) :: filename
179 INTEGER :: jj, n_rep_val, unit_nr
187 eigenvectors = 0.0_dp
191 IF (n_rep_val > 0)
THEN
199 IF (para_env%is_source())
THEN
200 INQUIRE (file=filename, exist=exist)
201 IF (.NOT. exist)
THEN
202 cpabort(
"File "//filename//
" is not found.")
205 file_action=
"READ", &
206 file_form=
"UNFORMATTED", &
211 IF (dof >
SIZE(eigenvalues))
THEN
212 cpabort(
"Too many DoFs found in "//filename)
215 READ (unit_nr) eigenvalues(1:dof)
218 READ (unit_nr) eigenvectors(1:dof, jj)
223 CALL para_env%bcast(dof)
224 CALL para_env%bcast(eigenvalues)
225 CALL para_env%bcast(eigenvectors)
227 IF (para_env%is_source())
THEN
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.
various routines to log and control the output. The idea is that decisions about where to log should ...
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...
character(len=default_path_length) function, public cp_print_key_generate_filename(logger, print_key, middle_name, extension, my_local)
Utility function that returns a unit number to write the print key. Might open a file with a unique f...
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
This public domain function parser module is intended for applications where a set of mathematical ex...
subroutine, public parsef(i, funcstr, var)
Parse ith function string FuncStr and compile it into bytecode.
real(rn) function, public evalf(i, val)
...
integer, public evalerrtype
subroutine, public finalizef()
...
subroutine, public initf(n)
...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
prints all energy info per timestep to the screen or to user defined output files
subroutine, public md_write_output(md_env)
This routine computes the conserved quantity, temperature and things like that and prints them out.
subroutine, public get_md_env(md_env, itimes, constant, used_time, cell, simpar, npt, force_env, para_env, reftraj, t, init, first_time, fe_env, thermostats, barostat, thermostat_coeff, thermostat_part, thermostat_shell, thermostat_baro, thermostat_fast, thermostat_slow, md_ener, averages, thermal_regions, ehrenfest_md)
get components of MD environment type
Utilities for Molecular Dynamics.
subroutine, public md_output(md_env, md_section, root_section, forced_io)
collects the part of the MD that, basically, does the output
subroutine, public update_expected_temperature(md_env)
update_expected_temperature
subroutine, public read_vib_eigs_unformatted(md_section, vib_section, para_env, dof, eigenvalues, eigenvectors)
read eigenvalues and eigenvectors of Hessian from vibrational analysis results, for use of initialisi...
Interface to the message passing library MPI.
Type for storing MD parameters.
Utilities for string manipulations.
subroutine, public integer_to_string(inumber, string)
Converts an integer number to a string. The WRITE statement will return an error message,...
Thermal regions type: to initialize and control the temperature of different regions.
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
Simulation parameter type for molecular dynamics.