Skip to content

Commit

Permalink
Perform various infrastructure related trivial updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderhe committed Apr 26, 2024
1 parent c8c5f71 commit 3aad573
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 199 deletions.
18 changes: 9 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,36 @@ When you contribute to the project, your contribution must align with the

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindCustomBlas.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Distributed under the OSI-approved BSD 2-Clause License.
#
# Copyright (C) 2021 DFTB+ developers group
# Copyright (C) 2024 DFTB+ developers group
#

#[=======================================================================[.rst:
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindCustomLapack.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Distributed under the OSI-approved BSD 2-Clause License.
#
# Copyright (C) 2021 DFTB+ developers group
# Copyright (C) 2024 DFTB+ developers group
#

#[=======================================================================[.rst:
Expand Down
2 changes: 1 addition & 1 deletion cmake/SkProgsUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function(skprogs_guess_toolchain toolchain)

if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
set(_toolchain "gnu")
elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Intel")
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel|IntelLLVM")
set(_toolchain "intel")
elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "NAG")
set(_toolchain "nag")
Expand Down
2 changes: 1 addition & 1 deletion common/include/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DFTB+: general package for performing fast atomistic simulations
Copyright (C) 2006 - 2021 DFTB+ developers group
Copyright (C) 2006 - 2024 DFTB+ developers group

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Expand Down
50 changes: 29 additions & 21 deletions common/include/common.fypp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!-------------------------------------------------------------------------------------------------!
#! DFTB+: general package for performing fast atomistic simulations !
#! Copyright (C) 2006 - 2020 DFTB+ developers group !
#! Copyright (C) 2006 - 2024 DFTB+ developers group !
#! !
#! See the LICENSE file for terms of usage and distribution. !
#!-------------------------------------------------------------------------------------------------!
Expand All @@ -12,27 +12,15 @@
#! Default values for all preprocessor variables
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#:if not defined('DEBUG')
#:set DEBUG = 0
#:endif

#:set DEBUG = getvar('DEBUG', 0)
#:set WITH_ASSERT = defined('WITH_ASSERT') or DEBUG > 0
#:set WITH_MPI = defined('WITH_MPI')


#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#! ASSERT and DEBUG related macros
#! DEBUG related macros
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#! Check a condition if WITH_ASSERT is True and call assertError if condition is False.
#:def ASSERT(cond)
#:if WITH_ASSERT
if (.not. (${cond}$)) then
call assertError("${_FILE_}$", ${_LINE_}$)
end if
#:endif
#:enddef ASSERT


#! Insert code if DEBUG level is greater than zero.
#:def DEBUG_CODE(code)
#:if DEBUG > 0
Expand All @@ -58,11 +46,31 @@
#:enddef


#! Macro for automated deallocations
#:def SAFE_DEALLOC(*args)
#:for arg in args
if (allocated(${arg}$)) deallocate(${arg}$)
#:endfor
#! Creates a class instance by allocating, initializing and move_allocing a specific type
#!
#! Args:
#! cls (str): Name of the LHS variable (must be a class)
#! dyntype (str): Dynamic type of the actual instance to be initialized
#! init (str): Initialization routine to call (with allocated instance as first arg)
#! initargs (str): Further arguments to pass to the init routine.
#:def CREATE_CLASS(cls, dyntype, init, *initargs)
block
type(${dyntype}$), allocatable :: inst
allocate(inst)
call ${init}$(inst, ${", ".join(initargs)}$)
call move_alloc(inst, ${cls}$)
end block
#:enddef


#! Simple macro printing out the position of a line
#:def PRINT_POSITION()
block
use iso_fortran_env, only : output_unit
write(output_unit, "(a)") "Reached line ${_LINE_}$ in ${_FILE_}$"
flush(output_unit)
end block
#:enddef

#:endif
#:endmute
55 changes: 11 additions & 44 deletions common/include/error.fypp
Original file line number Diff line number Diff line change
@@ -1,55 +1,18 @@
#!-------------------------------------------------------------------------------------------------!
#! DFTB+: general package for performing fast atomistic simulations !
#! Copyright (C) 2006 - 2020 DFTB+ developers group !
#! Copyright (C) 2006 - 2024 DFTB+ developers group !
#! !
#! See the LICENSE file for terms of usage and distribution. !
#!-------------------------------------------------------------------------------------------------!

#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#! Error string handling wrappers for returns from routinese
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


#! Macro to return an error flag if return variable available or throw
#! an error and shut down otherwise
#:def ERROR_HANDLING(errVar, errNumber, msg)
block
use dftbp_accuracy, only : lc
use dftbp_message
!> Error handling string
character(lc) :: stringTmp

write(stringTmp,"(A)")${msg}$
if (present(${errVar}$)) then
${errVar}$ = ${errNumber}$
call warning(stringTmp)
return
else
call error(stringTmp)
end if
end block
#:enddef ERROR_HANDLING

#:mute
#:if not defined("_ERROR_FYPP_")
#:set _ERROR_FYPP_

#! Macro to return an error flag if return variable available or throw
#! an error and shut down otherwise
#:def FORMATTED_ERROR_HANDLING(errVar, errNumber, formating, *variables)
block
use dftbp_accuracy, only : lc
use dftbp_message
!> Error handling string
character(lc) :: stringTmp

write(stringTmp,${formating}$) ${ ",".join(variables) }$
if (present(${errVar}$)) then
${errVar}$ = ${errNumber}$
call warning(stringTmp)
return
else
call error(stringTmp)
end if
end block
#:enddef FORMATTED_ERROR_HANDLING
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#! Error string handling wrappers for returns from routines
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


#! Propagation of error handling, for now it just returns when in error
Expand All @@ -60,3 +23,7 @@
end if
end if
#:enddef


#:endif
#:endmute
3 changes: 1 addition & 2 deletions doc/devel/code_structure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OVERVIEW
main.f90: main program

globals.f90: Variables of the main program, except the mixer all
other subroutines/functions use intent(in)/intent(out) to protect
other subroutines/functions use intent(in)/intent(out) to protect
these variables, so in some sence this is not global
The variables are also allocated here.
IMPORTANT: This also gives a short comment what the variable is !
Expand Down Expand Up @@ -49,4 +49,3 @@ utilities.f90: misc stuff (factorial etc.)

zora_routines.f90: ZORA routines, contains even the routines for the
naive implementation, see NAIVE_ZORA for their use

6 changes: 3 additions & 3 deletions doc/devel/general_notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ alpha with a known issue: Although I am confident I got the prefactor
right I cannot reproduce literature results. Not sure why.

For the ZORA stuff see vlenthe.pdf in references. Here, I basically use
the implementation for ADF Band (Chapter 6.2) which explicitely assumes a
the implementation for ADF Band (Chapter 6.2) which explicitely assumes a
sphericallysymmetric potential with one more step (which has to be
checked): Impementing 6.13-6.15 directly leads to an matrix element
containg the second derivative of the basis function. IMHO one can
Expand All @@ -60,7 +60,7 @@ ZORA as currently implemented.

The confining potential matrix elements are also evaluated analytically.
The confinig potential does not enter in the ZORA kinetic energy
operator, since the kinetic energy would then vanish for r->infty which is
clearly wrong. Having the confining potential only in the SCF potential but
operator, since the kinetic energy would then vanish for r->infty which is
clearly wrong. Having the confining potential only in the SCF potential but
not in the ZORA kinetic energy seems to work reasonanbly judging from the <r>
expectation values.
2 changes: 1 addition & 1 deletion doc/input.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Line 2:
xc_functional
integer :: xc_functional, 0=HF, 1=X-Alpha, 2=PW-LDA, 3=PBE

NOTE: HF only correct for 1S states, X-Aalpha is untested alpha=0.7
NOTE: HF only correct for 1S states, X-Alpha is untested alpha=0.7

Line 3:
r_0 power
Expand Down
2 changes: 1 addition & 1 deletion sys/generic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(Fortran_FLAGS "${CMAKE_Fortran_FLAGS}"
set(Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE}"
CACHE STRING "Fortran compiler flags for Release build")

set(Fortran_FLAGS_RELWITHDEBINFO "${Fortran_FLAGS_RELWITHDEBINFO}"
set(Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO}"
CACHE STRING "Fortran compiler flags for Release build")

set(Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}"
Expand Down
9 changes: 7 additions & 2 deletions sys/intel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
#
# Fortran compiler settings
#
set(Fortran_FLAGS_RELEASE "-O2 -ip"
CACHE STRING "Fortran compiler flags for Release build")
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "IntelLLVM")
set(Fortran_FLAGS_RELEASE "-O2"
CACHE STRING "Fortran compiler flags for Release build")
else()
set(Fortran_FLAGS_RELEASE "-O2 -ip"
CACHE STRING "Fortran compiler flags for Release build")
endif()

set(Fortran_FLAGS_RELWITHDEBINFO "-g ${Fortran_FLAGS_RELEASE}"
CACHE STRING "Fortran compiler flags for Release build")
Expand Down
26 changes: 0 additions & 26 deletions tools/utils/srccheck/pylint/pylintrc-2.ini

This file was deleted.

30 changes: 0 additions & 30 deletions tools/utils/srccheck/pylint/pylintrc-3.ini

This file was deleted.

26 changes: 0 additions & 26 deletions utils/srccheck/pylint/pylintrc-2.ini

This file was deleted.

Loading

0 comments on commit 3aad573

Please sign in to comment.