Skip to content

Commit

Permalink
merge with master restart capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
vtripath65 committed Nov 16, 2024
2 parents 8612b60 + de04a40 commit 2b922e9
Show file tree
Hide file tree
Showing 15 changed files with 1,085 additions and 910 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_test_serial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ jobs:
- name: 'Install Dependencies for Serial Version'
run: |
sudo apt-get update
sudo apt-get -y install gfortran
sudo apt-get -y install gfortran parallel
- name: 'Configure Serial Version'
run: ./configure --serial --enablef --prefix $PWD/install gnu
- name: 'Build and Install Serial Version Using 2 Jobs'
run: make -j2 all install
- name: 'Setup Environment Variables for Running Tests'
run: |
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
echo "PARALLEL_TEST_COUNT=2" >> "$GITHUB_ENV"
- name: 'Run Tests for Serial Version (Make)'
run: make fulltest
- name: 'Archive Test Results for Serial Version'
Expand All @@ -45,7 +46,7 @@ jobs:
- name: 'Install Dependencies for Serial Version (CMake)'
run: |
sudo apt-get update
sudo apt-get -y install gfortran cmake
sudo apt-get -y install gfortran cmake parallel
- name: 'Configure Serial Version (CMake)'
run: |
mkdir build
Expand All @@ -59,6 +60,7 @@ jobs:
- name: 'Setup Environment Variables for Running Tests'
run: |
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
echo "PARALLEL_TEST_COUNT=2" >> "$GITHUB_ENV"
- name: 'Run Tests for Serial Version'
run: |
cd install
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# !---------------------------------------------------------------------!
# ! Set version !
# !---------------------------------------------------------------------!
QUICK_VERSION='QUICK-22.03'
QUICK_VERSION='QUICK-24.03'
QUICK_HOME=`pwd`
cdate=`date +'%m/%d/%Y'`
ctime=`date +'%r'`
Expand Down
23 changes: 22 additions & 1 deletion src/modules/quick_files_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,28 @@ subroutine set_quick_files(api,ierr)

end subroutine

subroutine read_data_file(line)
use quick_exception_module
use quick_input_parser_module

implicit none

character line*(*)

call read(line,'$DATA',datafilename)

end subroutine

subroutine print_data_file(io)
implicit none

! pass-in Parameter
integer io

write (io,'("| DATA FILE = ",a)') trim(dataFileName)

end subroutine

subroutine read_basis_file(keywd,ierr)

use quick_exception_module
Expand Down Expand Up @@ -292,7 +314,6 @@ subroutine print_quick_io_file(io,ierr)

write (io,'("| INPUT FILE : ",a)') trim(inFileName)
write (io,'("| OUTPUT FILE: ",a)') trim(outFileName)
write (io,'("| DATA FILE : ",a)') trim(dataFileName)
write (io,'("| BASIS SET PATH: ",a)') trim(basisdir)

return
Expand Down
34 changes: 12 additions & 22 deletions src/modules/quick_method_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ module quick_method_module
logical :: debug = .false. ! debug mode
logical :: nodirect = .false. ! conventional scf
logical :: readDMX = .false. ! flag to read density matrix
logical :: readPMat = .false. ! flag to read density matrix
logical :: writePMat = .false. ! flag to write density matrix
logical :: readden = .false. ! flag to read density matrix
logical :: writeden = .false. ! flag to write density matrix
logical :: readSAD = .true. ! flag to read SAD guess
logical :: writeSAD = .false. ! flag to write SAD guess
logical :: diisSCF = .false. ! DIIS SCF
Expand Down Expand Up @@ -247,8 +247,8 @@ subroutine broadcast_quick_method(self, ierr)
call MPI_BCAST(self%calcDensLap,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%gridspacing,1,mpi_double_precision,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%lapGridSpacing,1,mpi_double_precision,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%readPMat,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%writePMat,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%readden,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%writeden,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%extCharges,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%ext_grid,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
call MPI_BCAST(self%extgrid_angstrom,1,mpi_logical,0,MPI_COMM_WORLD,mpierror)
Expand Down Expand Up @@ -424,8 +424,8 @@ subroutine print_quick_method(self,io,ierr)
if (self%printEnergy) write(io,'(" PRINT ENERGY EVERY CYCLE")')

if (self%readDMX) write(io,'(" READ DENSITY MATRIX FROM FILE")')
if (self%readPMat) write(io,'(" READ DENSITY MATRIX From DATAFILE")')
if (self%writePMat) write(io,'(" WRITE DENSITY MATRIX TO FILE")')
if (self%readden) write(io,'(" READ DENSITY MATRIX From DATAFILE")')
if (self%writeden) write(io,'(" WRITE DENSITY MATRIX TO FILE")')
if (self%readSAD) write(io,'(" READ SAD GUESS FROM FILE")')
if (self%writeSAD) write(io,'(" WRITE SAD GUESS TO FILE")')

Expand Down Expand Up @@ -526,24 +526,12 @@ subroutine read_quick_method(self,keywd,ierr)
use quick_exception_module
use quick_mpi_module
use quick_files_module, only : write_molden
use quick_files_module, only : dataFileName
implicit none
character(len=300) :: keyWD
character(len=300) :: tempstring
integer :: itemp,i,j
type (quick_method_type) self
integer, intent(inout) :: ierr
logical :: found

tempstring = keyWD
call upcase(tempstring,300)
if (index(tempstring,'READPMAT').ne.0)then
self%readPMat=.true.
call read(tempstring, 'READPMAT', i, j, .false., found)
if(found)then
dataFileName = keyWD(i:i+j-2)
endif
endif

call upcase(keyWD,300)
if (index(keyWD,'PDB').ne. 0) self%PDB=.true.
Expand Down Expand Up @@ -668,8 +656,7 @@ subroutine read_quick_method(self,keywd,ierr)
end if
if (index(keyWD,'ZMAKE').ne.0) self%zmat=.true.
if (index(keyWD,'DIPOLE').ne.0) self%dipole=.true.

if (index(keyWD,'WRITE').ne.0) self%writePMat=.true.
if (index(keyWD,'WRITE').ne.0) self%writeden=.true.
if (index(keyWD,'EXTCHARGES').ne.0) self%EXTCHARGES=.true.
if (index(keyWD,'EXTGRID').ne.0) self%ext_grid=.true.
!if (index(keyWD,'EXTGRID_ANGSTROM').ne.0) self%extgrid_angstrom=.true.
Expand All @@ -690,6 +677,9 @@ subroutine read_quick_method(self,keywd,ierr)
endif
endif

!Read density matrix
if (index(keyWD,'READDEN').ne.0) self%readden=.true.

if (self%DFT) then
if (index(keyWD,'SG0').ne.0) then
self%iSG=0
Expand Down Expand Up @@ -908,8 +898,8 @@ subroutine init_quick_method(self,ierr)
self%hasF = .false. ! If f orbitial is contained
self%calcDens = .false. ! calculate density
self%calcDensLap = .false. ! calculate density lap
self%readPMat = .false. ! Input density matrix
self%writePMat = .false. ! Output density matrix
self%readden = .false. ! Input density matrix
self%writeden = .false. ! Output density matrix
self%extCharges = .false. ! external charge
self%ext_grid = .false. ! external grid points
self%extgrid_angstrom = .false. ! external grid points (same as above) output in angstrom
Expand Down
37 changes: 17 additions & 20 deletions src/modules/quick_scf_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ subroutine electdiis(jscf,ierr)
#endif

implicit none

logical fail

logical :: fail
! variable inputed to return
integer :: jscf ! scf iteration
integer, intent(inout) :: ierr
Expand Down Expand Up @@ -269,17 +269,16 @@ subroutine electdiis(jscf,ierr)
if (bMPI) call MPI_setup_hfoperator
!-------------- END MPI / ALL NODE -----------
#endif

if(quick_method%readPMat)then
nbasis = quick_molspec%nbasis
if(master)then
open(unit=iDataFile,file=dataFileName,status='OLD',form='UNFORMATTED')
call rchk_int(iDataFile, "nbasis", nbasis, fail)
call rchk_darray(iDataFile, "dense", nbasis, nbasis, 1, quick_qm_struct%dense, fail)
close(iDataFile)
endif
endif

if(quick_method%readden)then
nbasis = quick_molspec%nbasis
if(master)then
open(unit=iDataFile,file=dataFileName,status='OLD',form='UNFORMATTED')
call rchk_int(iDataFile, "nbasis", nbasis, fail)
call rchk_darray(iDataFile, "dense", nbasis, nbasis, 1, quick_qm_struct%dense, fail)
close(iDataFile)
endif
endif

#ifdef MPIV
if (bMPI) then
! call MPI_BCAST(quick_qm_struct%o,nbasis*nbasis,mpi_double_precision,0,MPI_COMM_WORLD,mpierror)
Expand Down Expand Up @@ -726,17 +725,15 @@ subroutine electdiis(jscf,ierr)
!--------------- END MPI/ALL NODES -------------------------------------

if (master) then
if(quick_method%writepmat)then

if(quick_method%writeden)then
! open data file then write calculated info to dat file
call quick_open(iDataFile, dataFileName, 'R', 'U', 'A',.true.,ierr)
! rewind(iDataFile)
call wchk_int(iDataFile, "nbasis", nbasis, fail)
call wchk_darray(iDataFile, "dense", nbasis, nbasis, 1, quick_qm_struct%dense, fail)
! call wchk_darray(iDataFile, "denseSave", nbasis, nbasis, 1, quick_qm_struct%denseSave, fail)
close(iDataFile)
endif
endif

#ifdef USEDAT
! open data file then write calculated info to dat file
SAFE_CALL(quick_open(iDataFile, dataFileName, 'R', 'U', 'R',.true.,ierr)
Expand Down
24 changes: 23 additions & 1 deletion src/modules/quick_uscf_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ subroutine uelectdiis(jscf,ierr)
#endif

implicit none


logical :: fail

! variable inputed to return
integer :: jscf ! scf iteration
integer, intent(inout) :: ierr
Expand Down Expand Up @@ -235,6 +237,17 @@ subroutine uelectdiis(jscf,ierr)
!-------------- END MPI / ALL NODE -----------
#endif

if(quick_method%readden)then
nbasis = quick_molspec%nbasis
if(master)then
open(unit=iDataFile,file=dataFileName,status='OLD',form='UNFORMATTED')
call rchk_int(iDataFile, "nbasis", nbasis, fail)
call rchk_darray(iDataFile, "dense", nbasis, nbasis, 1, quick_qm_struct%dense, fail)
call rchk_darray(iDataFile, "denseb", nbasis, nbasis, 1, quick_qm_struct%denseb, fail)
close(iDataFile)
endif
endif

#ifdef MPIV
if (bMPI) then
call MPI_BCAST(quick_qm_struct%dense,nbasis*nbasis,mpi_double_precision,0,MPI_COMM_WORLD,mpierror)
Expand Down Expand Up @@ -826,6 +839,15 @@ subroutine uelectdiis(jscf,ierr)

if (master) then

if(quick_method%writeden)then
! open data file then write calculated info to dat file
call quick_open(iDataFile, dataFileName, 'R', 'U', 'A',.true.,ierr)
call wchk_int(iDataFile, "nbasis", nbasis, fail)
call wchk_darray(iDataFile, "dense", nbasis, nbasis, 1, quick_qm_struct%dense, fail)
call wchk_darray(iDataFile, "denseb", nbasis, nbasis, 1, quick_qm_struct%denseb, fail)
close(iDataFile)
endif

#ifdef USEDAT
! open data file then write calculated info to dat file
SAFE_CALL(quick_open(iDataFile, dataFileName, 'R', 'U', 'R',.true.,ierr)
Expand Down
19 changes: 14 additions & 5 deletions src/read_job_and_atom.f90
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,33 @@ subroutine read_job_and_atom(ierr)
do while(.true.)
read (inFile,'(A100)') tempstring
if(trim(tempstring).eq.'') exit
keyWD=trim(keyWD)//' '//trim(tempstring)
if(tempstring(1:1).eq.'$')then
call upcase(tempstring(2:2),4)
if (tempstring(2:5).eq.'DATA')then
! read data file
SAFE_CALL(read_data_file(tempstring))
endif
else
keyWD=trim(keyWD)//' '//trim(tempstring)
endif
end do
endif

call upcase(keyWD,300)
write(iOutFile,'(" KEYWORD=",a)') trim(keyWD)

! These interfaces,"read","check" and "print" are from quick_method_module
SAFE_CALL(read(quick_method,keyWD,ierr)) ! read method from Keyword

write(iOutFile,'(" KEYWORD=",a)') trim(keyWD)
! call upcase(keyWD,300)

call read(quick_qm_struct,keyWD) ! read qm struct from Keyword
call check(quick_method,iOutFile,ierr) ! check the correctness
call print(quick_method,iOutFile,ierr) ! then print method

! read basis file
SAFE_CALL(read_basis_file(keywd,ierr))
call print_basis_file(iOutFile)
if (quick_method%ecp) call print_ecp_file(iOutFile)
call print_data_file(iOutFile)
if (quick_method%ecp) call print_ecp_file(iOutFile)

! If PDB flag is on, then call readPDB to read PDB file and
! rewrite input file so that there will be no difference between
Expand Down
2 changes: 1 addition & 1 deletion src/subs/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ subroutine wchk_darray(chk,key,x,y,z,dim,fail)
! do
! read(chk,end=100,err=200)
! enddo
!

! 100 rewind(chk)
write(chk) '#'//kline(1:40)
write(chk) 'RR'
Expand Down
Loading

0 comments on commit 2b922e9

Please sign in to comment.