During initialization, the input file is read twice.The first read of the input file is used to allocate and initialize memory for all the global variables (i.e., those variables passed among routines via modules).The second read of the input file is used to define the problem.The input file readers are not foolproof but do report error messages when input errors are noted.Once the input file has been successfully read twice, the initial states are checked for thermodynamic consistency, phase conditions are established, and the primary variables are selected for every grid cell.The next stage of initialization involves computing all the secondary variables at grid cells and boundary surfaces.If geomechanics calculations are included in the simulation, then the initial stress state of the domain is established.If coupled wells are included in the simulation, then the well trajectories are determined and the wells are equilibrated with the formation.Once the well trajectories are defined, the coupled conservation equations and coupled well equations are sequenced such that the band width of the Jacobian matrix is minimized.If geochemistry calculations are included in the simulation, then the initial chemical state of the system is established.With the initial primary and secondary variables computed, the next stage of initialization is to compute the initial surface fluxes at both internal surfaces and boundary surfaces (e.g., volumetric phase flux, component advective/diffusive flux, heat flux).The final initialization stage is to record user requested output to the various output files (i.e., output, plot.xxx, and surface).If a zero-time-step simulation is requested, the simulator stops at the end of the initialization, after recording output.This option is very useful for computing property values or examining initial states.