ESP module source code questions


Clicked A Few Times
I have read the "esp_grid.F" file's source code in NWCHEM 6.0. And I want to know what are the meaning of "mgrid", "ngrid", "dble" and "xmin"? Parts of the source code in "esp_grid.F" file is as follow:

c
c determine actual number of grid points
c
     if(me.eq.0) then
rcut2=rcut*rcut
ngrid=1
do 1 iz=0,mgrid(3)+1
do 2 iy=0,mgrid(2)+1
do 3 ix=0,mgrid(1)+1
g(1,ngrid)=xmin(1)-rcut+dble(ix)*spac
g(2,ngrid)=xmin(2)-rcut+dble(iy)*spac
g(3,ngrid)=xmin(3)-rcut+dble(iz)*spac

Forum Vet
If you would search for these terms in the esp directory you will see where they are defined and you can figure out what they are. Also, the answers to the previous question you asked on this forum ( http://nwchemgit.github.io/Special_AWCforum/st/id685/NWCHEM_esp_plt_file_format.ht... ) gives you practically all the answers as these are the same variables written to the plt file.

mgrid = number of grad points in each direction

ngrid = is a counter over the grid points (see how it is incremented through the loop structure)

xmin = defines one corner of the cube of grid points

For dble, you should open a Fortran book, still is a standard function.

Bert



Quote:Lmyiop Nov 29th 4:33 am
I have read the "esp_grid.F" file's source code in NWCHEM 6.0. And I want to know what are the meaning of "mgrid", "ngrid", "dble" and "xmin"? Parts of the source code in "esp_grid.F" file is as follow:

c
c determine actual number of grid points
c
     if(me.eq.0) then
rcut2=rcut*rcut
ngrid=1
do 1 iz=0,mgrid(3)+1
do 2 iy=0,mgrid(2)+1
do 3 ix=0,mgrid(1)+1
g(1,ngrid)=xmin(1)-rcut+dble(ix)*spac
g(2,ngrid)=xmin(2)-rcut+dble(iy)*spac
g(3,ngrid)=xmin(3)-rcut+dble(iz)*spac[/quote]

Forum Regular
Hi Lmyiop,
As far as I can tell these entities mean the following

  • ngrid - the number of grid points (it tries to work that out in the ocde included in your message)
  • mgrid - the maximum number of grid points in the x,y,z directions based on the dimensions of your box and the grid spacing (set up in esp_getx.F)
  • dble - an intrinsic Fortran function to convert an integer to a double precision floating point number
  • xmin - the lower limit of the x,y,z coordinate of the box. I.e. if your box is defined by -1.0 < x < 10, 2.0 < y < 5.0 and -3.0 < z < -2.0 then xmin is (-1.0,2.0,-3.0) similarly xmax will be (10.0,5.0,-2.0).

I hope this helps, Huub


Forum >> NWChem's corner >> General Topics