      SUBROUTINE setobse(obserr,mxqobs,nlevoi)
c      include '/usr/include/cm/CMF_defs.h'
      REAL obserr (mxqobs, 4, 19)
      INTEGER obskx
      CHARACTER * 8 obsname
!hpf$ distribute obserr(block,block,block)
      DATA input_obselevs / 19 /
      DATA maxins / 87 /
c  Read and set the observation errors.
      DO 7002 kx = 1 , maxins
        READ( 62,6201 ) obskx,obsname
6201  FORMAT (1x,i5,1x,a8)
        DO 7000 lev = 1 , input_obselevs - 1
          READ( 62,6203 ) (obserr(kx,itype,lev),itype = 1,4)
6203  FORMAT (15x,2x,f6.4,3(2x,f6.2))
 7000   CONTINUE
        READ( 62,6204 ) (obserr(kx,itype,input_obselevs),itype = 1,4)
6204  FORMAT (15x,4(5x,f3.1))
 7002 CONTINUE
C  Shift observation error array to order observation errors in the way
C  that the OI is expecting them - errors in first level of array are
C  the errors that correspond to the top level of the analysis.
c  Position in the input table at which to start extracting levels.
c  (Note that the last level in the table corresponds to sea level - thi
c  level will not be shifted since the sea level pressure analysis expec
c  it at the end of the table.)
      level_start = input_obselevs - nlevoi
      IF (level_start .GT. 1) THEN
        DO 7008 kklev = 1 , nlevoi
          DO 7006 jjtype = 1 , 4
            DO 7004 i = 1 , mxqobs
              obserr(i,jjtype,kklev) = obserr(i,jjtype,level_start + 
     &            kklev - 1)
 7004       CONTINUE
 7006     CONTINUE
 7008   CONTINUE
      ENDIF
      RETURN
      END
