Re: global does not work in configuration and callback function

From: jc guo (guojc123_at_gmail.com)
Date: Sat Oct 24 2015 - 08:51:33 CDT

Ok, thanks. so is there any simple example that I could test this callback?
I do not know when this will work, if I write "puts stderr $saved_labels"
only in the tcl "proc save_callback {labels values", it done, other proc
can not get anything from this global var.

I have another question, how could I control the dynamics, It seems
unclearly what we got at each steps, if I want to write some tcl codes
based on dynamics, it will be very difficult to get the idea.

2015-10-24 21:30 GMT+08:00 Norman Geist <norman.geist_at_uni-greifswald.de>:

> I also stumbled into this problem a while back. You won’t get reasonable
> energies if you call the callback more often than “outputenergies” allows
> to update the energies actually. ;)
>
>
>
> Norman Geist
>
>
>
> *Von:* owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] *Im
> Auftrag von *jc guo
> *Gesendet:* Samstag, 24. Oktober 2015 08:46
> *An:* namd-l_at_ks.uiuc.edu
> *Betreff:* namd-l: global does not work in configuration and callback
> function
>
>
>
> Dear NAMD users,
>
>
>
> I was testing following codes (taken from replica.namd), I want to get MD
> variables such as $TS, $ENERGY during every MD step, but the "global"
> command seems not work after "callback", I could not print out $saved_label.
>
>
>
> proc save_callback {labels values} {
> global saved_labels saved_values
> set saved_labels $labels
> set saved_values $values
> }
> callback save_callback
>
>
>
> puts stderr $saved_labels
>
>
>
> Anyone know about it? and sometime I was very confused about how to get
> results generated at each MD step.
>
>
>
> Thanks before any reply.
>
>
>
> Best regards,
>
> Jiancang
>

This archive was generated by hypermail 2.1.6 : Tue Dec 27 2016 - 23:21:27 CST