%CLD%Module LOGIC_SUBCOMMANDS
%CLD%
\Program LOGIC
%HLP%1 HELP
%HLP%                Information on commands within LOGIC

 Program LOGIC is used to search the ICDD-JCPDS database for materials with
 selected characteristics. 
 The ICDD-JCPDS database contains approximately 60,000 sets of summarized 
 diffraction patterns. The database is copyright by the International
 Centre for Diffraction Data and may be used only by license.
 This program maintains a working subset of the full database, referred 
 to as the ``current table'' where the contents of the table may be 
 increased or decreased according to logical criteria  set by the user.

 There are five basic categories of instructions that may be given to
 LOGIC. 
 Commands READ and WRITE are used to read in or write out a stored table;
 commands TABLES, BROWSE, and INDEX are used to examine the entries
   in the current table;
 commands ADD, MATCH and CULL modify the current list by applying logical
   criteria;
 command WAVELENGTH controls whether the program will use d-spaces or 
   \twotheta\ angles for input and output; and command |DELETED| controls
   usage of ``deleted'' patterns.
 commands DCL, FILE, HELP and EXIT are used for program control.

%HLP% The list of available commands is given below. For additional
%HLP% information about any of these commands, enter the name at 
%HLP% the Topic? prompt. It is also possible to use the HELP command
%HLP% for help on a specific command from within LOGIC. Type
%HLP%        HELP command_name
%HLP% at the LOGIC> prompt (For example: LOGIC> help exit).

%HLP%1 Elements
The following element symbols are defined within program LOGIC:
\TAB {}
	H, He, Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, 
	Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni, Cu, Zn, Ga, Ge, 
	As, Se, Br, Kr,	Rb, Sr, Y, Zr, Nb, Mo, Tc, Ru, Rh, Pd, Ag, 
	Cd, In,	Sn, Sb, Te, I, Xe, Cs, Ba, La, Ce, Pr, Nd, Pm, Sm,
	Eu, Gd, Tb, Dy, Ho, Er, Tm, Yb, Lu, Hf, Ta, W, Re, Os, Ir, 
	Pt, Au, Hg, Tl, Pb, Bi, Po, At, Rn, Fr, Ra, Ac, Th, Pa, U, 
	Np, Pu, Am, Cm, Bk, Cf, Es, Fm, Md, No, Lr

\! In addition, the following special symbols are defined for chemical
\! groups or columns in the periodic table:
%HLP%1 Special_symbols
%HLP% Special symbols have been defined for groups in the periodic table:

\TAB LN    Lanthanides (La - Lu)
\TAB AD    Actinides (Ac - Lr)
\TAB 1a    period 1 (H,Li,Na,K,Rb,Cs,Fr)
\TAB 2a    period 2 (Be,Mg,Ca,Sr,Ba,Ra)
\TAB 3a    period 3 (B,Al,Ga,In,Tl)
\TAB 4a    period 4 (C,Si,Ge,Sn,Pb)
\TAB 5a    period 5 (N,P,As,Sb,Bi)
\TAB 6a    period 6 (O,S,Se,Te,Po)
\TAB 7a    period 7 (H,F,Cl,Br,I,At)
\TAB 8a    period 8 (He,Ne,Ar,Kr,Xe,Rn)
\TAB 1b    transition metals period 9 (Cu,Ag,Au)
\TAB 2b    transition metals period 10 (Zn,Cd,Hg)
\TAB 3b    transition metals period 1 (Sc,Y,La,Ac)
\TAB 4b    transition metals period 2 (Ti,Zr,Hf)
\TAB 5b    transition metals period 3 (V,Nb,Ta)
\TAB 6b    transition metals period 4 (Cr,Mo,W)
\TAB 7b    transition metals period 5 (Mn,Tc,Re)
\TAB 8b    transition metals period 6-8 (Fe,Co,Ni,Ru,Rh,Pd,Os,Ir,Pt)
%HLP%1 Periodic_table
%HLP% The periodic table used in LOGIC is given below. Special symbols, such
%HLP% as LN (for all Lanthanides) are enclosed in square brackets ([]).
%HLP% 
%HLP% [1a 2a                               3a 4a 5a 6a 7a 8a]
%HLP%       [3b 4b 5b 6b 7b  --8b--  1b 2b] 
%HLP%  H                                               H  He 
%HLP%  Li Be                               B  C  N  O  F  Ne 
%HLP%  Na Mg                               Al Si P  S  Cl Ar 
%HLP%  K  Ca Sc Ti V  Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr	
%HLP%  Rb Sr Y  Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I  Xe 
%HLP%  Cs Ba *  Hf Ta W  Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn 
%HLP%  Fr Ra **
%HLP% 
%HLP% *   La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu  [LN] 
%HLP% **  Ac Th Pa U  Np Pu Am Cm Bk Cf Es Fm Md No Lr  [AD] 
%HLP% 
%HLP% N.B. the 3b group includes La and Ac
%CLD%Define verb ADD
%CLD%    Synonym OR
%CLD%	Qualifier ELEMENTS, value(type=ELEMENT_LIST, list), nonnegatable
%CLD%	Qualifier E_SPAN, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier CARDS, value(list, type=$number), syntax=add_CARD
%CLD%	Qualifier PEAKS, value(list), syntax=add_PEAKS
%CLD%	Qualifier COUNT, value(list), syntax=add_count
%CLD%	Qualifier OR
%CLD%	Qualifier AND
%CLD%	Qualifier OPTIONAL, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier O_SPAN, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier ERROR, value(required, list)
%CLD%	Qualifier LEVEL, value(required)
%CLD%	Qualifier DSPACE
%CLD%	Qualifier WAVELENGTH, value(required)
%CLD%	Qualifier EXACT
%CLD%	Qualifier FAST
%CLD%	Disallow <add>ERROR or <add>LEVEL or <add>CARDS 
%CLD%		or <add>PEAKS or <add>FAST or
%CLD%		 <add>COUNT
%CLD%	Disallow ANY2(DSPACE,WAVELENGTH)
%CLD%	Disallow ANY2(OR,AND,EXACT)
%CLD%	Disallow ANY2(OR,AND,OPTIONAL)
%CLD%	Disallow ANY2(OR,AND,O_SPAN)
%CLD%Define syntax add_CARD
%CLD%	Disallow <add>OR or <add>AND or <add>FAST or 
%CLD%		 <add>EXACT or <add>OPTIONAL or <add>O_SPAN or 
%CLD%		 <add>PEAKS or <add>ELEMENTS or <add>E_SPAN or
%CLD%		 <add>COUNT
%CLD%Define syntax add_COUNT
%CLD%	Disallow <add>OR or <add>AND or <add>FAST or 
%CLD%		 <add>EXACT or <add>OPTIONAL or <add>O_SPAN or 
%CLD%		 <add>PEAKS or <add>ELEMENTS or <add>E_SPAN or <add>CARDS 
%CLD%Define syntax add_PEAKS
%CLD%	Disallow ANY2(<add>OR,<add>AND)
%CLD%	Disallow ANY2(<add>FAST,<add>EXACT)
%CLD%	Disallow <add>OPTIONAL or <add>CARDS or 
%CLD%		 <add>ELEMENTS or <add>E_SPAN or 
%CLD%		 <add>O_SPAN or
%CLD%		 <add>COUNT

%CLD%
%HLP%1 OR
%HLP% Synonym for ADD, see HELP information on the ADD command
\Command ADD
\! (OR)\par
 Command ADD increases the number of entries in the current table using 
 a logical .OR. operation to add all entries which match a specified
 logical criterion. Command OR is completely equivalent to command ADD.

 There are four possible logical criteria that may be established: 
\TAB {} |/ELEMENTS| A list of entries is specified by a partial or
		complete elemental composition
\TAB {} |/CARD    | A list of entries is specified by ICDD-JCPDS number
\TAB {} |/PEAKS   | A list of entries is specified by positions of the major
		peaks in the pattern.
\TAB {} |/COUNT   | A list of entries is specified by the number of different 
		elements in the chemical formula.

%HLP%2 syntax
 Qualifiers may be specified in only certain combinations. Square brackets 
 (|[ ]|) indicate parameters that are allowed but are not required.
 For example, if |/ELEMENTS/OPTIONAL| is used, |/EXACT| is assumed,
 and need not be specified explicitly.
 Angle brackets (|< >|) indicate that only one of the enclosed 
 parameters may be chosen. For example, for |/PEAKS/OR| 
 either |/DSPACE| or |/WAVELENGTH| may be used, but not both.
 Curly brackets (|{ }|) indicate that more than one of the enclosed 
 parameters may be chosen, but at least one must be chosen.
 For example, either |/OPTIONAL| or |/I_SPAN| or both may be specified
 with |/ELEMENTS| but one of the two must be specified, unless |/OR| or
 |/AND| or |/EXACT| is used.

\! {\parskip 0 pt
\TAB {} |ADD {/ELEMENTS= /E_SPAN=} /OR|\par
\TAB {} |ADD {/ELEMENTS= /E_SPAN=} /AND|\par
\TAB {} |ADD {/ELEMENTS= /E_SPAN=} /EXACT|\par
\TAB {} |ADD {/ELEMENTS= /E_SPAN=} {/OPTIONAL= /O_SPAN=} [/EXACT]|\par
\TAB {} 
\TAB {} |ADD/CARDS|\par
\TAB {} 
\TAB {} |ADD/COUNT=|\par
\TAB {} 
\TAB {} |ADD/PEAKS=/OR/FAST  [/ERROR=] [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |ADD/PEAKS=/AND/FAST [/ERROR=] [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |ADD/PEAKS=/OR/EXACT/ERROR=  [/LEVEL=] </DSPACE /WAVELENGTH]>|\par
\TAB {} |ADD/PEAKS=/AND/EXACT/ERROR= [/LEVEL=] </DSPACE /WAVELENGTH]>|\par
\TAB {} 
\! \par}

 The |/ELEMENTS| (or |/E_SPAN|), |/CARD| or |/PEAKS| qualifier 
 should be specified before other all other qualifiers. 
\Qualifiers
\qual 
/ELEMENTS=required_list\<
/ELEMENTS\<
/E_SPAN=req_range(s)\par
 Use this options to specify a list of elements which must be present for
 the logical criterion to be matched. The list of elements may be used 
 in one of four different ways:
\TAB {} |/OR      | 
		An entry with a composition containing any one of the 
		specified elements is a match.
\TAB {} |/AND     | 
		An entry with a composition containing all of the 
		specified elements is a match.
\TAB {} |/EXACT   | 
		An entry with a composition containing all of the 
		specified elements and no others is a match.
\TAB {} |/OPTIONAL| (and/or |/O_SPAN|) 
		An entry with a composition containing all of the 
		specified elements and any or none of the optional 
		elements, but no others no others is a match.

 Use |/E_SPAN| to specify a range of elements which must be present for
 the logical criterion to be matched. This option is equivalent to 
 specifying the elements individually in the |required_list| using 
 |/ELEMENTS|.

 Examples of the use of these qualifiers are:\par
\TAB {} |/ELEMENTS=SI|\par
\TAB {} |/elem=(si,o,H)|\par
\TAB {} |/E_SPAN=(H,BE)|\par
\TAB {} |/E_SPAN=(Be,H)| (same as previous)\par
\TAB {} |/ELEMENTS=(H,HE,LI,BE)| (same as previous)\par
\TAB {} |/E_SPAN=(H,BE,C,F)| (specifies two ranges: from H to Be and 
		from C to F.\par

 Note that capitalization is ignored and the elements must be surrounded
 by parentheses and separated by commas, if more than one element is
 specified. For the |/E_SPAN| qualifier, element ranges may be 
 specified in either ascending or descending order. 
 To specify more than one range, specify more than one pair of endpoints.
 If no elements are specified with |/ELEMENTS|, and |/E_SPAN| is not 
 used, the program will prompt for elements.

 The following qualifiers may not be used with |/ELEMENTS| or |/E_SPAN|: 
	|/CARDS|, |/PEAKS|, |/FAST|, |/ERROR|, or |/LEVEL|.
 The |/ELEMENTS| or |/E_SPAN| qualifier should be specified before 
 other all other qualifiers. 
\qual 
/COUNT=elm_count\<
/COUNT=(c_min,c_max)\<
/COUNT\par
 Use this qualifier to select entries using the number of unique elements 
 in the chemical formula. The qualifier may be used three ways, if a 
 single value is specified, for example |/COUNT=2|, then entries are 
 selected with that single number of elements. If two values are used, 
 for example |/COUNT=(2,4)| the two numbers represent a range of values,
 in this case 2, 3 or 4 elements are allowed. If no value is specified,
 the computer will prompt for one or more values.

 Note that Cr2O3 . xH2O will be counted as having 3 elements in the
 formula.

 No other qualifiers are allowed with |/COUNT|. 
\qual 
/CARDS=card_list\<
/CARDS\par
 Use this qualifier to select entries using their ICDD-JCPDS entry number.
 The entry number is always a five or six digit number consisting
 of the ``old'' entry number plus 10,000 times the set number. For
 example, entry 413 in set 7 would be coded as:\par
\TAB {} |/CARD=70413| or
\TAB {}	|/CARD=070413|\par
 To specify more than one entry, separate the list with commas and
 enclose the list in parentheses:
\TAB {}	|/CARD=(070413,10001)|

No other qualifiers are allowed with use of the |/CARDS| qualifier.
\qual 
/PEAKS=peak_list\<
/PEAKS\par
 Use this option to select entries based on the location of the
 intense peaks in the pattern. The peak positions must be input
 as either \twotheta\ angles or as d-spaces depending on the 
 current wavelength setting (see command WAVELENGTH). The 
 wavelength setting may be overridden using the |/WAVELENGTH|
 or the |/DSPACE| qualifiers.

 All entries with intense peaks (the intensity threshold is set by
 the |/LEVEL| option) within some region around input peak
 position will be selected. The actual window depends on the
 value(s) used on the |/ERROR| option.  If more than one peak 
 is input, the peaks should be separated by  commas and enclosed 
 in parentheses.  The list of peaks may be used in one of two 
 different ways:
\TAB {} |/OR | An entry with a composition containing any one of the 
		specified peaks is a match.
\TAB {} |/AND| An entry with a composition containing all of the 
		specified peaks is a match.\par
 If no peaks are input, the program will prompt for a list of peaks.

 The following qualifiers may not be used with |/PEAKS|: 
	|/CARDS|, |/ELEMENTS|, |/E_SPAN|, |/COUNT|,
	|/OPTIONAL|, or |/O_SPAN|.
 Specify |/PEAKS| as the first qualifier on the line.
\qual 
/ERROR=error_list\par
 The |error_list| specifies an allowed range for each peak.
 The range is used in one of two ways, depending on mode used by
 the program. If the mode is |/EXACT|, the error range is used
 exactly as specified. For example, If 
	|/PEAK=15.5/ERROR=0.1/EXACT|
 is used, peaks at locations between 15.4 and 15.6 will be 
 selected. The other mode, |/FAST|, may be considerably more rapid
 than |/EXACT|. In |/FAST| mode, the range specified with |/ERROR| 
 is expanded to match spacing of records in the peak index files.
 For example, if the peak index records cover the ranges, 15.15-15.3, 
 15.3-15.45, 15.45-15.6, etc., then if 
	|/PEAK=15.5/ERROR=0.1/FAST|
 is used, then the error range will be expanded to select peaks 
 between 15.3 and 15.6.
 
 An error value may be specified for each peak, but if the number 
 of values in the |error_list| is less than the number of peaks in 
 the |peak_list|, the last error value will be used for all 
 remaining peaks. If the |/ERROR| parameter is not used, the 
 program will prompt for a single error value for all peaks.
 The error value should be specified in the same units (d-space 
 or \twotheta) as the peak positions.

 The |/PEAKS| qualifier must precede this qualifier.
 The following qualifiers may not be used with |/ERROR|:
	|/CARDS|, |/ELEMENTS|, |/E_SPAN|, |/COUNT|,
	|/OPTIONAL|, or |/O_SPAN|.
\qual
/DSPACE\par
 Using this qualifier overrides the current wavelength setting and forces
 peaks to be input as d-spaces. This qualifier cannot be used with 
 |/WAVELENGTH| and will be ignored if used with a qualifier other than 
 |/PEAKS|.
\qual
/WAVELENGTH=wave_length\par
 Using this qualifier overrides the current wavelength setting and forces
 peaks to be input as \twotheta\ angles at |wave_length|\AA. This qualifier 
 cannot be used with |/DSPACE| and will be ignored if used with a qualifier 
 other than |/PEAKS|.
\qual 
/LEVEL=peak_level\par
 Specifies a relative intensity threshold for peak positions specified 
 with the |/PEAKS| qualifier. The threshold value is used slightly 
 differently in |/FAST| mode versus |/EXACT| mode. In |/EXACT| mode,
 the value specifies the exact intensity threshold (in percent relative 
 intensity). For example if |/PEAKS=20.5/ERR=0.1/LEVEL=75/DSPACE/EXACT| 
 is specified, entries with peaks having d-spaces from 20.4 to 20.6 \AA\ 
 with relative intensities of 75\% or greater will be located.
 In |/FAST| mode, the threshold value specifies a peak index to 
 be searched. If there is no peak index at this value, a peak index
 with a lower threshold is used (at 10 \% increments). Thus in the 
 example |/PEAKS=20.5/ERR=0.1/LEVEL=75/DSPACE/FAST|, the error range is 
 opened (see |/ERROR|) and the intensity threshold is also possibly 
 lowered, so that potentially more entries will be selected than in 
 |/EXACT| mode. It is also possible to specify |/LEVEL=3s| in |/FAST| mode.
 This specifies an index of the three strongest peaks in each entry.

 The |/PEAKS| qualifier must precede this qualifier.
 The following qualifiers may not be used with |/LEVEL|:
	|/CARDS|, |/ELEMENTS|, |/E_SPAN|, |/COUNT| 
	|/OPTIONAL|, or |/O_SPAN|.
\qual 
/EXACT\par
 Use |/EXACT| with |/ELEMENTS| to specify that only entries
 containing all of the specified elements and no others
 match as the specified logical criterion. It is possible to widen 
 this criterion so that certain elements are allowed, but not required, 
 using the |/OPTIONAL| and/or |/O_SPAN| qualifiers. 

 Use |/EXACT| with |/PEAKS| to specify that the error range specified
 for peak positions should not be extended, but instead be used as given.
 (See the description given for |/ERROR|.)

 The following qualifiers may not be used with |/EXACT| and |/ELEMENTS|: 
	|/CARDS|, |/PEAKS|, |/OR|, |/AND|, |/ERROR|, |/FAST|,
	|/COUNT| or |/LEVEL|.

 The following qualifiers may not be used with |/EXACT| and |/PEAKS|: 
	|/CARDS|, |/ELEMENTS|, |/E_SPAN|, |/FAST|, |/COUNT| 
	|/OPTIONAL|, or |/O_SPAN|.
\qual 
/FAST\par
 Use |/FAST| with |/PEAKS| to specify that the error range specified
 for peak positions may be extended for most efficient searching.
 (See the description given for |/ERROR|.)

 The following qualifiers may not be used with |/FAST|: 
	|/CARDS|, |/ELEMENTS|, |/E_SPAN|, |/OPTIONAL|, |/EXACT|,
	|/COUNT| or |/O_SPAN|.
\qual 
/OR\par
 Use |/OR| with either |/PEAKS| or |/ELEMENTS| to specify that any entry
 containing the specified element or peak is a match for the specified 
 logical criterion.\par
 The following qualifiers may not be used with |/OR|: 
	|/CARDS|, |/AND|, |/COUNT|, |/OPTIONAL|, or |/O_SPAN|.
 Also, if |/ELEMENTS| and |/OR| are used, |/EXACT| cannot be used.
\qual 
/AND\par
 Use |/AND| with either |/PEAKS| or |/ELEMENTS| to specify that only entries
 containing all of the specified elements or peaks match for the specified 
 logical criterion.\par
 The following qualifiers may not be used with |/AND|: 
	|/CARDS|, |/OR|, |/COUNT|, |/OPTIONAL|, or |/O_SPAN|.
 Also, if |/ELEMENTS| and |/AND| are used, |/EXACT| cannot be used.
\qual 
/OPTIONAL=optional_list\<
/O_SPAN=opt_range(s)\par
 Use |/OPTIONAL| or |/O_SPAN| with |/ELEMENTS| to specify that only 
 entries containing all of the required elements specified in the 
 |required_list| (see |/ELEMENTS| and |/E_SPAN|) and optionally those 
 in the optional_list, but no others, as the specified logical 
 criterion. |/O_SPAN| is equivalent to |/OPTIONAL| except that ranges
 of elements may be specified.

 Examples of the use of this qualifier are:\par
\TAB {} |/OPTIONAL=SI|\par
\TAB {} |/ig=(si,o,H)|\par
\TAB {} |/O_SPAN=(H,BE)| 
\TAB {} |/O_SPAN=(BE,H)| (equivalent to previous)\par
\TAB {} |/OPTIONAL=(H,HE,LI,BE)| (equivalent to previous)\par
\TAB {} |/O_SPAN=(H,BE,C,F)| specifies two ranges: from H to Be and 
		from C to F.\par
 Note that capitalization is ignored and the elements must be surrounded
 by parentheses and separated by commas, if more than one element is
 specified. 
 Ranges may be specified in either ascending or descending order.
 To specify more than one range, specify more than one pair of endpoints.

 The following qualifiers may not be used with |/OPTIONAL| or |/O_SPAN|: 
	|/CARDS|, |/PEAKS|, |/FAST|, |/OR|, |/AND|, 
	|/ERROR|, |/COUNT|, or |/LEVEL|.
 Qualifier |/EXACT| is assumed to be present if |/OPTIONAL| or |/O_SPAN|
 is used and thus is optional. |/O_SPAN| may be used with |/OPTIONAL|.\par
%CLD%Define verb BROWSE
%CLD%
\Command BROWSE\par
 Use this function to examine tables of angles or d-spaces for all entries 
 in the ``current list'' from a terminal. Entries are displayed one at a 
 time; it is possible to page backwards or forwards in the list and to
 print selected entries. If the full ICDD-JCPDS (PDF-2) database is on-line,
 the entire ICDD-JCPDS entry may be displayed or printed.

 After entering the BROWSE command, a prompt line is displayed, which 
 shows the total number of entries in the current list and the relative 
 position of the current entry within the list. Also displayed is a 
 list of available commands.  The following commands are defined:
\TAB	{} |+n_p| moves forward in the list by |n_p| entries; 
\TAB	{} |-n_p| moves backward by |n_p| entries;
\TAB	{} |>n_p| displays the |n_p|-th entry in the list;
\TAB	{} |[crd| displays ICDD-JCPDS entry |crd|, or the closest entry in the 
		list by number;
\TAB	{} |    | (blank line) displays the next entry;
\TAB	{} |P   | prints the chemical information and D/I data (PDF-1 data) 
		for the current entry and advances to the next entry;
\TAB	{} |C   | culls (removes) the current entry from the current table 
		and advances to the next entry;
\TAB	{} |D   | displays all the information for the current entry 
		in the full ICDD-JCPDS (PDF-2) database;
\TAB	{} |A   | prints All the information for the current entry 
		and advances to the next entry;
\TAB	{} |G   | graphically displays one or more entries, starting from
		the current entry;
\TAB	{} |^Z  | or advancing past the last entry terminates BROWSE mode.\par
 
 The command letter or symbol, (|+|, |>| or |P|, for example) must be 
 the first letter on the line. Commands which are not valid are not
 given in the list of options. 
 Commands D and A both require the PDF-2 database either on disk or on 
 CD-ROM. If the PDF-2 database is unavailable, these options will not be 
 listed.
 The graph command, G, is only available on graphics-compatible terminals. 
 This command can be used to display experimental data as well as ICDD-JCPDS
 entries. Each time the command is called, one can input a data or peak file
 to the program and this data will be displayed as well as the selected 
 entries. A wide variety of peak and data files may be read 
%HLP% see the help entry for File_formats.
\! see the section on File_formats in the first chapter.
 Of particular use will be SEARCH temporary files, which may 
 be read directly at this point by LOGIC and may then then be plotted.
%CLD%Define verb COMMENT
%CLD%	parameter P1, value (type = $rest_of_line)
%CLD%
\Command COMMENT\par
 The program records a summary of the logical steps (commands that 
 modify the contents of the current table). Use this command to 
 place a comment line into the list of logical steps. The comment
 may be placed on the same line as the COMMENT command, or will be
 prompted.
\Parameter
\parm
comment_line\par
 A single line of comments may be placed after the COMMENT command.
 Lowercase letters will be translated to uppercase if the 
 |comment_line| is placed on the same line, rather than entered at 
 the prompt.

%CLD%Define verb CULL
%CLD%    Synonym NAND
%CLD%	Qualifier ELEMENTS, value(type=ELEMENT_LIST, list)
%CLD%	Qualifier E_SPAN, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier CARDS, value(list, type=$number), syntax=CULL_CARD
%CLD%	Qualifier PEAKS, value(list), syntax=CULL_PEAKS
%CLD%	Qualifier NAME, value(required), syntax=CULL_NAME
%CLD%	Qualifier COUNT, value(list), syntax=CULL_count
%CLD%	Qualifier OR
%CLD%	Qualifier AND
%CLD%	Qualifier OPTIONAL, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier O_SPAN, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier ERROR, value(required, list)
%CLD%	Qualifier LEVEL, value(required)
%CLD%	Qualifier DSPACE
%CLD%	Qualifier WAVELENGTH, value(required)
%CLD%	Qualifier EXACT
%CLD%	Qualifier FAST
%CLD%	Disallow <cull>ERROR or <cull>LEVEL or <cull>CARDS 
%CLD%		or <cull>PEAKS or <cull>FAST or <cull>NAME or <cull>COUNT
%CLD%	Disallow ANY2(DSPACE,WAVELENGTH)
%CLD%	Disallow ANY2(OR,AND,EXACT)
%CLD%	Disallow ANY2(OR,AND,OPTIONAL)
%CLD%	Disallow ANY2(OR,AND,O_SPAN)
%CLD%Define syntax cull_CARD
%CLD%	Disallow <cull>OR or <cull>AND or <cull>FAST or <cull>PEAKS or 
%CLD%		 <cull>EXACT or <cull>OPTIONAL or <cull>O_SPAN or 
%CLD%		 <cull>ELEMENTS or <cull>E_SPAN or <cull>NAME or <cull>COUNT
%CLD%Define syntax cull_COUNT
%CLD%	Disallow <cull>EXACT or <cull>OPTIONAL or <cull>CARDS or 
%CLD%		 <cull>ELEMENTS or <cull>O_SPAN or <cull>PEAKS or
%CLD%		 <cull>OR or <cull>AND or <cull>E_SPAN or <cull>FAST or 
%CLD%		 <cull>CARDS or <cull>NAME
%CLD%Define syntax cull_PEAKS
%CLD%	Disallow ANY2(<cull>OR,<cull>AND)
%CLD%	Disallow ANY2(<cull>FAST,<cull>EXACT)
%CLD%	Disallow <cull>OPTIONAL or <cull>CARDS or 
%CLD%		 <cull>ELEMENTS or <cull>E_SPAN or 
%CLD%		 <cull>O_SPAN or <cull>NAME or <CULL>COUNT
%CLD%Define syntax cull_NAME
%CLD%	Disallow <cull>EXACT or <cull>OPTIONAL or <cull>CARDS or 
%CLD%		 <cull>ELEMENTS or <cull>O_SPAN or <cull>PEAKS or
%CLD%		 <cull>OR or <cull>AND or <cull>E_SPAN or <cull>FAST or <CULL>COUNT
%CLD%
%HLP%1 NAND
%HLP% Synonym for CULL, see HELP information on the CULL command
\Command CULL
\! (NAND)\par
 Command CULL decreases the number of entries in the current table using 
 a logical .AND. .NOT. operation to remove all entries which match a 
 specified logical criterion. Command NAND is completely equivalent to 
 command CULL.

 There are five possible logical criteria that may be established: 
\TAB {} |/ELEMENTS| A list of entries is specified by a partial or
		complete elemental composition
\TAB {} |/CARD    | A list of entries is specified by number
\TAB {} |/PEAKS   | A list of entries is specified by positions of the 
		major peaks in the pattern.
\TAB {} |/NAME    | A list of entries is specified by chemical/mineral name
\TAB {} |/COUNT   | A list of entries is specified by the number of different 
		elements in the chemical formula.

%HLP%2 syntax
 Qualifiers may be specified in only certain combinations. Square brackets 
 (|[ ]|) indicate parameters that are allowed but are not required.
 For example, if |/ELEMENTS/OPTIONAL| is used, |/EXACT| is assumed,
 and need not be specified explicitly.
 Angle brackets (|< >|) indicate that only one of the enclosed 
 parameters may be chosen. For example, for |/PEAKS/OR| 
 either |/DSPACE| or |/WAVELENGTH| may be used, but not both.
 Curly brackets (|{ }|) indicate that more than one of the enclosed 
 parameters may be chosen, but at least one must be chosen.
 For example, either |/OPTIONAL| or |/I_SPAN| or both may be specified
 with |/NOELEMENTS| but one of the two should be specified.

\! {\parskip 0 pt
\TAB {} |CULL {/ELEMENTS= /E_SPAN=} /OR|\par
\TAB {} |CULL {/ELEMENTS= /E_SPAN=} /AND|\par
\TAB {} |CULL {/ELEMENTS= /E_SPAN=} /EXACT|\par
\TAB {} |CULL {/ELEMENTS= /E_SPAN=} {/OPTIONAL= /O_SPAN=} [/EXACT]|\par
\TAB {} |CULL/NOELEMENTS {/OPTIONAL= /O_SPAN=} [/EXACT]|\par
\TAB {} 
\TAB {} |CULL/CARDS=|\par
\TAB {} 
\TAB {} |CULL/NAME=|
\TAB {} 
\TAB {} |CULL/COUNT=|\par
\TAB {} 
\TAB {} |CULL/PEAKS=/OR/FAST  [/ERROR=] [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |CULL/PEAKS=/AND/FAST [/ERROR=] [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |CULL/PEAKS=/OR/EXACT/ERROR=  [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |CULL/PEAKS=/AND/EXACT/ERROR= [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} 
\! \par}

 The |/ELEMENTS| (or |/E_SPAN|), |/CARD|, |/NAME| or |/PEAKS| qualifier 
 should be specified before other all other qualifiers. 
\Qualifiers
\qual 
/ELEMENTS=required_list\<
/ELEMENTS\<
/NOELEMENTS\<
/E_SPAN=req_range(s)\par
 Use this options to specify a list of elements which must be present for
 the logical criterion to be matched. The list of elements may be used 
 in one of four different ways:
\TAB {} |/OR      | 
		An entry with a composition containing any one of the 
		specified elements is a match.
\TAB {} |/AND     | 
		An entry with a composition containing all of the 
		specified elements is a match.
\TAB {} |/EXACT   | 
		An entry with a composition containing all of the 
		specified elements and no others is a match.
\TAB {} |/OPTIONAL| (and/or |/O_SPAN|) 
		An entry with a composition containing all of the 
		specified elements and any or none of the optional 
		elements, but no others no others is a match.

 Use |/E_SPAN| to specify a range of elements which must be present for
 the logical criterion to be matched. This option is equivalent to 
 specifying the elements individually in the |required_list| using 
 |/ELEMENTS|.

 The |/NOELEMENTS| option is used if there are no required elements,
 but optional elements will be specified using the |/OPTIONAL| or
 |/O_SPAN| options. Thus, entries will be removed that have any 
 combination of the optional elements and no others. Use of this
 option will remove all entries with unassigned chemical formulas, 
 as would be performed by a |CULL/COUNT=0| command.

 Examples of the use of these qualifiers are:\par
\TAB {} |/ELEMENTS=SI|\par
\TAB {} |/elem=(si,o,H)|\par
\TAB {} |/E_SPAN=(H,BE)|\par
\TAB {} |/E_SPAN=(Be,H)| (same as previous)\par
\TAB {} |/ELEMENTS=(H,HE,LI,BE)| (same as previous)\par
\TAB {} |/E_SPAN=(H,BE,C,F)| (specifies two ranges: from H to Be and 
		from C to F.\par

 Note that capitalization is ignored and the elements must be surrounded
 by parentheses and separated by commas, if more than one element is
 specified. For the |/E_SPAN| qualifier, element ranges may be 
 specified in either ascending or descending order. 
 To specify more than one range, specify more than one pair of endpoints.
 If no elements are specified with |/ELEMENTS|, and |/E_SPAN| is not 
 used, the program will prompt for elements.

 The following qualifiers may not be used with |/ELEMENTS| or |/E_SPAN|: 
	|/CARDS|, |/NAME|, |/PEAKS|, |/FAST|, |/ERROR|, or |/LEVEL|.
 The |/ELEMENTS| or |/E_SPAN| qualifier should be specified before 
 other all other qualifiers. 
\qual 
/COUNT=elm_count\<
/COUNT=(c_min,c_max)\<
/COUNT\par
 Use this qualifier to select entries using the number of unique elements 
 in the chemical formula. The qualifier may be used three ways, if a 
 single value is specified, for example |/COUNT=2|, then entries are 
 selected with that single number of elements. If two values are used, 
 for example |/COUNT=(2,4)| the two numbers represent a range of values,
 in this case 2, 3 or 4 elements are allowed. If no value is specified,
 the computer will prompt for one or more values.

 Note that Cr2O3 . xH2O will be counted as having 3 elements in the
 formula.

 No other qualifiers are allowed with |/COUNT|. 
\qual 
/CARDS=card_list\<
/CARDS\par
 Use this qualifier to select entries using their ICDD-JCPDS entry number.
 The entry number is always a five or six digit number consisting
 of the ``old'' entry number plus 10,000 times the set number. For
 example, entry 413 in set 7 would be coded as:\par
\TAB {} |/CARD=70413| or
\TAB {}	|/CARD=070413|\par
 To specify more than one entry, separate the list with commas and
 enclose the list in parentheses:
\TAB {}	|/CARD=(070413,10001)|

No other qualifiers are allowed with use of the |/CARDS| qualifier.
\qual 
/NAME=compound_name\<
/NAME=mineral_name\par
  A fragment of a chemical or mineral name to be matched. The name 
  listed on an entry must match the |compound_name| fragment letter 
  for letter (lowercase letters will be converted to uppercase). If
  spaces are to be included in the fragment, the fragment should be 
  enclosed in quotation marks (|"|). For example, 
\TAB {} |/NAME=silicon|
\TAB {} |/NAME="silicon oxide"|

  No other qualifiers may be used with |/NAME|.
\qual 
/PEAKS=peak_list\<
/PEAKS\par
 Use this option to select entries based on the location of the
 intense peaks in the pattern. The peak positions must be input
 as either \twotheta\ angles or as d-spaces depending on the 
 current wavelength setting (see command WAVELENGTH). The 
 wavelength setting may be overridden using the |/WAVELENGTH|
 or the |/DSPACE| qualifiers.

 All entries with intense peaks (the intensity threshold is set by
 the |/LEVEL| option) within some region around input peak
 position will be selected. The actual window depends on the
 value(s) used on the |/ERROR| option.  If more than one peak 
 is input, the peaks should be separated by  commas and enclosed 
 in parentheses.  The list of peaks may be used in one of two 
 different ways:
\TAB {} |/OR | An entry with a composition containing any one of the 
		specified peaks is a match.
\TAB {} |/AND| An entry with a composition containing all of the 
		specified peaks is a match.\par
 If no peaks are input, the program will prompt for a list of peaks.

 The following qualifiers may not be used with |/PEAKS|: 
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/COUNT|,
	|/OPTIONAL|, or |/O_SPAN|.
 Specify |/PEAKS| as the first qualifier on the line.
\qual 
/ERROR=error_list\par
 The |error_list| specifies an allowed range for each peak.
 The range is used in one of two ways, depending on mode used by
 the program. If the mode is |/EXACT|, the error range is used
 exactly as specified. For example, If 
	|/PEAK=15.5/ERROR=0.1/EXACT|
 is used, peaks at locations between 15.4 and 15.6 will be 
 selected. The other mode, |/FAST|, may be considerably more rapid
 than |/EXACT|. In |/FAST| mode, the range specified with |/ERROR| 
 is expanded to match spacing of records in the peak index files.
 For example, if the peak index records cover the ranges, 15.15-15.3, 
 15.3-15.45, 15.45-15.6, etc., then if 
	|/PEAK=15.5/ERROR=0.1/FAST|
 is used, then the error range will be expanded to select peaks 
 between 15.3 and 15.6.
 
 An error value may be specified for each peak, but if the number 
 of values in the |error_list| is less than the number of peaks in 
 the |peak_list|, the last error value will be used for all 
 remaining peaks. If the |/ERROR| parameter is not used, the 
 program will prompt for a single error value for all peaks.
 The error value should be specified in the same units (d-space 
 or \twotheta) as the peak positions.

 The |/PEAKS| qualifier must precede this qualifier.
 The following qualifiers may not be used with |/ERROR|:
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/COUNT|,
	|/OPTIONAL|, or |/O_SPAN|.
\qual
/DSPACE\par
 Using this qualifier overrides the current wavelength setting and forces
 peaks to be input as d-spaces. This qualifier cannot be used with 
 |/WAVELENGTH| and will be ignored if used with a qualifier other than 
 |/PEAKS|.
\qual
/WAVELENGTH=wave_length\par
 Using this qualifier overrides the current wavelength setting and forces
 peaks to be input as \twotheta\ angles at |wave_length|\AA. This qualifier 
 cannot be used with |/DSPACE| and will be ignored if used with a qualifier 
 other than |/PEAKS|.
\qual 
/LEVEL=peak_level\par
 Specifies a relative intensity threshold for peak positions specified 
 with the |/PEAKS| qualifier. The threshold value is used slightly 
 differently in |/FAST| mode versus |/EXACT| mode. In |/EXACT| mode,
 the value specifies the exact intensity threshold (in percent relative 
 intensity). For example if |/PEAKS=20.5/ERR=0.1/LEVEL=75/DSPACE/EXACT| 
 is specified, entries with peaks having d-spaces from 20.4 to 20.6 \AA\ 
 with relative intensities of 75\% or greater will be located.
 In |/FAST| mode, the threshold value specifies a peak index to 
 be searched. If there is no peak index at this value, a peak index
 with a lower threshold is used (at 10 \% increments). Thus in the 
 example |/PEAKS=20.5/ERR=0.1/LEVEL=75/DSPACE/FAST|, the error range is 
 opened (see |/ERROR|) and the intensity threshold is also possibly 
 lowered, so that potentially more entries will be selected than in 
 |/EXACT| mode. It is also possible to specify |/LEVEL=3s| in |/FAST| mode.
 This specifies an index of the three strongest peaks in each entry.

 The |/PEAKS| qualifier must precede this qualifier.
 The following qualifiers may not be used with |/LEVEL|:
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/COUNT| 
	|/OPTIONAL|, or |/O_SPAN|.
\qual 
/EXACT\par
 Use |/EXACT| with |/ELEMENTS| to specify that only entries
 containing all of the specified elements and no others
 match as the specified logical criterion. It is possible to widen 
 this criterion so that certain elements are allowed, but not required, 
 using the |/OPTIONAL| and/or |/O_SPAN| qualifiers. 

 Use |/EXACT| with |/PEAKS| to specify that the error range specified
 for peak positions should not be extended, but instead be used as given.
 (See the description given for |/ERROR|.)

 The following qualifiers may not be used with |/EXACT| and |/ELEMENTS|: 
	|/CARDS|, |/NAME|, |/PEAKS|, |/OR|, |/AND|, |/ERROR|, |/FAST|,
	|/COUNT| or |/LEVEL|.

 The following qualifiers may not be used with |/EXACT| and |/PEAKS|: 
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/FAST|, |/COUNT| 
	|/OPTIONAL|, or |/O_SPAN|.
\qual 
/FAST\par
 Use |/FAST| with |/PEAKS| to specify that the error range specified
 for peak positions may be extended for most efficient searching.
 (See the description given for |/ERROR|.)

 The following qualifiers may not be used with |/FAST|: 
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/OPTIONAL|, |/EXACT|,
	|/COUNT| or |/O_SPAN|.
\qual 
/OR\par
 Use |/OR| with either |/PEAKS| or |/ELEMENTS| to specify that any entry
 containing the specified element or peak is a match for the specified 
 logical criterion.\par
 The following qualifiers may not be used with |/OR|: 
	|/CARDS|, |/NAME|, |/AND|, |/COUNT|, |/OPTIONAL|, or |/O_SPAN|.
 Also, if |/ELEMENTS| and |/OR| are used, |/EXACT| cannot be used.
\qual 
/AND\par
 Use |/AND| with either |/PEAKS| or |/ELEMENTS| to specify that only entries
 containing all of the specified elements or peaks match for the specified 
 logical criterion.\par
 The following qualifiers may not be used with |/AND|: 
	|/CARDS|, |/NAME|, |/OR|, |/COUNT|, |/OPTIONAL|, or |/O_SPAN|.
 Also, if |/ELEMENTS| and |/AND| are used, |/EXACT| cannot be used.
\qual 
/OPTIONAL=optional_list\<
/O_SPAN=opt_range(s)\par
 Use |/OPTIONAL| or |/O_SPAN| with |/ELEMENTS| to specify that only 
 entries containing all of the required elements specified in the 
 |required_list| (see |/ELEMENTS| and |/E_SPAN|) and optionally those 
 in the optional_list, but no others, as the specified logical 
 criterion. |/O_SPAN| is equivalent to |/OPTIONAL| except that ranges
 of elements may be specified.

 Examples of the use of this qualifier are:\par
\TAB {} |/OPTIONAL=SI|\par
\TAB {} |/ig=(si,o,H)|\par
\TAB {} |/O_SPAN=(H,BE)| 
\TAB {} |/O_SPAN=(BE,H)| (equivalent to previous)\par
\TAB {} |/OPTIONAL=(H,HE,LI,BE)| (equivalent to previous)\par
\TAB {} |/O_SPAN=(H,BE,C,F)| specifies two ranges: from H to Be and 
		from C to F.\par
 Note that capitalization is ignored and the elements must be surrounded
 by parentheses and separated by commas, if more than one element is
 specified. 
 Ranges may be specified in either ascending or descending order.
 To specify more than one range, specify more than one pair of endpoints.

 The following qualifiers may not be used with |/OPTIONAL| or |/O_SPAN|: 
	|/CARDS|, |/NAME|, |/PEAKS|, |/FAST|, |/OR|, |/AND|, 
	|/ERROR|, |/COUNT|, or |/LEVEL|.
 Qualifier |/EXACT| is assumed to be present if |/OPTIONAL| or |/O_SPAN|
 is used and thus is optional. |/O_SPAN| may be used with |/OPTIONAL|.\par
%CLD%Define verb DCL 
%CLD%
\Command DCL\par
 Spawns a subprocess to execute DCL commands, type LOGOUT to 
 return back to LOGIC without affecting the ``current list''. 
 This command is useful for quick DCL ``errands'' such as answering a 
 mail message without exiting the program.

%CLD%Define verb DELETED
%CLD%	Qualifier INCLUDE
%CLD%	Qualifier EXCLUDE
%CLD%
\Command DELETED\par
 Some of the entries in the database are marked as ``deleted'' by the
 editors of the database. If these entries are included in the database
 (using the ENCODE program, PDF1) it is possible to select that these
 entries will be included or excluded from the operations of this
 program. 

 This command causes logical name |PS_DELETED| to be set so that 
 subsequent operations with the program and with other programs in the
 Powder Suite package will use the same option. The default mode for
 the program is |DELETED/EXCLUDE|. However, if desired the |PS_DELETED|
 logical name may be predefined (see customization instructions) to change
 the default.
\Qualifiers
\qual 
/INCLUDE\par
 Specifies that deleted entries will be included in the logical operations.
\qual 
/EXCLUDE\par
 Specifies that deleted entries will be not be included in the logical operations.
%CLD%Define verb EXIT
%CLD%
\Command EXIT\par
 Type EXIT (which can be abbreviated to EX) to exit from the program.
 Alternately, press Control Z (|^Z|) to exit. 

%CLD%Define verb FILE
%CLD%	Parameter P1, label file_name, value(type=$file)
%CLD%
\Command FILE\par
 Allows a series of commands to be input to the program from an external
 file. The file should be prepared before starting the program, or using
 the DCL command to invoke an editor. 
\Parameter
\parm
file_name\par
 A single file may be specified on the command line containing the name
 of the file with commands. If the file is not specified, a prompt will be
 given to request a file name. 

 If no file extension is supplied, the default extension is |.CMD|
%CLD%Define verb HELP
%CLD%	parameter P1, value (type = $rest_of_line)
%CLD%
\!\Command HELP\par
\! Invokes the VAX/VMS online help facility for help on this program.

%CLD%Define verb INDEX
%CLD%	Qualifier MAXD, value(type=$number), nonnegatable
%CLD%	Qualifier HANAWALT, value(type=$number), nonnegatable
%CLD%	Qualifier NAMES, nonnegatable
%CLD%	Qualifier PRINT
%CLD%	Disallow any2(MAXD,HANAWALT,NAMES)
%CLD%
\Command INDEX\par
 Displays an index of the entries in the current list, with the information
 for each entry summarized to a single line.\par
 There are three possible formats: 
 In ``names'' format, the chemical composition, chemical and mineral name 
 for each entry in the current list are given. In ``Hanawalt'' format, the
 most intense lines are listed with intensity and d-spacing or angle.
 This list may optionally be sorted in order of increasing d-space or 
 angle and the most intense lines may be permuted. In ``maxD'' format, 
 the lines are listed in order of decreasing d-space (or increasing 
 angle). This list may be sorted and permuted, as before. 

 If |/PRINT| is not specified, the list is displayed on the terminal in 
 sections. After each section, a ``|Continue?|" prompt appears. If the
 response is ``|N|", ``|P|" or |^Z|, no more sections will be displayed. 
 If ``|P|" is specified, the complete list will be printed. Enter ``|Y|'' 
 or a blank line for the next section.
\Qualifiers
\qual 
/HANAWALT=sort_lines\<
/HANAWALT\par
 The list is displayed in Hanawalt format -- an entry number followed by 
 the d-spaces or angles ordered by intensity. 
 
 Entries are listed by PDF file in sequential order, unless the |sort_lines|
 option is specified, in which case the records are sorted by 
 increasing d-spacing or angle. 

 |sort_lines| specifies the number of peaks to be used for sorting:
\TAB	{} |/HANAWALT=0| -- the list is sorted by set and entry number.
\TAB	{} |/HANAWALT=1| -- the list is sorted based on the 
	most intense line.
\TAB	{} |/HANAWALT=sort_lines| -- (|sort_lines|=2,3,4 or 5), 
	the |sort_lines| most intense lines are permuted and then sorted, 
	thus the length of the list increases by a factor of |sort_lines|.
\qual 
/MAXD=sort_lines\<
/MAXD\par
 The list is displayed in maxD format -- an entry number followed by 
 the d-spaces or angles ordered by decreasing d-space (increasing angle). 
 
 Entries are listed by PDF file in sequential order, unless the |sort_lines|
 option is specified, in which case the records are sorted by 
 increasing d-spacing or angle. 

 |sort_lines| specifies the number of peaks to be used for sorting:
\TAB	{} |/MAXD=0| -- the list is sorted by set and entry number.
\TAB	{} |/MAXD=1| -- the list is sorted based on the 
	highest d-space line.
\TAB	{} |/MAXD=sort_lines| -- (|sort_lines|=2,3,4 or 5), 
	the |sort_lines| highest d-space lines are permuted and then sorted, 
	thus the length of the list increases by a factor of |sort_lines|.
\qual 
/NAMES\par
 The ``current list'' is displayed with chemical formula, compound name and
 mineral name. Entries are listed in sequential order by set and entry number.
\qual 
/PRINT\par
 Prints the index rather than displaying it on the terminal.

%CLD%Define verb MATCH
%CLD%    Synonym AND
%CLD%	Qualifier ELEMENTS, value(type=ELEMENT_LIST, list)
%CLD%	Qualifier E_SPAN, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier CARDS, value(list, type=$number), syntax=MATCH_CARD
%CLD%	Qualifier PEAKS, value(list), syntax=MATCH_PEAKS
%CLD%	Qualifier NAME, value(required), syntax=MATCH_NAME
%CLD%	Qualifier COUNT, value(list), syntax=MATCH_count
%CLD%	Qualifier OR
%CLD%	Qualifier AND
%CLD%	Qualifier OPTIONAL, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier O_SPAN, value(type=ELEMENT_LIST,list,required)
%CLD%	Qualifier ERROR, value(required, list)
%CLD%	Qualifier LEVEL, value(required)
%CLD%	Qualifier DSPACE
%CLD%	Qualifier WAVELENGTH, value(required)
%CLD%	Qualifier EXACT
%CLD%	Qualifier FAST
%CLD%	Disallow <match>ERROR or <match>LEVEL or <match>CARDS 
%CLD%		or <match>PEAKS or <match>FAST or <match>NAME or <match>COUNT
%CLD%	Disallow ANY2(DSPACE,WAVELENGTH)
%CLD%	Disallow ANY2(OR,AND,EXACT)
%CLD%	Disallow ANY2(OR,AND,OPTIONAL)
%CLD%	Disallow ANY2(OR,AND,O_SPAN)
%CLD%Define syntax MATCH_CARD
%CLD%	Disallow <match>OR or <match>AND or <match>FAST or <match>PEAKS or 
%CLD%		 <match>EXACT or <match>OPTIONAL or <match>O_SPAN or 
%CLD%		 <match>ELEMENTS or <match>E_SPAN or <match>NAME or <match>COUNT
%CLD%Define syntax MATCH_PEAKS
%CLD%	Disallow ANY2(<match>OR,<match>AND)
%CLD%	Disallow ANY2(<match>FAST,<match>EXACT)
%CLD%	Disallow <match>OPTIONAL or <match>CARDS or 
%CLD%		 <match>ELEMENTS or <match>E_SPAN or 
%CLD%		 <match>O_SPAN or <match>NAME or <match>COUNT
%CLD%Define syntax MATCH_NAME
%CLD%	Disallow <match>EXACT or <match>OPTIONAL or <match>CARDS or 
%CLD%		 <match>ELEMENTS or <match>O_SPAN or <match>PEAKS or
%CLD%		 <match>OR or <match>AND or <match>E_SPAN or <match>FAST or
%CLD%		 <match>COUNT
%CLD%Define syntax MATCH_COUNT
%CLD%	Disallow <match>EXACT or <match>OPTIONAL or <match>CARDS or 
%CLD%		 <match>ELEMENTS or <match>O_SPAN or <match>PEAKS or
%CLD%		 <match>OR or <match>AND or <match>E_SPAN or <match>FAST or
%CLD%		 <match>NAME
%CLD%
%HLP%1 AND
%HLP% Synonym for MATCH, see HELP information on the MATCH command
\Command MATCH
\! (AND)\par
 Command MATCH decreases the number of entries in the current table using 
 a logical .AND. operation to remove all entries which do not match a 
 specified logical criterion. Command AND is completely equivalent to 
 command MATCH.

 There are five possible logical criteria that may be established: 
\TAB {} |/ELEMENTS| A list of entries is specified by a partial or
		complete elemental composition
\TAB {} |/CARD    | A list of entries is specified by number
\TAB {} |/PEAKS   | A list of entries is specified by positions of the 
		major peaks in the pattern.
\TAB {} |/NAME    | A list of entries is specified by chemical/mineral name
\TAB {} |/COUNT   | A list of entries is specified by the number of different 
		elements in the chemical formula.

%HLP%2 syntax
 Qualifiers may be specified in only certain combinations. Square brackets 
 (|[ ]|) indicate parameters that are allowed but are not required.
 For example, if |/ELEMENTS/OPTIONAL| is used, |/EXACT| is assumed,
 and need not be specified explicitly.
 Angle brackets (|< >|) indicate that only one of the enclosed 
 parameters may be chosen. For example, for |/PEAKS/OR| 
 either |/DSPACE| or |/WAVELENGTH| may be used, but not both.
 Curly brackets (|{ }|) indicate that more than one of the enclosed 
 parameters may be chosen, but at least one must be chosen.
 For example, either |/ELEMENTS| or |/E_SPAN| or both may be specified, 
 but one of the two should be specified.

\! {\parskip 0 pt
\TAB {} |MATCH {/ELEMENTS= /E_SPAN=} /OR|\par
\TAB {} |MATCH {/ELEMENTS= /E_SPAN=} /AND|\par
\TAB {} |MATCH {/ELEMENTS= /E_SPAN=} /EXACT|\par
\TAB {} |MATCH {/ELEMENTS= /E_SPAN=} {/OPTIONAL= /O_SPAN=} [/EXACT]|\par
\TAB {} |MATCH/NOELEMENTS {/OPTIONAL= /O_SPAN=} [/EXACT]|\par
\TAB {} 
\TAB {} |MATCH/CARDS=|\par
\TAB {} 
\TAB {} |MATCH/NAME=|
\TAB {} 
\TAB {} |MATCH/COUNT=|\par
\TAB {} 
\TAB {} |MATCH/PEAKS=/OR/FAST  [/ERROR=] [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |MATCH/PEAKS=/AND/FAST [/ERROR=] [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |MATCH/PEAKS=/OR/EXACT/ERROR=  [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} |MATCH/PEAKS=/AND/EXACT/ERROR= [/LEVEL=] </DSPACE /WAVELENGTH=]>|\par
\TAB {} 
\! \par}

 The |/ELEMENTS| (or |/E_SPAN|), |/CARD|, |/NAME| or |/PEAKS| qualifier 
 should be specified before other all other qualifiers. 
\Qualifiers
\qual 
/ELEMENTS=required_list\<
/ELEMENTS\<
/NOELEMENTS\<
/E_SPAN=req_range(s)\par
 Use this options to specify a list of elements which must be present for
 the logical criterion to be matched. The list of elements may be used 
 in one of four different ways:
\TAB {} |/OR      | 
		An entry with a composition containing any one of the 
		specified elements is a match.
\TAB {} |/AND     | 
		An entry with a composition containing all of the 
		specified elements is a match.
\TAB {} |/EXACT   | 
		An entry with a composition containing all of the 
		specified elements and no others is a match.
\TAB {} |/OPTIONAL| (and/or |/O_SPAN|) 
		An entry with a composition containing all of the 
		specified elements and any or none of the optional 
		elements, but no others no others is a match.

 Use |/E_SPAN| to specify a range of elements which must be present for
 the logical criterion to be matched. This option is equivalent to 
 specifying the elements individually in the |required_list| using 
 |/ELEMENTS|.

 The |/NOELEMENTS| option is used if there are no required elements,
 but optional elements will be specified using the |/OPTIONAL| or
 |/O_SPAN| options. Thus, entries will be selected that have any 
 combination of the optional elements and no others. Use of this
 option will allow some unexpected entries, entries with unassigned
 chemical formulas. These entries may be removed using a 
 |CULL/COUNT=0| command.

 Examples of the use of these qualifiers are:\par
\TAB {} |/ELEMENTS=SI|\par
\TAB {} |/elem=(si,o,H)|\par
\TAB {} |/E_SPAN=(H,BE)|\par
\TAB {} |/E_SPAN=(Be,H)| (same as previous)\par
\TAB {} |/ELEMENTS=(H,HE,LI,BE)| (same as previous)\par
\TAB {} |/E_SPAN=(H,BE,C,F)| (specifies two ranges: from H to Be and 
		from C to F.\par

 Note that capitalization is ignored and the elements must be surrounded
 by parentheses and separated by commas, if more than one element is
 specified. For the |/E_SPAN| qualifier, element ranges may be 
 specified in either ascending or descending order. 
 To specify more than one range, specify more than one pair of endpoints.
 If no elements are specified with |/ELEMENTS|, and |/E_SPAN| is not 
 used, the program will prompt for elements.

 The following qualifiers may not be used with |/ELEMENTS| or |/E_SPAN|: 
	|/CARDS|, |/PEAKS|, |/ERROR|, or |/LEVEL|.
 The |/ELEMENTS| or |/E_SPAN| qualifier should be specified before 
 other all other qualifiers. 
\qual 
/COUNT=elm_count\<
/COUNT=(c_min,c_max)\<
/COUNT\par
 Use this qualifier to select entries using the number of unique elements 
 in the chemical formula. The qualifier may be used three ways, if a 
 single value is specified, for example |/COUNT=2|, then entries are 
 selected with that single number of elements. If two values are used, 
 for example |/COUNT=(2,4)| the two numbers represent a range of values,
 in this case 2, 3 or 4 elements are allowed. If no value is specified,
 the computer will prompt for one or more values.

 Note that Cr2O3 . xH2O will be counted as having 3 elements in the
 formula.

 No other qualifiers are allowed with |/COUNT|. 
\qual 
/CARDS=card_list\<
/CARDS\par
 Use this qualifier to select entries using their ICDD-JCPDS entry number.
 The entry number is always a five or six digit number consisting
 of the ``old'' entry number plus 10,000 times the set number. For
 example, entry 413 in set 7 would be coded as:\par
\TAB {} |/CARD=70413| or
\TAB {}	|/CARD=070413|\par
 To specify more than one entry, separate the list with commas and
 enclose the list in parentheses:
\TAB {}	|/CARD=(070413,10001)|

No other qualifiers are allowed with use of the |/CARDS| qualifier.
\qual 
/NAME=compound_name\<
/NAME=mineral_name\par
  A fragment of a chemical or mineral name to be matched. The name 
  listed on an entry must match the |compound_name| fragment letter 
  for letter (lowercase letters will be converted to uppercase). If
  spaces are to be included in the fragment, the fragment should be 
  enclosed in quotation marks (|"|). For example, 
\TAB {} |/NAME=silicon|
\TAB {} |/NAME="silicon oxide"|

  No other qualifiers may be used with |/NAME|.
\qual 
/PEAKS=peak_list\<
/PEAKS\par
 Use this option to select entries based on the location of the
 intense peaks in the pattern. The peak positions must be input
 as either \twotheta\ angles or as d-spaces depending on the 
 current wavelength setting (see command WAVELENGTH). The 
 wavelength setting may be overridden using the |/WAVELENGTH|
 or the |/DSPACE| qualifiers.

 All entries with intense peaks (the intensity threshold is set by
 the |/LEVEL| option) within some region around input peak
 position will be selected. The actual window depends on the
 value(s) used on the |/ERROR| option.  If more than one peak 
 is input, the peaks should be separated by  commas and enclosed 
 in parentheses.  The list of peaks may be used in one of two 
 different ways:
\TAB {} |/OR | An entry with a composition containing any one of the 
		specified peaks is a match.
\TAB {} |/AND| An entry with a composition containing all of the 
		specified peaks is a match.\par
 If no peaks are input, the program will prompt for a list of peaks.

 The following qualifiers may not be used with |/PEAKS|: 
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/COUNT|,
	|/OPTIONAL|, or |/O_SPAN|.
 Specify |/PEAKS| as the first qualifier on the line.
\qual 
/ERROR=error_list\par
 The |error_list| specifies an allowed range for each peak.
 The range is used in one of two ways, depending on mode used by
 the program. If the mode is |/EXACT|, the error range is used
 exactly as specified. For example, If 
	|/PEAK=15.5/ERROR=0.1/EXACT|
 is used, peaks at locations between 15.4 and 15.6 will be 
 selected. The other mode, |/FAST|, may be considerably more rapid
 than |/EXACT|. In |/FAST| mode, the range specified with |/ERROR| 
 is expanded to match spacing of records in the peak index files.
 For example, if the peak index records cover the ranges, 15.15-15.3, 
 15.3-15.45, 15.45-15.6, etc., then if 
	|/PEAK=15.5/ERROR=0.1/FAST|
 is used, then the error range will be expanded to select peaks 
 between 15.3 and 15.6.
 
 An error value may be specified for each peak, but if the number 
 of values in the |error_list| is less than the number of peaks in 
 the |peak_list|, the last error value will be used for all 
 remaining peaks. If the |/ERROR| parameter is not used, the 
 program will prompt for a single error value for all peaks.
 The error value should be specified in the same units (d-space 
 or \twotheta) as the peak positions.

 The |/PEAKS| qualifier must precede this qualifier.
 The following qualifiers may not be used with |/ERROR|:
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/COUNT|,
	|/OPTIONAL|, or |/O_SPAN|.
\qual
/DSPACE\par
 Using this qualifier overrides the current wavelength setting and forces
 peaks to be input as d-spaces. This qualifier cannot be used with 
 |/WAVELENGTH| and will be ignored if used with a qualifier other than 
 |/PEAKS|.
\qual
/WAVELENGTH=wave_length\par
 Using this qualifier overrides the current wavelength setting and forces
 peaks to be input as \twotheta\ angles at |wave_length|\AA. This qualifier 
 cannot be used with |/DSPACE| and will be ignored if used with a qualifier 
 other than |/PEAKS|.
\qual 
/LEVEL=peak_level\par
 Specifies a relative intensity threshold for peak positions specified 
 with the |/PEAKS| qualifier. The threshold value is used slightly 
 differently in |/FAST| mode versus |/EXACT| mode. In |/EXACT| mode,
 the value specifies the exact intensity threshold (in percent relative 
 intensity). For example if |/PEAKS=20.5/ERR=0.1/LEVEL=75/DSPACE/EXACT| 
 is specified, entries with peaks having d-spaces from 20.4 to 20.6 \AA\ 
 with relative intensities of 75\% or greater will be located.
 In |/FAST| mode, the threshold value specifies a peak index to 
 be searched. If there is no peak index at this value, a peak index
 with a lower threshold is used (at 10 \% increments). Thus in the 
 example |/PEAKS=20.5/ERR=0.1/LEVEL=75/DSPACE/FAST|, the error range is 
 opened (see |/ERROR|) and the intensity threshold is also possibly 
 lowered, so that potentially more entries will be selected than in 
 |/EXACT| mode. It is also possible to specify |/LEVEL=3s| in |/FAST| mode.
 This specifies an index of the three strongest peaks in each entry.

 The |/PEAKS| qualifier must precede this qualifier.
 The following qualifiers may not be used with |/LEVEL|:
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/COUNT| 
	|/OPTIONAL|, or |/O_SPAN|.
\qual 
/EXACT\par
 Use |/EXACT| with |/ELEMENTS| to specify that only entries
 containing all of the specified elements and no others
 match as the specified logical criterion. It is possible to widen 
 this criterion so that certain elements are allowed, but not required, 
 using the |/OPTIONAL| and/or |/O_SPAN| qualifiers. 

 Use |/EXACT| with |/PEAKS| to specify that the error range specified
 for peak positions should not be extended, but instead be used as given.
 (See the description given for |/ERROR|.)

 The following qualifiers may not be used with |/EXACT| and |/ELEMENTS|: 
	|/CARDS|, |/NAME|, |/PEAKS|, |/OR|, |/AND|, |/ERROR|, |/FAST| 
	|/LEVEL| or |/COUNT|.

 The following qualifiers may not be used with |/EXACT| and |/PEAKS|: 
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/FAST|, |/COUNT| 
	|/OPTIONAL|, or |/O_SPAN|.
\qual 
/FAST\par
 Use |/FAST| with |/PEAKS| to specify that the error range specified
 for peak positions may be extended for most efficient searching.
 (See the description given for |/ERROR|.)

 The following qualifiers may not be used with |/FAST|: 
	|/CARDS|, |/NAME|, |/ELEMENTS|, |/E_SPAN|, |/OPTIONAL|, |/EXACT|,
	|/COUNT| or |/O_SPAN|.
\qual 
/OR\par
 Use |/OR| with either |/PEAKS| or |/ELEMENTS| to specify that any entry
 containing the specified element or peak is a match for the specified 
 logical criterion.\par
 The following qualifiers may not be used with |/OR|: 
	|/CARDS|, |/NAME|, |/AND|, |/COUNT|, |/OPTIONAL|, or |/O_SPAN|.
 Also, if |/ELEMENTS| and |/OR| are used, |/EXACT| cannot be used.
\qual 
/AND\par
 Use |/AND| with either |/PEAKS| or |/ELEMENTS| to specify that only entries
 containing all of the specified elements or peaks match for the specified 
 logical criterion.\par
 The following qualifiers may not be used with |/AND|: 
	|/CARDS|, |/NAME|, |/OR|, |/COUNT|, |/OPTIONAL|, or |/O_SPAN|.
 Also, if |/ELEMENTS| and |/AND| are used, |/EXACT| cannot be used.
\qual 
/OPTIONAL=optional_list\<
/O_SPAN=opt_range(s)\par
 Use |/OPTIONAL| or |/O_SPAN| with |/ELEMENTS| to specify that only 
 entries containing all of the required elements specified in the 
 |required_list| (see |/ELEMENTS| and |/E_SPAN|) and optionally those 
 in the optional_list, but no others, as the specified logical 
 criterion. |/O_SPAN| is equivalent to |/OPTIONAL| except that ranges
 of elements may be specified.

 Examples of the use of this qualifier are:\par
\TAB {} |/OPTIONAL=SI|\par
\TAB {} |/ig=(si,o,H)|\par
\TAB {} |/O_SPAN=(H,BE)| 
\TAB {} |/O_SPAN=(BE,H)| (equivalent to previous)\par
\TAB {} |/OPTIONAL=(H,HE,LI,BE)| (equivalent to previous)\par
\TAB {} |/O_SPAN=(H,BE,C,F)| specifies two ranges: from H to Be and 
		from C to F.\par
 Note that capitalization is ignored and the elements must be surrounded
 by parentheses and separated by commas, if more than one element is
 specified. 
 Ranges may be specified in either ascending or descending order.
 To specify more than one range, specify more than one pair of endpoints.

 The following qualifiers may not be used with |/OPTIONAL| or |/O_SPAN|: 
	|/CARDS|, |/NAME|, |/PEAKS|, |/FAST|, |/OR|, |/AND|, 
	|/ERROR|, |/COUNT|, or |/LEVEL|.
 Qualifier |/EXACT| is assumed to be present if |/OPTIONAL| or |/O_SPAN|
 is used and thus is optional. |/O_SPAN| may be used with |/OPTIONAL|.\par
%CLD%Define verb READ
%CLD%	Parameter P1, label file_name, value(type=$file)
%CLD%	Qualifier OR
%CLD%	Qualifier AND
%CLD%	Qualifier NOT
%CLD%	Qualifier REPLACE
%CLD%	Disallow ANY2(OR,AND,NOT,REPLACE)
%CLD%	Qualifier SUBPDF, value(required, type=sub_pdf), syntax=no_parms
%CLD%   Qualifier LIST, value(required, type=$file), syntax=no_parms       
%CLD%   Qualifier RANGE, value(list, required, type=$number), syntax=no_parms
%CLD%	Disallow ANY2(SUBPDF,LIST,RANGE)
%CLD%
\Command READ\par
 Reads a table (subfile) written by the WRITE command, prepared 
 using some other program, such as MATCH, or one of the standard 
 ICDD-JCPDS subfiles. The READ command can also be used to read a list of
 entries from a free-format ASCII text file or to select a list of
 entries in a range by number.

\Parameter
\parm
file_name\par
 A single file may be specified on the command line containing the name
 of the file to be read. If the file is not specified, a prompt will be
 given to request a file name to be read. 

 If no file extension is supplied, the default extension is |.USRPDF|

 To read one of the standard subfiles, omit the |file_name| parameter 
 and specify the |/SUBPDF| qualifier. 
\Qualifiers
\qual 
/SUBPDF=sub_file\par
 Use this option to read in one of the standard subfiles, such as the
 the inorganic subfile.

 The available subfiles are: 
\TAB   FULL         all entries in the database
\TAB   NULL         null table (a table without any entries)
\TAB   INORGANICS   Inorganic materials
\TAB   ORGANICS     Materials with a C-H bond
\TAB   COMMON       commonly found materials or phases
\TAB   MINERALS     Minerals, natural and synthetic
\TAB   METALS       metals, alloys and related materials
\TAB   NIST         patterns recorded by NIST (NBS)
\TAB   FORENSIC     materials of forensic interest
\TAB   ZEOLITES     zeolites and molecular sieves
\TAB   DELETED      superceeded but not removed patterns (if any)
\TAB   LOCAL        locally defined patterns (if any)
\TAB   SUPERCON     superconductors and related materials
\TAB   EXPLOSIVES   explosives and related materials
\TAB   EDUCATION    educationally relevant materials
\TAB   CEMENT       materials related to cement production
\TAB   CORROSION    corrosion products and related materials

  Note that the |sub_file| name may be abbreviated by only including
  the initial letters as long as the name is uniquely specified.
  Also, note that by default, ``DELETED'' patterns are not included, 
  unless the |DELETE/INCLUDE| command is used to force inclusion 
  of deleted patterns.

  Do not include a |file_name| parameter if |/SUBPDF| is used.
\qual 
/LIST=list_file\par
  Use this option to read a list of entries from a text file, named
  |list_file| (with default extension |.CARDS|). This file will usually
  be prepared prior to starting LOGIC through use of a text editor or
  with a non-Powder Suite program. 
  The |list_file| contains a list of ICDD-JCPDS entries with one entry 
  entry per line in the file. If an invalid number is used, a warning
  is reported.
  The entry number may entered either with or without a comma separating 
  the set number from the entry number (38,1 and 380001 are equivalent). 
  Comments may be included on each line provided that two commas or 
  are placed before the comment or the comment starts after column 20
  (see below). Blank lines in the file are ignored. A negative set number
  terminates reading the file, but use of a -1 is not required.\par

  Sample |list_file|:\par
{\parskip 0pt\par
  |            380001,,         this is the 1st entry in the list|\par
  | |\par
  |            390001,,         this is the last entry|\par
  |            -1|\par
\parskip 0pt\par}

 The |/LIST| option may not be used with |/SUBPDF| or |/RANGE|.
 Omit the |file_name| parameter if |/LIST| is used.
\qual 
/RANGE=(entry1,entry2)\par
  Create a list with entries starting with |entry1| and ending with
  |entry2|. The number must contain both the set and entry numbers.
  For example |READ/RANGE=(360000-369999)| will select all entries 
  in set 36.
  The |/RANGE| option may not be used with |/SUBPDF|, |/LIST|.
  Omit the |file_name| parameter if |/RANGE| is used.
\qual 
/OR\par
 Specify this option to merge the requested subfile with the current 
 table. Thus, the new current table will contain the entries in either 
 the subfile OR the current table. (|NEW_TABLE = OLD_TABLE .or. SUB_FILE|)

 |/OR| may not be used with |/AND|, |/NOT|  or |/REPLACE|
\qual 
/AND\par
 Specify this option to match the requested subfile against the current 
 table. The new current table will contain the entries in both the subfile 
 AND the current table. (|NEW_TABLE = OLD_TABLE .and. SUB_FILE|)

 |/AND| may not be used with |/OR|, |/NOT| or |/REPLACE|
\qual 
/NOT\par
 Specify this option to cull entries from the requested subfile from 
 the current table. All entries present in the both subfile and the current 
 table will be removed from in the new current table. 
 (|NEW_TABLE = OLD_TABLE .and. .not. SUB_FILE|)

 |/NOT| may not be used with |/OR|, |/AND| or |/REPLACE|
\qual 
/REPLACE\par
 Specify this option to set the new current table to be the same as the 
 requested subfile. (|NEW_TABLE = SUB_FILE|)

 |/REPLACE| may not be used with |/OR|, |/AND| or |/NOT|

%CLD%Define verb TABLES
%CLD%	Qualifier FULL, nonnegatable
%CLD%
\Command TABLES\par
 Prints a table of the d-spaces and chemical name for all entries in 
 the current list on the PS hardcopy listing device. 
 If the wavelength has been set (see command WAVELENGTH), both d-spaces 
 and \twotheta\ angles are printed.
\! (See the descriptions of the |PS_HDEV| and |PS_HCOM| logical names
\! in the Installation Instructions chapter.)
\Qualifiers
\qual 
/FULL\par
 If this qualifier is used, the full ICDD-JCPDS (PDF-2) entry is displayed.
%CLD%Define verb WAVELENGTH
%CLD% 	parameter P1, label=wave_length
%CLD%	Qualifier TARGET, value(type=TARGET_TYPE), syntax=NO_PARAMS
%CLD%	Qualifier WTYPE, nonnegatable,value(type=$number)
%CLD% 	Define syntax NO_PARAMS, noparameters
%CLD%
\Command WAVELENGTH\par
 Peaks positions may be input or output as d-spacings (in \AA) or 
 as \twotheta\ (Bragg) angles corresponding to a given x-ray or neutron 
 wavelength. This command is used to select between d-spacings 
 and angles and to select a wavelength for the latter option.

 The current mode of the program is displayed in the header line at the
 top of the computer screen; the default when the program is started 
 is d-space mode.
\Parameter
\parm
wave_length\par
  A single wavelength value may be specified directly, where |wave_length| 
  is the x-ray or neutron wavelength in \AA. (The |target_type| will be 
  assumed to be |SY| for synchrotron radiation).

  If |0.0| is used for the |wave_length|, the program will enter d-space 
  mode (same as specifying |WAVELENGTH/NOTARGET|).

  If |wave_length| is used, |/TARGET| and |/WTYPE| should not. 
\Qualifiers
\qual 
/TARGET=target_type\<
/TARGET\<
/NOTARGET\par
 Specifies an x-ray target for conventional x-ray sources. 
 The choices for targets are:
 |Cu|, |Mo|, |Ni|, |Co|, |Fe|, |Cr|, |Ag|, |NU|, or |SY|. 
 Specifying |/TARGET| without a |target_type| is equivalent to 
 |/TARGET=CU|. (Capitalization of the target type is ignored.)\par
 If |NU| or |SY| (for neutron or synchrotron radiation) is used, 
 the program prompts for a wavelength. 

 For input/output using d-spacings specify |/NOTARGET|\par

 The |/TARGET| option cannot be specified with a |wave_length| value.\par
\qual 
/WTYPE=wave_type\par
   |wave_type| may be either 1, 2 or 3 which determines 
   the exact value used for the wavelength specified with |/TARGET|.
   The choices are:
\TAB	1 to use \Kalpha1\ radiation 
\TAB	2 to use \Kalpha2\ radiation 
\TAB	3 to use the intensity weighted average of \Kalpha1\ and \Kalpha2\ 
	  radiation.\par
   Specifying |/WTYPE| without a value for |wave_type| is equivalent 
   to specifying |/WTYPE=1|.\par
   This qualifier is ignored if the radiation source has a single 
   wavelength, (e.g. |/TARGET=NU| or |/TARGET=SY|) or a 
   |wave_length| value is specified.
\Examples
\exam
|WAVELENGTH/TARGET=CU/WTYPE=3|\par
	The wavelength will be set to the average of Cu \Kalpha1\ and 
	\Kalpha2.
\exam
|WAVELENGTH/TARGET|\par
	The wavelength will be set to Cu \Kalpha1\ 
\exam
|WAVE/NOTAR|\par
	Peaks positions, etc. will be displayed as d-spaces.
\exam
|WAVE 0.0|\par
	Peaks positions, etc. will be displayed as d-spaces.
\exam
|WAVE 2.5401|\par
	The wavelength will be set to 2.5401\AA.
\exam
|WAVE|\par
	The user will be prompted to choose a wavelength or two use
	d-spacings. 
\exam
|WAVELENGTH/TARGET=NU/WTYPE=3|\par
	The user will be prompted to enter a wavelength; the |/WTYPE=3|
	qualifier will be ignored.\par
%CLD%Define verb WRITE
%CLD%	Parameter P1, label file_name, value(type=$file)
%CLD%	
\Command WRITE\par
 This command writes the current list in a format suitable for use as a 
 ``user supplied'' PDF subfile for program MATCH.
\Parameter
\parm
file_name\par
A single file may be specified on the command line containing the 
name of the file to be written. If the file is not specified, a prompt will
be given requesting a file name to be written.

If no file extension is supplied, the default extension is |.USRPDF|
\Examples
\exam 
 |WRITE MYINDEX.FILE|\par
       This writes file |MYINDEX.FILE| on the current default device and 
       directory.
\exam 
 |WRITE XRAY:[mother.group]myindex|\par
       This writes file |[MOTHER.GROUP]MYINDEX.USRPDF| on device |XRAY|.
\exam 
 |WRITE|\par
       The program will prompt for the name of a file to write.

%CLD%Define type ELEMENT_LIST
%CLD%	keyword H,  keyword HE, keyword LI, keyword BE, keyword B  
%CLD%	keyword C,  keyword N,  keyword O,  keyword F,  keyword NE
%CLD%	keyword NA, keyword MG, keyword AL, keyword SI, keyword P
%CLD%	keyword S,  keyword CL, keyword AR, keyword K,  keyword CA
%CLD%	keyword SC, keyword TI, keyword V,  keyword CR, keyword MN
%CLD%	keyword FE, keyword CO, keyword NI, keyword CU, keyword ZN 
%CLD%	keyword GA, keyword GE, keyword AS, keyword SE,	keyword BR
%CLD%	keyword KR, keyword RB, keyword SR, keyword Y,  keyword ZR 
%CLD%	keyword NB, keyword MO,	keyword TC, keyword RU, keyword RH 
%CLD%	keyword PD, keyword AG, keyword CD, keyword IN, keyword SN 
%CLD%	keyword SB, keyword TE, keyword I,  keyword XE, keyword CS 
%CLD%	keyword BA, keyword LA, keyword CE, keyword PR, keyword ND 
%CLD%	keyword PM, keyword SM, keyword EU, keyword GD, keyword TB 
%CLD%	keyword DY, keyword HO, keyword ER, keyword TM, keyword YB 
%CLD%	keyword LU, keyword HF, keyword TA, keyword W,  keyword RE 
%CLD%	keyword OS, keyword IR, keyword PT, keyword AU, keyword HG 
%CLD%	keyword TL, keyword PB, keyword BI, keyword PO, keyword AT
%CLD%	keyword RN, keyword FR, keyword RA, keyword AC, keyword TH
%CLD%	keyword PA, keyword U,  keyword NP, keyword PU, keyword AM
%CLD%	keyword CM, keyword BK, keyword CF, keyword ES, keyword FM 
%CLD%	keyword MD, keyword NO, keyword LR, keyword LN, keyword AD
%CLD%	keyword 1A, keyword 2A, keyword 3A, keyword 4A, keyword 5A, 
%CLD%	keyword 6A, keyword 7A, keyword 8A, keyword 1B, keyword 2B,
%CLD%	keyword 3B, keyword 4B, keyword 5B, keyword 6B, keyword 7B, 
%CLD%	keyword 8B
%CLD%
%CLD%Define type TARGET_TYPE
%CLD%	keyword CU, keyword MO, keyword NI, keyword CO
%CLD%	keyword FE, keyword CR, keyword AG, keyword SY, keyword NU
%CLD%
%CLD%Define type SUB_PDF
%CLD%	keyword FULL,       keyword NULL
%CLD%	keyword DELETED,    keyword LOCAL
%CLD%	keyword INORGANICS, keyword ORGANICS,  keyword COMMON
%CLD%	keyword MINERALS,   keyword METALS,    keyword NIST  
%CLD%	keyword FORENSICS,  keyword ZEOLITES,  keyword SUPERCON
%CLD%	keyword EXPLOSIVES, keyword EDUCATION, keyword CEMENT
%CLD%	keyword CORROSION
%CLD%
%CLD%Define syntax NO_PARMS
%CLD%	  noparameters
\subrub
Logic Examples
%------------%
%HLP%2 Examples

A few examples are presented to show how LOGIC may be used. Note that 
there may be several ways to achieve the same results [as is shown in
in Example 1(a) and (b).] Also note that the |READ| and 
|WAVELENGTH| commands may not be needed, as the subfile may be
selected when the program starts and the wavelegth may have already
been set appropriately.
 
\! \parskip .0 in {\bf
Example 1(a):
\! }\par\parskip .2 in
  Find all entries in the full database that contain both Si and O and may
  also contain Al and/or H (or neither) The resulting entries are then 
  examined using the |BROWSE| command.

\! \parskip .4 in {\par\parskip=2pt\obeyspaces\obeylines
	|READ/REPLACE/SUBPDF=FULL\_JCPDS|
	|MATCH/ELEMENT=(SI,O)/OPTIONAL=(AL,H)|
	|BROWSE|
\! }

\! \parskip .0 in {\bf
Example 1(b):
\! }\par\parskip .2 in
  Find all entries in the full database that contain both Si and O and may
  also contain Al and/or H (or neither). This yields the same results as 
  Example 1(a).
 
\! \parskip .4 in {\par\parskip=2pt\obeyspaces\obeylines
	|READ/REPLACE/SUBPDF=NULL|
	|MATCH/ELEMENT=(SI,O)/OPTIONAL=(AL,H)|
	|BROWSE|
\! }

\! \parskip .0 in {\bf
Example 2:
\! }\par\parskip .2 in
  Find all entries in the metals section of database that contains Fe
  or Mn and two or three other elements. The entries must have a 30\% or 
  greater intensity peak within approximately 0.25 degrees of 12, 14 
  or 16 degrees and may not have any strong peaks (greater than 70\%) 
  between approximately 5 and 10 degrees. (Angles are \twotheta\ values 
  for Cu \Kalpha1\ radiation).\par
  Two lisings of these entries are made, one with the entry numbers and 
  the other with the most intense three lines permuted and sorted. The 
  first list will be printed and the second list will be displayed on 
  the screen and then optionally printed.
 
\! \parskip .4 in {\par\parskip=2pt\obeyspaces\obeylines
	|READ/REPLACE/SUBPDF=METAL|
	|MATCH/ELEMENT=(FE,MN)/OR|
	|WAVELENGTH/TARGET=CU/WTYPE=1|
	|MATCH/PEAK=(12,14,16)/OR/ERROR=0.25/LEVEL=70/FAST|
	|CULL/PEAK=7.5/ERROR=2.5/LEVEL=30/FAST|
	|INDEX/NAME/PRINT|
	|INDEX/HANAWALT=3|
\! }


\! \parskip .0 in {\bf
Example 3:
\! }\par\parskip .2 in
  For some complex searches, it may be necessary to perform a search in
  sections and save intermediate results on files and finally combine 
  these files. To find all the entries in the ZEOLITE database that 
  contain C plus all the entries in the ORGANIC database that contain
  both Al and Si, it is necessary to perform each search separately.
 
\! \parskip .4 in {\par\parskip=2pt\obeyspaces\obeylines
	|READ/REPLACE/SUBPDF=ZEOLITE|
	|MATCH/ELEMENT=(C)/OR|
	|COMMENT Carbon containing Zeolites|
	|WRITE c-zeol|
	|READ/REPLACE/SUBPDF=ORGANIC|
	|MATCH/ELEMENT=(AL,SI)/AND|
	|COMMENT Alumino-silicate organics|
	|READ/OR c-zeol|
	|COMMENT C-containing Zeolites and Al-Si organics|
\! }
