WVModel
The WVModel is responsible for time-stepping (integrating) the ocean state forward in time, as represented by a WVTransform.
Overview
Assuming you have already initialized a WVTransform, e.g.,
wvt = WVTransformConstantStratification([Lx, Ly, Lz], [Nx, Ny, Nz], N0,latitude=latitude);
and maybe set some initial conditions, you can then initialize the model,
model = WVModel(wvt)
By default the model only takes a linear time-step. To specify a nonlinear flux on initialization, for example,
model = WVModel(wvt,nonlinearFlux=QGPVE(wvt,u_damp=wvt.uvMax));
You can also initialize a model from existing output,
model = WVModel.modelFromFile('SomeFile.nc');
Topics
- Initialization
WVModel
Initialize a model from a WVTransform instancemodelFromFile
Initialize a model from an existing file
- Model Properties
initialTime
Initial model time (seconds)linearDynamics
Indicates whether or not the model is using linear or nonlinear dynamics.nonlinearFluxOperation
The operation responsible for computing the nonlinear flux of the modelt
Current model time (seconds)wvt
The WVTransform instance the represents the ocean state.
- Integration
incrementsWrittenToFile
output index of the current/most recent step.integrateToTime
Time step the model forward to the requested time.outputInterval
Model output interval (seconds)setupIntegrator
Customize the time-steppingtimeOfLastIncrementWrittenToFile
output index of the current/most recent step.
- Particles
addParticles
Add particles to be advected by the flow.drifterPositions
Current positions of the drifter particlesfloatPositions
Returns the positions of the floats at the current time as well as the value of the fields being tracked.particlePositions
Positions and values of tracked fields of particles at the current model time.setDrifterPositions
Set positions of drifter-like particles to be advected.setFloatPositions
Set positions of float-like particles to be advected by the model.
- Tracer
- Writing to NetCDF files
addNetCDFOutputVariables
Add variables to list of variables to be written to the NetCDF variable during the model run.createNetCDFFileForModelOutput
Create a NetCDF file for model outputncfile
Reference to the NetCDFFile being used for model outputnetCDFOutputVariables
List of all StateVariables being written to NetCDF fileremoveNetCDFOutputVariables
Remove variables from the list of variables to be written to the NetCDF variable during the model run.setNetCDFOutputVariables
Set list of variables to be written to the NetCDF variable during the model run.
- Other
closeNetCDFFile
didBlowUp
didInitializeNetCDFFile
didSetupIntegrator
finalIntegrationTime
set only during an integrationinitialConditionOnlyVariables
initialOutputTime
output time corresponding to outputIndex=1 (set on instance initialization)initializeParticleStorage
integrationInformTime
integrationLastInformModelTime
integrationLastInformWallTime
wall clock, to keep track of the expected integration timeintegrationStartTime
integratorType
Array integratornetcdfVariableMapForParticleWithName
map to a map containing the particle variables, e.g. particlesWithName(‘float’) returns a map containing keys (‘x’,’y’,’z’) at minimumopenNetCDFFileForTimeStepping
particle
cell array containing particle structsparticleIndexWithName
map from particle name to cell array indexrecordNetCDFFileHistory
shouldShowIntegrationDiagnostics
showIntegrationFinishDiagnostics
showIntegrationStartDiagnostics
showIntegrationTimeDiagnostics
timeSeriesVariables
tracerArray
tracerIndexWithName
updateParticleTrackedFields
One special thing we have to do is log the particlewriteParticleDataAtTimeIndex
writeTimeStepToNetCDFFile