xraypy/feff85exafs — pull request #16 by bruceravel (2014-09-16 18:16:30+00:00)
Title: restructuring genfmt

In this pull request, I have begun working towards the goal of having a callable, wrap-able version of genfmt. While not there, this PR represents significant progress.

* All dependence on common blocks is removed from everything in the GENFMT folder. Data is passed through argument lists -- sometimes quite lengthy argument lists

* Several parts of genfmt.f (and FF2X/feffdt.f) have been abstracted out into separate subroutines living in separate files

* The program `onepath` was written. This takes three json files along with the `phase.bin` file as input and writes out a single `feffNNNN.dat` file or its equivalent in the form of a JSON file
* `phase.bin`, `genfmt.json` (formerly `mod5.inp`), and `global.dat` are written by earlier Feff modules.
* `onepath.json` represents a single paragraph from `paths.dat` and looks something like this (this a triangle path, ipath=4, among first & second shell atoms in in copper metal):
```json
{
"index": 4,
"nleg": 3,
"deg": 48.0,
"atom1": [ 0.000000, 0.000000, -3.610000, 1],
"atom2": [-1.805000, 0.000000, -1.805000, 1],
"atom3": [ 0.000000, 0.000000, 0.000000, 0],
"nnnn_out": true,
"json_out": true
}
```

* The `SConstruct` file was modified to make `libgenfmt.a` and `onepath` along with the `genfmt` program.

`onepath` is, functionally, a combination of `GENFMT/genfmt.f` and `FF2X/feffdt.f`. That is, it both calculates the constituents of an individual path and exports them in the familiar form encapsulated in a `feffNNNN.dat` file. It does **not** write to the `feff.bin` file, which normal Feff uses as an intermediate between GENFMT and FF2X.

`onepath` is a proof of concept or, perhaps, a resting point on the way to a proper library. Before moving on to making a proper library and its C wrapper, I intend to supplement the testing framework to do tests on the output of `onepath`. So far, in very limited testing, it seems to work transparently.