Skip to content

Commit

Permalink
Merge pull request #134 from openmopac/jjps-1022-updates
Browse files Browse the repository at this point in the history
October updates from Jimmy Stewart & pre-patch cleanup
  • Loading branch information
godotalgorithm authored Nov 7, 2022
2 parents a692c23 + d1ba809 commit 7e4b992
Show file tree
Hide file tree
Showing 16 changed files with 1,394 additions and 31 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
lscpu | grep "CPU(s): " | awk '{print $2}' > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
lscpu | grep "CPU(s): " | awk '{print $2}' > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
Expand All @@ -97,7 +97,7 @@ jobs:

- name: Cache Intel dependencies
id: cache-intel
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /opt/intel
key: cache-${{ env.IFORT_LINUX_URL }}-${{ env.MKL_LINUX_URL }}
Expand All @@ -111,7 +111,7 @@ jobs:
sudo sh mkl_download.sh -a --silent --eula accept
- name: Clone glibc compatibility library
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: wheybags/glibc_version_header
path: glibc
Expand Down Expand Up @@ -149,23 +149,24 @@ jobs:
name: linux-test-output
path: build/tests

- name: Local installation test
run: |
cd build
sudo make install
- name: Package MOPAC with CPack
run: |
source /opt/intel/oneapi/setvars.sh
cd build
cpack -G IFW
ls -l
- name: Local installation test & minimal packaging
run: |
cd build
sudo make install
sudo cpack -G TGZ
- name: Save executable as an artifact
uses: actions/upload-artifact@v2
with:
name: linux-dist
path: build/mopac-*-linux.run
path: build/mopac-*-linux.*

mac-build:
runs-on: macos-latest
Expand All @@ -177,7 +178,7 @@ jobs:
system_profiler SPHardwareDataType | grep "Total Number of Cores" | awk '{print $5}' > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
Expand All @@ -195,7 +196,7 @@ jobs:
- name: Cache Intel Fortran compiler
id: cache-intel
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /opt/intel
key: cache-${{ env.IFORT_MAC_URL }}-${{ env.MKL_MAC_URL }}
Expand Down Expand Up @@ -281,7 +282,7 @@ jobs:
WMIC CPU Get NumberOfLogicalProcessors | head -2 | tail -1 > num_cores
echo "NUM_CORES=$(cat num_cores)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
Expand All @@ -294,7 +295,7 @@ jobs:

- name: Cache Intel Fortran compiler
id: cache-intel
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: C:\Program Files (x86)\Intel
key: cache-${{ env.IFORT_WINDOWS_URL }}-${{ env.MKL_WINDOWS_URL }}
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ cff-version: 1.2.0
message: "If you use this software for a scientific publication, please cite it as below."
title: MOPAC
type: software
version: 22.0.4
version: 22.0.5
doi: 10.5281/zenodo.6511958
date-released: 2022-07-08
date-released: 2022-11-07
authors:
- family-names: Stewart
given-names: "James J. P."
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ elseif(WIN32)
elseif(UNIX)
set(CPACK_SYSTEM_NAME "linux")
endif()
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/cmake/CPackOptions.cmake")

# Package the Intel OpenMP library for the QT installer (hard-coded for each OS)
if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
Expand All @@ -291,7 +292,7 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
# resolve symbolic links
get_filename_component(INTEL_OMP_LIB_PATH ${INTEL_OMP_LIB} REALPATH)
message(STATUS "OMP packaging: ${INTEL_OMP_LIB} -> ${INTEL_OMP_LIB_PATH}")
install(FILES ${INTEL_OMP_LIB_PATH} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT qtifw EXCLUDE_FROM_ALL)
install(FILES ${INTEL_OMP_LIB_PATH} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist EXCLUDE_FROM_ALL)
endif()
endif()

Expand All @@ -307,6 +308,9 @@ else()
set(CPACK_IFW_TARGET_DIRECTORY "/opt/mopac")
endif()
install(FILES "${CMAKE_SOURCE_DIR}/.github/mopac.ico" DESTINATION "." COMPONENT qtifw EXCLUDE_FROM_ALL)
install(FILES "${CMAKE_SOURCE_DIR}/CITATION.cff"
"${CMAKE_SOURCE_DIR}/COPYING"
"${CMAKE_SOURCE_DIR}/COPYING.lesser" DESTINATION "." COMPONENT redist EXCLUDE_FROM_ALL)

# Install the executables and library
install(TARGETS mopac RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT main)
Expand All @@ -322,7 +326,7 @@ else()
install(TARGETS mopac-core LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT main)
endif()

# Add packaging
# Add IFW packaging
include(CPack)
include(CPackIFW)
cpack_ifw_configure_component(main DISPLAY_NAME "main program" SORTING_PRIORITY 2 FORCED_INSTALLATION
Expand All @@ -332,3 +336,4 @@ cpack_ifw_configure_component(main DISPLAY_NAME "main program" SORTING_PRIORITY
USER_INTERFACES "${CMAKE_SOURCE_DIR}/.github/pathcheckboxform.ui" "${CMAKE_SOURCE_DIR}/.github/filecheckboxform.ui" "${CMAKE_SOURCE_DIR}/.github/iconcheckboxform.ui")
cpack_ifw_configure_component(extra DISPLAY_NAME "extra utilities" SORTING_PRIORITY 1 DEFAULT FALSE)
cpack_ifw_configure_component(qtifw VIRTUAL FORCED_INSTALLATION)
cpack_ifw_configure_component(redist VIRTUAL FORCED_INSTALLATION)
6 changes: 6 additions & 0 deletions cmake/CPackOptions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)

if("${CPACK_GENERATOR}" MATCHES "TGZ")
set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
set(CPACK_COMPONENTS_ALL main extra redist)
endif()
15 changes: 10 additions & 5 deletions src/corrections/gdisp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ subroutine gdisp(r0ab, rs6, alp6, c6ab, s6, s8, mxc, r2r4, rcov, rs8, alp8, dxyz
! based on material provided by Stefan Grimme, University of Muenster, Germany
! v3.1 of the DFTD3 library
!
use common_arrays_C, only: nat, Vab
use molkst_C, only : numat
use common_arrays_C, only: nat, cell_ijk, Vab
use molkst_C, only : numat, l123, l1u, l2u, l3u
implicit none
double precision, parameter :: k1 = 16.d0
integer, parameter :: max_elem = 94, maxc = 5 ! maximum coordination number references per element
Expand All @@ -36,7 +36,7 @@ subroutine gdisp(r0ab, rs6, alp6, c6ab, s6, s8, mxc, r2r4, rcov, rs8, alp8, dxyz
!
! Local variables
!
integer :: i, j, linij
integer :: i, j, linij, iii, jjj, i_cell, j_cell, kkkk
double precision :: R0, r2, damp6, damp8, c6, tmp1, tmp2, r, dc6_rest, rij(3), dc6iji, dc6ijj, r6, r7, t6, t8, &
rcovij, expterm, dcn,x1, r42, r8, r9
double precision, allocatable :: drij(:), dc6i(:)
Expand Down Expand Up @@ -107,8 +107,13 @@ subroutine gdisp(r0ab, rs6, alp6, c6ab, s6, s8, mxc, r2r4, rcov, rs8, alp8, dxyz
dcn = 0.d0
end if
x1 = drij(linij) + dcn*(dc6i(i) + dc6i(j))
dxyz_temp(:,i) = dxyz_temp(:,i) + x1*rij/r
dxyz_temp(:,j) = dxyz_temp(:,j) - x1*rij/r
iii = l123*(i - 1)
jjj = l123*(j - 1)
kkkk = (l3u - cell_ijk(3)) + (2*l3u + 1)*(l2u - cell_ijk(2) + (2*l2u + 1)*(l1u - cell_ijk(1))) + 1
i_cell = iii + kkkk
j_cell = jjj + kkkk
dxyz_temp(:,i_cell) = dxyz_temp(:,i_cell) + x1*rij/r
dxyz_temp(:,j_cell) = dxyz_temp(:,j_cell) - x1*rij/r
end do
end do
return
Expand Down
11 changes: 6 additions & 5 deletions src/input/wrtkey.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ subroutine wrtkey
!
! Do not tidy up allkey earlier in the job, instead fill allkey here from keywrd,
! and do all the tidying up at this one point. The old style of tidying up allkey
! as the job progressed was very error-prone and hadr to debug.
! as the job progressed was very error-prone and hard to debug.
!
allkey = trim(keywrd)
j = 1
Expand All @@ -59,6 +59,9 @@ subroutine wrtkey
do
i = index(allkey, "(")
if (i == 0) exit
if (i > 6) then
if (allkey(i-6:i) == "OUTPUT(") exit
end if
j = index(allkey(i + 1:), ')') + i
allkey(i:j) = " "
end do
Expand Down Expand Up @@ -1462,17 +1465,15 @@ subroutine wrtcon (allkey)
write (iw,'(" * STEP1 - FIRST STEP-SIZE IN GRID =", f7.2)') &
reada (keywrd, Index (keywrd, "STEP1")+6)
if (index(keywrd, " POINT1") == 0) then
write (iw,'("*",/," * - **** KEYWORD POINT1 MISSING ****",/,"*")')
call mopend("KEYWORD POINT1 MISSING")
call l_control("POINT1=11", len_trim("POINT1=11"), 1)
end if
i = 2
end if
if (myword(allkey, " STEP2")) then
write (iw,'(" * STEP2 - SECOND STEP-SIZE IN GRID =", f7.2)') &
reada (keywrd, Index (keywrd, "STEP2")+6)
if (index(keywrd, " POINT2") == 0) then
write (iw,'("*",/," * - **** KEYWORD POINT2 MISSING ****",/,"*")')
call mopend("KEYWORD POINT2 MISSING")
call l_control("POINT2=11", len_trim("POINT2=11"), 1)
end if
end if
if (myword(allkey, " STEP=")) then
Expand Down
2 changes: 1 addition & 1 deletion src/reactions/big_swap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ subroutine l_control(txt, nt, mode)
end do
store = " "
if (mode == 1) then
i = index(keywrd, store(:mt + 2))
i = index(keywrd, store(:mt + 50))
keywrd = keywrd(:i)//line(:mt)//trim(keywrd(i + mt + 1:))
end if
if (local_txt == " ") exit
Expand Down
14 changes: 13 additions & 1 deletion src/reactions/grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ subroutine grid
use chanel_C, only : iw0, iw, iarc, ires, iump, archive_fn, ump_fn, &
restart_fn
!
use common_arrays_C, only : geo, xparam, geoa, &
use common_arrays_C, only : geo, xparam, geoa, labels, coord, &
na, nb, nc, pa, pb, p
!
use elemts_C, only : elemnt
!
use molkst_C, only : nvar, keywrd, tleft, line, norbs, &
natoms, moperr, uhf, numat, mpack, gui
Expand Down Expand Up @@ -359,6 +361,16 @@ subroutine grid
write (iw, "(/' FIRST VARIABLE ', 'SECOND VARIABLE FUNCTION')")
write (iw, "(' :',F16.5,F16.5,F16.6)") geo(lpara1, latom1)*c1, geo(lpara2, latom2)*c2, escf
call geout (iw)
if (index(keywrd, " PRTXYZ") /= 0) then
write (iw, '(29X,''CARTESIAN COORDINATES '',/)')
call gmetry(geo, coord)
l = 0
do i = 1, natoms
if (labels(i) == 99 .or. labels(i) == 107) cycle
l = l + 1
write (iw, '(I4,3X,A2,3x, 3F16.9)') l, elemnt(labels(i)), (coord(k,l),k=1,3)
end do
end if
if (gui) then
if (use_p) then
ij = 0
Expand Down
9 changes: 9 additions & 0 deletions src/reactions/pathk.F90
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ subroutine pathk()
end if
call to_screen("To_file: Reaction path")
call geout (iw)
if (index(keywrd, " PRTXYZ") /= 0) then
write (iw, '(29X,''CARTESIAN COORDINATES '',/)')
l = 0
do i = 1, natoms
if (labels(i) == 99 .or. labels(i) == 107) cycle
l = l + 1
write (iw, '(I4,3X,A2,3x, 3F16.9)') l, elemnt(labels(i)), (coord(k,l),k=1,3)
end do
end if
if (index(keywrd, " PDBOUT") /= 0) then
imodel = imodel + 1
write(line,'(F13.5)') escf
Expand Down
2 changes: 1 addition & 1 deletion src/run_mopac.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ subroutine run_mopac
write (iw, '(3/,'' TOTAL JOB TIME: '',F16.2,'' SECONDS'')') tim
write (iw, '(/,'' == MOPAC DONE =='')')
call fdate (line)
write(0,'(//10x,a,/)')"MOPAC Job: """//trim(job_fn)//""" ended normally on "// &
write(*,'(//10x,a,/)')"MOPAC Job: """//trim(job_fn)//""" ended normally on "// &
line(5:10)//", "//trim(line(21:))//", at"//line(11:16)//"."
!
! Delete files that are definitely not wanted
Expand Down
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ set_tests_properties(salt PROPERTIES DEPENDS ionize) # uses Neutral.mop
add_mopac_test(salt2 "SALT_2.mop")
add_mopac_test(residues "SITE_Individual_residues.mop")
set_tests_properties(residues PROPERTIES DEPENDS ionize) # uses IONIZE.arc
add_mopac_test(erratic-1 "erratic1.mop")
add_mopac_test(erratic-2 "erratic2.mop")
34 changes: 34 additions & 0 deletions tests/erratic1.mop
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
EF PM7 PRECISE T=48H ENPART DISP
Crashed at "Geometry optimization using EF" on a Linux machine

C -2.40330 1 -2.80250 1 0.06670 1
C -1.97490 1 -1.37110 1 0.25670 1
O -2.32280 1 -0.70200 1 1.25220 1
O -1.16670 1 -0.71900 1 -0.67070 1
C -0.75930 1 0.63730 1 -0.49020 1
C -1.36230 1 1.43290 1 -1.60520 1
C -1.10870 1 2.86320 1 -1.61960 1
O -0.48520 1 3.45080 1 -0.72520 1
O -1.59210 1 3.60080 1 -2.69170 1
C 0.72090 1 0.77160 1 -0.47290 1
N 1.39920 1 0.03370 1 0.56020 1
C 1.62120 1 -1.32420 1 0.09310 1
C 2.73740 1 0.62590 1 0.71830 1
C 0.77940 1 0.05150 1 1.84150 1
H -2.79340 1 -2.88280 1 -0.95970 1
H -1.58970 1 -3.48610 1 0.29570 1
H -3.24050 1 -2.97730 1 0.78380 1
H -1.18460 1 0.98460 1 0.46390 1
H -1.13850 1 0.96550 1 -2.61500 1
H -2.48330 1 1.28380 1 -1.48680 1
H 1.14260 1 0.42590 1 -1.45970 1
H 1.00880 1 1.82810 1 -0.38450 1
H 1.39810 1 -2.05510 1 0.87880 1
H 1.01070 1 -1.53930 1 -0.82450 1
H 2.67980 1 -1.49590 1 -0.23160 1
H 3.42440 1 -0.14000 1 1.10820 1
H 3.08560 1 1.07720 1 -0.24810 1
H 2.62480 1 1.42070 1 1.47130 1
H 0.10570 1 0.89260 1 2.03730 1
H 0.30170 1 -0.95410 1 2.00550 1
H 1.56480 1 0.10310 1 2.65230 1
Loading

0 comments on commit 7e4b992

Please sign in to comment.