|
MTZLIB (CCP4: Library)NAMEmtzlib - Subroutine Library for Reflection data file handlingCONTENTS
DESCRIPTIONThe library mtzlib contains subroutines used for reading, writing and handling the CCP4 reflection data files.All the routines contained in this library are written in ANSI standard FORTRAN 77. The first argument to all the subroutine calls in MTZLIB is MINDX. This mechanism allows more than one pair of MTZ files to be open for read and write at the same time, without the need for separate subroutines. At present a maximum of 8 files can be opened simultaneously (4 for read and 4 for write), but this could be increased easily. The subroutines of a set share an area of storage for the header data (e.g. for the cell parameters, label and title information) so that when an input file has been opened the header information is available for writing to an output file, without being explicitly copied by the calling program. This information may be replaced or new information may be added depending on the requirements of the output file or it may be created if no input file was read. THE MTZ FILE FORMATGeneral descriptionThe MTZ reflection file format uses fixed length logical 'records' written in a byte stream with, in general, four bytes for each data item (REAL*4), with a minimum of 3 columns and currently a maximum of 200 columns of data per record, although these limits could easily be increased. Additional information (title, cell dimensions, column labels, symmetry information, resolution range, history information and, if necessary, batch titles and orientation data) is contained in labelled header records. The columns of the reflection data records are identified by alphanumeric labels held as part of the file header information. The user relates the item names used by the program to the required data items, as identified by the labels, by means of assignment statements in the program control data. Record Formats The file contains basically two classes of records - header records and reflection data records. A standard reflection data file contains the following items, in the order given, not necessarily all items have to be present:
NB: Column Types are an extra check that the user input assignment for a requested program label is of the correct type. For a list of all column types see section COLUMN TYPES. Normally the Miller indices will be held in the first three columns though, within the definition of the format, there is no restriction on the use of the columns of the reflection data records. However, the subroutines which output the MTZ header information in a formatted way (e.g. Subroutine LHPRT) presume that the first 3 columns of a standard MTZ file are the Miller Indices, and the first 5 columns of a multi-record MTZ file are H,K,L,M/ISYM and Batch number. IMPLEMENTING MTZ FILESSource file mtzlib.f contains all the subroutines. These are included in the CCP4 library. It requires subroutines from the library modules `symlib', `diskio', `parser'.STORAGE OF DATA ITEMSThis section describes the way in which some standard data items are stored in an MTZ file.
STANDARD ITEM NAMESStandard names are normally used for the following items:
COLUMN TYPESThe column types are as follows:
DATASETSAn MTZ file can contain many columns of data, and these can often be grouped into distinct "datasets". For example, columns FPH1 SIGFPH1 DPH1 SIGDPH1 for a particular derivative can be considered as part of the same dataset, and distinct from the equivalent columns for the native which may also be present in the file.A dataset is identified by a "project name", which specifies a particular structure determination (and is equivalent to the mmCIF data item _entry.id), and a "dataset name", which specifies the particular crystal or derivative (and is equivalent to the mmCIF data item _diffrn.id). Normally, there will be several datasets with the same "project name" and different "dataset names". The total number of datasets represented in a file is given by the keyword NDIF in the main file header (see above), and a list of the project and dataset names associated with each dataset is given by the PROJECT and DATASET keywords also in the main file header. Each dataset is identified internally by an integer "dataset ID". For a merged single-record-per-reflection MTZ file, each column has as one of its attributes (included in the COL keyword) a "dataset ID", which acts as a pointer to the main list of datasets. For unmerged multi-record MTZ files, a column may be associated with several datasets (corresponding to different batches) and the "dataset ID" is not used. Instead, each batch header contains a "dataset ID", which points to the dataset associated with that batch. The main file header also contains properties of each dataset. Each dataset can have its own cell dimensions identified by the keyword DCELL, e.g. native and derivative crystals may well have significantly different cells. The information held in DCELL records is distinct from the general cell held in the CELL record, and programs may make use of either. A wavelength can also be attributed to each dataset via the keyword DWAVEL. Other dataset information may be added in the future. The records DCELL and DWAVEL are optional; the header reading routines assume that if they are present, then they will occur immediately after the relevant PROJECT and DATASET keywords. In mtzlib, the COMMON blocks /HARINT/, /HARREA/ and /HARCHA/ include 8 variables or arrays for each file or file pair opened. NSETW is the number of datasets, read from the file header keyword NDIF. ENTRY_ID, DIFFRN_ID and SET_ID are the "project name", "dataset name" and "dataset ID" for each dataset, read from the PROJECT and DATASET file keywords. CSET_ID is the dataset pointer for each column read from the COLU file keyword. (The corresponding dataset pointer for batches is held as the variable LBSETID in the COMMON block for that batch.) DCELL and DWAVEL hold the dataset cell and wavelength information. Finally, IDEFSET is a default dataset ID for each file, which is used for associating a dataset with a new column when there is no other information available. Future developmentsIn future, it is planned to work within a hierarchical data model for reflection data. The hierarchy is crystal/dataset/[datalist]/column. The project name will be an attribute of the crystal, and will be used principally for data harvesting. This hierarchy is represented in the MTZ file by the existing PROJECT and DATASET keywords, together with a new CRYSTAL keyword.The new hierarchy will be fully supported in the forthcoming C-language libraries. Meanwhile, there is partial support in MTZLIB, see the LRIDX and LWIDX keywords. However, no programs currently make use of these routines. SUBROUTINES IN MTZLIBThe following subroutines are available.The initialisation routine for the file handling system
Subroutines for reading an MTZ file
Subroutines for writing an MTZ file
Subroutines for multi-record MTZ files
Subroutines for handling Missing Number Flags
Subroutines for handling Project Name and Dataset Name
Utility subroutines
Internal routinesThere are 13 more subroutines which are internal to the package and are included here for completeness, but should not be called by the user program:
Subroutine MTZINIThis Subroutine initialises the MTZ file handling system.This subroutine must be called before any other mtzlib subroutine. Failure to do so may result in unpredictable behaviour. Subroutine LROPEN(MINDX,FILNAM,IPRINT,IFAIL)Subroutine to open an MTZ file for read. This should be the first MTZ subroutine called in a set of operations on a pair of files (i.e. one input and one output). The subroutine zeros all the Header COMMON block entries, opens the specified file and loads the header into the COMMONs, and positions the file ready to read the first data record.Arguments:
External Functions: INTEGER LENSTR
Function:
Subroutine LROPEN checks that nothing is already open for required index
VERS - version of routines which wrote the file could test versions here in the future TITL - read file title NCOL - no. of cols and refls in file and batches in file if no. of batches=0 then this is a standard file CELL - read in the Cell parameters SORT - read in sort order SYMI - various symmetry stuff SYMM - read in the symmetry cards and convert to matrices If present then calls SYMFR3 RESO - resolution limits for the file (1/d-squared) COLU - column labels, types and ranges BATC - batch serial numbers - hopefully only if nbatch >0 END of header card Ignores unrecognised lines. If end of header reached, but no END card, print warning Check no. of column cards input equals NCOLS from 1st line Check correct number of symmetry cards If NBATCH>0 prepare to read the batch headers Loop over the rest of the header lines looking for MTZHIST or MTZBATS as keyword, and proceed accordingly. Finally, hopefully hit the MTZENDOFHEADERS line. Output information with CALL LHPRT(INDEX,IPRINT,IFAIL) (if IPRINT>0) Finally positions the file ready to read reflection records with CALL QSEEK(RLUN(INDEX),1,SIZE1+1,1), where SIZE1 is the size of the first record in the file (which contained the offset). Subroutine LRASSN(MINDX,LSPRGI,NLPRGI,LOOKUP,CTPRGI)Subroutine to apply the input column label assignments to the MTZ file which is open for read and setup the Lookup pointer arrayIf the program is going to allow user input column assignments, then you MUST call subroutine LKYIN to parse these input label assignments, before LRASSN is called, as LKYIN sets up arrays which are then used by LRASSN. Note that user input labels and file labels are case sensitive - the input label must match the file label exactly. Also note that having an unassigned program label is a fatal error, but this subroutine uses LERROR to report this as a warning, so that all the program label assignments can be checked before stopping. Arguments:
External Functions: INTEGER LENSTR
Function:
This subroutine references the internal COMMON Blocks /MTZLBC/
and /MTZLAB/ which are set up by LKYIN.
Subroutine LRBATS(MINDX,NBATX,BATCHX)Return the number of batches and their batch serial numbers from the header of a multi-record MTZ fileArguments:
External Subroutines: LERROR Subroutine LRBRES (MINDX,BATNO)Reset the batch header info pointer to the batch BATNO, for re-read by subroutine LRBAT, for an MTZ file which has been opened for read on index MINDX.Arguments:
External Subroutines: LERROR Subroutine LRCELL(MINDX,CELLP)Return Cell Parameters from header of MTZ file open for read on index MINDXArguments:
External Subroutines: LERROR Subroutine LRCLAB(MINDX,CLABS,CTYPS,NCOL)Return the column labels, column types and number of columns from the header of an MTZ file.Arguments:
External Functions : INTEGER LENSTR
Subroutine LRHIST(MINDX,HSTRNG,NLINES)Return the history information from the MTZ file header.Arguments:
External Functions: INTEGER LENSTR
Subroutine LRINFO(MINDX,VERSNX,NCOLX,NREFLX,RANGES)Return information about the MTZ file open for read on index MINDX.Arguments:
External Subroutines: LERROR Subroutine LRNCOL(MINDX,NCOLX)Return the number of columns in the MTZ file open for read on index MINDX. A simpler call than LRINFO.Arguments:
External Subroutines: LERROR Subroutine LRNREF(MINDX,REFNUM)Return the current reflection number from an MTZ file opened for read. Files are normally read sequentially. The number returned is the number of the *NEXT* reflection record to be read. If you are going to jump about the file with LRSEEK then use this to record the current position before you start, so that it can be restored afterwards, if required.Arguments:
External Subroutines: LERROR Subroutine LRREFF(MINDX,RESOL,ADATA,EOF)Subroutine to read a reflection record from an MTZ file which has been opened for read. This returns the record in `lookup' order (as set by LRASSN). The subroutine also returns the resolution (1/d**2). This resolution calculation only works if there are at least 3 columns in the file and the first 3 have type H, which is the normal case, if not then the RESOL value is set to -1.0.NB: Since the calculation for the resolution is set up when the file is opened (LROPEN) any changes to the unit cell should be made (with LWCELL, where the setup is re-done) BEFORE reflections are read if it is wished that the new cell is used in the resolution calculation. There is a kluge to handle the absence flags defined by the Groningen BIOMOL system: If the MINDX is larger then 1000, then it is assumed that the subroutine is called by a BIOMOL program or another program that is able to interpret the BIOMOL absence flags (e.g. a value of -1.0E+10 indicates absent data). If MINDX is in the normal range of 1 to 3, then the subroutine will convert values of -1.0E+10 to zero to allow normal processing by the CCP4 programs. Arguments: MINDX (I) INTEGER indicates which MTZ file - one index points to both input and output files
External Subroutines: LERROR,QREAD Function:
Check that there is a file open
Subroutine LRREFL(MINDX,RESOL,ADATA,EOF)Read a reflection record from an MTZ file which has been opened for read. This returns the record in `file' order - the physical order of columns in the file rather than the `lookup' order, c.f. LRREFF. Otherwise the same as LRREFF.LRREFL calls the following which are external to MTZLIB: External Subroutines: LERROR,QREAD Function:
Check that there is a file open
Subroutine LRRSOL(MINDX,MINRES,MAXRES)Return the resolution range for the reflections in the MTZ file open for read on index MINDX. (Resolution is 1/d-squared). The resolution limits are calculated when the file is written - no `S' column is required in MTZ files. (See also subroutines LRREFF, LRREFL).Arguments:
External Subroutines: LERROR Subroutine LRSORT(MINDX,SORTX)Return sort order from header of MTZ fileArguments:
External Subroutines: LERROR Subroutine LRSYMI(MINDX,NSYMPX,LTYPEX,NSPGRX,SPGRNX,PGNAMX)Return available symmetry information (other than symmetry operations, for which see LRSYMM) from the MTZ headerArguments:
External Subroutines: LERROR Subroutine LRSYMM(MINDX,NSYMX,RSYMX)Return symmetry operations (if available) from the MTZ headerArguments:
External Subroutines : LERROR Subroutine LRTITL(MINDX,FTITLE,LEN)Return the title and it's length from the header of an MTZ file.Arguments:
External Subroutines: LERROR
Subroutine LRSEEK(MINDX,REFNUM)Move to a specific reflection record in an MTZ file opened for read. Files are normally read sequentially, so this should be viewed as a special case. The file read pointer is positioned so that the next record read with a call to LRREFF or LRREFL will be the one requested.Arguments:
External Subroutines: LERROR, QSEEK Subroutine LRREWD(MINDX)Rewind an MTZ file for re-reading of reflections. The file must already have been opened for read with LROPEN. The file is positioned at the start of the reflection records.Arguments:
External Subroutines: LERROR, QSEEK Subroutine LRCLOS(MINDX)Close an MTZ file which has been opened for readArguments:
External Subroutines: LERROR,QCLOSE Function: Close the file with CALL QCLOSE(RLUN(INDEX)) Mark this index as unoccupied for read Subroutine LWOPEN(MINDX,FILNAM)Open MTZ file for write. This subroutine should be called after the corresponding input file has been opened (i.e. after LROPEN has been called).NB: Every time LROPEN is called it zeros all the header info for that MINDX, and then loads up the header storage with data from the file. Therefore if LWOPEN is called first, and if (e.g.) a title of a history line is added with LWTITL or LWHIST, this info will be lost if it is followed by a call to LROPEN (on the same MINDX). While this is unlikely to occur in most programs, care should be taken with programs which open a large number of input files in sequence and write one output file (and therefore have a sequence of calls like - LROPEN, LWOPEN, LRREFL, LWREFL, LRCLOS, LROPEN, LRREFL, LWREFL, LRCLOS ... LWCLOS) not to update items in the header until the last input file has been opened. Alternatively, if you want to retain the data from the first input header in the output header, you should open the first input file on index 1, and the output file on 1 also, and all subsequent input files on index 2. Arguments:
External Subroutines: LERROR,QOPEN,QMODE,QWRITE Function:
Explicitly pull in the initialise block data here (EXTERNAL MTZINI)
Check for other open files on this index - first read files
If no read file open, then LROPEN has not been called -
initialise all the MTZ header common blocks here - some of these not necc.
if no read file, but do it for consistency
Subroutine LWASSN(MINDX,LSPRGO,NLPRGO,CTPRGO,IAPPND)Setup the column labels and column types for the output MTZ file. This allows for the user to have specified output column assignments.Note that this subroutine changes the values in the header common block, so all information about the input file's labels and types should already have been extracted. If the program is going to allow user output labels, then the subroutine LKYOUT *MUST* be called to parse the output label assignments from the input control data, before LWASSN is called. Also note that the case of the user and/or program output labels is preserved. Arguments:
LWASSN calls the following which are external to MTZLIB:
External Functions : INTEGER LENSTR
Function:
Work out starting column
Subroutine LWCELL(MINDX,CELLP)Write Cell Parameters into the header common block (to be written to the output MTZ file). When this is called the calculation for the resolution is re-initialised for the new cell parameters, therefore this should be called before any reflections are written to the output file (ie before any calls to LWREFL).Arguments:
Subroutine LWCLAB(MINDX,LSPRGO,NLPRGO,CTPRGO,IAPPND)Write the column labels and column types to the header of an output MTZ file. This is simpler than LWASSN as it doesn't look for column assignments and doesn't check back to the input file at all - so the output column labels are exactly what come into this subroutine in CLABS, and the case of the labels is preserved.Arguments:
External Functions : INTEGER LENSTR External Subroutines: LERROR Subroutine LWHIST(MINDX,HSTRNG,NLINES)Write new history lines to history header. History headers have a maximum of NHISTL lines. We write the new NLINES of history to the header and then fill up any free lines with the older lines.Arguments:
Subroutine LWHSTL(MINDX,EXTRA)Write a single line of hstory information to an MTZ file with index MINDX indicating that it was output from the program whose name was previously set with CCPVRS (/CCPRCS) at the current date and time. EXTRA is more information to append to the record (or blank). An example of the information produced might be:From FREERFLAG, 21/ 6/94 18:38:48 with fraction 0.050 ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ CCPVRS arg EXTRAThis is just a simplified interface to LWHIST. The history line will be truncated to 80 characters. Arguments:
External Subroutines: LERROR Function:
Check not too many lines input - if so take first NHISTL lines
Subroutine LWSORT(MINDX,SORTX)Write the sort order of the output file to the MTZ header.Arguments:
External Subroutines: LERROR Subroutine LWSYMM(MINDX,NSYMX,NSYMPX,RSYMX,LTYPEX,NSPGRX,SPGRNX,PGNAMX)Update the symmetry operations and information in the MTZ header.Arguments:
External Subroutines: LERROR,PUTLIN Function:
First deal with symmetry operations - if NSYMX .gt. 0 ie there is already
symmetry info there, print warning with
Subroutine LWTITL(MINDX,NTITLE,FLAG)Update the title of an MTZ file in the header common block.Arguments:
LWTITL calls the following which are external to MTZLIB:
External Functions : INTEGER LENSTR
Subroutine LWREFL(MINDX,ADATA)Write a reflection record to an MTZ file which has been opened for write. Also output column labels etc. should already have been setup using LWASSN.Arguments:
External Subroutines: LERROR,QWRITE
Function:
Check that there is a file open. If everything OK, increment no. of reflection
records written.
Subroutine LWCLOS(MINDX,IPRINT)Close an MTZ file which has been opened for write. The new header information should already have been supplied by calls to other LW* routines. This subroutine writes the MTZ header and its associated history header to the output file, writes a pointer to the headers in the first record of the file, and a machine stamp and closes the file. The headers are actually written at the end of the file.This is one of the most important subroutines in the library. If you do not call this subroutine your output file will be corrupted; it will have no header information and the file will be unreadable. Arguments:
LWCLOS calls the following which are external to MTZLIB:
External Functions : INTEGER LENSTR
Function:
Calculate position of start of header records, and move to it -
Subroutine LRBAT(MINDX,BATNO,RBATCH,CBATCH,IPRINT)Return the header info for the next batch from the multi-record MTZ file (or pair of files) open on index MINDX, and the information in the two arrays RBATCH (for numbers) and CBATCH (for characters).This will also optionally print out all this information in a pretty format. Note that the maximum numbers of batches currently allowed is 1000. Arguments:
LRBAT calls the following which are external to MTZLIB: External Subroutines: LERROR Subroutine LWBAT(MINDX,BATNO,RBATCH,CBATCH)Write the header for batch with serial number BATNO to the MTZ file open for write on index MINDX, batch info stored in the two arrays RBATCH (for numbers) and CBATCH (for characters).If this routine is called at all then it must be called for every batch which is to be output - these batch serial numbers are stored and used in LWCLOS. If it is called with BATNO = 0 this is a flag to say that the output MTZ file will be a standard file, and not a multi-record one, i.e. no batches. After this call no batch information is available to the calling program, so don't call it too soon ! Note that the maximum numbers of batches currently allowed is 1000. Arguments:
External Subroutines: LERROR Function: This subroutine will check whether the number of the current batch which is being written is (1) already present in the output file (ie LWBAT has already been called with this batch number) and (2) less than the serial number of the last batch written (ie the serial numbers are out of order). If 2 batches are the same the program will stop, and if the serial numbers are out of order a flag is set so that they will be sorted by LWCLOS before being written out to the file. Subroutine LRBSCL (MINDX,BATNO,BATSCL,NBATSC)Read batch scale, Bfactor and batch title for batch BATNO from batch headers from multi-record file open on index MINDX
External Subroutines: LERROR Subroutine LRBTIT (MINDX,BATNO,TBATCH,IPRINT)Read batch title for batch BATNO from batch headers from multi-record mtz file open on index MINDXArguments:
Subroutine LWBTIT (MINDX,BATNO,TBATCH)Write batch title and dummy orientation block for batch BATNO to multi-record file open on index MINDXArguments:
Subroutine LWBSCL(MINDX,BATNO,BATSCL,NBATSC)Write batch scale and Bfactor for batch BATNO to batch headers for multi-record file open on index MINDXArguments:
Subroutine LBPRT(IBATCH,IPRINT,RBATCH,CBATCH)Internal MTZ subroutine which copies the batch header information as it is stored in raw form on the files, into the common blocks MBTHDR and CBTHDR, and then calls LBPRTH to make some sense of these numbers.Arguments:
SUBROUTINE EQUAL_MAGIC(MINDX,ADATA,NCOL)Sets an array of NCOL to VAL_MISS(2,MINDX), the appropriate value for the output file.Arguments :
SUBROUTINE IS_MAGIC (VAL_MAGIC,VALTST,LVALMS)Function to test whether a number is "magic". Returns LVALMS TRUE if it is - otherwise LVALMS FALSE.Arguments :
SUBROUTINE RESET_MAGIC(MINDX,ADATA,BDATA,NCOL,VAL_MAGICA,VAL_MAGICB)Resets an array containing Missing value flags VAL_MAGICA to one containing Missing value flags VAL_MAGICB If MINDX > 0 then VAL_MAGICA is taken to be the value of the MNF stored in the MTZ header, for MTZ file MINDX. Else the passed value is taken. The MNF pertaining to the data need not necessarily be the same as that stored in the header. This allows you to list arrays containing Nan entries.Arguments :
SUBROUTINE SET_MAGIC(MINDX,VAL_MAGIC,SETVAL)Subroutine to pass the "magic" value for this mtz file either into the file or back to the calling programArguments :
SUBROUTINE LRREFM(MINDX,LOGMSS)Returns Logical array which flags missing data entries Array DATMSS set in LRREFF and LRREFLArguments :
SUBROUTINE LRIDX(MINDX,PNAME,XNAME,DNAME,ISETS,DATCELL, DATWAVE,NDATASETS)Subroutine to return information for all datasets from the MTZ file header, including crystal names.Arguments :
SUBROUTINE LRIDC(MINDX,PNAME,DNAME,ISETS,DATCELL, DATWAVE,NDATASETS)Subroutine to return information for all datasets from the MTZ file header.Arguments :
SUBROUTINE LRID(MINDX,PNAME,DNAME,ISETS,NDATASETS)As LRIDC, but without cell and wavelength information (for backwards compatbility).Arguments :
SUBROUTINE LWIDX(MINDX,PROJECT_NAME,CRYSTAL_NAME,DATASET_NAME, DATCELL,DATWAVE)Subroutine to add dataset information to the output MTZ file header, including crystal names. Datasets identified by the PROJECT_NAME/DATASET_NAME pair are appended to the MTZ header one at a time. Checks to see if the PROJECT_NAME/DATASET_NAME pair is already included; if so, the dataset is updated with the cell and wavelength information. Redundant datasets are removed in LWCLOS.Arguments :
SUBROUTINE LWIDC(MINDX,PROTEIN_NAME,DATASET_NAME, DATCELL,DATWAVE)Subroutine to add dataset information to the output MTZ file header. Datasets identified by the PROJECT_NAME/DATASET_NAME pair are appended to the MTZ header one at a time. Checks to see if the PROJECT_NAME/DATASET_NAME pair is already included; if so, the dataset is updated with the cell and wavelength information. Redundant datasets are removed in LWCLOS.Arguments :
SUBROUTINE LWID(MINDX,PROTEIN_NAME,DATASET_NAME)As LWIDC, but without cell and wavelength information (for backwards compatbility).Arguments :
SUBROUTINE LRCLID(MINDX,CSETID,NCOL)Subroutine to return the ID of the related dataset for each column of the input MTZ file, as obtained from the header.Arguments :
SUBROUTINE LWIDAS(MINDX,NLPRGO,PNAME,DNAME,IAPPND)Subroutine to associate dataset entry with each column for the output MTZ file. Note that this subroutine changes the values in the header common block, so all information about the input files datasets should already have been extracted.Arguments :
SUBROUTINE LRBSETID (MINDX,BATNO,BSETID)Subroutine to read dataset ID for batch BATNO from batch headers for multi-record file open on index MINDX. If LWBAT has been used, the batch headers in RBATW are used, else those in RBATR are used.Arguments :
SUBROUTINE LWBSETID (MINDX,BATNO,PNAME,DNAME)Subroutine to write dataset ID for batch BATNO to batch headers for multi-record file open on index MINDX. If LWBAT has been used, the batch headers in RBATW are used, else those in RBATR are used.Arguments :
Subroutine LKYIN(MINDX,LSPRGI,NLPRGI,NTOK,LINE,IBEG,IEND)Read standard input lines of the formLABIN <program label>=<file label> ... Use this to read the inputs, and then LRASSN to setup the program label to file label assignments. LKYIN also checks that each assignment set actually contains an input program label on one side of the = sign. This comparison is not case sensitive. If there is no ambiguity, the order in which program and file labels are given may be swapped. Arguments:
External Subroutines: CCPUPC, PUTLIN
Subroutine LKYSET(LSPRGI,NLPRGI,LSUSRJ,KPOINT,ITOK,NTOK,LINE,IBEG,IEND)Parses standard input lines of the form[LABIN] item1=name1 item2=name2 ... This subroutine returns the user input labels to the calling program (LKYIN does not) and the array KPOINT which indicates which of the program labels were assigned user input file labels Note that although this Subroutine looks similar to LKYIN it cannot be called in its place, it simply adds extra functionality. There is no MINDX argument to this call - it is not tied to any particular file(s) and the header common blocks are not affected by this subroutine. See the notes above (LKYIN) about the order of the assignment statements. Arguments:
External Subroutines: CCPUPC, PUTLIN
Subroutine LKYOUT(MINDX,LSPRGO,NLPRGO,NTOK,LINE,IBEG,IEND)Read standard input lines of the formLABOUT LabelFC=userFC LabelPHCAL=userPHCAL ... Use this to read the inputs, and then LWASSN to setup the program label to (new) file label assignments. LKYOUT also checks that each assignment set actually contains an output program label on one side of the = sign. This comparison is not case sensitive. If there is no ambiguity, the order in which program and file labels are given may be swapped. Note that the case of the user output labels is preserved. Arguments:
External Subroutines: CCPUPC, PUTLIN
Subroutine LKYASN(MINDX,NLPRGI,LSPRGI,CTPRGI,LOOKUP)Do column assignments, bypassing the need for keyworded input. This is useful in writing little mtz programs, without using Parser in the main program.Read column assignments and make them, for input MTZ file open for read on index MINDX
It expects to read from stream 5 a line of the form
See the LKYIN section above for the notes on case, and order of input assignments. Arguments:
External Subroutines: PARSER, LERROR Subroutine LHPRT(MINDX,IPRINT)Print out the header information from the MTZ COMMON blocks for the MTZ file open on index MINDX.Arguments:
LHPRT calls the following which are external to MTZLIB:
External Functions : INTEGER LENSTR
Subroutine LPHIST(MINDX)Output the history information from the MTZ file header. This text can be anything the programmer chooses, (but probably program stamps at least).Arguments:
External Functions : INTEGER LENSTR External Subroutines: BLANK,LERROR,PUTLIN Subroutine RBATHD(ILUN,BATCH,RBATCH,CBATCH)MTZLIB internal subroutine to read next batch header from multi-record MTZ file open on unit ILUN, and return it's batch number, plus real and character arrays.Arguments: ILUN (I) INTEGER LUN on which the file is open BATCH (O) INTEGER serial number of this batch RBATCH (O) REAL(*) array into which integer and real batch info is decoded by subroutine this should be equivalenced onto the appropriate COMMON block in the calling program. The first item is nwords,ie how many items in the array, if nword is 0 then only the title is present CBATCH (O) CHARACTER(*)*1 as RBATCH, but for character items - no nwords however; title is 1st 70 chars of CBATCH. RBATHD is call by LROPEN. RBATHD calls the following which are external to MTZLIB: External Subroutines: LERROR,QMODE,QREAD Subroutine WBATHD(ILUN,BATCH,RBATCH,CBATCH)MTZLIB internal subroutine to write batch header to Multi-record MTZ file open for write on ILUN, with batch number BATCH, and data in RBATCH and CBATCHArguments: ILUN (I) INTEGER LUN on which the file is open BATCH (I) INTEGER serial number of this batch RBATCH (I) REAL(*) array from which integer and real batch info is encoded by subroutine this should be equivalenced onto the appropriate COMMON block in the calling program. The first item is nwords,ie how many items in the array, if nword is 0 then only the title is written CBATCH (I) CHARACTER(*)*1 as RBATCH, but for character items - no nwords however; title is 1st 70 chars of CBATCH. WBATHD is called by LWCLOS. WBATHD calls the following which are external to MTZLIB: External Subroutines: QMODE,QWRITE Subroutine LRHDRL(ILUN,LINE)MTZLIB internal subroutine to read one header record from an MTZ file open for read on unit ILUN, and place the result in the character string LINE. All the header lines are 80 characters long and written to the file in 20A4 format, so have to decode from integers to chars QMODE = 0 for the header record (ie bytes)Arguments: ILUN (I) INTEGER LUN on which the file is open, for each MTZ file open this is stored in the RLUN array in MTZWRK LINE (O) CHARACTER*(*) character string containing one header record from the MTZ file
LRHDRL calls the following which are external to MTZLIB:
Subroutine LBPRTH(IBATCH,IPRINT)Internal subroutine to print out the batch header information from the MTZ COMMON blocks /MBTHDR/ and /CBTHDR/ (info already there)Arguments: IBATCH (I) INTEGER batch number IPRINT (I) INTEGER print indicator: meaning: =0 no print =1 print batch title only =2 also print orientation block .GT. 30 also print orientation block TO UNIT NUMBER IPRINT LBPRTH is called by LBPRT. LBPRTH calls the following which are external to MTZLIB: External Subroutines: BLANK,PUTLIN Subroutine LABPRT(LABELS,NLABS)Internal subroutine for MTZ routines to output an array of character strings across the page nicely eg labels or types.Uses subroutine PUTLIN to output to window CURWIN. Arguments: LABELS (I) CHARACTER*(*) array of dimension (NLABS) containing the character strings to be output NLABS (I) INTEGER number of labels to be output LABPRT calls th following which are external to MTZLIB:
External Functions : INTEGER LENSTR
Subroutine SORTUP(N,A,IN)Internal subroutine to return order of A in IN - Index Sort, for integer array. Lifted from STILLS program (MOSCO suite).Ref: Comm. ACM VOL.12 #3 MARCH 1969, R.C.SINGLETON Arguments: N (I) INTEGER dimension of arrays A and IN A (I) INTEGER array to be sorted IN (O) INTEGER index array for A Subroutine ADDLIN(NEWLIN,LINES,MAXLIN)Internal subroutine to add new lines from NEWLIN to array LINESArguments: NEWLIN(MAXLIN) (I/O) character array this is cleared on output LINES(MAXLIN) (O) character array INTEGER Function NEXTLN(LINES,MAXLIN)Internal integer function to find the next empty line in a character arrayArguments: LINES(MAXLIN) (I) character array NEXTLN (O) INTEGER number of next blank line (= -1 if full) Subroutine LSTRSL(MINDX,A,B,C,ALPHA,BETA,GAMMA)Internal subroutine to calculate coefficients for (sin(theta)/lambda)**2 from h,k,l for general axes.First calculate the components of input axes in an orthonormal basis, then calculate components of reciprocal axes in same basis Input angles are in degrees This is exactly the same as the subroutine SETRSL in SYMLIB, except that it stores its variables in the internal MTZ COMMON blocks, and will work if more than one file is open at once. MINDX (I) INTEGER indicates which MTZ file - one index points to both input and output files A,B,C,ALPHA,BETA,GAMMA (I) REAL cell parameters REAL FUNCTION LSTLSQ(MINDX,IH,IK,IL)Internal real function to calculate (sin(theta)/lambda)**2 from h,k,l; coef's set by call to LSTRSL, for the file open on index MINDXThis is exactly the same as the function STHLSQ in SYMLIB, except that it stores it's variables in the internal MTZ COMMON blocks, and will work if more than one file is open at once. MINDX (I) INTEGER indicates which MTZ file - one index points to both input and output files IH,IK,IL (I) INTEGER Miller indices for the reflection MTZ INTERNAL COMMON BLOCKSThe following common blocks used by MTZLIB are listed here for completeness: MTZCHR, MTZHDR, MTZWRC, MTZWRK, MBTHDR, CBTHDR, MTZHARC C - Parameters, COMMON blocks, and declarations for MTZ subroutines C C .. Parameters .. INTEGER MFILES,MCOLS,MBATCH PARAMETER (MFILES=4,MCOLS=500,MBATCH=5000) INTEGER MINCOL PARAMETER (MINCOL=3) INTEGER NTYP,LTYP PARAMETER (NTYP=16,LTYP=9) INTEGER MBLENG,CBLENG PARAMETER (MBLENG=185,CBLENG=70+3*8) INTEGER NHISLM PARAMETER (NHISLM=30) C .. C .. Arrays in Common .. REAL CELL,CRANGE,SRANGE,RBATR,RBATW,RSYM,WRANGE,WSRNGE INTEGER BATNUM,HDRST,ISORT,NBATCH,NBATR,NBATW,NCOLS,NCOLW,NHISTL, + NPLABS,NREFR,NREFS,NREFW,NSPGRP,NSYM,NSYMP,RLUN,RPOINT, + WLUN,WOMBAT,NSETW,SET_ID,CSET_ID,IDEFSET LOGICAL SORTB CHARACTER CBATR*1,CBATW*1,CTYPE*1,LTYPE*1,PGNAM*10,SPGNAM*10, + CLABEL*30,PLABS*30,TITLE*70,HSCR*80,ENTRY_ID*64, + DIFFRN_ID*64 C .. C .. Local Arrays .. CHARACTER CTYPES(NTYP)*1,LTYPES(LTYP)*1 C .. C .. Common blocks .. COMMON /MTZCHR/TITLE(MFILES),CLABEL(MCOLS,MFILES), + CTYPE(MCOLS,MFILES),SPGNAM(MFILES),LTYPE(MFILES), + CBATR(CBLENG,MBATCH,MFILES),PGNAM(MFILES) COMMON /MTZHDR/CELL(6,MFILES),NSYM(MFILES),NSYMP(MFILES), + RSYM(4,4,192,MFILES),NCOLS(MFILES),NREFS(MFILES), + NBATCH(MFILES),BATNUM(MBATCH,MFILES),ISORT(5,MFILES), + CRANGE(2,MCOLS,MFILES),NSPGRP(MFILES), + RBATR(MBLENG,MBATCH,MFILES),SRANGE(2,MFILES) COMMON /MTZWRC/PLABS(MCOLS,MFILES),HSCR(NHISLM,MFILES), + CBATW(CBLENG,MBATCH,MFILES) COMMON /MTZWRK/NCOLW(MFILES),RLUN(MFILES),WLUN(MFILES), + RPOINT(MCOLS,MFILES),WRANGE(2,MCOLS,MFILES),NREFW(MFILES), + NREFR(MFILES),NPLABS(MFILES),NBATW(MFILES),NBATR(MFILES), + WOMBAT(MBATCH,MFILES),HDRST(MFILES),SORTB(MFILES), + NHISTL(MFILES),RBATW(MBLENG,MBATCH,MFILES),WSRNGE(2,MFILES) COMMON /MTZHAR/NSETW(MFILES),SET_ID(MSETS,MFILES), + ENTRY_ID(MSETS,MFILES),DIFFRN_ID(MSETS,MFILES), + CSET_ID(MCOLS,MFILES),IDEFSET(MFILES) C .. C .. Data statements .. DATA CTYPES/'H','J','F','D','Q','P','W','A','B','Y','I','R', + 'G','K','L','M'/ DATA LTYPES/'P','A','B','C','I','F','R','H','?'/ Common blocks used by multi-record MTZ routines: These subroutines pass the batch header information (title and orientation blocks) as arguments packed into a REAL(185) and a CHARACTER(94) array. In the real array, the first 156 words are REAL numbers and the remaining 29 are INTEGER*4. The subroutine which produces formatted output of the batch headers, LBPRT, decodes these arrays into separate items by copying these arrays into common blocks (one for real and one for characters), and calling a subroutine (LBPRTH) which has these common blocks as COMMON /MBTHDR/ NWORDS,NINTGR,NREALS,IORTYP,LBCELL(6),MISFLG, + JUMPAX,NCRYST,LCRFLG,LDTYPE,JSCAXS,NBSCAL,NGONAX,LBMFLG, + NDET,LBSETID,INTPAD(8), + CELL(6),UMAT(3,3),PHIXYZ(3,2),CRYDAT(12),DATUM(3), + PHISTT,PHIEND,SCANAX(3),TIME1,TIME2, + BSCALE,BBFAC,SDBSCL,SDBFAC,PHIRANGE,BATPAD(11), + E1(3),E2(3),E3(3), + GONPAD(12),SOURCE(3),S0(3),BEMDAT(25), + DX1,THETA1,DETLM1(2,2),DX2,THETA2,DETLM2(2,2),DETPAD(33) INTEGER NWORDS,NINTGR,NREALS,IORTYP,LBCELL,MISFLG, + JUMPAX,NCRYST,LCRFLG,LDTYPE,JSCAXS,NBSCAL,NGONAX,LBMFLG, + NDET,LBSETID,INTPAD REAL CELL,UMAT,PHIXYZ,CRYDAT,ETAD,DATUM, + PHISTT,PHIEND,PHIRANGE,SCANAX,TIME1,TIME2, + BSCALE,BBFAC,SDBSCL,SDBFAC,BATPAD,E1,E2,E3,GONPAD, + SOURCE,S0,BEMDAT,ALAMBD,DELAMB,DELCOR,DIVHD,DIVVD, + DX1,THETA1,DETLM1,DX2,THETA2,DETLM2,DETPAD,ETADH,ETADV COMMON /CBTHDR/ BTITLE,GONLAB(3) CHARACTER BTITLE*70, GONLAB*8 An explanation of the format of the common blocks: Orientation block data This contains slots for all information that seems to be essential at present. Each group of parameters is padded at the end for future expansion.
Data in the orientation block are referred to the Cambridge laboratory axis
frame: x along the (idealized) X-ray beam, z along usual rotation axis E1
(omega on 3-axis system). The matrix Q converts a vector in the Madnes frame
to the Cambridge frame. Note that the laboratory frame is essentially defined
by the vectors e1,e2,e3 and source. It doesn't really seem necessary to carry
through a whole lot of crystal and beam tensors, particularly as we have
integrated intensities at this stage, but maybe someone will want to, using
the allocated padding
x = R M U B h where x position in laboratory frame R goniostat matrix M missetting angle matrix (if relevant, see MISFLG) PhiZ PhiY PhiX (PHIXYZ) U crystal orientation matrix UMAT B cell orthogonalization matrix, derived from cell dimensions h reflection indices Note that the description below is NOT is the same order as in the common block, in which all the integers come before all the reals (flagged as I or R in the description below) I NWORDS number of words in orientation block I NINTGR number of integers (first part of block includes these counts) I NREALS number of reals I IORTYP type of orientation block (for possible future use, now = 0) I INTPAD(8) padding for future use (integers) --- Information for this crystal R CELL(6) cell dimensions (A and degrees) I LBCELL(6) refinement flags for cell dimensions R UMAT(3,3) orientation matrix U. If MISFLG .gt. 0, U is the standard setting when PhiXYZ ==0 I MISFLG status of missetting angles PHIXYZ = 0 PHIXYZ not used, all orientation in UMAT = 1 1 set of missetting angles (PHIXYZ(I,1)) = 2 2 sets PHIXYZ(I,J), J=1,2 R PHIXYZ(3,2) missetting angles at beginning and end of rotation I JUMPAX reciprocal axis closest to principle goniostat axis E1 (only used for printing) I NCRYST crystal number: a crystal may contain several batches I LBSETID dataset number (this indexes a list of datasets in the file header) I LCRFLG type of crystal mosaicity information (=0 for isotropic, =1 anisotropic) *** CRYDAT(12) equivalenced to following *** R ETAD reflection width (full width) (degrees) (if LCRFLG=0) or R ETADH,ETADV horizontal and vertical reflection width (if LCRFLG=1) R rest of CRYDAT: padding for crystal information (eg more complicated mosaicity model) --- Information for this batch I LDTYPE type of data = 1 oscillation data (2D spots) = 2 area detector data (3D spots) = 3 Laue data R DATUM(3) datum values of goniostat axes, from which Phi is measured (degrees) R PHISTT,PHIEND start and stop values of Phi (degrees) relative to datum R PHIRANGE range of Phi values: typically this will be PHIEND-PHISTT, but storing this explicitly allows a distinction eg between a rotation of +160 degrees from a rotation of -200 degrees I JSCAXS goniostat scan axis number (=1,2,3, or =0 for multiple axis scan R SCANAX(3) rotation axis in laboratory frame (not yet implemented: only relevant if JSCAXS=0) R TIME1, TIME2 start and stop times in minutes I NBSCAL number of batch scales and Bfactors plus SD's (4 at present, BSCALE, BBFAC and sd's) set = 0 if batch scales unset R BSCALE batch scale R BBFAC batch temperature factor. corresponding scale is exp(-2 B (sin theta/lambda)**2) R SDBSCL sd (Bscale) R SDBFAC sd (BBfac) R BATPAD(11) padding for batch information --- Crystal goniostat information I NGONAX number of goniostat axes (normally 1 or 3) I E1(3),E2(3),E3(3) vectors (in Cambridge laboratory frame, see below) defining the NGONAX goniostat axes C GONLAB(3) names of the three goniostat axes R GONPAD(12) padding for goniostat information --- Beam information R SOURCE(3) Idealized (ie excluding tilts) source vector (antiparallel to beam), in Cambridge laboratory frame R S0(3) Source vector (antiparallel ! to beam), in Cambridge laboratory frame, including tilts I LBMFLG flag for type of beam information following = 0 for ALAMBD, DELAMB only (laboratory source) = 1 ALAMBD,DELAMB,DELCOR,DIVHD,DIVVD (synchrotron) (other options could include white beam) *** BEMDAT(25) equivalenced to following *** R ALAMBD Wavelength in Angstroms R DELAMB dispersion Deltalambda / lambda. R DELCOR Correlated component of wavelength dispersion. R DIVHD Horizontal beam divergence in degrees. R DIVVD Vertical beam divergence (may be 0.0 for isotropic beam divergence. R rest of BEMDAT: padding for beam information --- Detector information I NDET number of detectors (current maximum 2) -- for each detector R DXn crystal to detector distance (mm) R THETAn detector tilt angle (=Madnes:tau2) (degrees) R DETLMn(2,2) minimum and maximum values of detector coordinates (pixels) (i,j): i = 1 minimum, = 2 maximum j = 1 Ydet, = 2 Zdet R DETPAD(34) padding for detector information If you want to see an example of this, look at the subroutines LBPRT and LBPRTH. C INTERFACEJan Pieter Abrahams has written a C interface to MTZLIB which is incorporated into the solomon program.A new C-language library, which includes functions for reading and writing MTZ files, is under development, see the new library page. EXAMPLE PROGRAM USING AN MTZ FILE(See also the program templates available on the CCP4 developer's pages.)PROGRAM example_MTZ C =================== C C---- An example of a program reading and writing MTZ files.C C C .. Parameters .. INTEGER MCOLS, NPAR, NLOC PARAMETER (MCOLS=500, NPAR=200, NLOC=50) C .. C .. Scalars for Parser .. INTEGER NTOK LOGICAL LEND CHARACTER KEY*4,LINE*400 C .. C .. Arrays for Parser .. REAL FVALUE(NPAR) INTEGER IBEG(NPAR),IDEC(NPAR),IEND(NPAR),ITYP(NPAR) CHARACTER CVALUE(NPAR)*4 C .. C .. Local Scalars .. REAL EPS,F1,F2,FLAGIP,FLAGOP,RSOL INTEGER ALLSYM,I,IC,ICALL,ICEN,IERR,IFIL,II,ILEN,IPRINT,ISYSAB, + JDO10,JDO30,JDO40,JQ,NCEN,NCHK,NCOL,NEPS,NLPRGI,NLPRGO, + NREF,NSYM,NSYSAB,NLUSRI,NLURSO CHARACTER DUMMY*10,TITNEW*70 LOGICAL EOF C .. C .. Local Arrays .. REAL ADATA(MCOLS),DUM(2,MCOLS),RSYM(4,4,192) INTEGER IH(3),JPOINT(NLOC),LOOKUP(NLOC) CHARACTER OUTTYP(NLOC)*1,LSPRGI(NLOC)*30,LSPRGO(NLOC)*30, + HISNEW(20)*80,CTPRGI(NLOC)*1 C .. C .. External Subroutines .. EXTERNAL CCPUPC,CENTR,EPSLON,LRASSN,LRINFO,LROPEN,LRREFF, + LRSYMM,LRTITL,LWASSN,LWCLOS,LWHIST,LWOPEN,LWREFL,LWTITL, + PARSER,SYMTRN,LKYIN,LKYOUT C .. C .. Data statements .. C---- NLPRGI = number of input labels DATA NLPRGI,LSPRGI/7,'H','K','L','F1','SIG1','DELF1', + 'SIGDELF1',43*' '/ C---- NLPRGO = number of output labels DATA NLPRGO,LSPRGO/9,'H','K','L','FP','F1','SIG1','SIGFP', + 'FN','SIGFN',41*' '/ C---- This code signs which input columns are essential (LOOKUP) DATA CTPRGI/'H','H','H','F','Q','F','Q',43*' '/ DATA OUTTYP/'H','H','H','F','Q','F','Q','F','Q',41*' '/ DATA LOOKUP/-1,-1,-1,-1,-1,-1,0,43*0/ C---- Clear character arrays TITNEW, HISNEW, JPOINT DATA HISNEW/20*' '/, JPOINT/50*0/ C .. CALL CCPFYP CALL MTZINI NTOK = NPAR IFIL = 1 IPRINT = 3 C---- Open input file for Read CALL LROPEN(IFIL,'HKLIN',IPRINT,IERR) C---- Open output file CALL LWOPEN(IFIL,'HKLOUT') C---- Default is to copy input title to output C---- Do you want to change title?? TITNEW = 'A test case for reading and writing MTZ files' CALL LWTITL(IFIL,TITNEW,0) C---- Some history to append to output file C Only last 30 lines will be kept HISNEW(1) = ' Calculating F(+) F(-) - MTZRW_NEW' HISNEW(2) = ' Some more info...' CALL LWHIST(IFIL,HISNEW,2) C---- Find out how many columns and reflections in input file CALL LRINFO(IFIL,DUMMY,NCOL,NREF,DUM) C---- We want to set up centric and epsilon tests ALLSYM = 0 CALL LRSYMM(IFIL,NSYM,RSYM) CALL SYMTRN(NSYM,RSYM) CALL CENTRIC(NSYM,ISYM,0) C---- Read Program labels here if you like or C use those assigned in data stt above... C C Eg as in FFT F1 SIG1 F2 SIG2 PHI .... C C LKYIN will read string F1=FNAT89 PHI=Acalc ... C LRASSN will set LOOKUP(i) (i=1-nlabs) equal C column number in input file. C LOOKUP(i)=0 if label not matched... NLUSRI = 0 NLUSRO = 0 20 CONTINUE LINE = ' ' KEY = ' ' NTOK = NPAR CALL PARSER(KEY,LINE,IBEG,IEND,ITYP,FVALUE,CVALUE,IDEC,NTOK,LEND, + .FALSE.) IF (.NOT.LEND) THEN IF (KEY.EQ.'LABI') THEN CALL LKYIN (IFIL,LSPRGI,NLPRGI,NTOK,LINE,IBEG,IEND) CALL LRASSN(IFIL,LSPRGI,NLPRGI,LOOKUP,CTPRGI) ELSE IF (KEY.EQ.'LABO') THEN CALL LKYOUT(IFIL,LSPRGO,NLPRGO,NTOK,LINE,IBEG,IEND) CALL LWASSN(IFIL,LSPRGO,NLPRGO,OUTTYP,0) END IF GO TO 20 END IF C---- Now read data (`lookup' order) WRITE (6,FMT=*) ' NREF= ',NREF DO 40 JDO40 = 1,NREF CALL LRREFF(IFIL,RSOL,ADATA,EOF) IH(1) = ADATA(1) IH(2) = ADATA(2) IH(3) = ADATA(3) C centricity check CALL CENTR(IH,ICEN) IF (ICEN.EQ.1) THEN NCEN = NCEN + 1 IF (NCEN.LT.21) WRITE (6,FMT='(A,3I4,F8.2)') ' CENTRIC ',IH END IF C---- EPS = multiplicity of reflection. ISYSAB = 1 - systematic absence CALL EPSLON(IH,EPS,ISYSAB) IF (EPS.GT.1.0) THEN NEPS = NEPS + 1 WRITE (6,FMT='(/,A,3I4,F8.2)') ' EPS GT 1 ',IH,EPS IF (ISYSAB.EQ.1) THEN NSYSAB = NSYSAB + 1 WRITE (6,FMT='(/,A,3I4,F8.2)') ' SYS ABS ',IH END IF END IF NCHK = MOD(JDO40,500) IF (NCHK.EQ.1) THEN IH(1) = ADATA(1) IH(2) = ADATA(2) IH(3) = ADATA(3) WRITE (6,FMT=6004) JDO40,IERR,IH, (ADATA(II),II=4,NCOL) END IF C---- Do something ..... F1 = (ADATA(4)+ADATA(6))/2 F2 = (ADATA(4)-ADATA(6))/2 ADATA(6) = F1 ADATA(7) = ADATA(5) ADATA(8) = F2 ADATA(9) = ADATA(5) C---- New write routine IF (NCHK.EQ.1) WRITE (6,FMT=6006) JDO40, + (ADATA(II),II=1,NLPRGO) IERR = -1 ICALL = ICALL + 1 CALL LWREFL(IFIL,ADATA) 40 CONTINUE WRITE (6,FMT=6008) NCEN,NEPS,NSYSAB C---- Close output file - This call actually writes the header CALL LWCLOS(IFIL,2) CALL CCPERR(0, 'Normal termination') C---- Format statements 6000 FORMAT (' No assignment using default of ',A) 6002 FORMAT (' index for MLABSO = ',I4,' prog lab ',A,' user label ',A) 6004 FORMAT (' NREF IEND - IP DATA ',I8,I3,/1X,3I4,10F8.1, + 10 (/13X,10F8.1)) 6006 FORMAT (' NREF OP DATA ',I8,/1X,3F6.2,10F8.1,10 (/13X,10F8.1)) 6008 FORMAT (' END OF FILE - NUMBER OF CENTRIC REFLNS',I5,/' NUMBER O', + 'F EPS GT 1 ',I5,/' NUMBER OF SYS ABS ',I5) END AUTHORS AND HISTORYSandra McLaughlin and Howard Terry (EMBLHH) November 1989Header handling revised: SMM November 1990 Multi-record routines: SMM Feb 1990 Symmetry handling routines: Eleanor Dodson (York) First limited release to an unsuspecting public May 1991 Missing Number Flag routines: 1996-ish Dataset handling: Martyn Winn 1998-2002
|