Hi,<div><br /></div><div>I was looking at the source code of the qmmm module of cp2k and trying to understand how IMOMM link scheme is implemented. But I was confused by this subroutine in qmmm_links_methods.F:</div><div> </div><div>Why are Index1 and Index2 assigned to the same index in "added_charges%add_env(i)%Index1"? Would not the last statement wash what the statement above it put in "particles(Index2)%f"?</div><div><br /></div><div>Thanks!<br /><br />Regards,<br /><br />Xianyuan<br /></div><div><br /></div><div><br /></div><div><div style="color: rgb(171, 178, 191); background-color: rgb(35, 39, 46); font-family: "FiraCode Nerd Font Mono", Consolas, "Courier New", monospace, Consolas, "Courier New", monospace; line-height: 19px; white-space: pre;"><div><span style="color: rgb(127, 132, 142); font-style: italic;">! **************************************************************************************************</span></div><div><span style="color: rgb(127, 132, 142); font-style: italic;">!> \brief correct the forces due to the added charges in qm/mm link scheme</span></div><div><span style="color: rgb(127, 132, 142); font-style: italic;">!> \param qmmm_env ...</span></div><div><span style="color: rgb(127, 132, 142); font-style: italic;">!> \param particles ...</span></div><div><span style="color: rgb(127, 132, 142); font-style: italic;">!> \par History</span></div><div><span style="color: rgb(127, 132, 142); font-style: italic;">!> 01.2005 created [tlaino]</span></div><div><span style="color: rgb(127, 132, 142); font-style: italic;">!> \author Teodoro Laino</span></div><div><span style="color: rgb(127, 132, 142); font-style: italic;">! **************************************************************************************************</span></div><div> <span style="color: rgb(198, 120, 221);">SUBROUTINE</span> <span style="color: rgb(97, 175, 239); font-weight: bold;">qmmm_added_chrg_forces</span>(<span style="color: rgb(224, 108, 117); font-style: italic;">qmmm_env</span>, <span style="color: rgb(224, 108, 117); font-style: italic;">particles</span>)</div><div> <span style="color: rgb(198, 120, 221);">TYPE</span>(<span style="color: rgb(229, 192, 123);">qmmm_env_qm_type</span>), <span style="color: rgb(198, 120, 221);">POINTER</span> :: qmmm_env</div><div> <span style="color: rgb(198, 120, 221);">TYPE</span>(<span style="color: rgb(229, 192, 123);">particle_type</span>), <span style="color: rgb(198, 120, 221);">DIMENSION</span>(:), <span style="color: rgb(198, 120, 221);">POINTER</span> :: particles</div><br /><div> <span style="color: rgb(198, 120, 221);">INTEGER</span> :: I, Index1, Index2</div><div> <span style="color: rgb(198, 120, 221);">REAL</span>(<span style="color: rgb(224, 108, 117); font-style: italic;">KIND</span><span style="color: rgb(86, 182, 194);">=</span>dp) :: alpha</div><div> <span style="color: rgb(198, 120, 221);">TYPE</span>(<span style="color: rgb(229, 192, 123);">add_set_type</span>), <span style="color: rgb(198, 120, 221);">POINTER</span> :: added_charges</div><br /><div> added_charges <span style="color: rgb(198, 120, 221);">=></span> qmmm_env<span style="color: rgb(198, 120, 221);">%</span>added_charges</div><br /><div> <span style="color: rgb(198, 120, 221);">DO</span> i <span style="color: rgb(86, 182, 194);">=</span> <span style="color: rgb(209, 154, 102);">1</span>, added_charges<span style="color: rgb(198, 120, 221);">%</span>num_mm_atoms</div><div> Index1 <span style="color: rgb(86, 182, 194);">=</span> added_charges<span style="color: rgb(198, 120, 221);">%</span>add_env(i)<span style="color: rgb(198, 120, 221);">%</span>Index1</div><div> Index2 <span style="color: rgb(86, 182, 194);">=</span> added_charges<span style="color: rgb(198, 120, 221);">%</span>add_env(i)<span style="color: rgb(198, 120, 221);">%</span>Index1</div><div> alpha <span style="color: rgb(86, 182, 194);">=</span> added_charges<span style="color: rgb(198, 120, 221);">%</span>add_env(i)<span style="color: rgb(198, 120, 221);">%</span>alpha</div><div> particles(Index1)<span style="color: rgb(198, 120, 221);">%</span>f <span style="color: rgb(86, 182, 194);">=</span> particles(Index1)<span style="color: rgb(198, 120, 221);">%</span>f + alpha*added_charges<span style="color: rgb(198, 120, 221);">%</span>added_particles(i)<span style="color: rgb(198, 120, 221);">%</span>f</div><div> particles(Index2)<span style="color: rgb(198, 120, 221);">%</span>f <span style="color: rgb(86, 182, 194);">=</span> particles(Index2)<span style="color: rgb(198, 120, 221);">%</span>f + (<span style="color: rgb(209, 154, 102);">1.0_dp</span> - alpha)*added_charges<span style="color: rgb(198, 120, 221);">%</span>added_particles(i)<span style="color: rgb(198, 120, 221);">%</span>f</div><div> <span style="color: rgb(198, 120, 221);">END DO</span></div><br /><div> <span style="color: rgb(198, 120, 221);">END SUBROUTINE</span> <span style="color: rgb(97, 175, 239); font-weight: bold;">qmmm_added_chrg_forces</span></div><br /></div></div><div style="color: rgb(171, 178, 191); background-color: rgb(35, 39, 46); font-family: "FiraCode Nerd Font Mono", Consolas, "Courier New", monospace, Consolas, "Courier New", monospace; line-height: 19px; white-space: pre;"><br /></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "cp2k" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:cp2k+unsubscribe@googlegroups.com">cp2k+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/cp2k/f48baff0-c8f5-4596-9f29-de7c07158e6bn%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/cp2k/f48baff0-c8f5-4596-9f29-de7c07158e6bn%40googlegroups.com</a>.<br />