Index: /issm/trunk-jpl/src/m/classes/hydrologyshreve.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26309)
+++ /issm/trunk-jpl/src/m/classes/hydrologyshreve.m	(revision 26310)
@@ -37,5 +37,5 @@
 
 			%Early return
-			if ~ismember('HydrologyShreveAnalysis',analyses) |  (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
+			if ~ismember('HydrologyShreveAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.ishydrology==0), return; end
 
 			md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1);
Index: /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.js
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.js	(revision 26309)
+++ /issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.js	(revision 26310)
@@ -10,10 +10,10 @@
 - We cannot implement the following MATLAB built-in functions by name as their
 names are reserved keywords in JavaScript,
-	class
+    class
 
 TODO:
 - Implement,
-	sort
-	unique
+    sort
+    unique
 
 Sources:
@@ -36,10 +36,10 @@
  */
 function any(A) {//{{{
-	for (let i = 0; i < A.length; ++i) {
-		if (A[i] !== 0) {
-			return true;
-		}
-	}
-	return false;
+    for (let i = 0; i < A.length; ++i) {
+        if (A[i] !== 0) {
+            return true;
+        }
+    }
+    return false;
 } //}}}
 
@@ -61,9 +61,9 @@
  */
 function diff(X) {//{{{
-	let diffs = [];
-	for (let i = 0; i < X.length - 1; ++i) {
-		diffs[i] = X[i + 1] - X[i];
-	}
-	return diffs;
+    let diffs = [];
+    for (let i = 0; i < (X.length - 1); ++i) {
+        diffs[i] = X[i + 1] - X[i];
+    }
+    return diffs;
 } //}}}
 
@@ -82,5 +82,5 @@
  */
 function disp(X) {//{{{
-	console.log(X);
+    console.log(X);
 } //}}}
 
@@ -100,5 +100,5 @@
  */
 function error(msg) {//{{{
-	throw new Error(msg);
+    throw new Error(msg);
 } //}}}
 
@@ -117,25 +117,25 @@
  */
 function find(X, n, direction) {//{{{
-	if (typeof(X[0]) == 'number') {
-		let indices = [];
-		for (let i = 0; i < X.length; ++i) {
-			if (X[i] != 0) {
-				indices.push(i);
-			}
-		}
-		return indices;
-	} else { //TODO: If 2d array, assume return rows & cols - try to find a way to not always return rows/cols
-		let rowindices = [];
-		let colindices = [];
-		for (let i = 0; i < X.length; ++i) {
-			for (let j = 0; j < X[i].length; ++j) {
-				if (X[i][j] != 0) {
-					rowindices.push(i);
-					colindices.push(j);
-				}
-			}
-		}
-		return [rowindices, colindices];
-	}
+    if (typeof(X[0]) == 'number') {
+        let indices = [];
+        for (let i = 0; i < X.length; ++i) {
+            if (X[i] != 0) {
+                indices.push(i);
+            }
+        }
+        return indices;
+    } else { //TODO: If 2d array, assume return rows & cols - try to find a way to not always return rows/cols
+        let rowindices = [];
+        let colindices = [];
+        for (let i = 0; i < X.length; ++i) {
+            for (let j = 0; j < X[i].length; ++j) {
+                if (X[i][j] != 0) {
+                    rowindices.push(i);
+                    colindices.push(j);
+                }
+            }
+        }
+        return [rowindices, colindices];
+    }
 } //}}}
 
@@ -152,10 +152,10 @@
  */
 function isempty(A) {//{{{
-	//NOTE: Expanded for clarity/debugging. Can reduce later.
-	if (A === undefined) {
-		return 1; //TODO: Fix this: for now, treat undefined as empty
-	} else {
-		return A.length == 0;
-	}
+    //NOTE: Expanded for clarity/debugging. Can reduce later.
+    if (A === undefined) {
+        return 1; //TODO: Fix this: for now, treat undefined as empty
+    } else {
+        return A.length == 0;
+    }
 } //}}}
 
@@ -175,21 +175,21 @@
  */
 function ismember(A, B) {//{{{
-	let b = B;
-	if (typeof(B) == 'number' || typeof(B) == 'string') {
-		b = [B];
-	}
-	let indices = zeros(A.length);
-	for (let i = 0; i < A.length; ++i) {
-		for (let j = 0; j < b.length; ++j) {
-			if (A[i] === b[j]) {
-				indices[i] = 1;
-			}
-		}
-	}
-	if (indices.length) {
-		return indices;
-	} else {
-		return 0;
-	}
+    let b = B;
+    if (typeof(B) == 'number' || typeof(B) == 'string') {
+        b = [B];
+    }
+    let indices = zeros(A.length);
+    for (let i = 0; i < A.length; ++i) {
+        for (let j = 0; j < b.length; ++j) {
+            if (A[i] === b[j]) {
+                indices[i] = 1;
+            }
+        }
+    }
+    if (indices.length) {
+        return indices;
+    } else {
+        return 0;
+    }
 } //}}}
 
@@ -211,16 +211,16 @@
  */
 function isnan(A) {//{{{
-	if (A.constructor !== Array) {
-		error('isnan: argument must be an array')
-	}
-	is_nan = [];
-	for (let i = 0; i < A.length; ++i) {
-		if (Number.isNaN(A[i])) {
-			is_nan.push(1);
-		} else {
-			is_nan.push(0);
-		}
-	}
-	return is_nan;
+    if (A.constructor !== Array) {
+        error('isnan: argument must be an array')
+    }
+    is_nan = [];
+    for (let i = 0; i < A.length; ++i) {
+        if (Number.isNaN(A[i])) {
+            is_nan.push(1);
+        } else {
+            is_nan.push(0);
+        }
+    }
+    return is_nan;
 } //}}}/*
 
@@ -240,5 +240,5 @@
  */
 function length(A) {//{{{
-	return A.length;
+    return A.length;
 } //}}}/*
 
@@ -259,5 +259,5 @@
  */
 function max(A) {//{{{
-	return Math.max.apply(null, A);
+    return Math.max.apply(null, A);
 } //}}}/*
 
@@ -278,42 +278,44 @@
  */
 function min(A) {//{{{
-	return Math.min.apply(null, A);
+    return Math.min.apply(null, A);
 } //}}}/*
 
 /**
- * FUNCTION sum - Sum of elements of an array
- *
- * Replicates behavior of MATLAB's 'sum' function
- *
- * Usage:
- *     S = sum(A)
- *
- * Sources:
- * - https://www.mathworks.com/help/matlab/ref/sum.html
- *
- * TODO:
- * - Implement support for multidimensional arrays
- * - Implement 'nanflag' parameter
- */
-function sum(A) {//{{{
-	return ArraySum(A);
-} //}}}/*
-
-/**
  * FUNCTION ones - Create array of all ones
  *
- * Replicates behavior of MATLAB's 'ones' function
+ * Replicates behavior of MATLAB's 'zeros' function
+ * 
+ * Usage:
+ *     X = ones
+ *     X = ones(n)
+ *     X = ones(sz1,...,szN)
+ *     X = ones(sz)
  *
  * Sources:
  * - https://www.mathworks.com/help/matlab/ref/ones.html
  *
- * NOTE:
- * - Current behavior is to initialize and return a 1D array of length 'size'
- *
- * TODO:
- * - Implement actual behavior of MATLAB's 'ones' function
- */
-function ones(size) {//{{{
-	return NewArrayFill(size, 1);
+ * TODO:
+ * - Create lower-level function to handle both ones and zeros functions as 
+ * they are essentially the same
+ * - Implement functionality for more than 2 dimensions
+ */
+function ones() {//{{{
+    nargs = arguments.length;
+    if (nargs == 0) {
+        return 1;
+    } else if (nargs == 1) {
+        let arg = arguments[0];
+        if (typeof(arg) == 'number') {
+            return NewArrayFill(arg, 1);
+        } else if (arg.constructor == Array) {
+            return ones(...arg); // spread array of sizes
+        } else {
+            error('ones: functionality for greater than 2 dimensions is not currently implemented')
+        }
+    } else if (nargs == 2) {
+        return NewArrayFill2D(arguments[0], arguments[1], 1);
+    } else {
+        error('ones: functionality for greater than 2 dimensions is not currently implemented')
+    }
 } //}}}
 
@@ -337,43 +339,43 @@
  */
 function size(A, dim) {//{{{
-	let nargs = arguments.length;
-	if (nargs == 0) {
-		error('size: at least one argument is required');
-	} else if (nargs == 1) {
-		if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
-			return [1, 1];
-		} else if (A.constructor != Array) {
-			error('size: A argument must be a number or an Array');
-		}
-		if (typeof(A) == 'undefined' || isNaN(A)) {
-			return [0];
-		} else if (A.length && A[0].constructor == Array) {
-			return [A.length, A[0].length];
-		} else {
-			return [A.length];
-		}
-	} else if (nargs == 2) {
-		if (typeof(dim) != 'number' || dim < 0 || dim > 1) {
-			error('size: dim argument must be a number between 0 and 1, inclusive');
-		}
-		if (dim == 0) {
-			if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
-				return 1;
-			} else {
-				return A.length;
-			}
-		} else {
-			if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
-				return 1;
-			} else if (typeof(A) == 'undefined' || isNaN(A)) {
-				return 0;
-			} else if (A[0].constructor != Array) {
-				error('size: A[0] is not an Array');
-			}
-			return A[0].length;
-		}
-	} else {
-		error('size: functionality for more than 2 arguments is not currently implemented');
-	}
+    let nargs = arguments.length;
+    if (nargs == 0) {
+        error('size: at least one argument is required');
+    } else if (nargs == 1) {
+        if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+            return [1, 1];
+        } else if (A.constructor != Array) {
+            error('size: A argument must be a number or an Array');
+        }
+        if (typeof(A) == 'undefined' || isNaN(A)) {
+            return [0];
+        } else if (A.length && A[0].constructor == Array) {
+            return [A.length, A[0].length];
+        } else {
+            return [A.length];
+        }
+    } else if (nargs == 2) {
+        if (typeof(dim) != 'number' || dim < 0 || dim > 1) {
+            error('size: dim argument must be a number between 0 and 1, inclusive');
+        }
+        if (dim == 0) {
+            if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+                return 1;
+            } else {
+                return A.length;
+            }
+        } else {
+            if (typeof(A) == 'number') { // scalar numbers are of size [1, 1]
+                return 1;
+            } else if (typeof(A) == 'undefined' || isNaN(A)) {
+                return 0;
+            } else if (A[0].constructor != Array) {
+                error('size: A[0] is not an Array');
+            }
+            return A[0].length;
+        }
+    } else {
+        error('size: functionality for more than 2 arguments is not currently implemented');
+    }
 } //}}}
 
@@ -387,48 +389,178 @@
  */
 function strcmpi(s1, s2) {//{{{
-	return s1.toLowerCase() == s2.toLowerCase();
-} //}}}
-
-/**
- * FUNCTION sum - Sum of array elements
+    return s1.toLowerCase() == s2.toLowerCase();
+} //}}}
+
+/**
+ * FUNCTION sum - Sum of elements of an array
  *
  * Replicates behavior of MATLAB's 'sum' function
+ *
+ * Usage:
+ *     S = sum(A)
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/ref/sum.html
+ *
+ * TODO:
+ * - Implement support for multidimensional arrays
+ * - Implement 'nanflag' parameter
+ */
+function sum(A) {//{{{
+    return ArraySum(A);
+} //}}}
+
+/**
+ * FUNCTION zeros - Create array of all zeros
+ *
+ * Replicates behavior of MATLAB's 'zeros' function
  * 
- * Sum(A) returns the sum of the elements of A along the first array dimension 
- * whose size does not equal 1.
- * - If A is a 1D array, then sum(A) returns the sum of the elements
- *
- * Usage:
- *     S = sum(A)
- * 
- * Sources:
- * - https://www.mathworks.com/help/matlab/ref/sum.html
- *
- * NOTE:
- * - Not all functionality is implemented
- */
-function sum(A) {//{{{
-	return A.reduce((x, y) => x + y);
-} //}}}
-
-/**
- * FUNCTION zeros - Create array of all zeros
- *
- * Replicates behavior of MATLAB's 'zeros' function
+ * Usage:
+ *     X = zeros
+ *     X = zeros(n)
+ *     X = zeros(sz1,...,szN)
+ *     X = zeros(sz)
  *
  * Sources:
  * - https://www.mathworks.com/help/matlab/ref/zeros.html
  *
- * NOTE:
- * - Current behavior is to initialize and return a 1D array of length 'size'
- *
- * TODO:
- * - Implement actual behavior of MATLAB's 'ones' function
- */
-function zeros(size, size2) {//{{{
-	if (size2 !== undefined) {
-		return NewArrayFill2D(size, size2, 0);
-	} else {
-		return NewArrayFill(size, 0);
-	}
-} //}}}
+ * TODO:
+ * - Create lower-level function to handle both ones and zeros functions as 
+ * they are essentially the same
+ * - Implement functionality for more than 2 dimensions
+ */
+function zeros() {//{{{
+    nargs = arguments.length;
+    if (nargs == 0) {
+        return 0;
+    } else if (nargs == 1) {
+        let arg = arguments[0];
+        if (typeof(arg) == 'number') {
+            return NewArrayFill(arg, 0);
+        } else if (arg.constructor == Array) {
+            return zeros(...arg); // spread array of sizes
+        } else {
+            error('zeros: functionality for greater than 2 dimensions is not currently implemented')
+        }
+    } else if (nargs == 2) {
+        return NewArrayFill2D(arguments[0], arguments[1], 0);
+    } else {
+        error('zeros: functionality for greater than 2 dimensions is not currently implemented')
+    }
+} //}}}
+
+/**
+ * FUNCTIONS sin, cos, tan, asin, acos, atan2 - trig functions that work with radians
+ *
+ * Replicates behavior of MATLAB's trig functions
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/trigonometry.html
+ *
+ */
+function sin(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.sin(X[i]);
+    }
+    return result;
+} //}}}
+
+function cos(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.cos(X[i]);
+    }
+    return result;
+} //}}}
+
+function tan(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.tan(X[i]);
+    }
+    return result;
+} //}}}
+
+function asin(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.asin(X[i]);
+    }
+    return result;
+} //}}}
+
+function acos(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.acos(X[i]);
+    }
+    return result;
+} //}}}
+
+// TODO: Test that the arguments do not need to be reversed, as they are in MATLAB and Python
+function atan2(X, Y) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.atan2(X[i], Y[i]);
+    }
+    return result;
+} //}}}
+
+/**
+ * FUNCTIONS sind, cosd, tand, asind, acosd, atan2d - trig functions that work with degrees
+ *
+ * Replicates behavior of MATLAB's trig functions
+ *
+ * Sources:
+ * - https://www.mathworks.com/help/matlab/trigonometry.html
+ *
+ */
+function sind(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.sin(X[i] * DEG2RAD);
+    }
+    return result;
+} //}}}
+
+function cosd(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.cos(X[i] * DEG2RAD);
+    }
+    return result;
+} //}}}
+
+function tand(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = Math.tan(X[i] * DEG2RAD);
+    }
+    return result;
+} //}}}
+
+function asind(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = RAD2DEG * Math.asin(X[i]);
+    }
+    return result;
+} //}}}
+
+function acosd(X) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = RAD2DEG * Math.acos(X[i]);
+    }
+    return result;
+} //}}}
+
+// TODO: Test that the arguments do not need to be reversed, as they are in MATLAB and Python
+function atan2d(X, Y) {//{{{
+    let result = NewArrayFill(size, X.length);
+    for (let i = 0; i < X.length; ++i) {
+        result[i] = RAD2DEG * Math.atan2(X[i], Y[i]);
+    }
+    return result;
+} //}}}
