We need auxiliary information for sigma(k) to make the definition generic.
Something like this ... check my math and whther it's < or <=
If k numbers from top to bottom then (left side of diagram attached)
for 1 < k <= Nsigma we have sigma(k) = -k/Nsigma
zlev(k) is undefined
for k > Nsigma then sigma(k) is undefined (_FillValue?)
zlev(k) has valid
entries for Nsigma < k < N
If k numbers bottom to top then (right side of diagram attached)
for 1 < k <= N-Nsigma sigma(k) is undefined
zlev(k) has valid
entries for 1 < k < Nsigma
for k > N - Nsigma we have sigma(k) = (k-N)/Nsigma
zlev(k) is undefined
for k > N-Nsigma
With sigma defined thus as part of the standard, and/or as 1-D vector of
sigma(k) saved in the output file (this is what we do in ROMS to accommodate
multiple alternate stretchings in the"sigma" space for ocean_s_coordinate), and
zlev included in the output as a 1-D vector, then the rule is generic.
This will work for both numbering conventions:
If sigma is defined
z(n,k,j,i) = eta(n,j,i) + sigma(k)*(min(depth_c,depth(j,i))+eta(n,j,i))
If sigma is not defined
z = zlev(k)
I don't know how you write this in CF-speak. But it's a robust way to code a
calculation of z(n,sigma(k),i,j)

--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/cf-convention/cf-conventions/issues/314#issuecomment-790016078
This list forwards relevant notifications from Github. It is distinct from
[email protected], although if you do nothing, a subscription to the
UCAR list will result in a subscription to this list.
To unsubscribe from this list only, send a message to
[email protected].