From 018cc325c1ed11f4386478404acff305762cb1d4 Mon Sep 17 00:00:00 2001 From: Vikrant Tripathy Date: Fri, 15 Nov 2024 14:18:26 -0800 Subject: [PATCH] datafile name need not be default, can be user input --- src/modules/quick_files_module.f90 | 23 ++++++++++++++++++++++- src/read_job_and_atom.f90 | 13 +++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/modules/quick_files_module.f90 b/src/modules/quick_files_module.f90 index 40c46065..b08c0739 100644 --- a/src/modules/quick_files_module.f90 +++ b/src/modules/quick_files_module.f90 @@ -128,6 +128,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 @@ -272,7 +294,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 diff --git a/src/read_job_and_atom.f90 b/src/read_job_and_atom.f90 index c05f3f9e..42cd7366 100644 --- a/src/read_job_and_atom.f90 +++ b/src/read_job_and_atom.f90 @@ -49,7 +49,15 @@ 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 @@ -65,7 +73,8 @@ subroutine read_job_and_atom(ierr) ! 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