Skip to content

Commit

Permalink
Revise thermostat output
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrack committed Oct 14, 2020
1 parent 7bae583 commit e8d3a7a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 43 deletions.
61 changes: 33 additions & 28 deletions src/motion/thermostat/thermostat_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -463,39 +463,44 @@ SUBROUTINE thermostat_info(thermostat, label, section, simpar, para_env)
! Total Tehrmostat Energy
CALL get_thermostat_energies(thermostat, pot_energy, kin_energy, para_env)
IF (iw > 0) THEN
WRITE (iw, '( /,A )') ' THERMOSTAT| Thermostat Info for '//TRIM(label)
WRITE (iw, '(/,T2,A)') &
'THERMOSTAT| Thermostat information for '//TRIM(label)
SELECT CASE (thermostat%type_of_thermostat)
CASE (do_thermo_nose)
WRITE (iw, '( A,T63,A )') ' THERMOSTAT| Type of thermostat', 'Nose-Hoover-Chains'
WRITE (iw, '( A,T77,I4 )') ' THERMOSTAT| Nose-Hoover-Chain length ', thermostat%nhc%nhc_len
tmp = cp_unit_from_cp2k(thermostat%nhc%tau_nhc, "fs")
WRITE (iw, '( A,A4,A,T71,F10.2 )') &
' THERMOSTAT| Nose-Hoover-Chain time constant [', 'fs', '] ', tmp
WRITE (iw, '( A,T77,I4 )') ' THERMOSTAT| Order of Yoshida integrator ', &
thermostat%nhc%nyosh
WRITE (iw, '( A,T77,I4 )') ' THERMOSTAT| Number of multiple time steps', &
thermostat%nhc%nc
WRITE (iw, '( A,T69,F12.6 )') ' THERMOSTAT| Initial Potential Energy', &
pot_energy
WRITE (iw, '( A,T69,F12.6 )') ' THERMOSTAT| Initial Kinetic Energy', &
kin_energy
WRITE (iw, '(T2,A,T63,A)') &
'THERMOSTAT| Type of thermostat', 'Nose-Hoover-Chains'
WRITE (iw, '(T2,A,T71,I10)') &
'THERMOSTAT| Nose-Hoover-Chain length', thermostat%nhc%nhc_len
tmp = cp_unit_from_cp2k(thermostat%nhc%tau_nhc, 'fs')
WRITE (iw, '(T2,A,T61,F20.6)') &
'THERMOSTAT| Nose-Hoover-Chain time constant [fs]', tmp
WRITE (iw, '(T2,A,T71,I10)') &
'THERMOSTAT| Order of Yoshida integrator', thermostat%nhc%nyosh
WRITE (iw, '(T2,A,T71,I10)') &
'THERMOSTAT| Number of multiple time steps', thermostat%nhc%nc
WRITE (iw, '(T2,A,T61,E20.12)') &
'THERMOSTAT| Initial potential energy', pot_energy, &
'THERMOSTAT| Initial kinetic energy', kin_energy
CASE (do_thermo_csvr)
WRITE (iw, '( A,T44,A )') ' THERMOSTAT| Type of thermostat', 'Canonical Sampling/Velocity Rescaling'
tmp = cp_unit_from_cp2k(thermostat%csvr%tau_csvr, "fs")*0.5_dp*simpar%dt
WRITE (iw, '( A,A4,A,T71,F10.2 )') &
' THERMOSTAT| CSVR time constant [', 'fs', '] ', tmp
WRITE (iw, '( A,T69,F12.6 )') &
' THERMOSTAT| Initial Kinetic Energy ', kin_energy
WRITE (iw, '(T2,A,T44,A)') &
'THERMOSTAT| Type of thermostat', 'Canonical Sampling/Velocity Rescaling'
tmp = cp_unit_from_cp2k(thermostat%csvr%tau_csvr, 'fs')*0.5_dp*simpar%dt
WRITE (iw, '(T2,A,T61,F20.6)') &
'THERMOSTAT| CSVR time constant [fs]', tmp
WRITE (iw, '(T2,A,T61,E20.12)') &
'THERMOSTAT| Initial kinetic energy', kin_energy
CASE (do_thermo_al)
WRITE (iw, '( A,T44,A )') ' THERMOSTAT| Type of thermostat', 'Adaptive Langevin'
tmp = cp_unit_from_cp2k(thermostat%al%tau_nh, "fs")
WRITE (iw, '( A,A4,A,T71,F10.2 )') &
' THERMOSTAT| AD_LANGEVIN NH time constant [', 'fs', '] ', tmp
tmp = cp_unit_from_cp2k(thermostat%al%tau_langevin, "fs")
WRITE (iw, '( A,A4,A,T71,F10.2 )') &
' THERMOSTAT| AD_LANGEVIN Langevin time constant [', 'fs', '] ', tmp
WRITE (iw, '(T2,A,T44,A)') &
'THERMOSTAT| Type of thermostat', 'Adaptive Langevin'
tmp = cp_unit_from_cp2k(thermostat%al%tau_nh, 'fs')
WRITE (iw, '(T2,A,T61,F20.6)') &
'THERMOSTAT| Time constant of Nose-Hoover part [fs]', tmp
tmp = cp_unit_from_cp2k(thermostat%al%tau_langevin, 'fs')
WRITE (iw, '(T2,A,T61,F20.6)') &
'THERMOSTAT| Time constant of Langevin part [fs]', tmp
END SELECT
WRITE (iw, '( A,/ )') ' THERMOSTAT| End of Thermostat Info for '//TRIM(label)
WRITE (iw, '(T2,A)') &
'THERMOSTAT| End of thermostat information for '//TRIM(label)
END IF
CALL cp_print_key_finished_output(iw, logger, section, "PRINT%THERMOSTAT_INFO")

Expand Down
28 changes: 13 additions & 15 deletions src/motion/thermostat/thermostat_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,19 @@ SUBROUTINE compute_degrees_of_freedom(thermostats, cell, simpar, molecule_kind_s
iw = cp_print_key_unit_nr(logger, print_section, "PROGRAM_RUN_INFO", &
extension=".log")
IF (iw > 0) THEN
WRITE (iw, '( /, A )') ' Calculation of degrees of freedom'
WRITE (iw, '( T48, A, T71, I10 )') ' Number of atoms:', natom
WRITE (iw, '( T33, A, T71, I10 )') &
' Number of Intramolecular constraints:', nconstraint_int
WRITE (iw, '( T33, A, T71, I10 )') &
' Number of Intermolecular constraints:', nconstraint_ext
WRITE (iw, '( T34, A, T71, I10 )') &
' Invariants(translation + rotations):', roto_trasl_dof
WRITE (iw, '( T48, A, T71, I10 )') ' Degrees of freedom:', simpar%nfree
WRITE (iw, '()')
WRITE (iw, '( /, A )') ' Restraints Information'
WRITE (iw, '( T33, A, T71, I10 )') &
' Number of Intramolecular restraints:', nrestraints_int
WRITE (iw, '( T33, A, T71, I10 )') &
' Number of Intermolecular restraints:', gci%nrestraint
WRITE (iw, '(/,T2,A)') &
'DOF| Calculation of degrees of freedom'
WRITE (iw, '(T2,A,T71,I10)') &
'DOF| Number of atoms', natom, &
'DOF| Number of intramolecular constraints', nconstraint_int, &
'DOF| Number of intermolecular constraints', nconstraint_ext, &
'DOF| Invariants (translations + rotations)', roto_trasl_dof, &
'DOF| Degrees of freedom', simpar%nfree
WRITE (iw, '(/,T2,A)') &
'DOF| Restraints information'
WRITE (iw, '(T2,A,T71,I10)') &
'DOF| Number of intramolecular restraints', nrestraints_int, &
'DOF| Number of intermolecular restraints', gci%nrestraint
END IF
CALL cp_print_key_finished_output(iw, logger, print_section, &
"PROGRAM_RUN_INFO")
Expand Down

0 comments on commit e8d3a7a

Please sign in to comment.