      SUBROUTINE EQUIVALENTDEPTHS(kalt,kdimax)

C     EQUIVALENTDEPTHS SETS UP AN ARRAY OF CORRESPONDING
C     ARRAY ELEMENTS BETWEEN STANDARD 33 DEPTHS AND OTHER
C     STANDARD DEPTH DEFINITIONS (FULL AND GDEM)

      parameter (kdim=40,kdimaxloc=300)
      character*4 whichdepths
      dimension dz(kdim),dzalt(kdimaxloc),kalt(kdimax)

      call setstandeps(dz)
      call checkwhichdepthfile(whichdepths)

      if ( whichdepths .eq. 'orig' ) then
       do 40 k=1,kdim
40      dzalt(k)=dz(k)
       kmax=kdim
      else
       call setstandepsfromfile(kmax,dzalt)
      endif


      do 50 k=1,kmax

       klevel=0
       do 55 k2=1,kdim

        if ( dz(k2) .lt. dzalt(k)+0.01 ) klevel=klevel+1

55     continue
       kalt(k)=klevel

50    continue 

      return
      end
