files:
unit 5: stdin
unit 6: stdout
unit 10: save.dat output file
unit 11: Revision
unit 12:?
unit 20:?
unit 66: msg
unit 67: spur
unit 68: zop.out
output files: plot.datb... in popiplot format
       force.datb...
------------------------------
Constants
------------------------------
MAXCONV = 0.6


------------------------------
Parameters:
------------------------------
mainly in readprintpar.f

compulsory:
------------------------------
n1:->nx	number of cells in x-direction (2^i) + 2 (mandatory!)
n2:->ny	number of cells in y-direction (2^i) + 2 (mandatory!)
tau-si:->tauSI ->tau	numerical stepsize?
lambda-si: lengthscale?
or L-si: lengthscale?
rhogas-si: gas density 
rholiq-si: liquid density
tmax:	number of timesteps
tprint: log message (stdout and msg file) 'tprint' time steps (ok 2.9.01)
viscgas-si: (dynamic) viscosity gas 
viscliq-si: (dynamic) viscosity liquid
bubble->ibubble: (default 0, timestep.f)
drop->idrop: (default 0, timestep.f) 
radius: createdisk() in ini_conditions.f
	relative to the box width (in x-direction)
	the object is halve the grid width shifted to x=0
	radius must be < 1/2 to fit the whole object into the (x-) width
	(no default)
	diameter = 2*radius*(nx-2)

#numerics
MG_cycles_bound: ->ncycle,cycles : number of cycles in Vcycle
OMEGA:? (default 1)

#output

printres: VMG output if( printres == 1) (default 0)
optional:
------------------------------
maxcfl:	maximum cfl number (default 0.9)
xvel-si: velocity in x-direction (default 0)
yvel-si: vel. in y-direction (default 0)
sigma-si: ? (default 0)
spongeRe: ?
gravity-si: -> gSi, gravity (default 0)
deltau-si: -> duSi, velocityscale? (default 0!)
circul-si: ? circulSI, (default 0)

xc: x-centre (default 0, means object is placed (not quiet) in the centre
 (nx/2))  (ini_conditions.f)
yc: y-centre (default 0) (relative displacement (1/(nx-2) part)
    from the centre (ny/2))

#numerics
relaxfine: ->relax_times (default 4)
nres: ? (default 0)

div_tolerance: ->mineps
divfilter:? ->nfilter in /source/capcsf.f possibly there are two filtering
	processes in the new cfs code
nfilter:? ->nfilter (default 0) in /source/time_step.
	smoother, changes the volume fraction 
cinalg:? 2 -> x_swp(), 3 -> ciam_raus() (default 2)
capalg: (default 1, in timestep.f)
capalg=1 is the CSS method of Lafaurie et al. 
capalg=2 is our version of the CSF method. 
advectiontype: ->advectype (default 0 upwind scheme, 1 centred)

div_tolerance: -> mineps (default ???)

#output
nomovie
tvelo: timestep for plot.datb* & force.datb* output
tspurious: timestep for spur (unit 67) output
tpress: not used?
tsave:	  saves fields in unit 10: save.dat
tzop: 	number of timesteps between operation counts (in file zop.out)
	(default 1000)
printdiv: step of "divergence" and "ncycles" output to stdout (default
	  = 1)

------------------------------
variables:
------------------------------
nn: =min(nx,ny)
NG: = ng?
norm:

t: just an iteration counter (Drop.f)

?z(ires(ng))? (inital right hand side)

velmax: maximum speed (findninf())

S11(NMX,NMY) decl. in source/global.f
	Surface tension?
S12:
S22:

z: double field z contains the mass
ng: int 
icc: int

------------------------------
output:
------------------------------

mass: sumfiel( z(icc(ng)))
in msg: timestep, velmax (divided by lambdaSI)

spur: t,caliq,cagas (timestep.f)

------------------------------
Program Drop:
------------------------------

calls
	initlog()
	machineid()
	read_stdin()
	initialize()
	closelog()
	ifetch()
	flush()
	save()
	timestep()
	
initlog() def: source/initlog.f
	  initializes "Revision" file
	  calls openlog()
		machineID()

subroutine openlog()
	   just opens unit 11	  

machineID(), machineid( ), machineid_( ), MACHINEID( ) def: source/datb_out.c
	system call "hostname > hostname"

read_stdin() def: GetparC/

initialize() def: source/Drop.f
	readglob( )
	printhist( )
	initpressure( )
	ini1disk( ) or iniget() when restarting
	makebccf()
	makebcf()
	
subroutine closelog()
	 just closes unit 11

readglob( ) def: source/readprintpar.f
	reads just the parameters from stdin and calculates dimensionless
	variables

	calls ifetch(char, int)...
	calls printhist( int tprint)

parameter MAXCFL=.9 (default)
paramter timescale = lambdaSI/duSI

int ifetch() def: GetparC/GP_fetch.c
	
printhist( int tprint) def: source/readprintpar.f
	writes just some information to stdout like sigam=val

double MAXCFL dec: source/global.f
	def: source/readprintpar.f =.9d0


SUBROUTINE initpressure( int nx, int ny) def: source/VMG_relax.f
	seems to check some memory requirements
	calls mymalloc( )

int mymalloc( int len) def: source/VMG_relax.f

int MEMLEN dec: source/pointers.f
	
SUBROUTINE ini1disk(u,v,c,p,xvel,tau,nx,ny) def: source/ini_conditions.f
	calls creatdisk( )


SUBROUTINE creatdisk(u,v,c,p,xvel,yvel,xc,yc,idrop,r,tau,nx,ny) def: /source/ini_conditions.f
	initializes droplet velo and density conditions
	calls makebccf( ) 

SUBROUTINE makebccf(cc,nx,ny) def: source/xp_zn.f
	c y-direction: adjustment of the border values to the
	neighbouring inner values (cc(i,1)=cc(i,2))
	c x-direction: periodicity (cc(1,i)=cc(nx-1,i))
	   is called twice ( initialize()->ini1disk()->creatdisk()
	    & initialize() )

SUBROUTINE makebcf(u,v,nx,ny) def: source/xp_zn.f
	   velocity x-direction: periodicity
	   (u(1,i)=u(nx-1,i),u(nx,i)=u(2,i))
	   velocity y-direction: adjusts border (i=1,nx)
	v-velocities to zero (missing v(i,ny-1)=0?)
	and u-velos to the inner neigbours
	   
?subroutine flush(unit) def: source/flush.f?
	   just returns
	   what is flush for?

SUBROUTINE save(u1,v1,c,u,v,tau,nx,ny) def: source/save.f
	   saves field in unit 10: save.dat
	   adjust parameter tsave!
?	   overwrites timesteps?	   

SUBROUTINE timestep(t,tprint) def: source/time_step.f
	   opens unit 66: msg
		 unit 67: spur
		 unit 68: zop.out
calls
	datbfile()
	flush()
	sumfield()
	findmax()
	findmin()
	findninf()
	filter()
	x_swp() or
	ciam_raus()
	fill0()
	momentum()

void datbfile_(double *u, double *v, double *c, int *nx, int *ny, int
*nz, int *t) def: source/datb.out.c
     writes out the results in single(float)! precesion
			 
DOUBLE PRECISION FUNCTION sumfield(u,nx,ny) def: source/util.f
       sums matrix u in the range of nx & ny

SUBROUTINE x_swp(u,c,vof1,vof2,vof3,nx,nz) def: /source/ciam.f
	prepares some fields for actual calculations?

SUBROUTINE ciam_raus(u,w,c,flxm,flxp,flzm,flzp,
     %     divx,divz,nx,nz) def: source/ciam_raus.f

SUBROUTINE fill0(u,nx,ny)
	just fills field u with zeros

SUBROUTINE momentum(rhou,rhov,u,v,cc,p,a,c,ei,
     *                    S11,S22,S12,w1,w2,tau,mugas,muliq,
     *                    rhogas,g,nx,ny,outdiv,t) def: source/momentum.f
	calls
	mglin()
	

DOUBLE PRECISION FUNCTION findninf(u,v,nx,ny) def: source/util.f
	returns maximum speed

SUBROUTINE makebcpf(cc,nx,ny) def: in source/xp_zn.f
	same as makebccf()

SUBROUTINE bcvechom(u,v,nx,ny) BoundaryConditionsVELocityHOMogeneous?
	def: in source/xp_zn.f
	just calls makebcf()

Drop simulation:
x-direction: periodicity of velo and c
y-direction: v-velo zero at y = 1,2 and y = ny
	u-velo normal derivative zero at y = 2,ny-1
	c normal derivative zero

spur: dimensionless output of timestep, caliq and cagas
	def: in source/timestep.f
           velspur = lengthscale*velmax*h/tau
           caliq = velspur*muliq/sigma
           cagas = velspur*mugas/sigma

SUBROUTINE capcsf(w1,w2,w3,cc,sigma,tau,nx,ny)

SUBROUTINE mglin(r1,r2,nx,ny) source/VMG_relax.f
	   solves pressure equation
	   calls acfromac
	    mormmean

DOUBLE PRECISION FUNCTION normmean(u,nx,ny) util.f
	squared mean

SUBROUTINE acfromac(a,c,ei,a2,c2,nx,ny) def. in source/VMG_relax.f

SUBROUTINE filter(c, cfilt, nx,ny)
	smoother from c to cfilt

------------------------------
helper functions
------------------------------

Step: find_step.c

 D = lambda-si * radius: ONLY IF drop = 1!
 so if D should be the diameter in the laplace number
 L has to be half the width of the domain in x-direction.
 
h is lambda-si here
 tau/t_cap =  tau*(sigma/rholiq*h**3)^1/2
 must be
 tau/t_cap =  tau*(sigma/(rholiq*h**3))^1/2

------------------------------
projects
------------------------------
spurious_currents
Reame:
PIII 600MH -- 3 min
my PIII 500MH -- 1.7 min!?

------------------------------
la_1.2:

capalg=1:
1m5.77s
capalg=2:
1m17.42s

tmax=300
capalg=2:
16x16: 1.07
32x32: 2.42
64x64: 9.03
128x128: 45.71
256x256: 188.83 user