Télécharger ravc.eso

Retour à la liste

Numérotation des lignes :

ravc
  1. C RAVC SOURCE CB215821 20/11/25 13:38:29 10792
  2. subroutine ravc
  3. IMPLICIT INTEGER(I-N)
  4. IMPLICIT REAL*8(A-H,O-Z)
  5.  
  6. -INC PPARAM
  7. -INC CCOPTIO
  8. -INC SMCHPOI
  9. -INC SMELEME
  10. -INC SMCOORD
  11. segment icpr(nbpts)
  12. call lirobj ( 'CHPOINT',MCHPO1, 1,iretou)
  13. if(ierr . ne.0) return
  14. call lirobj ( 'CHPOINT',MCHPO2, 1,iretou)
  15. if(ierr . ne.0) return
  16. call lirobj ( 'CHPOINT',MCHPO3, 1,iretou)
  17. if(ierr . ne.0) return
  18. segact mchpo1, mchpo2,mchpo3
  19. if(mchpo1.ipchp(/1). ne . 1) then
  20. * write(6,*) ' erreur 1 '
  21. call erreur(19)
  22. return
  23. endif
  24. if(mchpo2.ipchp(/1). ne . 1) then
  25. * write(6,*) ' erreur 2 '
  26. call erreur(19)
  27. return
  28. endif
  29. if(mchpo3.ipchp(/1). ne . 1) then
  30. * write(6,*) ' erreur 3 '
  31. call erreur(19)
  32. return
  33. endif
  34. msoup1= mchpo1.ipchp(1)
  35. msoup2= mchpo2.ipchp(1)
  36. msoup3= mchpo3.ipchp(1)
  37. segact msoup1,msoup2,msoup3
  38. ipt1=msoup1.igeoc
  39. ipt2=msoup2.igeoc
  40. ipt3=msoup3.igeoc
  41. segact ipt1,ipt2,ipt3
  42. segini icpr
  43. n1 = ipt1.num(/2)
  44. n2 = ipt2.num(/2)
  45. n3 = ipt3.num(/2)
  46. ipo=0
  47. do 100 i=1,n1
  48. ia=ipt1.num(1,i)
  49. if(icpr(ia).eq.0) then
  50. ipo=ipo+1
  51. icpr(ia)=ipo
  52. endif
  53. 100 continue
  54. do 101 i=1,n2
  55. ia=ipt2.num(1,i)
  56. if(icpr(ia).eq.0) then
  57. ipo=ipo+1
  58. icpr(ia)=ipo
  59. endif
  60. 101 continue
  61. do 102 i=1,n3
  62. ia=ipt3.num(1,i)
  63. if(icpr(ia).eq.0) then
  64. ipo=ipo+1
  65. icpr(ia)=ipo
  66. endif
  67. 102 continue
  68. nbelem=ipo
  69. nbnn=1
  70. nbsous=0
  71. nbref=0
  72. segini meleme
  73. itypel=1
  74. do 103 i=1,icpr(/1)
  75. if(icpr(I).ne.0) then
  76. num(1,icpr(i))=i
  77. endif
  78. 103 continue
  79.  
  80. * write(6,*) ' ipt1',(ipt1.num(1,iou),iou=1,ipt1.num(/2))
  81. * write(6,*) ' ipt2',(ipt2.num(1,iou),iou=1,ipt2.num(/2))
  82. * write(6,*) ' ipt3',(ipt3.num(1,iou),iou=1,ipt3.num(/2))
  83. * if( (n1.ne.n2). or .(n1.ne.n3))then
  84. * write(6,*) ' erreur 4 '
  85. * call erreur(19)
  86. * return
  87. * endif
  88. if( msoup1.noharm(/1) . ne . 1) then
  89. * write(6,*) ' erreur 5 '
  90. call erreur(19)
  91. return
  92. endif
  93. if( msoup2.noharm(/1) . ne . 1) then
  94. * write(6,*) ' erreur 6 '
  95. call erreur(19)
  96. return
  97. endif
  98. if( msoup3.noharm(/1) . ne . 1) then
  99. * write(6,*) ' erreur 7 '
  100. call erreur(19)
  101. return
  102. endif
  103. segini,mchpoi=mchpo1
  104. segini,msoupo=msoup1
  105. ipchp(1)=msoupo
  106. mpova1=msoup1.ipoval
  107. mpova2=msoup2.ipoval
  108. mpova3=msoup3.ipoval
  109. segact mpova1,mpova2,mpova3
  110. n=nbelem
  111. nc=1
  112. segini mpoval
  113. ipoval=mpoval
  114. igeoc=meleme
  115. * write(6,*) ' meleme' , ( num(1,iou),iou=1,nbelem)
  116. *
  117. * on cherche les max de chaque champs
  118. *
  119. * amma=0.
  120. * bmma=0.
  121. * cmma=0.
  122. * do 10 i=1,nbelem
  123. * if(amma.le.(abs(mpova1.vpocha(i,1))))amma=abs(mpova1.vpocha(i,1))
  124. * if(bmma.le.(abs(mpova2.vpocha(i,1))))bmma=abs(mpova2.vpocha(i,1))
  125. * if(cmma.le.(abs(mpova3.vpocha(i,1))))cmma=abs(mpova3.vpocha(i,1))
  126. * 10 continue
  127. *
  128. * calcul des racines
  129. *
  130. do 1 j=1,nbelem
  131. ia = num(1,j)
  132. * write(6,*) ' ia ' , ia
  133. a = 0.d0
  134. do 8 i=1,n1
  135. if( ipt1.num(1,i).eq.ia)then
  136. a = mpova1.vpocha(i,1)
  137. go to 9
  138. endif
  139. 8 continue
  140. 9 continue
  141. b=0.d0
  142. do 2 k=1,n2
  143. if(ipt2.num(1,k).eq.ia) then
  144. b = mpova2.vpocha(k,1)
  145. go to 3
  146. endif
  147. 2 continue
  148. 3 continue
  149. c=0.d0
  150. do 4 l=1,n3
  151. if(ipt3.num(1,l).eq.ia)then
  152. c = mpova3.vpocha(l,1)
  153. go to 5
  154. endif
  155. 4 continue
  156. 5 continue
  157.  
  158. * test sur les grandeurs
  159. * write (6,*) ' a b c ',a,b,c
  160. if( a . eq. 0.d0. or . abs(a).lt. (abs(b)*1.e-13))then
  161. * on resoud une seule equation
  162. if( b . ne . 0.d0) then
  163. xx = -c / b
  164. if( xx .ge. 0.d0 ) xx = 0.d0
  165. else
  166. xx = 0.d0
  167. endif
  168. else
  169. xx=0.d0
  170. delta2 = ( b*b - 4*a*c)
  171. if (delta2.lt. b*b*1d-13) then
  172. xx = -b/(2.d0*a)
  173. xx = min(xx,0.d0)
  174. xx = 0.d0
  175. ** write (6,*) ' ravc discriminant negatif ',delta2,b
  176. else
  177. delta2=max(0.d0,delta2)
  178. delta = sqrt (delta2)
  179. s1= (-b + delta )/ (2.*a)
  180. s2= (-b - delta) / (2.*a)
  181. s1=min(s1,0.d0)
  182. s2=min(s2,0.d0)
  183. * write (6,*) ' s1 s2 ' , s1,s2
  184. if( s1. gt . s2) then
  185. if( s1 . lt. 0.d0) then
  186. xx = s1
  187. else
  188. if(s2.lt.0.d0) xx = s2
  189. endif
  190. else
  191. if( s2 . lt. 0.d0) then
  192. xx = s2
  193. else
  194. if(s1.lt.0.d0) xx = s1
  195. endif
  196. endif
  197. endif
  198. endif
  199. ** write (6,*) ' xx ',xx
  200. vpocha(j,1)=xx
  201. 1 continue
  202. segdes mpova1,mpova2,mpova3,mpoval
  203. segdes ipt1,ipt2,ipt3,meleme
  204. segdes msoupo,msoup1,msoup2,msoup3
  205. segdes mchpoi,mchpo1,mchpo2,mchpo3
  206. segsup icpr
  207. call ecrobj('CHPOINT',mchpoi)
  208. return
  209. end
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  

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