Step-by-step guide

First, compute geopotential on model levels using the mvl_geopotential_on_ml function. Then divide by g, the standard gravity. Example code:

g = 9.80665
z_ml = mvl_geopotential_on_ml(t, q, lnsp, zs)
z_height = z_ml / g