-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applied formatting with miss-hit. Runs on Octave (#147)
* Applied formatting with miss-hit. Runs on Octave * Update EXE
- Loading branch information
1 parent
63fc611
commit 6832a30
Showing
119 changed files
with
8,768 additions
and
8,679 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
function Lb = Planck(wl,Tb,em) | ||
function Lb = Planck(wl, Tb, em) | ||
|
||
c1 = 1.191066e-22; | ||
c2 = 14388.33; | ||
if nargin<3 | ||
if nargin < 3 | ||
em = ones(size(Tb)); | ||
end | ||
Lb = em.* c1*(wl*1e-9).^(-5)./(exp(c2./(wl*1e-3*Tb))-1); | ||
end | ||
|
||
Lb = em .* c1 * (wl * 1e-9).^(-5) ./ (exp(c2 ./ (wl * 1e-3 * Tb)) - 1); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
function [GAM] = Soil_Inertia0(cs,rhos,lambdas) | ||
% soil thermal inertia | ||
GAM = sqrt(cs*rhos*lambdas); % soil thermal intertia | ||
function [GAM] = Soil_Inertia0(cs, rhos, lambdas) | ||
% soil thermal inertia | ||
GAM = sqrt(cs * rhos * lambdas); % soil thermal intertia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
function [GAM] = Soil_Inertia1(SMC) | ||
global theta_s0 | ||
%soil inertia method by Murray and Verhoef ( | ||
global theta_s0 | ||
% soil inertia method by Murray and Verhoef ( | ||
|
||
% % parameters | ||
% % parameters | ||
|
||
theta_s = theta_s0; %(saturated water content, m3/m3) | ||
Sr = SMC/theta_s; | ||
theta_s = theta_s0; % (saturated water content, m3/m3) | ||
Sr = SMC / theta_s; | ||
|
||
%fss = 0.58; %(sand fraction) | ||
gamma_s = 0.27; %(soil texture dependent parameter) | ||
dels = 1.33; %(shape parameter) | ||
% fss = 0.58; %(sand fraction) | ||
gamma_s = 0.27; % (soil texture dependent parameter) | ||
dels = 1.33; % (shape parameter) | ||
|
||
ke = exp(gamma_s * (1 - power(Sr, gamma_s - dels))); | ||
|
||
ke = exp(gamma_s*(1- power(Sr,(gamma_s - dels)))); | ||
phis = theta_s0; % (phis == theta_s) | ||
lambda_d = -0.56 * phis + 0.51; | ||
|
||
phis = theta_s0; %(phis == theta_s) | ||
lambda_d = -0.56*phis + 0.51; | ||
QC = 0.20; % (quartz content) | ||
lambda_qc = 7.7; % (thermal conductivity of quartz, constant) | ||
|
||
QC = 0.20; %(quartz content) | ||
lambda_qc = 7.7; %(thermal conductivity of quartz, constant) | ||
lambda_s = (lambda_qc^(QC)) * lambda_d^(1 - QC); | ||
lambda_wtr = 0.57; % (thermal conductivity of water, W/m.K, constant) | ||
|
||
lambda_s = (lambda_qc^(QC))*lambda_d^(1-QC); | ||
lambda_wtr = 0.57; %(thermal conductivity of water, W/m.K, constant) | ||
lambda_w = (lambda_s^(1 - phis)) * lambda_wtr^(phis); | ||
|
||
lambda_w = (lambda_s^(1-phis))*lambda_wtr^(phis); | ||
lambdas = ke * (lambda_w - lambda_d) + lambda_d; | ||
|
||
lambdas = ke*(lambda_w - lambda_d) + lambda_d; | ||
Hcs = 2.0 * 10^6; | ||
Hcw = 4.2 * 10^6; | ||
|
||
Hcs = 2.0*10^6; | ||
Hcw = 4.2*10^6; | ||
Hc = (Hcw * SMC) + (1 - theta_s) * Hcs; | ||
|
||
Hc = (Hcw * SMC)+ (1-theta_s)*Hcs; | ||
|
||
GAM = sqrt(lambdas.*Hc); | ||
GAM = sqrt(lambdas .* Hc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function [rss,rbs] = calc_rssrbs(SMC,LAI,rbs) | ||
global SaturatedMC ResidualMC fieldMC | ||
aa=3.8; | ||
rss = exp((aa+4.1)-aa*(SMC-ResidualMC(1))/(fieldMC(1)-ResidualMC(1))); | ||
rbs = rbs*LAI/4.3; | ||
function [rss, rbs] = calc_rssrbs(SMC, LAI, rbs) | ||
global SaturatedMC ResidualMC fieldMC | ||
aa = 3.8; | ||
rss = exp((aa + 4.1) - aa * (SMC - ResidualMC(1)) / (fieldMC(1) - ResidualMC(1))); | ||
rbs = rbs * LAI / 4.3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
function [Fi_s,Fi_gs,Fi_g,Omega_s] = calczenithangle(Doy,t,Omega_g,Fi_gm,Long,Lat) | ||
% | ||
% author: Christiaan van der Tol ([email protected]) | ||
% date: Jan 2003 | ||
% update: Oct 2008 by Joris Timmermans ([email protected]): | ||
% - corrected equation of time | ||
% Oct 2012 (CvdT) comment: input time is GMT, not local time! | ||
% | ||
% function [Fi_s,Fi_gs,Fi_g]= calczenithangle(Doy,t,Omega_g,Fi_gm,Long,Lat) | ||
% | ||
% calculates pi/2-the angle of the sun with the slope of the surface. | ||
% | ||
% input: | ||
% Doy day of the year | ||
% t time of the day (hours, GMT) | ||
% Omega_g slope azimuth angle (deg) | ||
% Fi_gm slope of the surface (deg) | ||
% Long Longitude (decimal) | ||
% Lat Latitude (decimal) | ||
% | ||
% output: | ||
% Fi_s 'classic' zenith angle: perpendicular to horizontal plane | ||
% Fi_gs solar angle perpendicular to surface slope | ||
% Fi_g projected slope of the surface in the plane through the solar beam and the vertical | ||
% | ||
function [Fi_s, Fi_gs, Fi_g, Omega_s] = calczenithangle(Doy, t, Omega_g, Fi_gm, Long, Lat) | ||
% | ||
% author: Christiaan van der Tol ([email protected]) | ||
% date: Jan 2003 | ||
% update: Oct 2008 by Joris Timmermans ([email protected]): | ||
% - corrected equation of time | ||
% Oct 2012 (CvdT) comment: input time is GMT, not local time! | ||
% | ||
% function [Fi_s,Fi_gs,Fi_g]= calczenithangle(Doy,t,Omega_g,Fi_gm,Long,Lat) | ||
% | ||
% calculates pi/2-the angle of the sun with the slope of the surface. | ||
% | ||
% input: | ||
% Doy day of the year | ||
% t time of the day (hours, GMT) | ||
% Omega_g slope azimuth angle (deg) | ||
% Fi_gm slope of the surface (deg) | ||
% Long Longitude (decimal) | ||
% Lat Latitude (decimal) | ||
% | ||
% output: | ||
% Fi_s 'classic' zenith angle: perpendicular to horizontal plane | ||
% Fi_gs solar angle perpendicular to surface slope | ||
% Fi_g projected slope of the surface in the plane through the solar beam and the vertical | ||
% | ||
|
||
%parameters (if not already supplied) | ||
if nargin<6 | ||
Long = 13.75; % longitude | ||
Lat = 45.5; % latitude | ||
if (nargin<4) | ||
Omega_g = 210; % aspect | ||
Fi_gm = 30; % slope angle | ||
% parameters (if not already supplied) | ||
if nargin < 6 | ||
Long = 13.75; % longitude | ||
Lat = 45.5; % latitude | ||
if nargin < 4 | ||
Omega_g = 210; % aspect | ||
Fi_gm = 30; % slope angle | ||
end | ||
end | ||
end | ||
|
||
%convert angles into radials | ||
G = (Doy-1)/365*2*pi; % converts day of year to radials | ||
Omega_g = Omega_g/180*pi; % converts direction of slope to radials | ||
Fi_gm = Fi_gm/180*pi; % converts maximum slope to radials | ||
Lat = Lat/180*pi; % converts latitude to radials | ||
% convert angles into radials | ||
G = (Doy - 1) / 365 * 2 * pi; % converts day of year to radials | ||
Omega_g = Omega_g / 180 * pi; % converts direction of slope to radials | ||
Fi_gm = Fi_gm / 180 * pi; % converts maximum slope to radials | ||
Lat = Lat / 180 * pi; % converts latitude to radials | ||
|
||
%computes the declination of the sun | ||
d = 0.006918-0.399912*cos(G )+ 0.070247*sin(G )- ... | ||
0.006758*cos(2*G)+ 0.000907*sin(2*G)- ... | ||
0.002697*cos(3*G)+ 0.00148*sin(3*G); | ||
|
||
%Equation of time | ||
Et = 0.017 + .4281 * cos(G) - 7.351 * sin(G) - 3.349 * cos(2*G) - 9.731 * sin(2*G); | ||
% computes the declination of the sun | ||
d = 0.006918 - 0.399912 * cos(G) + 0.070247 * sin(G) - ... | ||
0.006758 * cos(2 * G) + 0.000907 * sin(2 * G) - ... | ||
0.002697 * cos(3 * G) + 0.00148 * sin(3 * G); | ||
|
||
%computes the time of the day when the sun reaches its highest angle | ||
tm = 12+(4*(-Long)-Et)/60; % de Pury and Farquhar (1997), Iqbal (1983) | ||
% Equation of time | ||
Et = 0.017 + .4281 * cos(G) - 7.351 * sin(G) - 3.349 * cos(2 * G) - 9.731 * sin(2 * G); | ||
|
||
%computes the hour angle of the sun | ||
Omega_s = (t-tm)/12*pi; | ||
% computes the time of the day when the sun reaches its highest angle | ||
tm = 12 + (4 * (-Long) - Et) / 60; % de Pury and Farquhar (1997), Iqbal (1983) | ||
|
||
%computes the zenithangle (equation 3.28 in De Bruin) | ||
Fi_s = acos(sin(d)*sin(Lat)+cos(d)*cos(Lat).*cos(Omega_s)); | ||
% computes the hour angle of the sun | ||
Omega_s = (t - tm) / 12 * pi; | ||
|
||
%computes the slope of the surface Fi_g in the same plane as the solar beam | ||
Fi_g = atan(tan(Fi_gm).*cos(Omega_s-Omega_g)); | ||
% computes the zenithangle (equation 3.28 in De Bruin) | ||
Fi_s = acos(sin(d) * sin(Lat) + cos(d) * cos(Lat) .* cos(Omega_s)); | ||
|
||
%computes the angle of the sun with the vector perpendicular to the surface | ||
Fi_gs = Fi_s + Fi_g; | ||
% computes the slope of the surface Fi_g in the same plane as the solar beam | ||
Fi_g = atan(tan(Fi_gm) .* cos(Omega_s - Omega_g)); | ||
|
||
% computes the angle of the sun with the vector perpendicular to the surface | ||
Fi_gs = Fi_s + Fi_g; |
Oops, something went wrong.