WVTransformBarotropicQG
A transform for modeling single-layer quasigeostrophic flow
Declaration
classdef WVTransformBarotropicQG < WVTransformOverview
This is a two-dimensional, single-layer which may be interpreted as the sea-surface height. The ‘h’ parameter is the equivalent depth, and 0.80 m is a typical value for the first baroclinic mode.
Lxy = 50e3;
Nxy = 256;
latitude = 25;
wvt = WVTransformSingleMode([Lxy, Lxy], [Nxy, Nxy], h=0.8, latitude=latitude);
Topics
- Initialization
WVTransformBarotropicQGcreate geometry for 2D barotropic flow
- Domain attributes
- Spatial grid
- DFT grid
Nk_dftlength of the k-wavenumber dimension on the DFT gridNl_dftlength of the l-wavenumber dimension on the DFT gridconjugateDimensionassumed conjugate dimensionkMode_dftk mode-number on the DFT gridk_dftk wavenumber dimension on the DFT gridlMode_dftl mode-number on the DFT gridl_dftl wavenumber dimension on the DFT grid
- WV grid
Nkllength of the combined kl-wavenumber dimension on the WV griddftConjugateIndexindex into the DFT grid of the conjugate of each WV modedftConjugateIndices2Dindex into the DFT grid of the conjugate of each WV modedftPrimaryIndexindex into the DFT grid of each WV modedftPrimaryIndices2Dindex into the DFT grid of each WV modedkwavenumber spacing of the \(k\) axisdlwavenumber spacing of the \(l\) axiskwavenumber dimension on the WV gridkMode_wvk mode number on the WV gridkRadialradial (k,l) wavenumber on the WV gridklwavenumber dimensionlwavenumber dimension on the WV gridlMode_wvl mode number on the WV gridshouldAntialiaswhether the WV grid includes quadratically aliased wavenumbersshouldExcludeNyquistwhether the WV grid includes Nyquist wavenumbersshouldExludeConjugateswhether the WV grid includes wavenumbers that are Hermitian conjugateswvConjugateIndexindex into the WV mode that matches the dftConjugateIndices
- Initial conditions
- Geostrophic Motions
initWithGeostrophicStreamfunctioninitialize with a geostrophic streamfunctionsetGeostrophicStreamfunctionset a geostrophic streamfunctionaddGeostrophicStreamfunctionadd a geostrophic streamfunction to existing geostrophic motionssetGeostrophicModesset amplitudes of the given geostrophic modesaddGeostrophicModesadd amplitudes of the given geostrophic modesremoveAllGeostrophicMotionsremove all geostrophic motions
- Geostrophic Motions
- Utility function
degreesOfFreedomForComplexMatrixa matrix with the number of degrees-of-freedom at each entrydegreesOfFreedomForRealMatrixa matrix with the number of degrees-of-freedom at each entryindicesOfFourierConjugatesa matrix of linear indices of the conjugateisHermitianCheck if the matrix is Hermitian. Report errors.setConjugateToUnityset the conjugate of the wavenumber (iK,iL) to 1
- Properties
effectiveHorizontalGridResolutionreturns the effective grid resolution in meters
- Primary flow components
geostrophicComponentreturns the geostrophic flow component
- Energetics
geostrophicEnergytotal energy of the geostrophic flowgeostrophicKineticEnergykinetic energy of the geostrophic flowgeostrophicPotentialEnergypotential energy of the geostrophic flow
- Index gymnastics
indexFromKLModeNumberreturn the linear index into k_wv and l_wv from a mode numberindicesFromDFTGridToWVGridindices to convert from DFT to WV gridindicesFromWVGridToDFTGridindices to convert from WV to DFT gridindicesFromWVGridToFFTWGridindices to convert from WV to DFT gridisValidConjugateKLModeNumberreturn a boolean indicating whether (k,l) is a valid conjugate WV mode numberisValidKLModeNumberreturn a boolean indicating whether (k,l) is a valid WV mode numberisValidPrimaryKLModeNumberreturn a boolean indicating whether (k,l) is a valid primary (non-conjugate) WV mode numberklModeNumberFromIndexreturn mode number from a linear index into a WV matrixprimaryKLModeNumberFromKLModeNumbertakes any valid WV mode number and returns the primary mode number
- Masks
maskForAliasedModesreturns a mask with locations of modes that will alias with a quadratic multiplication.maskForConjugateFourierCoefficientsa mask indicate the components that are redundant conjugatesmaskForNyquistModesreturns a mask with locations of modes that are not fully resolved
- Developer
propertyAnnotationsForGeometryreturn array of CAPropertyAnnotations initialized by default
- Operations
- Grid transformation
transformFromDFTGridToWVGridconvert from DFT to WV gridtransformFromWVGridToDFTGridconvert from a WV to DFT grid
- Fourier transformation
transformFromSpatialDomainToDFTGridtransform from \((x,y,z)\) to \((k,l,z)\) on the DFT gridtransformToSpatialDomainFromDFTGridtransform from \((k,l,z)\) on the DFT grid to \((x,y,z)\)transformToSpatialDomainFromDFTGridAtPositiontransform from \((k,l)\) on the DFT grid to \((x,y)\) at any position
- Transformations
transformToKLAxestransforms in the spectral domain from (j,kl) to (kAxis,lAxis,j)transformToRadialWavenumbertransforms in the spectral domain from (j,kl) to (j,kRadial)
- Grid transformation
- Other
A0NA0ZF0FpvJKK2KhLLr2LzNA0NjPA0UA0VA0XYZbetaclassRequiredPropertyNamesdiffXdiffYeffectiveJMaxenstrophyFluxFromF0ffluxForForcingggeometryFromFilegeometryFromGrouphh_0[Nj 1]indexFromModeNumberinertialPeriodjkAxisklGridkljGridlAxislatitudemaxFgmodeNumberFromIndexnamesOfRequiredPropertiesForGeometrynamesOfRequiredPropertiesForRotatingFPlanenamesOfRequiredPropertiesForTransformnamesOfTransformVariablesnewNonrequiredPropertyNamesnewRequiredPropertyNamesplanetaryRadiuspropertyAnnotationsForRotatingFPlaneqgpvFluxFromF0requiredPropertiesForGeometryFromGroupThis guy ignores Nz, because we will just use the defaultrequiredPropertiesForRotatingFPlaneFromGrouprequiredPropertiesForTransformFromGrouprotationRatesetSSHspatialMatrixSizespectralMatrixSizetotalEnstrophytotalEnstrophySpatiallyIntegratedtransformFromGrouptransformFromSpatialDomainWithFouriertransformQGPVToWaveVortextransformToSpatialDomainWithFouriertransformToSpatialDomainWithFourierAtPositionxyGrid