Télécharger lfcdi2.eso

Retour à la liste

Numérotation des lignes :

lfcdi2
  1. C LFCDI2 SOURCE PV090527 24/02/21 21:15:03 11846
  2. SUBROUTINE LFCDI2(NBAND,LMAX,R,IRETOU,IFORM)
  3. IMPLICIT INTEGER(I-N)
  4. IMPLICIT REAL*8 (A-H,O-Z)
  5.  
  6. -INC PPARAM
  7. -INC CCOPTIO
  8. -INC CCFXDR
  9. DIMENSION R(*)
  10. dimension rc(lmax+1)
  11. external long
  12. ipas=0
  13. 10 IRETOU=0
  14. ios=1
  15. IF (LMAX.EQ.0) return
  16. IF(IONIVE.le.19) THEN
  17. lmaxl=lmax
  18. IF (IFORM.EQ.1) then
  19. if (ionive.gt.2) then
  20. READ(NBAND,8003,END=1001,ERR=1000)(R(I),I=1,LMAX)
  21. else
  22. READ(NBAND,8002,END=1001,ERR=1000)(R(I),I=1,LMAX)
  23. endif
  24. endif
  25. IF (IFORM.EQ.0)READ(NBAND,END=1001,ERR=1000)(R(I),I=1,LMAX)
  26. if (iform.eq.2) then
  27. ios=ixdrdmat(ixdrr,lmaxl,r(1))
  28. if (ios.lt.0) goto 1001
  29. endif
  30. return
  31. Else
  32. ** niveau >= 20
  33. IF(IFORM.EQ.1)then
  34. READ(NBAND,8004,END=1001,ERR=1000)lc
  35. if(lc.gt.lmax+1) goto 1000
  36. READ(NBAND,8003,END=1001,ERR=1000)(rc(I),I=1,Lc)
  37. endif
  38. IF(IFORM.EQ.0)then
  39. READ(NBAND,END=1001,ERR=1000) lc
  40. if(lc.gt.lmax+1) goto 1000
  41. READ(NBAND,END=1001,ERR=1000) (rc(I),I=1,Lc)
  42. endif
  43. if(iform.eq.2) then
  44. ios=ixdrint(ixdrr,lc)
  45. if (ios.lt.0) goto 1001
  46. if (lc.gt.0) then
  47. if(lc.gt.lmax+1) goto 1000
  48. lmaxl=lc
  49. ios=ixdrdmat(ixdrr,lmaxl,rc(1))
  50. ** write (6,*) ' lc ios lmax - 1 ',lc,ios,lmax
  51. if (ios.lt.0) goto 1001
  52. else
  53. nc=-lc
  54. do is=0,nc-1
  55. ios=ixdrint(ixdrr,lc)
  56. ** write (6,*) ' lecture de ',lc,' en ',is*500000000+1
  57. ios=ixdrdmat(ixdrr,lc,rc(is*500000000+1))
  58. if (ios.lt.0) goto 1001
  59. enddo
  60.  
  61. endif
  62. endif
  63. * decompression
  64. i=0
  65. ic=0
  66. icp=0
  67. 1954 continue
  68. if (ic.ge.lc) goto 1955
  69. icp=ic+1
  70. if (rc(icp).gt.0.) then
  71. * comprime
  72. ic=icp+1
  73. do j=1,int(rc(icp))
  74. i=i+1
  75. r(i)=rc(ic)
  76. enddo
  77. ic=icp+1
  78. goto 1954
  79. else
  80. * non comprime
  81. ic=icp
  82. do j=1,int(-rc(icp))
  83. i=i+1
  84. ic=ic+1
  85. r(i)=rc(ic)
  86. enddo
  87. endif
  88. goto 1954
  89. 1955 continue
  90. if (i.ne.lmax) write (6,*) ' pb dans la decompression lfcdi2'
  91. goto 1
  92. endif
  93. 1000 IRETOU=1
  94. write (6,*) ' erreur lfcdi2 '
  95. 1 RETURN
  96. 1001 ll=long (nomres)
  97. ificle=ificle+1
  98. * write(6,*)' ificle ' , ificle
  99. if(ificle.eq.10000)then
  100. call erreur (945)
  101. iretou=1
  102. return
  103. endif
  104. if(ificle.eq.1) then
  105. nomres(ll+1:ll+2)='_1'
  106. ll=ll+2
  107. elseif ( ificle.lt.10) then
  108. write(nomres(ll:ll),fmt='(I1)')ificle
  109. elseif ( ificle.lt.100) then
  110. if(ificle.eq.10)ll = ll + 1
  111. write(nomres(ll-1:ll),fmt='(I2)')ificle
  112. elseif ( ificle.lt.1000) then
  113. if(ificle.eq.100)ll = ll + 1
  114. write(nomres(ll-2:ll),fmt='(I3)')ificle
  115. elseif ( ificle.lt.10000) then
  116. if(ificle.eq.1000)ll = ll + 1
  117. write(nomres(ll-3:ll),fmt='(I4)')ificle
  118. endif
  119. if (iform.ne.2) close (unit=nband)
  120. if (iform.eq.2) ios=IXDRCLOSE( ixdrr,.true.)
  121. * write(6,*) ' fermeture et ouverture de ',nomres(1:ll)
  122. if(iform.eq.1) then
  123. OPEN (UNIT=NBAND,STATUS='UNKNOWN',FILE=NOMRES(1:ll),
  124. # IOSTAT=IOS,ERR=2000,FORM='FORMATTED')
  125. ELSEif (iform.eq.0) then
  126. OPEN (UNIT=NBAND,STATUS='UNKNOWN',FILE=NOMRES(1:ll),
  127. # IOSTAT=IOS,ERR=2000,FORM='UNFORMATTED')
  128. else
  129. ios=INITXDR( NOMRES(1:ll),'r',.true.)
  130. if (ios.lt.0) goto 2000
  131. ENDIF
  132. write (6,*) 'Ouverture du fichier : ',nomres(1:ll)
  133. go to 10
  134. C --------------------
  135. 8004 FORMAT(i15)
  136. 8002 FORMAT(1P,6E13.6)
  137. 8003 FORMAT(1P,3E22.14)
  138. 2000 MOTERR=NOMRES(1:ll)
  139. INTERR(1)=IOS
  140. CALL ERREUR(424)
  141. RETURN
  142. END
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  

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