Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,19 @@ jobs:
- name: Upload coverage report
if: ${{ matrix.build == 'meson' && matrix.build-type == 'coverage' }}
uses: codecov/codecov-action@v5

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit checks
run: pre-commit run -a
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/PlasmaFAIR/fortitude-pre-commit
rev: v0.9.0
hooks:
- id: fortitude
args: ["--fix", "--preview"]
28 changes: 14 additions & 14 deletions app/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

program main
use, intrinsic :: iso_fortran_env, only: output_unit, error_unit, input_unit
use mctc_cutoff, only: get_lattice_points
use mctc_env, only: error_type, fatal_error, get_argument, wp
use mctc_io, only: structure_type, read_structure, filetype, get_filetype
use mctc_cutoff, only: get_lattice_points
use multicharge, only: mchrg_model_type, mchrg_model, new_eeq2019_model, &
& new_eeqbc2025_model, get_multicharge_version, &
& write_ascii_model, write_ascii_properties, write_ascii_results
Expand All @@ -44,7 +44,7 @@ program main

call get_arguments(input, model_id, input_format, grad, charge, json, error)
if (allocated(error)) then
write(error_unit, '(a)') error%message
write(error_unit, "(a)") error%message
error stop
end if

Expand All @@ -55,7 +55,7 @@ program main
call read_structure(mol, input, error, input_format)
end if
if (allocated(error)) then
write(error_unit, '(a)') error%message
write(error_unit, "(a)") error%message
error stop
end if

Expand All @@ -70,10 +70,10 @@ program main
read(unit, *, iostat=stat) charge
if (stat == 0) then
mol%charge = charge
write(output_unit, '(a,/)') &
write(output_unit, "(a,/)") &
"[Info] Molecular charge read from '"//chargeinput//"'"
else
write(output_unit, '(a,/)') &
write(output_unit, "(a,/)") &
"[Warn] Could not read molecular charge read from '"//chargeinput//"'"
end if
close(unit)
Expand All @@ -88,7 +88,7 @@ program main
call fatal_error(error, "Invalid model was choosen.")
end if
if (allocated(error)) then
write(error_unit, '(a)') error%message
write(error_unit, "(a)") error%message
error stop
end if

Expand Down Expand Up @@ -118,7 +118,7 @@ program main
& energy, gradient, sigma, qvec, dqdr, dqdL)

if (allocated(error)) then
write(error_unit, '(a)') error%message
write(error_unit, "(a)") error%message
error stop
end if

Expand All @@ -129,7 +129,7 @@ program main
open(file=json_output, newunit=unit)
call json_results(unit, " ", energy=sum(energy), gradient=gradient, charges=qvec, cn=cn)
close(unit)
write(output_unit, '(a)') &
write(output_unit, "(a)") &
"[Info] JSON dump of results written to '"//json_output//"'"
end if

Expand All @@ -138,16 +138,16 @@ program main
subroutine help(unit)
integer, intent(in) :: unit

write(unit, '(a, *(1x, a))') &
write(unit, "(a, *(1x, a))") &
"Usage: "//prog_name//" [options] <input>"

write(unit, '(a)') &
write(unit, "(a)") &
"", &
"Electronegativity equilibration model for atomic charges and", &
"higher multipole moments", &
""

write(unit, '(2x, a, t35, a)') &
write(unit, "(2x, a, t35, a)") &
"-m, -model, --model <model>", "Choose the charge model", &
"-i, -input, --input <format>", "Hint for the format of the input file", &
"-c, -charge, --charge <value>", "Set the molecular charge", &
Expand All @@ -156,7 +156,7 @@ subroutine help(unit)
"-v, -version, --version", "Print program version and exit", &
"-h, -help, --help", "Show this help message"

write(unit, '(a)')
write(unit, "(a)")

end subroutine help

Expand All @@ -165,7 +165,7 @@ subroutine version(unit)
character(len=:), allocatable :: version_string

call get_multicharge_version(string=version_string)
write(unit, '(a, *(1x, a))') &
write(unit, "(a, *(1x, a))") &
& prog_name, "version", version_string

end subroutine version
Expand All @@ -174,7 +174,7 @@ subroutine get_arguments(input, model_id, input_format, grad, charge, &
& json, error)

!> Input file name
character(len=:), allocatable :: input
character(len=:), allocatable, intent(out) :: input

!> ID of choosen model type
integer, intent(out) :: model_id
Expand Down
9 changes: 9 additions & 0 deletions fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ mctc-lib.tag = "v0.5.2"
[dev-dependencies]
mstore.git = "https://github.com/grimme-lab/mstore.git"
mstore.tag = "v0.3.0"

[extra.fortitude.check]
ignore = [
"C002", # interface without implicit none
"C003", # implicit none(external)
]
per-file-ignores."src/multicharge/blas.F90" = ["C071"]
per-file-ignores."src/multicharge/lapack.F90" = ["C071"]
line-length = 132
68 changes: 34 additions & 34 deletions src/multicharge/blas.F90
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ subroutine mchrg_sgemv312(amat, xvec, yvec, alpha, beta, trans)
if (present(trans)) then
tra = trans
else
tra = 'n'
tra = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1)*size(amat, 2), 1:size(amat, 3)) => amat
yptr(1:size(yvec, 1)*size(yvec, 2)) => yvec
else
Expand All @@ -234,9 +234,9 @@ subroutine mchrg_sgemv321(amat, xvec, yvec, alpha, beta, trans)
if (present(trans)) then
tra = trans
else
tra = 'n'
tra = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1), 1:size(amat, 2)*size(amat, 3)) => amat
xptr(1:size(xvec, 1)*size(xvec, 2)) => xvec
else
Expand All @@ -259,9 +259,9 @@ subroutine mchrg_dgemv312(amat, xvec, yvec, alpha, beta, trans)
if (present(trans)) then
tra = trans
else
tra = 'n'
tra = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1)*size(amat, 2), 1:size(amat, 3)) => amat
yptr(1:size(yvec, 1)*size(yvec, 2)) => yvec
else
Expand All @@ -284,9 +284,9 @@ subroutine mchrg_dgemv321(amat, xvec, yvec, alpha, beta, trans)
if (present(trans)) then
tra = trans
else
tra = 'n'
tra = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1), 1:size(amat, 2)*size(amat, 3)) => amat
xptr(1:size(xvec, 1)*size(xvec, 2)) => xvec
else
Expand Down Expand Up @@ -320,7 +320,7 @@ pure subroutine mchrg_sgemv(amat, xvec, yvec, alpha, beta, trans)
if (present(trans)) then
tra = trans
else
tra = 'n'
tra = "n"
end if
incx = 1_ik
incy = 1_ik
Expand Down Expand Up @@ -354,7 +354,7 @@ pure subroutine mchrg_dgemv(amat, xvec, yvec, alpha, beta, trans)
if (present(trans)) then
tra = trans
else
tra = 'n'
tra = "n"
end if
incx = 1_ik
incy = 1_ik
Expand Down Expand Up @@ -388,7 +388,7 @@ pure subroutine mchrg_ssymv(amat, xvec, yvec, uplo, alpha, beta)
if (present(uplo)) then
ula = uplo
else
ula = 'u'
ula = "u"
end if
incx = 1_ik
incy = 1_ik
Expand Down Expand Up @@ -421,7 +421,7 @@ pure subroutine mchrg_dsymv(amat, xvec, yvec, uplo, alpha, beta)
if (present(uplo)) then
ula = uplo
else
ula = 'u'
ula = "u"
end if
incx = 1_ik
incy = 1_ik
Expand Down Expand Up @@ -455,14 +455,14 @@ pure subroutine mchrg_sgemm(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transa)) then
tra = transa
else
tra = 'n'
tra = "n"
end if
if (present(transb)) then
trb = transb
else
trb = 'n'
trb = "n"
end if
if ((tra.eq.'n'.or.tra.eq.'N')) then
if ((tra=="n".or.tra=="N")) then
k = size(amat, 2)
else
k = size(amat, 1)
Expand Down Expand Up @@ -500,14 +500,14 @@ pure subroutine mchrg_dgemm(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transa)) then
tra = transa
else
tra = 'n'
tra = "n"
end if
if (present(transb)) then
trb = transb
else
trb = 'n'
trb = "n"
end if
if ((tra.eq.'n'.or.tra.eq.'N')) then
if ((tra=="n".or.tra=="N")) then
k = size(amat, 2)
else
k = size(amat, 1)
Expand All @@ -534,9 +534,9 @@ subroutine mchrg_sgemm323(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transa)) then
tra = transa
else
tra = 'n'
tra = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1)*size(amat, 2), 1:size(amat, 3)) => amat
else
aptr(1:size(amat, 1), 1:size(amat, 2)*size(amat, 3)) => amat
Expand All @@ -559,9 +559,9 @@ subroutine mchrg_sgemm233(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transb)) then
trb = transb
else
trb = 'n'
trb = "n"
end if
if (any(trb == ['n', 'N'])) then
if (any(trb == ["n", "N"])) then
bptr(1:size(bmat, 1), 1:size(bmat, 2)*size(bmat, 3)) => bmat
else
bptr(1:size(bmat, 1)*size(bmat, 2), 1:size(bmat, 3)) => bmat
Expand All @@ -584,19 +584,19 @@ subroutine mchrg_sgemm332(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transa)) then
tra = transa
else
tra = 'n'
tra = "n"
end if
if (present(transb)) then
trb = transb
else
trb = 'n'
trb = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1), 1:size(amat, 2)*size(amat, 3)) => amat
else
aptr(1:size(amat, 1)*size(amat, 2), 1:size(amat, 3)) => amat
end if
if (any(trb == ['n', 'N'])) then
if (any(trb == ["n", "N"])) then
bptr(1:size(bmat, 1)*size(bmat, 2), 1:size(bmat, 3)) => bmat
else
bptr(1:size(bmat, 1), 1:size(bmat, 2)*size(bmat, 3)) => bmat
Expand All @@ -618,9 +618,9 @@ subroutine mchrg_dgemm323(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transa)) then
tra = transa
else
tra = 'n'
tra = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1)*size(amat, 2), 1:size(amat, 3)) => amat
else
aptr(1:size(amat, 1), 1:size(amat, 2)*size(amat, 3)) => amat
Expand All @@ -643,9 +643,9 @@ subroutine mchrg_dgemm233(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transb)) then
trb = transb
else
trb = 'n'
trb = "n"
end if
if (any(trb == ['n', 'N'])) then
if (any(trb == ["n", "N"])) then
bptr(1:size(bmat, 1), 1:size(bmat, 2)*size(bmat, 3)) => bmat
else
bptr(1:size(bmat, 1)*size(bmat, 2), 1:size(bmat, 3)) => bmat
Expand All @@ -668,19 +668,19 @@ subroutine mchrg_dgemm332(amat, bmat, cmat, transa, transb, alpha, beta)
if (present(transa)) then
tra = transa
else
tra = 'n'
tra = "n"
end if
if (present(transb)) then
trb = transb
else
trb = 'n'
trb = "n"
end if
if (any(tra == ['n', 'N'])) then
if (any(tra == ["n", "N"])) then
aptr(1:size(amat, 1), 1:size(amat, 2)*size(amat, 3)) => amat
else
aptr(1:size(amat, 1)*size(amat, 2), 1:size(amat, 3)) => amat
end if
if (any(trb == ['n', 'N'])) then
if (any(trb == ["n", "N"])) then
bptr(1:size(bmat, 1)*size(bmat, 2), 1:size(bmat, 3)) => bmat
else
bptr(1:size(bmat, 1), 1:size(bmat, 2)*size(bmat, 3)) => bmat
Expand Down
2 changes: 1 addition & 1 deletion src/multicharge/charge.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

!> Interface to the charge models
module multicharge_charge
use mctc_cutoff, only : get_lattice_points
use mctc_env, only : error_type, wp
use mctc_io, only : structure_type
use mctc_cutoff, only : get_lattice_points
use multicharge_model, only : mchrg_model_type
use multicharge_param, only : new_eeq2019_model, new_eeqbc2025_model
implicit none
Expand Down
2 changes: 1 addition & 1 deletion src/multicharge/ewald.f90
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ subroutine search_alpha(lattice, rec_lat, volume, tolerance, alpha)
end do
if (alpha > huge(1.0_wp)) then
stat = 1
elseif (alpha == alpha0) then
else if (alpha == alpha0) then
stat = 2
end if

Expand Down
Loading
Loading