CAINDXI/O & Utilities 00010000 C*********************************************************************** C COPYRIGHT ATLANTIC RICHFIELD COMPANY 1991 * C*********************************************************************** CTITLEInput/Output Subroutines 00020000 CA 00030000 CA Several subroutines are used to perform input/output for traces, 00040000 CA the parameter file, and work files. 00050000 CA 00060000 CA FOIP 00070000 CA FORC - read a card for a specific process and process 00080000 CA number 00090000 CA FORP - read a parameter record 00100000 CA FOWC - re-write a data card to the SEISPARM file 00110006 CA FOWP - write a parameter record 00120006 CA 00130000 CA FOSCDK 00140000 CA FOISSD - open sequential work file 00150000 CA FOWSSD - write sequential work file 00160000 CA FOIDSD - open direct access work file 00170000 CA FORDSD - read direct access work file 00180000 CA FOWDSD - write direct access work file 00190000 CA FOCSD - close sequential dcb work file 00200000 CA FOCDD - close direct access dcb work file 00210000 CA 00220000 CA FOTRCE 00230000 CA FOIRTR - trace read initialization 00240000 CA FODRTR - get current data set name and volume number 00250000 CA FORTR - read trace data 00260000 CA FOCRTR - close trace read 00270000 CA FOIWTR - trace write initialization 00280000 CA FOVWTR - get current volume number 00290000 CA FOWTR - write trace data 00300000 CA FOCWTR - close trace write 00310000 CA 00320000 CA Three routines may be used to retrieve or replace values in a 00330000 CA trace header array in storage. 00340000 CA 00350000 CA USRHDR - read trace header from GM3DPARM file into storage 00360007 CA USRTHV - retrieve a trace header value after header is in 00370000 CA storage 00380000 CA USSTHV - store a value in the trace header 00390000 CA 00400000 CA The abstracts for these routines should be consulted for more 00410000 CA details. 00420000 CAEND 00430000 CTITLEDynamic Allocation Subroutines 00440002 CA 00450002 CA With the conversion of SPARC for an interactive world, each process00460002 CA is responsible for allocating and unallocating any necessary data 00470002 CA sets. Therefore, use of dynamic allocation routines is a must. 00480002 CA Refer to Section F for further details of SPARC programming 00490002 CA standards and conventions. 00500002 CA 00510002 CA Currently, EDP, and SPARC in particular, has a plethora of assembly00520002 CA language dynamic allocation subroutines. Some consolidation of 00530002 CA these routines has already taken place and more will follow in the 00540002 CA future. Therefore, great thought and care should be taken before 00550002 CA creating another new routine. The subroutines listed below are 00560002 CA used throughout SPARC and perform almost all of any necessary 00570002 CA functions relating to the SMS data base (data set names), acquiring00580002 CA and deleting DCB's, etc. USE THEM!!! 00590002 CA 00600002 CA UGUNAL - unallocate a SPARC data set (input or output). The DCB00610002 CA area is freed. 00620002 CA 00630002 CA UGUWRK - unallocate a SPARC work file. This routine will free 00640002 CA memory used for the BSAM and BDAM DCBs. 00650002 CA 00660002 CA UPAINP - allocate a SPARC input data set. A DCB address is 00670002 CA returned directly to the KP variable KPDBGS. The first00680002 CA data card for the process must conform to JOBGEN 00690002 CA standards. 00700002 CA 00710002 CA UPAPLT - dynamically adds any plot (seismic, calcomp type, or 00720002 CA color) to EDP's plotting system queue. The plot data 00730002 CA set should be unallocated prior to adding to the plot 00740002 CA queue so the data set may be plotted immediately. 00750002 CA 00760002 CA UPAWRK - allocate a SPARC work file and return addresses for 00770002 CA BSAM and BDAM DCBs. 00780002 CA 00790002 CA UPNPLT - allocate a SPARC output plot file. This high level 00800002 CA routine should be used to allocate any calcomp type or 00810002 CA color plot data set. An output DCB is returned 00820002 CA directly to KP variable KPDBGS. The first data card 00830002 CA for the process must conform to JOBGEN standards. 00840002 CA 00850002 CA UPNPRM - allocate a new SPARC output file. This high level 00860002 CA routine should be used to allocate any seismic output 00870002 CA data set when the first data card for the process does 00880002 CA not conform to JOBGEN standards. A DCB address is 00890002 CA returned through the calling arguments. New processes 00900002 CA should not be designed to use this routine. They 00910002 CA conform to the JOBGEN standards. Use of this routine 00920002 CA is not supported on the CRAY. 00930002 CA 00940002 CA UPNWRT - allocate a new SPARC output file. This high level 00950002 CA routine should be used to allocate any seismic output 00960002 CA data set. An output DCB is returned directly to KP 00970002 CA variable KPDBGS. The first data card for the process 00980002 CA must conform to JOBGEN standards. It is mainly for 00990002 CA use by the WRIT process and the SMS record is the 01000002 CA responsibility of the calling program. 01010002 CAEND 01020002 CTITLEUTCGI4 -- Generate Fortran Common Statements (default=I4) 01030000 CA 01040000 CA To simplify use of and changes to COMMON P, a program, UTCGI4, has 01050000 CA been written for use with Fortran subroutines. When this program 01060000 CA is used, the source program must contain one common statement for 01070000 CA each COMMON P variable used by the program. This statement must be 01080000 CA of the form: 01090000 CA 01100000 CA column 7 15 20 01110000 CA | | | 01120000 CA COMMON /P/ variable 01130000 CA 01140000 CA These cards may be in any order, but must be between cards with 01150000 CA variables STARTP and ENDP. UTCGI4 then compares these cards 01160000 CA against a master list, PTABDEF and arranges them in the correct 01170000 CA order. Where the variables are not contiguous, UTCGI4 inserts 01180007 CA dummy variables beginning with 'M' followed by a number and a 01190007 CA dimension for the number of words skipped. Comment cards 01200007 CA containing the common variables used, their dimension, location, 01210007 CA etc., are added to the program. Figures 3 and 4 give examples of 01220008 CA some common statements before and after UTCGI4, respectively. 01230007 CA Figure 5 gives a sample CLIST for use on TSO. 01240008 CA 01250007 CA 01260007 CA 01270000 CA 01280000 CA 01290000 CA COMMON /P/ STARTP 01300000 CA COMMON /P/ KPRTF 01310000 CA COMMON /P/ LCMXFD 01320000 CA COMMON /P/ LCTPSP 01330000 CA COMMON /P/ KPNA 01340000 CA COMMON /P/ KPRNO 01350000 CA COMMON /P/ ENDP 01360000 CA 01370000 CA Common statements before UTCGI4 01380000 CA Figure 3 01390008 CA 01400000 CA 01410000 CA 01420000 CA 01430000 CA COMMON /P/ STARTP ( 2) , M00000( 10) 01440004 CA COMMON /P/ LCTPSP , M00048( 4) 01450000 CA COMMON /P/ LCMXFD , M00068( 86) 01460004 CA COMMON /P/ KPNA 01470000 CA COMMON /P/ KPRNO , M00420( 17) 01480004 CA COMMON /P/ KPRTF , M00492( 238) 01490004 CA COMMON /P/ ENDP 01500000 CA 01510000 CA Common statements after UTCGI4 01520000 CA Figure 4 01530008 CA EJECT 01540000 CA 01550000 CA PROC 1 PROG PREFIX(DBGREM) 01560004 CA COPY '&PREFIX..&PROG..FORT' '&PREFIX..&PROG.SV.FORT' 01570000 CA ALLOC FILE(FT01F001) DA('DBG.SPARCXA.SOURCE(PTABDEF)') SHR 01580004 CA ATTRIB XRINT RECFM(F B A) 01590004 CA ALLOC FILE(FT08F001) DA('&PREFIX.PTABHEX.DATA') NEW B(12960) SP(2,1)-01600004 CA USING(XRINT) 01610004 CA ALLOC FILE(FT06F001) DA(*) 01620000 CA ALLOC FILE(FT03F001) DA('&PREFIX..&PROG.SV.FORT') SHR 01630000 CA ALLOC FILE(FT04F001) DA('&PREFIX..&PROG..FORT') 01640000 CA CALL 'DBG.SPARCXA.LOAD(UTCGI4)' 01650004 CA DELETE ('&PREFIX..&PROG.SV.FORT' '&PREFIX..PTABHEX.DATA') 01660004 CA FREEALL 01670000 CA END 01680000 CA 01690000 CA Sample CLIST for Executing UTCGI4 01700000 CA Figure 5 01710008 CAEND 01720000 CTITLEUTLCA -- To List the Program Abstracts 01730000 CA 01740000 CA This program is primarily used to list the program abstracts. It 01750000 CA may, however, be used for other purposes. It is designed to list 01760005 CA only those cards with a certain code in columns 1 and 2. The codes01770000 CA are designed to be comment cards in Fortran and assembly language 01780000 CA programs. The second character of the code must be specified and 01790000 CA the program will use that character prefixed by 'C' or '*' as the 01800000 CA code. For the program abstracts the codes are 'CA' and '*A'. 01810000 CA 01820000 CA File FT03F001 is used to read certain control parameters. The 01830000 CA format for the first card should be: 01840000 CA col 7- 8 number of copies desired. (Not currently used.) 01850007 CA 9-10 not equal to zero if table of contents is desired. 01860007 CA Pages will be numbered sequentially. 01870000 CA 11-12 code to be listed ('CA' for program abstracts). 01880000 CA The program will take this two-character code and 01890007 CA replace the first character by an asterisk to use in01900000 CA listing assembly routines. 01910000 CA The second card, if present, will be used as the title for the 01920000 CA table of contents. 01930000 CA 01940000 CA The input file to be listed is on file FT05F001. Interspersed with01950000 CA the cards to be listed may be cards to control page numbers, page 01960000 CA ejects, etc. These control cards are listed below. 01970000 CA 01980000 CA keyword columns description 01990000 CA ------- ------- ----------- 02000000 CA CTITLE 1- 6 use columns 7 to 72 as the title for a 02010000 CA list (columns 7 to 66 will appear in 02020000 CA the table of contents). A title card 02030000 CA should precede the first card with the 02040000 CA list code on it and will not be listed 02050000 CA unless there is a card with the list 02060000 CA code. 02070000 CA 02080000 CA list code 1- 2 'CA' or '*A' for program abstracts. 02090000 CA END 3- 6 End of one list. 02100000 CA 02110000 CA list code 1- 2 columns 7 to 66 are used as a secondary02120000 CA INDM 3- 6 column heading for the table of 02130007 CA contents. The heading is printed 02140007 CA immediately and is blanked by an END 02150000 CA card. Unless blank, it will be printed02160000 CA at the top of a new page after the 02170007 CA primary column heading. Mainly used 02180000 CA in multiple entry routines. 02190000 CA 02200000 CA list code 1- 2 columns 7 to 72 are used as column 02210000 CA INDX 3- 6 headings for the table of contents. 02220000 CA The heading is printed immediately 02230000 CA and at the top of each new page. 02240000 CA EJECT 02250000 CA keyword columns description 02260000 CA ------- ------- ----------- 02270000 CA list code 1- 2 start a new page. (Page heading is 02280000 CA EJECT 7-12 repeated). 02290003 CA or 10-15 02300000 CA 02310000 CA END 7- 9 end of one list. 02320000 CA or 10-12 02330000 CA 02340000 CA list code 1- 2 list all 80 columns until the next 808002350000 CA '8080' 3- 6 card is found. Only page ejects are 02360000 CA honored between 8080 cards. 02370000 CA 02380000 CA PAGENO 7-12 integer part of page number replaced by02390000 CA cols. 13-18. 02400000 CA Page increment by cols. 19-24. 02410000 CA Decimal part of page number in cols. 02420000 CA 25-30. (two digits). 02430000 CA Decimal increment in cols. 31-36. 02440000 CA 02450000 CA example 1. 02460000 CA cols 7 18 24 30 36 02470000 CA | | | | | 02480000 CA PAGENO 20 1 1 1 02490000 CA 02500000 CA This card will produce a page number of02510000 CA "20.1" followed by "20.2", "20.3", ...,02520000 CA "20.9", "20.10", "20.11", ..., "20.99".02530000 CA 02540000 CA example 2. 02550000 CA cols 7 18 24 30 36 02560000 CA | | | | | 02570000 CA PAGENO 20 2 02580000 CA 02590000 CA this card will produce page numbers of 02600000 CA "20", "22", "24", etc. 02610000 CA 02620000 CA Summary of files used: 02630000 CA 02640000 CA FT01F001 logo input 02650000 CA FT03F001 control cards 02660000 CA FT05F001 main text with interspersed control cards 02670000 CA 02680000 CA FT04F001 table of contents 02690000 CA FT06F001 main text 02700000 CA FT08F001 logo output 02710000 CAEND 02720000 CTITLEUTLCU -- To List the User's Guide 02730000 CA 02740000 CA This program is primarily used to list the user's guide. It may, 02750007 CA however, be used for other purposes. The functions are the same as02760005 CA UTLCA with the following exceptions. 02770005 CA 02780000 CA The list code is CU. 02790000 CA 02800000 CA INDM cards are ignored. 02810000 CA 02820000 CA CTITLE cards are ignored. The first card with the list code on 02830000 CA it is used as the title. If cols. 7-13 of the first card contain 02840000 CA the word PROCESS, the process name in cols. 15-18 is repeated 02850000 CA in cols. 75-78. 02860000 CA 02870000 CA 02880000 CA Summary of files used: 02890000 CA 02900000 CA FT01F001 logo input 02910000 CA FT03F001 control cards 02920000 CA FT05F001 main text with interspersed control cards 02930000 CA 02940000 CA FT02F001 not used 02950000 CA FT04F001 table of contents 02960000 CA FT06F001 main text 02970000 CA FT08F001 logo output 02980000 CAEND 02990000 CTITLEUTLPG -- To List the Programmer's Guide 03000000 CA 03010000 CA This program is primarily used to list the programmer's guide. It 03020007 CA may be used for other purposes. The functions are the same as for 03030007 CA UTLCA with the following exceptions. 03040000 CA 03050000 CA The list code is CA (same as the code for the abstracts). 03060000 CA 03070000 CA INDX cards can only be used at the beginning of a section. This is03080000 CA because the page numbers consist of a section letter followed by a 03090000 CA number (e.g A-1), and an INDX card causes the section letter to be03100007 CA incremented. 03110000 CA 03120000 CA The PAGENO control card has an additional field with the section 03130000 CA letter. 03140000 CA 03150000 CA PAGENO 7-12 03160000 CA 13-18 integer part of page number. 03170000 CA 19-24 page increment. 03180000 CA 25-30 decimal part of page number (2 digits).03190000 CA 31-36 decimal increment. 03200000 CA 37 section letter. 03210000 CA 03220000 CA example 1. 03230000 CA cols 7 18 24 30 36 03240000 CA | | | | | 03250000 CA PAGENO 20 1 1 1C 03260000 CA 03270000 CA this card will produce page numbers 03280000 CA C-20.1, C-20.2, C-20.3, ... C-20.99. 03290000 CA 03300000 CA example 2. 03310000 CA cols 7 18 24 30 36 03320000 CA | | | | | 03330000 CA PAGENO 20 2 B 03340000 CA 03350000 CA this card will produce page numbers 03360000 CA B-20, B-22, B-24, etc. 03370000 CA 03380000 CA FT01F001 logo input 03390000 CA FT03F001 control cards 03400000 CA FT05F001 main text with interspersed control cards 03410000 CA 03420000 CA FT04F001 table of contents 03430000 CA FT06F001 main text 03440000 CA FT08F001 logo output 03450000 CA FT10F001 permanent tso file to hold a copy of table of contents. 03460000 CAEND 03470000