      SUBROUTINE SHOWDEFL(DEVNAM,LDEV,DIRNAM,LDIR)
C
#ifdef __NAGWARE
      use f90_unix_dir
#endif
      implicit none
C
C  GET THE CURRENT DEFAULT DISK AND DIRECTORY BY PARSING A DUMMY
C  FILENAME WITH THE RMS SERVICE CALL
C  DMC:  FOLLOWING HINTS BY M. THOMPSON
C
 
      CHARACTER*(*) DEVNAM  ! OUTPUT DEVICE NAME
      CHARACTER*(*) DIRNAM  ! OUTPUT DIRECTORY NAME
 
      INTEGER LDEV	      ! OUTPUT LENGTH OF DEVICE NAME
      INTEGER LDIR	      ! OUTPUT LENGTH OF DIRECTORY NAME
 
      integer istat
#ifndef __NAGWARE
      integer getcwd
#endif
 
      ldev=0
      devnam=' '
C
      ldir=0
      dirnam=' '
#ifdef __NAGWARE
      call getcwd(dirnam,ldir,istat)
#elif __X1
      call cgetcwd(dirnam,ldir,istat)
#else
      istat=getcwd(dirnam)
#endif
C
#if __CRAY
      if (istat.le.0) dirnam='UNKNOWN'
#elif __HP
      if (istat.eq.0) then
         print *,' ...sget_cwd:showdefl - dirnam =',dirnam
         if (dirnam(1:1) .eq. ' ') dirnam='UNKNOWN'
      endif
#elif __IBM || __RS6000 || __SGI
      if (istat.eq.0) dirnam='UNKNOWN'
#endif
C
      call str_pad(dirnam)
C
      ldir=len_trim(dirnam)
C
      RETURN
      END
