diff --git a/src/modules/quick_input_parser_module.f90 b/src/modules/quick_input_parser_module.f90 index 717ae805..173aaec0 100644 --- a/src/modules/quick_input_parser_module.f90 +++ b/src/modules/quick_input_parser_module.f90 @@ -10,6 +10,7 @@ module quick_input_parser_module module procedure read_integer_keyword module procedure read_float_keyword module procedure read_string_keyword + module procedure read_string_endpoints_keyword end interface read contains @@ -146,4 +147,34 @@ subroutine read_string_keyword(line, keyword, val, required) endif end subroutine read_string_keyword + subroutine read_string_endpoints_keyword(line, keyword, i, j, required, found) + implicit none + character(len=*), intent(in) :: line + character(len=*), intent(in) :: keyword + logical, intent(in), optional :: required + integer, intent(out) :: i,j + integer :: ierror + logical, intent(out) :: found + logical :: reqdef !default value of required + + reqdef = .true. + if(present(required)) then + reqdef=required + endif + + call trimSpace(i,j,line,keyword,found) + + if(reqdef .and. .not. found) then + call PrtErr(OUTFILEHANDLE, "Keyword "//trim(keyword)//" needs an input value.") + call quick_exit(OUTFILEHANDLE,1) + endif + + if(found) then + if(ierror/=0) then + call PrtErr(OUTFILEHANDLE, "Error with keyword "//trim(keyword)//" encountered.") + call quick_exit(OUTFILEHANDLE,1) + endif + endif + end subroutine read_string_endpoints_keyword + end module quick_input_parser_module diff --git a/src/modules/quick_method_module.f90 b/src/modules/quick_method_module.f90 index 0159b002..4dc58645 100644 --- a/src/modules/quick_method_module.f90 +++ b/src/modules/quick_method_module.f90 @@ -426,7 +426,7 @@ 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 FILE")') + if (self%readPMat) write(io,'(" READ DENSITY MATRIX From DATAFILE")') if (self%writePMat) write(io,'(" WRITE DENSITY MATRIX TO FILE")') if (self%Skip) write(io,'(" SKIPPING SCF CALCULATION")') if (self%readSAD) write(io,'(" READ SAD GUESS FROM FILE")') @@ -529,12 +529,25 @@ 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 + Write(6,*)'dataFileName = ',dataFileName + endif call upcase(keyWD,300) if (index(keyWD,'PDB').ne. 0) self%PDB=.true. @@ -659,7 +672,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,'READ').ne.0) self%readPMat=.true. + if (index(keyWD,'WRITE').ne.0) self%writePMat=.true. if (index(keyWD,'SKIP').ne.0) self%Skip=.true. if (index(keyWD,'EXTCHARGES').ne.0) self%EXTCHARGES=.true. diff --git a/src/read_job_and_atom.f90 b/src/read_job_and_atom.f90 index c05f3f9e..39354134 100644 --- a/src/read_job_and_atom.f90 +++ b/src/read_job_and_atom.f90 @@ -53,11 +53,12 @@ subroutine read_job_and_atom(ierr) 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