%**************************************************************************
%This function writes phase integral information to the data file.
%
%Input:
%dat_file, data file for results
%phase_integral_end, Int_-inf^+inf (Int_-inf^z By(z') dz')^2 dz (Tm^3)
%phase_integral_cell, Int_z_enter^z_exit (Int_-inf^z By(z') dz')^2 dz (Tm^3)
%
%Zachary Wolf, 5/24/11

function [] = phase_dat_phase_integral(dat_file, phase_integral_end, phase_integral_cell)

%Write the results to the data file
fid = fopen(dat_file, 'a');
fprintf(fid, '\r\n');
fprintf(fid, 'Phase Integral:\r\n');
fprintf(fid, 'PI = Int_(z_enter)^(z_exit) {[Int_(-inf)^(z) Bx(z*) dz*]^2 + [Int_(-inf)^(z) By(z*) dz*]^2} dz (T^2m^3)\r\n');
fprintf(fid, 'PI = %11.3e T^2m^3\r\n', phase_integral_end);
fprintf(fid, 'PI Of Cell = %11.3e T^2m^3\r\n', phase_integral_cell);
fclose(fid);

%Done
