diff --git a/doc/dftb+/manual/dftbp.tex b/doc/dftb+/manual/dftbp.tex index a3b314f425..e5d94451ab 100644 --- a/doc/dftb+/manual/dftbp.tex +++ b/doc/dftb+/manual/dftbp.tex @@ -2709,9 +2709,21 @@ \subsubsection{Explicit specification} } \end{verbatim} +You can also set a \kw{Prefix} for the files, typically their path +Example (C): + \invparskip +\begin{verbatim} + SlaterKosterFiles = { + Prefix = "my_skfiles/mio-1-1/" + C-C = "C-C.skf" + } +\end{verbatim} +Which would specify the file's location as {\tt + ./my\_skfiles/mio-1-1/C-C.skf} inside the current directory. + If you treat shells from different species as shells of one atom by using the \iscb{SelectedShells} keyword in the -\iscb{MaxAngularMomentum} block, you have to specify more than one +\iscb{MaxAngularMomentum} block, you will have to specify more than one file name for certain species pairs. (For details see the description about the \iscb{MaxAngularMomentum} keyword.) diff --git a/src/dftbp/dftbplus/parser.F90 b/src/dftbp/dftbplus/parser.F90 index c709711bdf..1cc5f9451f 100644 --- a/src/dftbp/dftbplus/parser.F90 +++ b/src/dftbp/dftbplus/parser.F90 @@ -1328,7 +1328,7 @@ subroutine readDFTBHam(node, ctrl, geo, slako, poisson, errStatus) type(TListIntR1), allocatable :: angShells(:) logical, allocatable :: repPoly(:,:) integer :: iSp1, iSp2, ii - character(lc) :: prefix, suffix, separator, elem1, elem2, strTmp + character(lc) :: prefix, suffix, separator, elem1, elem2, strTmp, str2Tmp character(lc) :: errorStr logical :: tLower, tExist integer, allocatable :: pTmpI1(:) @@ -1396,6 +1396,9 @@ subroutine readDFTBHam(node, ctrl, geo, slako, poisson, errStatus) end do case default call setUnprocessed(value1) + call getChildValue(child, "Prefix", buffer2, "") + prefix = unquote(char(buffer2)) + do iSp1 = 1, geo%nSpecies do iSp2 = 1, geo%nSpecies strTmp = trim(geo%speciesNames(iSp1)) // "-" // trim(geo%speciesNames(iSp2)) @@ -1408,7 +1411,8 @@ subroutine readDFTBHam(node, ctrl, geo, slako, poisson, errStatus) call detailedError(child2, errorStr) end if do ii = 1, len(lStr) - call get(lStr, strTmp, ii) + call get(lStr, str2Tmp, ii) + strTmp = trim(prefix) // str2Tmp call findFile(searchPath, strTmp, strOut) if (allocated(strOut)) strTmp = strOut inquire(file=strTmp, exist=tExist) diff --git a/test/app/dftb+/non-scc/Si41C23N35/dftb_in.hsd b/test/app/dftb+/non-scc/Si41C23N35/dftb_in.hsd index ddff3ac5d9..9fcca9a1a6 100644 --- a/test/app/dftb+/non-scc/Si41C23N35/dftb_in.hsd +++ b/test/app/dftb+/non-scc/Si41C23N35/dftb_in.hsd @@ -244,7 +244,7 @@ Hamiltonian = DFTB { Temperature [Kelvin] = 1.000000000000000E-008 } SlaterKosterFiles = Type2FileNames { -Prefix = {slakos/origin/pbc-0-3/} + Prefix = {slakos/origin/pbc-0-3/} Separator = "-" Suffix = ".skf" } diff --git a/test/app/dftb+/non-scc/Si_2/Si-Si.skf b/test/app/dftb+/non-scc/Si_2/Si-Si.skf deleted file mode 120000 index 8e4e0a7f6e..0000000000 --- a/test/app/dftb+/non-scc/Si_2/Si-Si.skf +++ /dev/null @@ -1 +0,0 @@ -../../../../../external/slakos/origin/pbc-0-3/Si-Si.skf \ No newline at end of file diff --git a/test/app/dftb+/non-scc/Si_2/dftb_in.hsd b/test/app/dftb+/non-scc/Si_2/dftb_in.hsd index 7f54deb894..67a9361797 100644 --- a/test/app/dftb+/non-scc/Si_2/dftb_in.hsd +++ b/test/app/dftb+/non-scc/Si_2/dftb_in.hsd @@ -20,6 +20,7 @@ Hamiltonian = DFTB { Temperature [Kelvin] = 1.000000000000000E-008 } SlaterKosterFiles = { + Prefix = {slakos/origin/pbc-0-3/} Si-Si = "./Si-Si.skf" } KPointsAndWeights = {