DISSPLA to NCAR Transition Guide

Introduction

Both DISSPLA and NCAR are rich and complicated subroutine call libraries. This transition guide assumes you have familiarity with DISSPLA but that you have not used NCAR extensively. If you are new to using NCAR, check out the NCAR documentation Due to the size and richness of DISSPLA and NCAR this transition guide does not attempt to be complete on a detailed level. Instead, a rough overview of each package is given in the context of comparisons and contrasts on a functional level followed by specific low level equivalencies (where they exist) for a core set of procedures/routines. This core set of routines include routines for initialization and termination, coordinate systems, miscellaneous control, grids and labels, text pl! otting, lines and markers, and contouring. Included in these sections are tables with specific routine equivalencies and code fragments demonstrating the concepts using NCAR.

Overview & Comparison of DISSPLA & NCAR

These two packages are examples of two things, which are "the same only different". In most cases, they can do equivalent things but it different (sometimes very different) ways. There are two major, minor differences. DISSPLA ultimately defines its coordinates in terms of physical units (e.g. inches) while NCAR defines everything in terms of a unit box and the conversion to physical units is done implicitly or by postprocessing tools (e.g. ctrans). This also manifests itself in many of the arguments passed to DISSPLA routines (i.e. they're in inches). The other difference is that DISSPLA tends to do have separate functions for many things with NCAR has one function with input variables you use to select the action or a number of internal variables you can set via separate "set" calls.

Basically, both DISSPLA and NCAR are used as follows:

  1. Get an output device open and initialized.
  2. Set up the plotting area and axes (e.g. where to plot, the coordinate system).
  3. Draw lines, curves, plots, text, etc. in the plotting area.
  4. Close the output device.

Step 1 is complex because of the number of output devices that each package supports and the variety of options possible in each case. Step 2 and 3 are complex because of all the ways users would like to view their data. Should the axes be linear or logarithmic? What is being plotted (e.g. functions, relations, contours)? Will where need to be additional text? The list goes on and on. Step 4 is straightforward.

Both DISSPLA and NCAR provide routines for:

In addition to this, DISSPLA has the capability to do "3D object rendering". NCAR does not have this capability. On the other hand, NCAR can produce field flows, isosurfaces (3D contours), and movies. Refer to the NCAR tutorials and documentation for more details about these additional capabilities.

The remainder of this guide will discuss in detail the more elementary parts of DISSPLA and NCAR. This will cover opening and initializing the output device, setting up the plotting area and axes, drawing various things in plotting area (e.g. lines, curves, plots, text), and closing the output device. To convert codes, which use a more complex set of DISSPLA routines, please refer to the DISSPLA and NCAR documentation.

Detailed Documentation of Basic Functionality

Opening, Initializing, and Closing Output Devices/Workstations

The way DISSPLA and NCAR are initialized and how you define the plotting device are similar. DISSPLA calls the devices you plot to output devices while NCAR calls them workstations. DISSPLA used a separate subroutine call for specifying and initializing each device, whereas NCAR specifies the device by a number within the "open" workstation routine. Refer to the DISSPLA and NCAR documentation for the specific output device/workstation designations and initialization options. 

DISSPLA

NCAR

Open graphics system:

There is no equivalent call necessary in DISSPLA.

 

call gogks (ierr, idum)

ierr (int) - Fortran unit number for error messages

idum (int) - dummy, not used.

Close graphics system:

There is no equivalent call necessary in DISSPLA.

 

call gclks

Open device:

There is a different call for each type of output device. Refer to the DISSPLA documentation for details.

Example:

Create a CGM binary file named gmeta:

call cgmbo ('gmeta', 5, 1)

 

call gopwk (iwkid, iconid, iwktype)

iwkid (int) - workstation identifier.

iconid (int) - depends on the device specified by iwktype. In most cases it is ignored. If used (e.g., CGM), it is the Fortran logical unit that is used internally for writing to a file. Be careful not to use this same unit number elsewhere in your program for reads or writes.

iwktype (int) - workstation type

Examples:

Create a CGM binary file named gmeta:

call gopwk (1, 2, 1)

Create a X11 window:

call gopwk (2, idum, 8)

Create a postscript file named gmeta1.ps:

call gopwk (1, idum, 20)

Activate device:

There is no equivalent call necessary in DISSPLA.

 

call gacwk (iwkid)

iwkid (int) - workstation identifier specified in gopwk.

Deactivate device:

There is no equivalent call necessary in DISSPLA.

 

call gdawk (iwkid)

iwkid (int) - workstation identifier specified in gopwk.

Close device:

call donepl

 

call gclwk (iwkid)

iwkid (int) - workstation identifier specified in gopwk

New page:

call endpl (0) - end plot and advance frame

 

call frame - advance frame

The order of the subroutine calls to open, initialize, and close NCAR are important. The minimum calls necessary are:

	call gopks (ier, idum)
	call gopwk (iwkid, iconid, iwktype)
	call gacwk (iwkid)

		< graphics calls >

	call gdawk (iwkid)
	call gclwk (iwkid)
	call gclks

Here are two ways to change the name of the file that NCAR will be creating. The first is the easiest to do and change. When the environment variable NCARG_GKS_OUTPUT is defined, NCAR will use this filename when creating the CGM. For example,

	% setenv NCARG_GKS_OUTPUT mycgm.1 

The other way is within your Fortran code, before you open GKS (gopks) and the workstation (gopwk):

	character*80 fname, cdum
	fname = "mycgm.1"
	call gesc (-1391, 1, fname, 1, 1, cdum)
        call gopks (…)
        call gopwk (…) 

 

Plotting Areas and Axes

These routines set up the coordinate system for all the plotting discussed in the next section. In both DISSPLA and NCAR provide a rich set of options. Here some of the basic possibilities are listed.  The result of using the NCAR routines will be similar to using the DISSPLA routines. To get closer or equivalent output, refer to the detailed DISSPLA and NCAR documentation.

DISSPLA

NCAR

Plotting areas:

call page (width, height)

width, height - page width and height

call area2d (width, height)

width, height - width and height of plot area

 
There are no equivalent calls in NCAR. Some of this functionality is possible using the programs which display the CGM output of NCAR (e.g. ctrans).

Define Cartesian coordinate systems and axes:

call graf (xorig, xstp, xmax, yorig, ystp, ymax) - set up linear x, linear y coordinate system and axes

call ylog (xorig, xstep, yorig, ycycle) - set up linear x, log y coordinate system and axes

call xlog (xorig, xcycle, yorig, ystep) - set up log x, linear y coordinate system and axes

call loglog (xorig, xcycle, yorig, ycycle) - set up log x, log y coordinate system and axes

 

call set (vxmn, vxmx, vymn, vymx, xmn, xmx, ymn, ymx, itype)

vxmn, ... (real) - defines where on the frame the data is plotted..

xmn, ... (real) - defines the user coordinate system.

itype (int) - defines the transformation.

1 = linear x, linear y
2 = linear x, log y
3 = log x, linear y
4 = log x, log y

Define polar coordinate systems and axes:

call polar (thefac, rstep, xdist, ydist)

thefac (real) - conversion of theta to radians.

rstep (real) - radius step size in units/inch.

xdist, ydist (real) - position of origin in inches.

 
 
call stseti ('MAP', 2)
call stsetr ('XC1', rmin)
call stsetr ('XCM', rmax)
call stsetr ('YC1', tmin)
call stsetr ('YCM', tmax)

rmin, rmax (real) - minimum and maximum radius.

tmin, tmax (real) - minimum and maximum theta in degrees.

 

Grid, Label, and Text Routines

NCAR has at least two ways to produce a grid, ticks, labels, etc. The first method used the features of NCAR called "Autograph". This method is recommended because it best matches the capabilities of DISSPLA, and is the easiest to use. Autograph also has the capability to draw complete line graphs. We are not recommended using "Autograph" for drawing lines to DISSPLA users because the DASHPACK routines better support curve smoothing. "Better" here means that you do not need to change the libraries you load, and smoothing is turned off and on using a flag.

The second method would be to use the grid routines in NCAR, e.g., GRIDAL. These routines have a lot of flexibility, but you need to provide more information. If you are interested in using these routines, see "man gridal" and "man gridall_params".

In the case of drawing text both DISSPLA and NCAR again off a rich set of options, fonts, etc. In the table below a very basic set of text drawing options are given. See the documentation for DISSPLA and NCAR for more information.

DISSPLA

NCAR

Draw a grid:

call grid (ixgrid, iygrid)

ixgrid, iygrid (int) - number of grid lines per step (if negative then use thin lines).

 

Refer to the GRIDAL routines mentioned above.

Titles:

call headin (lhead, ihead, htmult, nlines)

lhead (string) - character string to use.

ihead (int) - number characters in lhead.

htmult (real) - multiple of current character height.

nlines (int) - total number of lines (maximum = 4).

 

Passed as a parameter to many of the graphing routines (e.g. ezmxy). See examples below.

Labels axes:

call xname (lname, iname) - label x axis

call yname (lname, iname) - label y axis

lname (string) - character string to use.

iname (int) - number characters in lname.

 

call agsetc ('LABEL/NAME.', 'B')
call agseti ('LINE/NUMBER.', -100)
call agsetc ('LINE/TEXT.', lname)
 
call agsetc ('LABEL/NAME.', 'L')
call agseti ('LINE/NUMBER.', 100)
call agsetc ('LINE/TEXT.', lname)

lname (string) - character string to use.

The first set of calls set the x axis label and the second set of calls set the y axis label. See example below.

Draw text:

call rlmess (lmess, imess, xval, yval)

lmess (string) - text to draw.

imess (int) - number of characters in lmess.

xval, yval (real) - position of text in current coordinates.

 

call plchlq (xpos, ypos, chrs, size, angd, cntr)

xpos, ypos (real) - position of text in current coordinates.

chrs (string) - text to draw.

size (real) - multiplier for character:

<0) The absolute value of the specifies the character size as a multiple of a default digitized size on a 1024 x 1024 grid on which blanks are 16 units wide.

0.0 < size < 1.0) Specifies the desired width of a blank as a fraction of the distance across the plotter frame.

>1) Specifies the desired width of a blank in plotter coordinates, as defined by default or by a call to the SPPS routine SETI.

angd (real) - angle of text in degrees (0 is horizontal).

cntr (int) - centering of text:

-1) The point (xpos, ypos) is the center of the left edge of the first character.

1) The point (xpos, ypos) is the center of the right edge of the last character.

0) The point (xpos, ypos) is the midpoint of the line joining the center of the left edge of the first character to the center of right edge of the last character.

Text alignment:

call alnmes (xalign, yalign)

xalign (real) - position the message so that xval (see rlmess above) is this fraction of the distance from the left edge to the right edge of the string (e.g. 0.0 is the left and 1.0 is the right).

yalign (real) - position the message so that yval (see rlmess above) is this fraction of the distance from the bottom to the top of the string (e.g. 0.0 is the bottom and 1.0 is the top).

 

See the cntr argument to plchlq above.

Text angle:

call angle (ang)

ang (real) - angle of text in degrees (0 is horizontal).

 

See the angd argument to plchlq above.

Text size:

call height (hite) - height of all strings

call cwidth (lwidth) - width of each character

hite (real) - height of strings and labels in inches.

lwidth (string) - width of characters: 'NORMAL', 'CONDENSED', or 'EXTENDED'

 

See the size argument to plchlq above.

To create a grid with axis, ticks, and tick labels without drawing lines and axis titles, do:

c	specifies no frame advance after the call to ezxmy so you can add your curves,
c	contours, etc.
	call agseti ('frame.', 2)
c	don't have ezxmy draw the curves nor change the limits of the data defined by
c	the call to set.
	call agseti ('SET.', -4)
c	I don't think the next calls are needed because of the previous call, but I do
c	it for completeness.
	data_x(1) = xmin	! set the values of data_x and data_y to the limits of 
	data_x(2) = xmax	! your data, defined in the call to set.
	data_y(1) = ymin
	data_y(2) = ymax
c	suppress x and y axis titles, NOTE that the call order is critical.
	call agsetc ('LABEL/NAME.', 'B')	! x axis
	call agseti ('LABEL/SUPPRESSION FLAG.', 1)
	call agsetc ('LABEL/NAME.', 'L')	! y axis
	call agseti ('LABEL/SUPPRESSION FLAG.', 1)
c	draw grid, also suppressing the graph title
	call ezmxy (data_x, data_y, 1, 1, 1, '')

 

To have the titles plotted (x and y axis titles, and graph titles) do:

	call agseti ('frame.', 2)
	call agseti ('SET.', -4)
c	I don't think the next calls are needed because of the previous call, but I do
c	it for completeness.
	data_x(1) = xmin	! set the values of data_x and data_y to the limits 
	data_x(2) = xmax	! of your data, defined in the call to set.
	data_y(1) = ymin
	data_y(2) = ymax
c	specify the x and y axis titles, NOTE that the call order is critical.
	call agsetc ('LABEL/NAME.', 'B')	! x axis
	call agseti ('LINE/NUMBER.', -100)
	call agsetr ('LIN/CH.', .03)		! increase the size of the characters
	call agseti ('LINE/TEXT.', xlabel)	! xlabel is a character string
	call agsetc ('LABEL/NAME.', 'L')	! y axis
	call agseti ('LINE/NUMBER.', 100)
	call agsetr ('LIN/CH.', .03)		! increase the size of the characters
	call agseti ('LINE/TEXT.', ylabel)	! ylabel is a character string 
c	draw grid with the graph title
	call ezmxy (data_x, data_y, 1, 1, 1, 'My Title')

 

Line and Marker Routines

By changing parameters, DISSPLA could plot lines, markers, and disjoint lines with or without smoothing. NCAR has a more than one way to draw lines and markers. The examples below show how to use the DASHPACK routines in NCAR. These routines are recommended over curve and curved because smoothing can be done without loading anything special, and because parameters can be set through subroutine calls. Both DISSPLA and NCAR can do smoothing in a variety of ways and there are very few exact equivalencies. Below are some possibilities. These can be used as a starting point. Note: line style changes affect all lines drawn in DISSPLA and NCAR. The only exception might be in some of the higher level routines in NCAR.

DISSPLA

NCAR

Plot a line between points:

call strtpt (x, y) - move to first point
call connpt (x, y) - connect last point to this point

x, y (real) - coordinates of the point.

 

call dpfrst (x, y) - move to first point
call dpvect (x, y) - connect last point to this point
call dplast - flush buffer

x, y (real) - coordinates of the point.

Plot a line when n points:

call curve (xarray, yarray, length, imark)

xarray, yarray (real array) - contains the array of x, y coordinates to plot.

length (int) - number of point to plot.

imark (int) - put a marker every imark points (if negative don't connect the points, if zero don't use draw the symbol.

 

call dpcurv (xarray, yarray, length)

xarray, yarray (real array) - contains the array of x, y coordinates to plot.

length (int) - number of point to plot.

Set marker:

call marker (isym)

isym (int) - select the marker to use.

 

call dpsetc ('DPT', marker)

marker (string) - select the string to use as the marker. The string is used in calls to the text drawing routines that will use the currently defined sizes and fonts. Thus, this can be used to draw any character available in NCAR as a marker.

Set line pattern:

call dot - dotted lines
call dash - dashed lines
call chndot - chain dotted lines
call chndsh - chain dashed lines

call mrscod (tleng, nmrksp, ratray) - user defined pattern

tleng (real) - overall length of pattern in inches.

nmrksp (int) - total number of marks and spaces.

ratray (real array) - array of size nmrksp of ratios of marks and spaces to tleng .

 

call gsln (itype)

itype (int) - line pattern:

l = solid
2 = dashed
3 = dotted
4 = dash-dotted

See the example below for user defined patterns.

Set line thickness:

call thkcrv (thknss)

thkcrv (real) - curve thickness in inches.

 

call gslwsc (size)

size (real) - line width scale factor. A value of 1.0 is the default line width. A value of 0.0 produces no lines, where 2.0 will double the line width on most devices (i.e. the displayed line width is dependent on the hardware capabilities of the graphics device being used).

Line interpolation/smoothing:

call linear - linear interpolation

call raspln (tensn) - rational spline interpolation

tensn (real) - "tension" number that determines smoothing.

call spline - cubic spline interpolation

call psplin - parametric cubic spline interpolation

call poly3
call para3
call poly5
call poly5 - parametric polynomial interpolation

 

call dpsetr ('TCS', -1.0) - linear interpolation (default)

call dpsetr ('TCS', tensn) - cubic spline interpolation

tensn (real) - "tension" number that determines smoothing.

call dpsetr ('SSL', sslen) - set smoothed segment length

sslen (real) - specifies how far apart the point used to draw a smoothed curve should be. This number must be between 0.000001 and 1 (0.01 is the default value).

call dpsetr ('EPS', epsilon) - separate point spacing

epsilon (real) - specifies how far apart two points must be in order to be considered separate points for smoothing purposes.

Defining line styles in NCAR via the dashpack parameters:

	subroutine dashpat(num)

c	routine that produces 10 dash line patterns
c	it is a simple routine, because previous states are not
c	saved and restored. '$' represents a solid line, '_'
c	represents a blank. The line patterns are stored in dashpt
c	and their length in dashsz.

	integer dashsz(10)
	character*10 dashpt(10)
	data dashpt /	'$', '$_', '$$__', '$$$$___', 
     x			'$$$$$$____', '$$_$_$$_$_', '$$$$_$_',
     x			'$$$$$__$__', '$$_$_$_', '$$$$$_$_$_'/
	data dashsz/1, 2, 4, 7, 10, 10, 7, 10, 7, 10/

c
c	If num is greater than 10, make it 10
	num_dash = num
	if (num_dash .gt. 10) num_dash = 10

	call dpseti ('DPS', 0)
	call dpsetc ('DPT', dashpt(num_dash))
	call dpseti ('DPL', dashsz(num_dash))
c
	return
	end

 

Contouring Routines

It is difficult to give a one-to-one correspondence between contouring for DISSPLA and NCAR. They both have a rich set of routines and options. The best way to convert is to look at the examples shown here, or use the examples of contouring in ncargex (see 'man ncargex'). You might want to use the higher level routines in NCAR (see how to run these examples by doing 'man ng4ex'), but I have neither looked them over nor tried them out.

There is, by and large, less functionality in DISSPLA than there is in NCAR. DISSPLA provides the ability to do contouring as an "Engineering Option" where it is an integrated capability of NCAR. Basically, DISSPLA allow the user to read contours generated elsewhere to make up for this (a capability NCAR doesn't have, as far as I know). DISSPLA provides only a few ways to convert data not on a grid to a grid and one way to generate contours. It then provides various options for drawing contours regardless of how they were generated. NCAR does not separate the generation and drawing of contours and it provides many, many ways of dealing with data that does not lie on a grid.

A PostScript version of NCAR's contouring package (CONPACK) is available from the web at: http://ngwww.ucar.edu/ngdoc/ng4.0.1/conmaptutor/conpack/conpacka.html. This document is important to read. It has a lot of useful information in it that this simple guide does not duplicate. You may also want to refer to this section of the GRAFLIB to NCAR transition guide, http://www-vis.lbl.gov/software/graf_trans.html, as it contains addition information on some of the NCAR contouring routines that go beyond what is available in DISSPLA.

Some things to note:

DISSPLA

NCAR

Generating and drawing contours:

call conmak (zmat, ixdim, iydim, zincr) - generate contours

zmat (real 2D array) - two dimensional array containing Z data values for the surface.

ixdim, iydim (int) - x and y dimension of zmat.

zincr (real) - increment between Z levels.

call contur (nlines, lblflg, idraw) - draw contours

nlines (int) - the number of sets of line characteristics to be used (see conlin below).

lblflg (string) - labeling flag: 'LABELS', 'NOLABELS', 'BLANKED LABES'.

idraw (string) - curve drawing flag: 'DRAW', 'NODRAW'.

 

call cprect (...) ! initialize contour
call cpback (...) ! draw background
call cpcldr (...) ! contouring routine

The calls below should be place before the calls to cprect above.

call cpseti ('CLS', clevel) - control contour levels

clevel (int) - contour level selection flag:

0) - use the contour levels chosen in the previous calls to CONPACK routines.

-n) - generate n contour levels, splitting the range from the minimum to maximum level into n+1 equal intervals.

+n) - see CONPACK documentation.

call cpseti ('LLP', llpos) - control labels

llpos (int) - line label positioning:

0) - no labels.

!=0) - generate label (see CONPACK documentation).

Generating contours between two Z levels:

call zrange (dmin, dmax)

dmin, dmax (real) - minimum and maximum Z levels.

 

call cpseti ('CMN', dmin)
call cpseti ('CMX', dmax)
call cprect (...) ! initialize contour
call cpback (...) ! draw background
call cpcldr (...) ! contouring routine

dmin, dmax (real) - minimum and maximum Z levels.

Generating contours for specific levels:

call conlvs (zary, nzs, idatyp)

zary (real array) - array of Z levels for contours.

nzs (int) - number of Z levels in zary.

idatyp (string) - type of data in zary: 'DATA', 'PERCENT', 'NONE'

 

 

See examples below, the CONPACK documentation mentioned above, and the GRAFLIB to NCAR transition guide mentioned above.

Contour line characteristics:

call conlin (lineno, mode, lblflg, ithick, iprior)

lineno (int) - the index number of the curve characteristic (0 to 19).

mode (string) - line type: 'DOT', 'DASH', 'CHNDOT', 'CHNDSH', 'SOLID', 'MYCON', 'MYCNLN'.

lblflg (string) - labeling flag: 'LABELS', 'NOLABELS'.

ithick (int) - number of lines drawn a "pen width" apart.

iprior (int) - line priority (1 to 10) for thinning and deleting.

 

See examples below, the CONPACK documentation mentioned above, and the GRAFLIB to NCAR transition guide mentioned above.

Below is a code fragment demonstrating how you can choose your own contour levels:

	data clevels/-1.,0.,5.,10./
	
	INCL = 4
	call cpseti('CLS - Contour Level Selector', 0)
	call cpseti('NCL - No. of contour levels', INCL)
	DO I = 1,INCL
	   call cpseti('PAI - Parameter Array Index', I)
	   call cpsetr('CLV - Contour level value', clevel(I))
	enddo

If you change the mapping function (e.g. call cpseti ('MAP -- Mapping Function', cpmpxy)) you need to add a routine like cpmpxy below to:

	SUBROUTINE CPMPXY(IMAP,XINP,YINP,XOTP,YOTP)
C
C 	This version of CPMPXY implements four different mappings:
C
C   	IMAP = 1 implies an EZMAP mapping. XINP and YINP are assumed to be
C   	the longitude and latitude, in degrees, of a point on the globe.
C
C   	IMAP = 2 implies a polar coordinate mapping. XINP and YINP are
C   	assumed to be values of rho and theta (in degrees).
C
C   	IMAP = 3 implies an orthogonal, but unequally spaced mapping. XINP
C   	is assumed to lie in the range from 1 to M, YINP in the range from
C   	1 to N, where M and N are the dimensions of the grid. The common
C   	block CPMPC1 contains arrays XFOI and YFOJ giving the X coordinates
C   	associated with I = 1 to M and the Y coordinates associated with
C   	J = 1 to N.
C
C   	IMAP = 4 implies a generalized distortion. XINP is assumed to lie
C   	in the range from 1 to M, YINP in the range from 1 to N, where M
C   	and N are the dimensions of the grid. The common block CPMPC2
C   	contains arrays XFIJ and YFIJ, giving the X and Y coordinates
C   	associated with index pairs (I,J).
C
C 	Declare common blocks.
C
	   Parameter (M=<data column dimension >, N=<data row dimension>)
        COMMON /CPMPC1/ XFOI(M),YFOJ(N)
        COMMON /CPMPC2/ XFIJ(M,N),YFIJ(M,N)
C
C 	Do the mapping.
C
        IF (IMAP.EQ.1) THEN
          CALL MAPTRN (YINP,XINP,XOTP,YOTP)
        ELSE IF (IMAP.EQ.2) THEN
          XOTP=XINP*COS(.017453292519943*YINP)
          YOTP=XINP*SIN(.017453292519943*YINP)
        ELSE IF (IMAP.EQ.3) THEN
          I=MAX(1,MIN(32,INT(XINP)))
          J=MAX(1,MIN(32,INT(YINP)))
          XOTP=(REAL(I+1)-XINP)*XFOI(I)+(XINP-REAL(I))*XFOI(I+1)
          YOTP=(REAL(J+1)-YINP)*YFOJ(J)+(YINP-REAL(J))*YFOJ(J+1)
        ELSE IF (IMAP.EQ.4) THEN
          I=MAX(1,MIN(32,INT(XINP)))
          J=MAX(1,MIN(32,INT(YINP)))
          XOTP=(REAL(J+1)-YINP)*
     +    ((REAL(I+1)-XINP)*XFIJ(I,J  )+(XINP-REAL(I))*XFIJ(I+1,J  ))
     +    +(YINP-REAL(J))*
     +    ((REAL(I+1)-XINP)*XFIJ(I,J+1)+(XINP-REAL(I))*XFIJ(I+1,J+1))
          YOTP=(REAL(J+1)-YINP)*
     +    ((REAL(I+1)-XINP)*YFIJ(I,J  )+(XINP-REAL(I))*YFIJ(I+1,J  ))
     +    +(YINP-REAL(J))*
     +    ((REAL(I+1)-XINP)*YFIJ(I,J+1)+(XINP-REAL(I))*YFIJ(I+1,J+1))
        ELSE
          XOTP=XINP
          YOTP=YINP
        END IF
C
C Done.
C
        RETURN
C
      END