-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
Release CPCM-X
- Loading branch information
There are no files selected for viewing
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 |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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 |
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 |
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 |
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 |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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")) | ||
|
||
|