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

Add initial support of LLVMFlang #1207

Merged
merged 5 commits into from
Mar 5, 2025
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: 2 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(bounds "-check all -fpe0")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI")
set(dialects "-Mbackslash -Mallocatable=03 -r8 -traceback")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang")
set(dialects "-fdefault-real-8 -fdefault-double-8")
endif()

# Customize compiler flags
Expand Down
3 changes: 1 addition & 2 deletions src/gfnff/gfnff_eg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3274,8 +3274,7 @@ subroutine batmgfnff_eg(n,iat,jat,kat,iTrj,iTrk,at,xyz,q,sqrab,srab,energy,g,ds,
real*8 r2ij,r2jk,r2ik,c9,mijk,imjk,ijmk,rijk3,ang,angr9,rav3
real*8 rij(3),rik(3),rjk(3),ri(3),rj(3),rk(3),drij,drik,drjk,dang,ff,fi,fj,fk,fqq
parameter (fqq=3.0d0)
integer :: linij,linik,linjk,lina,i,j,iTrDum,dm1,dm2
lina(i,j)=min(i,j)+max(i,j)*(max(i,j)-1)/2
integer :: linij,linik,linjk,i,j,iTrDum,dm1,dm2

fi=(1.d0-fqq*q(iat))
fi=min(max(fi,-4.0d0),4.0d0)
Expand Down
38 changes: 19 additions & 19 deletions src/main/json.F90
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%nb(:, j, 1) ! open nb entry
write (iunit, '("],")') ! close nb entry
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') neigh%nb(:, n, 1)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%nb(:, n, 1)
write (iunit, '("]")')
else ! periodic boundary conditions
do i = 1, neigh%numctr - 1 ! iterate over all cells
Expand All @@ -382,7 +382,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%nb(:, j, i)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') neigh%nb(:, n, i)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%nb(:, n, i)
write (iunit, '("]")')
write (iunit, '(3x,"],")') ! close cell
end do
Expand All @@ -391,7 +391,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%nb(:, j, neigh%numctr)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') neigh%nb(:, n, neigh%numctr)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%nb(:, n, neigh%numctr)
write (iunit, '("]")')
write (iunit, '(3x,"]")') ! close last cell
end if
Expand All @@ -405,7 +405,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%bpair(:, i, 1) ! open entry
write (iunit, '("],")') ! close entry
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') neigh%bpair(:, n, 1)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%bpair(:, n, 1)
write (iunit, '("]")')
else ! periodic boundary conditions
do i = 1, neigh%numctr - 1 ! iterate over all cells
Expand All @@ -414,7 +414,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%bpair(:, j, i)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') neigh%bpair(:, n, i)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%bpair(:, n, i)
write (iunit, '("]")')
write (iunit, '(3x,"],")') ! close cell
end do
Expand All @@ -423,7 +423,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%bpair(:, j, neigh%numctr)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') neigh%bpair(:, n, neigh%numctr)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') neigh%bpair(:, n, neigh%numctr)
write (iunit, '("]")')
write (iunit, '(3x,"]")') ! close last cell
end if
Expand All @@ -435,7 +435,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i8,:,","))', advance='no') topo%alist(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i8,:,","),"]",/)', advance='no') topo%alist(:, topo%nangl)
write (iunit, '(3x,"[",*(i8,:,","))', advance='no') topo%alist(:, topo%nangl)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand All @@ -445,7 +445,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i8,:,","))', advance='no') neigh%blist(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i8,:,","),"]",/)', advance='no') neigh%blist(:, neigh%nbond)
write (iunit, '(3x,"[",*(i8,:,","))', advance='no') neigh%blist(:, neigh%nbond)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand All @@ -455,7 +455,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i8,:,","))', advance='no') topo%tlist(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i8,:,","),"]",/)', advance='no') topo%tlist(:, topo%ntors)
write (iunit, '(3x,"[",*(i8,:,","))', advance='no') topo%tlist(:, topo%ntors)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand All @@ -465,7 +465,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') topo%vtors(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(f25.15,:,","),"]",/)', advance='no') topo%vtors(:, topo%ntors)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') topo%vtors(:, topo%ntors)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand All @@ -475,7 +475,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') topo%vbond(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(f25.15,:,","),"]",/)', advance='no') topo%vbond(:, neigh%nbond)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') topo%vbond(:, neigh%nbond)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand All @@ -485,7 +485,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') topo%vangl(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(f25.15,:,","),"]",/)', advance='no') topo%vangl(:, topo%nangl)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') topo%vangl(:, topo%nangl)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand All @@ -496,7 +496,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') nlist%hblist1(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') nlist%hblist1(:, nlist%nhb1)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') nlist%hblist1(:, nlist%nhb1)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
else
Expand All @@ -511,7 +511,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') nlist%hblist2(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') nlist%hblist2(:, nlist%nhb2)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') nlist%hblist2(:, nlist%nhb2)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
else
Expand All @@ -526,7 +526,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') nlist%hblist3(:, j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(i7,:,","),"]",/)', advance='no') nlist%hblist3(:, nlist%nxb)
write (iunit, '(3x,"[",*(i7,:,","))', advance='no') nlist%hblist3(:, nlist%nxb)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
else
Expand All @@ -541,7 +541,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%hbe1(j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(f25.15,:,","),"]",/)', advance='no') nlist%hbe1(nlist%nhb1)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%hbe1(nlist%nhb1)
write (iunit, '("]")')
write (iunit, '(3x,"],")')

Expand All @@ -550,7 +550,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%hbe2(j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(f25.15,:,","),"]",/)', advance='no') nlist%hbe2(nlist%nhb2)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%hbe2(nlist%nhb2)
write (iunit, '("]")')
write (iunit, '(3x,"],")')

Expand All @@ -559,7 +559,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%hbe3(j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(f25.15,:,","),"]",/)', advance='no') nlist%hbe3(nlist%nxb)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%hbe3(nlist%nxb)
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand All @@ -569,7 +569,7 @@ subroutine write_json_gfnff_lists(n, etot, gnorm, topo, neigh, nlist, printTopo)
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%q(j)
write (iunit, '("],")')
end do
write (iunit, '(3x,"[",*(f25.15,:,","),"]",/)', advance='no') nlist%q(size(nlist%q))
write (iunit, '(3x,"[",*(f25.15,:,","))', advance='no') nlist%q(size(nlist%q))
write (iunit, '("]")')
write (iunit, '(3x,"],")')
end if
Expand Down
6 changes: 3 additions & 3 deletions src/scc_core.f90
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ pure function shellPoly(iPoly,jPoly,iRad,jRad,xyz1,xyz2)
real(wp) :: shellPoly
real(wp) :: rab,k1,rr,r,rf1,rf2,dx,dy,dz,a

a=0.5 ! R^a dependence 0.5 in GFN1
a=0.5_wp ! R^a dependence 0.5 in GFN1

dx=xyz1(1)-xyz2(1)
dy=xyz1(2)-xyz2(2)
Expand All @@ -716,8 +716,8 @@ pure function shellPoly(iPoly,jPoly,iRad,jRad,xyz1,xyz2)

r=rab/rr

rf1=1.0d0+0.01*iPoly*r**a
rf2=1.0d0+0.01*jPoly*r**a
rf1=1.0d0+0.01_wp*iPoly*r**a
rf2=1.0d0+0.01_wp*jPoly*r**a

shellPoly= rf1*rf2

Expand Down
4 changes: 2 additions & 2 deletions test/unit/test_docking.f90
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ subroutine test_dock_wat_wat_gfn2_wall(error)
maxwalls=3
call init_walls
spherepot_type = p_type_polynomial
call set_sphere_radius([6.7,4.7,3.8],[0.0,0.0,0.0],3,[1,2,3]) !"solute"
call set_sphere_radius([6.9,5.7,5.2],[0.0,0.0,0.0]) !"all"
call set_sphere_radius([6.7_wp,4.7_wp,3.8_wp],[0.0_wp,0.0_wp,0.0_wp],3,[1,2,3]) !"solute"
call set_sphere_radius([6.9_wp,5.7_wp,5.2_wp],[0.0_wp,0.0_wp,0.0_wp]) !"all"

call env%checkpoint("Initializing xtb-IFF failed.")

Expand Down