APPENDIX A 



I. Program Name: XTRACT 



n. System Name: DYFIT 



in. Purpose: XTRACT is the first step in a system of programs that build a data file for 

 the DYFIT program. XTRACT reads a NOAA STD Data tape and extracts records with valid 

 dynamic depth anomaly data. All other records are skipped. The data is processed (see section 

 Vn) and written out onto a disk file for subsequent processing by the IBM SORT routine. 



IV. History: XTRACT was originally written in FORTRAN by David A. Portyrata in October 

 1978. It was rewritten in COBOL in July 1979. The change to COBOL allowed the use of built- 

 in functions to handle the overpunched sign on the latitude and longitude fields, and facilitated 

 use of packed decimal output. 



V. Machine: IBM 360/65 



VL Language: IBM COBOL VERSION 4 

 vn. Description of Processing: 



a. Scanning for Valid Records 



Many different types of data records are contained on a STD tape. Only record 

 type 6 contains a dynamic depth anomaly field. All other records are skipped. The following 

 conditions are necessary for a record to be processed: 



(1) A '6 ' in the 80th byte (the record type field). 



(2) Valid numeric data in bytes 60-63 (the dynamic depth anomaly field). 



(3) Valid numeric data in bytes 7-8 (the minutes of latitude field). 



(4) Valid numeric data in bytes 13-14 (the minutes of longitude field). 



b. Converting Latitude and Longitude Records 



Latitude and longitude records are converted from degrees/minutes/tenths 

 of minutes to decimal degrees. The latitudes are subtracted from 90 so that they range from 

 to ISO instead of -90 to 90. 180 is added to the longitudes so that they range from to 360 

 instead of -180 to 180. The above operations are performed so that the output from XTRACT 

 need not contain signed numeric fields. 



c. Computing the Julian Day 



The Julian date is calculated using a formula published in the Texas Instru- 

 ments Master Library for TI 58/59. The factor for the cast day is calculated, and the factor for 

 January 1st of the year the cast was taken is subtracted from it, giving the Julian date. The 

 formula is: ., 



