$	SUBROUTINE CHAR2R(STRING,VAL,NVALS)BC_TITLE CHAR2R converts ASCII characters to floating point binary C3C_ARGS    TYPE         VARIABLE   I/O   DESCRIPTION?	CHARACTER*(*)  STRING     !I    Character string of any lengthCC                                       which contains only decimalDC                                       numbers in floating point or;C                                       exponential format.A	REAL*4         VAL(1)     !O    Dimensioned variable containing GC                                       the character to floating point3C                                       conversion.?	INTEGER*4      NVALS      !I    Number of values to convert to7C                                       floating point.CAC_DESC  CHAR2R shall convert an ASCII character string of varyingGC       length and containing only decimal characters in floating pointKC       or scientific notation to floating point binary values. The callingEC       routine shall specify the number of real integer variables to C       extract from the string.CDC_HIST  24Sep85  Eric M. Eliason U.S.G.S. Flagstaff Original Version7C       14Nov86  Joni L. Bauers  updated documentation C_END                          OC******************************************************************************.C Initialize the output array VAL to all zerosMC****************************************************************************      DO 10 I = 1,NVALS   10 VAL(I) = 0.0NC*****************************************************************************EC Find, if there is one, the blank character of comma after the firstC number int character string.MC****************************************************************************      ISTART = 1      DO 500 IV = 1,NVALSMC****************************************************************************=C Find the first non-blank character in the  character stringMC****************************************************************************            ILEN = LEN(STRING)      DO 100 I1 = ISTART,ILENA      IF (STRING(I1:I1).NE.' '.AND.STRING(I1:I1).NE.',') GOTO 110  100 CONTINUENC*****************************************************************************<C All characters in string are blank, return a value of zeroMC****************************************************************************      GOTO 9000  110 CONTINUENC*****************************************************************************CC Find, if there is one, the blank character after the digit stringMC****************************************************************************      DO 200 I2 = I1,ILEN@      IF (STRING(I2:I2).EQ.' '.OR.STRING(I2:I2).EQ.',') GOTO 210  200 CONTINUE      I2 = ILEN + 1  210 I2 = I2 - 1OC******************************************************************************IC Use the DECODE statement to convert the string to binary floating pointOC******************************************************************************      NCHARS = I2 - I1 + 1+      DECODE(NCHARS,900,STRING(I1:I2)) XRES  900 FORMAT(G<NCHARS>.0)      VAL(IV) = XRES      ISTART = I2 + 1  500 CONTINUE      RETURNOC******************************************************************************CC Set the result to zero, something wrong with the character stringOC****************************************************************************** 9000 CONTINUE      RETURN	      END