QUICK icon indicating copy to clipboard operation
QUICK copied to clipboard

Improve gradient printout

Open agoetz opened this issue 2 years ago • 5 comments

Currently the gradient is printed in a single column and there is a typo, VARIABLES is missing an A.

 ANALYTICAL GRADIENT: 
------------------------
 VARIBLES    NEW_GRAD
------------------------
    1X    -0.0066581453
    1Y    -0.0235117742
    1Z     0.0041963421
    2X     0.0014871380
    2Y     0.0212612260
    2Z    -0.0069824337
...

I suggest to print it by atom. Renaming to ATOM will also fix the typo.

 ANALYTICAL GRADIENT: 
---------------------------------------------------------
   ATOM         X                Y                Z
---------------------------------------------------------
    1    -0.0066581453    -0.0235117742     0.0041963421
    2     0.0014871380     0.0212612260    -0.0069824337
...

I can fix it but I don't know when I find time. It might required updating tests and/or test scripts. If someone works on this please comment and mention others so we don't have two people working on it.

agoetz avatar Feb 20 '23 22:02 agoetz

I can work on this one.

akhilshajan avatar Feb 20 '23 22:02 akhilshajan

Thanks @akhilshajan . @Madu86 please let Akhil know what else we need to keep in mind when changing output format (your test scripts, QUICK tests reference output, Amber tests reference output etc). Thanks.

agoetz avatar Feb 20 '23 22:02 agoetz

Good suggestion but not sure if we want to do this as we approach a release. You will have to change runtest script, reference test output files and file based QM/MM interface in AMBER. @agoetz Can you please confirm the last one? Is this quick_module.f90? Separate reference output files are no longer available for AMBER tests.

Madu86 avatar Feb 21 '23 12:02 Madu86

This is a good point to avoid large changes right before a release. On the other hand more people are starting to use QUICK and it would be good to make changes in output format sooner than later to avoid breaking any interfaces people may write.

agoetz avatar Feb 22 '23 05:02 agoetz

The file based QM/MM interface in AMBER is in qm2_extern_quick_module.F90. Relevant is subroutine read_results(). Specifically, gradients are read in the code block starting at line 544

       ! look for QM gradients and read into dxyzqm                                                               
       if ( do_grad ) then

          if (read_buffer(1:21) == ' ANALYTICAL GRADIENT:' ) then
             do i = 1, 3
		read (iunit, '(a)', iostat = ios) read_buffer
             end do
             do iqm = 1, nqmatoms
                do ixyz = 1, 3
                   read (iunit, '(a)', iostat = ios) read_buffer
                   if (ios < 0) then
                      call sander_bomb('read_results (qm2_extern_quick_module)', &
                           'Error reading Quick output from file '//outfile, &
                           '(Problem reading QM gradient.)')
                   end if
                   read (read_buffer(24:),*) dxyzqm(ixyz,iqm)
                end do
             end do
          end if

       end if

agoetz avatar Feb 22 '23 05:02 agoetz