Closed navidcy closed 8 months ago
Turns out the current implementation for constructing zi
precludes the surface zi = 0
. E.g.,
>>> import numpy as np
>>> thicknesses = np.array([10, 20, 30])
>>> thicknesses
array([10, 20, 30])
>>> np.cumsum(thicknesses)
array([10, 30, 60])
See also https://github.com/COSIMA/regional-mom6/pull/106#issuecomment-1956101121
I don't understand why we use
self.vlayers + 1
as input in thedz_hyperbolictan
here:https://github.com/COSIMA/regional-mom6/blob/3e9844286db015e17940bbbacc2c35f7ddc82e23/regional_mom6/regional_mom6.py#L705-L713
The
dz_hyperbolictan
method actually spits out the layer thicknesses, thus it will spit out an array of lengthself.vlayers
if we provideself.vlayers
as its first argument. Why do we give+1
?I think the code in the above-mentioned lines should be replaced with:
According to what I suggest,
thicknesses
is an array of sizeself.vlayers
. Thenzi
are the interfaces height and is an array of sizeself.vlayers + 1
. Last,zl
, are the heights of the midpoints of each layer and is an array of sizeself.vlayers
.