.lm 6 .rm 68 .ap .p 5,1,8 .blank 2 .lm 55 PM0041.2 .lm 6 .blank 6 .center; M U L A N A .BLANK 3 .CENTER; A. Kreymer, R. Pordes, D. Ritchie .BLANK 3 .CENTER;13 December 1983 .BLANK 12 .CENTER;ABSTRACT .BLANK 3 Mulana in a Fortran progam for analysis of data files generated by the Fermilab RT-11 version of the MULTI online data acquisition system, described in PN-97. .Page .HEADER;MULANA PM0041.2 .HL 1 .C; FUNCTION Mulana is a standard 1977 Fortran program to read a standard format MULTI data file, producing a report of the number and type of records present, as well as checking the data file for correct standard MULTI format. Both the internal form of the records, and the location of the various begin run, end run, and camac list records within the file are examined. Internal flags are available for determining the amount of printout associated with individual records found to be in error. A summary of the numbers of various errors is printed for each data file. The MULTI standard record format, described in PN97 and in Appendix A of this report, consists simply of a header containing record length, event type, and the run and event numbers. The content of the data following this header is not specified by the MULTI standard; therefore, MULANA does not examine it. The programs which examine and test the header are intended to be a useful example of the unpacking and interpretation of such data. MULTI is intended to be a 1977 standard ANSI Fortran program, with the exception of the use of BUFFERIN and C11WRD. Standard Fortran provides no standard routine such as BUFFERIN for reading binary data directly into an array. If MULANA is run on a machine other than the Fermilab Cyber system, the local equivalent routine must be used. On a machine with 16-bit integer type variables, the binary data may be read directly into the IB array. The call to C11WRD, which unpacks the 16-bit words from the 60-bit Cyber word IA buffer, is then unnecessary. .hl 1 .center; RUNNING MULANA Mulana may be run on the Cyber system either as an interactive program, for checking short data files on disk, or as a batch job when analyzing longer data tapes. To use MULANA interactively, .blank 1 ATTACH,TAPE1=datafile. .break ATTACH,MULANA/UN=LIBR. .break MULANA. .break .blank 2 MULANA will prompt you for the number of records per file, the first file number, and the number of files to be analyzed. Reasonable defaults, displayed in the prompt, are obtained by simply typing carriage return at any prompt. From batch, the record and file parameters may be specified on the MULANA execution statement, as shown below. The LABEL statement is shown for a 6250 BPI, labeled tape, with records longer than 512 Cyber words. .break .blank 2 LABEL,TAPE1,VSN=label,D=GE,LB=KL,F=L,PO=R. .break ATTACH,MULANA/UN=LIBR5. .break MULANA,REC=nrecords,FILE=firstfile,NFILE=nfiles. .break .blank 2 The defaults for these are 0#(unlimited) records, starting with FILE 1, and analyzing NFILE=0#(unlimited) files. In addition to REC, FILE, and NFILE, the allowed number of read errors, oversized blocks and oversized recoreds may be set using MERR, MBERR, and MRERR. The defaults for MERR, MBERR and MRERR are 25, 10, and 100, respectively. .hl 1 .center; LIMITS The data arrays are dimensioned to accommodate data blocks of up to 1024 cyber words (about 4096 16-bit words). For larger data blocks, the user must recompile the MULANA source with larger dimensions. In the BUFF common deck, change parameter MIA to the size of the raw cyber data buffer, in cyber words. Set MIB and MIC, the arrays into which MIA is expanded, each to four times MIA. The actual necessary factor is 15/4, but a factor of four is much easier and safer to calculate. .hl 1 .center; PROGRAM ORGANIZATION The program consists of a main routine, 10 subroutines, and three UPDATE format COMDECK common decks. .hl 2 COMDECK BUFF Blank common contains buffers for event input and expansion on the cyber. Common /LENGTH/ contains buffer length information for KIOWA or HBOOK. .hl 2 COMDECK PRTS Common /PRTS/ contains flags to enable printout for events which contain format errors of various sorts. .hl 2 COMDECK STAT Commons in this COMDECK contain all the counters of events, errors, and limits on those errors. .hl 2 DECK MULANA The MULANA deck contains the main routine. Subroutine OPTION is called once, to interpret the parameters on the run card, and to prompt the user for event and file limits. INIT is called at the beginning of each file, to clear the event and error counters. A simple loop calls INPUT to read events, and CHECK to check for proper format. PRINT is called at the end of each file, to print out the event and error counter summaries. .hl 2 DECK OPTION Subroutine OPTION interprets the parameters in the execution statement, if any, to determine event and file limits. If no parameters are present, the session is presumed to be interactive, and the user is prompted for these limits. .hl 2 DECK INPUT Subroutine INPUT reads data blocks into array IA using BUFFERIN, expands the data into integers corresponding to the original PDP11 data in array IB, and unblocks single events into array IC. Single data blocks may contain more than one event record. Because most MULTI data words are interpreted as binary data rather than as signed 16-bit integers, no sign extension is performed on the numbers in IB and IC. The event type must be interpreted as a signed integer, and code to do this is contained in subroutine CHECK. .hl 2 DECK INPUT1 Subroutine INPUT1 is a short version of INPUT, for use where only one record is known to occur in each data block. INPUT1 is considerably simpler and faster than INPUT, in part because only the standard MULTI header words need to be analyzed. .hl 2 DECK SKIPFL Subroutine SKIPFL skips to the next End of File mark on Unit 1, using BUFFERIN, for routine INPUT. .hl 2 DECK CHECK Subroutine CHECK looks for errors in the format of the event records prepared by INPUT. A count is kept of each event type, positive and negative, for types up to 50. Event numbers are checked for proper ordering. Begin and end run records are printed, and checked for proper event number and position within the file. Camac definitions records are checked for position, and are printed. .hl 2 DECK INIT Resets various counters and other variables to zero, called by MAIN at the beginning of each file. .hl 2 DECK PRINT Subroutine PRINT prints event and error counts at the end of each file. .hl 2 DECK PRINTB Subroutine PRINTB prints Begin and End Run records for CHECK. .hl 2 DECK PRINTC Subroutine PRINTC prints Camac definition records for CHECK. .hl 2 DECK ASCHAR Subroutine ASCHAR converts the ASCII characters in the data buffers to a Fortran 77 character type variable, for PRINTB and PRINTC. .appendix RT-11 MULTI Standard Data Format .blank 6 There is no standarf format for Multi-generated data.