%**************************************************************************
%This function outputs H in the magnets to the data file.
%
%Input:
%dat_file, data file for results
%hm, H in the magnets (A/m)
%
%Zachary Wolf, 10/13/09

function [] = field_calc_dat_hm(dat_file, hm)

%Constants
mu0 = 4 * pi * 10^-7;  %permeability of free space (Tm/A)

%Open the data file
fid = fopen(dat_file, 'a');

%Write the values to the data file
fprintf(fid, '\r\n');
fprintf(fid, 'H In The Magnets:\r\n');
fprintf(fid, 'Hm = %9.1f A/m\r\n', hm);
fprintf(fid, 'mu0 Hm = %9.5f T\r\n', mu0 * hm);

%Close the file
fclose(fid);

%Done
