      SUBROUTINE WALABL
      IMPLICIT NONE
*
* WALABL - Write Ascii label record from common block
*
* Local Variables...
*    ASCREC - Ascii record to be written to output file
*    ASCLEN - Length of Ascii record
* 
      INCLUDE 'misc.inc'
      INCLUDE 'labl.inc'

      CHARACTER ASCREC*1000
      INTEGER   ASCLEN

      IF (LEVEL .EQ. '3AT' .OR. LEVEL .EQ. '3TP') THEN

         WRITE (UNIT=RECORD,FMT=1000)
     +      SATEID,RECTYP,INSTID,SPECIE,FVERNO,PRECNO,NCONTS,NPRECS,
     +      CREATE,FSTYEA,FSTDAY,FSTMIL,LSTYEA,LSTDAY,LSTMIL,
     +      LEVEL,UARSDN,NPEREC,BASEIN,BINLEN,
     +      CCBVER,FCYCNO,VFFLAG,TOTENT,NUMENT
 1000    FORMAT (A4,A2,A12,A12,A4,A8,I4,I8,A23,A3,A3,A8,A3,A3,A8,
     +           A3,A4,A4,A4,I5,A9,A5,A1,I4,I4)

      ELSE

         WRITE (UNIT=RECORD,FMT=2000)
     +      SATEID,RECTYP,INSTID,SPECIE,FVERNO,PRECNO,NCONTS,NPRECS,
     +      CREATE,FSTYEA,FSTDAY,FSTMIL,LSTYEA,LSTDAY,LSTMIL,
     +      LEVEL,UARSDN,NPEREC,BASEIN,BINLEN,MINLAT,MAXLAT,
     +      CCBVER,FCYCNO,VFFLAG,TOTENT,NUMENT
 2000    FORMAT (A4,A2,A12,A12,A4,A8,I4,I8,A23,A3,A3,A8,A3,A3,A8,
     +           A3,A4,A4,A4,I5,A3,A3,A9,A5,A1,I4,I4)

      ENDIF

      IF (RECKEY .NE. ' ') THEN
         ASCREC = RECKEY(1:20)//RECORD(1:BINLEN-20)
      ELSE
         ASCREC = RECORD(1:BINLEN)
      ENDIF

      ASCLEN = BINLEN

      CALL WAWRIT (ASCREC,ASCLEN)

      RETURN
      END
