90
91
92
93
94
95
96 DOUBLE PRECISION DD1,DD2,DX1,DY1
97
98
99 DOUBLE PRECISION DPARAM(5)
100
101
102
103
104
105 DOUBLE PRECISION DFLAG,DH11,DH12,DH21,DH22,DP1,DP2,DQ1,DQ2,DTEMP,
106 $ DU,GAM,GAMSQ,ONE,RGAMSQ,TWO,ZERO
107
108
109 INTRINSIC dabs
110
111
112
113 DATA zero,one,two/0.d0,1.d0,2.d0/
114 DATA gam,gamsq,rgamsq/4096.d0,16777216.d0,5.9604645d-8/
115
116
117 IF (dd1.LT.zero) THEN
118
119 dflag = -one
120 dh11 = zero
121 dh12 = zero
122 dh21 = zero
123 dh22 = zero
124
125 dd1 = zero
126 dd2 = zero
127 dx1 = zero
128 ELSE
129
130 dp2 = dd2*dy1
131 IF (dp2.EQ.zero) THEN
132 dflag = -two
133 dparam(1) = dflag
134 RETURN
135 END IF
136
137 dp1 = dd1*dx1
138 dq2 = dp2*dy1
139 dq1 = dp1*dx1
140
141 IF (dabs(dq1).GT.dabs(dq2)) THEN
142 dh21 = -dy1/dx1
143 dh12 = dp2/dp1
144
145 du = one - dh12*dh21
146
147 IF (du.GT.zero) THEN
148 dflag = zero
149 dd1 = dd1/du
150 dd2 = dd2/du
151 dx1 = dx1*du
152 ELSE
153
154
155
156 dflag = -one
157 dh11 = zero
158 dh12 = zero
159 dh21 = zero
160 dh22 = zero
161
162 dd1 = zero
163 dd2 = zero
164 dx1 = zero
165 END IF
166 ELSE
167
168 IF (dq2.LT.zero) THEN
169
170 dflag = -one
171 dh11 = zero
172 dh12 = zero
173 dh21 = zero
174 dh22 = zero
175
176 dd1 = zero
177 dd2 = zero
178 dx1 = zero
179 ELSE
180 dflag = one
181 dh11 = dp1/dp2
182 dh22 = dx1/dy1
183 du = one + dh11*dh22
184 dtemp = dd2/du
185 dd2 = dd1/du
186 dd1 = dtemp
187 dx1 = dy1*du
188 END IF
189 END IF
190
191
192 IF (dd1.NE.zero) THEN
193 DO WHILE ((dd1.LE.rgamsq) .OR. (dd1.GE.gamsq))
194 IF (dflag.EQ.zero) THEN
195 dh11 = one
196 dh22 = one
197 dflag = -one
198 ELSE
199 dh21 = -one
200 dh12 = one
201 dflag = -one
202 END IF
203 IF (dd1.LE.rgamsq) THEN
204 dd1 = dd1*gam**2
205 dx1 = dx1/gam
206 dh11 = dh11/gam
207 dh12 = dh12/gam
208 ELSE
209 dd1 = dd1/gam**2
210 dx1 = dx1*gam
211 dh11 = dh11*gam
212 dh12 = dh12*gam
213 END IF
214 ENDDO
215 END IF
216
217 IF (dd2.NE.zero) THEN
218 DO WHILE ( (dabs(dd2).LE.rgamsq) .OR. (dabs(dd2).GE.gamsq) )
219 IF (dflag.EQ.zero) THEN
220 dh11 = one
221 dh22 = one
222 dflag = -one
223 ELSE
224 dh21 = -one
225 dh12 = one
226 dflag = -one
227 END IF
228 IF (dabs(dd2).LE.rgamsq) THEN
229 dd2 = dd2*gam**2
230 dh21 = dh21/gam
231 dh22 = dh22/gam
232 ELSE
233 dd2 = dd2/gam**2
234 dh21 = dh21*gam
235 dh22 = dh22*gam
236 END IF
237 END DO
238 END IF
239
240 END IF
241
242 IF (dflag.LT.zero) THEN
243 dparam(2) = dh11
244 dparam(3) = dh21
245 dparam(4) = dh12
246 dparam(5) = dh22
247 ELSE IF (dflag.EQ.zero) THEN
248 dparam(3) = dh21
249 dparam(4) = dh12
250 ELSE
251 dparam(2) = dh11
252 dparam(5) = dh22
253 END IF
254
255 dparam(1) = dflag
256 RETURN
257
258
259