TOC PREV NEXT INDEX

Put your logo here!


11 Subroutine Calls

PPLUS can be run from another program by linking the PPLUS libraries and using the following subroutines. When PPLUS is run via the subroutine calls the behavior is identical to the stand alone version. See the fortran source code of pplus.F or PPLUS.FOR for an example of how these subroutines are used.

PPLUS routines
opnppl is used to initialize the PPLUS package. The logical unit numbers specified should be chosen so that PPLUS will not interfere with the controlling programs input/output. opnppl must be called before and PPLUS routines are used.
opnppl subroutine opnppl(efile,elun,dlun,mlun,clun,ltt,key1,key2,epl1,epl2)
character efile*(*)
integer elun,dlun,mlun,clun,ltt,key1,key2,epl1,epl2

efile echo file name
elun echo lun
dlun data lun
mlun multplt temporary file lun
clun command file lun
ltt terminal lun
key1 first key file lun
key2 second key file lun
epl1 first EPIC lun
epl2 second EPIC lun

pplcmd runs PPLUS in one of three modes: 1) command input is from a command file specified by fromi and the command file arguments are given in linei; 2) command input is from the terminal, fromi is the device name from the terminal; 3) command input is given is combuf of length icmsze. Whichever method you use the unused variable must be either zero or set blank. Control will be returned to the calling program when PPLUS processes either all the commands in the buffer have been executed, a return or EOF from the command file is processed or the exit command is issued.

pplcmd subroutine pplcmd(fromi,linei,isi,combuf,icmdim,icmsze)
character fromi*(*),linei*(*),combuf(icmdim)*(*)
integer isi,icmdim,icmsze

fromi command file or device (/dev/tty or TT: for terminal)
linei input line for parameters
isi length of line in characters
combuf() command buffer
icmdim dimensioned length of combuf
icmsze number of lines in combuf

pplldc is used to load contour data directly from memory into PPLUS without going through the rd command. The meaning of the parameters is consistent with the rd command.

pplldc subroutine pplldc(k,z,mx,my,imn,imx,jmn,jmx,pi,pj,nx,ny,xmin,ymin,dx,dy,tstrt,xdt)
integer k,mx,my,imn,imx,jmn,jmx,nx,ny
real pi(*),pj(*),z(mx,my),xmin,ymin,dx,dy,xdt
character tstrt*12

k = 0 already on an equally spaced rectangular grid
= 1 on an unequally spaced, but rectangular grid
z input array
mx dimensioned x size of z(mx,my)
my dimensioned y size of z
imn initial x index value
imx final x index value
jmn initial y index value
jmx final y index value
pi x positions pi(mx)
pj y positions pj(my)
nx number of x grid points in output buffer
ny number of y grid points in output buffer
xmin x position of (1,1) in output grid
ymin y position of (1,1) in output grid
dx spacing of x grid points in output grid
dy spacing of y grid points in output grid
tstrt start time in WHOI format, corresponds to xt=1.0
xdt sample rate in minutes for x

pplldv is used to load the second component of gridded data directly from memory into PPLUS. The meaning of the parameters is consistent with the rd command. The pplldv routine is only to be used immediately after pplldc has been used, pplldv assumes the same grid definitions from the pplldc routine. WHOI date format is either Wyymmddhhmm or Wyyyymmddhhmm.

pplldv subroutine pplldv(k,z,mx,my,imn,imx,jmn,jmx)
integer k,mx,my,imn,imx,jmn,jmx
real z(mx,my)

k = 0 already on an equally spaced rectangular grid
= 1 on an unequally spaced, but rectangular grid
z input array mx -- dimensioned x size of z(mx,my)
my dimensioned y size of z
imn initial x index value
imx final x index value
jmn initial y index value
jmx final y index value

pplldx allows the calling program to load x-y pairs of data directly into the PPLUS plotting buffers from memory. tstrt and xdt are used only for time series data. The parameters have meanings similar to the rd and vars commands.

pplldx subroutine pplldx(icode,xt,yt,npts,tstrt,xdt)
integer icode,npts
real xt(*),yt(*),xdt
character tstrt*12

icode = 0 use both x and y
= 1 use x only
= 2 use y only
xt x data
yt y data
npts number of xt and yt points
tstrt start time in WHOI format, corresponds to xt=1.0
xdt sample rate in minutes for x

tstrt and xdt are used only for taxis,on

clsppl is called when the calling program is done with PPLUS. This routine must be called to insure that all the temporary buffers are flushed and temporary files are removed.

clsppl subroutine clsppl
PPLUSR routine
pplusr is a subroutine that is called by PPLUS when ever the usr command is issued. pplusr should not directly access any of the PPLUS common blocks or variables. All interaction should be via the routines described in this chapter.
pplusr subroutine pplusr(command,ier,msg)
character command*255,msg*80
integer ier

command command passed to pplusr from PPLUS
ier = 0 no error
= 1 error
=-1 non fatal error
msg a string containing a description of the error
Symbol routines
The following routines are used to store, read and delete PPLUS symbols. PPLUS symbols are stored in upper case. The naming convention for global symbols applies to these routines.

putsym is used to create or update a symbol with a new value. These symbols will be available to PPLUS command files.

putsym subroutine putsym(sym,value,nc,ier)
character sym*30,value*255
integer nc,ier

sym symbol name`
value value of symbol
nc length of value
ier = 0 success
= 1 error

getsym is used to access the symbols created by the calling program, the users command file or PPLUS.

getsym subroutine getsym(sym,value,nc,ier)
character sym*30,value*255
integer nc,ier

sym symbol name
value value of symbol
nc length of value
ier = 0 success
= 1 symbol not found

delsym is used to delete symbols from PPLUS.

delsym subroutine delsym(sym,ier)
character sym*30
integer ier

sym symbol name
ier = 0 success
= 1 symbol not found
PPLUS format routines
Here is a group of six routines used to load data into and retrieve data from a header in the PPLUS formatted DSF file header. (See the chapter on data formats for more information.) The argument list for the subroutines that load and get the header information are identical for each type of data.

ldgrid and gtgrid load and get information about the data grid.

ldgrid subroutine ldgrid(xmin,xmax,nx,ymin,ymax,ny,itype,ang,gty,info)
real xmin,xmax,ymin,ymax,ang
integer nx,ny,itype
character gty*8,info*32

xmin minimum x value (user units)
xmax maximum x value (user units)
nx number of x grid points
ymin minimum y value (user units)
ymax maximum y value (user units)
ny number of y grid points
itype data type (=0 2-d set, =1 1-d set)
ang grid orientation angle
gty grid type
info additional grid information

ldcmnt and gtcmnt load and get user comment information.

ldcmnt subroutine ldcmnt(cmnta,cmntb,cmntc,cmntd,cmnte)
character*120 cmnta,cmntb,cmntc,cmntd,cmnte

cmnta user supplied comment
cmntb
cmntc
cmntd
cmnte

lduser and gtuser load and get user fields.

lduser subroutine lduser(usera,userb,userc,userd)
character*32 usera,userb,userc,userd

usera user supplied field
userb
userc
userd

ldplid and gtplid load and get plot identification information.

ldplid subroutine ldplid(ident,source,date,time)
character ident*32,source*32,date*16,time*16

ident identifier of plot file
source source of plot file
date date of plot file creation
time time of plot file creation

ldvar and gtvar load and get information about the data.

ldvar subroutine ldvar(name,date,time,ident,mean,var,std,rms,min,max,jdate,lat,long)
character name*32,date*16,time*16,ident*32
real mean,var,std,rms,min,max,jdate,lat,long

name name of variable
date gregorian date
time time of data
ident variable identification
mean mean of variable
var variance of the data
std standard deviation of the data
rms root mean square of variable
min minimum of variable
max maximum of variable
jdate julian date of variable
lat latitude of variable (or grid)
long longitude of variable (or grid)

ldaxlb and gtaxlb load and get the axis labels.

ldaxlb subroutine ldaxlb(xlabel,ylabel,main)
character xlabel*80,ylabel*80,main*120

xlabel x axis label
ylabel y axis label
main main title of plot

More information about the PPLUS data format can be found in the ppl.inc include file. This file defines the header information. There is information in the header not directly available via the above routines.



Quadralay Corporation
http://www.webworks.com
Voice: (512) 719-3399
Fax: (512) 719-3606
sales@webworks.com
TOC PREV NEXT INDEX