C This data set, DOCSECD, is the last part of Section D of the SPARC00010007 C*********************************************************************** C COPYRIGHT ATLANTIC RICHFIELD COMPANY 1991 * C*********************************************************************** C Programmer's Guide. As such, when printing the entire manual, 00020007 C it should come after PTABDEF. 00030007 C 00040007 CTITLECOMMON /SYSTEM/ 00050007 CA 00060007 CA The SYSTEM common area contains values which are unique to each 00070007 CA computer system on which SPARC is executed. It is used to 00080007 CA recognize the computer system and the byte length of words. The 00090008 CA common statement normally appears as: 00100008 CA 00110007 CA COMMON /SYSTEM/ SYSTEM, SYBYPW, SYLOCF, JAPNMS 00120008 CA 00130007 CA The descriptions are: 00140008 CA 00150007 CA SYSTEM - character code for computer system, IBM or CRAY. Any 00160008 CA checks for IBM should limit the test to three 00170008 CA characters because, in the past, the fourth character 00180008 CA has contained a value other than blank. 00190008 CA 00200008 CA SYBYPW - contains the integer value for the number of bytes per 00210008 CA word. On IBM the value is 4 and on the CRAY it is 8. 00220008 CA 00230008 CA SYLOCF - contains the integer value used to indicate the change 00240008 CA in location from one word to the next contiguous word. 00250008 CA The main use of SYLOCF is to compute a Fortran index 00260008 CA into an array when the function LOC returns different 00270008 CA values based on the computer system (bytes on IBM and 00280008 CA words on the CRAY). For example: 00290008 CA 00300008 CA IDTIME = (LOC(KPTIME) - LOC(KPNA)) / SYLOCF 00310008 CA 00320008 CA On the IBM the value is 4 and on the CRAY it is 1. 00330008 CA 00340008 CA JAPNMS - contains the jobname and step name. This variable 00350008 CA contains 16 bytes of information and is therefore 00360008 CA usually dimensioned as an integer array with four 00370008 CA elements. 00380008 CA 00390008 CA Because of the use of this common area throughout SPARC, it may 00400008 CA also appear in other applications which use SPARC routines. One 00410008 CA example is the SPARC simulator program, P1SSIM, which is the part 00420008 CA of the plotting system used to produce fully annotated paper plots.00430008 CA P1SSIM calls FOIP to establish a SEISPARM file and FOIP references 00440008 CA SYSTEM. 00450008 CAEND 00460007 CTITLECOMMON /LHEADR/ 00470008 CA 00480008 CA The LHEADR common area is used to establish an area to save HEAD 00490008 CA cards and thereby create the line header for ARCY data sets. This 00500008 CA common area is initialized by subroutine COMINIT. A Fortran block 00510008 CA data is no longer used for initialization because of problems in 00520008 CA generating the executable load modules on both the IBM and CRAY. 00530008 CA 00540008 CA See COMINIT for a further description. 00550008 CAEND 00560008 CTITLECOMMON /SPOOL/ 00570008 CA 00580008 CA The SPOOL common area is used by process WRIT to control the use 00590008 CA of the tape spooling function. The common area is initialized by 00600008 CA subroutine COMINIT and contains two arrays of ten elements each. 00610008 CA The definitions are 00620008 CA 00630008 CA SPTAF (10) - flag indicating if the output tape has been 00640008 CA allocated. Indices 1 to 10 correspond to WRIT 00650008 CA process numbers (KPRNO) 0 to 9. The final value 00660008 CA for each element using spooling is the number of 00670008 CA occurrences of that process number. 00680008 CA 00690008 CA SPVOL (10) - a blank common index to the last volume serial 00700008 CA number for each spool member. Indices 1 to 10 00710008 CA correspond to WRIT process numbers (KPRNO) 0 to 9. 00720008 CA Only elements corresponding to a process number 00730008 CA specifying spooling are used. 00740008 CAEND 00750008 CTITLEProcess Table Common Areas (MPTABI, MPTABC, JUSTKY, SORTKY) 00760009 CA 00770009 CA These common areas, defined in subroutine FJPTAB, replace the old 00780009 CA usage of PTABMSTR. They are used to define I/O processes, specify 00790009 CA sort/justification keys for each process, indicate if the process 00800011 CA is in the fully linked PREP or PROC modules, etc. 00801012 CA 00820010 CA The actual process table is split into two common areas because the00830010 CA CRAY does not allow character and integer data to be mixed in a 00840009 CA common area. The common areas for the process table, MPTABC 00850010 CA (character data) and MPTABI (integer data), each contain a two 00860010 CA dimensional array to hold the information on the SPARC processes 00870010 CA defined as follows: 00880010 CA 00890009 CA COMMON /MPTABC/ PTABC(5,250) 00900009 CA CHARACTER*4 PTABC 00910009 CA PTABC ( 1, N) = process name (KPNA) 00920009 CA PTABC ( 2, N) = justification/sort key (2 characters each) 00930009 CA PTABC ( 3, N) = computer code (I, C, IC) 00940011 CA PTABC ( 4, N) = future use 00950009 CA PTABC ( 5, N) = future use 00960009 CA 00970009 CA COMMON /MPTABI/ NPTAB,PTABI(14,250) 00980009 CA INTEGER NPTAB 00990009 CA INTEGER PTABI 01000009 CA NPTAB = number of processes actually in arrays PTABC 01010009 CA and PTABI 01020009 CA PTABI ( 1, N) = 0 - no PREP; 1 - PREP; 2 - in fully linked PREP01030013 CA PTABI ( 2, N) = 0 - no PROC; 1 - PROC; 2 - in fully linked PROC01040013 CA PTABI ( 3, N) = blank common requirement (0 - call JSCORE) 01050009 CA PTABI ( 4, N) = maximum number of times process may appear in a01060009 CA job 01070009 CA PTABI ( 5, N) = I/O flag: 0 - no I/O 01080009 CA 1 - PROC step input 01090009 CA 2 - PROC step output 01100009 CA 3 - PREP step input 01110009 CA 4 - possible PREP step input 01120009 CA PTABI ( 6, N) = default return flag (KPDRTF) 01130009 CA PTABI ( 7, N) = last output trace flag (KPLOTF) 01140009 CA PTABI ( 8, N) = more input trace flag (KPMITF) 01150009 CA PTABI ( 9, N) = trace array manager flag (KPTAMF) 01160009 CA PTABI (10, N) = future use 01170009 CA PTABI (11, N) = future use 01180009 CA PTABI (12, N) = future use 01190009 CA PTABI (13, N) = future use 01200009 CA PTABI (14, N) = future use 01210009 CA 01220010 CA The SORTKY and JUSTKY common areas contain the actual sort and 01230010 CA justification keys and are defined in a BLOCK DATA contained at 01240010 CA the end of subroutine FJPTAB. They are defined as follows: 01250010 CA 01260010 CA PARAMETER (NCOLS=15, NKEYS=15, NLINES=3) 01270010 CA COMMON /JUSTKY/ JKEY, JKEYID 01280010 CA COMMON /SORTKY/ SKEY, SKEYID 01290010 CA INTEGER JKEY (NCOLS, NLINES, NKEYS) 01300010 CA INTEGER JKEYID (NKEYS) 01310010 CA INTEGER SKEY (NCOLS, NLINES, NKEYS) 01320010 CA INTEGER SKEYID (NKEYS) 01330010 CA 01340010 CA JKEYID (N) = justification key id 01350010 CA JKEY (NCOLS, 1, N) = beginning column numbers 01360010 CA JKEY (NCOLS, 2, N) = ending column numbers 01370010 CA JKEY (NCOLS, 3, N) = key for type of justification 01380010 CA 1 - right justify and space fill 01390010 CA 2 - right justify and zero fill 01400010 CA 3 - left justify and space fill 01410010 CA 4 - left justify and zero fill 01420010 CA 01430010 CA SKEYID (N) = sort key id 01440010 CA SKEY (NCOLS, 1, N) = beginning column numbers (99 is a special01450010 CA code that may appear anywhere in any sort01460010 CA field and means "input card order") 01470010 CA SKEY (NCOLS, 2, N) = number of columns to use for this sort 01480010 CA field (use value of 5 for special code of01490010 CA 99) 01500010 CA SKEY (NCOLS, 3, N) = ascending/descending sort flag 01510010 CA 0 - ascending sort 01520010 CA 1 - descending sort; only used when 01530010 CA processing mode is S and beginning 01540010 CA shotpoint on the LINE card is greater01550010 CA than the ending shotpoint 01560010 CA 01570010 CA The justification and sort keys are processed by subroutines FJJUST01580010 CA and FJSORT respectively. 01590010 CAEND 01600009 CTITLESPARC Blank Common 01610008 CA 01620008 CA SPARC does not use Fortran blank common in the "normal" sense. 01630008 CA Subroutine CPBCOM is used to determine the amount of common 01640008 CA required by each process. See Section A, Space Calculations for a 01650008 CA description of the space calculation. After the amount of space 01660008 CA needed has been determined, CPPREP or CSEXEC uses GETMN2 to issue a01670008 CA getmain for that amount of memory. In order to address the 01680008 CA acquired memory, a Fortran index is calculated based on the 01690008 CA location of the "real" blank common variable COM (1). 01700008 CA 01710008 CA Within each SPARC process, this memory is broken into two parts: 01720008 CA 01730008 CA reserved memory - memory allocated to each specific process 01740008 CA and unavailable to any other process. 01750008 CA 01760008 CA unreserved memory - memory used as a scratch area and available 01770008 CA to all processes. 01780008 CA 01790008 CA Preparation routines are only called once and should never reserve 01800008 CA any of this memory. They may, however, make use of the unreserved 01810008 CA memory through use of KP-variables KPIUSM and KPNUSM. 01820008 CA 01830008 CA Process routines may use both types of memory. In order to reserve01840008 CA memory, mainly for use in making the processor serially reusable, 01850008 CA the processor calls subroutine UPRESM with the amount of space it 01860008 CA wishes to reserve. Since memory is reserved sequentially within 01870008 CA the getmained area, repeated calls to UPRESM are allowed during the01880008 CA initialization of each process. However, once the process returns 01890008 CA to CSEXEC, the process may not reserve more memory because it is 01900008 CA impossible to guarantee contiguous memory. UPRESM will store the 01910008 CA beginning index to the reserved memory area in KP-varible KPIRSM 01920008 CA and the number of reserved words in variable KPNRSM. UPRESM will 01930008 CA also maintain the main control variables for blank common and will 01940008 CA update the index and number of unreserved words in the variables 01950008 CA KPIUSM and KPNUSM. 01960008 CA 01970008 CA Upon entry to either preparation routine or processor, KPIUSM and 01980008 CA KPNUSM will be appropriately set by CPPREP or CSEXEC. As processes01990008 CA are initialized, the amount of unreserved blank commmon will 02000008 CA continue to decrease and the index to unreserved will be adjusted. 02010008 CA Therefore, the values from KPIUSM and KPNUSM should always be 02020008 CA referenced on each entry to the program. Neither preparation 02030008 CA routine nor processor routine should directly alter the values of 02040008 CA four KP-variables. The values are maintained by UPRESM or SPARC 02050008 CA control routines. 02060008 CA 02070008 CA Refer to Section F on Processors for more information on using 02080008 CA reserved common to make the processors serially reusable. 02090008 CAEND 02100008