I hope this will be a short explanation to get you familiar
with my code and to get you started.

I have 3 main simulation programs which do almost the same thing,
so I'll explain briefly what they're supposed to do, then concentrate
on just one (the extension of the other two from this one is so
straightforward that I don't know why I bother to have the other
two.)
pcdw: simulates cdw with phase slips for a specified amt of time
cdwcurrent: simulates cdw with phase slips for a specified amt of
	time and writes the current out every so often.  The sampling
	interval and length of time to be run is in a file 'fftparam'
	for example Data0/F1.3/fftparam
cdw-mon: simulates for a specified time, writing out instances where
	the strain passes a maximum into file 'spring.mon', for example,
	Data0/F1.3/spring.mon.  There may be bugs in the monitoring,
	so please beware and look at the code (in loop-mon.f).

Now we concentrate on pcdw, first how to use it, then where the
source code files are and what they do.
-----------------------------------------------------------
pcdw: HOW TO USE IT

A good thing to try is to start from scratch.
Suppose you want to generate new cdw configurations for a different
impurity distribution, let say with random seed 8.

Do the following:

%mkdir Data8
%echo "0.01 0.1 1 8" > Data8/parameters
  The first number is dt (time step).  Ignore the next two numbers
  (They were more relevant in the FLR model.) The last number is
  the random seed.
%echo "10.0" > Data8/timeout
   This is the length of time you want to run the simulation for
   each field.  I've mostly used 5000.0, but for this first trial
   run you don't want to become bored.  The number of iterations
   is timeout/dt, i.e. 10.0/0.01 = 1000.
%vi Data8/elec
    Now type the following in elec:
    3
    1.3
    'F1.3/'
    1.25
    'F1.25/'
    1.2
    'F1.2/'

	First number indicates how many different fields.
	The next pair of numbers indicate first, what the
	value of the field is, and second, what directory the various
	information pertinent to that field (e.g. phi, velocity,etc.)
	are to be stored within the root/default directory of 
	Data8.
%pcdw <return>
Default Directory: Data8 <return>

That's it!

After it stops, you may want to run everything for a longer time.
So do this: change the value in timeout to say 5000.0. Then type:
%pcdw <return>
Default Directory: Data8 <return>
again.  It will take the old configurations from the last run and
use them as starting configurations.
----------------------------------------------------------------
Now a brief overview of the way the code was divided:
Please see Makefile later for more info.

Again focus on pcdw:

pcdw is made from 
cdw3.f: Asks for default directory, reads in parameters in that
	directory, then call init found in init3.f.  Init will
	generate the random impurity positions from the seed,
	weeding out points which lie too close together. The
	different fields are read in and then a loop takes care
	of each field in turn.  In this loop, phi is read in from
	various possible sources, then a procedure converge found
	in loop.f is called. Converge iterates the equation for a
	specified time, then returns to the main procedure in
	cdw3.f. Phi is saved out.
init3.f: contains code for generating the positions of impurities,
	weeding out points too close together, and saving to a
	file called 'x'.
loop.f: contains the code which iterates the difference equation
	for a specified time. At the end, it subtracts a multiple
	of two pi from the configuration before returning to the
	main procedure.  If every point in the config has moved by
	two pi in the time run, then the config is further subtracted
	by 10*2pi so that we can detect whether the field is above
	threshold (provided we make timeout big enough) simply by
	looking at the min and max value at the end of the file 
	phi3 (e.g. tail Data1/F1.3/phi3). Just look at a few example
	to better understand what I mean.
Lib/heapsort.f: this is just the heapsort from numerical recipes
		except changed to double precision.  This was
		used in init3.f to sort the random numbers so
		that they became ordered position coordinates.
Lib/aux256.f: Various small routines like file input and output
		of phi and checking for file existence, etc.
------------------------------------------------------------
I hope this has been helpful so far.
I would like to point out now the exact place where I left
off.  I have concentrated on Data0/F1.3 and Data0/F1.25
because they seem to be where the first phase slips start
to appear, and where a subpeak appears in the current.
To look at the currents, make sure that the file Data0/elecall
(which has the same format of elec) has the right fields.
Then type (in directory ~/PhaseSlips):
plottime2 
Default directory: Data0 <return>
File containing avvel: Current <return>
	Now it counts the number of lines in the file 
		Data0/F1.3/Current and reports 10001 lines
		(i.e. data points)
	To look at a section of the current vs. time curve, just
	type the beg and end (integers), so for example:
9000 10000
	to plot the last 1000 points 

	Type a 1 and return after every display. You may 
	have to type control-Q occsionally if the display
	hangs up without finishing plotting.

Source code is in ~/PhaseSlip/Source.
(plottime is just an older and less useful version.)
