C---------------------------------------------------------------------- subroutine ftpi4b(ounit,nvals,incre,i4vals,status) C Write an array of Integer*4 bytes to the output FITS file. C Does any required translation from internal machine format to FITS. integer nvals,incre,ounit,status,offset integer i4vals(nvals) C ounit i fortran unit number C nvals i number of pixels in the i4vals array C incre i byte increment between values C i4vals i array of input integer*4 values C status i output error status integer compid common/ftcpid/compid integer cray2ieg,neven,ierr if (compid .eq. 0 .or. compid .eq. -1)then C big endian machine (e.g., SUN) doesn't need byte swapping else if (compid .ge. 1)then C little endian machine (e.g. DEC, VAX, or PC) must be byte swapped call ftswi4(i4vals,nvals) else C must be a CRAY C there is a bug in cray2ieg if the number of values to convert C is not a multiple of 8 bytes. neven=nvals/2*2 if (neven .gt. 0)then ierr= cray2ieg(1,neven,i4vals,0,i4vals,1,' ') end if if (neven .ne. nvals)then C have to do the remaining odd word separately ierr= cray2ieg(1,1,i4vals(nvals/2+1),0,i4vals(nvals),1,' ') end if end if if (incre .le. 4)then call ftpbyt(ounit,nvals*4,i4vals,status) else C offset is the number of bytes to move between each value offset=incre-4 call ftpbyo(ounit,4,nvals,offset,i4vals,status) end if end