Degraf is a parallel MPI code to degrade in resolution large cosmological initial conditions on a cluster without requiring shared memory, while possibly shifting the box for the purpose of resimulations. The real Fourier transforms are carried in place using fftw, while minimizing the amount of used memory (at the expense of performance), in the spirit of grafic-1. The output of the result(s) is also carried in parallel.
It runs interactively using the command:
mpirun -np [number of processors] degraf [namelistfile]
where namelistfile is a fortran namelist parameter file. The structure of the parameter file is the following:
nfiles = 1
inputfiles = 'ic_deltab'
degramax = 2
recurse = .false.
shift = 0 0 0
* nfiles is the number of input files to be processed
* inputfiles is the list of input file names, in simple quotes, separated by white spaces
* degramax is a power of 2 (greater or equal to 2) indicating by how much the resolution of the input box(es) is degraded
* if recurse is set to .false., the output resolution is uniquely set by degramax. If set to .true., then all resolutions corresponding to degradation factors from to 2 up to degramax (in powers of 2) are computed
* if shift is present the whole hierarchy will be shifted according to shift (in relative units of the boxsize).
* The output file names are constructed from the input file names, adding at the end of the file names the output linear size of the box in the x direction (note that the code should work also on non-cubic boxes)
For velocity fields (or in general for fields where the grid is offset by a fraction of a mesh length), care is taken during the degradation to first shift the grid points back to the original (zero offset) position at full resolution. After degradation, the shift is reapplied, with a value equal to the same offset fraction, but computed in units of the new (bigger) mesh size.