From d06d957fd78886ca1a156c06c278ff1b1c0919fa Mon Sep 17 00:00:00 2001 From: Jan Polena Date: Mon, 22 Jun 2026 16:45:40 +0200 Subject: [PATCH 1/5] Decoupling of temp0 and temp keywords --- src/init.F90 | 20 +++++++++++++------- tests/ABINITIO-FAIL/input.in | 1 + tests/ABINITIO/input.in | 1 + tests/ANALYZE_EXT/input.in | 3 ++- tests/CMD/input.in | 13 +++++++------ tests/DOUBLEWELL/input.in | 1 + tests/GLE-CANONICAL/input.in | 3 ++- tests/H2O_CVRQD/input.in | 3 ++- tests/H2O_SCHWENKE/input.in | 3 ++- tests/H2O_SCHWENKE_PIMD/input.in | 1 + tests/HARMON/input.in | 1 + tests/INIT/input.in | 1 + tests/INIT/input.in.nhc | 1 + tests/INIT/input.in.sh | 1 + tests/LANGEVIN/input.in | 3 ++- tests/MINI/input.in | 1 + tests/MM/input.in | 3 ++- tests/MORSE/input.in | 1 + tests/MTS/input.in | 1 + tests/MTS/input.in2 | 1 + tests/NHC-GLOBAL/input.in | 1 + tests/PIGLE/input.in | 3 ++- tests/PIGLE2/input.in | 3 ++- tests/QMMM/input.in | 3 ++- tests/QT/input.in | 1 + tests/QT2/input.in | 1 + tests/SHAKE/input.in | 3 ++- tests/SH_FRUSTRATED/input.in | 1 + tests/SH_FRUSTRATED_2/input.in | 1 + tests/WATER_FAIL/input.in | 5 +++-- tests/WATER_FAIL/input.in2 | 1 + tests/WITHOUT_FFTW/input.in | 1 + tests/WITHOUT_FFTW/input.in2 | 1 + tests/WITHOUT_PLUMED/input.in | 1 + 34 files changed, 64 insertions(+), 25 deletions(-) diff --git a/src/init.F90 b/src/init.F90 index 16c76c63..d26d741b 100644 --- a/src/init.F90 +++ b/src/init.F90 @@ -84,7 +84,7 @@ subroutine init(dt) ! L-J parameters real(DP), allocatable :: LJ_rmin(:), LJ_eps(:) ! Initial temperature (read from namelist nhcopt) - real(DP), save :: temp0 = -1 + real(DP), save :: temp0 = -1.0_DP ! User-defined masses in relative atomic units real(DP), allocatable :: masses(:) integer :: iw, iat, natom_xyz, iost @@ -435,9 +435,7 @@ subroutine init(dt) call plumed_init(natom, irest, dt0, nrest) end if - if (temp0 < 0) then - temp0 = temp - end if + ! Print initial and target temperature information write (stdout, *) 'Initial temperature [K] =', temp0 if (inose /= 0) write (stdout, *) 'Target temperature [K] =', temp @@ -463,7 +461,7 @@ subroutine init(dt) if (inose == 1) then call nhc_init() else if (inose == 2) then - call gle_init(dt * 0.5D0 / nabin / nstep_ref) !nabin is set to 1 unless ipimd=1 + call gle_init(dt * 0.5D0 / nabin / nstep_ref) ! nabin is set to 1 unless ipimd=1 else if (inose == 3) then call pile_init(dt * 0.5D0, tau0_langevin) else if (inose == 4) then @@ -484,9 +482,11 @@ subroutine init(dt) ! what about massive thermostat? end if - ! Set initial velocities according to the Maxwell-Boltzmann distribution + ! Set initial velocities according to the Maxwell--Boltzmann distribution if (irest == 0 .and. chveloc == '') then call vinit(temp0, am, vx, vy, vz) + write (*, '(a,1x,f8.2,1x,a)') "Initial velocities generated from Maxwell--Boltzmann distribution based at temperature", & + temp0, "K" end if ! Read velocities from file (optional) @@ -599,6 +599,12 @@ subroutine check_inputsanity() write (stderr, *) 'Velocities will be taken from restart file because irest=1.' end if + if (irest == 0 .and. chveloc == '' .and. temp0 < 0) then + write (*, '(a)') 'ERROR: Initial temperature (temp0) was not set and no file with initial velocities were provided.' + write (*, '(a,/)') 'FIX: Set parameter temp0 >= 0 or provide initial velocities.' + error = 1 + end if + if (pot /= '_cp2k_') then if (nproc > nwalk) then write (*, *) 'ERROR: Nproc greater than nwalk. That does not make sense.' @@ -620,7 +626,7 @@ subroutine check_inputsanity() error = 1 end if if (ipimd == 1 .and. nwalk <= 1) then - write (*, *) 'Number of walkers for PIMD (nwalk) mus be >= 1!' + write (*, *) 'Number of walkers for PIMD (nwalk) must be >= 1!' write (*, *) 'Either set ipimd=0 for classical simulation' write (*, *) 'or set nwalk > 1' error = 1 diff --git a/tests/ABINITIO-FAIL/input.in b/tests/ABINITIO-FAIL/input.in index da7cfde2..f3c87487 100644 --- a/tests/ABINITIO-FAIL/input.in +++ b/tests/ABINITIO-FAIL/input.in @@ -22,4 +22,5 @@ irest=0, &nhcopt inose=0, temp=0.0, +temp0=0.0 / diff --git a/tests/ABINITIO/input.in b/tests/ABINITIO/input.in index dfb2059e..9cc2222b 100644 --- a/tests/ABINITIO/input.in +++ b/tests/ABINITIO/input.in @@ -31,6 +31,7 @@ kb_sbc=0.1d0, inose=1, nchain=4, temp=298.15, +temp0=298.15, rem_comrot=.false. tau0=0.001D0 / diff --git a/tests/ANALYZE_EXT/input.in b/tests/ANALYZE_EXT/input.in index b336711c..f1bbf212 100644 --- a/tests/ANALYZE_EXT/input.in +++ b/tests/ANALYZE_EXT/input.in @@ -13,7 +13,8 @@ nrest=10, / &nhcopt -temp=200. inose=1 +temp=200.0, +temp0=200.0, tau0=0.001D0 / diff --git a/tests/CMD/input.in b/tests/CMD/input.in index 522b3fa9..862e699d 100644 --- a/tests/CMD/input.in +++ b/tests/CMD/input.in @@ -5,8 +5,9 @@ # TESTING nyosh = 1 # TESTING iknow &nhcopt -inose=1, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3 -temp=298.15, ! initial temperature for Maxwell-Boltzmann sampling [au] +inose=1, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3 +temp=298.15, ! Target temperature of thermostat [K] +temp0=298.15, ! Initial temperature for Maxwell--Boltzmann sampling [K] tau0=0.0015 nrespnose=3 nyosh=1 ! Turn off Suzuki-Yoshida integration scheme (NOT RECOMMENDED!) @@ -21,11 +22,11 @@ irest=0, idebug=1 iknow=1 -pot='_mmwater_' -mdtype='MD', ! classical MD +pot='_mmwater_' +mdtype='MD', ! classical MD -dt=20., ! number of steps and timestep -irandom=131313, ! random seed +dt=20., ! number of steps and timestep +irandom=131313, ! random seed nwrite=1, nwritex=1, diff --git a/tests/DOUBLEWELL/input.in b/tests/DOUBLEWELL/input.in index d320200a..7aa4f99b 100644 --- a/tests/DOUBLEWELL/input.in +++ b/tests/DOUBLEWELL/input.in @@ -18,6 +18,7 @@ idebug=1, &thermostat therm='none', temp=298.15, +temp0=298.15 / &system diff --git a/tests/GLE-CANONICAL/input.in b/tests/GLE-CANONICAL/input.in index d8d597c5..85550029 100644 --- a/tests/GLE-CANONICAL/input.in +++ b/tests/GLE-CANONICAL/input.in @@ -19,6 +19,7 @@ nwritef=1, &nhcopt inose=4, rem_comrot=.false. -temp=300., +temp=300.0, +temp0=300.0, gle_test=.true. / diff --git a/tests/H2O_CVRQD/input.in b/tests/H2O_CVRQD/input.in index aacf36fb..4e6cf073 100644 --- a/tests/H2O_CVRQD/input.in +++ b/tests/H2O_CVRQD/input.in @@ -14,6 +14,7 @@ nstep=2 &nhcopt inose=0, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3 -temp=100 +temp=100.0, +temp0=100.0, rem_comrot=.true. ! this is a default value, remove rotations at the beginning / diff --git a/tests/H2O_SCHWENKE/input.in b/tests/H2O_SCHWENKE/input.in index 091acd47..5aae1c1b 100644 --- a/tests/H2O_SCHWENKE/input.in +++ b/tests/H2O_SCHWENKE/input.in @@ -15,6 +15,7 @@ nwritef=1, ! write forces &nhcopt inose=0, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3 -temp=0 +temp=0.0, +temp0=0.0, rem_comrot=.true. ! this is a default value, remove rotations at the beginning / diff --git a/tests/H2O_SCHWENKE_PIMD/input.in b/tests/H2O_SCHWENKE_PIMD/input.in index d09def74..358b45f1 100644 --- a/tests/H2O_SCHWENKE_PIMD/input.in +++ b/tests/H2O_SCHWENKE_PIMD/input.in @@ -22,6 +22,7 @@ nwritef=1, ! write forces &nhcopt inose=1, temp=298.15, +temp0=298.15, tau0=0.0015 nrespnose=3 nyosh=7 diff --git a/tests/HARMON/input.in b/tests/HARMON/input.in index 9dfb3578..12d6801f 100644 --- a/tests/HARMON/input.in +++ b/tests/HARMON/input.in @@ -32,6 +32,7 @@ dist2=1 &nhcopt inose=1, temp=50.15, +temp0=50.15, tau0=0.0015 nrespnose=3 nyosh=7 diff --git a/tests/INIT/input.in b/tests/INIT/input.in index eebbb916..b1d68a8f 100644 --- a/tests/INIT/input.in +++ b/tests/INIT/input.in @@ -18,5 +18,6 @@ idebug=1, &nhcopt inose=0, temp=298.15, +temp0=298.15, tau0=0.001D0 / diff --git a/tests/INIT/input.in.nhc b/tests/INIT/input.in.nhc index d4968c4b..4ff732ea 100644 --- a/tests/INIT/input.in.nhc +++ b/tests/INIT/input.in.nhc @@ -8,6 +8,7 @@ dt=20., &nhcopt temp=0.1 +temp0=0.0, inose=1, nchain=150 nrespnose=1 diff --git a/tests/INIT/input.in.sh b/tests/INIT/input.in.sh index b6f13bf8..bb8cd193 100644 --- a/tests/INIT/input.in.sh +++ b/tests/INIT/input.in.sh @@ -8,6 +8,7 @@ dt=20., &nhcopt inose=0, +temp0=0.0 / ! Invalid SH parameters diff --git a/tests/LANGEVIN/input.in b/tests/LANGEVIN/input.in index fbff49b2..b1698387 100644 --- a/tests/LANGEVIN/input.in +++ b/tests/LANGEVIN/input.in @@ -16,6 +16,7 @@ nwritef=1, &thermostat therm='langevine', -temp=300.0 +temp=300.0, +temp0=300.0, tau0_langevin=0.001 / diff --git a/tests/MINI/input.in b/tests/MINI/input.in index f722b4ca..e87dabba 100644 --- a/tests/MINI/input.in +++ b/tests/MINI/input.in @@ -19,4 +19,5 @@ gammthr=1.3 &nhcopt inose=0, +temp0=0.0 / diff --git a/tests/MM/input.in b/tests/MM/input.in index e4c9a2c4..33e7ad87 100644 --- a/tests/MM/input.in +++ b/tests/MM/input.in @@ -13,7 +13,8 @@ nwritef=1 &nhcopt inose=0, -temp=100, +temp=100.0, +temp0=100.0, / &qmmm diff --git a/tests/MORSE/input.in b/tests/MORSE/input.in index e834c803..ef980c02 100644 --- a/tests/MORSE/input.in +++ b/tests/MORSE/input.in @@ -30,5 +30,6 @@ d0_morse=0.363965D0 &nhcopt inose=1, temp=300.0, +temp0=300.0, tau0=0.001 / diff --git a/tests/MTS/input.in b/tests/MTS/input.in index 64ef136f..497aa29b 100644 --- a/tests/MTS/input.in +++ b/tests/MTS/input.in @@ -20,6 +20,7 @@ idebug=1, &nhcopt inose=1, temp=298.15, +temp0=298.15, tau0=0.001D0 / diff --git a/tests/MTS/input.in2 b/tests/MTS/input.in2 index 6f6c7f0c..eba8f42f 100644 --- a/tests/MTS/input.in2 +++ b/tests/MTS/input.in2 @@ -20,6 +20,7 @@ idebug=1, &nhcopt inose=1, temp=298.15, +temp0=298.15, tau0=0.001D0 / diff --git a/tests/NHC-GLOBAL/input.in b/tests/NHC-GLOBAL/input.in index 0ab0eb38..3cfb8eb5 100644 --- a/tests/NHC-GLOBAL/input.in +++ b/tests/NHC-GLOBAL/input.in @@ -20,5 +20,6 @@ therm='nhc', imasst=0, nyosh=3, temp=298.15, +temp0=298.15, tau0=0.001D0 / diff --git a/tests/PIGLE/input.in b/tests/PIGLE/input.in index f85e1b61..9badbe68 100644 --- a/tests/PIGLE/input.in +++ b/tests/PIGLE/input.in @@ -19,7 +19,8 @@ nrest=1, &thermostat therm='gle', -temp=200, +temp=200.0, +temp0=200.0, rem_comrot=.false. gle_test=.true. / diff --git a/tests/PIGLE2/input.in b/tests/PIGLE2/input.in index bcd17eae..e11a6946 100644 --- a/tests/PIGLE2/input.in +++ b/tests/PIGLE2/input.in @@ -19,7 +19,8 @@ nrest=1, &nhcopt inose=2, -temp=200, +temp=200.0, +temp0=200.0, rem_comrot=.false. ! Unlike in the PIGLE test, we're running a normal PIGLE here, diff --git a/tests/QMMM/input.in b/tests/QMMM/input.in index 7bfd4618..dd8bba3f 100644 --- a/tests/QMMM/input.in +++ b/tests/QMMM/input.in @@ -18,7 +18,8 @@ irest=0, ! should we restart from restart.xyz? (ignoring mini.dat), NOT working &nhcopt inose=1, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3 nchain=4, ! number of nose-hoover chains -temp=298.15, ! initial temperature for Maxwell-Boltzmann sampling [au] +temp=298.15, ! Target temperature for thermostat [K] +temp0=298.15, ! Initial temperature for Maxwell--Boltzmann sampling [K] rem_comrot=.false. tau0=0.001D0 / diff --git a/tests/QT/input.in b/tests/QT/input.in index 95880e13..c34cd4f6 100644 --- a/tests/QT/input.in +++ b/tests/QT/input.in @@ -20,5 +20,6 @@ nwritef=1, inose=2, rem_comrot=.false. temp=100.15, +temp0=100.15, gle_test=.true. / diff --git a/tests/QT2/input.in b/tests/QT2/input.in index b7f361fd..361b1b1a 100644 --- a/tests/QT2/input.in +++ b/tests/QT2/input.in @@ -20,6 +20,7 @@ nwritef=1, inose=2, rem_comrot=.false. temp=100.15, +temp0=100.15, ! Unlike in the PIGLE test, we're running a normal PIGLE here, ! where propagator matrices S and T are computed from A and C ! matrices read from GLE-A and GLE-C files. diff --git a/tests/SHAKE/input.in b/tests/SHAKE/input.in index 7748e073..533ea264 100644 --- a/tests/SHAKE/input.in +++ b/tests/SHAKE/input.in @@ -44,7 +44,8 @@ nshakemol=2,2,0,2,2,3*0, ! number of constraints in molecules imasst=0 ! Use global thermostat (massive thermostat not possible with shake) inose=1, ! Thermostating: Nose-Hoover 1, microcanonical 0 nchain=4, ! number of nose-hoover chains -temp=298.15, ! initial temperature for Maxwell-Boltzmann sampling [au] +temp=298.15, ! Target temperature of thermostat [K] +temp0=298.15, ! Initial temperature for Maxwell--Boltzmann sampling [K] nyosh=7, nrespnose=3 tau0=0.001D0 diff --git a/tests/SH_FRUSTRATED/input.in b/tests/SH_FRUSTRATED/input.in index 88737b6d..3d233c1c 100644 --- a/tests/SH_FRUSTRATED/input.in +++ b/tests/SH_FRUSTRATED/input.in @@ -17,6 +17,7 @@ xyz_units='bohr' &nhcopt temp=0.0D0, +temp0=0.0, inose=0, / diff --git a/tests/SH_FRUSTRATED_2/input.in b/tests/SH_FRUSTRATED_2/input.in index 42a94530..e5e14851 100644 --- a/tests/SH_FRUSTRATED_2/input.in +++ b/tests/SH_FRUSTRATED_2/input.in @@ -17,6 +17,7 @@ xyz_units='bohr' &nhcopt temp=0.0D0, +temp0=0.0, inose=0, / diff --git a/tests/WATER_FAIL/input.in b/tests/WATER_FAIL/input.in index de71b987..110207b9 100644 --- a/tests/WATER_FAIL/input.in +++ b/tests/WATER_FAIL/input.in @@ -9,6 +9,7 @@ dt=20. / &nhcopt -inose=0 -temp=100 +inose=0, +temp=100.0, +temp0=100.0 / diff --git a/tests/WATER_FAIL/input.in2 b/tests/WATER_FAIL/input.in2 index 9fec87cb..b5fa6dcd 100644 --- a/tests/WATER_FAIL/input.in2 +++ b/tests/WATER_FAIL/input.in2 @@ -11,4 +11,5 @@ dt=20., &nhcopt inose=0, temp=0.0, +temp0=0.0 / diff --git a/tests/WITHOUT_FFTW/input.in b/tests/WITHOUT_FFTW/input.in index 1fe93d70..ccdd8c2b 100644 --- a/tests/WITHOUT_FFTW/input.in +++ b/tests/WITHOUT_FFTW/input.in @@ -15,5 +15,6 @@ nrest=10, &nhcopt inose=3, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, Langevin 3 temp=298.15, +temp0=298.15, tau0_langevin=0.001 / diff --git a/tests/WITHOUT_FFTW/input.in2 b/tests/WITHOUT_FFTW/input.in2 index a4fde583..7a140052 100644 --- a/tests/WITHOUT_FFTW/input.in2 +++ b/tests/WITHOUT_FFTW/input.in2 @@ -18,4 +18,5 @@ nrest=10, &nhcopt inose=3, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, Langevin 3 temp=298.15, +temp0=298.15 / diff --git a/tests/WITHOUT_PLUMED/input.in b/tests/WITHOUT_PLUMED/input.in index 0c43b6a4..70b7c95a 100644 --- a/tests/WITHOUT_PLUMED/input.in +++ b/tests/WITHOUT_PLUMED/input.in @@ -20,4 +20,5 @@ k=0.05, ! Ha*bohr-2 &nhcopt inose=0, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3 +temp0=0.0 / From 299fee8e3160cbef35235c4beca56c76614ebd19 Mon Sep 17 00:00:00 2001 From: Jan Polena Date: Tue, 23 Jun 2026 01:48:40 +0200 Subject: [PATCH 2/5] Decoupling of temp0 and temp keywords --- tests/PIGLET/input.in | 3 ++- tests/PIGLET/input.in2 | 3 ++- tests/PIGLET2/input.in | 3 ++- tests/PIGLET2/input.in2 | 3 ++- tests/PILE/input.in | 1 + tests/PILE/input.in2 | 1 + tests/PLUMED/input.in | 1 + tests/PLUMED/input.in2 | 1 + tests/TERAPI-FAILS/input.in.valid | 3 ++- tests/TERAPI-FAILS/input.in1 | 3 ++- tests/TERAPI-FAILS/input.in2 | 3 ++- tests/TERAPI-FAILS/input.in3 | 3 ++- tests/TERAPI-FAILS/input.in4 | 3 ++- tests/TERAPI-FAILS/input.in7 | 3 ++- tests/TERAPI-FAILS/input.in8 | 3 ++- tests/TERAPI-PIMD-PARALLEL/input.in | 1 + tests/TERAPI-PIMD/input.in | 1 + tests/TERAPI-SH-S0/input.in | 3 ++- tests/TERAPI-SH-S0/input.in2 | 3 ++- tests/TERAPI/input.in | 3 ++- 20 files changed, 34 insertions(+), 14 deletions(-) diff --git a/tests/PIGLET/input.in b/tests/PIGLET/input.in index 3a727abf..3a534379 100644 --- a/tests/PIGLET/input.in +++ b/tests/PIGLET/input.in @@ -20,6 +20,7 @@ nrest=1, &nhcopt inose=2, -temp=300, +temp=300.0, +temp0=300.0, gle_test=.true. / diff --git a/tests/PIGLET/input.in2 b/tests/PIGLET/input.in2 index b8c11cc7..4dc90a98 100644 --- a/tests/PIGLET/input.in2 +++ b/tests/PIGLET/input.in2 @@ -20,6 +20,7 @@ nrest=1, &nhcopt inose=2, -temp=300, +temp=300.0, +temp0=300.0, gle_test=.true. / diff --git a/tests/PIGLET2/input.in b/tests/PIGLET2/input.in index 1780dd23..a6d87b17 100644 --- a/tests/PIGLET2/input.in +++ b/tests/PIGLET2/input.in @@ -20,6 +20,7 @@ nrest=1, &nhcopt inose=2, -temp=300, +temp=300.0, +temp0=300.0, gle_test=.false. / diff --git a/tests/PIGLET2/input.in2 b/tests/PIGLET2/input.in2 index ee7fe389..fc73135f 100644 --- a/tests/PIGLET2/input.in2 +++ b/tests/PIGLET2/input.in2 @@ -20,6 +20,7 @@ nrest=1, &nhcopt inose=2, -temp=300, +temp=300.0, +temp0=300.0, gle_test=.false. / diff --git a/tests/PILE/input.in b/tests/PILE/input.in index caf7a201..6bfa66fc 100644 --- a/tests/PILE/input.in +++ b/tests/PILE/input.in @@ -18,6 +18,7 @@ idebug=2 &nhcopt inose=3, ! Thermostating: Nose-Hoover 1, microcanonical 0,GLE 2, LE 3 temp=298.15, +temp0=298.15, tau0_langevin=0.001, ! Relaxation time of the Langevin thermostat in picoseconds rem_comrot=.false. / diff --git a/tests/PILE/input.in2 b/tests/PILE/input.in2 index 32f5a88f..54a1a6bc 100644 --- a/tests/PILE/input.in2 +++ b/tests/PILE/input.in2 @@ -19,5 +19,6 @@ nrest=1, &nhcopt inose=3, ! Thermostating: Nose-Hoover 1, microcanonical 0, GLE 2, LE 3 temp=298.15, +temp0=298.15, tau0_langevin=0.001, ! Relaxation time of the Langevin thermostat in picoseconds / diff --git a/tests/PLUMED/input.in b/tests/PLUMED/input.in index bffb08bb..946e0a5d 100644 --- a/tests/PLUMED/input.in +++ b/tests/PLUMED/input.in @@ -30,5 +30,6 @@ dist2=2, &nhcopt inose=1, temp=300.0, +temp0=300.0, tau0=0.001D0 / diff --git a/tests/PLUMED/input.in2 b/tests/PLUMED/input.in2 index 337c0ddb..2836d795 100644 --- a/tests/PLUMED/input.in2 +++ b/tests/PLUMED/input.in2 @@ -30,5 +30,6 @@ dist2=2, &nhcopt inose=1, temp=300.0, +temp0=300.0, tau0=0.001D0 / diff --git a/tests/TERAPI-FAILS/input.in.valid b/tests/TERAPI-FAILS/input.in.valid index ccdc953d..826aa7bd 100644 --- a/tests/TERAPI-FAILS/input.in.valid +++ b/tests/TERAPI-FAILS/input.in.valid @@ -18,5 +18,6 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0d0, +temp0=0.0 / diff --git a/tests/TERAPI-FAILS/input.in1 b/tests/TERAPI-FAILS/input.in1 index ccdc953d..826aa7bd 100644 --- a/tests/TERAPI-FAILS/input.in1 +++ b/tests/TERAPI-FAILS/input.in1 @@ -18,5 +18,6 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0d0, +temp0=0.0 / diff --git a/tests/TERAPI-FAILS/input.in2 b/tests/TERAPI-FAILS/input.in2 index 752b091a..670cd61b 100644 --- a/tests/TERAPI-FAILS/input.in2 +++ b/tests/TERAPI-FAILS/input.in2 @@ -14,5 +14,6 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0d0, +temp0=0.0 / diff --git a/tests/TERAPI-FAILS/input.in3 b/tests/TERAPI-FAILS/input.in3 index df2eb99e..5b64caf0 100644 --- a/tests/TERAPI-FAILS/input.in3 +++ b/tests/TERAPI-FAILS/input.in3 @@ -16,5 +16,6 @@ idebug=3 &nhcopt inose=1, -temp=300 +temp=300.0, +temp0=0.0 / diff --git a/tests/TERAPI-FAILS/input.in4 b/tests/TERAPI-FAILS/input.in4 index ccdc953d..826aa7bd 100644 --- a/tests/TERAPI-FAILS/input.in4 +++ b/tests/TERAPI-FAILS/input.in4 @@ -18,5 +18,6 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0d0, +temp0=0.0 / diff --git a/tests/TERAPI-FAILS/input.in7 b/tests/TERAPI-FAILS/input.in7 index ccdc953d..560df48c 100644 --- a/tests/TERAPI-FAILS/input.in7 +++ b/tests/TERAPI-FAILS/input.in7 @@ -18,5 +18,6 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0, +temp0=0.0 / diff --git a/tests/TERAPI-FAILS/input.in8 b/tests/TERAPI-FAILS/input.in8 index ccdc953d..560df48c 100644 --- a/tests/TERAPI-FAILS/input.in8 +++ b/tests/TERAPI-FAILS/input.in8 @@ -18,5 +18,6 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0, +temp0=0.0 / diff --git a/tests/TERAPI-PIMD-PARALLEL/input.in b/tests/TERAPI-PIMD-PARALLEL/input.in index 3eaf72bc..bf2bb533 100644 --- a/tests/TERAPI-PIMD-PARALLEL/input.in +++ b/tests/TERAPI-PIMD-PARALLEL/input.in @@ -23,4 +23,5 @@ iknow=1 ! We're running PIMD without thermostat ! &nhcopt inose=0, temp=0.0, +temp0=0.0 / diff --git a/tests/TERAPI-PIMD/input.in b/tests/TERAPI-PIMD/input.in index b8b78f71..a8049155 100644 --- a/tests/TERAPI-PIMD/input.in +++ b/tests/TERAPI-PIMD/input.in @@ -30,4 +30,5 @@ iknow=1 ! We're running PIMD without thermostat ! &nhcopt inose=0, temp=0.0, +temp0=0.0 / diff --git a/tests/TERAPI-SH-S0/input.in b/tests/TERAPI-SH-S0/input.in index cdbabfe8..9b261013 100644 --- a/tests/TERAPI-SH-S0/input.in +++ b/tests/TERAPI-SH-S0/input.in @@ -27,7 +27,8 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0d0, +temp0=0.0 / &sh diff --git a/tests/TERAPI-SH-S0/input.in2 b/tests/TERAPI-SH-S0/input.in2 index 9543f8c4..55a0fc7a 100644 --- a/tests/TERAPI-SH-S0/input.in2 +++ b/tests/TERAPI-SH-S0/input.in2 @@ -28,7 +28,8 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0d0, +temp0=0.0 / &sh diff --git a/tests/TERAPI/input.in b/tests/TERAPI/input.in index afa78130..c760c511 100644 --- a/tests/TERAPI/input.in +++ b/tests/TERAPI/input.in @@ -24,5 +24,6 @@ idebug=3 &nhcopt inose=0, -temp=0.0d0 +temp=0.0d0, +temp0=0.0 / From d8e1034bbde36c729462bcd730e8b688a60ddd17 Mon Sep 17 00:00:00 2001 From: Jan Polena Date: Tue, 23 Jun 2026 09:14:15 +0200 Subject: [PATCH 3/5] Decoupling of temp0 and temp keywords --- src/init.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.F90 b/src/init.F90 index d26d741b..7b6f8737 100644 --- a/src/init.F90 +++ b/src/init.F90 @@ -486,7 +486,7 @@ subroutine init(dt) if (irest == 0 .and. chveloc == '') then call vinit(temp0, am, vx, vy, vz) write (*, '(a,1x,f8.2,1x,a)') "Initial velocities generated from Maxwell--Boltzmann distribution based at temperature", & - temp0, "K" + temp0, "K" end if ! Read velocities from file (optional) From bdbb44997a38f12050e5c8d4fc120b852de2c1bc Mon Sep 17 00:00:00 2001 From: Jan Polena Date: Tue, 23 Jun 2026 11:42:13 +0200 Subject: [PATCH 4/5] Decoupling of temp0 and temp keywords --- tests/INIT/input.in.nhc | 2 +- tests/INIT/test.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/INIT/input.in.nhc b/tests/INIT/input.in.nhc index 4ff732ea..7e2808e5 100644 --- a/tests/INIT/input.in.nhc +++ b/tests/INIT/input.in.nhc @@ -8,7 +8,7 @@ dt=20., &nhcopt temp=0.1 -temp0=0.0, +temp0=0.1, inose=1, nchain=150 nrespnose=1 diff --git a/tests/INIT/test.sh b/tests/INIT/test.sh index 22169c1b..37f3660e 100755 --- a/tests/INIT/test.sh +++ b/tests/INIT/test.sh @@ -28,3 +28,11 @@ mv ERROR ABIN_ERROR3 $ABINEXE -x mini.xyz -i input.in.nhc > abin.out 2>&1 || true mv ERROR ABIN_ERROR4 + +# Testing that ABIN does not run +# if temp0 is not set and initial velocities file is not +# present and irest=0 + +$ABINEXE -x mini.xyz -i input.in.vels > abin.out 2>&1 || true +mv ERROR ABIN_ERROR5 + From 11edbce0730ef04ed7faf49b8ee52d0b4173f609 Mon Sep 17 00:00:00 2001 From: Jan Polena Date: Tue, 23 Jun 2026 11:46:14 +0200 Subject: [PATCH 5/5] Decoupling of temp0 and temp keywords --- tests/INIT/ABIN_ERROR5.ref | 1 + tests/INIT/input.in.vels | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/INIT/ABIN_ERROR5.ref create mode 100644 tests/INIT/input.in.vels diff --git a/tests/INIT/ABIN_ERROR5.ref b/tests/INIT/ABIN_ERROR5.ref new file mode 100644 index 00000000..3bb1882b --- /dev/null +++ b/tests/INIT/ABIN_ERROR5.ref @@ -0,0 +1 @@ +ERROR in init.F90: Invalid input parameters diff --git a/tests/INIT/input.in.vels b/tests/INIT/input.in.vels new file mode 100644 index 00000000..eebbb916 --- /dev/null +++ b/tests/INIT/input.in.vels @@ -0,0 +1,22 @@ +&general +irest=0, +nstep=1, +pot='_mmwater_' +mdtype='MD', + +dt=20., +irandom=53478953, + +nwrite=1, +nwritex=1, +nrest=1, +nwritev=1, +nwritef=1, +idebug=1, +/ + +&nhcopt +inose=0, +temp=298.15, +tau0=0.001D0 +/