IF (CI( I) .EQ. 0. 



) GO 



TO 42 



TEMP = 



= CB( I)**2 







TEM = 



TEMP**2 







TEMPI 



- CI(I) 







C0EF1 



= CI(I) 







C0EF2 



= 2. * TEMP 



* CI(I) + 



C0EF3 



= 2. * T * 



CB(I) 





C0EF4 



= TEM * CI(I ) - 



TEMP 



OLDFN 



= 1.D20 







DO 41 



J = 1,10 







114 IF (BLPK(I) .LE. 0.) GO TO 37 



115 T = 2izui .■o^^lOti / BLPK(I) 



116 CBI(I) = T - SORT ((T - CB(I)) ♦ (T + CB(1))) 



117 37 T = C(I) * (C(I)**2 - 3. * CI(I)**2) 



118 TI = CI(I) * (3. * C(I)**2 - CI(I)**2) 



119 IF (BLPK(I) .LT. 0.) GO TO 39 



120 TEMP = CB(I)**2 - CBI(I)**2 



121 TEMPI = 2. * CB(I) * CBI(I) 



122 DENOM = TEMP**2 + TEMP1**2 



123 TEMP = TEMP / DENOM 



124 TEMPI = -TEMPI / DENOM 



125 GAMMA(I) = 0.5 ♦ (C(I) - (T * TEMP - TI * TEMPI)) / 



126 * (Z(I + 1 ) - Z(I)) 



127 GAMMAI(I) = 0.5 * (CI(I) - (T * TEMPI + TI * TEMP)) / 



128 * (Z(I+1 ) - Z(I)) 



129 IF (I .EO. N) GO TO 27 



130 GO TO 33 



131 C **SPECIAL CASE, GRADIENT REAL NUMBER 



132 3 

 133 

 134 

 135 

 136 



137 C0EF2 = 2. * TEMP * CI(I) + TI 

 138 

 139 

 140 

 141 



142 FN= (((C0EF1 ♦ TEMPI) + C0EF2) * TEMPI + C0EF3) * TEMPI + C0EF4 



143 FP = ((4. * C0EF1 * TEMPI) + 2. * C0EF2) * TEMPI + C0EF3 



144 TEMPI = TEMPI - FN / FP 



145 IF (FN .GE. OLDFN) GO TO 43 

 14fi OLDFN = FN 



147 41 CONTINUE 



148 43 CBI(I) = TEMPI 



149 GAMMA(I) = .5 *(.5 * (CI(I) *(TEMP - CBI(I)**2) - TI) / 



150 * (CBII) ♦ TEMPI) + C(I)) / (Z(I+1) - Z(I)) 



151 GO TO 28 



152 42 GAMMA(I) = C(I) - T / (CB(I)**2 * (Z(I+1) - Z(I)) ♦ 2.) 



153 GO TO 33 



154 C ♦*SOUND SDEED AND GRADIENT GIVEN 



155 38 IF (I .EO. N) GO TO 33 



156 T = C(I) * (C(I)**2 - 3. * CI(I)**2) 



157 TI = CI(I) * (3. * C(I)**2 - CI(I)**2) 



158 IF (BLPK(I) .EO. 0.) GO TO 29 



159 IF (BLPK(I) .LT. 0.) GO TO 28 



160 TEMP = (BLPK(I) / 54575 .0541 6) * *2 / (Z(I+1) - Z(I)) * 0.5 



161 T = T * TEMP 



162 TI = TI * TEMP 



163 TEMP = .5 * C(I) / (Z(I+1 ) - Z(I)) - GAMMA ( I ) + T 



164 T = -(TI - SORT( TI * TI + T * TEMP)) / T 



165 CB(I) = 54575.05416 * T / BLPK(I) / (1, + T * T) 



166 CBI(I) = CB(I) / T 



167 GO TO 37 



168 C **SPECIAL CASE, GRADIENT REAL NUMBER 



169 28 TEMP = C(I) - 2. * GAMMA( I ) * (Z(I+1) - Z( I ) ) 



170 TEM = TEMP**2 + CI(I)**2 



46 



