include include # SPINIT -- Initialize gio pointer and gtools pointer. Do some initial io procedure spinit( gp, gt, xdata, ydata, ndata, device) pointer gp # o: gio pointer pointer gt # o: gtools pointer double xdata[ARB] # i: x data points double ydata[ARB] # i: y data points int ndata # i: number of data points % character*(*) device char devnam[SZ_FNAME] pointer sp, xd, yd pointer gopen(), gtinit() int i begin # Allocate memory call smark( sp ) call salloc( xd, ndata, TY_REAL) call salloc( yd, ndata, TY_REAL) # Copy data to single precision arrays for (i=1; i<=ndata; i=i+1){ Memr[xd+i-1] = xdata[i] Memr[yd+i-1] = ydata[i] } gt = gtinit() call clgstr( "device", devnam, SZ_FNAME ) gp = gopen(devnam, NEW_FILE, STDGRAPH ) # convert devnam string to FORTRAN string call f77pak( devnam, device, SZ_FNAME) call gtascale(gp, gt, Memr[xd], Memr[yd], ndata) call gt_swind(gp, gt) call gt_labax(gp, gt) call sfree(sp) end