C
C SUBROUTINE 'STR_ADDF'
C =====================
C
C ADD A FLOATING POINTVALUE STRING 'NB' SPACES AFTER THE LAST NON-BLANK 
C CHARACTER OF ANOTHER CHARACTER STRING, GIVEN THE REAL VALUE
C
      SUBROUTINE STR_ADDF (STR, VAL, ND, NB)
C
C PARAMETERS
C
C      STR   (I/O)    CHARACTER STRING TO WHICH THE INTEGER STRING IS
C                     TO BE APPENDED
C      VAL   (I)      THE REAL VALUE
C      ND    (I)      THE NUMBER OF DIGITS REQUIRED AFTER THE DECIMAL POINT
C                     (A NEGATIVE VALUE WILL GIVE SCIENTIFIC NOTATION WITH
C                     THE ABSOLUTE VALUE BEING USED AS THE NUMBER OF DIGITS
C                     AFTER THE DECIMAL POINT)
C      NB    (I)      THE NUMBER OF BLANKS REQUIRED AFTER THE LAST NON-BLANK
C                     CHARACTER OF THE STRING BEFORE ADDING THE INTEGER
C                     (MAY BE 0)
C
C SPECIFICATION STATEMENTS
C ------------------------
C
      CHARACTER*(*) STR
      CHARACTER*25 FPSTR
      CHARACTER*8 FMT
C
C ADD STRING
C ----------
C
      LL = LEN(STR) 
      DO 100 L=LL,1,-1
         IF (STR(L:L).NE.' ') THEN
            LSTR = L
            GO TO 200
         END IF
100   CONTINUE
      LSTR = 0
200   IF (ND.GT.0) THEN
         FMT = '(F25.  )'
         WRITE (FMT(6:7),'(I2.2)') ND
         WRITE (FPSTR,FMT) VAL
      ELSE IF (ND.LT.0) THEN
         FMT = '(E25.  )'
         WRITE (FMT(6:7),'(I2.2)') -ND
         WRITE (FPSTR,FMT) VAL
      ELSE
         WRITE (FPSTR,'(I25)') NINT(VAL)
      ENDIF
      L = LSTR + NB
      DO 300 I=1,25
         IF (FPSTR(I:I).EQ.' ') GO TO 300
         L = L+1
         IF (L.GT.LL) RETURN
         STR(L:L) = FPSTR(I:I)
300   CONTINUE
      RETURN
      END
