
Regarding instability calculations (in MKS units), in sqgm code, in
order to make dimensional calculation, between max wavelength L0 and
min wavelength Lmin = L0/nwaves, where basin depth is H0, *average*
density difference between layers is delrho and average density of fluid
is rho0, central latitude is phi (in degrees), dz is a vector of
layer thicknesses, rho is vector of potential densities at center of
each layer, u and v are zonal and meridional velocity profiles at centers
of layers:

>> [Fd,gammad] = ndparams(2*pi,H0,1,phi,delrho/rho0);
>> betad = Fd*gammad;
>> kvecd = linspace(0,2*pi/(L0/nwaves),nwaves+1);
>> grd = qggr(dz,rho,u,v,Fd,betad,0,0,0,kvecd,0);

For wavenumbers of deformation:

>> kdd = vmodes(dz,rho,Fd);

Equivalently, do the nondim calculation as

>> [F,gamma] = ndparams(L0,H0,U0,phi,delrho/rho0);
>> beta = F*gamma;
>> kvec = 0:99;
>> gr = qggr(dz,rho,u/U0,v/U0,F,beta,0,0,0,kvec,0);

and you should find that

>> max(grd)

and

>> max(gr)*2*pi*U0/L0

give the same number.  Also, of course

>> kd = vmodes(dz,rho,F);
>> kd*2*pi/L0

gives the same answer as kdd above.