00001 SUBROUTINE CWRSK(ZR, FNU, KODE, N, Y, NZ, CW, TOL, ELIM, ALIM)
00002
00003
00004
00005
00006
00007
00008
00009
00010 COMPLEX CINU, CSCL, CT, CW, C1, C2, RCT, ST, Y, ZR
00011 REAL ACT, ACW, ALIM, ASCLE, ELIM, FNU, S1, S2, TOL, YY
00012 INTEGER I, KODE, N, NW, NZ
00013 DIMENSION Y(N), CW(2)
00014
00015
00016
00017
00018
00019 NZ = 0
00020 CALL CBKNU(ZR, FNU, KODE, 2, CW, NW, TOL, ELIM, ALIM)
00021 IF (NW.NE.0) GO TO 50
00022 CALL CRATI(ZR, FNU, N, Y, TOL)
00023
00024
00025
00026
00027 CINU = CMPLX(1.0E0,0.0E0)
00028 IF (KODE.EQ.1) GO TO 10
00029 YY = AIMAG(ZR)
00030 S1 = COS(YY)
00031 S2 = SIN(YY)
00032 CINU = CMPLX(S1,S2)
00033 10 CONTINUE
00034
00035
00036
00037
00038
00039
00040 ACW = CABS(CW(2))
00041 ASCLE = 1.0E+3*R1MACH(1)/TOL
00042 CSCL = CMPLX(1.0E0,0.0E0)
00043 IF (ACW.GT.ASCLE) GO TO 20
00044 CSCL = CMPLX(1.0E0/TOL,0.0E0)
00045 GO TO 30
00046 20 CONTINUE
00047 ASCLE = 1.0E0/ASCLE
00048 IF (ACW.LT.ASCLE) GO TO 30
00049 CSCL = CMPLX(TOL,0.0E0)
00050 30 CONTINUE
00051 C1 = CW(1)*CSCL
00052 C2 = CW(2)*CSCL
00053 ST = Y(1)
00054
00055
00056
00057
00058 CT = ZR*(C2+ST*C1)
00059 ACT = CABS(CT)
00060 RCT = CMPLX(1.0E0/ACT,0.0E0)
00061 CT = CONJG(CT)*RCT
00062 CINU = CINU*RCT*CT
00063 Y(1) = CINU*CSCL
00064 IF (N.EQ.1) RETURN
00065 DO 40 I=2,N
00066 CINU = ST*CINU
00067 ST = Y(I)
00068 Y(I) = CINU*CSCL
00069 40 CONTINUE
00070 RETURN
00071 50 CONTINUE
00072 NZ = -1
00073 IF(NW.EQ.(-2)) NZ=-2
00074 RETURN
00075 END