Re: [AMBER] the meaning of variables used in source file force.f

From: Jason Swails <jason.swails.gmail.com>
Date: Mon, 23 Jul 2012 19:03:28 -0400

On Mon, Jul 23, 2012 at 6:22 PM, Xin Geng <xingeng2011.berkeley.edu> wrote:

>
>
> Dear all,
>
> I need to add new file into source file and use some
> variables in my file. I already read through files force.f and egb.f and
> have some ideas about what the meaning of variables are. In force.f, the
> array 'x' --- the x,y, z coordinates of all the atoms(e.g. for ith atom,
> x(3*i-2),x(3*i-1),x(3*i) are x,y,z coordinates respectively)
>

Yes. In this source file, "x" is the cartesian coordinates of all atoms.
 However, at times "x" is the global real array (see below for more
explanation). Only in the sander subroutine is "x" the 'global real
array', however, and not the coordinate array. Typically, if the variable
"xx" is defined, that is the global real array and "x" is the coordinate
array.


> the integer
> 'natom' --- the number of total atoms
>

Yes.


>
> the integer 'nbona' --- the number
> of bonds
>

Not quite. It is the number of bonds *not* containing hydrogen. nbonh is
the number of bonds containing hydrogen. So the total number of bonds is
the sum of these two.

All of these pointers are described in the prmtop specification here:
http://ambermd.org/formats.html#topology


> but for the arrays 'ix' and 'ih' , I don't understand what
> values they are used to store(seems like 'ix' is for all the bonded atoms
> and 'ih' for names of atoms )
>

I already mentioned the 'global real array' -- ix is the global integer
array and ih is the global 'hollerith' array (basically an array of
4-character strings). The way memory management is done in sander is that
large arrays are allocated at the very beginning of execution, and each
array (such as the various index arrays read from the topology file, the
coordinate array, force array, velocity array, etc.) is defined with an
offset into this global array.

Therefore, "ix" holds all of the integer pointers found in the prmtop, with
each individual pointer array being defined with a particular offset index.

The "ih" is the same idea, but for atom names, residue names, atom types,
etc. (4-character strings) instead of integer or real arrays.

Each sub-array of the large arrays are assigned an index, as I mentioned.
 In the case of atom names, that index is m06, as you mention below.

These global arrays are all set up in the file "locmem.f" and in that file
you will find a description of all of the pointer indexes. All pointer
indexes are defined in a common block in md.h, which must be included in
your new source files if you want access to those pointers.


When I'm working on the code myself, I typically have 3 files handy:
rdparm.f, locmem.f, and the amber prmtop specification. rdparm.f gives you
the connection between the FLAG name from the topology file and the pointer
variable in locmem.f (which is helpful in case the comments describing the
pointer variables are at all ambiguous). The locmem.f file gives you the
description of these pointers that you will find scattered throughout the
code. Finally, the prmtop spec gives you the names of the arrays that
store the various data as well as a description of what these variables do.

Given this information, my suggestion is to poke around, try and understand
what is going on with the code, and be patient -- you'll understand more
each time you work through it.

I hope this has been helpful,
Jason

-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Mon Jul 23 2012 - 16:30:02 PDT
Custom Search