Parse data files produced by program DelPhi (version 4).
DelPhi writes potential to a 3D lattice grid file, with extension '.phi'. The format of the file is binary, and LittleEndian encoding of multibyte values is used (at least on Linux). Each (Fortran) Write command appends the listed variable data in given format to the file. The written data has both before and after four bytes which contain the number of bytes (as uint*4) used for the data itself.
Write character*20 uplbl Write character*10 nxtlbl, character*60 toplbl Write real*4 phi(igrid,igrid,igrid) Write character*16 botlbl Write real*4 scale,oldmid(3), integer*4 igrid
x = (IX - middle)/scale + oldmid(1) y = (IY - middle)/scale + oldmid(2) z = (IZ - middle)/scale + oldmid(3)where middle = (igrid+1)/2 is the middle point of the grid and the point indices range from 1 to igrid, inclusive. Index order x,y,z corresponds to iteration order:
do IZ = 1,igrid do IY = 1,igrid do IX = 1,igrid write phi(IX,IY,IZ) end do end do end do
The writing of grid to .phi file has been implemented, but has certain limitations. The format requires an orthogonal cube with common spacing and lattice point count on all dimensions. Thus, only grids meeting these criteria are written out. The lattice points written out are those determined by the "limits" specified for the grid. By default, the "limits" encompass the whole grid. Since the igrid value must be odd and same for each dimension, this initial implementation chooses the smallest range from the three dimensions and then ensures that the value is odd. Thus, the result may be a subgrid substantially smaller in the file than the limits.
There are no configurable options at this moment.