next up previous
Next: Cancelling a Parameter
Up: Basic Routines
Previous: Getting an Array of Values

Putting a Parameter's Value  

The opposite to get is put. Using traditional Fortran input-output, the equivalent of putting a value is to write the value to a file. In addition to getting parameter values, PAR can also put values into parameters. Suppose we have an application that computes statistical parameters for a data array. We should like to store these statistics in parameters, so that they may be passed to a later application. Thus we could have a number of puts - one per statistic. Here we just put the standard deviation value in the parameter SIGMA.

          CALL PAR_PUT0D( 'SIGMA', STDDEV, STATUS )

The value is written to a parameter file associated with the application. This file contains not only any values you have put there, but also the last-used values of all the parameters of that application.[*]

If we had the values corresponding to the quartiles and median of a data array we could use a routine that handles a 1-dimensional array.

          DOUBLE PRECISION QRTILE( 3 )

              :       :       :

          CALL PAR_PUT1D( 'QUARTILES', 3, QRTILE, STATUS )

When you put an array, the subroutine arguments specify both the dimensionality and size of that array, and the size of an `object' into which the array is to be put.[*]

Analogous to the PAR_GETNx and PAR_GETVx routines for getting arrays of values, there are equivalent generic routines, PAR_PUTNx and PAR_PUTVx, for putting values in parameters. Using PAR_PUTNx in one application and accessing the array via PAR_GETNx without prompting is the most likely way to handle n-dimensional arrays of parameter values.

See SUN/115 Appendix C for details of the specifications needed within the interface file to deal with scalar and array output parameters.



next up previous
Next: Cancelling a Parameter
Up: Basic Routines
Previous: Getting an Array of Values

PAR Interface to the ADAM Parameter System
Starlink User Note 114
Malcolm J. Currie
Alan J. Chipperfield
1999 September 24
E-mail:ussc@star.rl.ac.uk