CMAX: [Version 1.0 (6/22/93)]
CMAX: ----------------------------------------------------
CMAX: Transformation of OBERTRP0 from obertrp0.f
CMAX: ----------------------------------------------------
      SUBROUTINE obertrp0(xkx,pres,ober,obserr,kq,n)
      INTEGER INDX
      INTEGER KQ
      INTEGER KX
      INTEGER LEVDN
      INTEGER LEVUP
      INTEGER N
      DIMENSION OBER (N)
      DIMENSION OBSERR (200, 4, 19)
      DIMENSION PRES (N)
      DIMENSION XKX (N)
      COMMON / GRIDXX / IM, JNP, MLEV
!hpf$ distribute ober(block)
!hpf$ distribute obserr(block,block,block)
!hpf$ distribute pres(block)
!hpf$ distribute xkx(block)
      INTEGER  LEVUP100(n)
!hpf$ distribute levup100(block)
      INTEGER  KX100(n)
!hpf$ distribute kx100(block)
      REAL  HL100(n)
!hpf$ distribute hl100(block)
      INTEGER  LEVDN100(n)
!hpf$ distribute levdn100(block)
      kx100 = xkx + 0.1
      FORALL (k = 1:n) hl100(k) = pindx2(pres(k))
      levup100 = hl100 + 0.001
      levup100 = max0(levup100,1)
      levdn100 = min0(levup100 + 1,mlev)
      DO k = 1 , n
        ober(k) = obserr(kx100(k),kq,levup100(k)) + (hl100(k) 
     &      - levup100(k)) * (obserr(kx100(k),kq,levdn100(k)) 
     &      - obserr(kx100(k),kq,levup100(k)))
      ENDDO
      RETURN
      END
CMAX: ----------------------------------------------------
CMAX: Transformation of OBERTRP0 from obertrp0.f
CMAX: ----------------------------------------------------
      SUBROUTINE obertrp0_v1(xkx,os,ln,pres,os100,ln100,ober,os101,ln101
     &    ,obserr,kq,n)
cmax: Changed argument XKX to passed with index
      INTEGER os
      INTEGER ln
cmax: Changed argument PRES to passed with index
      INTEGER os100
      INTEGER ln100
cmax: Changed argument OBER to passed with index
      INTEGER os101
      INTEGER ln101
      INTEGER INDX
      INTEGER KQ
      INTEGER KX
      INTEGER LEVDN
      INTEGER LEVUP
      INTEGER N
      DIMENSION ober(1-os101+1:ln101+1-os101)
      DIMENSION OBSERR (200, 4, 19)
      DIMENSION pres(1-os100+1:ln100+1-os100)
      DIMENSION xkx(1-os+1:ln+1-os)
      COMMON / GRIDXX / IM, JNP, MLEV
!hpf$ distribute ober(block)
!hpf$ distribute obserr(block,block,block)
!hpf$ distribute pres(block)
!hpf$ distribute xkx(block)
      INTEGER  LEVUP100(1-os101+1:ln101+1-os101)
!hpf$ distribute levup100(block)
      INTEGER  KX100(1-os+1:ln+1-os)
!hpf$ distribute kx100(block)
      REAL  HL100(1-os101+1:ln101+1-os101)
!hpf$ distribute hl100(block)
      INTEGER  LEVDN100(1-os101+1:ln101+1-os101)
!hpf$ distribute levdn100(block)
      kx100(1:n) = xkx(1:n) + 0.1
      FORALL (k = 1:n) hl100(k) = pindx2(pres(k))
      levup100(1:n) = hl100(1:n) + 0.001
      levup100(1:n) = max0(levup100(1:n),1)
      levdn100(1:n) = min0(levup100(1:n) + 1,mlev)
      DO k = 1 , n
        ober(k) = obserr(kx100(k),kq,levup100(k)) + (hl100(k) 
     &      - levup100(k)) * (obserr(kx100(k),kq,levdn100(k)) 
     &      - obserr(kx100(k),kq,levup100(k)))
      ENDDO
      RETURN
      END
