52 subroutine calc_nldd (incls, inlcls, clnoise, nldd, jjmaxTmax, lmaxM)
57 REAL(dl),
INTENT(IN),
DIMENSION (:,:) :: incls
64 REAL(dl),
INTENT(IN),
DIMENSION (:,:) :: inlcls
70 REAL(dl),
INTENT(IN),
DIMENSION (:,:) :: clnoise
74 real(dl),
INTENT(OUT),
DIMENSION (:) :: nldd
76 integer ,
INTENT(INOUT) :: jjmaxTmax
79 integer ,
INTENT(IN) :: lmaxM
82 integer jjmaxT, jj, ll, l1, l2max, nn, l2, l, err
83 integer,
dimension(:),
allocatable :: llens
84 double precision all, gall, al1, an, al2
85 double precision aAlTT, aAlEE, aAlTE, aAlTB, aAlEB
86 double precision aBlTTEE, aBlTTTE, aBlEETE, aBlTBEB
87 double precision Al1L0, Al1L2, wigner0, wigner2
88 double precision parity_test, parity, prefactor
89 double precision fTT12, fEE12, fTE12, fTE21
90 double precision fTB12, fTB21, fEB12, fEB21
91 double precision gTE12_den, gTE12_num, gTE21_num
92 double precision Wl20_sup, Wl22_sup, Wl20_mid, Wl22_mid, Wl20_inf, Wl22_inf
93 double precision aa0, bb0, cc0, aa2, bb2, cc2
94 double precision,
dimension(5,5) :: LensingNoise, InvLensingNoise
95 double precision GaussVecLens(5,1)
96 double precision,
dimension(:),
allocatable :: MinVarNoise_L
97 double precision,
dimension(:),
allocatable :: ddMinVarNoise_L
98 double precision,
dimension(:),
allocatable :: alogllens
100 CHARACTER(LEN=100),
PARAMETER :: code =
'calc_NLDD'
107 jjmaxt=int((dble(lmaxm)+1700.d0)/50.d0)
109 if (jjmaxt.gt.jjmaxtmax)
then
111 write(*,*)
'WARNING: jjmaxTmax increased to: ',jjmaxt
114 allocate(minvarnoise_l(1:jjmaxt), &
115 & alogllens(1:jjmaxt), &
116 & llens(1:jjmaxt), stat = bonalloc)
117 if (bonalloc > 0)
then
118 print*,code,
'> pb allocation memoire', bonalloc
160 if (dint(gall).ne.gall) gall=gall+0.5d0
161 if (gall.le.2.d0) gall=2.d0
191 al1l0=al1l0*(an-0.5d0)*(al1+an)/an/(al1+an-0.5d0)
197 & *dsqrt(al1*(al1-1.d0)/(al1+1.d0)/(al1+2.d0)) &
198 & *dsqrt((al1+all+1.d0)*(al1+all+2.d0) &
199 & /(al1+all)/(al1+all-1.d0))
206 wl20_sup=al1l0/dsqrt(2.d0*(all+al1)+1.d0)
207 wl22_sup=al1l2/dsqrt(2.d0*(all+al1)+1.d0)
209 parity_test=(all+al1)/2.d0
211 if (dint(parity_test).ne.parity_test)
then
216 parity=(al1+all+al2)/2.d0
218 if (l2.le.lmaxm)
then
223 prefactor=dsqrt((2.d0*all+1.d0)*(2.d0*al1+1.d0) &
224 & *(2.d0*al2+1.d0)/(16.d0*pi))
226 if (dint(parity).eq.parity)
then
228 ftt12=prefactor*wigner0*(incls(1,l1) &
229 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
231 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
232 fee12=prefactor*wigner2*(incls(2,l1) &
233 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
235 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
236 fte12=prefactor*(wigner2*incls(3,l1) &
237 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
238 & +wigner0*incls(3,l2) &
239 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
240 fte21=prefactor*(wigner2*incls(2,l2) &
241 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)) &
242 & +wigner0*incls(3,l1) &
243 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)))
245 gte12_den=(inlcls(1,l1)+clnoise(1,l1)) &
246 & *(inlcls(1,l2)+clnoise(1,l2)) &
247 & *(inlcls(2,l1)+clnoise(2,l1)) &
248 & *(inlcls(2,l2)+clnoise(2,l2)) &
249 & -(inlcls(3,l1)*inlcls(3,l2))**2
250 gte12_num=(inlcls(1,l2)+clnoise(1,l2)) &
251 & *(inlcls(2,l1)+clnoise(2,l1)) &
252 & *fte12-(inlcls(3,l1)) &
253 & *(inlcls(3,l2))*fte21
254 gte21_num=(inlcls(1,l1)+clnoise(1,l1)) &
255 & *(inlcls(2,l2)+clnoise(2,l2)) &
256 & *fte21-(inlcls(3,l1)) &
257 & *(inlcls(3,l2))*fte12
259 aaltt = aaltt +ftt12**2 &
260 & /(inlcls(1,l1)+clnoise(1,l1))/(inlcls(1,l2)+clnoise(1,l2))
261 aalee = aalee +fee12**2 &
262 & /(inlcls(2,l1)+clnoise(2,l1))/(inlcls(2,l2)+clnoise(2,l2))
263 aalte = aalte + (fte12*gte12_num+fte21*gte21_num) &
266 ablttee= ablttee+ftt12*fee12 &
267 & *(inlcls(3,l1))*(inlcls(3,l2)) &
268 & /(inlcls(1,l1)+clnoise(1,l1))/(inlcls(1,l2)+clnoise(1,l2)) &
269 & /(inlcls(2,l1)+clnoise(2,l1))/(inlcls(2,l2)+clnoise(2,l2))
270 ablttte= ablttte+ftt12/gte12_den &
271 & /(inlcls(1,l1)+clnoise(1,l1))/(inlcls(1,l2)+clnoise(1,l2)) &
272 & *((inlcls(1,l1)+clnoise(1,l1))*(inlcls(3,l2)) &
274 & +(inlcls(1,l2)+clnoise(1,l2))*(inlcls(3,l1)) &
276 ableete= ableete+fee12/gte12_den &
277 & /(inlcls(2,l1)+clnoise(2,l1))/(inlcls(2,l2)+clnoise(2,l2)) &
278 & *((inlcls(2,l2)+clnoise(2,l2))*(inlcls(3,l1)) &
280 & +(inlcls(2,l1)+clnoise(2,l1))*(inlcls(3,l2)) &
285 ftb12=prefactor*wigner2*incls(3,l1) &
286 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
287 ftb21=prefactor*wigner2*incls(3,l2) &
288 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
289 feb12=prefactor*wigner2*incls(2,l1) &
290 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
291 feb21=prefactor*wigner2*incls(2,l2) &
292 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
295 & + ftb12**2/(inlcls(1,l1)+clnoise(1,l1)) &
296 & /(inlcls(4,l2)+clnoise(2,l2)) &
297 & + ftb21**2/(inlcls(1,l2)+clnoise(1,l2)) &
298 & /(inlcls(4,l1)+clnoise(2,l1))
300 & + feb12**2/(inlcls(2,l1)+clnoise(2,l1)) &
301 & /(inlcls(4,l2)+clnoise(2,l2)) &
302 & + feb21**2/(inlcls(2,l2)+clnoise(2,l2)) &
303 & /(inlcls(4,l1)+clnoise(2,l1))
305 & + ftb12*feb12*(inlcls(3,l1)) &
306 & /(inlcls(4,l2)+clnoise(2,l2)) &
307 & /(inlcls(1,l1)+clnoise(1,l1)) &
308 & /(inlcls(2,l1)+clnoise(2,l1)) &
309 & + ftb21*feb21*(inlcls(3,l2)) &
310 & /(inlcls(4,l1)+clnoise(2,l1)) &
311 & /(inlcls(1,l2)+clnoise(1,l2))/(inlcls(2,l2)+clnoise(2,l2))
322 wl22_mid=al1l2*2.d0* &
323 & dsqrt(all/al1/(al1+all-2.d0)/(al1+all+2.d0))
325 if (dint(parity_test).ne.parity_test)
then
329 parity=(al1+all+al2)/2.d0
331 if (l2.le.lmaxm)
then
336 prefactor=dsqrt((2.d0*all+1.d0)*(2.d0*al1+1.d0) &
337 & *(2.d0*al2+1.d0)/(16.d0*pi))
339 if (dint(parity).eq.parity)
then
340 ftt12=prefactor*wigner0*(incls(1,l1) &
341 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
343 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
344 fee12=prefactor*wigner2*(incls(2,l1) &
345 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
347 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
348 fte12=prefactor*(wigner2*incls(3,l1) &
349 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
350 & +wigner0*incls(3,l2) &
351 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
352 fte21=prefactor*(wigner2*incls(3,l2) &
353 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)) &
354 & +wigner0*incls(3,l1) &
355 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)))
357 gte12_den=(inlcls(1,l1)+clnoise(1,l1)) &
358 & *(inlcls(1,l2)+clnoise(1,l2)) &
359 & *(inlcls(2,l1)+clnoise(2,l1)) &
360 & *(inlcls(2,l2)+clnoise(2,l2)) &
362 & *(inlcls(3,l2)))**2
363 gte12_num=(inlcls(1,l2)+clnoise(1,l2)) &
364 & *(inlcls(2,l1)+clnoise(2,l1))*fte12-(inlcls(3,l1)) &
365 & *(inlcls(3,l2))*fte21
366 gte21_num=(inlcls(1,l1)+clnoise(1,l1)) &
367 & *(inlcls(2,l2)+clnoise(2,l2))*fte21-(inlcls(3,l1)) &
368 & *(inlcls(3,l2))*fte12
370 aaltt = aaltt +ftt12**2 &
371 & /(inlcls(1,l1)+clnoise(1,l1))/(inlcls(1,l2)+clnoise(1,l2))
372 aalee = aalee +fee12**2 &
373 & /(inlcls(2,l1)+clnoise(2,l1))/(inlcls(2,l2)+clnoise(2,l2))
374 aalte = aalte + (fte12*gte12_num+fte21*gte21_num) &
377 ablttee= ablttee+ftt12*fee12 &
378 & *(inlcls(3,l1))*(inlcls(3,l2)) &
379 & /(inlcls(1,l1)+clnoise(1,l1))/(inlcls(1,l2)+clnoise(1,l2)) &
380 & /(inlcls(2,l1)+clnoise(2,l1))/(inlcls(2,l2)+clnoise(2,l2))
381 ablttte= ablttte+ftt12/gte12_den &
382 & /(inlcls(1,l1)+clnoise(1,l1))/(inlcls(1,l2)+clnoise(1,l2)) &
383 & *((inlcls(1,l1)+clnoise(1,l1))*(inlcls(3,l2)) &
385 & +(inlcls(1,l2)+clnoise(1,l2))*(inlcls(3,l1)) &
387 ableete= ableete+fee12/gte12_den &
388 & /(inlcls(2,l1)+clnoise(2,l1))/(inlcls(2,l2)+clnoise(2,l2)) &
389 & *((inlcls(2,l2)+clnoise(2,l2))*(inlcls(3,l1)) &
391 & +(inlcls(2,l1)+clnoise(2,l1))*(inlcls(3,l2)) &
396 ftb12=prefactor*wigner2*incls(3,l1) &
397 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
398 ftb21=prefactor*wigner2*incls(3,l2) &
399 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
400 feb12=prefactor*wigner2*inlcls(2,l1) &
401 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
402 feb21=prefactor*wigner2*inlcls(2,l2) &
403 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
406 & + ftb12**2/(inlcls(1,l1)+clnoise(1,l1)) &
407 & /(inlcls(4,l2)+clnoise(2,l2)) &
408 & + ftb21**2/(inlcls(1,l2)+clnoise(1,l2)) &
409 & /(inlcls(4,l1)+clnoise(2,l1))
411 & + feb12**2/(inlcls(2,l1)+clnoise(2,l1)) &
412 & /(inlcls(4,l2)+clnoise(2,l2)) &
413 & + feb21**2/(inlcls(2,l2)+clnoise(2,l2)) &
414 & /(inlcls(4,l1)+clnoise(2,l1))
417 & + ftb12*feb12*(inlcls(3,l1)) &
418 & /(inlcls(4,l2)+clnoise(2,l2)) &
419 & /(inlcls(1,l1)+clnoise(1,l1)) &
420 & /(inlcls(2,l1)+clnoise(2,l1)) &
421 & + ftb21*feb21*(inlcls(3,l2)) &
422 & /(inlcls(4,l1)+clnoise(2,l1)) &
423 & /(inlcls(1,l2)+clnoise(1,l2)) &
424 & /(inlcls(2,l2)+clnoise(2,l2))
431 do nn=1,l2max-ll+l1-1
438 aa0=(al2+2.d0)*(al2+1.d0)* &
439 & dsqrt((-al2+all+al1)*(al2-all+al1+1.d0) &
440 & *(al2+all-al1+1.d0)*(al2+all+al1+2.d0))
442 cc0=-(al2+1.d0)*(al2+2.d0)* &
443 & dsqrt((-al2+all+al1-1.d0)*(al2-all+al1+2.d0) &
444 & *(al2+all-al1+2.d0)*(al2+all+al1+3.d0))
446 wl20_inf=(bb0*wl20_mid+cc0*wl20_sup)/aa0
448 aa2=(al2+2.d0)*dsqrt(((al2+1.d0)**2-4.d0) &
449 & *(-al2+all+al1)*(al2-all+al1+1.d0) &
450 & *(al2+all-al1+1.d0)*(al2+all+al1+2.d0))
451 bb2=2.d0*(2.d0*al2+3.d0)*((al2+1.d0)*(al2+2.d0) &
452 & +all*(all+1.d0)-al1*(al1+1.d0))
453 cc2=-(al2+1.d0)*dsqrt(((al2+2.d0)**2-4.d0) &
454 & *(-al2+all+al1-1.d0)*(al2-all+al1+2.d0) &
455 & *(al2+all-al1+2.d0)*(al2+all+al1+3.d0))
457 wl22_inf=(bb2*wl22_mid+cc2*wl22_sup)/aa2
459 parity=(al1+all+al2)/2.d0
461 if (l2.le.lmaxm)
then
466 prefactor=dsqrt((2.d0*all+1.d0)*(2.d0*al1+1.d0) &
467 & *(2.d0*al2+1.d0)/(16.d0*3.14159d0))
469 if (dint(parity).eq.parity)
then
471 ftt12=prefactor*wigner0*(incls(1,l1) &
472 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
474 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
475 fee12=prefactor*wigner2*(incls(2,l1) &
476 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
478 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
479 fte12=prefactor*(wigner2*incls(3,l1) &
480 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
481 & +wigner0*incls(3,l2) &
482 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
483 fte21=prefactor*(wigner2*incls(3,l2) &
484 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)) &
485 & +wigner0*incls(3,l1) &
486 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)))
488 gte12_den=(inlcls(1,l1)+clnoise(1,l1)) &
489 & *(inlcls(1,l2)+clnoise(1,l2)) &
490 & *(inlcls(2,l1)+clnoise(2,l1)) &
491 & *(inlcls(2,l2)+clnoise(2,l2)) &
493 & *(inlcls(3,l2)))**2
494 gte12_num=(inlcls(1,l2)+clnoise(1,l2)) &
495 & *(inlcls(2,l1)+clnoise(2,l1)) &
496 & *fte12-(inlcls(3,l1)) &
497 & *(inlcls(3,l2))*fte21
498 gte21_num=(inlcls(1,l1)+clnoise(1,l1)) &
499 & *(inlcls(2,l2)+clnoise(2,l2)) &
500 & *fte21-(inlcls(3,l1)) &
501 & *(inlcls(3,l2))*fte12
503 aaltt = aaltt +ftt12**2 &
504 & /(inlcls(1,l1)+clnoise(1,l1)) &
505 & /(inlcls(1,l2)+clnoise(1,l2))
506 aalee = aalee +fee12**2 &
507 & /(inlcls(2,l1)+clnoise(2,l1)) &
508 & /(inlcls(2,l2)+clnoise(2,l2))
509 aalte = aalte + (fte12*gte12_num+fte21*gte21_num) &
512 ablttee= ablttee+ftt12*fee12 &
513 & *(inlcls(3,l1))*(inlcls(3,l2)) &
514 & /(inlcls(1,l1)+clnoise(1,l1)) &
515 & /(inlcls(1,l2)+clnoise(1,l2)) &
516 & /(inlcls(2,l1)+clnoise(2,l1)) &
517 & /(inlcls(2,l2)+clnoise(2,l2))
518 ablttte= ablttte+ftt12/gte12_den &
519 & /(inlcls(1,l1)+clnoise(1,l1)) &
520 & /(inlcls(1,l2)+clnoise(1,l2)) &
521 & *((inlcls(1,l1)+clnoise(1,l1))*(inlcls(3,l2)) &
523 & +(inlcls(1,l2)+clnoise(1,l2))*(inlcls(3,l1)) &
525 ableete= ableete+fee12/gte12_den &
526 & /(inlcls(2,l1)+clnoise(2,l1)) &
527 & /(inlcls(2,l2)+clnoise(2,l2)) &
528 & *((inlcls(2,l2)+clnoise(2,l2))*(inlcls(3,l1)) &
530 & +(inlcls(2,l1)+clnoise(2,l1))*(inlcls(3,l2)) &
535 ftb12=prefactor*wigner2*incls(3,l1) &
536 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
537 ftb21=prefactor*wigner2*incls(3,l2) &
538 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
539 feb12=prefactor*wigner2*incls(2,l1) &
540 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
541 feb21=prefactor*wigner2*incls(2,l2) &
542 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
545 & + ftb12**2/(inlcls(1,l1)+clnoise(1,l1)) &
546 & /(inlcls(4,l2)+clnoise(2,l2)) &
547 & + ftb21**2/(inlcls(1,l2)+clnoise(1,l2)) &
548 & /(inlcls(4,l1)+clnoise(2,l1))
550 & + feb12**2/(inlcls(2,l1)+clnoise(2,l1)) &
551 & /(inlcls(4,l2)+clnoise(2,l2)) &
552 & + feb21**2/(inlcls(2,l2)+clnoise(2,l2)) &
553 & /(inlcls(4,l1)+clnoise(2,l1))
556 & + ftb12*feb12*(inlcls(3,l1)) &
557 & /(inlcls(4,l2)+clnoise(2,l2)) &
558 & /(inlcls(1,l1)+clnoise(1,l1)) &
559 & /(inlcls(2,l1)+clnoise(2,l1)) &
560 & + ftb21*feb21*(inlcls(3,l2)) &
561 & /(inlcls(4,l1)+clnoise(2,l1)) &
562 & /(inlcls(1,l2)+clnoise(1,l2)) &
563 & /(inlcls(2,l2)+clnoise(2,l2))
582 do l1=int(gall),lmaxm
596 al1l0=al1l0*(an-0.5d0)*(al1+an)/an/(al1+an-0.5d0)
602 & *dsqrt(al1*(al1-1.d0)/(al1+1.d0)/(al1+2.d0)) &
603 & *dsqrt((al1+all+1.d0)*(al1+all+2.d0) &
604 & /(al1+all)/(al1+all-1.d0))
611 wl20_sup=al1l0/dsqrt(2.d0*(all+al1)+1.d0)
612 wl22_sup=al1l2/dsqrt(2.d0*(all+al1)+1.d0)
614 parity_test=(all+al1)/2.d0
616 if (dint(parity_test).ne.parity_test)
then
621 parity=(al1+all+al2)/2.d0
623 if (l2.le.lmaxm)
then
628 if (dint(parity).eq.parity)
then
630 prefactor=dsqrt((2.d0*all+1.d0)*(2.d0*al1+1.d0) &
631 & *(2.d0*al2+1.d0)/(16.d0*pi))
633 ftt12=prefactor*wigner0*(incls(1,l1) &
634 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
636 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
637 fee12=prefactor*wigner2*(incls(2,l1) &
638 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
640 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
641 fte12=prefactor*(wigner2*incls(3,l1) &
642 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
643 & +wigner0*incls(3,l2) &
644 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
645 fte21=prefactor*(wigner2*incls(3,l2) &
646 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)) &
647 & +wigner0*incls(3,l1) &
648 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)))
650 gte12_den=(inlcls(1,l1)+clnoise(1,l1)) &
651 & *(inlcls(1,l2)+clnoise(1,l2)) &
652 & *(inlcls(2,l1)+clnoise(2,l1)) &
653 & *(inlcls(2,l2)+clnoise(2,l2)) &
655 & *(inlcls(3,l2)))**2
656 gte12_num=(inlcls(1,l2)+clnoise(1,l2)) &
657 & *(inlcls(2,l1)+clnoise(2,l1))*fte12-(inlcls(3,l1)) &
658 & *(inlcls(3,l2))*fte21
659 gte21_num=(inlcls(1,l1)+clnoise(1,l1)) &
660 & *(inlcls(2,l2)+clnoise(2,l2))*fte21-(inlcls(3,l1)) &
661 & *(inlcls(3,l2))*fte12
663 aaltt = aaltt +ftt12**2 &
664 & /(inlcls(1,l1)+clnoise(1,l1)) &
665 & /(inlcls(1,l2)+clnoise(1,l2))
666 aalee = aalee +fee12**2 &
667 & /(inlcls(2,l1)+clnoise(2,l1)) &
668 & /(inlcls(2,l2)+clnoise(2,l2))
669 aalte = aalte + (fte12*gte12_num+fte21*gte21_num) &
672 ablttee= ablttee+ftt12*fee12 &
673 & *(inlcls(3,l1))*(inlcls(3,l2)) &
674 & /(inlcls(1,l1)+clnoise(1,l1)) &
675 & /(inlcls(1,l2)+clnoise(1,l2)) &
676 & /(inlcls(2,l1)+clnoise(2,l1)) &
677 & /(inlcls(2,l2)+clnoise(2,l2))
678 ablttte= ablttte+ftt12/gte12_den &
679 & /(inlcls(1,l1)+clnoise(1,l1)) &
680 & /(inlcls(1,l2)+clnoise(1,l2)) &
681 & *((inlcls(1,l1)+clnoise(1,l1))*(inlcls(3,l2)) &
683 & +(inlcls(1,l2)+clnoise(1,l2))*(inlcls(3,l1)) &
685 ableete= ableete+fee12/gte12_den &
686 & /(inlcls(2,l1)+clnoise(2,l1)) &
687 & /(inlcls(2,l2)+clnoise(2,l2)) &
688 & *((inlcls(2,l2)+clnoise(2,l2))*(inlcls(3,l1)) &
690 & +(inlcls(2,l1)+clnoise(2,l1))*(inlcls(3,l2)) &
695 ftb12=prefactor*wigner2*incls(3,l1) &
696 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
697 ftb21=prefactor*wigner2*incls(3,l2) &
698 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
699 feb12=prefactor*wigner2*incls(2,l1) &
700 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
701 feb21=prefactor*wigner2*incls(2,l2) &
702 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
705 & + ftb12**2/(inlcls(1,l1)+clnoise(1,l1)) &
706 & /(inlcls(4,l2)+clnoise(2,l2)) &
707 & + ftb21**2/(inlcls(1,l2)+clnoise(1,l2)) &
708 & /(inlcls(4,l1)+clnoise(2,l1))
710 & + feb12**2/(inlcls(2,l1)+clnoise(2,l1)) &
711 & /(inlcls(4,l2)+clnoise(2,l2)) &
712 & + feb21**2/(inlcls(2,l2)+clnoise(2,l2)) &
713 & /(inlcls(4,l1)+clnoise(2,l1))
716 & + ftb12*feb12*(inlcls(3,l1)) &
717 & /(inlcls(4,l2)+clnoise(2,l2)) &
718 & /(inlcls(1,l1)+clnoise(1,l1)) &
719 & /(inlcls(2,l1)+clnoise(2,l1)) &
720 & + ftb21*feb21*(inlcls(3,l2)) &
721 & /(inlcls(4,l1)+clnoise(2,l1)) &
722 & /(inlcls(1,l2)+clnoise(1,l2)) &
723 & /(inlcls(2,l2)+clnoise(2,l2))
734 wl22_mid=al1l2*2.d0* &
735 & dsqrt(all/al1/(al1+all-2.d0)/(al1+all+2.d0))
737 if (dint(parity_test).ne.parity_test)
then
741 parity=(al1+all+al2)/2.d0
743 if (l2.le.lmaxm)
then
748 prefactor=dsqrt((2.d0*all+1.d0)*(2.d0*al1+1.d0) &
749 & *(2.d0*al2+1.d0)/(16.d0*3.14159d0))
751 if (dint(parity).eq.parity)
then
753 ftt12=prefactor*wigner0*(incls(1,l1) &
754 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
756 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
757 fee12=prefactor*wigner2*(incls(2,l1) &
758 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
760 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
761 fte12=prefactor*(wigner2*incls(3,l1) &
762 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
763 & +wigner0*incls(3,l2) &
764 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
765 fte21=prefactor*(wigner2*incls(3,l2) &
766 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)) &
767 & +wigner0*incls(3,l1) &
768 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)))
770 gte12_den=(inlcls(1,l1)+clnoise(1,l1)) &
771 & *(inlcls(1,l2)+clnoise(1,l2)) &
772 & *(inlcls(2,l1)+clnoise(2,l1)) &
773 & *(inlcls(2,l2)+clnoise(2,l2)) &
775 & *(inlcls(3,l2)))**2
776 gte12_num=(inlcls(1,l2)+clnoise(1,l2)) &
777 & *(inlcls(2,l1)+clnoise(2,l1)) &
778 & *fte12-(inlcls(3,l1)) &
779 & *(inlcls(3,l2))*fte21
780 gte21_num=(inlcls(1,l1)+clnoise(1,l1)) &
781 & *(inlcls(2,l2)+clnoise(2,l2)) &
782 & *fte21-(inlcls(3,l1)) &
783 & *(inlcls(3,l2))*fte12
785 aaltt = aaltt +ftt12**2 &
786 & /(inlcls(1,l1)+clnoise(1,l1)) &
787 & /(inlcls(1,l2)+clnoise(1,l2))
788 aalee = aalee +fee12**2 &
789 & /(inlcls(2,l1)+clnoise(2,l1)) &
790 & /(inlcls(2,l2)+clnoise(2,l2))
791 aalte = aalte + (fte12*gte12_num+fte21*gte21_num) &
794 ablttee= ablttee+ftt12*fee12 &
795 & *(inlcls(3,l1))*(inlcls(3,l2)) &
796 & /(inlcls(1,l1)+clnoise(1,l1)) &
797 & /(inlcls(1,l2)+clnoise(1,l2)) &
798 & /(inlcls(2,l1)+clnoise(2,l1)) &
799 & /(inlcls(2,l2)+clnoise(2,l2))
800 ablttte= ablttte+ftt12/gte12_den &
801 & /(inlcls(1,l1)+clnoise(1,l1)) &
802 & /(inlcls(1,l2)+clnoise(1,l2)) &
803 & *((inlcls(1,l1)+clnoise(1,l1)) &
804 & *(inlcls(3,l2))*gte12_num &
805 & +(inlcls(1,l2)+clnoise(1,l2)) &
806 & *(inlcls(3,l1))*gte21_num)
807 ableete= ableete+fee12/gte12_den &
808 & /(inlcls(2,l1)+clnoise(2,l1)) &
809 & /(inlcls(2,l2)+clnoise(2,l2)) &
810 & *((inlcls(2,l2)+clnoise(2,l2)) &
811 & *(inlcls(3,l1))*gte12_num &
812 & +(inlcls(2,l1)+clnoise(2,l1)) &
813 & *(inlcls(3,l2))*gte21_num)
817 ftb12=prefactor*wigner2*incls(3,l1) &
818 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
819 ftb21=prefactor*wigner2*incls(3,l2) &
820 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
821 feb12=prefactor*wigner2*incls(2,l1) &
822 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
823 feb21=prefactor*wigner2*incls(2,l2) &
824 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
827 & + ftb12**2/(inlcls(1,l1)+clnoise(1,l1)) &
828 & /(inlcls(4,l2)+clnoise(2,l2)) &
829 & + ftb21**2/(inlcls(1,l2)+clnoise(1,l2)) &
830 & /(inlcls(4,l1)+clnoise(2,l1))
832 & + feb12**2/(inlcls(2,l1)+clnoise(2,l1)) &
833 & /(inlcls(4,l2)+clnoise(2,l2)) &
834 & + feb21**2/(inlcls(2,l2)+clnoise(2,l2)) &
835 & /(inlcls(4,l1)+clnoise(2,l1))
838 & + ftb12*feb12*(inlcls(3,l1)) &
839 & /(inlcls(4,l2)+clnoise(2,l2)) &
840 & /(inlcls(1,l1)+clnoise(1,l1)) &
841 & /(inlcls(2,l1)+clnoise(2,l1)) &
842 & + ftb21*feb21*(inlcls(3,l2)) &
843 & /(inlcls(4,l1)+clnoise(2,l1)) &
844 & /(inlcls(1,l2)+clnoise(1,l2)) &
845 & /(inlcls(2,l2)+clnoise(2,l2))
859 aa0=(al2+2.d0)*(al2+1.d0) &
860 & *dsqrt((-al2+all+al1)*(al2-all+al1+1.d0) &
861 & *(al2+all-al1+1.d0)*(al2+all+al1+2.d0))
863 cc0=-(al2+1.d0)*(al2+2.d0) &
864 & *dsqrt((-al2+all+al1-1.d0)*(al2-all+al1+2.d0) &
865 & *(al2+all-al1+2.d0)*(al2+all+al1+3.d0))
867 wl20_inf=(bb0*wl20_mid+cc0*wl20_sup)/aa0
869 aa2=(al2+2.d0)*dsqrt(((al2+1.d0)**2-4.d0) &
870 & *(-al2+all+al1)*(al2-all+al1+1.d0) &
871 & *(al2+all-al1+1.d0)*(al2+all+al1+2.d0))
872 bb2=2.d0*(2.d0*al2+3.d0)*((al2+1.d0)*(al2+2.d0) &
873 & +all*(all+1.d0)-al1*(al1+1.d0))
874 cc2=-(al2+1.d0)*dsqrt(((al2+2.d0)**2-4.d0) &
875 & *(-al2+all+al1-1.d0)*(al2-all+al1+2.d0) &
876 & *(al2+all-al1+2.d0)*(al2+all+al1+3.d0))
878 wl22_inf=(bb2*wl22_mid+cc2*wl22_sup)/aa2
880 parity=(al1+all+al2)/2.d0
882 if (l2.le.lmaxm)
then
887 prefactor=dsqrt((2.d0*all+1.d0)*(2.d0*al1+1.d0) &
888 & *(2.d0*al2+1.d0)/(16.d0*3.14159d0))
890 if (dint(parity).eq.parity)
then
892 ftt12=prefactor*wigner0*(incls(1,l1) &
893 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
895 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
896 fee12=prefactor*wigner2*(incls(2,l1) &
897 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
899 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
900 fte12=prefactor*(wigner2*incls(3,l1) &
901 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)) &
902 & +wigner0*incls(3,l2) &
903 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)))
904 fte21=prefactor*(wigner2*incls(3,l2) &
905 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0)) &
906 & +wigner0*incls(3,l1) &
907 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0)))
909 gte12_den=(inlcls(1,l1)+clnoise(1,l1)) &
910 & *(inlcls(1,l2)+clnoise(1,l2)) &
911 & *(inlcls(2,l1)+clnoise(2,l1)) &
912 & *(inlcls(2,l2)+clnoise(2,l2)) &
914 & *(inlcls(3,l2)))**2
915 gte12_num=(inlcls(1,l2)+clnoise(1,l2)) &
916 & *(inlcls(2,l1)+clnoise(2,l1))*fte12 &
917 & -(inlcls(3,l1))*(inlcls(3,l2))*fte21
918 gte21_num=(inlcls(1,l1)+clnoise(1,l1)) &
919 & *(inlcls(2,l2)+clnoise(2,l2))*fte21 &
920 & -(inlcls(3,l1))*(inlcls(3,l2))*fte12
922 aaltt = aaltt +ftt12**2 &
923 & /(inlcls(1,l1)+clnoise(1,l1)) &
924 & /(inlcls(1,l2)+clnoise(1,l2))
925 aalee = aalee +fee12**2 &
926 & /(inlcls(2,l1)+clnoise(2,l1)) &
927 & /(inlcls(2,l2)+clnoise(2,l2))
928 aalte = aalte + (fte12*gte12_num+fte21*gte21_num) &
931 ablttee= ablttee+ftt12*fee12 &
932 & *(inlcls(3,l1))*(inlcls(3,l2)) &
933 & /(inlcls(1,l1)+clnoise(1,l1)) &
934 & /(inlcls(1,l2)+clnoise(1,l2)) &
935 & /(inlcls(2,l1)+clnoise(2,l1)) &
936 & /(inlcls(2,l2)+clnoise(2,l2))
937 ablttte= ablttte+ftt12/gte12_den &
938 & /(inlcls(1,l1)+clnoise(1,l1)) &
939 & /(inlcls(1,l2)+clnoise(1,l2)) &
940 & *((inlcls(1,l1)+clnoise(1,l1)) &
941 & *(inlcls(3,l2))*gte12_num &
942 & +(inlcls(1,l2)+clnoise(1,l2)) &
943 & *(inlcls(3,l1))*gte21_num)
944 ableete= ableete+fee12/gte12_den &
945 & /(inlcls(2,l1)+clnoise(2,l1)) &
946 & /(inlcls(2,l2)+clnoise(2,l2)) &
947 & *((inlcls(2,l2)+clnoise(2,l2)) &
948 & *(inlcls(3,l1))*gte12_num &
949 & +(inlcls(2,l1)+clnoise(2,l1)) &
950 & *(inlcls(3,l2))*gte21_num)
954 ftb12=prefactor*wigner2*incls(3,l1) &
955 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
956 ftb21=prefactor*wigner2*incls(3,l2) &
957 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
958 feb12=prefactor*wigner2*incls(2,l1) &
959 & *(all*(all+1.d0)+al1*(al1+1.d0)-al2*(al2+1.d0))
960 feb21=prefactor*wigner2*incls(2,l2) &
961 & *(all*(all+1.d0)+al2*(al2+1.d0)-al1*(al1+1.d0))
964 & + ftb12**2/(inlcls(1,l1)+clnoise(1,l1)) &
965 & /(inlcls(4,l2)+clnoise(2,l2)) &
966 & + ftb21**2/(inlcls(1,l2)+clnoise(1,l2)) &
967 & /(inlcls(4,l1)+clnoise(2,l1))
969 & + feb12**2/(inlcls(2,l1)+clnoise(2,l1)) &
970 & /(inlcls(4,l2)+clnoise(2,l2)) &
971 & + feb21**2/(inlcls(2,l2)+clnoise(2,l2)) &
972 & /(inlcls(4,l1)+clnoise(2,l1))
975 & + ftb12*feb12*(inlcls(3,l1)) &
976 & /(inlcls(4,l2)+clnoise(2,l2)) &
977 & /(inlcls(1,l1)+clnoise(1,l1)) &
978 & /(inlcls(2,l1)+clnoise(2,l1)) &
979 & + ftb21*feb21*inlcls(3,l2) &
980 & /(inlcls(4,l1)+clnoise(2,l1)) &
981 & /(inlcls(1,l2)+clnoise(1,l2)) &
982 & /(inlcls(2,l2)+clnoise(2,l2))
1004 aa0=(al2+2.d0)*(al2+1.d0)* &
1005 & dsqrt((-al2+all+al1)*(al2-all+al1+1.d0) &
1006 & *(al2+all-al1+1.d0)*(al2+all+al1+2.d0))
1008 cc0=-(al2+1.d0)*(al2+2.d0)* &
1009 & dsqrt((-al2+all+al1-1.d0)*(al2-all+al1+2.d0) &
1010 & *(al2+all-al1+2.d0)*(al2+all+al1+3.d0))
1012 wl20_inf=(bb0*wl20_mid+cc0*wl20_sup)/aa0
1014 aa2=(al2+2.d0)*dsqrt(((al2+1.d0)**2-4.d0) &
1015 & *(-al2+all+al1)*(al2-all+al1+1.d0) &
1016 & *(al2+all-al1+1.d0)*(al2+all+al1+2.d0))
1017 bb2=2.d0*(2.d0*al2+3.d0)*((al2+1.d0)*(al2+2.d0) &
1018 & +all*(all+1.d0)-al1*(al1+1.d0))
1019 cc2=-(al2+1.d0)*dsqrt(((al2+2.d0)**2-4.d0) &
1020 & *(-al2+all+al1-1.d0)*(al2-all+al1+2.d0) &
1021 & *(al2+all-al1+2.d0)*(al2+all+al1+3.d0))
1023 wl22_inf=(bb2*wl22_mid+cc2*wl22_sup)/aa2
1025 parity=(al1+all+al2)/2.d0
1027 if (l2.le.lmaxm)
then
1032 prefactor=dsqrt((2.d0*all+1.d0)*(2.d0*al1+1.d0) &
1033 & *(2.d0*al2+1.d0)/(16.d0*pi))
1035 if (dint(parity).eq.parity)
then
1037 ftt12=prefactor*wigner0*2.d0*incls(1,l1)*all*(all+1.d0)
1038 fee12=prefactor*wigner2*2.d0*incls(2,l1)*all*(all+1.d0)
1039 fte12=prefactor*(wigner2+wigner0)*incls(3,l1) &
1042 gte12_den=(inlcls(1,l1)+clnoise(1,l1))**2 &
1043 & *(inlcls(2,l1)+clnoise(2,l1))**2 &
1044 & -(inlcls(3,l1))**4
1045 gte12_num=((inlcls(1,l1)+clnoise(1,l1)) &
1046 & *(inlcls(2,l1)+clnoise(2,l1)) &
1047 & -(inlcls(3,l1))**2)*fte21
1049 aaltt = aaltt + ftt12**2 &
1050 & /(2.d0*(inlcls(1,l1)+clnoise(1,l1))**2)
1051 aalee = aalee + fee12**2 &
1052 & /(2.d0*(inlcls(2,l1)+clnoise(2,l1))**2)
1053 aalte = aalte + fte12*gte12_num &
1056 ablttee= ablttee+ftt12*fee12 &
1057 & /2.d0*(inlcls(3,l1))**2 &
1058 & /(inlcls(1,l1)+clnoise(1,l1))**2 &
1059 & /(inlcls(2,l1)+clnoise(2,l1))**2
1060 ablttte= ablttte+ftt12/gte12_den &
1061 & /(inlcls(1,l1)+clnoise(1,l1)) &
1062 & *(inlcls(3,l1))*gte12_num
1063 ableete= ableete+fee12/gte12_den &
1064 & /(inlcls(2,l1)+clnoise(2,l1)) &
1065 & *(inlcls(3,l1))*gte12_num
1069 ftb12=prefactor*wigner2*incls(3,l1)*all*(all+1.d0)
1070 feb12=prefactor*wigner2*incls(2,l1)*all*(all+1.d0)
1073 & + ftb12**2/(inlcls(1,l1)+clnoise(1,l1)) &
1074 & /(inlcls(4,l1)+clnoise(2,l1))
1076 & + feb12**2/(inlcls(2,l1)+clnoise(2,l1)) &
1077 & /(inlcls(4,l1)+clnoise(2,l1))
1080 & + ftb12*feb12*(inlcls(3,l1)) &
1081 & /(inlcls(4,l1)+clnoise(2,l1)) &
1082 & /(inlcls(1,l1)+clnoise(1,l1)) &
1083 & /(inlcls(2,l1)+clnoise(2,l1))
1092 aaltt = all*(all+1.d0)*(2.d0*all+1.d0)/aaltt
1093 aalee = all*(all+1.d0)*(2.d0*all+1.d0)/aalee
1094 aalte = all*(all+1.d0)*(2.d0*all+1.d0)/aalte
1095 aaltb = all*(all+1.d0)*(2.d0*all+1.d0)/aaltb
1096 aaleb = all*(all+1.d0)*(2.d0*all+1.d0)/aaleb
1097 ablttee= all*(all+1.d0)*(2.d0*all+1.d0)/ablttee
1098 ablttte= all*(all+1.d0)*(2.d0*all+1.d0)/ablttte
1099 ableete= all*(all+1.d0)*(2.d0*all+1.d0)/ableete
1100 abltbeb= all*(all+1.d0)*(2.d0*all+1.d0)/abltbeb
1102 lensingnoise(1,1) = aaltt
1103 lensingnoise(2,2) = aalee
1104 lensingnoise(3,3) = aalte
1105 lensingnoise(4,4) = aaltb
1106 lensingnoise(5,5) = aaleb
1108 lensingnoise(1,2) = aaltt*aalee/ablttee
1109 lensingnoise(1,3) = aaltt*aalte/ablttte
1110 lensingnoise(1,4) = 0.
1111 lensingnoise(1,5) = 0.
1112 lensingnoise(2,3) = aalee*aalte/ableete
1113 lensingnoise(2,4) = 0.
1114 lensingnoise(2,5) = 0.
1115 lensingnoise(3,4) = 0.
1116 lensingnoise(3,5) = 0.
1117 lensingnoise(4,5) = aaltb*aaleb/abltbeb
1119 lensingnoise(2,1) = lensingnoise(1,2)
1120 lensingnoise(3,1) = lensingnoise(1,3)
1121 lensingnoise(4,1) = lensingnoise(1,4)
1122 lensingnoise(5,1) = lensingnoise(1,5)
1123 lensingnoise(3,2) = lensingnoise(2,3)
1124 lensingnoise(4,2) = lensingnoise(2,4)
1125 lensingnoise(5,2) = lensingnoise(2,5)
1126 lensingnoise(4,3) = lensingnoise(3,4)
1127 lensingnoise(5,3) = lensingnoise(3,5)
1128 lensingnoise(5,4) = lensingnoise(4,5)
1133 gaussveclens(l1,1)=1.
1135 invlensingnoise(l1,l2)=lensingnoise(l1,l2)
1139 call gaussj(invlensingnoise,5,5,gaussveclens,1,1)
1141 minvarnoise_l(jj)=0.
1145 minvarnoise_l(jj)=minvarnoise_l(jj)+invlensingnoise(l1,l2)
1149 minvarnoise_l(jj)=1.d0/minvarnoise_l(jj)
1168 alogllens(jj)=log(all)
1174 allocate(ddminvarnoise_l(1:jjmaxt))
1175 call spline(alogllens,minvarnoise_l,jjmaxt, &
1176 & 0.d0,0.d0,ddminvarnoise_l)
1185 call splint(alogllens,minvarnoise_l,ddminvarnoise_l, &
1186 & jjmaxt,log(dble(l)),nldd(l))
1205 SUBROUTINE gaussj(a,n,np,b,m,mp)
1207 INTEGER m,mp,n,np,NMAX
1208 REAL*8 a(np,np),b(np,mp)
1218 INTEGER i,icol,irow,j,k,l,ll,indxc(nmax),indxr(nmax),ipiv(nmax)
1221 REAL*8 big,dum,pivinv
1231 if(ipiv(j).ne.1)
then
1233 if (ipiv(k).eq.0)
then
1234 if (abs(a(j,k)).ge.big)
then
1243 ipiv(icol)=ipiv(icol)+1
1244 if (irow.ne.icol)
then
1260 if (a(icol,icol).eq.0.) stop
'singular matrix in gaussj'
1262 pivinv=1./a(icol,icol)
1265 a(icol,l)=a(icol,l)*pivinv
1268 b(icol,l)=b(icol,l)*pivinv
1277 a(ll,l)=a(ll,l)-a(icol,l)*dum
1280 b(ll,l)=b(ll,l)-b(icol,l)*dum
1290 if(indxr(l).ne.indxc(l))
then
1293 a(k,indxr(l))=a(k,indxc(l))
1300 END SUBROUTINE gaussj
1305 SUBROUTINE spline(x,y,n,yp1,ypn,y2)
1307 double precision yp1,ypn,x(n),y(n),y2(n)
1310 double precision p,qn,sig,un,u(nmax)
1311 if (yp1.gt..99d30)
then
1316 u(1)=(3.d0/(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1)
1319 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1))
1322 u(i)=(6.d0*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1)) &
1323 & /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p
1325 if (ypn.gt..99d30)
then
1330 un=(3.d0/(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1)))
1332 y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.d0)
1334 y2(k)=y2(k)*y2(k+1)+u(k)
1338 END subroutine spline
1342 subroutine splint(xa,ya,y2a,n,x,y)
1345 double precision x,y,xa(n),y2a(n),ya(n)
1348 double precision a,b,h
1352 1
if (khi-klo.gt.1)
then
1362 if (h.eq.0.) stop
'bad xa input in splint'
1365 y=a*ya(klo)+b*ya(khi) + &
1366 & ((a**3-a)*y2a(klo)+(b**3-b)*y2a(khi))*(h**2)/6.
1368 end subroutine splint
This module contains the code to compute the noise for CMB lensing.
subroutine, public calc_nldd(incls, inlcls, clnoise, nldd, jjmaxTmax, lmaxM)
This subroutine computes the noise for the Okamoto & Hu's estimator of the CMB lensing.