Energy-Pathways-Group / GLOceanKit

Tools for physical oceanography in Matlab and Objective-C
21 stars 11 forks source link

Fix QGPV tracking on beta-plane #77

Open JeffreyEarly opened 1 year ago

JeffreyEarly commented 1 year ago

@rowedaniel This will add fix the qgpv calculation for the qgpv monopole

if model.nonlinearFluxOperation.beta > 0
    beta = 2 * 7.2921E-5 * cos( wvt.latitude*pi/180. ) / 6.371e6;
    outputVar = WVVariableAnnotation('qgpv',{'x','y','z'},'1/s', 'quasigeostrophic potential vorticity');
    f = @(wvt) -wvt.transformToSpatialDomainWithF( (wvt.Omega .* wvt.Omega ./ (wvt.h * wvt.f)) .*wvt.A0t) + beta*wvt.Y;
    wvt.addOperation(WVOperation('qgpv',outputVar,f),overwriteExisting=1);
end