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


collect_cls

subroutine collect_cls( int nmaps, int mapnum, int ncomp, int nlmax, int nmvals, int *mvals, int lda, s2hat_dcomplex *local_alm, int nspec, double *cl, int myid, int numprocs, int root, MPI_Comm comm)

Purpose:

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

Parameters:

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

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

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

nlmax(*)-- [int], maximum value of l (included);

nmvals-- [int], a number of m values to be processed by a given proc;

mvals-- [int*], a vector of a length nmvals containing a list of m values to be processed by a given proc;

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

local_alm-- [s2hat_dcomplex*], a vector of complex numbers storing 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);

in the column-wise order. It contains relevant alm coefficients for all m values as 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(*)-- [ int], determines which spectra will be computed (see the output parameters for more details);

myid-- [int], proc id (0,...,numprocs-1);

numprocs(*)-- [int], total number of procs used;

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

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

output:

cl-- [double*], a vector of doubles storing a 2-dim array of the dimensions [0:nlmax,1:nspec] in the column-wise order. It stores 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 2009-10-15