      SUBROUTINE GETFIELDS(WORK,FIELDS,NC,NF)
C
C     SUBROUTINE TO BREAK A FORMAT STATEMENT (WITHOUT PARENTHESES)
C     INTO INDIVIDUAL FIELDS
C
      CHARACTER WORK*(*),FIELDS(50)*10
      LOGICAL LOOP
C
      NF=0
      I1=1
      LOOP=.TRUE.
      DO WHILE(LOOP)
           I2=INDEX(WORK(I1:NC),',')
           IF(I2.EQ.0)THEN
                 LOOP=.FALSE.
                 I2=NC
           ELSE
                I2=I2+I1-2
           ENDIF
           NF=NF+1
           FIELDS(NF)=WORK(I1:I2)
           I1=I2+2
      ENDDO
      RETURN
      END
