amber-developers: Stack changes (lots of changes)

From: Michael Crowley <crowley.scripps.edu>
Date: Wed, 16 Nov 2005 14:58:27 -0700

Dear all,
Please update your trees carefully and check out the
new method of using r_stack and i_stack. I think I have
made the changes correctly, but there may be some hidden
bugs.

The idea behind the change was to release us from the lastist/lastrst
restriction, meaning that one can blow the stacks if they are not
estimated correctly. Instead, the current method will make a new and
larger stack when it detects that the stack size is exceeded. Thus we
start with a default stack size of 1 and increase as needed.

There is a new restriction which, as it turns out, was never violated
anyway in the current code so it does not break anything at the moment.
The restriction is that one must start getting stack from a clean stack,
all get's must be in a single routine, and then all must be freed from the
same routine. THe "gotten" stack can be passed into routines as usual. The
catch is that one cannot then allocate more stack from a routine that is
called while the stack is not clean.

One nice result of the changes is that we do not have to pass r_stack all
the way down the line from sander() to wherever it is going to be used.

If you want stack (real or integer), you just add "use stack" to the
routine and also add
  character(kind=1, len=###) :: routine="ROUTINE_NAME"
where ROUTINE_NAME is the name of the routine that will call get_rstack,
get_istack, free_stack, and free_istack, and ### is the length of that
character string.
Then each call to get or free has the added argument "routine"
Look at short_ene.f for an example.

There is debugging available to check for improper calling of the get and
free routines which only developers should use and use when they are
adding, new gets and frees: DEBUG_STACK preprocessor keyword.

Best wishes as always
Mike

 -----------------------------------------------------------------
Physical mail: Dr. Michael F. Crowley
                 Department of Molecular Biology, TPC6
                 The Scripps Research Institute
                 10550 North Torrey Pines Road
                 La Jolla, California 92037

Electronic mail: crowley.scripps.edu
Telephone: 858/784-9290
Fax: 858/784-8688
-----------------------------------------------------------------
Received on Wed Apr 05 2006 - 23:49:48 PDT
Custom Search