Skip to content

Commit a17ef67

Browse files
authored
ADD: error when incorrect radius for litho
Check consistency will now reject a model where the Earth radius is not strictly increasing to prevent user errors in the input
1 parent 2f9c9c5 commit a17ef67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/m/classes/materials.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ function disp(self) % {{{
254254
md = checkfield(md,'fieldname','materials.ebm_taul','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
255255
md = checkfield(md,'fieldname','materials.ebm_tauh','Inf',1,'size',[md.materials.numlayers 1],'>=',0);
256256
end
257-
257+
if any(diff(md.materials.radius)<=0)
258+
error('materials checkconsistency error message: radius should be monotonously increasing');
259+
end
258260
for i=1:md.materials.numlayers,
259261
if md.materials.rheologymodel(i)==1 & (isnan(md.materials.burgers_viscosity(i) | isnan(md.materials.burgers_mu(i)))),
260262
error('materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with rheologymodel choice');

0 commit comments

Comments
 (0)