34 #include "../../base/base_uses.f90"
42 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'barostat_utils'
58 TYPE(cell_type),
POINTER :: cell
59 TYPE(simpar_type),
INTENT(IN) :: simpar
60 TYPE(npt_info_type),
DIMENSION(:, :),
INTENT(IN) :: npt
61 REAL(kind=
dp),
INTENT(OUT) :: baro_kin, baro_pot
64 REAL(
dp) :: iv0, v0, v_shock
68 baro_pot = simpar%p_ext*cell%deth
69 baro_kin = 0.5_dp*npt(1, 1)%v**2*npt(1, 1)%mass
71 baro_pot = simpar%p_ext*cell%deth
75 baro_kin = baro_kin + 0.5_dp*npt(i, j)%v**2*npt(i, j)%mass
81 v_shock = simpar%v_shock
84 baro_pot = -0.5_dp*v_shock*v_shock*(1._dp - cell%deth*iv0)**2 - simpar%p0*(v0 - cell%deth)
86 baro_kin = 0.5_dp*npt(1, 1)%v*npt(1, 1)%v*npt(1, 1)%mass
103 TYPE(barostat_type),
POINTER :: barostat
104 TYPE(simpar_type),
INTENT(IN) :: simpar
105 CHARACTER(LEN=default_string_length) :: my_pos, my_act
106 TYPE(cell_type),
POINTER :: cell
107 INTEGER,
INTENT(IN) :: itimes
108 REAL(kind=
dp),
INTENT(IN) :: time
110 INTEGER :: baro, nfree
112 REAL(kind=
dp) :: baro_kin, baro_pot, temp
113 TYPE(cp_logger_type),
POINTER :: logger
118 IF (
ASSOCIATED(barostat))
THEN
120 extension=
".bener", file_position=my_pos, file_action=my_act, is_new_file=new_file)
122 nfree =
SIZE(barostat%npt, 1)*
SIZE(barostat%npt, 2)
123 temp = 2.0_dp*baro_kin/real(nfree,
dp)*
kelvin
126 WRITE (baro,
'("#",3X,A,10X,A,8X,3(5X,A,5X),3X,A)')
"Step Nr.",
"Time[fs]",
"Kin.[a.u.]", &
127 "Temp.[K]",
"Pot.[a.u.]",
"Vol[Ang.^3]"
129 WRITE (unit=baro, fmt=
"(I10, F20.3,4F20.10)") itimes, time*
femtoseconds, &
Barostat structure: module containing barostat available for MD.
subroutine, public get_baro_energies(cell, simpar, npt, baro_kin, baro_pot)
Calculates kinetic energy and potential of barostat.
subroutine, public print_barostat_status(barostat, simpar, my_pos, my_act, cell, itimes, time)
Prints status of barostat during an MD run.
Handles all functions related to the CELL.
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...
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)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
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
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
Definition of physical constants:
real(kind=dp), parameter, public femtoseconds
real(kind=dp), parameter, public kelvin
real(kind=dp), parameter, public angstrom
Type for storing MD parameters.