disp('read_parameters_rhb');

%This routine reads the parameter file of the cruise.

fname='D:\Data\lb\flux_eval_programs\flux_config_STRATUS06.par';
flist=fopen(fname,'r');

para=[];
if flist>0
    while ~feof(flist)
        para=textscan(flist, '%s', 'commentStyle', '%');
    end;
else
    fprintf('unknown file: %s\n', fname);
end;

%################## Cruise informations  ##################################################################
cruise=para{1}{1};             % Cruise name  
year=para{1}{2};               % Year  
ship=para{1}{3};               % Research vessel  

way_raw_data=para{1}{4};                                % Raw data path on ETLDAS 11 
way_proc_data=para{1}{5};                              % Processed data path on ETLDAS 11 
way_spec_data=para{1}{6};
backup=para{1}{7};
way_backup_rawdata=para{1}{8};  % Raw Data back-up path on external hard disk
way_backup_procdata=para{1}{9}; % Processed Data back-up path on external hard disk

%################## Sonic configuration  ##################################################################
sonicmodel=para{1}{10};        %Sonic model
fsonic=str2double(para{1}{11});            %frequency (Hz)
rotationsonic=str2double(para{1}{12});     %rotated 30 deg = 1
outputsonic=str2double(para{1}{13}); 		%Sonic output. 0=speed of sound, 1=Temperature (degC)

%################## Licor configuration  ##################################################################
flicor=str2double(para{1}{14});            %frequency (Hz)
 
%################## Clear sky model configuration #########################################################
k1=str2double(para{1}{15});                %aerosol optical depth, band 1
k2=str2double(para{1}{16});                %aerosol optical depth, band 2
oz=str2double(para{1}{17});                %column ozone
iv=str2double(para{1}{18});                %column water vapor (cm)

%##################  Other parameters  ####################################################################
p=str2double(para{1}{19});                  %surface pressure (mb)
zus=str2double(para{1}{20});                %wind speed measurement height (m)
zts=str2double(para{1}{21});                %air T measurement height (m)
zqs=str2double(para{1}{22});                %air q measurement height (m)

disp('  ');
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
disp([cruise ' ' year ' ' ship]);

disp(['Raw data path: ' way_raw_data]);
disp(['Processed data path: ' way_proc_data]); 
disp(['Spec data path: ' way_spec_data]); 

if backup=='1'
    disp('Backup on external disk selected. Current path:');
    disp(way_backup_rawdata);
    disp(way_backup_procdata);
else
    disp('No data backup on external disk selected');
end;

if rotationsonic==1
    t='yes';
else
    t='no';
end;
disp(['Sonic= ', sonicmodel, '  ,frequency= ', para{1}{11}, ' Hz  , 30degrees rotation= ', t]);
disp(['Licor frequency= ', para{1}{14}, ' Hz']);

disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');

