LOGICAL FUNCTION YESNO1(DEFAULT)
!
!	READS TERMINAL FOR A CHARACTER AND RETURNS
!	"PRINT"S OUT DEFAULT VALUE
!	.TRUE. = YES  .FALSE. = NO
!	DEFAULT IS FOR WHEN ONLY RETURN IS PRESSED
!
  LOGICAL DEFAULT
  character*1 ANS
  
  YESNO1=DEFAULT
  IF (DEFAULT) THEN
     PRINT 2
2    FORMAT(' [Y] ',$)
  ELSE
     PRINT 3
3    FORMAT(' [N] ',$)
  ENDIF
  READ (*,1,END=99,ERR=99) ANS
1 FORMAT(A1)
  IF (ANS.EQ.'Y'.OR.ANS.EQ.'y') YESNO1=.TRUE.
  IF (ANS.EQ.'N'.OR.ANS.EQ.'n') YESNO1=.FALSE.
99 RETURN
END FUNCTION YESNO1
