diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aa0b16fdc2..b4a38f2d1d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -118,6 +118,9 @@ Fixed - Enable CI test cases and fix a parser bug +- Fix backward compatibility bug from release 22.2 which led to + dftb_pin.hsd files containing obsolete keywords + 24.1 (2024-02-12) ================= diff --git a/src/dftbp/io/hsdutils2.F90 b/src/dftbp/io/hsdutils2.F90 index 382e904e07..98effbfd52 100644 --- a/src/dftbp/io/hsdutils2.F90 +++ b/src/dftbp/io/hsdutils2.F90 @@ -210,10 +210,10 @@ subroutine setNodeName(node, name, updateHsdName) character(len=*), intent(in) :: name !> Whether the original HSD-name should be also updated (default: .false.) - !> - !> If set to .true., the attribute storing the original capitalized HSD-name will also be - !> updated if present. Otherwise, it is kept at its original value. - !> + !! + !! If present and set to .false., the attribute storing the original HSD-name will not be + !! updated. Default behaviour (i.e. if absent) is .true. + !! logical, optional, intent(in) :: updateHsdName type(string) :: buffer @@ -221,7 +221,7 @@ subroutine setNodeName(node, name, updateHsdName) @:ASSERT(associated(node)) - updateHsdName_ = .false. + updateHsdName_ = .true. if (present(updateHsdName)) updateHsdName_ = updateHsdName call setTagName(node, tolower(name)) diff --git a/test/app/dftb+/legacy/parser/v4/C18H12.gen b/test/app/dftb+/legacy/parser/v4/C18H12.gen new file mode 100644 index 0000000000..c93723d3e4 --- /dev/null +++ b/test/app/dftb+/legacy/parser/v4/C18H12.gen @@ -0,0 +1,32 @@ +30 C +C H + 1 1 -0.4960894119E+01 -0.6361793804E+01 -0.1468686907E+00 + 2 1 -0.4647039074E+01 -0.4993568105E+01 0.1372421501E+00 + 3 1 -0.5722028171E+01 -0.4120968534E+01 0.4226826256E+00 + 4 1 -0.5501118315E+01 -0.2767269230E+01 0.7031992906E+00 + 5 1 -0.4155430196E+01 -0.2249784697E+01 0.7018997732E+00 + 6 1 -0.3084921974E+01 -0.3106897648E+01 0.4201412979E+00 + 7 1 -0.3298780018E+01 -0.4475087084E+01 0.1358980437E+00 + 8 1 -0.2223792399E+01 -0.5347684758E+01 -0.1495623364E+00 + 9 1 -0.2444692377E+01 -0.6701428083E+01 -0.4298739144E+00 +10 1 -0.3790368322E+01 -0.7218938062E+01 -0.4284818920E+00 +11 1 -0.3994987538E+01 -0.8606307934E+01 -0.7177101233E+00 +12 1 -0.2931247196E+01 -0.9429666486E+01 -0.9915161986E+00 +13 1 -0.1602125651E+01 -0.8918534654E+01 -0.9928062919E+00 +14 1 -0.1363688757E+01 -0.7594408244E+01 -0.7203324585E+00 +15 1 -0.6582077142E+01 -0.1874307988E+01 0.9938718547E+00 +16 1 -0.6343611391E+01 -0.5501970380E+00 0.1266409737E+01 +17 1 -0.5014494889E+01 -0.3906714851E-01 0.1265013843E+01 +18 1 -0.3950763485E+01 -0.8624491386E+00 0.9912470797E+00 +19 2 -0.5887346655E+01 -0.6757009196E+01 -0.1458600108E+00 +20 2 -0.6748801177E+01 -0.4515351683E+01 0.4237024452E+00 +21 2 -0.2058449519E+01 -0.2711734346E+01 0.4192030727E+00 +22 2 -0.1197037050E+01 -0.4953257476E+01 -0.1507123994E+00 +23 2 -0.5020330183E+01 -0.9002593484E+01 -0.7170706128E+00 +24 2 -0.3096933322E+01 -0.1049276507E+02 -0.1212528844E+01 +25 2 -0.7671938410E+00 -0.9596870251E+01 -0.1214711168E+01 +26 2 -0.3370339568E+00 -0.7201533426E+01 -0.7217040485E+00 +27 2 -0.7608717141E+01 -0.2267196965E+01 0.9954153720E+00 +28 2 -0.7178510634E+01 0.1281258261E+00 0.1488464300E+01 +29 2 -0.4848783686E+01 0.1024035770E+01 0.1485963909E+01 +30 2 -0.2925411817E+01 -0.4661810654E+00 0.9906441954E+00 diff --git a/test/app/dftb+/legacy/parser/v4/_autotest.tag b/test/app/dftb+/legacy/parser/v4/_autotest.tag new file mode 100644 index 0000000000..6aefc186e8 --- /dev/null +++ b/test/app/dftb+/legacy/parser/v4/_autotest.tag @@ -0,0 +1,109 @@ +orbital_charges :real:2:4,30 + 0.119284395899165E+001 0.947980246057765E+000 0.103273808603203E+001 + 0.958721849543066E+000 0.114680335586219E+001 0.919226372622287E+000 + 0.967806825769234E+000 0.918686970854662E+000 0.118478187320680E+001 + 0.944642142695631E+000 0.102129549194831E+001 0.954515609570172E+000 + 0.114379500612117E+001 0.920518718858732E+000 0.972359122247518E+000 + 0.921015927006392E+000 0.114358724549461E+001 0.917950964350984E+000 + 0.971650574683202E+000 0.923102025097868E+000 0.118339725440411E+001 + 0.942979020827329E+000 0.102545402187042E+001 0.953747882310453E+000 + 0.114188641189360E+001 0.919902924945084E+000 0.975563724376088E+000 + 0.919066174279005E+000 0.118406424705280E+001 0.945220080073105E+000 + 0.101732250611631E+001 0.952401150749657E+000 0.114195723724198E+001 + 0.919188661598911E+000 0.972455537665904E+000 0.919024372540141E+000 + 0.116251609800047E+001 0.920194515024398E+000 0.971333186889569E+000 + 0.913388251093793E+000 0.117736975603738E+001 0.941415356457914E+000 + 0.100169349343285E+001 0.951414777093991E+000 0.117185334158280E+001 + 0.953974665871199E+000 0.998710416717525E+000 0.932402312443412E+000 + 0.117179192890673E+001 0.945583519186769E+000 0.997477019374345E+000 + 0.940864967832269E+000 0.117741219539542E+001 0.942467918633928E+000 + 0.100612116021793E+001 0.949154072172060E+000 0.117767544753985E+001 + 0.942635105327461E+000 0.100364538888261E+001 0.949885913196349E+000 + 0.117185211380776E+001 0.945867313615500E+000 0.998153330942004E+000 + 0.940719106235939E+000 0.117185645417071E+001 0.954052137459419E+000 + 0.997541103568038E+000 0.932513801072004E+000 0.117762986860449E+001 + 0.940495160520579E+000 0.100453814361402E+001 0.951887865244294E+000 + 0.916359565896960E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.942454199826147E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.941946524184169E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.942485022941941E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.944040718277660E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.944319088819037E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.944190158630189E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.943436252824506E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.943451805010933E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.944063956477534E+000 0.000000000000000E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.944057600857015E+000 0.000000000000000E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.943454325128948E+000 + 0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000 +forces :real:2:3,30 + 0.774462927950518E-001 0.140583745709508E-001 0.198541900899663E-002 + -0.685793681188461E-001 -0.526199752898386E-002 0.264783307341179E-002 + 0.526469911086089E-001 0.487952832143691E-001 0.637429415806625E-002 + -0.158570211485391E-001 -0.503006436654617E-001 -0.964071764779688E-002 + 0.451421984478356E-001 -0.272985786355670E-001 -0.993394481229354E-002 + -0.671028207401693E-001 -0.365056038629281E-002 0.505353297537416E-002 + 0.354036837292032E-001 0.432462601048474E-002 -0.203784812205133E-002 + -0.530772914162591E-001 -0.348958501198684E-001 -0.319403200184813E-002 + 0.519968459654354E-002 0.470242209472672E-001 0.998850580857725E-002 + -0.279508269608566E-001 -0.151276252947029E-001 -0.289837266740378E-002 + 0.954008131309508E-001 -0.416049956631750E-001 -0.173859900742723E-001 + -0.547236886981776E-001 0.798300515769129E-001 0.224711651240239E-001 + -0.128056481918595E-001 0.974867183387526E-001 0.226715124484280E-001 + -0.404035488327371E-001 -0.978615593447773E-001 -0.181002749507994E-001 + 0.387204924989371E-001 0.100062979579069E+000 0.188359447023555E-001 + 0.102493918643575E-001 -0.999202608661727E-001 -0.230156588935159E-001 + 0.592414839532330E-001 -0.810876481166097E-001 -0.230310268303136E-001 + -0.955873467470311E-001 0.481344445548394E-001 0.188641300044405E-001 + 0.144251732312263E+000 0.666905114747517E-001 0.424208098605892E-003 + 0.128386244559385E+000 0.492882632606328E-001 -0.177767144638954E-003 + -0.128050487872755E+000 -0.495509187135924E-001 0.549058486509388E-004 + -0.127978691735118E+000 -0.491075405485886E-001 0.145673708143674E-003 + 0.128164931248143E+000 0.496969662668866E-001 -0.804827846136677E-004 + 0.209922034543243E-001 0.133142471735587E+000 0.276600079387249E-001 + -0.104730594325206E+000 0.848673224219272E-001 0.277716202952569E-001 + -0.128591294862416E+000 -0.486635883340222E-001 0.284479373223725E-003 + 0.128431861956924E+000 0.487985032863030E-001 -0.271735380481122E-003 + 0.104740631399124E+000 -0.848456173320762E-001 -0.278021148379301E-001 + -0.209498891034972E-001 -0.133197252380466E+000 -0.276618755844922E-001 + -0.128030118301418E+000 -0.498261003083764E-001 -0.139083382912691E-005 +mermin_energy :real:0: + -0.439098922757801E+002 +end_coords :real:2:3,30 + -0.937473054326264E+001 -0.120220470853992E+002 -0.277541581724350E+000 + -0.878163050807953E+001 -0.943647542375730E+001 0.259350057772419E+000 + -0.108130653421194E+002 -0.778750133681579E+001 0.798754342517095E+000 + -0.103956062461030E+002 -0.522938058132579E+001 0.132885397459708E+001 + -0.785262443510681E+001 -0.425147661062806E+001 0.132639824279369E+001 + -0.582965722700599E+001 -0.587118522928033E+001 0.793951929516909E+000 + -0.623379033061945E+001 -0.845668836378867E+001 0.256810064976924E+000 + -0.420235828959457E+001 -0.101056588659200E+002 -0.282631834007663E+000 + -0.461979871889768E+001 -0.126638628090377E+002 -0.812343907853831E+000 + -0.716275752436968E+001 -0.136418148657030E+002 -0.809713366947867E+000 + -0.754943177460753E+001 -0.162635637685928E+002 -0.135627547226619E+001 + -0.553925400523030E+001 -0.178194858222259E+002 -0.187369392859140E+001 + -0.302757847966363E+001 -0.168535867157055E+002 -0.187613185142810E+001 + -0.257699808443579E+001 -0.143513506265648E+002 -0.136123096724440E+001 + -0.124383222340687E+002 -0.354192851552467E+001 0.187814547314373E+001 + -0.119876873070180E+002 -0.103972164154775E+001 0.239316739219830E+001 + -0.947602131133948E+001 -0.738262058390193E-001 0.239052953502920E+001 + -0.746586043233314E+001 -0.162979255103993E+001 0.187318536761205E+001 + -0.111254719777267E+002 -0.127688958827480E+002 -0.275635453103162E+000 + -0.127533849759289E+002 -0.853277742293868E+001 0.800681522118877E+000 + -0.388990555223208E+001 -0.512443486775827E+001 0.792178940973330E+000 + -0.226207202267685E+001 -0.936029938052004E+001 -0.284805137947267E+000 + -0.948704841806228E+001 -0.170124348713261E+002 -0.135506697265437E+001 + -0.585235538347946E+001 -0.198284508448321E+002 -0.229134726840836E+001 + -0.144978613961539E+001 -0.181354551223346E+002 -0.229547126278666E+001 + -0.636901827198546E+000 -0.136089248727320E+002 -0.136382289651307E+001 + -0.143783905210936E+002 -0.428438102598776E+001 0.188106229789936E+001 + -0.135654181043600E+002 0.242122703389314E+000 0.281278967078193E+001 + -0.916287254443171E+001 0.193514700780343E+001 0.280806461692763E+001 + -0.552822673788079E+001 -0.880954474669791E+000 0.187204608148224E+001 +dipole_moments :real:2:3,1 + -0.103531110953098E-002 0.677551187038913E-002 0.376853622264924E-002 +scaled_dipole :real:2:3,1 + -0.103531110953098E-002 0.677551187038913E-002 0.376853622264924E-002 diff --git a/test/app/dftb+/legacy/parser/v4/dftb_old.hsd b/test/app/dftb+/legacy/parser/v4/dftb_old.hsd new file mode 100644 index 0000000000..c46ec3da90 --- /dev/null +++ b/test/app/dftb+/legacy/parser/v4/dftb_old.hsd @@ -0,0 +1,47 @@ +Geometry = GenFormat { + <<< "C18H12.gen" +} + +Driver = {} + +Hamiltonian = DFTB { + + SCC = Yes + SCCTolerance = 1.0E-008 # Extremely small + MaxSCCIterations = 1000 + + Eigensolver = Standard {} + Mixer = Broyden {} + + MaxAngularMomentum = { + H = "s" + C = "p" + } + + SlaterKosterFiles = Type2FileNames { + Prefix = "slakos/origin/hybrid/cam/HC/" + Separator = "-" + Suffix = ".skf" + } + + RangeSeparated = CAM { + Screening = MatrixBased {} + } + +} + +Options { + CalculateForces = Yes + WriteAutotestTag = Yes + MullikenAnalysis = Yes +} + +ParserOptions { + ParserVersion = 4 +} + +Parallel { + # Allow OMP threads explicitely to test for hybrid parallelisation with + # MPI-binary. (Check the manual before using this in production runs!) + UseOmpThreads = Yes +} diff --git a/test/app/dftb+/legacy/parser/v4/testrun.sh b/test/app/dftb+/legacy/parser/v4/testrun.sh new file mode 100755 index 0000000000..825ca46942 --- /dev/null +++ b/test/app/dftb+/legacy/parser/v4/testrun.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +#------------------------------------------------------------------------------# +# DFTB+: general package for performing fast atomistic simulations # +# Copyright (C) 2006 - 2025 DFTB+ developers group # +# # +# See the LICENSE file for terms of usage and distribution. # +#------------------------------------------------------------------------------# + + +DFTBPLUS_CMD=$* + +rm -f dftb_in.hsd +cp dftb_old.hsd dftb_in.hsd +$DFTBPLUS_CMD + +rm -f dftb_in.hsd +mv dftb_pin.hsd dftb_in.hsd +$DFTBPLUS_CMD diff --git a/test/app/dftb+/tests b/test/app/dftb+/tests index 7634671767..bdc9cb8c52 100644 --- a/test/app/dftb+/tests +++ b/test/app/dftb+/tests @@ -105,6 +105,7 @@ input/unsorted_contcar #? MPI_PROCS <= 1 hybrid/cluster/C18H12-force-hyb #? MPI_PROCS <= 4 hybrid/cluster/C18H12-force-lc #? not WITH_MPI hybrid/cluster/C18H12-force-cam #? MPI_PROCS <= 4 +legacy/parser/v4 #? MPI_PROCS <= 4 hybrid/cluster/C18H12-nbscreening #? not WITH_MPI hybrid/cluster/C18H12-matrix #? MPI_PROCS <= 4 hybrid/cluster/CH3 #? not WITH_MPI diff --git a/utils/srcmanip/change_header_year b/utils/srcmanip/change_header_year index fb7b11d852..ddec3084d8 100755 --- a/utils/srcmanip/change_header_year +++ b/utils/srcmanip/change_header_year @@ -29,6 +29,7 @@ IGNORED_FILES = [ "*.mgf", "*.egg", "*.skf", + "*.bin", ]