CHAPTER 2 - LAUE DATA MODULE (LDM) ROUTINES

2.1 INTRODUCTION

This chapter gives details of the routines which are available to read, write and access the Laue Data Module (LDM) Data.

The following sets of routines are available:

Read, Parse and Write LDM Data
Setting LDM Parameter Values
Getting LDM Parameter Values
Symmetry Handling Routines
Convenience and Supplementary LDM Routines
Monitor LDM Parameter Value Changes
Make Distortion Corrections to Coordinates
Save and Restore Refineable Parameter Values
Special Routines for Use with Laue Reflection Lists
Special Reciprocal Lattice to Detector Conversions
Handle Extended LDM Data

2.2 READ, PARSE AND WRITE LDM DATA

2.2.1 Introduction

Routines are available to read lines of data from a file (accessing indirect file references if present) and to examine such lines for LDM data; if such data are found the data will be checked for validity and stored in the Laue Data Module. Any non-LDM data lines will be returned to the calling program for interpretation by that program and this LDM and other control or parameters data may be included in the file being read. Lines of data from other sources may also be interpreted using the parsing routine and indirect file references in such data may be handled if required. A routine is also available to write out the current LDM data to a file; this has a number of options ranging from only writing non-default data items to writing all data items for every pack and plate where relevant. There is also an option to write out only LDM parameter values which have been changed since a particular point in a program.

The following routines are available:

Read Line of Data from a File - LDM_READLINE
Handle Indirect File References in a String - LDM_READSTR
Parse Line Containing LDM Data - LDM_PARSE
Parse LDM Data with Additional Checking - LDM_CHK_PARSE
Parse and LDM Item - LDM_PARSEITEM
Write LDM Parameters Data - LDM_WRITE

2.2.2 Read Line of Data from a File - LDM_READLINE

This routine will return, on repeated calls, the next logical line of data read from a parameters file. Any indirectly referenced parameter files will be read as required. The logical line returned will contain any continuation lines present but will exclude any comments found.
 
Fortran call:
 
      SUBROUTINE LDM_READLINE (IUN, KUN, INDIRECT, LINE, EOF, IERR)
 
Parameters:
 
IUN      i (R)   Logical unit number of file/stream being read.
KUN      i (R)   Start logical unit number for use with indirect files.
                 Unit nos. (up to MAXIND e.g. 20) in sequence will be 
                 used but any already open will be skipped.
INDIRECT i (R/W) Current indirection level. MUST be set to 0 on first 
                 call to read the file and subsequently must give the 
                 previously returned value.You should ensure that the 
                 program repeats calls to the routine until EOF is 
                 returned as .TRUE. or INDIRECT is returned as 0 
                 (otherwise files will be left open)
LINE     c (W)   Returns the next logical line with comments removed and
                 with all continuation lines included.
EOF      l (W)   .TRUE.  End of file encountered on main input stream 
                         (IUN)   
                 .FALSE. No end of file on main input stream.
IERR     i (W)   Returned error flag = 0 OK
                                     = 1 LINE too short, data truncated
                                     = 2 Error opening indirect file
                                     = 3 Maximum allowed level of 
                                         indirection exceeded
                                     = 4 Insufficient Fortran units 
                                         available for opening indirect 
                                         files
                                     = 5 Calling error (invalid INDIRECT 
                                         value)

                 For error flags > 1, all opened indirect files will be 
                 closed

Notes:   Allows for indirect reads from specified files up to MAXIND
         levels (e.g. 20) in depth. 

         Conventions for comments & continuations similar to CCP4 parser
         but only '!' introduces comments (and not '#')

         If '@' not followed by a file name is found, then all
         indirection is cancelled and the next line is read from
         the main input stream.

2.2.3 Handle Indirect File References in a String - LDM_READSTR

This routine is similar to LDM_READLINE in its handling of indirect files. The difference is that the line for examination is passed to the routine rather than being read from a top level parameter file.
 
Fortran call:
 
      SUBROUTINE LDM_READSTR (LINE, KUN, INDIRECT, IFLAG, IERR)
 
Parameters:
 
LINE     c (R/W) On input is the line to be decoded for indirect file
                 specification. The string should not contain comment or
                 continuation characters and, if an indirect file
                 specification is used, then it should only contain that
                 specification.
                 On output is the next line read from an
                 indirect file (or the original line if no indirection
                 found (or blank if the input line contained '@' only)).
KUN      i (R)   Start logical unit number for use with indirect files.
                 Unit nos. (up to MAXIND e.g. 20) in sequence will be 
                 used but any already open will be skipped.
INDIRECT i (R/W) Current indirection level. MUST be set to 0 on first 
                 call to read the file and subsequently must give the 
                 previously returned value. You should ensure that the 
                 program repeats calls to the routine until IFLAG or 
                 INDIRECT are returned as 0 (otherwise files will be 
                 left open).
IFLAG    i (W)   Flag = 0, if first call and string does not contain
                           indirect file specification. 'LINE' is
                           returned as input.
                      = 1, Line read from indirect file
                      =-1, End of indirect data reached
IERR     i (W)   Returned error flag = 0 OK
                                     = 1 LINE too short, data truncated
                                     = 2 Error opening indirect file
                                     = 3 Maximum allowed level of 
                                         indirection exceeded
                                     = 4 Insufficient Fortran units 
                                         available for opening indirect 
                                         files
                                     = 5 Calling error (invalid INDIRECT 
                                         value)

                 For error flags > 1, all opened indirect files will be 
                 closed

Notes:   Allows for indirect reads from specified files up to MAXIND
         levels (e.g. 20) in depth. 

         Conventions for comments & continuations similar to CCP4 parser
         but only '!' introduces comments (and not '#')

         If '@' not followed by a file name is found, then all
         indirection is cancelled. A blank line will be returned
         and IFLAG will be returned as 0 (see above)

2.2.4 Parse Line Containing LDM Data - LDM_PARSE

This routine parses a given line of data, examining it for the presence of LDM data. Any such data found is automatically checked and, if valid, stored in the Laue Data Module. If the line does not contain LDM data, then it is merely passed back to the calling program to allow further interpretation by that program. LDM and non-LDM data must not be given in the same line of data and a line of data containing any valid LDM keyword will be assumed to be an LDM parameter line. The calling program should also take account of the fact that incorrectly specified LDM keyords may result in the line being returned to the calling program.
 
Fortran call:
 
      SUBROUTINE LDM_PARSE (LINE, IFLAG, BADTOK, ERRSTR)
 
Parameters:
 
LINE     c (R)   Character string containing line to be parsed
                 (Assume comments & continuations already removed)
IFLAG    i (W)   Return flag = 0,  Laue module data found & OK
                             = 1,  Not Laue module data
                             = 2,  No non-blank tokens
                             < 0,  Laue module data but error(s)
                             =-1,  Invalid or inappropriate pack 
                                   specification
                             =-2,  Invalid or inappropriate plate 
                                   specification
                             =-3,  Syntax error in pack/plate 
                                   specification
                             =-4,  Invalid code/string value or syntax 
                                   error
                             =-5,  Invalid value - must be >=0.0 (>=0)
                             =-6,  Invalid value - must be >0.0 (>0)
                             =-7,  Other out of range value
                             =-8,  Non-LDM data mixed with LDM data
                                   (Possibly miss-spelt keyword)
                            -100,  Coding error in LDM routines, 
                                   information supposedly already 
                                   checked is found later to be invalid! 
BADTOK   c (W)   Returns the token string for an invalid token
ERRSTR   c (W)   Error string (max 80 chars) if IFLAG<0

2.2.5 Parse LDM Data with Additional Checking - LDM_CHK_PARSE

This routine is similar to LDM_PARSE but a user supplied routine may make an additional check on each LDM parameter and disable its update if desired.
 
Fortran call:
 
      SUBROUTINE LDM_CHK_PARSE (LINE, PGM_CHK, IFLAG, BADTOK, ERRSTR)
 
Parameters:
 
LINE     c (R)   Character string containing line to be parsed
                 (Assume comments & continuations already removed)
PGM_CHK  s (R)   Subroutine to make additional check on LDM parameters
                 to restrict updates (or return other information to 
                 calling program about the parameters found via common 
                 blocks)

                 The call will be as follows: CALL PGM_CHK (KEYWORD, OK)    

                 KEYWORD   (R) CHARACTER*(*) variable holding the full
                               name of the LDM parameter or extended
                               LDM parameter.
                 OK        (W) Logical flag; return .TRUE. if parameter
                               may be updated or .FALSE. if it may not.

IFLAG    i (W)   Return flag = 0,  Laue module data found & OK
                             = 1,  Not Laue module data
                             = 2,  No non-blank tokens
                             < 0,  Laue module data but error(s)
                             =-1,  Invalid or inappropriate pack 
                                   specification
                             =-2,  Invalid or inappropriate plate 
                                   specification
                             =-3,  Syntax error in pack/plate 
                                   specification
                             =-4,  Invalid code/string value or 
                                   syntax error
                             =-5,  Invalid value - must be >=0.0 (>=0)
                             =-6,  Invalid value - must be >0.0 (>0)
                             =-7,  Other out of range value
                             =-8,  Non-LDM data mixed with LDM data
                                   (Possibly miss-spelt keyword)
                            -100,  Coding error in LDM routines, 
                                   information supposedly already 
                                   checked is found later to be invalid!
BADTOK   c (W)   Returns the token string for an invalid token
ERRSTR   c (W)   Error string (max 80 chars) if IFLAG<0

2.2.6 Parse and LDM Item - LDM_PARSEITEM

This routine is used by the higher level parsing routines described above but may be called by the user if required. It examines a given string to see if it is a valid LDM keyword and, if so, interprets and returns any pack/plate specification given.
 
Fortran call:
 
      SUBROUTINE LDM_PARSEITEM (STR, KEYWORD, IPACK, IPLATE, 
     +                          KTYP, IERR)
 
Parameters:
 
STR       c (R)    String containing the keyword string to be examined
KEYWORD   c (W)    Returns the full keyword name if the string is an LDM 
                   parameter (up to 20 characters in length)
IPACK     i (W)    Returns pack specification for an LDM parameter if
                   allowed and if present
IPLATE    i (W)    Returns plate specification for an LDM parameter if
                   allowed and if present
KTYP      i (W)    For LDM parameter returns  0 if global parameter
                                              1 if pack parameter
                                              2 if plate parameter
IERR      i (W)    Error flag  = 0  OK, LDM parameter & correct syntax
                               = 1  Non-LDM parameter
                               =-1  Pack specified when none allowed
                               =-2  Plate specified when none allowed
                               =-3  Syntax error in pack/plate 
                                    specification

2.2.7 Write LDM Parameters Data - LDM_WRITE

This is used to write out the current LDM parameters data to a data file or to a terminal. The data may be listed in different degrees of detail though any non-default parameter values are always written. A special option is available for use, in conjunction with the routines LDM_CH_RESET and LDM_ANY_CH, to write out parameter values changed since a flag was set at a particular point in a program.
 
Fortran call:
 
      SUBROUTINE LDM_WRITE (IUNOUT, IOPTYP)
 
Parameters:
 
IUNOUT  i (R)   Unit number for output (if <0 then terminal output is 
                required on unit -IUNOUT)
IOPTYP  i (R)   Type of output = 1 minimum, do not o/p parameters with 
                                   default values
                               = 2 standard output (selected parameters
                                   with default values will be included)
                               = 3 full (all parameters will be included)     
                               = 4 all individual values given for 
                                   plate/pack parameters.
                               < 0 write changed parameter values since 
                                   last reset of flag for channel 
                                   -IOPTYP (1-16) (see LDM_CH_RESET)

2.3 SETTING LDM PARAMETER VALUES

2.3.1 Introduction

The data in the Laue data module must only be accessed via a set of supplied routines to make its use independent of the actual way the data are held. There is a set of routines available for setting the parameter values. Each LDM parameter has its own routine which should be used where efficient access is required. There is also a general routine to set a parameter value by giving the keyword and a value string. For parameters with real values there is also the following distinction made. When a value is set by the explicit routine, then subsequent o/p will be done with the default number of decimal places for that parameter; when set via the keyword and string values the subsequent o/p will use the same number of decimal places as the given string. This is intended so that any unrefined values can basically be output as they were originally input in order to clarify the parameters file.

The following routines are available:

General Routine to Set LDM Parameter Value - LDM_SET
Reset Default LDM Parameter Value(s) - LDM_RESET
Individual Routines to Set LDM Parameter Values - LDM_SET_...

2.3.2 General Routine to Set LDM Parameter Value - LDM_SET

This routine is used to set an LDM parameter value given the full LDM keyword and a value string. Any pack/plate specifications are checked and the parameter value is also checked for validity.
 
Fortran call:
 
      SUBROUTINE LDM_SET (KEYWORD, IPACK, IPLATE, VALSTR, 
     +                    IERR, ERRSTR)
 
Parameters:
 
 KEYWORD   c  (R)  Full keyword string (upper case)
 IPACK     i  (R)  Pack number or 0=all packs 
                   (if relevant for the parameter)
 IPLATE    i  (R)  Plate number or 0=all plates 
                   (if relevant for the parameter)
 VALSTR    c  (R)  The string containing the parameter value
 IERR      i  (W)  Error flag = 0 OK
                              =-1 Invalid pack specification
                              =-2 Invalid plate specification
                              =-3 Invalid LDM keyword
                              =-4 Invalid polynomial coefficient no.
                              =-4 Memory allocation error
                              = 1 Invalid code/string or syntax error in
                                  number
                              = 2 Invalid value - must be >=0.0 (>=0)
                              = 3 Invalid value - must be >0.0 (>0)
                              = 4 Invalid value - must be <=0.0 (<=0)
                              = 5 Invalid value - must be <0.0 (<0)
                              = 6 Other out of range number
                              = 7 Invalid value for extended LDM keyword
 ERRSTR    c  (W)  Returns string for error message (max. 80 chars)

2.3.3 Reset Default LDM Parameter Value(s) - LDM_RESET

This routine is used to reset the default parameter value for an individual LDM parameter or for all LDM parameters. A blank keyword string indicates all parameters.
 
Fortran call:
 
      SUBROUTINE LDM_RESET (KEYWORD, IPACK, IPLATE, IERR, ERRSTR)
 
Parameters:
 
 KEYWORD   c  (R)  Full keyword string (upper case) or blank to reset all
                   LDM parameters.
 IPACK     i  (R)  Pack number or 0=all packs 
                   (if relevant for the parameter)
 IPLATE    i  (R)  Plate number or 0=all plates 
                   (if relevant for the parameter)
 IERR      i  (W)  Error flag = 0 OK
                              =-1 Invalid pack specification
                              =-2 Invalid plate specification
                              =-3 Invalid LDM keyword
 ERRSTR    c  (W)  Returns string for error message (max. 80 chars)

2.3.4 Individual Routines to Set LDM Parameter Values - LDM_SET_...

These are the individual routines for setting LDM parameter values.
As there are a large number of routines involved and as these routines 
have very similar parameters, a general description of the parameters
is given here and only the list of parameters is given with each
individual subroutine.

 General description of parameters for 'set' routines:

 KEYWORD    c (R)  Full keyword string (upper case) (blank = all 
                   parameters for LDM_RESET)
 VALUE      r (R)  The real parameter value to be set 
 IVAL       i (R)  The integer parameter value to be set
 VALSTR     c (R)  A string containing the parameter value
 SVAL()     r (R)  Values of the polynomial coefficients for Spatial
                   distortion polynomial parameters; for single 
                   coefficient put value in first element of the array.
                   (if ICOEFF.EQ.0) dimension to at least LDM_MAXSPD)
 IPACK      i (R)  Pack number or 0=all packs 
                   (if relevant for the parameter)
 IPLATE     i (R)  Plate number or 0=all plates 
                   (if relevant for the parameter)
 ICOEFF     i (R)  Coefficient no. if > 0, 0=all coefficients (Spatial
                   distortion polynomial parameters)
 IERR       i (W)  Error flag = 0 OK
                              =-1 Invalid pack specification
                              =-2 Invalid plate specification
                              =-3 Invalid LDM keyword
                              =-4 Invalid polynomial coefficient no.
                              = 1 Invalid code/string or syntax error in
                                  number
                              = 2 Invalid value - must be >=0.0 (>=0)
                              = 3 Invalid value - must be >0.0 (>0)
                              = 4 Invalid value - must be <=0.0 (<=0)
                              = 5 Invalid value - must be <0.0 (<0)
                              = 6 Other out of range number
 ERRSTR     c (W)  Returns string for error message if IERR is
                   non-zero (max. 80 chars)

Routines:

CRYStal          SUBROUTINE LDM_SET_CRYST (VALSTR, IERR, ERRSTR)
TITLe            SUBROUTINE LDM_SET_TITLE (VALSTR, IERR, ERRSTR)
SYSTem           SUBROUTINE LDM_SET_SYST (VALSTR, IVAL, IERR, ERRSTR)
LATTice          SUBROUTINE LDM_SET_LATT (VALSTR, IVAL, IERR, ERRSTR)
SYMMetry         SUBROUTINE LDM_SET_SYMM (VALSTR, IERR, ERRSTR)
BEAM_axis        SUBROUTINE LDM_SET_BEAM (VALSTR, IVAL, IERR, ERRSTR)
ROTAtion_axis    SUBROUTINE LDM_SET_ROT (VALSTR, IVAL, IERR, ERRSTR)
IMAGE_Type       SUBROUTINE LDM_SET_IMTYP (VALSTR, IVAL, IERR, ERRSTR)
IMAGE_Data       SUBROUTINE LDM_SET_IMDAT (VALSTR, IVAL, IERR, ERRSTR)
DGEOm            SUBROUTINE LDM_SET_DGEOM (VALSTR, IVAL, IERR, ERRSTR)
AXORd            SUBROUTINE LDM_SET_AXORD (VALSTR, IERR, ERRSTR)
FIDType          SUBROUTINE LDM_SET_FIDT (VALSTR, IVAL, IERR, ERRSTR)
FIDX1            SUBROUTINE LDM_SET_FIDX1 (VALUE, IERR, ERRSTR)
FIDY1            SUBROUTINE LDM_SET_FIDY1 (VALUE, IERR, ERRSTR)
FIDX2            SUBROUTINE LDM_SET_FIDX2 (VALUE, IERR, ERRSTR)
FIDY2            SUBROUTINE LDM_SET_FIDY2 (VALUE, IERR, ERRSTR)
FIDX3            SUBROUTINE LDM_SET_FIDX3 (VALUE, IERR, ERRSTR)
FIDY3            SUBROUTINE LDM_SET_FIDY3 (VALUE, IERR, ERRSTR)
NXRAst           SUBROUTINE LDM_SET_NXRAS (IVAL, IERR, ERRSTR)
NYRAst           SUBROUTINE LDM_SET_NYRAS (IVAL, IERR, ERRSTR)
RASTer_size      SUBROUTINE LDM_SET_RAST (VALUE, IERR, ERRSTR)
RMIN             SUBROUTINE LDM_SET_RMIN (VALUE, IERR, ERRSTR)
RMAX             SUBROUTINE LDM_SET_RMAX (VALUE, IERR, ERRSTR)
XLOW             SUBROUTINE LDM_SET_XLOW (VALUE, IERR, ERRSTR)
XHIGh            SUBROUTINE LDM_SET_XHIGH (VALUE, IERR, ERRSTR)
YLOW             SUBROUTINE LDM_SET_YLOW (VALUE, IERR, ERRSTR)
YHIGh            SUBROUTINE LDM_SET_YHIGH (VALUE, IERR, ERRSTR)
DISTortion_type  SUBROUTINE LDM_SET_DSTOR (VALSTR, IVAL, IERR, ERRSTR)
FTHResh          SUBROUTINE LDM_SET_FTHR (VALUE, IERR, ERRSTR)
FIDBox           SUBROUTINE LDM_SET_FBOX (VALUE, IERR, ERRSTR)
STHResh          SUBROUTINE LDM_SET_STHR (VALUE, IERR, ERRSTR)
OVERload_pixel   SUBROUTINE LDM_SET_OVPIX (IVAL, IERR, ERRSTR)
NUMPack          SUBROUTINE LDM_SET_NUMP (IVAL, IERR, ERRSTR)
NPLAtes          SUBROUTINE LDM_SET_NPLAT (IVAL, IERR, ERRSTR)
TEMPlate         SUBROUTINE LDM_SET_TEMPL (VALSTR, IERR, ERRSTR)
SPOT_Epsilon     SUBROUTINE LDM_SET_EPS (VALUE, IERR, ERRSTR)
DTILt            SUBROUTINE LDM_SET_DTILT (VALUE, IERR, ERRSTR)
N1OD             SUBROUTINE LDM_SET_N1OD (IVAL, IERR, ERRSTR)
G1OD             SUBROUTINE LDM_SET_G1OD (VALUE, IERR, ERRSTR)
BASEod           SUBROUTINE LDM_SET_BASE (VALUE, IERR, ERRSTR)
NONLinearity     SUBROUTINE LDM_SET_NONL (VALUE, IERR, ERRSTR)
DSPIn            SUBROUTINE LDM_SET_DSPIN (VALUE, IERR, ERRSTR)
SPINdle          SUBROUTINE LDM_SET_SPIN (IPACK, VALUE, IERR, ERRSTR)
PACK_id          SUBROUTINE LDM_SET_PID (IPACK, IVAL, IERR, ERRSTR)
KEYPlate         SUBROUTINE LDM_SET_KEYP (IPACK, IVAL, IERR, ERRSTR)
FILEname         SUBROUTINE LDM_SET_FNAME (IPACK, IPLATE, VALSTR, 
                +                          IERR, ERRSTR) 
X_CEN_f          SUBROUTINE LDM_SET_XCENF (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
Y_CEN_f          SUBROUTINE LDM_SET_YCENF (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPACing          SUBROUTINE LDM_SET_SPAC (IPACK, IPLATE, VALUE, 
                +                         IERR, ERRSTR)
A                SUBROUTINE LDM_SET_A (VALUE, IERR, ERRSTR)
B                SUBROUTINE LDM_SET_B (VALUE, IERR, ERRSTR)
C                SUBROUTINE LDM_SET_C (VALUE, IERR, ERRSTR)
ALPHA            SUBROUTINE LDM_SET_ALPHA (VALUE, IERR, ERRSTR)
BETA             SUBROUTINE LDM_SET_BETA (VALUE, IERR, ERRSTR)
GAMMA            SUBROUTINE LDM_SET_GAMMA (VALUE, IERR, ERRSTR)
LMIN             SUBROUTINE LDM_SET_LMIN (IPACK, VALUE, IERR, ERRSTR)
LMAX             SUBROUTINE LDM_SET_LMAX (IPACK, VALUE, IERR, ERRSTR)
DMIN             SUBROUTINE LDM_SET_DMIN (IPACK, VALUE, IERR, ERRSTR)
PHIX             SUBROUTINE LDM_SET_PHIX (IPACK, VALUE, IERR, ERRSTR)
PHIY             SUBROUTINE LDM_SET_PHIY (IPACK, VALUE, IERR, ERRSTR)
PHIZ             SUBROUTINE LDM_SET_PHIZ (IPACK, VALUE, IERR, ERRSTR)
CTOF             SUBROUTINE LDM_SET_CTOF (IPACK, IPLATE, VALUE, 
                +                         IERR, ERRSTR)
Y_SCale          SUBROUTINE LDM_SET_YSCAL (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPOT_Length      SUBROUTINE LDM_SET_SPOTL (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPOT_Width       SUBROUTINE LDM_SET_SPOTW (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPOT_Factor      SUBROUTINE LDM_SET_SPOTF (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPOT_Border      SUBROUTINE LDM_SET_SPOTB (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPOT_Delta       SUBROUTINE LDM_SET_SPOTD (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
X_C              SUBROUTINE LDM_SET_XC (IPACK, IPLATE, VALUE, 
                +                       IERR, ERRSTR)
Y_C              SUBROUTINE LDM_SET_YC (IPACK, IPLATE, VALUE, 
                +                       IERR, ERRSTR)
W_C              SUBROUTINE LDM_SET_WC (IPACK, IPLATE, VALUE, 
                +                       IERR, ERRSTR)
TWISt            SUBROUTINE LDM_SET_TWIST (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
TILT             SUBROUTINE LDM_SET_TILT (IPACK, IPLATE, VALUE, 
                +                         IERR, ERRSTR)
BULGe            SUBROUTINE LDM_SET_BULGE (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
ROFF             SUBROUTINE LDM_SET_ROFF (IPACK, IPLATE, VALUE, 
                +                         IERR, ERRSTR)
TOFF             SUBROUTINE LDM_SET_TOFF (IPACK, IPLATE, VALUE, 
                +                         IERR, ERRSTR)
SPDXY            SUBROUTINE LDM_SET_SPDXY (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPDX_N           SUBROUTINE LDM_SET_SPDXN (IPACK, IPLATE, IVAL, 
                +                          IERR, ERRSTR)
SPDX_MIn         SUBROUTINE LDM_SET_SXMIN (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPDX_MAx         SUBROUTINE LDM_SET_SXMAX (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPDX1, SPDX2...  SUBROUTINE LDM_SET_SPDX (ICOEFF, IPACK, IPLATE, 
                +                         SVAL, IERR, ERRSTR)
SPDY_N           SUBROUTINE LDM_SET_SPDYN (IPACK, IPLATE, IVAL, 
                +                          IERR, ERRSTR)
SPDY_MIn         SUBROUTINE LDM_SET_SYMIN (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPDY_MAx         SUBROUTINE LDM_SET_SYMAX (IPACK, IPLATE, VALUE, 
                +                          IERR, ERRSTR)
SPDY1, SPDY2...  SUBROUTINE LDM_SET_SPDY (ICOEFF, IPACK, IPLATE, 
                +                         SVAL, IERR, ERRSTR)
RFL              SUBROUTINE LDM_SET_RFL (IPACK, IPLATE, IVAL, 
                +                        IERR, ERRSTR)
.

2.4 GETTING LDM PARAMETER VALUES

2.4.1 Introduction

The data in the Laue data module must only be accessed via a set of supplied routines to make its use independent of the actual way the data values are stored internally. Each LDM parameter has its own routine which should be used where efficient access is required. There is also a general routine to retrieve a parameter value for a given LDM keyword string

The following routines are available:

General Routine to Get LDM Parameter Value - LDM_GET
Individual Routines to Get LDM Parameter Values - LDM_GET_...
Routine to Get All SPD... Parameter Values - LDM_SPDXY

2.4.2 General Routine to Get LDM Parameter Value - LDM_GET

This routine will return the value of any LDM parameter except for the 'SYMMETRY' parameter. The parameter value is returned as string, and where relevant as a real or integer value. The symmetry data may only be returned via the specific LDM_GET_SYMM routine. For AXORD only the string is returned and not IORD or ISWAP
 
Fortran call:
 
      SUBROUTINE LDM_GET (KEYWORD, IPACK, IPLATE, VALSTR, VALUE, ND,
     +                    IVAL, IFLAG, ITYP, IERR, ERRSTR)
 
Parameters:
 
 KEYWORD   c  (R)  Full keyword string (upper case)
                   Note: All LDM keywords valid excepy SYMMETRY.
                         The symmetry data may only be returned
                         via the specific LDM_GET_SYMM routine.

                         For AXORD only the string is returned and
                         not IORD or ISWAP
 IPACK     i  (R)  Pack number (explicit) if relevant for the parameter
 IPLATE    i  (R)  Plate number (explicit) if relevant for the parameter
 VALSTR    i  (W)  The value returned as a string (max 120 chars)
 VALUE     r  (W)  The parameter value as a real number for 'real number'
                   parameters.
 ND        i  (W)  The number of decimal places to be printed for 'real
                   number' parameters (-ve for E format)
 IVAL      i  (W)  The parameter value as an integer for integer parameters
 IFLAG     i  (W)  The status of the parameter value =-1 undefined
                                                     = 0 default
                                                     = 1 set explicitly
                                                     = 2 set globally
 ITYP      i  (W)  = 0 string value returned
                   = 1 string value and integer code
                   = 2 integer value (string also returned)
                   = 3 real value (string also returned)
                   = 4 LDM extended integer parameter
                   = 5 LDM extended float parameter
                   = 6 LDM extended single token string parameter
                   = 7 LDM extended multiple token string parameter
                   = 8 LDM extended variable array parameter
 IERR      i  (W)  Error flag =  0 OK
                              =  1 Invalid keyword
                              = -1 Invalid pack number
                              = -2 Invalid plate number
                              = -3 Invalid polynomial coefficient number
                              = -4 Any error from extended LDM keyword
 ERRSTR    c  (W)  Returns string for error message (max. 80 chars)

         Note: for an extended LDM parameter, only the first integer or
               real value will be returned for any parameter which has
               more than one value. Also the value string length of
               120 may not be adequate in all cases. Special purpose
               routines should be written to get values for such
               parameters (or use KDMF_GETVALUE calls directly)

2.4.3 Individual Routines to Get LDM Parameter Values - LDM_GET_...

These are the individual routines for getting LDM parameter values.
As there are a large number of routines involved and as these routines 
have very similar parameters, a general description of the parameters
is given here and only the list of parameters is given with each
individual subroutine.

 General description of parameters for 'get' routines:

 KEYWORD    c (R)  Full keyword string (upper case) without any
                   pack/plate specification.
 IPACK      i (R)  Pack number (explicit) if relevant for the parameter      
 IPLATE     i (R)  Plate number (explicit) if relevant for the parameter
 ICOEFF     i (R)  Coefficient no. if > 0, 0=all coefficients (for 
                   spatial distortion polynomial parameters only)
 VALSTR     c (W)  The value returned as a string (max 120 chars)
 VALUE      r (W)  The parameter value as a real number for 
                   'real number' parameters.
 ND         i (W)  The number of decimal places to be printed for 'real
                   number' parameters (-ve for E format). This may be
                   the default for the parameter or may be derived
                   from the value string used to set the parameter value
                   (see the LDM parameter value setting routines)
 IVAL       i (W)  The parameter value as an integer for integer 
                   parameters
 SVAL()     r (W)  Returns polynomial coefficients (for the spatial 
                   parameters only).
                   (if ICOEFF.GT.0 value is returned in SVAL(1))
                   (if ICOEFF.EQ.0 dimension to at least LDM_MAXSPD)
 IFLAG      i (W)  The status of the parameter value =-1 undefined
                                                     = 0 default
                                                     = 1 set explicitly 
                                                     = 2 set globally
 ITYP       i (W)  = 0 string value returned
                   = 1 string value and integer code
                   = 2 integer value (string also returned)
                   = 3 real value (string also returned)
 IERR       i (W)  Error flag =  0 OK
                              =  1 Invalid keyword
                              = -1 Invalid pack number
                              = -2 Invalid plate number
                              = -3 Invalid polynomial coefficient number
 ERRSTR     c (W)  Returns string for error message (max. 80 chars)

Routines:

CRYStal          SUBROUTINE LDM_GET_CRYST (VALSTR, IFLAG)
TITLe            SUBROUTINE LDM_GET_TITLE (VALSTR, IFLAG)
SYSTem           SUBROUTINE LDM_GET_SYST (VALSTR, IVAL, IFLAG)
LATTice          SUBROUTINE LDM_GET_LATT (VALSTR, IVAL, IFLAG)
SYMMetry         SUBROUTINE LDM_GET_SYMM (NSPG, SPGNAME, PGNAME, 
                +                         NSYMMP, NSYMM, RSM, RSMT, IFLAG)    
                 (see separate section on Symmetry Handling Routines)
BEAM_axis        SUBROUTINE LDM_GET_BEAM (VALSTR, IVAL, IFLAG)
ROTAtion_axis    SUBROUTINE LDM_GET_ROT (VALSTR, IVAL, IFLAG)
IMAGE_Type       SUBROUTINE LDM_GET_IMTYP (VALSTR, IVAL, IFLAG)
IMAGE_Data       SUBROUTINE LDM_GET_IMDAT (VALSTR, IVAL, IFLAG)
DGEOm            SUBROUTINE LDM_GET_DGEOM (VALSTR, IVAL, IFLAG)
AXORd            SUBROUTINE LDM_GET_AXORD (VALSTR, IORD, ISWAP, IFLAG)
FIDType          SUBROUTINE LDM_GET_FIDT (VALSTR, IVAL, IFLAG)
FIDX1            SUBROUTINE LDM_GET_FIDX1 (VALUE, IFLAG, ND)
FIDY1            SUBROUTINE LDM_GET_FIDY1 (VALUE, IFLAG, ND)
FIDX2            SUBROUTINE LDM_GET_FIDX2 (VALUE, IFLAG, ND)
FIDY2            SUBROUTINE LDM_GET_FIDY2 (VALUE, IFLAG, ND)
FIDX3            SUBROUTINE LDM_GET_FIDX3 (VALUE, IFLAG, ND)
FIDY3            SUBROUTINE LDM_GET_FIDY3 (VALUE, IFLAG, ND)
NXRAst           SUBROUTINE LDM_GET_NXRAS (IVAL, IFLAG)
NYRAst           SUBROUTINE LDM_GET_NYRAS (IVAL, IFLAG)
RASTer_size      SUBROUTINE LDM_GET_RAST (VALUE, IFLAG, ND)
RMIN             SUBROUTINE LDM_GET_RMIN (VALUE, IFLAG, ND)
RMAX             SUBROUTINE LDM_GET_RMAX (VALUE, IFLAG, ND)
XLOW             SUBROUTINE LDM_GET_XLOW (VALUE, IFLAG, ND)
XHIGh            SUBROUTINE LDM_GET_XHIGH (VALUE, IFLAG, ND)
YLOW             SUBROUTINE LDM_GET_YLOW (VALUE, IFLAG, ND)
YHIGh            SUBROUTINE LDM_GET_YHIGH (VALUE, IFLAG, ND)
DISTortion_type  SUBROUTINE LDM_GET_DSTOR (VALSTR, IVAL, IFLAG)
FTHResh          SUBROUTINE LDM_GET_FTHR (VALUE, IFLAG, ND)
FIDBox           SUBROUTINE LDM_GET_FBOX (VALUE, IFLAG, ND)
STHResh          SUBROUTINE LDM_GET_STHR (VALUE, IFLAG, ND)
OVERload_pixel   SUBROUTINE LDM_GET_OVPIX (IVAL, IFLAG)
NUMPack          SUBROUTINE LDM_GET_NUMP (IVAL, IFLAG)
NPLAtes          SUBROUTINE LDM_GET_NPLAT (IVAL, IFLAG)
TEMPlate         SUBROUTINE LDM_GET_TEMPL (VALSTR, IFLAG)
SPOT_Epsilon     SUBROUTINE LDM_GET_EPS (VALUE, IFLAG, ND)
DTILt            SUBROUTINE LDM_GET_DTILT (VALUE, IFLAG, ND)
N1OD             SUBROUTINE LDM_GET_N1OD (IVAL, IFLAG)
G1OD             SUBROUTINE LDM_GET_G1OD (VALUE, IFLAG, ND)
BASEod           SUBROUTINE LDM_GET_BASE (VALUE, IFLAG, ND)
NONLinearity     SUBROUTINE LDM_GET_NONL (VALUE, IFLAG, ND)
DSPIn            SUBROUTINE LDM_GET_DSPIN (VALUE, IFLAG, ND)
SPINdle          SUBROUTINE LDM_GET_SPIN (IPACK, VALUE, IFLAG, ND, 
                +                         IERR, ERRSTR)       
PACK_id          SUBROUTINE LDM_GET_PID (IPACK, IVAL, IFLAG, 
                +                        IERR, ERRSTR)
KEYPlate         SUBROUTINE LDM_GET_KEYP (IPACK, IVAL, IFLAG, 
                +                         IERR, ERRSTR)
FILEname         SUBROUTINE LDM_GET_FNAME (IPACK, IPLATE, VALSTR, IFLAG,    
                +                          IERR, ERRSTR)
X_CEN_f          SUBROUTINE LDM_GET_XCENF (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
Y_CEN_f          SUBROUTINE LDM_GET_YCENF (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPACing          SUBROUTINE LDM_GET_SPAC (IPACK, IPLATE, VALUE, IFLAG, 
                +                         ND, IERR, ERRSTR)
A                SUBROUTINE LDM_GET_A (VALUE, IFLAG, ND)
B                SUBROUTINE LDM_GET_B (VALUE, IFLAG, ND)
C                SUBROUTINE LDM_GET_C (VALUE, IFLAG, ND)
ALPHa            SUBROUTINE LDM_GET_ALPHA (VALUE, IFLAG, ND)
BETA             SUBROUTINE LDM_GET_BETA (VALUE, IFLAG, ND)
GAMMa            SUBROUTINE LDM_GET_GAMMA (VALUE, IFLAG, ND)
LMIN             SUBROUTINE LDM_GET_LMIN (IPACK, VALUE, IFLAG, ND, 
                +                         IERR, ERRSTR)
LMAX             SUBROUTINE LDM_GET_LMAX (IPACK, VALUE, IFLAG, ND, 
                +                         IERR, ERRSTR)
DMIN             SUBROUTINE LDM_GET_DMIN (IPACK, VALUE, IFLAG, ND, 
                +                         IERR, ERRSTR)
PHIX             SUBROUTINE LDM_GET_PHIX (IPACK, VALUE, IFLAG, ND, 
                +                         IERR, ERRSTR)
PHIY             SUBROUTINE LDM_GET_PHIY (IPACK, VALUE, IFLAG, ND, 
                +                         IERR, ERRSTR)
PHIZ             SUBROUTINE LDM_GET_PHIZ (IPACK, VALUE, IFLAG, ND, 
                +                         IERR, ERRSTR)
CTOF             SUBROUTINE LDM_GET_CTOF (IPACK, IPLATE, VALUE, IFLAG, 
                +ND, IERR, ERRSTR)
Y_SCale          SUBROUTINE LDM_GET_YSCAL (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPOT_Length      SUBROUTINE LDM_GET_SPOTL (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPOT_Width       SUBROUTINE LDM_GET_SPOTW (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPOT_Factor      SUBROUTINE LDM_GET_SPOTF (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPOT_Border      SUBROUTINE LDM_GET_SPOTB (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPOT_Delta       SUBROUTINE LDM_GET_SPOTD (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
X_C              SUBROUTINE LDM_GET_XC (IPACK, IPLATE, VALUE, IFLAG, 
                +                       ND, IERR, ERRSTR)
Y_C              SUBROUTINE LDM_GET_YC (IPACK, IPLATE, VALUE, IFLAG, 
                +                       ND, IERR, ERRSTR)
W_C              SUBROUTINE LDM_GET_WC (IPACK, IPLATE, VALUE, IFLAG, 
                +                       ND, IERR, ERRSTR)
TWISt            SUBROUTINE LDM_GET_TWIST (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
TILT             SUBROUTINE LDM_GET_TILT (IPACK, IPLATE, VALUE, IFLAG, 
                +                         ND, IERR, ERRSTR)
BULGe            SUBROUTINE LDM_GET_BULGE (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
ROFF             SUBROUTINE LDM_GET_ROFF (IPACK, IPLATE, VALUE, IFLAG, 
                +                         ND, IERR, ERRSTR)
TOFF             SUBROUTINE LDM_GET_TOFF (IPACK, IPLATE, VALUE, IFLAG, 
                +                         ND, IERR, ERRSTR)
SPDXY            SUBROUTINE LDM_GET_SPDXY (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPDX_N           SUBROUTINE LDM_GET_SPDXN (IPACK, IPLATE, IVAL, IFLAG, 
                +                          IERR, ERRSTR)
SPDX_MIn         SUBROUTINE LDM_GET_SXMIN (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPDX_MAx         SUBROUTINE LDM_GET_SXMAX (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPDX1, SPDX2...  SUBROUTINE LDM_GET_SPDX (ICOEFF, IPACK, IPLATE, SVAL, 
                +                         IFLAG, ND, IERR, ERRSTR)
SPDY_N           SUBROUTINE LDM_GET_SPDYN (IPACK, IPLATE, IVAL, IFLAG, 
                +                          IERR, ERRSTR)
SPDY_MIn         SUBROUTINE LDM_GET_SYMIN (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPDY_MAx         SUBROUTINE LDM_GET_SYMAX (IPACK, IPLATE, VALUE, IFLAG, 
                +                          ND, IERR, ERRSTR)
SPDY1, SPDY2...  SUBROUTINE LDM_GET_SPDY (ICOEFF, IPACK, IPLATE, SVAL, 
                +                         IFLAG, ND, IERR, ERRSTR)
RFL              SUBROUTINE LDM_GET_RFL (IPACK, IPLATE, IVAL, IFLAG, 
                +                        IERR, ERRSTR)
.

2.4.4 Routine to Get All SPD... Parameter Values - LDM_SPDXY

This routine enables all the parameters related to using a polynomial based spatial distortion to be retrieved in one call and should be used where several such parameter values are required and where efficiency of retrieval is important.
 
Fortran call:
 
      SUBROUTINE LDM_SPDXY (IPACK, IPLATE, SPD_XY, 
     +                      NSPDX, SPDX_MIN, SPDX_MAX, SXVAL,
     +                      NSPDY, SPDY_MIN, SPDY_MAX, SYVAL,
     +                      MAXDIM, IERR, ERRSTR)
 
Parameters:
 
 IPACK      i (R)   Pack number (explicit)
 IPLATE     i (R)   Plate number (explicit)
 SPD_XY     r (W)   Returns spdxy correction factor
 NSPDX      i (W)   Returns polynomial order SPDX_N
 SPDX_MIN   r (W)   Returns lower x chebyshev polynomial bound
 SPDX_MAX   r (W)   Returns upper x chebyshev polynomial bound
 SXVAL()    r (W)   Returns polynomial coefficients for x (see MAXDIM)
 NSPDY      i (W)   Returns polynomial order SPDY_N
 SPDY_MIN   r (W)   Returns lower y chebyshev polynomial bound
 SPDY_MAX   r (W)   Returns upper y chebyshev polynomial bound
 SYVAL()    r (W)   Returns polynomial coefficients for y (see MAXDIM)
 MAXDIM     i (R)   Maximum dimension of SXVAL, SYVAL arrays (Note: only
                    MAXDIM coefficients will be returned if this is less
                    than the LDM limit which may be found using the
                    LDM_SPDMAX function.
 IERR       i (W)   Error flag = 0 OK
                               =-1 Invalid pack number
                               =-2 Invalid plate number
 ERRSTR     c (W)   Error string if error found

2.5 SYMMETRY HANDLING ROUTINES

2.5.1 Introduction

A special set of routines are required to retrieve symmetry information as the symmetry parameter data is more complex than for the other LDM parameters. Routines are also available to determine systematic absences, list symmetry operators and to set up the information to enable reflections to be assigned to a standard assymetric unit using CCP4 routines.

The following routines are available:

Get Full Symmetry Data - LDM_GET_SYMM
Get Basic Space Group Details - LDM_GET_SPGRP
Get Number of Symmetry Operators - LDM_GET_NSYM
Check for Systematic Absence - LDM_SYSABS
Get Systematic Absence Based on H, K - LDM_SYSAHK
List Symmetry Data - LDM_SYMM_LIST
Prepare to Convert Indices to Assymetric Unit - LDM_AUSET
Write symmetry to MTZ file - LDM_LWSYMM
Write symmetry to LIRL - LDM_LIRLSYMM

2.5.2 Get Full Symmetry Data - LDM_GET_SYMM

This routine is used to get the full symmetry detail including such items as the space group, point group and symmetry operator matrices.
 
Fortran call:
 
      SUBROUTINE LDM_GET_SYMM (NSPG, SPGNAME, PGNAME, NSYMMP, NSYMM,
     +                         RSM, RSMT, IFLAG)
 
Parameters:
 
 NSPG     i (W)   Space group number (will be 0 if symmetry operators 
                  were input explicitly.
 SPGNAME  c (W)   Space group name (will be blank if symmetry operators 
                  were input explicitly) (10 characters)
 PGNAME   c (W)   Point group name (10 characters)
 NSYMMP   i (W)   No. of primitive symmetry operators
 NSYMM    i (W)   Total number of symmetry operators (0 if symmetry not
                  defined)
 RSM()    r (W)   The NSYMM symmetry operators -  dimensioned (4,4,192)
 RSMT()   r (W)   The NSYMM inverted symmetry operators -dimensioned 
                  (4,4,192)
 IFLAG    i (W)   Flag = -1 undefined value
                       =  0 default value
                       =  1 value set explicitly
                       =  2 value set globally

2.5.3 Get Basic Space Group Details - LDM_GET_SPGRP

This routine rentuns where possible the space group number and name and the number of primitive and totla number of symmetry operators.
 
Fortran call:
 
      SUBROUTINE LDM_GET_SPGRP (NSPG, SPGNAME, NSYMMP, NSYMM)
 
Parameters:
 
 NSPG     i (W)   Space group number (will be 0 if symmetry operators were
                  input explicitly.
 SPGNAME  c  (W)  Space group name (will be blank if symmetry operators 
                  were input explicitly) (10 characters)
 NSYMMP   i (W)   No. of primitive symmetry operators
 NSYMM    i (W)   Total number of symmetry operators (0 if symmetry not
                  defined)

2.5.4 Get Number of Symmetry Operators - LDM_GET_NSYM

This routine returns the number of symmetry operators or 0 if no symmetry has been defined. This provides the simplest way of determining whether the symmetry has been defined.
 
Fortran call:
 
      SUBROUTINE LDM_GET_NSYM (NSYMM, IFLAG)
 
Parameters:
 
 NSYMM    i (W)   Total number of symmetry operators (0 if symmetry not
                  defined)
 IFLAG    i (W)   Flag = -1 undefined value
                       =  0 default value
                       =  1 value set explicitly
                       =  2 value set globally

2.5.5 Check for Systematic Absence - LDM_SYSABS

This routine checks whether a given reflection is a systematic absence based on the symmetry information available. Its initial checks are based on the lattice type but it will then use the full symmetry information if this has been defined.
 
Fortran call:
 
        SUBROUTINE LDM_SYSABS (IH,IK,IL,ABSNT)
 
Parameters:
 
IH      i (R)     h index 
IK      i (R)     k index
IL      i (R)     l index
ABSNT   l (W)     returns =.TRUE. systematically absent, =.FALSE. not

2.5.6 Get Systematic Absence Based on H, K - LDM_SYSAHK

This is a variant on LDM_SYSABS and checks to see if a given 'h', 'k' reflection is absence regardless of 'l'. It only uses the lattice type and not the full symmetry.
 
Fortran call:
 
        SUBROUTINE LDM_SYSAHK (IH,IK,ABSNT)
 
Parameters:
 
IH       i (R)     h index 
IK       i (R)     k index
ABSNT    l (W)     returns =.TRUE. systematically absent, =.FALSE. not

2.5.7 List Symmetry Data - LDM_SYMM_LIST

This routine lists the symmetry operators to a file or a terminal.
 
Fortran call:
 
      SUBROUTINE LDM_SYMM_LIST (IUN, TERM)
 
Parameters:
 
 IUN   i (R)   Unit no. for listing o/p
 TERM  l (R)   .TRUE. o/p is to a terminal; .FALSE. o/p is to a file

2.5.8 Prepare to Convert Indices to Assymetric Unit - LDM_AUSET

This routine calls the CCP4 routine ASUSET to prepare for converting indices to the asyymetric unit etc. using ASUPUT, ASUGET. The ASUSET routine is called via the LDM routine because it can access data stored internally within the Laue Data Module and avoid having to duplicate such data unnecessarily.
 
Fortran call:
 
      SUBROUTINE LDM_ASUSET (MLAUE)
 
Parameters:
 
MLAUE   i (W)   Returns the Laue group number

2.5.9 Write symmetry to MTZ file - LDM_LWSYMM

This routine calls the MTZ library routine LWSYMM to write the symmetry data (if defined) to the header of an MTZ file. The LWSYMM routine is called via the LDM routine because it can access data stored internally within the Laue Data Module and avoid having to duplicate such data unnecessarily.
 
Fortran call:
 
      SUBROUTINE LDM_LWSYMM (MTZIDX)
 
Parameters:
 
MTZIDX   i (R)   MTZ file index

2.5.10 Write symmetry to LIRL - LDM_LIRLSYMM

This routine calls the Laue Integrated Reflection List (LIRL) routine LIRLF_SETSYM to set the symmetry for the list. The LIRLF_SETSYM routine is called via the LDM routine because it can access data stored internally within the Laue Data Module and avoid having to duplicate such data unnecessarily.
 
Fortran call:
 
      SUBROUTINE LDM_LIRLSYMM (MINDX)
 
Parameters:
 
MINDX   i (R)   Index for the LIRL

2.6 CONVENIENCE AND SUPPLEMENTARY LDM ROUTINES

2.6.1 Introduction

This section includes a number of useful routines for decoding axis order strings, getting mm to raster conversion factors, determining an image file name (using template or explicit definition as appropriate). Routines are also listed in this section for returning the spatial distortion polynomial coefficient limit and for converting strings to integer or real numbers.

The following routines are available:

Interpret Axis Order String - LDM_AXORD
Millimetre to Raster Conversion Factors - LDM_MMRAST
Get Image File Name From Definition or Template - LDM_FILENAME
Find LDM Limit SPD Polynomial Coefficients - LDM_SPDMAX
Find LDM Number of Packs - LDM_PKMAX
Find LDM Number of Plates per Pack - LDM_PLMAX
Decode Character String into a Number - LDM_INTFP

2.6.2 Interpret Axis Order String - LDM_AXORD

This routine decodes an axis order string as described in the parameter list.
 
Fortran call:
 
      SUBROUTINE LDM_AXORD (VALSTR, IORD, ISWAP, IERR, ERRSTR)
 
Parameters:
 
VALSTR   c (R)   The string containing the axis order code string to
                 be interpreted.

                 The string defines the axis order in terms of x and y 
                 (the detector xd, yd axes). The slower moving axis is
                 given first followed by the faster moving axis. Minus 
                 signs are used when the order of an axis is reversed. 
                 The code 's' if present indicates that byte swapping is 
                 to be done and the code 'n' indicates that no byte 
                 swapping is to be done (byte swapping only relevant for 
                 image plate data). Characters, other than 'x', 'y', 
                 '-', '+', 's' and 'n', or their upper case equivalents, 
                 are ignored. 
                 Some examples follow and the returned flags are indicated:

                 xy                     IORD = 1, ISWAP = 0
                 +x+y                   IORD = 1, ISWAP = 0
                 -xy                    IORD = 3, ISWAP = 0
                 x-y s                  IORD = 2, ISWAP = 2
                 -Y, +X, n              IORD = 7, ISWAP = 1
                 S                      IORD = 0, ISWAP = 2
                 +yd, +xd               IORD = 4, ISWAP = 0

                 Invalid strings: +x-x      (Same axis defined twice)
                                  +x+y-x    (More than two axes defined)
                                  xysn      (Byte swapping and no byte 
                                             swapping both defined)

IORD     i (W)   Returns the axis order as a number from 1 - 8
                 0 if none specified (or syntax error)
                 1   +xd slow   +yd fast
                 2   +xd slow   -yd fast
                 3   -xd slow   +yd fast
                 4   -xd slow   -yd fast
                 5   +yd slow   +xd fast
                 6   +yd slow   -xd fast
                 7   -yd slow   +xd fast
                 8   -yd slow   -xd fast
ISWAP    i (W)   Returns byte swap type   =1 do not swap bytes
                                          =2 swap bytes
                                          =0 not specified (or syntax
                                             error)
IERR     i (W)   Error flag 0 = OK
                            1 = Only one axis defined
                            2 = Both axes the same
                            3 = More than two axes defined
                            4 = byte swap and no byte swap both given
ERRSTR   c (W)   Error message string (up to 80 chars)

2.6.3 Millimetre to Raster Conversion Factors - LDM_MMRAST

This routine returns the conversion factors from millimetres to rastors for the requested pack and plate number.
 
Fortran call:
 
      SUBROUTINE LDM_MMRAST (IPACK, IPLATE, MM_RAST_X, MM_RAST_Y)
 
Parameters:
 
IPACK      i (R)   Pack number
IPLATE     i (R)   Plate number
MM_RAST_X  r (W)   Conversion factor for mm to x-rasters
MM_RAST_Y  r (W)   Conversion factor for mm to y-rasters

2.6.4 Get Image File Name From Definition or Template - LDM_FILENAME

This routine returns the image file name for a given pack and plate. If an explicit name has been defined for the file name then this will be returned. Otherwise the name will be created from the file name template using the pack id and plate number. Full details are given in the parameter descriptions for the routine.
 
Fortran call:
 
      SUBROUTINE LDM_FILENAME (IPACK, IPLATE, FILNAM)
 
Parameters:
 
IPACK      i (R)   Pack number
IPLATE     i (R)   Plate number
FILNAM     c (W)   Returns file name
                   If explicit one present then this is returned. If not
                   then one is derived from the template which normally
                   contains a sequence of '#' characters; these are
                   replaced with the pack_id (+plate identifier) with at 
                   least as many characters use as '#' characters in the 
                   sequence. 

                   The pack_id is output as an integer with leading zeros
                   if needed; If the number of plates in the pack is 
                   greater than one then the pack_id will be followed by 
                   the plate letter 1=a, 2=b etc.

                   Examples:

                       1) Template lys####.i2 pack_id=15 1 plate
                          file name returned = lys0015.od

                       2) Template pf####.od pack_id=12 no. 1 of 6 plates
                          file name returned = pf012a.od
                    
                       3) As above but for 2'nd plate 
                          file name returned = pf012b.od
                  
                       3) Template pf#.od pack_id=12 no. 1 of 6 plates
                          file name returned = pf12a.od

                   For non-standard cases, the treatments are as follows:

                   If no '#' is present in the template, the pack_id 
                   (+ plate identifier) will be added just before the 
                   '.' of file extension; if there is no file extension 
                   the pack_id (+ plate identifier) will be added at the 
                   of the template string.

                   If there are more than 26 plates in the pack the plate
                   identifier will be added as an underscore followed by 
                   the plate number

2.6.5 Find LDM Limit SPD Polynomial Coefficients - LDM_SPDMAX

This function returns the currently compiled in limit for the maximum coefficient for polynomial based spatial distortion corrections. Programs which use a LDM routines to retrieve all coefficients in an array will need to be aware of this limit and take appropriate steps if it is not consistent with the dimensions of the program's own arrays.
 
Fortran call:
 
      INTEGER FUNCTION LDM_SPDMAX(IDUM)
    Return:  Maximum allowed order for SPDXi, SPDYi terms.
CD-end
Arguments:

      INTEGER IDUM

D-Parameters:
IDUM   (R)  Dummy argument

2.6.6 Find LDM Number of Packs - LDM_PKMAX

This function returns the currently compiled in limit for the maximum number of packs.
 
Fortran call:
 
      INTEGER FUNCTION LDM_PKMAX(IDUM)
    Return:  Maximum allowed number of packs.
CD-end
Arguments:

      INTEGER IDUM

D-Parameters:
IDUM   (R)  Dummy argument

2.6.7 Find LDM Number of Plates per Pack - LDM_PLMAX

This function returns the currently compiled in limit for the maximum number of plater per pack.
 
Fortran call:
 
      INTEGER FUNCTION LDM_PLMAX(IDUM)
    Return:  Maximum allowed number of plates per pack.
CD-end
Arguments:

      INTEGER IDUM

D-Parameters:
IDUM   (R)  Dummy argument

2.6.8 Decode Character String into a Number - LDM_INTFP

This routine will decode a character string into an integer or floating point number. Fixed point or scientific notation numbers are both valid.
 
Fortran call:
 
       FUNCTION LDM_INTFP (CHSTR, FP, IV, ND) 
     Return:     = 0  Syntax error in the number
                 = 1  integer  (no decimal point present)
                 = 2  floating point no.
                 =-1  blank string

 
Parameters:
 
CHSTR   c (R)     Character string containing the number to be decoded
                  (Leading spaces ignored; further space terminates
                  the number string interpreted)
FP      r (W)     Returns the value as a floating point value (0.0 if
                  syntax error)
IV      i (W)     Returns the value as an integer (the nearest integer
                  if value contained a decimal point) (0 if syntax error)
ND      i (W)     No. of digits after the decimal point. (-ve if E format
                  number)

2.7 MONITOR LDM PARAMETER VALUE CHANGES

2.7.1 Introduction

Routines are available to enable the monitoring of changes to LDM parameter values. A routine is available to set a flag on one of 16 independent channels and the Laue Data Module will keep track of any LDM parameter value changes since that flag was set. The changed parameter values may be written out using an option of the LDM_WRITE routine. A routine is also provided to check whether there have been any changes on a given channel.

The following routines are available:

Reset Parameter Change Monitoring Flags - LDM_CH_RESET
Check for Parameter Value Changes - LDM_ANY_CH

2.7.2 Reset Parameter Change Monitoring Flags - LDM_CH_RESET

This routine resets the flag for monitoring subsequent LDM parameter value changes for the requested channel or for all channels.
 
Fortran call:
 
      SUBROUTINE LDM_CH_RESET (ICH)
 
Parameters:
 
ICH   i (R)  Initialise/clear parameter changed flags for this channel 
             (1-16, 0 = all channels)

2.7.3 Check for Parameter Value Changes - LDM_ANY_CH

This routine enables a check to be made on whether and LDM parameter values have been changed since the changes monitoring flag was set for a particular channel.
 
Fortran call:
 
      LOGICAL FUNCTION LDM_ANY_CH (ICH)
 
Parameters:
 
ICH   i (R)  Examine flags for this channel (1-16, 0 = all channels)

Return:  .TRUE. if any changes found, otherwise .FALSE.

2.8 MAKE DISTORTION CORRECTIONS TO COORDINATES

2.8.1 Introduction

A routine is avaiable to make the appropriate distortion corrections to an ideal predicted spot position. The routine takes account of the current distortion type and the various distortion parameters.

The following routines are available:

Make Distortion Corrections to Ideal Coordinates - LDM_CORR

2.8.2 Make Distortion Corrections to Ideal Coordinates - LDM_CORR

This routine will make the appropriate distortion corrections to an ideal predicted spot position. The routine takes account of the current distortion type and the various distortion parameters. cos(w_c) and sin(w_c) are passed as parameters to the routine so that, in suitable circumstances, they need not be re-calculated each time that LDM_CORR is called.
 
Fortran call:
 
      SUBROUTINE LDM_CORR (IPACK, IPLATE, COS_WC, SIN_WC, CF, XF, YF, 
     +                     XFD, YFD)
 
Parameters:
 
IPACK     i (R)   Pack number 
IPLATE    i (R)   Plate number
COS_WC    r (R)   cos(w_c) for the pack and plate
SIN_WC    r (R)   sin(w_c) for the pack and plate
CF        r (R)   crystal-film distance for the pack and plate
XF        r (R)   Predicted reflection 'xf' coordinate in mm with 
                  respect to the predicted pattern centre.
YF        r (R)   Predicted reflection 'yf' coordinate in mm with 
                  respect to the predicted pattern centre.
XFD       r (W)   Distortion corrected 'xfd' parameter in mm with 
                  respect to the predicted centre. The coordinate is 
                  now along the direction of the actual image 'xd' axis
YFD       r (W)   Distortion corrected 'yfd' parameter in mm with 
                  respect to the predicted centre. The coordinate is 
                  now along the direction of the actual image 'yd' axis

2.9 SAVE AND RESTORE REFINEABLE PARAMETER VALUES

2.9.1 Introduction

These routines enable the refineable LDM parameter values to be saved for a given pack and plate before a refinement is carried out and restore, if required, if the refined values are not deemen to be acceptable. The routines are included as LDM routines as they need to access internal flags within the LDM.

The following routines are available:

Save Refineable Parameters - LDM_SAVERP
Restore Saved Refineable Parameters - LDM_RESTRP

2.9.2 Save Refineable Parameters - LDM_SAVERP

This routine will save the values of the refineable parameters for a requested pack and plate.
 
Fortran call:
 
      SUBROUTINE LDM_SAVERP (IPACK, IPLATE)
 
Parameters:
 
IPACK   i (R)  Pack number (explicit)
IPLATE  i (R)  Plate number (explicit)

2.9.3 Restore Saved Refineable Parameters - LDM_RESTRP

Restore the refineable LDM parameters saved by the last call to LDM_SAVERP.
 
Fortran call:
 
      SUBROUTINE LDM_RESTRP (IPACK, IPLATE)
 
Parameters:
 
IPACK  i  (R)  Pack number
IPLATE i  (R)  Plate number

2.10 SPECIAL ROUTINES FOR USE WITH LAUE REFLECTION LISTS

2.10.1 Introduction

These routines enable flags to be set when Laue Reflection List (LRL) routine have been used to predict a set of spots. The LDM module keeps track of whether any of the parameters required for the prediction have been changed since the list was predicted and a routine is available to query such changes. This can be used to save regenerating lists when they are not required and checking when they need to be regenerated. These routines are used for example by the LRL_GEN routine and if this is used to generate spot lists then the routines described in this section will not normally need to be called explicitly from an application program.

The following routines are available:

Set LRL Generation Flags - LDM_LRL_CALC
See if LRL Needs to be Regenerated - LDM_CHK_GEN

2.10.2 Set LRL Generation Flags - LDM_LRL_CALC

This routine is used to inform the Laue Data Module that a stage of the generation of a Laue Reflection List (LRL) for a given pack and plate has been completed. There are three stages identified in the generation of the LRL.
 
Fortran call:
 
      SUBROUTINE LDM_LRL_CALC (IPACK, IPLATE, ISTAGE)
 
Parameters:
 
IPACK   i (R)   Pack number of LRL generation
IPLATE  i (R)   Plate number of LRL generation
ISTAGE  i (R)   Stage = 1, matrix calculation
                      = 2, LRL generation
                      = 3, overlaps calculation

2.10.3 See if LRL Needs to be Regenerated - LDM_CHK_GEN

This routine determines which of the three calculation stages need to be carried out to obtain a valid Laue Reflection List (LRL) for the required pack and plate.
 
Fortran call:
 
      SUBROUTINE LDM_CHK_GEN (IPACK, IPLATE, MTX, GEN, OVL)
 
Parameters:
 
IPACK    i (R)   Pack number for which LRL is to be generated
IPLATE   i (R)   Plate number for whic LRL is to be generated
MTX      l (W)   =.TRUE. need to recalculate matrices, =.FALSE. do not
GEN      l (W)   =.TRUE. need to regenerate LRL, =.FALSE. do not
OVL      l (W)   =.TRUE. need to recalculate overlaps, =.FALSE. do not

2.11 SPECIAL RECIPROCAL LATTICE TO DETECTOR CONVERSIONS

2.11.1 Introduction

Some routines are available for converting between reciprocal lattice and detector coordinates. Where appropriate, these routines should be used as they would be modified to cope with any new requirements for a detector arrangement. The currently cope with a normal or tilted detector.

The following routines are available:

Convert Reciprocal Lattice to Detector Coordinates - LDM_RTOD
Double Precision Version of LDM_RTOD - LDM_RTOD_DP
Convert Detector to Reciprocal Lattice Coordinates - LDM_DTOR
Convert Detector to 'Q' Axis Coordinates - LDM_DTOQAX

2.11.2 Convert Reciprocal Lattice to Detector Coordinates - LDM_RTOD

This routine will convert from reciprocal lattice to ideal detector xf, yf coordinates. It also returns a flag to indicate whether the reflection would be recorded on the detector at all assuming that it is sufficiently large.
 
Fortran call:
 
      LOGICAL FUNCTION LDM_RTOD (X, Y, Z, DSTAR2, CTF, XF, YF)
 
Parameters:
 
 X        r (R)    Reciprocal lattice X coordinate (Wonacott convention)
 Y        r (R)    Reciprocal lattice Y coordinate (Wonacott convention)
 Z        r (R)    Reciprocal lattice Z coordinate (Wonacott convention)
 DSTAR2   r (R)    (d*)**2 for the reflection
 CTF      r (R)    Crystal to film distance (mm)
 XF       r (W)    Detector xf coordinate (mm) (Wonacott convention)
 YF       r (W)    Detector yf coordinate (mm) (Wonacott convention)

Return:  Returns .TRUE. if reflection would be recorded on the detector
         (if sufficiently large) or .FALSE. if it would not. Check to
         avoid divide overflow incorporated.

Note: For untilted detector xf || Y, yf || Z

2.11.3 Double Precision Version of LDM_RTOD - LDM_RTOD_DP

This is a double precision version of LDM_RTOD
 
Fortran call:
 
      LOGICAL FUNCTION LDM_RTOD_DP (X, Y, Z, DSTAR2, CTF, XF, YF)
 
Parameters:
 
 X       dp (R)   Reciprocal lattice X coordinate (Wonacott convention)
 Y       dp (R)   Reciprocal lattice Y coordinate (Wonacott convention)
 Z       dp (R)   Reciprocal lattice Z coordinate (Wonacott convention)
 DSTAR2  dp (R)   (d*)**2 for the reflection
 CTF     dp (R)   Crystal to film distance (mm)
 XF      dp (W)   Detector xf coordinate (mm) (Wonacott convention)
 YF      dp (W)   Detector yf coordinate (mm) (Wonacott convention)

Return:  Returns .TRUE. if reflection would be recorded on the detector
         (if sufficiently large) or .FALSE. if it would not. Check to
         avoid divide overflow incorporated.

Note: For untilted detector xf || Y, yf || Z

2.11.4 Convert Detector to Reciprocal Lattice Coordinates - LDM_DTOR

This routine converts ideal detector coordinates to reciprocal lattice coordinates.
 
Fortran call:
 
      SUBROUTINE LDM_DTOR (XF, YF, DSTAR2, CTF, X, Y, Z)
 
Parameters:
 
 XF      r (R)    Detector xf coordinate (mm) (Wonacott convention)
 YF      r (R)    Detector yf coordinate (mm) (Wonacott convention)
 DSTAR2  r (R)    (d*)**2 for the reflection
 CTF     r (R)    Crystal to detector distance (mm)
 X       r (W)    Reciprocal lattice X coordinate (Wonacott convention)
 Y       r (W)    Reciprocal lattice Y coordinate (Wonacott convention)
 Z       r (W)    Reciprocal lattice Z coordinate (Wonacott convention)

Note: For untilted detector xf || Y, yf || Z

2.11.5 Convert Detector to 'Q' Axis Coordinates - LDM_DTOQAX

This routine converts idela detector axes to coordinates with respect to a 'q' set of axes as defined in the parameter description of the routine.
 
Fortran call:
 
      SUBROUTINE LDM_DTOQAX (XF, YF, CTF, XQ, YQ, ZQ)
 
Parameters:
 
 XF      r (R)    Detector xf coordinate (mm) (Wonacott convention)
 YF      r (R)    Detector yf coordinate (mm) (Wonacott convention)
 CTF     r (R)    Crystal to detector distance (mm)
 XQ      r (W)    Reciprocal lattice X coordinate wrt 'q' axes
 YQ      r (W)    Reciprocal lattice Y coordinate wrt 'q' axes
 ZQ      r (W)    Reciprocal lattice Z coordinate wrt 'q' axes

 'q' axes are as follows:

     Origin at crystal
     XQ along Wonacott Y
     YQ along Wonacott Z
     ZQ along Wonacott X (X-ray beam)

     For untilted flat detector: XQ=XF, YQ=YF, ZQ=CTF

2.12 HANDLE EXTENDED LDM DATA

2.12.1 Introduction

Routines are available to enable the handling of LDM data with an extended set of parameters. These are managed via the 'C' based 'KDM' (Keyword Data Module) routines. LDM routines are available to add new keyword parameters of various types. The KDMF_DEFINE_... routines may also be used to define parameters of some other types and the index to the keyword set required in such calls may be obtained by calling the LDM_KDX function. If such additional parameters are defined then they will be automatically handled by routines such as LDM_PARSE, LDM_WRITE, LDM_SET, LDM_RESET, LDM_CH_RESET, LDM_ANY_CH. In most cases LDM_GET may also be used though it will not fully handle integer, real or variable array parameter value keywords with more than one integer/real value. Also the returned string for such parameters could exceed the standard 120 characters maximum. For such cases the KDMF_GETVALUE routine may be called directly to enable the full data to be returned.

The following routines are available:

Define a New Integer Parameter - LDM_NEWINT
Define a New Floating Point Parameter - LDM_NEWFLP
Define a New String Parameter - LDM_NEWSTR
Get Index to KDM Keyword Set - LDM_KDX

2.12.2 Define a New Integer Parameter - LDM_NEWINT

This routine is used create a new integer LDM parameter to form part of an extended LDM parameter set.
 
Fortran call:
 
      SUBROUTINE LDM_NEWINT (KEYWORD, MINL, ITYP, ISTD, I_DEFLT, 
     +                       I_MIN, I_MAX, ICHK, IERR)
 
Parameters:
 
KEYWORD   (R) Parameter name (full) character string  
MINL      (R) Minimum length for keyword match
ITYP      (R) Parameter type 1=dataset, 2=pack, 3=plate specific 
ISTD      (R) Standard parameter for output  = 1 yes, =0 no
I_DEFLT   (R) Default parameter value  
I_MIN     (R) Minimum allowed value (if ICHK==5) 
I_MAX     (R) Maximum allowed value (if ICHK==5) 
ICHK      (R) Check value option =0 any integer OK,
                                 =1 any >=0
                                 =2 any >0
                                 =3 any <=0
                                 =4 any <0
                                 =5 must be in range I_MIN to I_MAX
IERR      (W) Error return = 0 OK
                           = 1 Parameter error
                           =-1 Cannot allocate memory

2.12.3 Define a New Floating Point Parameter - LDM_NEWFLP

This routine is used create a new floating point (real) LDM parameter to form part of an extended LDM parameter set.
 
Fortran call:
 
      SUBROUTINE LDM_NEWFLP (KEYWORD, MINL, ITYP, ISTD, F_DEFLT, 
     +                       F_MIN, F_MAX, ICHK, ND, ND_DFLT, IERR)
 
Parameters:
 
KEYWORD   (R) Parameter name (full) character string  
MINL      (R) Minimum length for keyword match
ITYP      (R) Parameter type 1=dataset, 2=pack, 3=plate specific 
ISTD      (R) Standard parameter for output  = 1 yes, =0 no
F_DEFLT   (R) Default parameter value  
F_MIN     (R) Minimum allowed value (if ICHK==5) 
F_MAX     (R) Maximum allowed value (if ICHK==5) 
ICHK      (R) Check value option =0 any integer OK,
                                 =1 any >=0.0
                                 =2 any >0.0
                                 =3 any <=0.0
                                 =4 any <0.0
                                 =5 must be in range F_MIN to F_MAX
ND        (R) No. of decimal places for printing value when it was
              recalculated by a program
ND_DFLT   (R) No. of decimal places for printing the default value 
IERR      (W) Error return = 0 OK
                           = 1 Parameter error
                           =-1 Cannot allocate memory

2.12.4 Define a New String Parameter - LDM_NEWSTR

This routine is used create a new string LDM parameter to form part of an extended LDM parameter set.
 
Fortran call:
 
      SUBROUTINE LDM_NEWSTR (KEYWORD, MINL, ITYP, ISTD, MAXLEN, 
     +                       S_DFLT, STRINGS, NUMS, LENS, ICHK, 
     +                       MATCH, IERR)
 
Parameters:
 
KEYWORD   (R) Parameter name (full) character string  
MINL      (R) Minimum length for keyword match
ITYP      (R) Parameter type 1=dataset, 2=pack, 3=plate specific 
              for single token; 4=dataset, 5=pack, 6=plate specific
              multiple token string
ISTD      (R) Standard parameter for output  = 1 yes, =0 no
MAXLEN    (R) Maximum string length for parameter value
S_DEFLT   (R) Default character string  
STRINGS() (R) Array of character strings containing allowed values
              CHARACTER*LENS STRINGS(NUMS)
NUMS      (R) No. of strings in STRINGS
LENS      (R) Length of each character string element in the
                      STRINGS array
ICHK      (R) Check value option =0 any string OK
                                 =1 check using allowed strings
MATCH     (R) Minimum no. of characters to be matched if ICHK==1;
              if -MATCH given then only MATCH characters will be
              checked and remainder will be ignored; if MATCH==0
              all characters will be checked
IERR      (W) Error return = 0 OK
                           = 1 Parameter error
                           =-1 Cannot allocate memory

2.12.5 Get Index to KDM Keyword Set - LDM_KDX

This routine is used get the index required to access the KDM routines for parameters belonging to an extended LDM parameter set in cases where the direct calling of such routines is required (e.g. to set up new parameters for which specific LDM routines have not been prepared or to return parameter values from multi-value parameters).
 
Fortran call:
 
      INTEGER FUNCTION LDM_KDX(IDUM) 
 
Parameters:
 
IDUM      (R) Dummy parameter



John W. Campbell
CCLRC Daresbury Laboratory
Last update 16 Jan 1998