% 
% Two-Box Climate Model main program
%
% (c) A. Czaja, Feb. 2007.

%----------------------
% Initial conditions
%----------------------

  clear;
  RESTART =1,
  INPUTfile = 'Output_CTRL'; %name of input file if restart
  TwoBox_init; %calls initialization routine


%-----------
% Forcing
%-----------

  Te1 = TEMI1;    %emission temperature for tropical Box
  Te2 = TEMI2;    %emission temperature for extra-tropical Box 
  CO2 = 2*280;    %Well mixed CO2 concentration (ppm)

%------------------
%Time integration
%------------------

  Nyr = 200;
  Dt = 2*DAY;
  Nt = round(Nyr*YEAR/Dt);
  Time = [0:1:Nt-1]*Dt;
  TwoBox_Run; %Run Two-Box Model
  
%---------------
% Diagnostics
%---------------

  TwoBox_Diagnos; %run a few diagnostics
  
%----------------------
% Figures
%----------------------
  
  TwoBox_Plots; %plot model outputs

%--------------------
% Save Model output
%--------------------

  return; %to avoid rewriting on save files
  TwoBox_Save;
  clear Ta1 Ta2 To1 To2 Ts1 Ts2 Ts;
  clear PSIa Fa Fo Ft Ft1 Ft2 Fs1 Fs2 Time Feva1 Feva2;
  clear RESTART;
  save 'Output_2XCO2_nowvf';