	subroutine cdstand (ibuf, sdx, ierr)
C_TITLE	CDSTAND determines the CDROM format standard
C_ARGS
	byte		ibuf(6144)	!input, volume descriptor buffer
	integer*2	sdx		!return, standard index
	integer*4	ierr		!return, error value
C_VARS	none
C_DESC	This routine determines whether the cdrom being accessed is
C	in ISO or High Sierra format.  If the routine is unable to
C	determine the standard, a negative error value is returned.
C_HIST	3Aug88, DMcMacken, ISD, USGS, Flagstaff, Original Version
C_END
C******************************************************************************
c
c	local variables
c
	logical*2	isoflg		!flag indicating ISO standard
	logical*2	hisflg		!High Sierra standard flag
	integer*2	ndx		!character counter for loop
	byte		isostd(5)	!ISO identifying string
	byte		hisstd(5)	!High Sierra identifying string
c
	data	isostd /'C', 'D', '0', '0', '1'/
	data	hisstd /'C', 'D', 'R', 'O', 'M'/
c
c	assume there will be no error
c
	ierr = 0
c
c	determine the standard
c
	isoflg = .true.
	hisflg = .false.
	ndx = 1
	do while (isoflg .and. ndx .le. 5)
		if (ibuf(ndx + 1) .ne. isostd(ndx)) isoflg = .false.
		ndx = ndx + 1
	enddo
c
c	if not ISO try High Sierra
c
	if (.not. isoflg) then
		hisflg = .true.
		ndx = 1
		do while (hisflg .and. ndx .le. 5)
			if (ibuf(ndx + 9) .ne. hisstd(ndx)) hisflg = .false.
			ndx = ndx + 1
		enddo
	endif
c
c	set standard index
c
	if (isoflg) then
		sdx = 2
	else if (hisflg) then
		sdx = 1
	else
		sdx = 0
		ierr = -1
	endif
c
	return
	end
