Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests comparing julia vs fortran Sneasy versions #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
340 changes: 340 additions & 0 deletions sneasy_fortran/GPL.txt

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions sneasy_fortran/Matlab/mytallfigure.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function foo=mytallfigure(number,width)
% function myfigure(number)
% /home/klaus/wrk/matlab/mystuff
% Fri Jun 22 13:54:07 EDT 2001
% update: Mon Oct 29 13:31:59 EST 2001
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(number);
clf;
set(gcf,'PaperPosition',[1.75 1.5 5 8]);
set(gcf,'DefaultLineLineWidth',width)
wysiwyg;
foo=number;



20 changes: 20 additions & 0 deletions sneasy_fortran/Matlab/plotallfigures.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function hout=plotallfigures (h, filename)
%PLOTALLFIGURES
% Plots all figures up to handle h on h.ps

% Klaus Keller 8/10/96 [email protected]

figure(1);
cmd = strcat(['print -dpsc2 ' filename]);
eval(cmd)

cmd = strcat(['print -append -dpsc2 ' filename]);
for j = 2:h
figure(j)
eval(cmd)
end
hout = 0 ;
return



71 changes: 71 additions & 0 deletions sneasy_fortran/Matlab/stampit.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
function ht = stampit(h,shft,fn)
% PLTSTMP Adds a timestamp and additonal comment to a plot
%
% PLTSTMP adds a timestamp to the plot. If PLTSTMP is issued in a m-file,
% the full path and filename is also added in the footer of the plot.
%
% PLTSTMP(FID) adds the timestamp to figure FID instead of the current
% figure.
%
% The timestamp sometimes interferes with the x-axis label. To avoid
% this, PLTSTMP(FID,SHFT) moves child axes of FID vertically by SHFT
% (in normalized coordinates) before adding the timestamp.
%
% PLTSTMP(FID,SHFT,STR) adds STR to the footer instead of the m-file
% name.
%
% H = PLTSTMP also returns the handle of the text string.
%
% Example:
% plot(pascal(5)), pltstmp

% aha, 3-jul-2004, fixed zoom problem and documentation
% aha, 15-oct-2003

if nargin<1, h=gcf; end

% shift original axes upward by shft
if nargin>1
ax = get(gcf,'child');
ax = findobj(gcf,'Type','Axes');
for k = 1:length(ax)
pp = get(ax(k),'Position');
set(ax(k),'Position',pp+[0 shft 0 0])
end
end

if nargin<3
% no string given, retrieve m-file name
[St,I]=dbstack;
if length(St)>I
fn = which(St(I+1,1).name);
fn = [fn ' [' datestr(now) ']'];
else
fn = [' [' datestr(now) ']'];
end
in = 'non';
else
% add timestamp to given string
fn = [fn ' [' datestr(now) ']'];
in = 'tex';
end

% delete a previous existing timestamp
set(0,'ShowHiddenHandles','On');
delete(findobj(h,'Tag','PLTSTMP-AXES'));
set(0,'ShowHiddenHandles','Off');

% create axes for text string and add string to the bottom of the
% figure
a = axes('parent',h,...
'posi',[-0 -0 1 1],...
'ydir','norm','xdir','norm',...
'visible','off',...
'Handlevisibility','off',...
'Tag','PLTSTMP-AXES');
ht = text(.5,0,fn,'hor','center','vert','bot','fontsize',8,...
'interpre',in,'parent',a);

% set(h,'currentaxes',oax)
if nargout==0, clear, end

57 changes: 57 additions & 0 deletions sneasy_fortran/Matlab/viewESys.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
close all
clear all

emis = load('emis_data_sep09.txt') ;

ES = load('earth_system.out') ;
yrs_emis = emis(:,1) ;
emissions = emis(:,2) ;
years = ES(:,1);
MOC = ES(:,2);
rad_forc = ES(:,3);
co2 = ES(:,4);
ocflux = ES(:,5);
temp = ES(:,6);
ocheat = ES(:,7);

mytallfigure(1,2) ;

subplot(4,1,1)
plot(yrs_emis,emissions)
ylabel('CO_2 Emis. [GtC]')
title({'Cs = 3.4 deg.C, Q10 = 1.311, Beta = 0.502,';'Eta = 17.722, Hyd.sens. = 0.047 Sv/deg.C'})

subplot(4,1,2)
plot(years,MOC)
ylabel('MOC str. [Sv]')

subplot(4,1,3)
plot(years,rad_forc)
ylabel('Rad. forcing [W/m^2]')

subplot(4,1,4)
plot(years,co2)
ylabel('Atm. CO_2 [ppm]')
xlabel('year')

stampit

mytallfigure(2,2) ;

subplot(3,1,1)
plot(years,ocflux)
ylabel('Atm./ocean flux [GtC]')

subplot(3,1,2)
plot(years,temp)
ylabel('Global surf. temp. [K]')

subplot(3,1,3)
plot(years,ocheat)
ylabel('Global ocean heat [10^{22} J]')
xlabel('year')

stampit

!/bin/rm ES_figs.ps
plotallfigures(gcf,'ES_figs.ps') ;
5 changes: 5 additions & 0 deletions sneasy_fortran/Matlab/wysiwyg.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function wysiwyg()
units=get(gcf,'units');
set(gcf,'units',get(gcf,'PaperUnits'));
set(gcf,'Position',get(gcf,'PaperPosition'));
set(gcf,'Units',units);
Loading