APPENDIX C: PROGRAM DATACHECK 



The following program was written as an aid to the proper entry of the 

 profile data into the user's computer system. The program was run on the 

 correct data at the Field Research Facility and the proper checksum values 

 added to the BPAS format file as explained in Appendix B. The data should be 

 entered without the checksum values and then run through this program. 

 Compare the checksum values with those given in Appendix B. The code was 

 developed on a Control Data Corporation computer, but should be easily 

 converted to any system running an implementation of FORTRAN 77. 



PROGRAM DATCHK ( INPUT, OUTPUT, TAPE7) 

 C 



C AUTHOR: MS. REBECCA SAVAGE, WESCD-F 



C THIS PROGRAM IS DESIGNED FOR THE DATA PROCESSER TO COMPARE COPIES 

 C OF DATA FILES TO MAKE SURE TRANSFERED COPIES ARE CORRECT. 

 C THE COPY CAN BE CHECKED AT EVERY LINE OR EVERY TEN LINES. 

 C 



C THE PROGRAM READS FROM FORTRAN UNIT 7 AND WRITES TO UNIT 8 

 C 



INTEGER*2 ICARD(25) , ITOT.LTOT, I , J,N,V,STOT 

 CHARACTERS LINE(80) ,CARD(25) 

 C 



DATA I CARD/ 1, 2, 3,4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 

 $ 20,21,22,23,24,25/ 



DATA CARD/ ' . • , ' ' , • - • , ' ' , • 1 ' , ' 2 ' , ' 3 ' , ' 4 • , • 5' 1 , , 6', , 7 , , , 8 I , , 9 , 1 

 $ 'G'.'H'.'D'.'E'.'O'.'M'.'R'.'C'.'V'.'A'.'S'.'B 1 / 



C 



C DATA IS READ IN LINE BY LINE 

 C 



N=l 

 V=l 



STOT=0 

 50 ITOT=0 



READ(7,100,END=99) LINE 

 100 FORMAT(80A1) 

 C 



C ASSIGN INTEGER VALUES TO CHARACTER DATA 



C AND KEEP SUMS OF DATA BASED ON CHARACTER AND LOCATION IN LINE 

 C 



DO 10, 1=1,80 

 DO 20, J=l,25 

 IF (LINE(I).EQ.CARD(J))THEN 

 ITOT=ICARD(J)*I+ITOT 

 GO TO 10 

 END IF 

 20 CONTINUE 



WRITE (*,103) LINE(I),N,I 



CI 



