Extract data from the fplo output file(s)

Usage: grepfplo [-h] -m mode [options] (-p prefix) (-f outfile) ([-a(ll)]) 
          ([-x(fbp)])  ([-xm(grace)]) 

We assume that separate calculations are done in separate directories
and that the directory names contain the running variable value.

prefix: is the prefix string of a bunch of directories, of
	which the data shall be extracted. (Default is . =current directory.)
	The prefix is used to select the directories and is removed from the
	directory name to get the corresponding values;
	E.g. if the directories are named
	M=0.1 M=0.2 M=0.3, the prefix M= will result in a data set
	0.1 data1
	0.2 data2
	0.3 data3
	 where data... is the data actually extracted from the output files. (See below.)
	If the directories are named id=1_M=0.1 id=2_M=0.2 ..., the prefix
	'id*M=' (quotes are important) will give the same list as above.
	The prefix is used to identify the directories but also
	is removed from the directory name to obtain the values of the
	first column (which are encoded in the dir-names).

	Use single quotes to protect * in shell context;

	If prefix is . (simple dot), the file in the current directory is scanned.
	In this case the option '-all' will make a list of the data indexed by the
	iteration step.

outfile: is the name of the output file, which should be the same in all 
	directories. Default is out.


modes: Default is EE.
	EE: extract the total energy. There is no options. Examples:

	    grepfplo -m EE -p 'id*M=' -f out

	          This extracts all Etots from all directories named id*M=...
	          where * can be anything and ... after M= is usually the value of M for
	          this particular directory/calculation
	          The result is a table of M and Etot values

	    grepfplo -m EE -p M= -f out

	          Same as above, but for directories called M=...

	    grepfplo -m EE -p . -f out

	          Extract last total energy from file out in current directory
	          Equivalent to grepfplo -m EE or grepfplo

	    grepfplo -m EE -p . -f out -a

	          Extract total energies for all iteration steps from current directory
	          The resulting table has columns 'iteration step' 'total energy'
	          Equivalent to grepfplo -a

	    grepfplo -m EE -p . -f out -a -x
	    grepfplo -m EE -p . -f out -a -xm

	          Extract total energies for all iteration steps from current directory
	          and send them to xfbp (-x) or  xmgrace (-xm)
	          This is equivalent to grepfplo -a -x or grepfplo -a -xm


	FF: free energy (if it applies)

	EEcorrected: broadening corrected energy, (Efree+Etot)/2

	SS: total gross spin. no options.

	it: iteration progress

	fit: force iteration progress

	time: timing of one cycle

	term: termination of process

	SSat: total gross spin of atom. Options: site-number. Examples
	      grepfplo -m SSat 13 -p M= -f out

	N_net/N_gros/S_net/S_gros:  individual population numbers. 
	      Options:  site-number orbital-number.
	      orbital-number is the number of the orbital in the order as printed in the 
	      population analysis.
	      If orbital-number is out of range the total site population number is printed.
	      For the N_gros cases there is one more number than for N_net and S_..., which
	      is the number of excess electrons of the site.
	Lzat: the orbital moment of an atom. Options: site-number. Example
	      grepfplo -m Lzat 12 -p U=

	Bfsm: the auxillary magnetic field needed to set the FSM moment.

	dBfsm:the change of the auxillary magnetic field needed to set the FSM moment.
	      This is for controlling what's going on in full relativistic FSM calculations.

	NkTotal:the total number of k-points in the BZ.

	spinmoments:table of all spin moments.

	orbitalmoments:table of all orbital moments.

	gmBJ: the modified Becke Johnson g-parameter.

	cmBJ: the modified Becke Johnson coefficient.

	gap: the total gap.



