Up: Gather/scatter routines    Previous: collect_cls


collect_xls

subroutine collect_xls( int nmaps1, int mapnum1, int nmaps2, int mapnum2, int ncomp, int nlmax, int nmvals, int *mvals, int lda, s2hat_dcomplex *local_alm1, s2hat_dcomplex *local_alm2, int nxspec, double *xcl, int myid, int numprocs, int root, MPI_Comm comm)

Purpose:

Computes and collects on the proc root power cross-spectra for the sets mapnum1 and mapnum2 stored in the distributed form in local_alm1 and local_alm2 respectively. The latter are assumed to be distributed over the procs in the same way as defined by lmax, mmax, nmvals, and mvals. local_alm1 and local_alm2 can be the same object.
The call has to be made by all procs of the communicator, comm. Blocking.

Parameters:

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

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

ncomp(*)-- [int], a number of components of the input alm sets (=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_alm1, local_alm2-- [s2hat_dcomplex*], vectors of complex numbers each corresponding to a (different or the same) 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);

stored in the column-wise order. It stores 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;

nxspec(*)-- [ int], determines which spectra are to be computed (see the output parameter description below);

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(*)-- [int], an mpi communicator for the numprocs procs.
(*)The value must be the same on all procs of the communicator comm.

output:

xcl-- [double*], a vector of doubles storing a 2-dim array [0:nlmax,1:nxspec] in the column-wise order. On the output it stores, on the proc root only, the computed (pseudo) cross-power spectra of the types as determined by the value of nxspec.

    nxspec == ncomp -- only same component-spectra are computed;
    nxspec == ncomp+2 ( ncomp>1) -- all ncomp same-component spectra and one different-component spectrum (e.g., T1E2 and E1T2 if ncomp == 3) are computed;
    nxspec == ncomp^2 (ncomp > 1) -- all same-component and all different-component spectra are computed.


On the output the auto spectra are stored first (i.e., [ 1_i 2_i] for i = 1, ..., ncomp) followed by relevant spectra of the different components ([1_i 2_j], [1_j, 2_i] for i = 1,.., ncomp-1 and j = i+1, ..., ncomp). Here, the numbers 1 and 2, denote, respectively, the first or the second set of the alms which are used for the calculation of the spectra.

For example:

if ncomp = 3 (= nstokes) and nspec = 9 then the output is as follows:
T1 T2, E1 E2, B1 B2, T1 E2, E1 T2, T1 B2, B1 T2, E1 B2, B1 E2
(and in the above order).



Up: Gather/scatter routines    Previous: collect_cls

radek stompor 2009-10-15