Next: collect_xls    Up: Gather/scatter routines    Previous: collect_alms


collect_cls

subroutine collect_cls( nmaps, mapnum, ncomp, nlmax, nmvals, mvals, lda, local_alm, nspec, cl, myid, numprocs, root, comm)

Purpose:

Computes and collects on the proc root power spectra computed directly from the alm coefficients which are kept distributed over all procs. The spectra are computed for a single set mapnum out of nmaps stored in the local_alm arrays.
The call has to be made bay all procs of the communicator comm. Blocking.

Parameters:

input:
nmaps(*)-- [integer(4b)], a number of the alm sets (each made of ncomp components);

mapnum(*)-- [integer(4b)], an alm set number, spectra of which are to be computed;

ncomp(*)-- [integer(4b)], a number of alm components stored in the local_alm array (=1,2,3);

nlmax(*)-- [integer(4b)], maximum value of l (included);

nmvals-- [integer(4b)], a number of m values to be processed by a given proc;

mvals-- [integer(4b)], a vector of a length nmvals containing a list of m values to be processed by a given proc;

lda(*)-- [integer(4b)], defines the leading dimension of the alm, local_alm and local_plm matrices. Accepted values: lda == ncomp or nlmax;

local_alm-- [complex(dp)], an allocated pointer to a 4dim array of dimensions:

(1:ncomp,0:nlmax,0:nmvals-1,1:nmaps), if lda == ncomp;      (HEALpix convention);
(0:nlmax,0:nmvals-1,1:ncomp,1:nmaps), if lda == nlmax;      (S2HAT convention);

storing relevant alm coefficients for all m values processed on a given proc and all l and all ncomp components for each of the nmaps maps which are to be processed simultanously; For ncomp == 1 the coefficients are those for total intensity only. For ncomp == 3 the component corresponds to the total intensity, E-mode and B-mode polarizations, respectively;

nspec(*)-- [ integer(4b)], determines which spectra will be computed (see the output parameters for more details);

myid-- [integer(4b)], proc id (0,...,numprocs-1);

numprocs(*)-- [integer(4b)], total number of procs used;

root(*)-- [integer(4b)], defines root processor on which the alm coefficients are stored in a non-distributed form;

comm(*)-- [integer(4b)], an mpi communicator for the numprocs procs.
(*)The value must be the same on all procs of the communicator comm.

output:

cl-- [ real(dp)], a pointer to an array [0:nlmax,1:nspec] storing the computed (pseudo) power spectra of the types as determined by the value of nspec.

    nspec == ncomp -- only auto-spectra are computed;
    nspec == ncomp+1 ( ncomp>1) -- all ncomp auto spectra and one cross spectrum (e.g., TE if ncomp == 3) are computed;
    nspec == [ncomp (ncomp+1)]/2 (ncomp > 1) -- all auto and all cross spectra are computed.


On the output the auto spectra are stored first (i.e., [ i i] for i = 1, ..., ncomp) followed by relevant cross-spectra ([i j] for i = 1,.., ncomp-1 and j = i+1, ..., ncomp).

For example:

if ncomp = 3 = (nstokes) and nspec = 6 then the computed spectra are as follows: TT, EE, BB, TE, TB, EB (in this order).



Next: collect_xls    Up: Gather/scatter routines    Previous: collect_alms

radek stompor 2007-09-15