Télécharger sb.eso

Retour à la liste

Numérotation des lignes :

sb
  1. C SB SOURCE CB215821 22/11/16 21:15:04 11500
  2. C SBFIT SOURCE CB215821 16/04/21 21:18:22 8920
  3. SUBROUTINE SB(Xbar, Sigma, RTB1, B2, Gamma, Delta, Xlam, Xi,
  4. $ FAULT)
  5. IMPLICIT INTEGER(I-N)
  6. IMPLICIT REAL*8 (A-H,O-Z)
  7. REAL*8 HMU(6), Deriv(4), DD(4), Xbar, Sigma, RTB1,
  8. $ Xlam, Xi, TT, Tol, RB1, B1, E, U, X, Y, W, F, D, G, S, H2, T,
  9. $ H2A, H2B, H3, H4, RBET, BET2,B2, Gamma, Delta
  10. LOGICAL NEG, FAULT
  11. DATA TT, Tol, LIMIT /1.0E-4, 0.01D0, 50/
  12. C
  13. C
  14. RB1 = ABS(RTB1)
  15. B1 = RB1 * RB1
  16. NEG = RTB1.LT.0.D0
  17. C
  18. C Calcul de D = premiere approximation de Delta
  19. C
  20. E = B1 + 1.D0
  21. U = 1.D0 / 3.D0
  22. X = 0.5D0 * B1 + 1.D0
  23. Y = RB1 * SQRT(0.25D0 * B1 + 1.D0)
  24. W = (X + Y) ** U + (X - Y) ** U - 1.D0
  25. F = W * W * (3.D0 + W * (2.D0 + W)) - 3.D0
  26. E = (B2 - E) / (F-E)
  27. IF (ABS(RB1).GT.Tol) GOTO 5
  28. F = 2.D0
  29. GOTO 20
  30. 5 D = 1.D0 / SQRT(LOG(W))
  31. IF (D.LT.0.64D0) WRITE (*,*) 'D < 0.64'
  32. IF (D.LT.0.64D0) GOTO 10
  33. F = 2.D0 - 8.5245D0 / (D * (D * (D - 2.163D0) + 11.346D0))
  34. GOTO 20
  35. 10 F = 1.25D0 * D
  36. 20 F = E * F + 1.D0
  37. IF (F.LT.1.8D0) GOTO 25
  38. D = (0.626D0 * F - 0.408D0) * (3.D0 - F) ** (-0.479D0)
  39. GOTO 30
  40. 25 D = 0.8D0 * (F - 1.D0)
  41. C
  42. C Calcul de G = premiere approximation de Gamma
  43. C
  44. 30 G = 0.D0
  45. IF (B1.LT.TT) GOTO 70
  46. IF (D.GT.1.D0) GOTO 40
  47. G = (0.7466D0 * D ** 1.7973D0 + 0.5955D0)*B1**0.485D0
  48. GOTO 70
  49. 40 IF (D.LE.2.5) GOTO 50
  50. U = 0.0124D0
  51. Y = 0.5291D0
  52. GOTO 60
  53. 50 U = 0.0623D0
  54. Y = 0.4043D0
  55. 60 G = B1 ** (U * D + Y) * (0.9281D0+D*(1.0614D0*D-0.7077D0))
  56. 70 M = 0
  57. C
  58. C Boucle iterative principale
  59. C
  60. 80 M = M + 1
  61. C WRITE (*,*) 'M =',M
  62. FAULT = M.GT.LIMIT
  63. IF (FAULT) WRITE (*,*) 'Depassement limite dans bcle principale'
  64. IF (FAULT) RETURN
  65. C
  66. C Calcul des 6.D0 premiers moments associes a G et D
  67. C
  68. CALL MOM(G, D, HMU, FAULT)
  69. C WRITE (*,*) '(MOM) G =',G
  70. C WRITE (*,*) '(MOM) D =',D
  71. C IF (FAULT) WRITE (*,*) 'ERREUR DANS MOM'
  72. IF (FAULT) RETURN
  73. S = HMU(1) * HMU(1)
  74. H2 = HMU(2) - S
  75. FAULT = H2.LE.0.D0
  76. IF (FAULT) RETURN
  77. T = SQRT(H2)
  78. H2A = T * H2
  79. H2B = H2 * H2
  80. H3 = HMU(3) - HMU(1) * (3.D0 * HMU(2) - 2.D0 * S)
  81. RBET = H3 / H2A
  82. H4 = HMU(4) - HMU(1) * (4.D0 * HMU(3) - HMU(1) *
  83. $ (6.D0 * HMU(2) - 3.D0 * S))
  84. BET2 = H4 / H2B
  85. W = G * D
  86. U = D * D
  87. C
  88. C Calcul des derivees
  89. C
  90. DO 120 J = 1,2
  91. DO 110 K = 1,4
  92. T = K
  93. IF (J.EQ.1) GOTO 90
  94. S = ((W - T) * (HMU(K) - HMU(K+1)) + (T + 1.D0) *
  95. $ (HMU(K+1) - HMU(K+2))) / U
  96. GOTO 100
  97. 90 S = HMU(K+1) - HMU(K)
  98. 100 DD(K) = T * S / D
  99. 110 CONTINUE
  100. T = 2.D0 * HMU(1) * DD(1)
  101. S = HMU(1) * DD(2)
  102. Y = DD(2) - T
  103. DERIV(J) = (DD(3) - 3.D0 * (S + HMU(2) * DD(1) - T *
  104. $ HMU(1)) - 1.5D0 * H3 * Y / H2) / H2A
  105. DERIV (J+2) = (DD(4) - 4.D0 * (DD(3) * HMU(1) + DD(1) *
  106. $ HMU(3)) + 6.D0 * (HMU(2) * T + HMU(1) * (S - T * HMU(1)))
  107. $ - 2.D0 * H4 * Y / H2) / H2B
  108. 120 CONTINUE
  109. T = 1.D0 / (DERIV(1) * DERIV(4) - DERIV(2) * DERIV(3))
  110. U = (DERIV(4) * (RBET - RB1) - DERIV(2) * (BET2 - B2)) * T
  111. Y = (DERIV(1) * (BET2 - B2) - DERIV(3) * (RBET - RB1)) * T
  112. C
  113. C Calcul des nouvelles estimations de G et D
  114. C
  115. G = G - U
  116. IF (B1.EQ.0.D0.OR.G.LT.0.D0) G = 0.D0
  117. D = D - Y
  118. IF ( ABS(U).GT.TT.OR.ABS(Y).GT.TT) GOTO 80
  119. C
  120. C Fin des iterations
  121. C
  122. C WRITE (*,*) 'Fin des iterations '
  123. Delta = D
  124. Xlam = Sigma / SQRT(H2)
  125. IF (NEG) GOTO 130
  126. Gamma = G
  127. GOTO 140
  128. 130 Gamma = -G
  129. HMU(1) = 1.D0 - HMU(1)
  130. 140 Xi = Xbar - Xlam * HMU(1)
  131. RETURN
  132. END
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales