Page:4SIGHT manual- a computer program for modelling degradation of underground low level waste concrete vaults (IA 4sightmanualcomp5612snyd).pdf/89

From Wikisource
Jump to navigation Jump to search
This page needs to be proofread.
2. MAIN
B.4

2. MAIN.

The body of 4SIGHT is fairly straightforward and the logical flow can be inferred from the outline below.

#define banner "\"\tThis is 4SIGHT (Version 1.0)\"\n\n"
#define NUM_CELLS 20
#define NUM_SURFACES (NUM_CELLS + 1)
#define DLIMIT 0.0005
 ⟨Include files 3⟩;
 ⟨Preprocessor definitions 11⟩;
 ⟨User defined data types 14⟩;
 ⟨Global variables 4⟩;
 ⟨Function declarations 23⟩;
 ⟨Interrupt handlers 24⟩;
 ⟨Input parsing routine 13⟩;
 int main(int arge, char **argv)
 {
   int i, j, k;
   ⟨System setup 5⟩;
   ⟨Parse input 6⟩;
   ⟨Parameter initialization 7⟩;
   ⟨Print header 75⟩;
   ⟨Print intermediate results 76⟩;
   do {
     if (kbhit()) {
       i = getch();
       control_break();
     }
     ⟨Ion transport 8⟩;
     ⟨Adjust parameters 9⟩;
     ⟨Print intermediate results 76⟩;
     ⟨Assess termination 10⟩;
   } while (!termination);
   ⟨Print termination information 77⟩;
   ⟨Print desired output 78⟩;
   return 1;
 } 

3. The following are #include files needed for some of the intrinsic functions such as printf and scanf. The math functions pow and log and the math error routine matherr require math.h. Additional include files are declared when needed. The routine kbhit() requires the header file conio.h.

⟨Include files 3⟩ 
#include <stdio.h>
#include <math.h>
#include <conio.h>
#include <bios.h>
#include <time.h>

See also sections 22, 28, and 32.

This code is used in section 2.