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

Prepare Release of CPCM-X #25

Merged
merged 15 commits into from
Jul 31, 2023
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
121 changes: 121 additions & 0 deletions .github/workflows/fortran_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: CI
on: [push, pull_request]

env:
BUILD_DIR: _build

jobs:
gcc-meson-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
fc: [gfortran-11]
cc: [gcc-11]
include:
- os: ubuntu-latest
fc: gfortran-9
cc: gcc-9
- os: ubuntu-latest
fc: gfortran-10
cc: gcc-10

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x

- name: Install OpenBLAS (OSX)
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install openblas
echo "PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig" >> $GITHUB_ENV

- name: Install meson
run: pip3 install meson==0.62.0 ninja cmake

- name: Configure build
run: >-
meson setup ${{ env.BUILD_DIR }}
--buildtype=release
${{ env.MESON_ARGS }}
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
MESON_ARGS: ${{ contains(matrix.os, 'macos') && '-Dlapack=openblas' || '-Dlapack=netlib' }}

- name: Build project
run: meson compile -C ${{ env.BUILD_DIR }}

- name: Run unit tests
run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild -t 120 --suite cpx

intel-meson-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
fc: [ifort]
cc: [icc]
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
APT_PACKAGES: >-
intel-oneapi-compiler-fortran
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
intel-oneapi-mkl
intel-oneapi-mkl-devel
asciidoctor

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x

- run: pip3 install meson ninja --user

- name: Add Intel repository
if: contains(matrix.os, 'ubuntu')
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update

- name: Install Intel oneAPI compiler
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install ${APT_PACKAGES}
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV

- name: Configure meson build
run: >-
meson setup ${{ env.BUILD_DIR }}
--prefix=/ --libdir=lib
-Dfortran_link_args="-lifcoremt -static"
-Ddefault_library=static
-Dlapack=mkl

- name: Build project
run: ninja -C ${{ env.BUILD_DIR }}

- name: Run unit tests
run: >-
meson test -C ${{ env.BUILD_DIR }}
--print-errorlogs
--num-processes 1
--no-rebuild
--suite cpx
-t 12
750 changes: 750 additions & 0 deletions DB/xtb/2methylpyridine.cosmo

Large diffs are not rendered by default.

499 changes: 499 additions & 0 deletions DB/xtb/2methylpyridine.fh

Large diffs are not rendered by default.

965 changes: 965 additions & 0 deletions DB/xtb/4methyl2pentanone.cosmo

Large diffs are not rendered by default.

654 changes: 654 additions & 0 deletions DB/xtb/4methyl2pentanone.fh

Large diffs are not rendered by default.

505 changes: 505 additions & 0 deletions DB/xtb/aceticacid.cosmo

Large diffs are not rendered by default.

332 changes: 332 additions & 0 deletions DB/xtb/aceticacid.fh

Large diffs are not rendered by default.

418 changes: 418 additions & 0 deletions DB/xtb/acetonitrile.cosmo

Large diffs are not rendered by default.

271 changes: 271 additions & 0 deletions DB/xtb/acetonitrile.fh

Large diffs are not rendered by default.

884 changes: 884 additions & 0 deletions DB/xtb/acetophenone.cosmo

Large diffs are not rendered by default.

589 changes: 589 additions & 0 deletions DB/xtb/acetophenone.fh

Large diffs are not rendered by default.

748 changes: 748 additions & 0 deletions DB/xtb/aniline.cosmo

Large diffs are not rendered by default.

495 changes: 495 additions & 0 deletions DB/xtb/aniline.fh

Large diffs are not rendered by default.

839 changes: 839 additions & 0 deletions DB/xtb/anisole.cosmo

Large diffs are not rendered by default.

560 changes: 560 additions & 0 deletions DB/xtb/anisole.fh

Large diffs are not rendered by default.

673 changes: 673 additions & 0 deletions DB/xtb/benzene.cosmo

Large diffs are not rendered by default.

441 changes: 441 additions & 0 deletions DB/xtb/benzene.fh

Large diffs are not rendered by default.

852 changes: 852 additions & 0 deletions DB/xtb/benzylalcohol.cosmo

Large diffs are not rendered by default.

574 changes: 574 additions & 0 deletions DB/xtb/benzylalcohol.fh

Large diffs are not rendered by default.

684 changes: 684 additions & 0 deletions DB/xtb/bromobenzene.cosmo

Large diffs are not rendered by default.

448 changes: 448 additions & 0 deletions DB/xtb/bromobenzene.fh

Large diffs are not rendered by default.

498 changes: 498 additions & 0 deletions DB/xtb/bromoethane.cosmo

Large diffs are not rendered by default.

326 changes: 326 additions & 0 deletions DB/xtb/bromoethane.fh

Large diffs are not rendered by default.

388 changes: 388 additions & 0 deletions DB/xtb/bromoform.cosmo

Large diffs are not rendered by default.

252 changes: 252 additions & 0 deletions DB/xtb/bromoform.fh

Large diffs are not rendered by default.

1,288 changes: 1,288 additions & 0 deletions DB/xtb/bromooctane.cosmo

Large diffs are not rendered by default.

875 changes: 875 additions & 0 deletions DB/xtb/bromooctane.fh

Large diffs are not rendered by default.

802 changes: 802 additions & 0 deletions DB/xtb/butanol.cosmo

Large diffs are not rendered by default.

538 changes: 538 additions & 0 deletions DB/xtb/butanol.fh

Large diffs are not rendered by default.

709 changes: 709 additions & 0 deletions DB/xtb/butanone.cosmo

Large diffs are not rendered by default.

474 changes: 474 additions & 0 deletions DB/xtb/butanone.fh

Large diffs are not rendered by default.

1,038 changes: 1,038 additions & 0 deletions DB/xtb/butylacetate.cosmo

Large diffs are not rendered by default.

705 changes: 705 additions & 0 deletions DB/xtb/butylacetate.fh

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions DB/xtb/butylbenzene.cosmo

Large diffs are not rendered by default.

816 changes: 816 additions & 0 deletions DB/xtb/butylbenzene.fh

Large diffs are not rendered by default.

273 changes: 273 additions & 0 deletions DB/xtb/carbondisulfide.cosmo

Large diffs are not rendered by default.

169 changes: 169 additions & 0 deletions DB/xtb/carbondisulfide.fh

Large diffs are not rendered by default.

343 changes: 343 additions & 0 deletions DB/xtb/carbontet.cosmo

Large diffs are not rendered by default.

221 changes: 221 additions & 0 deletions DB/xtb/carbontet.fh

Large diffs are not rendered by default.

666 changes: 666 additions & 0 deletions DB/xtb/chlorobenzene.cosmo

Large diffs are not rendered by default.

436 changes: 436 additions & 0 deletions DB/xtb/chlorobenzene.fh

Large diffs are not rendered by default.

361 changes: 361 additions & 0 deletions DB/xtb/chloroform.cosmo

Large diffs are not rendered by default.

232 changes: 232 additions & 0 deletions DB/xtb/chloroform.fh

Large diffs are not rendered by default.

1,007 changes: 1,007 additions & 0 deletions DB/xtb/chlorohexane.cosmo

Large diffs are not rendered by default.

681 changes: 681 additions & 0 deletions DB/xtb/chlorohexane.fh

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions DB/xtb/crs.param_h2o
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
0.30880726
7540.06830745
-1.26119686
15813.08917624
0.00845974
16.58382447
-0.23040291
-0.13909842
-10.60951107
0.00000000
10 changes: 10 additions & 0 deletions DB/xtb/crs.param_h2o_old
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
0.26735274
6968.29354476
-0.85997768
16987.81891223
0.00881484
20.09563223
-0.19526441
-0.16800049
-10.80693208
0.00000000
10 changes: 10 additions & 0 deletions DB/xtb/crs.param_h2o_old2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
0.30880726
7540.06830745
-1.26119686
15813.08917624
0.00845974
16.58382447
-0.23040291
-0.13909842
-10.60951107
0.00000000
10 changes: 10 additions & 0 deletions DB/xtb/crs.param_ot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
0.53725564
1977.88495090
1.61721497
2664.61735599
0.00806820
57.11402448
-0.12356319
-0.08426734
-8.41974122
0.00000000
889 changes: 889 additions & 0 deletions DB/xtb/cyclohexane.cosmo

Large diffs are not rendered by default.

595 changes: 595 additions & 0 deletions DB/xtb/cyclohexane.fh

Large diffs are not rendered by default.

855 changes: 855 additions & 0 deletions DB/xtb/cyclohexanone.cosmo

Large diffs are not rendered by default.

570 changes: 570 additions & 0 deletions DB/xtb/cyclohexanone.fh

Large diffs are not rendered by default.

1,271 changes: 1,271 additions & 0 deletions DB/xtb/decalin.cosmo

Large diffs are not rendered by default.

862 changes: 862 additions & 0 deletions DB/xtb/decalin.fh

Large diffs are not rendered by default.

1,534 changes: 1,534 additions & 0 deletions DB/xtb/decane.cosmo

Large diffs are not rendered by default.

1,052 changes: 1,052 additions & 0 deletions DB/xtb/decane.fh

Large diffs are not rendered by default.

1,616 changes: 1,616 additions & 0 deletions DB/xtb/decanol.cosmo

Large diffs are not rendered by default.

1,105 changes: 1,105 additions & 0 deletions DB/xtb/decanol.fh

Large diffs are not rendered by default.

507 changes: 507 additions & 0 deletions DB/xtb/dibromoethane.cosmo

Large diffs are not rendered by default.

334 changes: 334 additions & 0 deletions DB/xtb/dibromoethane.fh

Large diffs are not rendered by default.

1,344 changes: 1,344 additions & 0 deletions DB/xtb/dibutylether.cosmo

Large diffs are not rendered by default.

914 changes: 914 additions & 0 deletions DB/xtb/dibutylether.fh

Large diffs are not rendered by default.

477 changes: 477 additions & 0 deletions DB/xtb/dichloroethane.cosmo

Large diffs are not rendered by default.

315 changes: 315 additions & 0 deletions DB/xtb/dichloroethane.fh

Large diffs are not rendered by default.

804 changes: 804 additions & 0 deletions DB/xtb/diethylether.cosmo

Large diffs are not rendered by default.

537 changes: 537 additions & 0 deletions DB/xtb/diethylether.fh

Large diffs are not rendered by default.

1,050 changes: 1,050 additions & 0 deletions DB/xtb/diisopropylether.cosmo

Large diffs are not rendered by default.

709 changes: 709 additions & 0 deletions DB/xtb/diisopropylether.fh

Large diffs are not rendered by default.

783 changes: 783 additions & 0 deletions DB/xtb/dimethylacetamide.cosmo

Large diffs are not rendered by default.

524 changes: 524 additions & 0 deletions DB/xtb/dimethylacetamide.fh

Large diffs are not rendered by default.

665 changes: 665 additions & 0 deletions DB/xtb/dimethylformamide.cosmo

Large diffs are not rendered by default.

441 changes: 441 additions & 0 deletions DB/xtb/dimethylformamide.fh

Large diffs are not rendered by default.

878 changes: 878 additions & 0 deletions DB/xtb/dimethylpyridine.cosmo

Large diffs are not rendered by default.

586 changes: 586 additions & 0 deletions DB/xtb/dimethylpyridine.fh

Large diffs are not rendered by default.

584 changes: 584 additions & 0 deletions DB/xtb/dimethylsulfoxide.cosmo

Large diffs are not rendered by default.

388 changes: 388 additions & 0 deletions DB/xtb/dimethylsulfoxide.fh

Large diffs are not rendered by default.

1,799 changes: 1,799 additions & 0 deletions DB/xtb/dodecane.cosmo

Large diffs are not rendered by default.

1,239 changes: 1,239 additions & 0 deletions DB/xtb/dodecane.fh

Large diffs are not rendered by default.

535 changes: 535 additions & 0 deletions DB/xtb/ethanol.cosmo

Large diffs are not rendered by default.

353 changes: 353 additions & 0 deletions DB/xtb/ethanol.fh

Large diffs are not rendered by default.

977 changes: 977 additions & 0 deletions DB/xtb/ethoxybenzene.cosmo

Large diffs are not rendered by default.

662 changes: 662 additions & 0 deletions DB/xtb/ethoxybenzene.fh

Large diffs are not rendered by default.

756 changes: 756 additions & 0 deletions DB/xtb/ethylacetate.cosmo

Large diffs are not rendered by default.

504 changes: 504 additions & 0 deletions DB/xtb/ethylacetate.fh

Large diffs are not rendered by default.

921 changes: 921 additions & 0 deletions DB/xtb/ethylbenzene.cosmo

Large diffs are not rendered by default.

617 changes: 617 additions & 0 deletions DB/xtb/ethylbenzene.fh

Large diffs are not rendered by default.

686 changes: 686 additions & 0 deletions DB/xtb/fluorobenzene.cosmo

Large diffs are not rendered by default.

452 changes: 452 additions & 0 deletions DB/xtb/fluorobenzene.fh

Large diffs are not rendered by default.

1,301 changes: 1,301 additions & 0 deletions DB/xtb/fluoroctane.cosmo

Large diffs are not rendered by default.

886 changes: 886 additions & 0 deletions DB/xtb/fluoroctane.fh

Large diffs are not rendered by default.

1,131 changes: 1,131 additions & 0 deletions DB/xtb/heptane.cosmo

Large diffs are not rendered by default.

770 changes: 770 additions & 0 deletions DB/xtb/heptane.fh

Large diffs are not rendered by default.

2,319 changes: 2,319 additions & 0 deletions DB/xtb/hexadecane.cosmo

Large diffs are not rendered by default.

1,605 changes: 1,605 additions & 0 deletions DB/xtb/hexadecane.fh

Large diffs are not rendered by default.

2,344 changes: 2,344 additions & 0 deletions DB/xtb/hexadecyliodide.cosmo

Large diffs are not rendered by default.

1,617 changes: 1,617 additions & 0 deletions DB/xtb/hexadecyliodide.fh

Large diffs are not rendered by default.

1,013 changes: 1,013 additions & 0 deletions DB/xtb/hexane.cosmo

Large diffs are not rendered by default.

686 changes: 686 additions & 0 deletions DB/xtb/hexane.fh

Large diffs are not rendered by default.

1,070 changes: 1,070 additions & 0 deletions DB/xtb/hexanol.cosmo

Large diffs are not rendered by default.

723 changes: 723 additions & 0 deletions DB/xtb/hexanol.fh

Large diffs are not rendered by default.

680 changes: 680 additions & 0 deletions DB/xtb/iodobenzene.cosmo

Large diffs are not rendered by default.

448 changes: 448 additions & 0 deletions DB/xtb/iodobenzene.fh

Large diffs are not rendered by default.

789 changes: 789 additions & 0 deletions DB/xtb/isobutanol.cosmo

Large diffs are not rendered by default.

530 changes: 530 additions & 0 deletions DB/xtb/isobutanol.fh

Large diffs are not rendered by default.

1,189 changes: 1,189 additions & 0 deletions DB/xtb/isooctane.cosmo

Large diffs are not rendered by default.

806 changes: 806 additions & 0 deletions DB/xtb/isooctane.fh

Large diffs are not rendered by default.

666 changes: 666 additions & 0 deletions DB/xtb/isopropanol.cosmo

Large diffs are not rendered by default.

445 changes: 445 additions & 0 deletions DB/xtb/isopropanol.fh

Large diffs are not rendered by default.

1,024 changes: 1,024 additions & 0 deletions DB/xtb/isopropylbenzene.cosmo

Large diffs are not rendered by default.

694 changes: 694 additions & 0 deletions DB/xtb/isopropylbenzene.fh

Large diffs are not rendered by default.

1,167 changes: 1,167 additions & 0 deletions DB/xtb/isopropyltoluene.cosmo

Large diffs are not rendered by default.

793 changes: 793 additions & 0 deletions DB/xtb/isopropyltoluene.fh

Large diffs are not rendered by default.

849 changes: 849 additions & 0 deletions DB/xtb/mcresol.cosmo

Large diffs are not rendered by default.

573 changes: 573 additions & 0 deletions DB/xtb/mcresol.fh

Large diffs are not rendered by default.

1,051 changes: 1,051 additions & 0 deletions DB/xtb/mesitylene.cosmo

Large diffs are not rendered by default.

709 changes: 709 additions & 0 deletions DB/xtb/mesitylene.fh

Large diffs are not rendered by default.

728 changes: 728 additions & 0 deletions DB/xtb/methoxyethanol.cosmo

Large diffs are not rendered by default.

489 changes: 489 additions & 0 deletions DB/xtb/methoxyethanol.fh

Large diffs are not rendered by default.

358 changes: 358 additions & 0 deletions DB/xtb/methylenechloride.cosmo

Large diffs are not rendered by default.

232 changes: 232 additions & 0 deletions DB/xtb/methylenechloride.fh

Large diffs are not rendered by default.

538 changes: 538 additions & 0 deletions DB/xtb/methylformamide.cosmo

Large diffs are not rendered by default.

353 changes: 353 additions & 0 deletions DB/xtb/methylformamide.fh

Large diffs are not rendered by default.

760 changes: 760 additions & 0 deletions DB/xtb/nitrobenzene.cosmo

Large diffs are not rendered by default.

502 changes: 502 additions & 0 deletions DB/xtb/nitrobenzene.fh

Large diffs are not rendered by default.

584 changes: 584 additions & 0 deletions DB/xtb/nitroethane.cosmo

Large diffs are not rendered by default.

389 changes: 389 additions & 0 deletions DB/xtb/nitroethane.fh

Large diffs are not rendered by default.

468 changes: 468 additions & 0 deletions DB/xtb/nitromethane.cosmo

Large diffs are not rendered by default.

309 changes: 309 additions & 0 deletions DB/xtb/nitromethane.fh

Large diffs are not rendered by default.

1,390 changes: 1,390 additions & 0 deletions DB/xtb/nonane.cosmo

Large diffs are not rendered by default.

950 changes: 950 additions & 0 deletions DB/xtb/nonane.fh

Large diffs are not rendered by default.

1,479 changes: 1,479 additions & 0 deletions DB/xtb/nonanol.cosmo

Large diffs are not rendered by default.

1,008 changes: 1,008 additions & 0 deletions DB/xtb/nonanol.fh

Large diffs are not rendered by default.

1,267 changes: 1,267 additions & 0 deletions DB/xtb/octane.cosmo

Large diffs are not rendered by default.

863 changes: 863 additions & 0 deletions DB/xtb/octane.fh

Large diffs are not rendered by default.

1,342 changes: 1,342 additions & 0 deletions DB/xtb/octanol.cosmo

Large diffs are not rendered by default.

912 changes: 912 additions & 0 deletions DB/xtb/octanol.fh

Large diffs are not rendered by default.

667 changes: 667 additions & 0 deletions DB/xtb/odichlorobenzene.cosmo

Large diffs are not rendered by default.

442 changes: 442 additions & 0 deletions DB/xtb/odichlorobenzene.fh

Large diffs are not rendered by default.

862 changes: 862 additions & 0 deletions DB/xtb/onitrotoluene.cosmo

Large diffs are not rendered by default.

576 changes: 576 additions & 0 deletions DB/xtb/onitrotoluene.fh

Large diffs are not rendered by default.

2,183 changes: 2,183 additions & 0 deletions DB/xtb/pentadecane.cosmo

Large diffs are not rendered by default.

1,509 changes: 1,509 additions & 0 deletions DB/xtb/pentadecane.fh

Large diffs are not rendered by default.

866 changes: 866 additions & 0 deletions DB/xtb/pentane.cosmo

Large diffs are not rendered by default.

582 changes: 582 additions & 0 deletions DB/xtb/pentane.fh

Large diffs are not rendered by default.

948 changes: 948 additions & 0 deletions DB/xtb/pentanol.cosmo

Large diffs are not rendered by default.

638 changes: 638 additions & 0 deletions DB/xtb/pentanol.fh

Large diffs are not rendered by default.

747 changes: 747 additions & 0 deletions DB/xtb/perfluorobenzene.cosmo

Large diffs are not rendered by default.

501 changes: 501 additions & 0 deletions DB/xtb/perfluorobenzene.fh

Large diffs are not rendered by default.

1,156 changes: 1,156 additions & 0 deletions DB/xtb/phenylether.cosmo

Large diffs are not rendered by default.

786 changes: 786 additions & 0 deletions DB/xtb/phenylether.fh

Large diffs are not rendered by default.

673 changes: 673 additions & 0 deletions DB/xtb/propanol.cosmo

Large diffs are not rendered by default.

447 changes: 447 additions & 0 deletions DB/xtb/propanol.fh

Large diffs are not rendered by default.

626 changes: 626 additions & 0 deletions DB/xtb/pyridine.cosmo

Large diffs are not rendered by default.

409 changes: 409 additions & 0 deletions DB/xtb/pyridine.fh

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions DB/xtb/rewrite_cosmo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/python3

# Read .cosmo file and write a fortran file with the same data

import sys

# Break each line after every 120 characters
def break_lines(string):
if (len(string) < 132):
return string
new_string = ""
for i in range(0, len(string), 120):
new_string += string[i:i+120] + "&\n&"
return new_string[:-3]
# Read the file
with open(sys.argv[1], 'r') as f:
lines = f.readlines()

solvent = sys.argv[1].split('.')[0]

# Read area
area=0
for line in lines:
if "area" in line:
area = float(line.split('=')[1])
break
# Read volume (if it exists)
volume=0
for line in lines:
if "volume" in line:
volume = float(line.split('=')[1])
break
# Read COSMO energy
energy=0
for line in lines:
if "Total energy [a.u.]" in line:
energy = float(line.split('=')[1])
break

print(area, volume, energy)

# Read atom information
aid = []
axyz = []
aelement = []
i=0
while True:
if "#atom" in lines[i]:
break
i+=1
i+=1
tmp_element=""
while 'coord_car' not in lines[i]:
aid.append(int(lines[i].split()[0]))
axyz.append([float(lines[i].split()[1]), float(lines[i].split()[2]), float(lines[i].split()[3])])
tmp_element=lines[i].split()[4].lower()
if len(tmp_element) == 1:
tmp_element=tmp_element+" "
aelement.append(tmp_element)
i+=1

# Read segment information
su = []
sid = []
sarea = []
sxyz = []
spot = []
while True:
if "segment_information" in lines[i]:
break
i+=1
i+=11
while i < len(lines):
sid.append(int(lines[i].split()[1]))
sxyz.append([float(lines[i].split()[2]), float(lines[i].split()[3]), float(lines[i].split()[4])])
sarea.append(float(lines[i].split()[6]))
su.append(float(lines[i].split()[7]))
spot.append(float(lines[i].split()[8]))
i+=1

# Write the file
with open(solvent+".fh", 'w') as f:
f.write("!>COSMO file for "+solvent+" from xtb\n")
f.write(break_lines("real(wp), parameter :: area_"+solvent+"_xtb = "+str(area)+", volume_"+solvent+"_xtb = "+str(volume)+", energy_"+solvent+"_xtb = "+str(energy)+"\n"))
f.write(break_lines("integer, parameter, dimension("+str(len(aid))+") :: aid_"+solvent+"_xtb = (/ "+str(aid)[1:-1]+" /)\n"))
f.write(break_lines("real(wp), parameter, dimension("+str(len(aid))+",3) :: axyz_"+solvent+"_xtb = reshape(btoa*(/ "+str(axyz)[1:-1]+" /), shape(axyz_"+solvent+"_xtb),order=(/2,1/))\n"))
f.write(break_lines("character(len=2), parameter, dimension("+str(len(aid))+") :: aelement_"+solvent+"_xtb = (/ "+str(aelement)[1:-1]+" /)\n"))
f.write(break_lines("integer, parameter, dimension("+str(len(sid))+") :: sid_"+solvent+"_xtb = (/ "+str(sid)[1:-1]+" /)\n"))
f.write(break_lines("real(wp), parameter, dimension("+str(len(sid))+",3) :: sxyz_"+solvent+"_xtb = reshape(btoa*(/ "+str(sxyz)[1:-1]+" /), shape(sxyz_"+solvent+"_xtb),order=(/2,1/))\n"))
f.write(break_lines("real(wp), parameter, dimension("+str(len(sid))+") :: sarea_"+solvent+"_xtb = (/ "+str(sarea)[1:-1]+" /)\n"))
f.write(break_lines("real(wp), parameter, dimension("+str(len(sid))+") :: su_"+solvent+"_xtb = (/ "+str(su)[1:-1]+" /)\n"))
f.write(break_lines("real(wp), parameter, dimension("+str(len(sid))+") :: spot_"+solvent+"_xtb = (/ "+str(spot)[1:-1]+" /)\n"))


Loading