Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocate lattice for non-periodic structures #14

Merged
merged 3 commits into from
Apr 21, 2021
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ get_directory_property(is-subproject PARENT_DIRECTORY)
project(
"mctc-lib"
LANGUAGES "Fortran"
VERSION "0.2.1"
VERSION "0.2.2"
DESCRIPTION "Modular computation tool chain"
)

Expand Down
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "mctc-lib"
version = "0.2.1"
version = "0.2.2"
license = "Apache-2.0"
maintainer = ["@awvwgk"]
author = ["Sebastian Ehlert"]
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
project(
'mctc-lib',
'fortran',
version: '0.2.1',
version: '0.2.2',
license: 'Apache-2.0',
meson_version: '>=0.53',
default_options: [
Expand Down
2 changes: 2 additions & 0 deletions src/mctc/io/structure.f90
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ subroutine new_structure(self, num, sym, xyz, charge, uhf, lattice, periodic, &

if (present(lattice)) then
self%lattice = lattice
else
allocate(self%lattice(0, 0))
end if

if (present(periodic)) then
Expand Down
6 changes: 3 additions & 3 deletions src/mctc/io/write/vasp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ subroutine write_vasp(self, unit, comment_line)
! scaling factor for lattice parameters is always one
write(unit, '(f20.14)') self%info%scale
! write the lattice parameters
if (allocated(self%lattice)) then
do i = 1, 3
if (any(self%periodic)) then
do i = 1, size(self%lattice, 2)
write(unit, '(3f20.14)') self%lattice(:, i)*autoaa/self%info%scale
enddo
else
Expand All @@ -87,7 +87,7 @@ subroutine write_vasp(self, unit, comment_line)
if (self%info%selective) write(unit, '("Selective")')

! we write cartesian coordinates
if (.not.allocated(self%lattice) .or. self%info%cartesian) then
if (any(shape(self%lattice) /= [3, 3]) .or. self%info%cartesian) then
write(unit, '("Cartesian")')

! now write the cartesian coordinates
Expand Down
4 changes: 2 additions & 2 deletions src/mctc/version.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ module mctc_version


!> String representation of the mctc-lib version
character(len=*), parameter :: mctc_version_string = "0.2.1"
character(len=*), parameter :: mctc_version_string = "0.2.2"

!> Numeric representation of the mctc-lib version
integer, parameter :: mctc_version_compact(3) = [0, 2, 1]
integer, parameter :: mctc_version_compact(3) = [0, 2, 2]


contains
Expand Down