-
Notifications
You must be signed in to change notification settings - Fork 1
/
importTz.m
53 lines (53 loc) · 2.54 KB
/
importTz.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function Tz = importTz(Tdatatype,z)
H = max(z);
switch Tdatatype
case 'Luthi'
% Use Site D borehole
load fielddata/Luthidata.mat
% Put it on the 0 to 1 / 0 to H z grid
Luthi.zetanew = flipud(linspace(Luthi.zeta(1),Luthi.zeta(end),100));
% ^ zeta here does not go quite all the way 0 to 1
Luthi.Tsmooth = fastsmooth(interp1(Luthi.zeta,Luthi.T,Luthi.zetanew),10,3,1);
Tz = interp1(linspace(1,0,100),Luthi.Tsmooth,z/H);
%
case 'IkenB'
% Use Site B borehole
load fielddata/IkenB.mat
% Interpolate
Tz = interp1(IkenB.zetamodel,IkenB.Tmodel,z/H);
%
case 'Temperate'
% Temperate ice (no refreezing)
Tz = 273.15*ones(size(z));
case 'Cool'
Tmin = -5;
Tz = linspace(0,Tmin,numel(z))' + 273.15;
case 'Cold'
Tmin = -3;
Tz = fastsmooth([linspace(0,Tmin,numel(z)/2) linspace(Tmin,Tmin/2,numel(z)/2+1)]',40,3,1) + 273.15;
case 'HarrS2A'
load fielddata/Harrington_temps_2015.mat
harr15.S2_A_zeta = (harr15.S2_A_depth_m - min(harr15.S2_A_depth_m)) / (-min(harr15.S2_A_depth_m));
harr15.S2_A_zeta(1) = 1;
harr15.Tsmooth = fastsmooth(interp1(harr15.S2_A_zeta,harr15.S2_A_temp_C+273.15,linspace(0,1,100)),10,3,1);
Tz = interp1(linspace(0,1,100),harr15.Tsmooth,z/H);
case 'HarrS4C'
load fielddata/Harrington_temps_2015.mat
harr15.S4_C_zeta = (harr15.S4_C_depth_m - min(harr15.S4_C_depth_m)) / (-min(harr15.S4_C_depth_m));
harr15.S4_C_zeta(1) = 1;
harr15.Tsmooth = fastsmooth(interp1(harr15.S4_C_zeta,harr15.S4_C_temp_C+273.15,linspace(0,1,100)),10,3,1);
Tz = interp1(linspace(0,1,100),harr15.Tsmooth,z/H);
case 'Ryser_foxx'
load fielddata/Luthi_temps_2015.mat
luthi15.FOXX1_C_zeta = (luthi15.FOXX1_depth_m - min(luthi15.FOXX1_depth_m)) / (-min(luthi15.FOXX1_depth_m));
luthi15.FOXX1_C_zeta(1) = 1;
luthi15.Tsmooth = fastsmooth(interp1(luthi15.FOXX1_C_zeta,luthi15.FOXX1_temp_C+273.15,linspace(0,1,100)),10,3,1);
Tz = interp1(linspace(0,1,100),luthi15.Tsmooth,z/H);
case 'Ryser_gull'
load fielddata/Luthi_temps_2015.mat
luthi15.GULL_C_zeta = (luthi15.GULL_depth_m - min(luthi15.GULL_depth_m)) / (-min(luthi15.GULL_depth_m));
luthi15.GULL_C_zeta(1) = 1;
luthi15.GULL_C_zeta(11) = 0.5656;
luthi15.Tsmooth = fastsmooth(interp1(luthi15.GULL_C_zeta,luthi15.GULL_temp_C+273.15,linspace(0,1,100)),10,3,1);
Tz = interp1(linspace(0,1,100),luthi15.Tsmooth,z/H);
end