!set the neutron wavelength
c lambda1 1.594
!read the exafs data
r ex;t11.ex;;;ga k;;;
!read the fixed-wavelength neutron data and coordinates
!(the coordinates in bich4.fil are derived from Angew.Chem.Int,1995,34,2414)
r n;bich4;;;
!Reduce the listings
pd;nxt off;lst1 off;ipl1 off;q
!set the exafs weighting
s w k3
!read the phaseshifts
r phas 1;6;bichr.gac;.o;.ga;.si;.ca;.h
!set the weightings for the two techniques (ignore exafs at first)
c wex 0.;c wpd 1.
!set up some alias's for plotting restricted ranges
alias t0
c tmin -999;c tmax 999
alias t1 
c tmin 20;c tmax 40;p pd
alias t2 
c tmin 40;c tmax 60;p pd
alias t3 
c tmin 60;c tmax 80;p pd
alias t4 
c tmin 80;c tmax 100;p pd
!Select the profile function
pd prof ps
!Set up the space group
!c space i-43m
!set initial value of SCALE1 by inspection
c scale1 5000.
site m1;ga 2/3;si 1/3;=
site h1;h 1/3;=
c pt1 m1
c pt6 h1
!reduce relaxation factor until peak profile parameters are approximately correct
c relax .5
!refine peak profle etc.,then include Biso parameters and ACELL parameters
pause
ref pd;m 10
!Set ASYM to a non-zero value so it is included in the refinement
c asym .5
fit
pause
c relax .95
ref pd+cell;9;bi[1,2];bi[3,5];bi4;bi6;=;m 5
!Switch on the EXAFS
c wex .5;c wpd .5
!Change initial values of EF and A parameters
c ef -5;c a[2-ns] .02
fit
!NPD is OK but EXAFS is hopeless
!try a different model - PD disordered, EXAFS ordered in I-4
pause
c space i-4:i-43m
c pt1 ga
c pt6 h
!move existing atomi positions
c atom9 6;c atom8 5;c atom7 4;c atom6 3
!duplicate atoms in special positions in I-43m
c atom3 2;c atom4 6;c atom5 6
c lab3 MJ2;c lab5 O2;c lab6 O3;c lab8 O4
!c bi[1-9] 1
!Set up restraints on positions using COUPLE
!(these are described in Acta Cryst.B,1998,54,558)
!(there are several ways of setting up contraints in the program)
couple 5
0;0;0;0
1;0;0;0
0;0;0;0
couple 6 4
0;1;0;0
1;0;0;0
0;0;1;0
couple 7
0;0;0;0
1;0;0;0
1;0;0;0
couple 8
0;0;0;0
1;0;0;0
1;0;0;0
couple 9
0;0;0;0
0;0;0;0
0;1;0;0
!Note that relative restraints on Ga-O distances have not been set
!as was done in the Acta Cryst paper
c px1 .5;c py1 .25;c pz1 0
!reset orientation for new space group
!add new atoms where neccessary
c px2  0;c py2 .5 ;c pz2 .25
c px3  0;c py3 .5 ;c pz3 .75
c px4 pz4;c pz4 py4;c px5 pz4;c pz5 px4
c px9 pz9;c py9 py9
!adjust pd occupancies
c scale1 scale1/100
reset occ
!reset the point group (now C1)
reset point
!Select block-mode disorder
s dis bl
c long 3.5
c xlong 5
!Set FT limit
c rmax 8
!Use AFAC from a previous EXCURVE refinement
c afac .85
s ms al
c plmax 8
!Initalise DW blocks
c gh: .075;c go: .05;c go:s .005;c gsi: .025;c gga: .025
c gca: .025;c gsi:i .015;c gga:i .01
!Refine using 5 angstrom cluster
ref 80;ef;py1;px4;py4;pz4;px5;pz5;bi[1-3];bi[4-6,8];bi[9];go:s;gsi:i;gga:i;gca:l;=
c;p;c;=
!Do it again
ref res 100
c;p;c;=
!Extend the cluster to 6.5 angstroms and re-refine DWs
!(this will take some time)
c rhigh 6.5;c plmax 13;fit
ref;go:s;gsi:i;gga:i;gca:l;bi[1-3];bi[4-6,8];bi7;bi9;=;c;c;
!An improved EXAFS fit (as published) can be obtained using ATMAX=3
!for the refinements - this would require considerable additional effort
