next.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\utils\damocles\next.f
00002 !
00061                      INTEGER FUNCTION NEXT
00062 !                    *********************
00063 !
00064      &( ICOL , LIGNE )
00065 !
00066 !***********************************************************************
00067 ! DAMOCLES   V6P0                                   21/08/2010
00068 !***********************************************************************
00069 !
00070 !
00071 !
00072 !
00073 !
00074 !
00075 !
00076 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00077 !| ICOL           |<->| POSITION COURANTE DU POINTEUR DANS LA LIGNE
00078 !| LIGNE          |<->| LIGNE EN COURS DE DECODAGE
00079 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00080 !
00081       IMPLICIT NONE
00082 !
00083       INTEGER       ICOL
00084       CHARACTER*(*) LIGNE*(*)
00085 !
00086       INTEGER       LNG,LU
00087       INTEGER       NLIGN,LONGLI
00088       INTEGER       NFIC
00089       LOGICAL       ERREUR,RETOUR
00090 !
00091 !-----------------------------------------------------------------------
00092 !
00093       INTEGER       I,J
00094       CHARACTER*1   TABUL
00095 !
00096 !-----------------------------------------------------------------------
00097 !
00098       COMMON / DCINFO / LNG,LU
00099       COMMON / DCRARE / ERREUR,RETOUR
00100       COMMON / DCMLIG / NLIGN,LONGLI
00101       COMMON / DCCHIE / NFIC
00102 !
00103       INTRINSIC CHAR
00104 !
00105 !***********************************************************************
00106 !                                    RCS AND SCCS MARKING
00107 !
00108 !***********************************************************************
00109 !
00110       TABUL = CHAR(9)
00111       NEXT  = LONGLI + 1
00112       I     = ICOL -1
00113 !
00114 100   CONTINUE
00115       I = I + 1
00116 !
00117       IF(I.GT.LONGLI) THEN
00118 99        NLIGN = NLIGN + 1
00119           READ(NFIC,END=900,ERR=998,FMT='(A)') LIGNE
00120 !         DOES NOT CONSIDER A LINE STARTING WITH '/'
00121           IF(LIGNE(1:1).EQ.'/') GO TO 99
00122           I = 0
00123           GO TO 100
00124       ENDIF
00125 !
00126 !
00127 ! CASE OF A WHITE OR TABULATION CHARACTER
00128       IF (LIGNE(I:I).EQ.' '.OR.LIGNE(I:I).EQ.TABUL) GOTO 100
00129 !
00130 !-----------------------------------------------------------------------
00131 !
00132 !          DOES NOT CONSIDER THE COMMENTED LINES:
00133 !
00134 !          IF ( LIGNE(I:I).NE.'/'.OR.I.GE.LONGLI ) THEN
00135            IF (LIGNE(I:I).NE.'/') THEN
00136                 NEXT = I
00137                 GO TO 1000
00138            ELSE
00139                 DO J = I+1 , LONGLI
00140                      IF ( LIGNE(J:J).EQ.'/' ) THEN
00141                           I = J
00142                           GO TO 100
00143                      ENDIF
00144                 ENDDO ! J
00145                 I = LONGLI
00146                 GO TO 100
00147             ENDIF
00148 !
00149 !-----------------------------------------------------------------------
00150 !
00151 998   CONTINUE
00152       IF(LNG.EQ.1) WRITE(6,999) NFIC,NLIGN
00153       IF(LNG.EQ.2) WRITE(6,1999) NFIC,NLIGN
00154 999   FORMAT(1X,'UNITE LOGIQUE ',1I2,'   ERREUR LIGNE ',1I6)
00155 1999  FORMAT(1X,'LOGICAL UNIT ',1I2,'   ERROR LINE ',1I6)
00156 900   CONTINUE
00157       RETOUR = .TRUE.
00158 !
00159 1000  CONTINUE
00160 !
00161 !-----------------------------------------------------------------------
00162 !
00163       RETURN
00164       END

Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using doxygen 1.7.0