
% MATLAB code to drive the Dartmouth FEM "quoddy" Circulation Model

% Jim Manning March 1997

% puts user in the model directory (assumes you started in atsee directory)
cd model;

% Steps to this code include:

%   - build ".inq" model run control file (buildinq.m)
%   - build ".ind" particle tracking control file (buildind.m)
%   - execute cold start
%   - build ".icq4" initial condition file (createicq4.exe)
%   - execute hot start
%   - visualize output (movec.m)



%%%%%%%%%%%%%%%%%%%    BUILD .INQ   %%%%%%%%%%%%%%%%%

%   - build ".inq" model run control file (buildinq.m)
buildinq;


%%%%%%%%%%%%%%%%%%%    BUILD .IND    %%%%%%%%%%%%%%%%%

%  build ".ind" particle tracking control file (buildind.m)
%  (note: here is where the user specifies coh='y' or 'n' for cold start)
buildind;

if coh=='y';
%%%%%%%%%%%%%%%%%%%    EXECUTE COLD START %%%%%%%%%%%

% execute cold start (expects wind.dat file in this directory)
  !source qcs.run

else;
  ic=menu('Do you want to apply initial conditions?','yes','no');
  if ic==1;
%%%%%%%%%%%%%%%%%%%    CREATE .ICQ   %%%%%%%%%%%%%%%%
%    build ".icq4" initial condition file (createicq4.exe)
     !source create_icq4.run
  end;

%%%%%%%%%%%%%%%%%%%    EXECUTE HOT START %%%%%%%%%%%

% execute cold start
  !source qhs.run
end;
