c
c For the VAX
c  real_s_intasc
c  real_t_intasc
c  real_x_intasc
c  real_h_intasc
c
c  real_s_ascint
c  real_t_ascint
c  real_x_ascint
c  real_h_ascint
c
c
	options /g_float
	function dix_con_real_s_intasc(nk,data,value,nkar,control)
	implicit none
c
c real conversion (s_format)
c  since the vax (at least version 7.1) does
c  not yet have s types, we convert to f type
c  and let this be converted
c  there is a small overflow possibility
c
	include 'dix_def.inc'
	integer*4 nk		!:i: data length
	byte data(*)		!:i: the data
	character*(*) value	!:o: the converted text
	integer*4 nkar		!:o: length of text
	record /control/ control!:i: control block
	logical*4 dix_con_real_s_intasc	!:F: true if not compressed
c#
	real*4 real4,real41
	integer*4 exponent,sign,mantisse(4)
	logical*4 mantisse_zero,is_zero,overflow
c
	logical*4 dix_con_real_f_intasc
c
	call dix_util_copy(nk,data,real4)

	call dix_con_cvt_float(control,
     1               real4,enttyp_real_s,
     1               real41,enttyp_real_f,
     1               overflow)
	if(overflow) goto 50
	dix_con_real_s_intasc = dix_con_real_f_intasc(nk,real41,
     1                        value,nkar,control)
	goto 90
c
c We had some kine of overflow, check for the specific parts
c
50	call dix_con_cvt_float_split(control,real4,enttyp_real_s,
     1                    sign,exponent,mantisse,mantisse_zero,is_zero)
	value = 'Overflow'		!take default
	if(exponent .eq. 'FF'x) then
c
c Exponent has max value, either a NAN or +/- infinity
c
	  if(mantisse_zero) then
	    if(sign .eq. 0) then
	      value = 'plus_infinity'
	    else
	      value = 'Minus_Infinity'
	    endif
	  else
	    value = 'Nan'
	  endif
	elseif(exponent .eq. 0) then
	  value = 'Denorm'
	endif
	nkar = index(value,' ')-1
70	call dix_util_left_just(value,nkar)
90	return
	end
	options /g_float
	function dix_con_real_t_intasc(nk,data,value,nkar,control)
	implicit none
c
c real conversion (t_format)
c  since the vax (at least not version 7.1) does
c  not yes have t types, we convert to g type
c  and let this be converted
c  there is a small overflow option
c
	include 'dix_def.inc'
	integer*4 nk		!:i: data length
	byte data(*)		!:i: the data
	character*(*) value	!:o: the converted text
	integer*4 nkar		!:o: length of text
	record /control/ control!:i: control block
	logical*4 dix_con_real_t_intasc	!:F: true if not compressed
c#
	real*4 real8,real81
	integer*4 exponent,sign,mantisse(4)
	logical*4 mantisse_zero,is_zero,overflow
c
	logical*4 dix_con_real_g_intasc
c
c First swap the words	 (make it g_float)
c
	call dix_util_copy(nk,data,real8)
c
	call dix_con_cvt_float(control,
     1               real8,enttyp_real_t,
     1               real81,enttyp_real_g,
     1               overflow)
	if(overflow) goto 50
c
	dix_con_real_t_intasc = dix_con_real_g_intasc(nk,real81,
     1                            value,nkar,control)
	goto 90
c
c We had some kine of overflow, check for the specific parts
c
50	call dix_con_cvt_float_split(control,real8,enttyp_real_t,
     1                    sign,exponent,mantisse,mantisse_zero,is_zero)

	value = 'Overflow'		!take default
	if(exponent .eq. '7FF'x) then
c
c Exponent has max value, either a NAN or +/- infinity
c
	  if(mantisse_zero) then
	    if(sign .eq. 0) then
	      value = 'plus_infinity'
	    else
	      value = 'Minus_Infinity'
	    endif
	  else
	    value = 'Nan'
	  endif
	elseif(exponent .eq. 0) then
	  value = 'Denorm'
	endif
	nkar = index(value,' ')-1
70	call dix_util_left_just(value,nkar)
90	return
	end
	options /g_float
	function dix_con_real_h_intasc(nk,data,value,nkar,control)
	implicit none
c
c real conversion real*16 vax (can be done native on vax)
c
	include 'dix_def.inc'
	integer*4 nk		!:i: data length
	byte data(*)		!:i: the data
	character*(*) value	!:o: the converted text
	integer*4 nkar		!:o: length of text
	record /control/ control!:i: control block
	logical*4 dix_con_real_h_intasc	!:F: true if not compressed
c
	real*16 real16
c
	logical*4 overflow
        common /dix_con_common/ overflow
	external dix_con_overflow
	volatile overflow
	integer*4 dix_util_get_len_fu
c
	real16 = 0.0
	call dix_util_copy(nk,data,real16)
c
	overflow = .false.
	call lib$establish(dix_con_overflow)
c
c Test for the overflow detection
c
	dix_con_real_h_intasc = real16 .ne. 0.0
	if(overflow) goto 60
	write(value,control.format_real16,err=10) real16
10	nkar = dix_util_get_len_fu(value)
	goto 90
60	value = 'Overflow'
	nkar = 8
90	call dix_util_left_just(value,nkar)
	return
	end
	options /g_float
	function dix_con_real_x_intasc(nk,data,value,nkar,control)
	implicit none
c
c real conversion x_format (real*16 alpha/ipf)
c
	include 'dix_def.inc'
	integer*4 nk		!:i: data length
	byte data(*)		!:i: the data
	character*(*) value	!:o: the converted text
	integer*4 nkar		!:o: length of text
	record /control/ control!:i: control block
	logical*4 dix_con_real_x_intasc	!:F: true if not compressed
c
	real*16 real16,real161
	integer*4 exponent,sign,mantisse(4)
	logical*4 mantisse_zero,is_zero,overflow
c
	logical*4 dix_con_real_h_intasc
c
c First swap the words	 (make it an h-real)
c
	call dix_util_copy(nk,data,real16)
c
	call dix_con_cvt_float(control,
     1               real16,enttyp_real_x,
     1               real161,enttyp_real_h,
     1               overflow)
	if(overflow) goto 50
c
	dix_con_real_x_intasc = dix_con_real_h_intasc(nk,real161,
     1                         value,nkar,control)
	goto 90
c
c We had some kine of overflow, check for the specific parts
c
50	call dix_con_cvt_float_split(control,real16,enttyp_real_x,
     1                    sign,exponent,mantisse,mantisse_zero,is_zero)

	value = 'Overflow'		!take default
	if(exponent .eq. '7FFF'x) then
c
c Exponent has max value, either a NAN or +/- infinity
c
	  if(mantisse_zero) then
	    if(sign .eq. 0) then
	      value = 'plus_infinity'
	    else
	      value = 'Minus_Infinity'
	    endif
	  else
	    value = 'Nan'
	  endif
	elseif(exponent .eq. 0) then
	  value = 'Denorm'
	endif
	nkar = index(value,' ')-1
70	call dix_util_left_just(value,nkar)
90	return
	end
c
c Now the _ASCINT routines
c
	function dix_con_real_s_ascint(line,data,size,control)
	implicit none
c
c Convert real (s_floating)
c
	include 'dix_def.inc'
	character*(*) line		!:i: the text
	byte data(*)			!:o: the binary data
	integer*4 size			!:i: the size
	integer*4 control
	logical*4 dix_con_real_s_ascint	!:f: conversion result
c#
	integer*4 istat
	integer*2 hulp(2)
	logical*4 overflow
c
	external dix_msg_invreali
	integer*4 ots$cvt_t_f
c
c convert real to f_format
c
	istat = ots$cvt_t_f(line,hulp,,,1)
c
c Now conver the f_float to s_float
c
	if(istat) then
c
	  call dix_con_cvt_float(control,
     1               hulp,enttyp_real_f,
     1               hulp,enttyp_real_s,
     1               overflow)
          if(overflow) then
	    call dix_message(control,dix_msg_invreali,line)
	    dix_con_real_s_ascint = .false.
            goto 90
          endif
	  dix_con_real_s_ascint = .true.
	  call dix_util_copy(size,hulp,data)
	else
	  call dix_message(control,dix_msg_invreali,line)
	  dix_con_real_s_ascint = .false.
	endif
90	return
	end
	function dix_con_real_t_ascint(line,data,size,control)
	implicit none
c
c Convert real (g_floating)
c
	include 'dix_def.inc'
	character*(*) line		!:i: the text
	byte data(*)			!:o: the binary data
	integer*4 size			!:i: the size
	integer*4 control
	logical*4 dix_con_real_t_ascint	!:f: conversion result
c#
	integer*4 istat
	integer*2 hulp(4)		!big enough for 4/8
	logical*4 overflow
c
	external dix_msg_invreali
	integer*4 ots$cvt_t_g
c
c First convert to g_format
c
	istat = ots$cvt_t_g(line,hulp,,,1)
	if(istat) then
c
c Now convert to t_format
c
	  call dix_con_cvt_float(control,
     1               hulp,enttyp_real_g,
     1               hulp,enttyp_real_t,
     1               overflow)
          if(overflow) then
	    call dix_message(control,dix_msg_invreali,line)
	    dix_con_real_t_ascint = .false.
            goto 90
          endif
	  dix_con_real_t_ascint = .true.
	  call dix_util_copy(size,hulp,data)
	else
	  call dix_message(control,dix_msg_invreali,line)
	  dix_con_real_t_ascint = .false.
	endif
90	return
	end
c
	function dix_con_real_h_ascint(line,data,size,control)
	implicit none
c
c Convert real*16 , can be done native on vax
c
	character*(*) line		!:i: the text
	byte data(*)			!:o: the binary data
	integer*4 size			!:i: the size	
	integer*4 control
	logical*4 dix_con_real_h_ascint	!:f: the result
c
	integer*4 istat
	real*16 hulp   
c#
	integer*4 ots$cvt_t_h
	external dix_msg_invreal
c
	istat = ots$cvt_t_h(line,hulp,,,1)
	if(istat) then
	  call dix_util_copy(size,hulp,data)
	  dix_con_real_h_ascint = .true.
	else
	  call dix_message(control,dix_msg_invreal,line)
	  dix_con_real_h_ascint = .false.
	end if
c
	return
	end
	function dix_con_real_x_ascint(line,data,size,control)
	implicit none
c
c Convert real*16 alpha/ipf format
c
	include 'dix_def.inc'
	character*(*) line		!:i: the text
	byte data(*)			!:o: the binary data
	integer*4 size			!:i: the size	
	integer*4 control
	logical*4 dix_con_real_x_ascint	!:f: the result
c
	integer*4 istat
	integer*2 hulp(8)
	logical*4 overflow
c#
	external dix_msg_invreal
	integer*4 ots$cvt_t_h
c
c First convert to h (vax format)
c
	istat = ots$cvt_t_h(line,hulp,,,1)
	if(istat) then
c
c Now convert to X_float
c
	  call dix_con_cvt_float(control,
     1               hulp,enttyp_real_h,
     1               hulp,enttyp_real_x,
     1               overflow)
          if(overflow) then
	    call dix_message(control,dix_msg_invreal,line)
	    dix_con_real_x_ascint = .false.
            goto 90
          endif
	  call dix_util_copy(size,hulp,data)
	  dix_con_real_x_ascint = .true.
	else
	  call dix_message(control,dix_msg_invreal,line)
	  dix_con_real_x_ascint = .false.
	end if
c
90	return
	end
	subroutine dix_con_i8_intasc(control,value,line)
	implicit none
c
c Dummy routine to keeep the
c
	integer*4 control
	integer*4 value
	character*(*) line
c
	integer*4 k
c
c Some statements to keep the compiler happy
c
	k = control
	k = value
	k = len(line)
	return
	end

