SUBROUTINE PRDST390(AB,IDIM,JDIM,M,N,RM,ZM,LUW_DST)

implicit none
INTEGER, PARAMETER :: iknd=SELECTED_INT_KIND(8)  ! nobody does this
INTEGER, PARAMETER :: DP=SELECTED_REAL_KIND(14)  ! this is double precision
INTEGER, PARAMETER :: SP=SELECTED_REAL_KIND(6)  ! this is single precision

real(DP):: AB(IDIM,JDIM),RM(1),ZM(1),imax
integer :: irun,imin,luw_dst,i,j,n,idim,jdim,m

IMIN = 1
IRUN = M
8 CONTINUE
IMAX = MIN(IRUN,12)+IMIN-1
IRUN = M-IMAX
WRITE(LUW_DST,10) (RM(I),I = IMIN,IMAX)
10 FORMAT(20X,'R-DIST'/4X,'Z-DIST',F7.2,11F10.2)
WRITE(LUW_DST,30)
30 FORMAT(1X,120(1H-))
DO 20 J = 1,N
WRITE(LUW_DST,15) ZM(J),(AB(I,J),I=IMIN,IMAX)
20 CONTINUE
15 FORMAT(4X,F6.2,12G10.4)
IF(IRUN <= 0) GO TO 25
IMIN = IMAX+1
GO TO 8
25 CONTINUE
WRITE(LUW_DST,30)

RETURN
END subroutine prdst390