Skip to content

Commit

Permalink
Release notes and some help info updated
Browse files Browse the repository at this point in the history
  • Loading branch information
GHilmarG committed Oct 26, 2023
1 parent 920ecea commit 547fbe9
Show file tree
Hide file tree
Showing 14 changed files with 3,086 additions and 1,735 deletions.
6 changes: 3 additions & 3 deletions DefineAGlenDistribution.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

function [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
function [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,F)


%%
%
% User input m-file to define A and n in the Glenn-Steinemann flow law
%
% [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,F)
%
% [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%
% Usually A is defined on the nodes (but sometimes in an inverse run A might be
% defined as an element variable.)
%
%%

Expand Down
8 changes: 8 additions & 0 deletions DefineCalving.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
%
% Both the Level-Set Field (LSF) and the Calving-Rate Field (c) must be defined over the whole computational domain.
%
% The level-set option must be activated by setting
%
% CtrlVar.LevelSetMethod=1;
%
% in DefineInitialInputs.m
%
% The LSF should, in general, only be defined in the beginning of the run and set the initial value for the LSF. However, if
% required, the user can change LSF at any time step. The LSF is evolved by solving the Level-Set equation, so any changes
Expand All @@ -31,6 +36,9 @@
% then the level-set is NOT evolved in time using by solving the level-set equation. This can be usefull if, for example, the
% user simply wants to manually prescribe the calving front position at each time step.
%
%
% See more information in Ua2D_DefaultParameters.
%
%%

%% initialize LSF
Expand Down
51 changes: 46 additions & 5 deletions DefineCalvingAtIntegrationPoints.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,57 @@
function [c,dcddphidx,dcddphidy]=DefineCalvingAtIntegrationPoints(UserVar,CtrlVar,dphidx,dphidy,F)

% function [c,dcDdphidx,dcDdphidy]=DefineCalvingAtIntegrationPoints(UserVar,CtrlVar,dfdx,dfdy,u,v,h,s,S,x,y)

%%
%
% Defines calving at integration points.
%
% phi is the level set function
%

% dcddphidx is dc/d (dphidx) = \frac{ d c]{d (dphidx)}, ie it is the derivative of c with respect to dphidx
% where dphidx is in turn d(phi)/dx
%
% cint=DefineCalvingAtIntegrationPoints(UserVar,CtrlVar,nx,ny,uint,vint)

% Note: F is here provided at the integration points, i.e. this is not the usual F variable provided at nodes!
% Not all the usual fields of F are available. The fields available include:
% u,v,h,s,S,rho,exx,exy,eyy.
%
% Also note that F.x,F.y are here the (x,y) coordinates of the integration points, ie not the (x,y) nodal coordinates.
%
% The level-set option must be activated by setting
%
% CtrlVar.LevelSetMethod=1;
%
% in DefineInitialInputs.m
%
% If the calving rate is a function of the gradients of the level-set, the calving rate must be defined at the element
% integration points using this function as:
%
%
% [c,dcddphidx,dcddphidy]=DefineCalvingAtIntegrationPoints(UserVar,CtrlVar,dphidx,dphidy,F)
%
% which provies dphi/dx and dphi/dy where phi is the level-set function
%
% This option is activated by the usuer by setting
%
%
% CtrlVar.CalvingLaw.Evaluation="-int-" ;
%
% in DefineInitialInputs.m
%
% The default is to prescribe the calving rate at the nodes, i.e. by default we have
%
% CtrlVar.CalvingLaw.Evaluation="-node-" ;
%
% Prescribing the calving rate at the integration points is, for example, required if the calving rate is a function of velocities normal to the calving front.
%
% The user must then also return derivatives of the calving rate, c, with respect to x and y derivatives of the level set,
% ie
%
% $$\frac{dc}{d (d \phi/dx)}$$
%
% $$\frac{dc}{d (d \phi/dy)}$$
%
% More details are provided in the UaCompendium
%
%%

narginchk(5,5)

Expand Down
20 changes: 14 additions & 6 deletions DefineMassBalance.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
% dasdh and dabdh only need to be specified if the mass-balance feedback option is
% being used.
%
% In Úa the mass balance, as returned by this m-file, is multiplied internally by the local ice density.
% In Úa the mass balance, as returned by this m-file, is multiplied internally by the local ice density.
%
% The units of as and ab are water equivalent per time, i.e. usually
% as and ab will have the same units as velocity (something like m/yr or m/day).
Expand All @@ -41,24 +41,32 @@
% These fields need to be returned at the nodal coordinates. The nodal
% x and y coordinates are stored in MUA.coordinates, and also in F as F.x and F.y
%
% Examples:
%
% To set upper surface mass balance to zero, and melt along the lower ice
% surface to 10 over all ice shelves:
% *Examples* :
%
% *To set upper surface mass balance to zero, and melt along the lower ice
% surface to 10 over all ice shelves:*
%
% as=zeros(MUA.Nnodes,1);
% ab=-(1-F.GF.node)*10
%
%
% To set upper surface mass balance as a function of local surface elevation and
% prescribe mass-balance feedback for the upper surface:
% *To set upper surface mass balance as a function of local surface elevation and
% prescribe mass-balance feedback for the upper surface:*
%
% as=0.1*F.h+F.b;
% dasdh=zeros(MUA.Nnodes,1)+0.1;
% ab=F.s*0;
% dabdh=zeros(MUA.Nnodes,1);
%
% *To add basal melt due to sliding as a mass-balance term:*
%
% [tbx,tby,tb,beta2] = CalcBasalTraction(CtrlVar,MUA,F.ub,F.vb,F.C,F.m,F.GF);
% L=333.44 ; % Enthalpy of fusion = L = [J/gramm = kJ/kg] Make sure that the units are correct.
% F.ab=-(tbx.*F.ub+tby.*F.vb)./(F.rho.*L); % Ablation (Melt) is always negative, accumulation is positive
%
%
%
%%


Expand Down
4 changes: 3 additions & 1 deletion DefineSlipperyDistribution.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

function [UserVar,C,m,q,muk]=DefineSlipperyDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
function [UserVar,C,m,q,muk]=DefineSlipperyDistribution(UserVar,CtrlVar,MUA,F)


%%
%
% [UserVar,C,m,q,muk]=DefineSlipperyDistribution(UserVar,CtrlVar,MUA,F)
%
% [UserVar,C,m,q,muk]=DefineSlipperyDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%
%
Expand Down
12 changes: 9 additions & 3 deletions ReleaseNotes.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

%%
%
%
%
% *Release Notes* _October 2023_
%
% A (rare) case where the Cauchy direction is not a direction of descent was incorrectly updated. This has now been addressed.
%
%
% *Release Notes* _September 2023_
%
% * Thanks to Sebastian Rosier for providing an example where the backtracking algorithm failed. This has now been corrected.
%
%
%
% *Release Notes* _July 2023_
%
% * uv and uvh solver now uses dog-leg seach if Newton back-tracking results in small steps.
Expand Down Expand Up @@ -235,7 +241,7 @@
%
% CtrlVar.DefineOutputsDt
%
% If you define these old fields in your (new) DefineInitialInputs.m, Úa will spot this and complain bitterly.
% If you define these old fields in your (new) DefineInitialInputs.m, �a will spot this and complain bitterly.
%
% Those using Unix might want to systematically change names of some of the CtrlVar fields
% in there old input files. You might be able to use something like:
Expand Down Expand Up @@ -272,7 +278,7 @@
% _February 2020_
%
%
% * Úa can now be called with CtrlVar as second argument, e.g
% * �a can now be called with CtrlVar as second argument, e.g
%
% Ua([],CtrlVar)
%
Expand Down
74 changes: 53 additions & 21 deletions html/DefineAGlenDistribution.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@

<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
This HTML was auto-generated from MATLAB code.
To make changes, update the MATLAB code and republish this document.
--><title>DefineAGlenDistribution</title><meta name="generator" content="MATLAB 9.2"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2018-05-31"><meta name="DC.source" content="DefineAGlenDistribution.m"><style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--
This HTML was auto-generated from MATLAB code.
To make changes, update the MATLAB code and republish this document.
-->
<title>DefineAGlenDistribution</title>
<meta name="generator" content="MATLAB 23.2">
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
<meta name="DC.date" content="2023-10-26">
<meta name="DC.source" content="DefineAGlenDistribution.m">
<style type="text/css">
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}

html { min-height:100%; margin-bottom:1px; }
html body { height:100%; margin:0px; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000; line-height:140%; background:#fff none; overflow-y:scroll; }
Expand All @@ -23,7 +28,7 @@

p { padding:0px; margin:0px 0px 20px; }
img { padding:0px; margin:0px 0px 20px; border:none; }
p img, pre img, tt img, li img, h1 img, h2 img { margin-bottom:0px; }
p img, pre img, tt img, li img, h1 img, h2 img { margin-bottom:0px; }

ul { padding:0px; margin:0px 0px 20px 23px; list-style:square; }
ul li { padding:0px; margin:0px 0px 7px 0px; }
Expand Down Expand Up @@ -52,6 +57,7 @@
span.string { color:#A020F0 }
span.untermstring { color:#B20000 }
span.syscmd { color:#B28C00 }
span.typesection { color:#A0522D }

.footer { width:auto; padding:10px 0px; margin:25px 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; }
.footer p { margin:0px; }
Expand All @@ -66,22 +72,46 @@



</style></head><body><div class="content"><pre class="codeinput"><span class="keyword">function</span> [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
</pre><p>User input m-file to define A and n in the Glenn-Steinemann flow law</p><pre class="language-matlab">[UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
</pre><p>Usually A is defined on the nodes (but sometimes in an inverse run A might be defined as an element variable.)</p><pre class="codeinput">n=3 ;
</style>
</head>
<body>
<div class="content">
<pre class="codeinput">
<span class="keyword">function</span> [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,F)
</pre>
<p>User input m-file to define A and n in the Glenn-Steinemann flow law</p>
<pre class="language-matlab">[UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,F)
</pre>
<pre class="language-matlab">[UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
</pre>
<p>Usually A is defined on the nodes (but sometimes in an inverse run A might be defined as an element variable.)</p>
<pre class="codeinput">n=3 ;
A=6.338e-25;
AGlen=A*1e9*365.2422*24*60*60+zeros(MUA.Nnodes,1);
</pre><pre class="codeinput"><span class="keyword">end</span>
</pre><p class="footer"><br><a href="http://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2017a</a><br></p></div><!--
##### SOURCE BEGIN #####
</pre>
<pre class="codeinput">
<span class="keyword">end</span>
</pre>
<p class="footer">
<br>
<a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2023b</a>
<br>
</p>
</div>
<!--
##### SOURCE BEGIN #####
function [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,F)
function [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%%
%
% User input m-file to define A and n in the Glenn-Steinemann flow law
%
% [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,F)
%
% [UserVar,AGlen,n]=DefineAGlenDistribution(UserVar,CtrlVar,MUA,time,s,b,h,S,B,rho,rhow,GF)
%
% Usually A is defined on the nodes (but sometimes in an inverse run A might be
Expand All @@ -96,6 +126,8 @@
end
##### SOURCE END #####
--></body></html>
##### SOURCE END #####
-->
</body>
</html>
Loading

0 comments on commit 547fbe9

Please sign in to comment.