	PROGRAM SAMPLE
C
C  Note:  This is the UNIX version
C
C       This sample program demonstrates loading an array
C  of data into SAOimage.
C			Donald H. Gudehus, 1995
C			Version 2, D. Gudehus, August 29, 2006
C			Put in changes from saofact.for and call to
C			GET_ENDIAN
C
	INCLUDE 'saofacts.for'  ! UNIX likes lower case
	CHARACTER*40 ARRAY_NAME
	DIMENSION ARRAY(512,512)
C
	CALL GET_ENDIAN
	IFB_SAO=1  ! Calls up the 512X512 buffer;  no user prompting
	CALL SAOSTART
	CALL SAOFIRST
C  Fill the array
	NCOLS=512
	NROWS=512
	DO J=1,NROWS
	  DO I=1,NCOLS
	    ARRAY(I,J)=I+J
	  END DO
	END DO
C  Position the lower left corner of the array at the
C  lower left corner of the frame.
	IXFRAME=0
	IYFRAME=511
	BRIGHTNESS_MIN=2
	BRIGHTNESS_MAX=1024
	ARRAY_NAME='Sample image'
	NPICTURE=1
C  Load SAOimage in `fast mode'
	MODE=0
	CALL SAOLOAD(ARRAY,NCOLS,NROWS,IXFRAME,IYFRAME,
	1BRIGHTNESS_MIN,BRIGHTNESS_MAX,ARRAY_NAME,NPICTURE,MODE)
C
	END
