WVTransformBarotropicQG
Represent two-dimensional equivalent-barotropic quasigeostrophic flow.
Declaration
classdef WVTransformBarotropicQG < WVTransformOverview
This is a two-dimensional, single-layer transform. The h parameter
is the equivalent depth; 0.80 m is a representative first-baroclinic
value. The transform stores its state in A0 and has no wave Ap or
Am content.
Lxy = 50e3;
Nxy = 256;
latitude = 25;
wvt = WVTransformBarotropicQG([Lxy,Lxy],[Nxy,Nxy],h=0.8,latitude=latitude);
The quasigeostrophic state is stored in
A0, with current-time view
A0t. This transform has no active Ap, Am, Apt, or Amt content.
Topics
- Create and restore a transform
WVTransformBarotropicQGCreate an equivalent-barotropic quasigeostrophic transform.waveVortexTransformFromFileRestore a WVTransformBarotropicQG instance from an existing file
- Inspect the domain
- Physical environment
- Planetary rotation
betaMeridional gradient of the Coriolis parameter.fCoriolis parameter in radians per second.inertialPeriodInertial period in seconds.latitudeCentral latitude of the rotating domain in degrees north.planetaryRadiusRadius of the rotating planetary body in meters.rotationRatePlanetary rotation rate in radians per second.
- Gravity
gGravitational acceleration in meters per second squared.
- Planetary rotation
- Spatial grid
- Coordinate axes
- Coordinate arrays
- Domain dimensions
- Resolution and shape
NxNumber of spatial grid points in the x direction.NyNumber of spatial grid points in the y direction.spatialMatrixSizeShape of a gridded physical-space field.
- Spectral grid
- Compact grid vectors
- Compact grid arrays
- Wavenumber spacing
- Horizontal wavenumber geometry
- Resolution and shape
NklNumber of retained compact horizontal-wavenumber columns.spectralMatrixSizeShape of a wave-vortex coefficient array.effectiveHorizontalGridResolutionreturns the effective grid resolution in meterssummarizeDegreesOfFreedomSummarize the spatial grid and active spectral degrees of freedom.
- Equivalent depth and deformation scale
- Transform configuration
isHydrostaticWhether the transform uses the hydrostatic approximation.shouldAntialiasWhether the spectral grid excludes modes that alias quadratic products.
- Physical environment
- Initialize the flow
- General initialization
addRandomFlowadd randomized flow to the existing stateinitFromNetCDFFileinitialize the flow from a NetCDF fileinitWithRandomFlowinitialize with a random flow stateremoveAllremoves all energy from the model
- 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 motionssetSSHSet a barotropic geostrophic state from sea-surface height.
- General initialization
- Evaluate physical fields
- Registered variables
hasVariableWithNameTest whether state variables are registered by name.summarizeVariablesPrint a table of registered state variables and cache status.variableNamesReturn the names of all registered state variables.variableWithNameCompute or retrieve one or more registered transform variables.
- On the model grid
- Velocity
- Pressure and surface fields
- Vorticity and geostrophic fields
- At arbitrary positions
variableAtPositionWithNameAccess dynamical variables at arbitrary positions in the domain.
- Registered variables
- Manage forcing and closures
- Configure forcing
addForcingAdd forcing or closure objects to this transform.setForcingReplace the complete forcing registry.removeForcingRemove the exact registered forcing objects.removeAllForcingRemove every forcing and closure from this transform.
- Inspect forcing and closures
forcingarray of WVForcing objectsforcingNamesReturn forcing and closure names in application order.forcingWithNameReturn registered forcing objects by name.hasForcingWithNameTest whether forcing objects are registered by name.hasClosureWhether a closure is currently attached to the transform.
- Summarize forcing
summarizeForcingPrint a table of registered forcing and closure objects.
- Configure forcing
- Analyze the flow
- Flow diagnostics
hasMeanPressureDifferenceDiagnose an MDA mean-pressure difference between the boundaries.uvMaxmax horizontal fluid speed
- Potential vorticity and enstrophy
totalEnstrophyPotential enstrophy computed from geostrophic coefficients.totalEnstrophySpatiallyIntegratedPotential enstrophy evaluated from the gridded QGPV field.
- Spectra
- Spectral fields
kAxisCenteredNx-by-1 x-wavenumber axis in \(\mathrm{rad\,m^{-1}}\).lAxisCenteredNy-by-1 y-wavenumber axis in \(\mathrm{rad\,m^{-1}}\).transformToKLAxestransforms in the spectral domain from (j,kl) to (kAxis,lAxis,j)
- Radial wavenumber
kRadialradial (k,l) wavenumber on the WV gridtransformToRadialWavenumbertransforms in the spectral domain from (j,kl) to (j,kRadial)
- Spectral fields
- Flow diagnostics
- Analyze energy
- Component energy
geostrophicKineticEnergykinetic energy of the geostrophic flowgeostrophicPotentialEnergypotential energy of the geostrophic flowgeostrophicEnergytotal energy, geostrophictotalEnergyOfFlowComponentCompute the energy carried by one flow component.
- Total energy
totalEnergyTotal energy computed from wave-vortex coefficients.totalEnergySpatiallyIntegratedTotal energy computed from physical-space fields.
- Energy summaries
summarizeEnergyContentdisplays a summary of the energy content of the fluidsummarizeModeEnergyList the most energetic modes
- Component energy
- Save transform state
writeToFileWrite this instance to NetCDF file.
- Convert representations
- Physical fields and coefficients
transformQGPVToWaveVortexProject quasigeostrophic potential vorticity ontoA0coefficients.
- Physical fields and coefficients
- Differentiate and integrate fields
- Inspect flow components
- Primary flow components
geostrophicComponentreturns the geostrophic flow componentprimaryFlowComponentsPrimary flow components that partition the active coefficient state.primaryFlowComponentNamesretrieve the names of all available variablesprimaryFlowComponentWithNameretrieve a WVPrimaryFlowComponent by name
- Registered and combined components
flowComponentsAll registered physical and diagnostic flow components.flowComponentNamesretrieve the names of all available variablesflowComponentWithNameretrieve a WVFlowComponent by nametotalFlowComponentCombined view of all primary flow components.
- Summarize flow components
summarizeFlowComponentsPrint a table of registered primary and diagnostic components.
- Primary flow components
- Inspect wave-vortex coefficients
- Create a related transform
spectralVariableWithResolutioncreate a new variable with different resolutionwaveVortexTransformWithDoubleResolutioncreate a new WVTransform with double resolutionwaveVortexTransformWithResolutionCreate the same transform family at a new resolution.
- Extend a transform
- Flow components
addFlowComponentadd a flow component and its standard variablesaddPrimaryFlowComponentadd a primary flow component, automatically added to the flow
- Operations and variables
addOperationRegister one or more operations and their output variables.operationWithNameretrieve a WVOperation by nameremoveOperationRemove the exact registered operation and its cached outputs.
- Flow components
- Get package information
versionInstalled WaveVortexModel version.
Developer Topics
These items document internal implementation details and are not part of the primary public API.
- Projection and reconstruction coefficients
A0NProjects density displacement onto \(A_0\).A0UProjects \(u\) onto \(A_0\).A0VProjects \(v\) onto \(A_0\).A0ZProjects vertical vorticity onto \(A_0\).NA0Reconstructs density displacement from \(A_0\).PA0Reconstructs pressure height from \(A_0\).UA0Reconstructs \(u\) from \(A_0\).VA0Reconstructs \(v\) from \(A_0\).
- Geometry and mode indexing
- Mode numbers and validity
isValidConjugateKLModeNumberreturn a boolean indicating whether (k,l) is a valid conjugate WV mode numberisValidConjugateModeNumberisValidKLModeNumberreturn a boolean indicating whether (k,l) is a valid WV mode numberisValidModeNumberisValidPrimaryKLModeNumberreturn a boolean indicating whether (k,l) is a valid primary (non-conjugate) WV mode numberisValidPrimaryModeNumberkMode_dftk mode-number on the DFT gridkMode_wvk mode number on the WV gridlMode_dftl mode-number on the DFT gridlMode_wvl mode number on the WV gridprimaryKLModeNumberFromKLModeNumbertakes any valid WV mode number and returns the primary mode number
- Linear-index conversion
indexFromKLModeNumberreturn the linear index into k_wv and l_wv from a mode numberindexFromModeNumberklModeNumberFromIndexreturn mode number from a linear index into a WV matrixmodeNumberFromIndex
- DFT and WV layout metadata
Nk_dftlength of the k-wavenumber dimension on the DFT gridNl_dftlength of the l-wavenumber dimension on the DFT gridconjugateDimensionassumed conjugate dimensiondftConjugateIndices2Dindex into the DFT grid of the conjugate of each WV modedftPrimaryIndices2Dindex into the DFT grid of each WV modeindicesOfFourierConjugatesa matrix of linear indices of the conjugatek_dftk wavenumber dimension on the DFT gridklwavenumber dimensionl_dftl wavenumber dimension on the DFT gridshouldExcludeConjugateswhether the WV grid excludes redundant Hermitian-conjugate wavenumbersshouldExcludeNyquistwhether the WV grid includes Nyquist wavenumbers
- Layout conversion
indicesFromDFTGridToWVGridindices to convert from DFT to WV gridindicesFromWVGridToDFTGridindices to convert from WV to DFT gridtransformFromDFTGridToWVGridconvert from DFT to WV gridtransformFromSpatialDomainToDFTGridtransform from \((x,y,z)\) to \((k,l,z)\) on the DFT gridtransformFromWVGridToDFTGridconvert from a WV to 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
- Masks and Hermitian bookkeeping
isHermitianCheck if the matrix is Hermitian. Report errors.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 resolvedsetConjugateToUnityset the conjugate of the wavenumber (iK,iL) to 1
- Mode numbers and validity
- Spectral transforms and operators
degreesOfFreedomForComplexMatrixa matrix with the number of degrees-of-freedom at each entrydegreesOfFreedomForRealMatrixa matrix with the number of degrees-of-freedom at each entryfastTransformfast transform objecttransformFromSpatialDomainWithFouriertransformToSpatialDomainWithFouriertransformToSpatialDomainWithFourierAtPosition
- Nonlinear flux and forcing internals
- Persistence internals
classRequiredPropertyNamesgeometryFromGroupnamesOfRequiredPropertiesForGeometrynamesOfRequiredPropertiesForRotatingFPlanenamesOfRequiredPropertiesForTransformnamesOfTransformVariablesnewNonrequiredPropertyNamesnewRequiredPropertyNamesrequiredPropertiesForGeometryFromGroupThis guy ignores Nz, because we will just use the defaultrequiredPropertiesForRotatingFPlaneFromGrouprequiredPropertiesForTransformFromGrouptransformFromGroup
- Caches and registries
propertyAnnotationsForGeometryreturn array of CAPropertyAnnotations initialized by defaultpropertyAnnotationsForRotatingFPlane
- Class internals