c    @(#)lnblk.f	1.1


      FUNCTION lnblk(STRING, NCHAR)
C
CC  THIS FUNCTION RETURNS THE CHARACTER POSITION
CC  OF THE LAST NON-BLANK CHARACTER IN THE STRING.
CC  CHARACTERS ARE NUMBERED STARTING WITH 1 AT THE
CC  LEFT OF THE FIRST WORD AND ARE PACKED TEN WORD
CC  WITH BLANK FILL. NCHAR TELLS LNBLK WHERE TO START
CC  THE SEARCH FOR THE LAST NON BLANK CHARACTER
C
        CHARACTER STRING*255
        DO 10 I=NCHAR,1,-1
        IF(STRING(I:I).NE.' ')GOTO 11
10      CONTINUE
        LNBLK=0
        RETURN
11      LNBLK=I
      RETURN
      END
