% 
% Two-Box Climate Model main program
%
% (c) A. Czaja, Feb. 2007.
% http://www.sp.ph.ic.ac.uk/~arnaud/EP_ClimateModel

%----------------------
% Initial conditions
%----------------------

  clear;
  RESTART =1,
  INPUTfile = 'Output_CTRLv2'; %name of input file if restart
  TwoBox_Init; %calls initialization routine

  % Time integration
  Nyr = 10; %length of integration (in years)
  Dt = 1*DAY; %Model time step (<=2 days otherwise unstable scheme)
  Nt = round(Nyr*YEAR/Dt);
  Time = [0:1:Nt-1]*Dt;
  
%-----------
% Forcing
%-----------

  Te1 = TEMI1;    %emission temperature for tropical Box
  Te2 = TEMI2;    %emission temperature for extra-tropical Box 
  CO2 = 280 * ones(1,Nt);    %Constant CO2 concentration (ppm)
  TAU_CO2 = 10*DAY;
  CO2 = 280 + 280*( 1-exp(-Time/TAU_CO2) ); %doubling ver a tim
  
%------------------
%Time integration
%------------------

  PICTUREonline = 0, %if plot of on-going results is wanted
  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;
